1 diff -urB wine/dlls/kernel32/heap.c wine/dlls/kernel32/heap.c
2 --- wine/dlls/kernel32/heap.c 2011-12-16 19:15:33.000000000 +0000
3 +++ wine/dlls/kernel32/heap.c 2011-12-19 17:08:41.686061500 +0000
6 /* values are limited to 2Gb unless the app has the IMAGE_FILE_LARGE_ADDRESS_AWARE flag */
7 /* page file sizes are not limited (Adobe Illustrator 8 depends on this) */
9 if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE))
11 if (lpBuffer->dwTotalPhys > MAXLONG) lpBuffer->dwTotalPhys = MAXLONG;
13 if (lpBuffer->dwTotalVirtual > MAXLONG) lpBuffer->dwTotalVirtual = MAXLONG;
14 if (lpBuffer->dwAvailVirtual > MAXLONG) lpBuffer->dwAvailVirtual = MAXLONG;
18 /* work around for broken photoshop 4 installer */
19 if ( lpBuffer->dwAvailPhys + lpBuffer->dwAvailPageFile >= 2U*1024*1024*1024)
20 diff -urB wine/dlls/ntdll/loader.c wine/dlls/ntdll/loader.c
21 --- wine/dlls/ntdll/loader.c 2011-12-16 19:15:33.000000000 +0000
22 +++ wine/dlls/ntdll/loader.c 2011-12-19 17:04:12.512726601 +0000
24 status = wine_call_on_stack( attach_process_wine/dlls, wm, NtCurrentTeb()->Tib.StackBase );
25 if (status != STATUS_SUCCESS) goto error;
27 - virtual_release_address_space( nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE );
28 + //virtual_release_address_space( nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE );
29 + virtual_release_address_space( IMAGE_FILE_LARGE_ADDRESS_AWARE );
30 virtual_clear_thread_stack();
31 wine_switch_to_stack( start_process, kernel_start, NtCurrentTeb()->Tib.StackBase );
33 diff -urB wine/dlls/wined3d/directx.c wine/dlls/wined3d/directx.c
34 --- wine/dlls/wined3d/directx.c
35 +++ wine/dlls/wined3d/directx.c
36 @@ -4673,8 +4673,13 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
37 caps->MaxUserClipPlanes = gl_info->limits.clipplanes;
38 caps->MaxActiveLights = gl_info->limits.lights;
40 - caps->MaxVertexBlendMatrices = gl_info->limits.blends;
41 - caps->MaxVertexBlendMatrixIndex = 0;
42 + if (gl_info->supported[ARB_VERTEX_BLEND]) {
43 + caps->MaxVertexBlendMatrices = gl_info->limits.blends;
44 + caps->MaxVertexBlendMatrixIndex = 0;
46 + caps->MaxVertexBlendMatrices = 4;
47 + caps->MaxVertexBlendMatrixIndex = 255;
50 caps->MaxAnisotropy = gl_info->limits.anisotropy;
51 caps->MaxPointSize = gl_info->limits.pointsize_max;
52 diff -urB wine/dlls/wined3d/drawprim.c wine/dlls/wined3d/drawprim.c
53 --- wine/dlls/wined3d/drawprim.c
54 +++ wine/dlls/wined3d/drawprim.c
55 @@ -60,6 +60,75 @@ static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primit
59 + * Emit a vertex using swoftware vertex blending
61 +static void emitBlendedVertex(struct wined3d_stateblock *stateBlock,
62 + const float *weights, int nweights, const BYTE *indices,
63 + const float *pos, const float *norm)
71 + /* compute the weighted sum of the matrices */
72 + m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[0] : 0))].u.m[0][0];
73 + for (j = 0; j < 16; j++)
74 + mat[j] = m[j] * weights[0];
77 + for (i = 1; i < nweights; i++) {
79 + m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[i] : i))].u.m[0][0];
80 + for (j = 0; j < 16; j++)
81 + mat[j] += m[j] * weights[i];
88 + m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[i] : i))].u.m[0][0];
89 + for (j = 0; j < 16; j++)
90 + mat[j] += m[j] * last;
94 + /* compute the resulting normal */
95 + vec[0] = norm[0] * mat[0] + norm[1] * mat[4] + norm[2] * mat[8];
96 + vec[1] = norm[0] * mat[1] + norm[1] * mat[5] + norm[2] * mat[9];
97 + vec[2] = norm[0] * mat[2] + norm[1] * mat[6] + norm[2] * mat[10];
99 + vec[3] = vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2];
101 + vec[3] = 1.f / sqrtf(vec[3]);
111 + /* compute the resulting position */
112 + vec[0] = pos[0] * mat[0] + pos[1] * mat[4] + pos[2] * mat[8] + mat[12];
113 + vec[1] = pos[0] * mat[1] + pos[1] * mat[5] + pos[2] * mat[9] + mat[13];
114 + vec[2] = pos[0] * mat[2] + pos[1] * mat[6] + pos[2] * mat[10] + mat[14];
115 + vec[3] = pos[0] * mat[3] + pos[1] * mat[7] + pos[2] * mat[11] + mat[15];
128 * Actually draw using the supplied information.
129 * Slower GL version which extracts info about each vertex in turn
131 @@ -78,7 +147,8 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi
132 BOOL pixelShader = use_ps(state);
133 BOOL specular_fog = FALSE;
134 const BYTE *texCoords[WINED3DDP_MAXTEXCOORD];
135 - const BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL;
136 + const BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL, *weights = NULL, *indices = NULL;
138 const struct wined3d_gl_info *gl_info = context->gl_info;
139 UINT texture_stages = gl_info->limits.texture_stages;
140 const struct wined3d_stream_info_element *element;
141 @@ -171,6 +241,31 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi
142 GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0);
145 + if (device->vertexBlendSW) {
146 + if (!si->elements[WINED3D_FFP_BLENDWEIGHT].data.addr) {
147 + WARN("vertex blending enabled but blendWeights.data=NULL\n");
148 + } else if (si->elements[WINED3D_FFP_BLENDWEIGHT].format->gl_vtx_type != GL_FLOAT) {
149 + FIXME("unsupported blend weights datatype (%d)\n", si->elements[WINED3D_FFP_BLENDWEIGHT].format->id);
150 + } else if (position && si->elements[WINED3D_FFP_POSITION].format->emit_idx != WINED3D_FFP_EMIT_FLOAT3) {
151 + FIXME("unsupported postion datatype (%d)\n", si->elements[WINED3D_FFP_POSITION].format->id);
152 + } else if (normal && si->elements[WINED3D_FFP_NORMAL].format->emit_idx != WINED3D_FFP_EMIT_FLOAT3) {
153 + FIXME("unsupported normal datatype (%d)\n", si->elements[WINED3D_FFP_NORMAL].format->id);
155 + element = &si->elements[WINED3D_FFP_BLENDWEIGHT];
156 + weights = element->data.addr;
157 + nweights = element->format->gl_vtx_format;
160 + if (si->elements[WINED3D_FFP_BLENDINDICES].data.addr) {
161 + if (si->elements[WINED3D_FFP_BLENDINDICES].format->emit_idx != WINED3D_FFP_EMIT_UBYTE4) {
162 + FIXME("unsupported blend indices datatype (%d)\n", si->elements[WINED3D_FFP_BLENDINDICES].format->id);
164 + element = &si->elements[WINED3D_FFP_BLENDINDICES];
165 + indices = element->data.addr;
170 for (textureNo = 0; textureNo < texture_stages; ++textureNo)
172 int coordIdx = state->texture_states[textureNo][WINED3DTSS_TEXCOORDINDEX];
173 @@ -287,17 +382,25 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi
177 - /* Normal -------------------------------- */
179 + emitBlendedVertex(device->stateBlock,
180 + (const float*)(weights + SkipnStrides * si->elements[WINED3D_FFP_BLENDWEIGHT].stride), nweights,
181 + indices ? (indices + SkipnStrides * si->elements[WINED3D_FFP_BLENDINDICES].stride) : NULL,
182 + (const float*)(position ? (position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride) : NULL),
183 + (const float*)(normal ? (normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride) : NULL));
185 + /* Normal -------------------------------- */
188 - const void *ptrToCoords = normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride;
189 + const void *ptrToCoords = normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride;
190 normal_funcs[si->elements[WINED3D_FFP_NORMAL].format->emit_idx](ptrToCoords);
194 - /* Position -------------------------------- */
196 - const void *ptrToCoords = position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride;
197 + /* Position -------------------------------- */
199 + const void *ptrToCoords = position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride;
200 position_funcs[si->elements[WINED3D_FFP_POSITION].format->emit_idx](ptrToCoords);
204 /* For non indexed mode, step onto next parts */
205 @@ -696,6 +799,17 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
209 + else if (device->vertexBlendSW)
211 + static BOOL warned;
213 + FIXME("Using software emulation because vertex blending is enabled\n");
216 + TRACE("Using software emulation because vertex blending is enabled\n");
222 stream_info = &stridedlcl;
223 diff -urB wine/dlls/wined3d/state.c wine/dlls/wined3d/state.c
224 --- wine/dlls/wined3d/state.c
225 +++ wine/dlls/wined3d/state.c
226 @@ -3662,7 +3662,7 @@ static void transform_world(struct wined3d_context *context, const struct wined3
228 checkGLcall("glLoadIdentity()");
231 + else if (!context->swapchain->device->vertexBlendSW)
233 /* In the general case, the view matrix is the identity matrix */
234 if (context->swapchain->device->view_ident)
235 @@ -3677,6 +3677,9 @@ static void transform_world(struct wined3d_context *context, const struct wined3
236 glMultMatrixf(&state->transforms[WINED3DTS_WORLDMATRIX(0)].u.m[0][0]);
237 checkGLcall("glMultMatrixf");
240 + glLoadMatrixf(&state->transforms[WINED3DTS_VIEW].u.m[0][0]);
241 + checkGLcall("glLoadMatrixf");
245 @@ -3812,11 +3812,30 @@ static void state_vertexblend_w(struct wined3d_context *context, const struct wi
246 enum wined3d_vertex_blend_flags f = state->render_states[WINED3D_RS_VERTEXBLEND];
247 static unsigned int once;
249 - if (f == WINED3D_VBF_DISABLE)
252 - if (!once++) FIXME("Vertex blend flags %#x not supported.\n", f);
253 - else WARN("Vertex blend flags %#x not supported.\n", f);
255 + case WINED3D_VBF_0WEIGHTS:
256 + case WINED3D_VBF_1WEIGHTS:
257 + case WINED3D_VBF_2WEIGHTS:
258 + case WINED3D_VBF_3WEIGHTS:
261 + FIXME("Vertex blending enabled, but not supported by hardware. Using software emulation.\n");
263 + if (!context->swapchain->device->vertexBlendSW) {
264 + context->swapchain->device->vertexBlendSW = TRUE;
265 + transform_world(context, state, state_id);
268 + case WINED3D_VBF_TWEENING:
269 + WARN("Vertex blend flags %#x not supported.\n", f);
272 + if (context->swapchain->device->vertexBlendSW) {
273 + context->swapchain->device->vertexBlendSW = FALSE;
274 + transform_world(context, state, state_id);
280 static void state_vertexblend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
281 diff -urB wine/dlls/wined3d/vertexdeclaration.c wine/dlls/wined3d/vertexdeclaration.c
282 --- wine/dlls/wined3d/vertexdeclaration.c
283 +++ wine/dlls/wined3d/vertexdeclaration.c
284 @@ -107,6 +107,15 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
288 + case WINED3DDECLUSAGE_BLENDINDICES:
289 + switch(element->format)
291 + case WINED3DFMT_R8G8B8A8_UINT:
297 case WINED3DDECLUSAGE_NORMAL:
298 switch(element->format)
300 diff -urB wine/dlls/wined3d/wined3d_private.h wine/dlls/wined3d/wined3d_private.h
301 --- wine/dlls/wined3d/wined3d_private.h
302 +++ wine/dlls/wined3d/wined3d_private.h
303 @@ -1672,6 +1672,7 @@ struct wined3d_device
305 WORD view_ident : 1; /* true iff view matrix is identity */
306 WORD vertexBlendUsed : 1; /* To avoid needless setting of the blend matrices */
307 + WORD vertexBlendSW : 1; /* vertexBlend software fallback used */
308 WORD isRecordingState : 1;
310 WORD bCursorVisible : 1;