Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 4 + dlls/d3d10/tests/effect.c | 160 +++++++++++++++++++++----------------- 2 files changed, 92 insertions(+), 72 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 5e65ad3f4be..0a6256d7ebd 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1695,6 +1695,10 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset, *(void **)out_data = &null_shader_resource_variable; break;
+ case D3D10_SVT_DEPTHSTENCIL: + *(void **)out_data = &null_depth_stencil_variable; + break; + default: FIXME("Unhandled out_type %#x.\n", out_type); return FALSE; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 149328301e1..87b591e3af8 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -4216,13 +4216,17 @@ technique10 tech0 { SetPixelShader( CompileShader(ps_4_0, PS()) ); } + pass pass2 + { + SetDepthStencilState(NULL, 0); + } }; #endif static DWORD fx_test_state_groups[] = { - 0x43425844, 0x61e5a938, 0x1d4228df, 0x536560dd, 0x76c777b2, 0x00000001, 0x000011ce, 0x00000001, - 0x00000024, 0x30315846, 0x000011a2, 0xfeff1001, 0x00000000, 0x00000000, 0x00000029, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00000922, 0x00000000, 0x00000024, 0x00000001, 0x00000001, + 0x43425844, 0xefc189be, 0xdf31b02d, 0x77de2d1a, 0x7b97922c, 0x00000001, 0x00001218, 0x00000001, + 0x00000024, 0x30315846, 0x000011ec, 0xfeff1001, 0x00000000, 0x00000000, 0x00000029, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000940, 0x00000000, 0x00000024, 0x00000001, 0x00000001, 0x00000001, 0x00000014, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x74736152, 0x7a697265, 0x74537265, 0x00657461, 0x00000004, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x74736172, 0x6174735f, 0x01006574, 0x02000000, 0x02000000, 0x01000000, @@ -4296,73 +4300,75 @@ static DWORD fx_test_state_groups[] = 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07260000, 0x00000000, 0x00300000, 0x00140000, - 0x00000000, 0xffff0000, 0x000affff, 0x000c0000, 0x00000000, 0x00010000, 0x003b0000, 0x000d0000, - 0x00000000, 0x00010000, 0x00470000, 0x000e0000, 0x00000000, 0x00010000, 0x00530000, 0x000f0000, - 0x00000000, 0x00010000, 0x005f0000, 0x00100000, 0x00000000, 0x00010000, 0x006b0000, 0x00110000, - 0x00000000, 0x00010000, 0x00770000, 0x00120000, 0x00000000, 0x00010000, 0x00830000, 0x00130000, - 0x00000000, 0x00010000, 0x008f0000, 0x00140000, 0x00000000, 0x00010000, 0x009b0000, 0x00150000, - 0x00000000, 0x00010000, 0x00a70000, 0x00000000, 0x00e10000, 0x00c50000, 0x00000000, 0xffff0000, - 0x000effff, 0x00160000, 0x00000000, 0x00010000, 0x00ea0000, 0x00170000, 0x00000000, 0x00010000, - 0x00f60000, 0x00180000, 0x00000000, 0x00010000, 0x01020000, 0x00190000, 0x00000000, 0x00010000, - 0x010e0000, 0x001a0000, 0x00000000, 0x00010000, 0x011a0000, 0x001b0000, 0x00000000, 0x00010000, - 0x01260000, 0x001c0000, 0x00000000, 0x00010000, 0x01320000, 0x001d0000, 0x00000000, 0x00010000, - 0x013e0000, 0x001e0000, 0x00000000, 0x00010000, 0x014a0000, 0x001f0000, 0x00000000, 0x00010000, - 0x01560000, 0x00200000, 0x00000000, 0x00010000, 0x01620000, 0x00210000, 0x00000000, 0x00010000, - 0x016e0000, 0x00220000, 0x00000000, 0x00010000, 0x017a0000, 0x00230000, 0x00000000, 0x00010000, - 0x01860000, 0x00000000, 0x01b90000, 0x019d0000, 0x00000000, 0xffff0000, 0x000bffff, 0x00240000, - 0x00000000, 0x00010000, 0x01c50000, 0x00250000, 0x00000000, 0x00010000, 0x01d10000, 0x00250000, - 0x00070000, 0x00010000, 0x01dd0000, 0x00260000, 0x00000000, 0x00010000, 0x01e90000, 0x00270000, - 0x00000000, 0x00010000, 0x01f50000, 0x00280000, 0x00000000, 0x00010000, 0x02010000, 0x00290000, - 0x00000000, 0x00010000, 0x020d0000, 0x002a0000, 0x00000000, 0x00010000, 0x02190000, 0x002b0000, - 0x00000000, 0x00010000, 0x02250000, 0x002c0000, 0x00000000, 0x00010000, 0x02310000, 0x002c0000, - 0x00070000, 0x00010000, 0x023d0000, 0x00000000, 0x02720000, 0x02560000, 0x00000000, 0xffff0000, - 0x000bffff, 0x002d0000, 0x00000000, 0x00010000, 0x027b0000, 0x002e0000, 0x00000000, 0x00010000, - 0x02870000, 0x002f0000, 0x00000000, 0x00010000, 0x02930000, 0x00300000, 0x00000000, 0x00010000, - 0x029f0000, 0x00310000, 0x00000000, 0x00010000, 0x02ab0000, 0x00320000, 0x00000000, 0x00010000, - 0x02b70000, 0x00330000, 0x00000000, 0x00010000, 0x02c30000, 0x00340000, 0x00000000, 0x00010000, - 0x02cf0000, 0x00350000, 0x00000000, 0x00010000, 0x02f30000, 0x00360000, 0x00000000, 0x00010000, - 0x02ff0000, 0x00370000, 0x00000000, 0x00010000, 0x030b0000, 0x00000000, 0x033b0000, 0x031f0000, - 0x00000000, 0xffff0000, 0x0000ffff, 0x03640000, 0x03480000, 0x00000000, 0xffff0000, 0x0000ffff, - 0x03920000, 0x03760000, 0x00000000, 0xffff0000, 0x0000ffff, 0x03bc0000, 0x03a00000, 0x00000000, - 0xffff0000, 0x0000ffff, 0x03ea0000, 0x03ce0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04160000, - 0x03fa0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04490000, 0x042d0000, 0x00000000, 0xffff0000, - 0x0000ffff, 0x04760000, 0x045a0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04a10000, 0x04850000, - 0x00000000, 0xffff0000, 0x0000ffff, 0x04a40000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, - 0x00370000, 0x00000000, 0x00020000, 0x033b0000, 0x00000000, 0x04ad0000, 0x02560000, 0x00000000, - 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x03640000, 0x00000000, 0x04b60000, - 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x03920000, - 0x00000000, 0x04c00000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, - 0x00020000, 0x03bc0000, 0x00000000, 0x04c90000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, - 0x00370000, 0x00000000, 0x00020000, 0x03ea0000, 0x00000000, 0x04d30000, 0x02560000, 0x00000000, - 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x04160000, 0x00000000, 0x04dc0000, - 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x04490000, - 0x00000000, 0x04e60000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, - 0x00020000, 0x04760000, 0x00000000, 0x04ef0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, - 0x00370000, 0x00000000, 0x00020000, 0x04a10000, 0x00000000, 0x05140000, 0x04f80000, 0x00000000, - 0xffff0000, 0x0000ffff, 0x05350000, 0x05190000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05560000, - 0x053a0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05780000, 0x055c0000, 0x00000000, 0xffff0000, - 0x0000ffff, 0x05990000, 0x057d0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05bb0000, 0x059f0000, - 0x00000000, 0xffff0000, 0x0000ffff, 0x05df0000, 0x05c30000, 0x00000000, 0xffff0000, 0x0000ffff, - 0x06040000, 0x05e80000, 0x00000000, 0xffff0000, 0x0000ffff, 0x06250000, 0x06090000, 0x00000000, - 0xffff0000, 0x0000ffff, 0x062a0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, - 0x00000000, 0x00030000, 0x06330000, 0x00000000, 0x063b0000, 0x02560000, 0x00000000, 0xffff0000, - 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x06440000, 0x00000000, 0x064c0000, 0x02560000, - 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x06550000, 0x00000000, - 0x065d0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, - 0x06670000, 0x00000000, 0x066f0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, - 0x00000000, 0x00030000, 0x06790000, 0x00000000, 0x06810000, 0x02560000, 0x00000000, 0xffff0000, - 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x068b0000, 0x00000000, 0x06930000, 0x02560000, - 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x069d0000, 0x00000000, - 0x06a50000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, - 0x06af0000, 0x00000000, 0x06b70000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, - 0x00000000, 0x00030000, 0x06c10000, 0x00000000, 0x06c90000, 0x02560000, 0x00000000, 0xffff0000, - 0x0001ffff, 0x00370000, 0x00000000, 0x00010000, 0x06cc0000, 0x00000000, 0x06d80000, 0x00020000, - 0x00000000, 0x06de0000, 0x00060000, 0x00000000, 0x000a0000, 0x00000000, 0x00010000, 0x06e40000, - 0x000b0000, 0x00000000, 0x00010000, 0x07080000, 0x00020000, 0x00000000, 0x00020000, 0x01b90000, - 0x00090000, 0x00000000, 0x00010000, 0x07140000, 0x00010000, 0x00000000, 0x00020000, 0x00e10000, - 0x00000000, 0x00000000, 0x00020000, 0x00300000, 0x07200000, 0x00010000, 0x00000000, 0x00070000, - 0x00000000, 0x00070000, 0x091a0000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07260000, 0x00000000, 0x61700000, 0x00327373, + 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000030, 0x00000014, + 0x00000000, 0xffffffff, 0x0000000a, 0x0000000c, 0x00000000, 0x00000001, 0x0000003b, 0x0000000d, + 0x00000000, 0x00000001, 0x00000047, 0x0000000e, 0x00000000, 0x00000001, 0x00000053, 0x0000000f, + 0x00000000, 0x00000001, 0x0000005f, 0x00000010, 0x00000000, 0x00000001, 0x0000006b, 0x00000011, + 0x00000000, 0x00000001, 0x00000077, 0x00000012, 0x00000000, 0x00000001, 0x00000083, 0x00000013, + 0x00000000, 0x00000001, 0x0000008f, 0x00000014, 0x00000000, 0x00000001, 0x0000009b, 0x00000015, + 0x00000000, 0x00000001, 0x000000a7, 0x00000000, 0x000000e1, 0x000000c5, 0x00000000, 0xffffffff, + 0x0000000e, 0x00000016, 0x00000000, 0x00000001, 0x000000ea, 0x00000017, 0x00000000, 0x00000001, + 0x000000f6, 0x00000018, 0x00000000, 0x00000001, 0x00000102, 0x00000019, 0x00000000, 0x00000001, + 0x0000010e, 0x0000001a, 0x00000000, 0x00000001, 0x0000011a, 0x0000001b, 0x00000000, 0x00000001, + 0x00000126, 0x0000001c, 0x00000000, 0x00000001, 0x00000132, 0x0000001d, 0x00000000, 0x00000001, + 0x0000013e, 0x0000001e, 0x00000000, 0x00000001, 0x0000014a, 0x0000001f, 0x00000000, 0x00000001, + 0x00000156, 0x00000020, 0x00000000, 0x00000001, 0x00000162, 0x00000021, 0x00000000, 0x00000001, + 0x0000016e, 0x00000022, 0x00000000, 0x00000001, 0x0000017a, 0x00000023, 0x00000000, 0x00000001, + 0x00000186, 0x00000000, 0x000001b9, 0x0000019d, 0x00000000, 0xffffffff, 0x0000000b, 0x00000024, + 0x00000000, 0x00000001, 0x000001c5, 0x00000025, 0x00000000, 0x00000001, 0x000001d1, 0x00000025, + 0x00000007, 0x00000001, 0x000001dd, 0x00000026, 0x00000000, 0x00000001, 0x000001e9, 0x00000027, + 0x00000000, 0x00000001, 0x000001f5, 0x00000028, 0x00000000, 0x00000001, 0x00000201, 0x00000029, + 0x00000000, 0x00000001, 0x0000020d, 0x0000002a, 0x00000000, 0x00000001, 0x00000219, 0x0000002b, + 0x00000000, 0x00000001, 0x00000225, 0x0000002c, 0x00000000, 0x00000001, 0x00000231, 0x0000002c, + 0x00000007, 0x00000001, 0x0000023d, 0x00000000, 0x00000272, 0x00000256, 0x00000000, 0xffffffff, + 0x0000000b, 0x0000002d, 0x00000000, 0x00000001, 0x0000027b, 0x0000002e, 0x00000000, 0x00000001, + 0x00000287, 0x0000002f, 0x00000000, 0x00000001, 0x00000293, 0x00000030, 0x00000000, 0x00000001, + 0x0000029f, 0x00000031, 0x00000000, 0x00000001, 0x000002ab, 0x00000032, 0x00000000, 0x00000001, + 0x000002b7, 0x00000033, 0x00000000, 0x00000001, 0x000002c3, 0x00000034, 0x00000000, 0x00000001, + 0x000002cf, 0x00000035, 0x00000000, 0x00000001, 0x000002f3, 0x00000036, 0x00000000, 0x00000001, + 0x000002ff, 0x00000037, 0x00000000, 0x00000001, 0x0000030b, 0x00000000, 0x0000033b, 0x0000031f, + 0x00000000, 0xffffffff, 0x00000000, 0x00000364, 0x00000348, 0x00000000, 0xffffffff, 0x00000000, + 0x00000392, 0x00000376, 0x00000000, 0xffffffff, 0x00000000, 0x000003bc, 0x000003a0, 0x00000000, + 0xffffffff, 0x00000000, 0x000003ea, 0x000003ce, 0x00000000, 0xffffffff, 0x00000000, 0x00000416, + 0x000003fa, 0x00000000, 0xffffffff, 0x00000000, 0x00000449, 0x0000042d, 0x00000000, 0xffffffff, + 0x00000000, 0x00000476, 0x0000045a, 0x00000000, 0xffffffff, 0x00000000, 0x000004a1, 0x00000485, + 0x00000000, 0xffffffff, 0x00000000, 0x000004a4, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, + 0x00000037, 0x00000000, 0x00000002, 0x0000033b, 0x00000000, 0x000004ad, 0x00000256, 0x00000000, + 0xffffffff, 0x00000001, 0x00000037, 0x00000000, 0x00000002, 0x00000364, 0x00000000, 0x000004b6, + 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, 0x00000000, 0x00000002, 0x00000392, + 0x00000000, 0x000004c0, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, 0x00000000, + 0x00000002, 0x000003bc, 0x00000000, 0x000004c9, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, + 0x00000037, 0x00000000, 0x00000002, 0x000003ea, 0x00000000, 0x000004d3, 0x00000256, 0x00000000, + 0xffffffff, 0x00000001, 0x00000037, 0x00000000, 0x00000002, 0x00000416, 0x00000000, 0x000004dc, + 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, 0x00000000, 0x00000002, 0x00000449, + 0x00000000, 0x000004e6, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, 0x00000000, + 0x00000002, 0x00000476, 0x00000000, 0x000004ef, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, + 0x00000037, 0x00000000, 0x00000002, 0x000004a1, 0x00000000, 0x00000514, 0x000004f8, 0x00000000, + 0xffffffff, 0x00000000, 0x00000535, 0x00000519, 0x00000000, 0xffffffff, 0x00000000, 0x00000556, + 0x0000053a, 0x00000000, 0xffffffff, 0x00000000, 0x00000578, 0x0000055c, 0x00000000, 0xffffffff, + 0x00000000, 0x00000599, 0x0000057d, 0x00000000, 0xffffffff, 0x00000000, 0x000005bb, 0x0000059f, + 0x00000000, 0xffffffff, 0x00000000, 0x000005df, 0x000005c3, 0x00000000, 0xffffffff, 0x00000000, + 0x00000604, 0x000005e8, 0x00000000, 0xffffffff, 0x00000000, 0x00000625, 0x00000609, 0x00000000, + 0xffffffff, 0x00000000, 0x0000062a, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, + 0x00000000, 0x00000003, 0x00000633, 0x00000000, 0x0000063b, 0x00000256, 0x00000000, 0xffffffff, + 0x00000001, 0x00000037, 0x00000000, 0x00000003, 0x00000644, 0x00000000, 0x0000064c, 0x00000256, + 0x00000000, 0xffffffff, 0x00000001, 0x00000037, 0x00000000, 0x00000003, 0x00000655, 0x00000000, + 0x0000065d, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, 0x00000000, 0x00000003, + 0x00000667, 0x00000000, 0x0000066f, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, + 0x00000000, 0x00000003, 0x00000679, 0x00000000, 0x00000681, 0x00000256, 0x00000000, 0xffffffff, + 0x00000001, 0x00000037, 0x00000000, 0x00000003, 0x0000068b, 0x00000000, 0x00000693, 0x00000256, + 0x00000000, 0xffffffff, 0x00000001, 0x00000037, 0x00000000, 0x00000003, 0x0000069d, 0x00000000, + 0x000006a5, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, 0x00000000, 0x00000003, + 0x000006af, 0x00000000, 0x000006b7, 0x00000256, 0x00000000, 0xffffffff, 0x00000001, 0x00000037, + 0x00000000, 0x00000003, 0x000006c1, 0x00000000, 0x000006c9, 0x00000256, 0x00000000, 0xffffffff, + 0x00000001, 0x00000037, 0x00000000, 0x00000001, 0x000006cc, 0x00000000, 0x000006d8, 0x00000003, + 0x00000000, 0x000006de, 0x00000006, 0x00000000, 0x0000000a, 0x00000000, 0x00000001, 0x000006e4, + 0x0000000b, 0x00000000, 0x00000001, 0x00000708, 0x00000002, 0x00000000, 0x00000002, 0x000001b9, + 0x00000009, 0x00000000, 0x00000001, 0x00000714, 0x00000001, 0x00000000, 0x00000002, 0x000000e1, + 0x00000000, 0x00000000, 0x00000002, 0x00000030, 0x00000720, 0x00000001, 0x00000000, 0x00000007, + 0x00000000, 0x00000007, 0x0000091a, 0x00000922, 0x00000002, 0x00000000, 0x00000009, 0x00000000, + 0x00000001, 0x00000928, 0x00000001, 0x00000000, 0x00000001, 0x00000934, };
static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv, @@ -4391,10 +4397,10 @@ static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderRes
static void test_effect_state_groups(void) { + ID3D10DepthStencilState *ds_state, *ds_state2; ID3D10ShaderResourceView *srv0, *srv1; ID3D10EffectDepthStencilVariable *d; ID3D10EffectRasterizerVariable *r; - ID3D10DepthStencilState *ds_state; ID3D10RasterizerState *rast_state; ID3D10EffectTechnique *technique; D3D10_DEPTH_STENCIL_DESC ds_desc; @@ -4620,7 +4626,6 @@ static void test_effect_state_groups(void) rast_desc.AntialiasedLineEnable);
ID3D10RasterizerState_Release(rast_state); - ID3D10DepthStencilState_Release(ds_state); ID3D10BlendState_Release(blend_state);
/* pass 1 - uses SamplerState.Texture = NULL, resource slot is reset. */ @@ -4645,6 +4650,17 @@ static void test_effect_state_groups(void) ID3D10ShaderResourceView_Release(srv0); ID3D10Texture2D_Release(tex0);
+ /* pass 2 - NULL depth stencil state */ + pass = technique->lpVtbl->GetPassByName(technique, "pass2"); + ok(pass->lpVtbl->IsValid(pass), "Failed to get pass.\n"); + + ID3D10Device_OMSetDepthStencilState(device, ds_state, 0); + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ID3D10Device_OMGetDepthStencilState(device, &ds_state2, &stencil_ref); + ok(!ds_state2, "Unexpected depth stencil state.\n"); + + ID3D10DepthStencilState_Release(ds_state); effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);