Nikolay Sivov : d3d10/effect: Pick up resources from elements when shader variable arrays are used.

Alexandre Julliard julliard at winehq.org
Fri Oct 15 15:40:05 CDT 2021


Module: wine
Branch: master
Commit: 64df3c61a5b7c86f29f292f131c14a41f027a154
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=64df3c61a5b7c86f29f292f131c14a41f027a154

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Oct 14 09:42:18 2021 +0300

d3d10/effect: Pick up resources from elements when shader variable arrays are used.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d10/effect.c       | 11 ++--------
 dlls/d3d10/tests/effect.c | 54 +++++++++++++++++++++++++----------------------
 2 files changed, 31 insertions(+), 34 deletions(-)

diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
index 17a4c547a2c..29d59f2620b 100644
--- a/dlls/d3d10/effect.c
+++ b/dlls/d3d10/effect.c
@@ -3979,6 +3979,8 @@ static void d3d10_effect_pass_set_shader(struct d3d10_effect_pass *pass,
         default:
             WARN("Unexpected shader type %u.\n", v->type->basetype);
     }
+
+    apply_shader_resources(device, v);
 }
 
 static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags)
@@ -3991,20 +3993,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface
     if (flags) FIXME("Ignoring flags (%#x)\n", flags);
 
     if (pass->vs.shader != &null_shader_variable)
-    {
         d3d10_effect_pass_set_shader(pass, &pass->vs);
-        apply_shader_resources(device, pass->vs.shader);
-    }
     if (pass->gs.shader != &null_shader_variable)
-    {
         d3d10_effect_pass_set_shader(pass, &pass->gs);
-        apply_shader_resources(device, pass->gs.shader);
-    }
     if (pass->ps.shader != &null_shader_variable)
-    {
         d3d10_effect_pass_set_shader(pass, &pass->ps);
-        apply_shader_resources(device, pass->ps.shader);
-    }
     if (pass->rasterizer)
         ID3D10Device_RSSetState(device, pass->rasterizer->u.state.object.rasterizer);
     if (pass->depth_stencil)
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c
index dd16aab5aaa..93e82490eb0 100644
--- a/dlls/d3d10/tests/effect.c
+++ b/dlls/d3d10/tests/effect.c
@@ -5946,43 +5946,47 @@ float4 PS( float4 pos : SV_POSITION ) : SV_Target
     return t_a[1].Sample(s[1], float2(0, 0));
 }
 
+PixelShader ps[1] = { CompileShader(ps_4_0, PS()) };
+
 technique10 rsrc_test
 {
     pass p0
     {
-        SetPixelShader(CompileShader(ps_4_0, PS()));
+        SetPixelShader(ps[0]);
     }
 }
 #endif
 static DWORD fx_test_resource_variable2[] =
 {
-    0x43425844, 0xb62313ac, 0x8116090b, 0xdc1d2951, 0xfc18ca42, 0x00000001, 0x0000035a, 0x00000001,
-    0x00000024, 0x30315846, 0x0000032e, 0xfeff1001, 0x00000000, 0x00000000, 0x00000002, 0x00000000,
-    0x00000000, 0x00000000, 0x00000001, 0x0000028a, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
-    0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x74786554,
+    0x43425844, 0xecd43fcd, 0x0654927c, 0x71931f03, 0xf166cc09, 0x00000001, 0x0000039d, 0x00000001,
+    0x00000024, 0x30315846, 0x00000371, 0xfeff1001, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
+    0x00000000, 0x00000000, 0x00000001, 0x000002b5, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
+    0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x74786554,
     0x32657275, 0x00040044, 0x00020000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x000c0000,
     0x5f740000, 0x61530061, 0x656c706d, 0x61745372, 0x2e006574, 0x02000000, 0x02000000, 0x00000000,
-    0x00000000, 0x00000000, 0x15000000, 0x73000000, 0x72737200, 0x65745f63, 0x70007473, 0x02180030,
-    0x58440000, 0xb2424342, 0x3c889e83, 0xb8b8fc18, 0x749f2920, 0x0001877a, 0x02180000, 0x00050000,
-    0x00340000, 0x00c80000, 0x00fc0000, 0x01300000, 0x019c0000, 0x44520000, 0x008c4645, 0x00000000,
-    0x00000000, 0x00020000, 0x001c0000, 0x04000000, 0x0100ffff, 0x00620000, 0x005c0000, 0x00030000,
-    0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00020000, 0x00010000, 0x005e0000, 0x00020000,
-    0x00050000, 0x00040000, 0xffff0000, 0x0000ffff, 0x00020000, 0x000c0000, 0x00730000, 0x00615f74,
-    0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d,
-    0x31207265, 0x00312e30, 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000,
-    0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e,
-    0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000,
-    0x000f0000, 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x00645244, 0x00400000, 0x00190000,
-    0x005a0000, 0x60000300, 0x00020010, 0x18580000, 0x70000400, 0x00010010, 0x55550000, 0x00650000,
-    0x20f20300, 0x00000010, 0x00450000, 0x20f20c00, 0x00000010, 0x40020000, 0x00000000, 0x00000000,
-    0x00000000, 0x00000000, 0x7e460000, 0x00010010, 0x60000000, 0x00020010, 0x003e0000, 0x54530100,
-    0x00745441, 0x00020000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
-    0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000,
+    0x00000000, 0x00000000, 0x15000000, 0x73000000, 0x78695000, 0x68536c65, 0x72656461, 0x00005900,
+    0x00000200, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000500, 0x00737000, 0x00000218,
+    0x43425844, 0x9e83b242, 0xfc183c88, 0x2920b8b8, 0x877a749f, 0x00000001, 0x00000218, 0x00000005,
+    0x00000034, 0x000000c8, 0x000000fc, 0x00000130, 0x0000019c, 0x46454452, 0x0000008c, 0x00000000,
+    0x00000000, 0x00000002, 0x0000001c, 0xffff0400, 0x00000100, 0x00000062, 0x0000005c, 0x00000003,
+    0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000001, 0x0000005e, 0x00000002,
+    0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000002, 0x0000000c, 0x5f740073, 0x694d0061,
+    0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69,
+    0x2e303120, 0xabab0031, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000,
+    0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4e47534f,
+    0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
+    0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000064, 0x00000040, 0x00000019,
+    0x0300005a, 0x00106000, 0x00000002, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03000065,
+    0x001020f2, 0x00000000, 0x0c000045, 0x001020f2, 0x00000000, 0x00004002, 0x00000000, 0x00000000,
+    0x00000000, 0x00000000, 0x00107e46, 0x00000001, 0x00106000, 0x00000002, 0x0100003e, 0x54415453,
+    0x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
+    0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00660000, 0x00000000,
-    0x002a0000, 0x000e0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00570000, 0x003b0000, 0x00000000,
-    0xffff0000, 0x0000ffff, 0x00000000, 0x00000000, 0x00590000, 0x00010000, 0x00000000, 0x00630000,
-    0x00010000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x02820000, 0x00000000,
+    0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x63727372, 0x7365745f,
+    0x30700074, 0x00008100, 0x00000000, 0x00002a00, 0x00000e00, 0x00000000, 0xffffff00, 0x000000ff,
+    0x00005700, 0x00003b00, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00000000, 0x00008100,
+    0x00006500, 0x00000000, 0xffffff00, 0x000084ff, 0x00000000, 0x0002a000, 0x00000100, 0x00000000,
+    0x0002aa00, 0x00000100, 0x00000000, 0x00000700, 0x00000000, 0x00000300, 0x0002ad00, 0x00000000,
 };
 
 static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv,




More information about the wine-cvs mailing list