diff --git a/patches/wined3d-Indexed_Vertex_Blending/0001-d3d9-tests-Add-test-for-indexed-vertex-blending.patch b/patches/wined3d-Indexed_Vertex_Blending/0001-d3d9-tests-Add-test-for-indexed-vertex-blending.patch index 59eded57..77b19d71 100644 --- a/patches/wined3d-Indexed_Vertex_Blending/0001-d3d9-tests-Add-test-for-indexed-vertex-blending.patch +++ b/patches/wined3d-Indexed_Vertex_Blending/0001-d3d9-tests-Add-test-for-indexed-vertex-blending.patch @@ -8,15 +8,16 @@ Subject: d3d9/tests: Add test for indexed vertex blending. 1 file changed, 252 insertions(+) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c -index 1de7e5d186b..9b845b5ad44 100644 +index 4fdc41c26b..3b6215a274 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c -@@ -19715,6 +19715,257 @@ done: +@@ -20198,6 +20198,276 @@ done: DestroyWindow(window); } +static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char *test_id_str) +{ ++ IDirect3DPixelShader9 *ps; + D3DCAPS9 caps; + D3DCOLOR color; + HRESULT hr; @@ -33,30 +34,48 @@ index 1de7e5d186b..9b845b5ad44 100644 + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, ++ 0.0f, 0.0f, 2.0f, 0.0f, + -4.0f, 4.0f, 0.0f, 1.0f + }}}, + lower_left = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, ++ 0.0f, 0.0f, 2.0f, 0.0f, + -4.0f, -4.0f, 0.0f, 1.0f + }}}, + upper_right = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, ++ 0.0f, 0.0f, 2.0f, 0.0f, + 4.0f, 4.0f, 0.0f, 1.0f + }}}, + lower_right = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, ++ 0.0f, 0.0f, 2.0f, 0.0f, + 4.0f, -4.0f, 0.0f, 1.0f -+ }}}; ++ }}}, ++ identity = ++ {{{ ++ 1.0f, 0.0f, 0.0f, 0.0f, ++ 0.0f, 1.0f, 0.0f, 0.0f, ++ 0.0f, 0.0f, 1.0f, 0.0f, ++ 0.0f, 0.0f, 0.0f, 1.0f ++ }}}; ++ ++ static const DWORD normal_ps[] = ++ { ++ 0xffff0200, /* ps_2_0 */ ++ 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, /* def c0, 1, 0, 0, 0 */ ++ 0x0200001f, 0x80000000, 0xb0070000, /* dcl t0.xyz */ ++ 0x02000001, 0x80170000, 0xb0e40000, /* mov_sat r0.xyz, t0 */ ++ 0x02000001, 0x80080000, 0xa0000000, /* mov r0.w, c0.x */ ++ 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ ++ 0x0000ffff, /* end */ ++ }; + + static const POINT quad_upper_right_points[] = + { @@ -269,7 +288,7 @@ index 1de7e5d186b..9b845b5ad44 100644 static void test_updatetexture(void) { BOOL r32f_supported, ati2n_supported, do_visual_test; -@@ -22971,6 +23222,7 @@ START_TEST(visual) +@@ -23864,6 +24134,7 @@ START_TEST(visual) test_multisample_mismatch(); test_texcoordindex(); test_vertex_blending(); diff --git a/patches/wined3d-Indexed_Vertex_Blending/0002-wined3d-Implement-hardware-indexed-vertex-blending-w.patch b/patches/wined3d-Indexed_Vertex_Blending/0002-wined3d-Implement-hardware-indexed-vertex-blending-w.patch index 1eb5042a..c26eecfe 100644 --- a/patches/wined3d-Indexed_Vertex_Blending/0002-wined3d-Implement-hardware-indexed-vertex-blending-w.patch +++ b/patches/wined3d-Indexed_Vertex_Blending/0002-wined3d-Implement-hardware-indexed-vertex-blending-w.patch @@ -192,8 +192,8 @@ index 2c40b2d9838..7c20934ad40 100644 DWORD texgen[MAX_TEXTURES]; }; -@@ -4299,6 +4301,20 @@ static inline void *wined3d_calloc(SIZE_T count, SIZE_T size) - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * size); +@@ -4298,6 +4348,20 @@ static inline BOOL wined3d_format_is_typeless(const struct wined3d_format *forma + return format->id == format->typeless_id && format->id != WINED3DFMT_UNKNOWN; } +static inline BOOL use_indexed_vertex_blending(const struct wined3d_state *state, const struct wined3d_stream_info *si) diff --git a/patches/wined3d-Indexed_Vertex_Blending/0003-d3d9-tests-Test-normal-calculation-when-indexed-vert.patch b/patches/wined3d-Indexed_Vertex_Blending/0003-d3d9-tests-Test-normal-calculation-when-indexed-vert.patch index abc197d1..abfe1410 100644 --- a/patches/wined3d-Indexed_Vertex_Blending/0003-d3d9-tests-Test-normal-calculation-when-indexed-vert.patch +++ b/patches/wined3d-Indexed_Vertex_Blending/0003-d3d9-tests-Test-normal-calculation-when-indexed-vert.patch @@ -12,68 +12,6 @@ diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 3575b0be2e8..863a3c513de 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c -@@ -19717,6 +19717,7 @@ done: - - static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char *test_id_str) - { -+ IDirect3DPixelShader9 *ps; - D3DCAPS9 caps; - D3DCOLOR color; - HRESULT hr; -@@ -19733,31 +19734,49 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char - {{{ - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, -- 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 2.0f, 0.0f, - -4.0f, 4.0f, 0.0f, 1.0f - }}}, - lower_left = - {{{ - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, -- 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 2.0f, 0.0f, - -4.0f, -4.0f, 0.0f, 1.0f - }}}, - upper_right = - {{{ - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, -- 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 2.0f, 0.0f, - 4.0f, 4.0f, 0.0f, 1.0f - }}}, - lower_right = - {{{ - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, -- 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 2.0f, 0.0f, - 4.0f, -4.0f, 0.0f, 1.0f -+ }}}, -+ identity = -+ {{{ -+ 1.0f, 0.0f, 0.0f, 0.0f, -+ 0.0f, 1.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 0.0f, 1.0f - }}}; - -+ static const DWORD normal_ps[] = -+ { -+ 0xffff0200, /* ps_2_0 */ -+ 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, /* def c0, 1, 0, 0, 0 */ -+ 0x0200001f, 0x80000000, 0xb0070000, /* dcl t0.xyz */ -+ 0x02000001, 0x80170000, 0xb0e40000, /* mov_sat r0.xyz, t0 */ -+ 0x02000001, 0x80080000, 0xa0000000, /* mov r0.w, c0.x */ -+ 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ -+ 0x0000ffff, /* end */ -+ }; -+ - static const POINT quad_upper_right_points[] = - { - {576, 48}, {-1, -1}, @@ -19798,6 +19817,7 @@ static void do_test_indexed_vertex_blending(IDirect3DDevice9 *device, const char struct vec3 position; struct vec3 blendweights; diff --git a/patches/wined3d-Indexed_Vertex_Blending/0004-wined3d-Fix-calculation-of-normal-when-vertex-blendi.patch b/patches/wined3d-Indexed_Vertex_Blending/0004-wined3d-Fix-calculation-of-normal-when-vertex-blendi.patch index fe6ec80b..fc788f01 100644 --- a/patches/wined3d-Indexed_Vertex_Blending/0004-wined3d-Fix-calculation-of-normal-when-vertex-blendi.patch +++ b/patches/wined3d-Indexed_Vertex_Blending/0004-wined3d-Fix-calculation-of-normal-when-vertex-blendi.patch @@ -35,8 +35,8 @@ index 3e84ad0d717..2aa0d0db0a4 100644 GLint texture_matrix_location[MAX_TEXTURES]; GLint material_ambient_location; GLint material_diffuse_location; -@@ -1496,33 +1496,6 @@ static BOOL invert_matrix(struct wined3d_matrix *out, struct wined3d_matrix *m) - return TRUE; +@@ -1523,33 +1523,6 @@ static void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_ma + *out = temp; } -static void shader_glsl_ffp_vertex_normalmatrix_uniform(const struct wined3d_context *context, diff --git a/patches/wined3d-Indexed_Vertex_Blending/0005-wined3d-Move-matrix-inversion-functions-into-utils.c.patch b/patches/wined3d-Indexed_Vertex_Blending/0005-wined3d-Move-matrix-inversion-functions-into-utils.c.patch index 29db3899..ca11b9fb 100644 --- a/patches/wined3d-Indexed_Vertex_Blending/0005-wined3d-Move-matrix-inversion-functions-into-utils.c.patch +++ b/patches/wined3d-Indexed_Vertex_Blending/0005-wined3d-Move-matrix-inversion-functions-into-utils.c.patch @@ -13,7 +13,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 2aa0d0db0a4..aaca2f63441 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1221,281 +1221,6 @@ static void shader_glsl_load_np2fixup_constants(const struct glsl_ps_program *ps +@@ -1236,281 +1236,6 @@ static void shader_glsl_load_np2fixup_constants(const struct glsl_ps_program *ps GL_EXTCALL(glUniform4fv(ps->np2_fixup_location, ps->np2_fixup_info->num_consts, &np2fixup_constants[0].sx)); } @@ -88,7 +88,7 @@ index 2aa0d0db0a4..aaca2f63441 100644 - *b = tmp; -} - --static BOOL invert_matrix(struct wined3d_matrix *out, struct wined3d_matrix *m) +-static BOOL invert_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m) -{ - float wtmp[4][8]; - float m0, m1, m2, m3, s; @@ -292,9 +292,9 @@ index 2aa0d0db0a4..aaca2f63441 100644 - return TRUE; -} - - static void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_context *context, - const struct wined3d_state *state, unsigned int tex, struct glsl_shader_prog_link *prog) + static void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m) { + struct wined3d_matrix temp; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 847429511b9..b2effb5c2ec 100644 --- a/dlls/wined3d/utils.c