Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
-- v4: d3d10/tests: Compile more test effects from sources.
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/tests/effect.c | 1078 ++++++++++++------------------------- 1 file changed, 343 insertions(+), 735 deletions(-)
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 22379289d8a..0f1c5b87eae 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -98,38 +98,19 @@ static UINT effect_get_d3d_buffer_size(ID3D10Effect *effect, const char *name) return desc.ByteWidth; }
-/* - * test_effect_constant_buffer_type - */ -#if 0 -cbuffer cb : register(b1) -{ - float f1 : SV_POSITION; - float f2 : COLOR0; -}; - -cbuffer cb2 : register(b0) -{ - float f3 : packoffset(c2); -}; -#endif -static DWORD fx_test_ecbt[] = -{ - 0x43425844, 0x7cfb8cde, 0x31ec2d95, 0x38500042, 0xa9330c67, 0x00000001, 0x00000145, 0x00000001, - 0x00000024, 0x30315846, 0x00000119, 0xfeff1001, 0x00000002, 0x00000003, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000049, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263, - 0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900, - 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49, 0x43003266, 0x524f4c4f, 0x62630030, 0x33660032, - 0x00000400, 0x00001000, 0x00000000, 0x00000200, 0x00000100, 0x00000000, 0x00002900, 0x00000d00, - 0x00002c00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00003800, 0x00000d00, 0x00003b00, - 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00004200, 0x00003000, 0x00000000, 0x00000100, - 0x00000000, 0x00000000, 0x00004600, 0x00000d00, 0x00000000, 0x00002000, 0x00000000, 0x00000400, - 0x00000000, 0x00000000, -}; - static void test_effect_constant_buffer_type(void) { + static char source[] = + "cbuffer cb : register(b1)\n" + "{\n" + " float f1 : SV_POSITION;\n" + " float f2 : COLOR0;\n" + "};\n" + "\n" + "cbuffer cb2 : register(b0)\n" + "{\n" + " float f3 : packoffset(c2);\n" + "};"; ID3D10Effect *effect; ID3D10EffectConstantBuffer *constantbuffer; ID3D10EffectType *type, *type2, *null_type; @@ -141,6 +122,7 @@ static void test_effect_constant_buffer_type(void) D3D10_EFFECT_DESC desc; ID3D10Device *device; ID3D10Buffer *buffer; + ID3D10Blob *blob; ULONG refcount; HRESULT hr; LPCSTR string; @@ -153,10 +135,14 @@ static void test_effect_constant_buffer_type(void) return; }
- hr = create_effect(fx_test_ecbt, 0, NULL, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, NULL, NULL, &effect); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
- hr = create_effect(fx_test_ecbt, 0, device, NULL, &effect); + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, NULL); @@ -165,7 +151,7 @@ static void test_effect_constant_buffer_type(void) hr = effect->lpVtbl->GetDesc(effect, &desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(desc.ConstantBuffers == 2, "Unexpected constant buffers count %u.\n", desc.ConstantBuffers); + ok(desc.ConstantBuffers == 3, "Unexpected constant buffers count %u.\n", desc.ConstantBuffers); ok(desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", desc.SharedConstantBuffers); ok(desc.GlobalVariables == 3, "Unexpected global variables count %u.\n", desc.GlobalVariables); @@ -178,7 +164,7 @@ static void test_effect_constant_buffer_type(void) size = effect_get_d3d_buffer_size(effect, "cb2"); ok(size == 48, "Unexpected size %u.\n", size);
- constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0); + constantbuffer = effect->lpVtbl->GetConstantBufferByName(effect, "cb");
hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &var_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); @@ -295,7 +281,7 @@ static void test_effect_constant_buffer_type(void) string = type->lpVtbl->GetMemberSemantic(type, 3); ok(string == NULL, "GetMemberSemantic is "%s", expected "NULL"\n", string);
- constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 1); + constantbuffer = effect->lpVtbl->GetConstantBufferByName(effect, "cb2"); v = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 0); hr = v->lpVtbl->GetDesc(v, &var_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); @@ -313,60 +299,30 @@ static void test_effect_constant_buffer_type(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }
-/* - * test_effect_variable_type - */ -#if 0 -struct test -{ - float f3 : SV_POSITION; - float f4 : COLOR0; -}; -struct test1 -{ - float f1; - float f2; - test t; -}; -cbuffer cb -{ - test1 t1; -}; -#endif -static DWORD fx_test_evt[] = { -0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4, -0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001, -0x00000024, 0x30315846, 0x00000160, 0xfeff1001, -0x00000001, 0x00000001, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x000000e0, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x74006263, -0x31747365, 0x00316600, 0x616f6c66, 0x00100074, -0x00010000, 0x00000000, 0x00040000, 0x00100000, -0x00040000, 0x09090000, 0x32660000, 0x74007400, -0x00747365, 0x53003366, 0x4f505f56, 0x49544953, -0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700, -0x00000300, 0x00000000, 0x00000800, 0x00001000, -0x00000800, 0x00000200, 0x00003c00, 0x00003f00, -0x00000000, 0x00001600, 0x00004b00, 0x00004e00, -0x00000400, 0x00001600, 0x00000700, 0x00000300, -0x00000000, 0x00001800, 0x00002000, 0x00001000, -0x00000300, 0x00000d00, 0x00000000, 0x00000000, -0x00001600, 0x00003200, 0x00000000, 0x00000400, -0x00001600, 0x00003500, 0x00000000, 0x00001000, -0x00005500, 0x00317400, 0x00000004, 0x00000020, -0x00000000, 0x00000001, 0xffffffff, 0x00000000, -0x000000dd, 0x00000091, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, -}; - static void test_effect_variable_type(void) { + static char source[] = + "struct test\n" + "{\n" + " float f3 : SV_POSITION;\n" + " float f4 : COLOR0;\n" + "};\n" + "struct test1\n" + "{\n" + " float f1;\n" + " float f2;\n" + " test t;\n" + "};\n" + "cbuffer cb\n" + "{\n" + " test1 t1;\n" + "};"; ID3D10Effect *effect; ID3D10EffectConstantBuffer *constantbuffer; ID3D10EffectVariable *variable; @@ -374,6 +330,7 @@ static void test_effect_variable_type(void) D3D10_EFFECT_TYPE_DESC type_desc; D3D10_EFFECT_DESC desc; ID3D10Device *device; + ID3D10Blob *blob; ULONG refcount; HRESULT hr; LPCSTR string; @@ -386,13 +343,17 @@ static void test_effect_variable_type(void) return; }
- hr = create_effect(fx_test_evt, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", desc.ConstantBuffers); + ok(desc.ConstantBuffers == 2, "Unexpected constant buffers count %u.\n", desc.ConstantBuffers); ok(desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", desc.SharedConstantBuffers); ok(desc.GlobalVariables == 1, "Unexpected global variables count %u.\n", desc.GlobalVariables); @@ -403,7 +364,7 @@ static void test_effect_variable_type(void) size = effect_get_d3d_buffer_size(effect, "cb"); ok(size == 32, "Unexpected size %u.\n", size);
- constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0); + constantbuffer = effect->lpVtbl->GetConstantBufferByName(effect, "cb"); type = constantbuffer->lpVtbl->GetType(constantbuffer); hr = type->lpVtbl->GetDesc(type, &type_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); @@ -419,7 +380,7 @@ static void test_effect_variable_type(void) ok(type_desc.UnpackedSize == 0x20, "UnpackedSize is %#x, expected 0x20\n", type_desc.UnpackedSize); ok(type_desc.Stride == 0x20, "Stride is %#x, expected 0x20\n", type_desc.Stride);
- constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0); + constantbuffer = effect->lpVtbl->GetConstantBufferByName(effect, "cb"); variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 0); type = variable->lpVtbl->GetType(variable); hr = type->lpVtbl->GetDesc(type, &type_desc); @@ -565,66 +526,37 @@ static void test_effect_variable_type(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }
-/* - * test_effect_variable_member - */ -#if 0 -struct test -{ - float f3 : SV_POSITION; - float f4 : COLOR0; -}; -struct test1 -{ - float f1; - float f2; - test t; -}; -cbuffer cb -{ - test1 t1; -}; -#endif -static DWORD fx_test_evm[] = { -0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4, -0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001, -0x00000024, 0x30315846, 0x00000160, 0xfeff1001, -0x00000001, 0x00000001, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x000000e0, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x74006263, -0x31747365, 0x00316600, 0x616f6c66, 0x00100074, -0x00010000, 0x00000000, 0x00040000, 0x00100000, -0x00040000, 0x09090000, 0x32660000, 0x74007400, -0x00747365, 0x53003366, 0x4f505f56, 0x49544953, -0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700, -0x00000300, 0x00000000, 0x00000800, 0x00001000, -0x00000800, 0x00000200, 0x00003c00, 0x00003f00, -0x00000000, 0x00001600, 0x00004b00, 0x00004e00, -0x00000400, 0x00001600, 0x00000700, 0x00000300, -0x00000000, 0x00001800, 0x00002000, 0x00001000, -0x00000300, 0x00000d00, 0x00000000, 0x00000000, -0x00001600, 0x00003200, 0x00000000, 0x00000400, -0x00001600, 0x00003500, 0x00000000, 0x00001000, -0x00005500, 0x00317400, 0x00000004, 0x00000020, -0x00000000, 0x00000001, 0xffffffff, 0x00000000, -0x000000dd, 0x00000091, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, -}; - static void test_effect_variable_member(void) { + static char source[] = + "struct test\n" + "{\n" + " float f3 : SV_POSITION;\n" + " float f4 : COLOR0;\n" + "};\n" + "struct test1\n" + "{\n" + " float f1;\n" + " float f2;\n" + " test t;\n" + "};\n" + "cbuffer cb\n" + "{\n" + " test1 t1;\n" + "};"; ID3D10Effect *effect; ID3D10EffectConstantBuffer *constantbuffer; ID3D10EffectVariable *variable, *variable2, *variable3, *null_variable; D3D10_EFFECT_VARIABLE_DESC desc; D3D10_EFFECT_DESC effect_desc; ID3D10Device *device; + ID3D10Blob *blob; ULONG refcount; HRESULT hr; UINT size; @@ -635,13 +567,17 @@ static void test_effect_variable_member(void) return; }
- hr = create_effect(fx_test_evm, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 2, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -654,7 +590,7 @@ static void test_effect_variable_member(void) size = effect_get_d3d_buffer_size(effect, "cb"); ok(size == 32, "Unexpected size %u.\n", size);
- constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0); + constantbuffer = effect->lpVtbl->GetConstantBufferByName(effect, "cb"); hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
@@ -783,65 +719,31 @@ static void test_effect_variable_member(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }
-/* - * test_effect_variable_element - */ -#if 0 -struct test -{ - float f3 : SV_POSITION; - float f4 : COLOR0; - float f5 : COLOR1; -}; -struct test1 -{ - float f1; - float f2[3]; - test t[2]; -}; -cbuffer cb -{ - test1 t1; -}; -#endif -static DWORD fx_test_eve[] = { -0x43425844, 0x6ea69fd9, 0x9b4e6390, 0x006f9f71, -0x57ad58f4, 0x00000001, 0x000001c2, 0x00000001, -0x00000024, 0x30315846, 0x00000196, 0xfeff1001, -0x00000001, 0x00000001, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000116, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x74006263, -0x31747365, 0x00316600, 0x616f6c66, 0x00100074, -0x00010000, 0x00000000, 0x00040000, 0x00100000, -0x00040000, 0x09090000, 0x32660000, 0x00001000, -0x00000100, 0x00000300, 0x00002400, 0x00001000, -0x00000c00, 0x00090900, 0x74007400, 0x00747365, -0x53003366, 0x4f505f56, 0x49544953, 0x66004e4f, -0x4f430034, 0x30524f4c, 0x00356600, 0x4f4c4f43, -0x53003152, 0x03000000, 0x02000000, 0x1c000000, -0x10000000, 0x18000000, 0x03000000, 0x58000000, -0x5b000000, 0x00000000, 0x16000000, 0x67000000, -0x6a000000, 0x04000000, 0x16000000, 0x71000000, -0x74000000, 0x08000000, 0x16000000, 0x07000000, -0x03000000, 0x00000000, 0x5c000000, 0x60000000, -0x28000000, 0x03000000, 0x0d000000, 0x00000000, -0x00000000, 0x16000000, 0x32000000, 0x00000000, -0x10000000, 0x35000000, 0x51000000, 0x00000000, -0x40000000, 0x7b000000, 0x74000000, 0x00040031, -0x00600000, 0x00000000, 0x00010000, 0xffff0000, -0x0000ffff, 0x01130000, 0x00c70000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, -}; - static void test_effect_variable_element(void) { + static char source[] = + "struct test\n" + "{\n" + " float f3 : SV_POSITION;\n" + " float f4 : COLOR0;\n" + " float f5 : COLOR1;\n" + "};\n" + "struct test1\n" + "{\n" + " float f1;\n" + " float f2[3];\n" + " test t[2];\n" + "};\n" + "cbuffer cb\n" + "{\n" + " test1 t1;\n" + "};"; ID3D10Effect *effect; ID3D10EffectConstantBuffer *constantbuffer, *parent; ID3D10EffectVariable *variable, *variable2, *variable3, *variable4, *variable5; @@ -850,6 +752,7 @@ static void test_effect_variable_element(void) D3D10_EFFECT_TYPE_DESC type_desc; D3D10_EFFECT_DESC effect_desc; ID3D10Device *device; + ID3D10Blob *blob; ULONG refcount; HRESULT hr; UINT size; @@ -860,13 +763,17 @@ static void test_effect_variable_element(void) return; }
- hr = create_effect(fx_test_eve, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 2, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -879,7 +786,7 @@ static void test_effect_variable_element(void) size = effect_get_d3d_buffer_size(effect, "cb"); ok(size == 96, "Unexpected size %u.\n", size);
- constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0); + constantbuffer = effect->lpVtbl->GetConstantBufferByName(effect, "cb"); hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
@@ -1326,6 +1233,8 @@ static void test_effect_variable_element(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); } @@ -2361,249 +2270,109 @@ static void test_effect_variable_type_class(void) ok(!refcount, "Device has %lu references left.\n", refcount); }
-/* - * test_effect_constant_buffer_stride - */ -#if 0 -cbuffer cb1 -{ - float a1; - float b1; - float c1; - float d1; -}; -cbuffer cb2 -{ - float a2; - float2 b2; -}; -cbuffer cb3 -{ - float2 a3; - float3 b3; -}; -cbuffer cb4 -{ - float2 a4; - float3 b4; - float2 c4; -}; -cbuffer cb5 -{ - float2 a5; - float2 b5; - float3 c5; -}; -cbuffer cb6 -{ - float2 a6 : packoffset(c0); - float3 b6 : packoffset(c1); - float2 c6 : packoffset(c0.z); -}; -cbuffer cb7 -{ - float2 a7 : packoffset(c0); - float3 b7 : packoffset(c1); - float2 c7 : packoffset(c2); -}; -cbuffer cb8 -{ - float2 a8 : packoffset(c0); - float3 b8 : packoffset(c0.y); - float4 c8 : packoffset(c2); -}; -cbuffer cb9 -{ - float2 a9 : packoffset(c0); - float2 b9 : packoffset(c0.y); - float2 c9 : packoffset(c0.z); -}; -cbuffer cb10 -{ - float4 a10 : packoffset(c2); -}; -cbuffer cb11 -{ - struct { - float4 a11; - float b11; - } s11; - float c11; -}; -cbuffer cb12 -{ - float c12; - struct { - float b12; - float4 a12; - } s12; -}; -cbuffer cb13 -{ - float a13; - struct { - float b13; - } s13; -}; -cbuffer cb14 -{ - struct { - float a14; - } s14; - struct { - float b14; - } t14; -}; -cbuffer cb15 -{ - float2 a15[2] : packoffset(c0); -}; -#endif -static DWORD fx_test_ecbs[] = { -0x43425844, 0x615d7d77, 0x21289d92, 0xe9e8d98e, -0xcae7b74e, 0x00000001, 0x00000855, 0x00000001, -0x00000024, 0x30315846, 0x00000829, 0xfeff1001, -0x0000000f, 0x00000024, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000285, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00316263, -0x616f6c66, 0x00080074, 0x00010000, 0x00000000, -0x00040000, 0x00100000, 0x00040000, 0x09090000, -0x31610000, 0x00316200, 0x64003163, 0x62630031, -0x32610032, 0x6f6c6600, 0x00327461, 0x0000003d, -0x00000001, 0x00000000, 0x00000008, 0x00000010, -0x00000008, 0x0000110a, 0x63003262, 0x61003362, -0x6c660033, 0x3374616f, 0x00006a00, 0x00000100, -0x00000000, 0x00000c00, 0x00001000, 0x00000c00, -0x00190a00, 0x00336200, 0x00346263, 0x62003461, -0x34630034, 0x35626300, 0x00356100, 0x63003562, -0x62630035, 0x36610036, 0x00366200, 0x63003663, -0x61003762, 0x37620037, 0x00376300, 0x00386263, -0x62003861, 0x6c660038, 0x3474616f, 0x0000ce00, -0x00000100, 0x00000000, 0x00001000, 0x00001000, -0x00001000, 0x00210a00, 0x00386300, 0x00396263, -0x62003961, 0x39630039, 0x31626300, 0x31610030, -0x62630030, 0x3c003131, 0x616e6e75, 0x3e64656d, -0x31316100, 0x31316200, 0x00010f00, 0x00000300, -0x00000000, 0x00001400, 0x00002000, 0x00001400, -0x00000200, 0x00011900, 0x00000000, 0x00000000, -0x0000d500, 0x00011d00, 0x00000000, 0x00001000, -0x00000e00, 0x31317300, 0x31316300, 0x31626300, -0x31630032, 0x31620032, 0x31610032, 0x010f0032, -0x00030000, 0x00000000, 0x00200000, 0x00200000, -0x00140000, 0x00020000, 0x016e0000, 0x00000000, -0x00000000, 0x000e0000, 0x01720000, 0x00000000, -0x00100000, 0x00d50000, 0x31730000, 0x62630032, -0x61003331, 0x62003331, 0x0f003331, 0x03000001, -0x00000000, 0x04000000, 0x10000000, 0x04000000, -0x01000000, 0xbf000000, 0x00000001, 0x00000000, -0x0e000000, 0x73000000, 0x63003331, 0x00343162, -0x00343161, 0x0000010f, 0x00000003, 0x00000000, -0x00000004, 0x00000010, 0x00000004, 0x00000001, -0x000001f8, 0x00000000, 0x00000000, 0x0000000e, -0x00343173, 0x00343162, 0x0000010f, 0x00000003, -0x00000000, 0x00000004, 0x00000010, 0x00000004, -0x00000001, 0x0000022c, 0x00000000, 0x00000000, -0x0000000e, 0x00343174, 0x35316263, 0x00003d00, -0x00000100, 0x00000200, 0x00001800, 0x00001000, -0x00001000, 0x00110a00, 0x35316100, 0x00000400, -0x00001000, 0x00000000, 0x00000400, 0xffffff00, -0x000000ff, 0x00002a00, 0x00000e00, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00002d00, 0x00000e00, 0x00000000, 0x00000400, -0x00000000, 0x00000000, 0x00000000, 0x00003000, -0x00000e00, 0x00000000, 0x00000800, 0x00000000, -0x00000000, 0x00000000, 0x00003300, 0x00000e00, -0x00000000, 0x00000c00, 0x00000000, 0x00000000, -0x00000000, 0x00003600, 0x00001000, 0x00000000, -0x00000200, 0xffffff00, 0x000000ff, 0x00003a00, -0x00000e00, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00006000, 0x00004400, -0x00000000, 0x00000400, 0x00000000, 0x00000000, -0x00000000, 0x00006300, 0x00002000, 0x00000000, -0x00000200, 0xffffff00, 0x000000ff, 0x00006700, -0x00004400, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00008d00, 0x00007100, -0x00000000, 0x00001000, 0x00000000, 0x00000000, -0x00000000, 0x00009000, 0x00003000, 0x00000000, -0x00000300, 0xffffff00, 0x000000ff, 0x00009400, -0x00004400, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00009700, 0x00007100, -0x00000000, 0x00001000, 0x00000000, 0x00000000, -0x00000000, 0x00009a00, 0x00004400, 0x00000000, -0x00002000, 0x00000000, 0x00000000, 0x00000000, -0x00009d00, 0x00002000, 0x00000000, 0x00000300, -0xffffff00, 0x000000ff, 0x0000a100, 0x00004400, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x0000a400, 0x00004400, 0x00000000, -0x00000800, 0x00000000, 0x00000000, 0x00000000, -0x0000a700, 0x00007100, 0x00000000, 0x00001000, -0x00000000, 0x00000000, 0x00000000, 0x0000aa00, -0x00002000, 0x00000000, 0x00000300, 0xffffff00, -0x000000ff, 0x0000ae00, 0x00004400, 0x00000000, -0x00000000, 0x00000000, 0x00000400, 0x00000000, -0x0000b100, 0x00007100, 0x00000000, 0x00001000, -0x00000000, 0x00000400, 0x00000000, 0x0000b400, -0x00004400, 0x00000000, 0x00000800, 0x00000000, -0x00000400, 0x00000000, 0x0000b700, 0x00003000, -0x00000000, 0x00000300, 0xffffff00, 0x000000ff, -0x0000bb00, 0x00004400, 0x00000000, 0x00000000, -0x00000000, 0x00000400, 0x00000000, 0x0000be00, -0x00007100, 0x00000000, 0x00001000, 0x00000000, -0x00000400, 0x00000000, 0x0000c100, 0x00004400, -0x00000000, 0x00002000, 0x00000000, 0x00000400, -0x00000000, 0x0000c400, 0x00003000, 0x00000000, -0x00000300, 0xffffff00, 0x000000ff, 0x0000c800, -0x00004400, 0x00000000, 0x00000000, 0x00000000, -0x00000400, 0x00000000, 0x0000cb00, 0x00007100, -0x00000000, 0x00000400, 0x00000000, 0x00000400, -0x00000000, 0x0000f100, 0x0000d500, 0x00000000, -0x00002000, 0x00000000, 0x00000400, 0x00000000, -0x0000f400, 0x00001000, 0x00000000, 0x00000300, -0xffffff00, 0x000000ff, 0x0000f800, 0x00004400, -0x00000000, 0x00000000, 0x00000000, 0x00000400, -0x00000000, 0x0000fb00, 0x00004400, 0x00000000, -0x00000400, 0x00000000, 0x00000400, 0x00000000, -0x0000fe00, 0x00004400, 0x00000000, 0x00000800, -0x00000000, 0x00000400, 0x00000000, 0x00010100, -0x00003000, 0x00000000, 0x00000100, 0xffffff00, -0x000000ff, 0x00010600, 0x0000d500, 0x00000000, -0x00002000, 0x00000000, 0x00000400, 0x00000000, -0x00010a00, 0x00002000, 0x00000000, 0x00000200, -0xffffff00, 0x000000ff, 0x00015d00, 0x00012100, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00016100, 0x00000e00, 0x00000000, -0x00001400, 0x00000000, 0x00000000, 0x00000000, -0x00016500, 0x00003000, 0x00000000, 0x00000200, -0xffffff00, 0x000000ff, 0x00016a00, 0x00000e00, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x0001b200, 0x00017600, 0x00000000, -0x00001000, 0x00000000, 0x00000000, 0x00000000, -0x0001b600, 0x00002000, 0x00000000, 0x00000200, -0xffffff00, 0x000000ff, 0x0001bb00, 0x00000e00, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x0001ef00, 0x0001c300, 0x00000000, -0x00001000, 0x00000000, 0x00000000, 0x00000000, -0x0001f300, 0x00002000, 0x00000000, 0x00000200, -0xffffff00, 0x000000ff, 0x00022800, 0x0001fc00, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00025c00, 0x00023000, 0x00000000, -0x00001000, 0x00000000, 0x00000000, 0x00000000, -0x00026000, 0x00002000, 0x00000000, 0x00000100, -0xffffff00, 0x000000ff, 0x00028100, 0x00026500, -0x00000000, 0x00000000, 0x00000000, 0x00000400, -0x00000000, 0x00000000, -}; - static void test_effect_constant_buffer_stride(void) { + static char source[] = + "cbuffer cb1\n" + "{\n" + " float a1;\n" + " float b1;\n" + " float c1;\n" + " float d1;\n" + "};\n" + "cbuffer cb2\n" + "{\n" + " float a2;\n" + " float2 b2;\n" + "};\n" + "cbuffer cb3\n" + "{\n" + " float2 a3;\n" + " float3 b3;\n" + "};\n" + "cbuffer cb4\n" + "{\n" + " float2 a4;\n" + " float3 b4;\n" + " float2 c4;\n" + "};\n" + "cbuffer cb5\n" + "{\n" + " float2 a5;\n" + " float2 b5;\n" + " float3 c5;\n" + "};\n" + "cbuffer cb6\n" + "{\n" + " float2 a6 : packoffset(c0);\n" + " float3 b6 : packoffset(c1);\n" + " float2 c6 : packoffset(c0.z);\n" + "};\n" + "cbuffer cb7\n" + "{\n" + " float2 a7 : packoffset(c0);\n" + " float3 b7 : packoffset(c1);\n" + " float2 c7 : packoffset(c2);\n" + "};\n" + "cbuffer cb8\n" + "{\n" + " float2 a8 : packoffset(c0);\n" + " float3 b8 : packoffset(c0.y);\n" + " float4 c8 : packoffset(c2);\n" + "};\n" + "cbuffer cb9\n" + "{\n" + " float2 a9 : packoffset(c0);\n" + " float2 b9 : packoffset(c0.y);\n" + " float2 c9 : packoffset(c0.z);\n" + "};\n" + "cbuffer cb10\n" + "{\n" + " float4 a10 : packoffset(c2);\n" + "};\n" + "cbuffer cb11\n" + "{\n" + " struct {\n" + " float4 a11;\n" + " float b11;\n" + " } s11;\n" + " float c11;\n" + "};\n" + "cbuffer cb12\n" + "{\n" + " float c12;\n" + " struct {\n" + " float b12;\n" + " float4 a12;\n" + " } s12;\n" + "};\n" + "cbuffer cb13\n" + "{\n" + " float a13;\n" + " struct {\n" + " float b13;\n" + " } s13;\n" + "};\n" + "cbuffer cb14\n" + "{\n" + " struct {\n" + " float a14;\n" + " } s14;\n" + " struct {\n" + " float b14;\n" + " } t14;\n" + "};\n" + "cbuffer cb15\n" + "{\n" + " float2 a15[2] : packoffset(c0);\n" + "};"; ID3D10Effect *effect; ID3D10EffectConstantBuffer *constantbuffer; ID3D10EffectType *type; D3D10_EFFECT_TYPE_DESC tdesc; D3D10_EFFECT_DESC effect_desc; ID3D10Device *device; + ID3D10Blob *blob; ULONG refcount; HRESULT hr; unsigned int i; @@ -2638,13 +2407,17 @@ static void test_effect_constant_buffer_stride(void) return; }
- hr = create_effect(fx_test_ecbs, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 15, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 16, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -2687,7 +2460,7 @@ static void test_effect_constant_buffer_stride(void)
for (i=0; i<ARRAY_SIZE(tv_ecbs); i++) { - constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, i); + constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, i + 1); type = constantbuffer->lpVtbl->GetType(constantbuffer);
hr = type->lpVtbl->GetDesc(type, &tdesc); @@ -2707,6 +2480,8 @@ static void test_effect_constant_buffer_stride(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); } @@ -4029,47 +3804,26 @@ if (0) ok(!refcount, "Device has %lu references left.\n", refcount); }
-/* - * test_effect_get_variable_by - */ -#if 0 -cbuffer cb -{ - float f1 : SV_POSITION; - float f2 : COLOR0; -}; -cbuffer cb2 -{ - float f3 : SV_POSITION; - float f4 : COLOR1; -}; -Texture1D tex1 : COLOR2; -Texture1D tex2 : COLOR1; -#endif -static DWORD fx_test_egvb[] = { -0x43425844, 0x63d60ede, 0xf75a09d1, 0x47da5604, 0x7ef6e331, 0x00000001, 0x000001ca, 0x00000001, -0x00000024, 0x30315846, 0x0000019e, 0xfeff1001, 0x00000002, 0x00000004, 0x00000002, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x0000008a, 0x00000000, 0x00000002, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263, -0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900, -0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49, 0x43003266, 0x524f4c4f, 0x62630030, 0x33660032, -0x00346600, 0x4f4c4f43, 0x54003152, 0x75747865, 0x44316572, 0x00005300, 0x00000200, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000a00, 0x78657400, 0x4f430031, 0x32524f4c, 0x78657400, -0x00040032, 0x00100000, 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff, 0x00290000, 0x000d0000, -0x002c0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00380000, 0x000d0000, 0x003b0000, -0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00420000, 0x00100000, 0x00000000, 0x00020000, -0xffff0000, 0x0000ffff, 0x00460000, 0x000d0000, 0x002c0000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00490000, 0x000d0000, 0x004c0000, 0x00040000, 0x00000000, 0x00000000, 0x00000000, -0x00790000, 0x005d0000, 0x007e0000, 0xffff0000, 0x0000ffff, 0x00850000, 0x005d0000, 0x004c0000, -0xffff0000, 0x0000ffff, 0x00000000, -}; - static void test_effect_get_variable_by(void) { + static char source[] = + "cbuffer cb\n" + "{\n" + " float f1 : SV_POSITION;\n" + " float f2 : COLOR0;\n" + "};\n" + "cbuffer cb2\n" + "{\n" + " float f3 : SV_POSITION;\n" + " float f4 : COLOR1;\n" + "};\n" + "Texture1D tex1 : COLOR2;\n" + "Texture1D tex2 : COLOR1;\n"; ID3D10Effect *effect; ID3D10EffectVariable *variable_by_index, *variable, *null_variable; D3D10_EFFECT_DESC effect_desc; ID3D10Device *device; + ID3D10Blob *blob; ULONG refcount; HRESULT hr; UINT size; @@ -4080,13 +3834,17 @@ static void test_effect_get_variable_by(void) return; }
- hr = create_effect(fx_test_egvb, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 2, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 3, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -4187,6 +3945,8 @@ static void test_effect_get_variable_by(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); } @@ -4855,43 +4615,21 @@ static void test_effect_state_groups(void) ok(!refcount, "Device has %lu references left.\n", refcount); }
-#if 0 -RasterizerState rast_state {}; -DepthStencilState ds_state {}; -BlendState blend_state {}; -SamplerState sampler0 {}; - -technique10 tech0 -{ - pass pass0 - <string a="text";> - { - } -}; -#endif -static DWORD fx_test_state_group_defaults[] = -{ - 0x43425844, 0xef2bd174, 0x123794f9, 0xbea23fa0, 0x953a31dd, 0x00000001, 0x00000209, 0x00000001, - 0x00000024, 0x30315846, 0x000001dd, 0xfeff1001, 0x00000000, 0x00000000, 0x00000004, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x0000010d, 0x00000000, 0x00000000, 0x00000001, 0x00000001, - 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x74736152, - 0x7a697265, 0x74537265, 0x00657461, 0x00000004, 0x00000002, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000004, 0x74736172, 0x6174735f, 0x44006574, 0x68747065, 0x6e657453, 0x536c6963, - 0x65746174, 0x00003b00, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000300, - 0x5f736400, 0x74617473, 0x6c420065, 0x53646e65, 0x65746174, 0x00007200, 0x00000200, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x656c6200, 0x735f646e, 0x65746174, 0x6d615300, - 0x72656c70, 0x74617453, 0x00a50065, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00150000, 0x61730000, 0x656c706d, 0x74003072, 0x30686365, 0x73617000, 0x53003073, 0x6e697274, - 0x00e30067, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00610000, - 0x74786574, 0x00003000, 0x00001400, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00006900, - 0x00004d00, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00009900, 0x00007d00, 0x00000000, - 0xffffff00, 0x000000ff, 0x00000000, 0x0000ce00, 0x0000b200, 0x00000000, 0xffffff00, 0x000000ff, - 0x00000000, 0x0000d700, 0x00000100, 0x00000000, 0x0000dd00, 0x00000000, 0x00000100, 0x00010600, - 0x0000ea00, 0x00010800, 0x00000000, -}; - static void test_effect_state_group_defaults(void) { + static char source[] = + "RasterizerState rast_state {};\n" + "DepthStencilState ds_state {};\n" + "BlendState blend_state {};\n" + "SamplerState sampler0 {};\n" + "\n" + "technique10 tech0\n" + "{\n" + " pass pass0\n" + " <string a="text";>\n" + " {\n" + " }\n" + "};"; ID3D10EffectDepthStencilVariable *d; ID3D10EffectRasterizerVariable *r; ID3D10EffectTechnique *technique; @@ -4907,6 +4645,7 @@ static void test_effect_state_group_defaults(void) ID3D10EffectPass *pass; ID3D10Effect *effect; ID3D10Device *device; + ID3D10Blob *blob; unsigned int idx; ULONG refcount; HRESULT hr; @@ -4917,13 +4656,17 @@ static void test_effect_state_group_defaults(void) return; }
- hr = create_effect(fx_test_state_group_defaults, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 0, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -5031,47 +4774,12 @@ static void test_effect_state_group_defaults(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }
-/* - * test_effect_scalar_variable - */ -#if 0 -cbuffer cb -{ - float f0, f_a[2]; - int i0, i_a[2]; - bool b0, b_a[2]; - uint i1, i1_a[2]; -}; -#endif -static DWORD fx_test_scalar_variable[] = -{ - 0x43425844, 0x7d97f44c, 0x1da4b110, 0xb710407e, 0x26750c1c, 0x00000001, 0x00000288, 0x00000001, - 0x00000024, 0x30315846, 0x0000025c, 0xfeff1001, 0x00000001, 0x00000008, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000118, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263, - 0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900, - 0x00306600, 0x00000007, 0x00000001, 0x00000002, 0x00000014, 0x00000010, 0x00000008, 0x00000909, - 0x00615f66, 0x00746e69, 0x0000004c, 0x00000001, 0x00000000, 0x00000004, 0x00000010, 0x00000004, - 0x00000911, 0x4c003069, 0x01000000, 0x02000000, 0x14000000, 0x10000000, 0x08000000, 0x11000000, - 0x69000009, 0x6200615f, 0x006c6f6f, 0x0000008f, 0x00000001, 0x00000000, 0x00000004, 0x00000010, - 0x00000004, 0x00000921, 0x8f003062, 0x01000000, 0x02000000, 0x14000000, 0x10000000, 0x08000000, - 0x21000000, 0x62000009, 0x7500615f, 0x00746e69, 0x000000d3, 0x00000001, 0x00000000, 0x00000004, - 0x00000010, 0x00000004, 0x00000919, 0xd3003169, 0x01000000, 0x02000000, 0x14000000, 0x10000000, - 0x08000000, 0x19000000, 0x69000009, 0x00615f31, 0x00000004, 0x00000090, 0x00000000, 0x00000008, - 0xffffffff, 0x00000000, 0x00000029, 0x0000000d, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000048, 0x0000002c, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, - 0x0000006c, 0x00000050, 0x00000000, 0x00000024, 0x00000000, 0x00000000, 0x00000000, 0x0000008b, - 0x0000006f, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000b0, 0x00000094, - 0x00000000, 0x00000044, 0x00000000, 0x00000000, 0x00000000, 0x000000cf, 0x000000b3, 0x00000000, - 0x00000050, 0x00000000, 0x00000000, 0x00000000, 0x000000f4, 0x000000d8, 0x00000000, 0x00000064, - 0x00000000, 0x00000000, 0x00000000, 0x00000113, 0x000000f7, 0x00000000, 0x00000070, 0x00000000, - 0x00000000, 0x00000000, -}; - static void test_scalar_methods(ID3D10EffectScalarVariable *var, D3D10_SHADER_VARIABLE_TYPE type, const char *name) { @@ -5325,6 +5033,14 @@ static void test_scalar_array_methods(ID3D10EffectScalarVariable *var, D3D10_SHA
static void test_effect_scalar_variable(void) { + static char source[] = + "cbuffer cb\n" + "{\n" + " float f0, f_a[2];\n" + " int i0, i_a[2];\n" + " bool b0, b_a[2];\n" + " uint i1, i1_a[2];\n" + "};"; static const struct { const char *name; @@ -5348,6 +5064,7 @@ static void test_effect_scalar_variable(void) ID3D10EffectType *type; ID3D10Device *device; ID3D10Effect *effect; + ID3D10Blob *blob; unsigned int i; ULONG refcount; HRESULT hr; @@ -5360,13 +5077,17 @@ static void test_effect_scalar_variable(void) return; }
- hr = create_effect(fx_test_scalar_variable, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 2, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -5430,59 +5151,12 @@ static void test_effect_scalar_variable(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }
-/* - * test_effect_vector_variable - */ -#if 0 -cbuffer cb -{ - float4 v_f0, v_f_a[2]; - int3 v_i0, v_i_a[3]; - bool2 v_b0, v_b_a[4]; -}; -#endif -static DWORD fx_test_vector_variable[] = -{ - 0x43425844, 0x581ae0ae, 0xa906b020, 0x26bba03e, - 0x5d7dfba2, 0x00000001, 0x0000021a, 0x00000001, - 0x00000024, 0x30315846, 0x000001ee, 0xfeff1001, - 0x00000001, 0x00000006, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x000000e2, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x66006263, - 0x74616f6c, 0x00070034, 0x00010000, 0x00000000, - 0x00100000, 0x00100000, 0x00100000, 0x210a0000, - 0x5f760000, 0x07003066, 0x01000000, 0x02000000, - 0x20000000, 0x10000000, 0x20000000, 0x0a000000, - 0x76000021, 0x615f665f, 0x746e6900, 0x00510033, - 0x00010000, 0x00000000, 0x000c0000, 0x00100000, - 0x000c0000, 0x19120000, 0x5f760000, 0x51003069, - 0x01000000, 0x03000000, 0x2c000000, 0x10000000, - 0x24000000, 0x12000000, 0x76000019, 0x615f695f, - 0x6f6f6200, 0x9900326c, 0x01000000, 0x00000000, - 0x08000000, 0x10000000, 0x08000000, 0x22000000, - 0x76000011, 0x0030625f, 0x00000099, 0x00000001, - 0x00000004, 0x00000038, 0x00000010, 0x00000020, - 0x00001122, 0x5f625f76, 0x00040061, 0x00c00000, - 0x00000000, 0x00060000, 0xffff0000, 0x0000ffff, - 0x002a0000, 0x000e0000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x004b0000, - 0x002f0000, 0x00000000, 0x00100000, 0x00000000, - 0x00000000, 0x00000000, 0x00720000, 0x00560000, - 0x00000000, 0x00300000, 0x00000000, 0x00000000, - 0x00000000, 0x00930000, 0x00770000, 0x00000000, - 0x00400000, 0x00000000, 0x00000000, 0x00000000, - 0x00bb0000, 0x009f0000, 0x00000000, 0x00700000, - 0x00000000, 0x00000000, 0x00000000, 0x00dc0000, - 0x00c00000, 0x00000000, 0x00800000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, -}; - static void test_vector_methods(ID3D10EffectVectorVariable *var, D3D10_SHADER_VARIABLE_TYPE type, const char *name, unsigned int components) { @@ -5775,6 +5449,13 @@ static void test_vector_array_methods(ID3D10EffectVectorVariable *var, D3D10_SHA
static void test_effect_vector_variable(void) { + static char source[] = + "cbuffer cb\n" + "{\n" + " float4 v_f0, v_f_a[2];\n" + " int3 v_i0, v_i_a[3];\n" + " bool2 v_b0, v_b_a[4];\n" + "};"; static const struct { const char *name; @@ -5796,6 +5477,7 @@ static void test_effect_vector_variable(void) ID3D10EffectType *type; ID3D10Device *device; ID3D10Effect *effect; + ID3D10Blob *blob; unsigned int i; ULONG refcount; HRESULT hr; @@ -5807,13 +5489,17 @@ static void test_effect_vector_variable(void) return; }
- hr = create_effect(fx_test_vector_variable, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 2, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -5858,61 +5544,12 @@ static void test_effect_vector_variable(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }
-/* - * test_effect_matrix_variable - */ -#if 0 -cbuffer cb -{ - float4x4 m_f0; - float4x4 m_f_a[2]; - - row_major int2x3 m_i0; - - bool3x2 m_b0; - bool3x2 m_b_a[2]; -}; -#endif - -static DWORD fx_test_matrix_variable[] = -{ - 0x43425844, 0xc95a5c42, 0xa138d3cb, 0x8a4ef493, - 0x3515b7ee, 0x00000001, 0x000001e2, 0x00000001, - 0x00000024, 0x30315846, 0x000001b6, 0xfeff1001, - 0x00000001, 0x00000005, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x000000c6, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x66006263, - 0x74616f6c, 0x00347834, 0x00000007, 0x00000001, - 0x00000000, 0x00000040, 0x00000040, 0x00000040, - 0x0000640b, 0x30665f6d, 0x00000700, 0x00000100, - 0x00000200, 0x00008000, 0x00004000, 0x00008000, - 0x00640b00, 0x665f6d00, 0x6900615f, 0x7832746e, - 0x00530033, 0x00010000, 0x00000000, 0x001c0000, - 0x00200000, 0x00180000, 0x1a130000, 0x5f6d0000, - 0x62003069, 0x336c6f6f, 0x7b003278, 0x01000000, - 0x00000000, 0x1c000000, 0x20000000, 0x18000000, - 0x23000000, 0x6d000053, 0x0030625f, 0x0000007b, - 0x00000001, 0x00000002, 0x0000003c, 0x00000020, - 0x00000030, 0x00005323, 0x5f625f6d, 0x00040061, - 0x01400000, 0x00000000, 0x00050000, 0xffff0000, - 0x0000ffff, 0x002c0000, 0x00100000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x004d0000, 0x00310000, 0x00000000, 0x00400000, - 0x00000000, 0x00000000, 0x00000000, 0x00760000, - 0x005a0000, 0x00000000, 0x00c00000, 0x00000000, - 0x00000000, 0x00000000, 0x009f0000, 0x00830000, - 0x00000000, 0x00e00000, 0x00000000, 0x00000000, - 0x00000000, 0x00c00000, 0x00a40000, 0x00000000, - 0x01000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, -}; - struct d3d10_matrix { float m[4][4]; @@ -6139,6 +5776,17 @@ static void test_matrix_array_methods(ID3D10EffectMatrixVariable *var, D3D10_SHA
static void test_effect_matrix_variable(void) { + static char source[] = + "cbuffer cb\n" + "{\n" + " float4x4 m_f0;\n" + " float4x4 m_f_a[2];\n" + "\n" + " row_major int2x3 m_i0;\n" + "\n" + " bool3x2 m_b0;\n" + " bool3x2 m_b_a[2];\n" + "};"; static const struct { const char *name; @@ -6159,6 +5807,7 @@ static void test_effect_matrix_variable(void) ID3D10EffectType *type; ID3D10Device *device; ID3D10Effect *effect; + ID3D10Blob *blob; unsigned int i; ULONG refcount; HRESULT hr; @@ -6170,13 +5819,17 @@ static void test_effect_matrix_variable(void) return; }
- hr = create_effect(fx_test_matrix_variable, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, + &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 2, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -6221,6 +5874,8 @@ static void test_effect_matrix_variable(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); } @@ -7559,68 +7214,28 @@ static void test_effect_pool(void) ok(!refcount, "Device has %lu references left.\n", refcount); }
-#if 0 -float4 f4 = {1,2,3,4}; -float2 f2 = {1,2}; -float1 f1 = {1}; -int i = 10; -int i2[2] = {9,12}; -float f = 0.2f; - -struct test -{ - bool b1; - float f2; - bool b2; -}; -test s1 = { true, -0.2f, false }; - -matrix <uint, 2, 3> m1 = { 1, 2, 3, 4, 5, 6 }; -row_major matrix <uint, 2, 3> m2 = { 1, 2, 3, 4, 5, 6 }; -row_major matrix <bool, 2, 3> m3 = { true, false, true, false, true, false }; -float2x2 m4 = { 1.0f, 2.0f, 3.0f, 4.0f }; -#endif -static DWORD fx_test_default_variable_value[] = -{ - 0x43425844, 0x3673286d, 0xd7bb3432, 0xb571508a, 0x5d70cc01, 0x00000001, 0x00000448, 0x00000001, - 0x00000024, 0x30315846, 0x0000041c, 0xfeff1001, 0x00000001, 0x0000000b, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000284, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, - 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010, - 0x00000010, 0x0000210a, 0x00003466, 0x003f8000, 0x00400000, 0x00404000, 0x66408000, 0x74616f6c, - 0x00430032, 0x00010000, 0x00000000, 0x00080000, 0x00100000, 0x00080000, 0x110a0000, 0x32660000, - 0x80000000, 0x0000003f, 0x6f6c6640, 0x00317461, 0x00000071, 0x00000001, 0x00000000, 0x00000004, - 0x00000010, 0x00000004, 0x0000090a, 0x00003166, 0x693f8000, 0x9b00746e, 0x01000000, 0x00000000, - 0x04000000, 0x10000000, 0x04000000, 0x11000000, 0x69000009, 0x00000a00, 0x00009b00, 0x00000100, - 0x00000200, 0x00001400, 0x00001000, 0x00000800, 0x00091100, 0x00326900, 0x00000009, 0x0000000c, - 0x616f6c66, 0x00e80074, 0x00010000, 0x00000000, 0x00040000, 0x00100000, 0x00040000, 0x09090000, - 0x00660000, 0x3e4ccccd, 0x74736574, 0x00316200, 0x6c6f6f62, 0x00011800, 0x00000100, 0x00000000, - 0x00000400, 0x00001000, 0x00000400, 0x00092100, 0x00326200, 0x00000110, 0x00000003, 0x00000000, - 0x0000000c, 0x00000010, 0x0000000c, 0x00000003, 0x00000115, 0x00000000, 0x00000000, 0x0000011d, - 0x00000066, 0x00000000, 0x00000004, 0x000000ee, 0x00000139, 0x00000000, 0x00000008, 0x0000011d, - 0x01003173, 0xcd000000, 0x00be4ccc, 0x75000000, 0x32746e69, 0x97003378, 0x01000001, 0x00000000, - 0x28000000, 0x30000000, 0x18000000, 0x1b000000, 0x6d00005a, 0x00010031, 0x00020000, 0x00030000, - 0x00040000, 0x00050000, 0x00060000, 0x01970000, 0x00010000, 0x00000000, 0x001c0000, 0x00200000, - 0x00180000, 0x1a1b0000, 0x326d0000, 0x00000100, 0x00000200, 0x00000300, 0x00000400, 0x00000500, - 0x00000600, 0x6f6f6200, 0x3378326c, 0x00020d00, 0x00000100, 0x00000000, 0x00001c00, 0x00002000, - 0x00001800, 0x001a2300, 0x00336d00, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, - 0x00000000, 0x616f6c66, 0x32783274, 0x00024c00, 0x00000100, 0x00000000, 0x00001800, 0x00002000, - 0x00001000, 0x00520b00, 0x00346d00, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x00000004, - 0x000000e0, 0x00000000, 0x0000000b, 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000, - 0x00000000, 0x00000033, 0x00000000, 0x00000000, 0x00000066, 0x0000004a, 0x00000000, 0x00000010, - 0x00000069, 0x00000000, 0x00000000, 0x00000094, 0x00000078, 0x00000000, 0x00000018, 0x00000097, - 0x00000000, 0x00000000, 0x000000bb, 0x0000009f, 0x00000000, 0x0000001c, 0x000000bd, 0x00000000, - 0x00000000, 0x000000dd, 0x000000c1, 0x00000000, 0x00000020, 0x000000e0, 0x00000000, 0x00000000, - 0x0000010a, 0x000000ee, 0x00000000, 0x00000034, 0x0000010c, 0x00000000, 0x00000000, 0x00000188, - 0x0000013c, 0x00000000, 0x00000040, 0x0000018b, 0x00000000, 0x00000000, 0x000001bb, 0x0000019f, - 0x00000000, 0x00000050, 0x000001be, 0x00000000, 0x00000000, 0x000001f2, 0x000001d6, 0x00000000, - 0x00000080, 0x000001f5, 0x00000000, 0x00000000, 0x00000231, 0x00000215, 0x00000000, 0x000000a0, - 0x00000234, 0x00000000, 0x00000000, 0x00000271, 0x00000255, 0x00000000, 0x000000c0, 0x00000274, - 0x00000000, 0x00000000, -}; - static void test_effect_default_variable_value(void) { + static char source[] = + "float4 f4 = {1,2,3,4};\n" + "float2 f2 = {1,2};\n" + "float1 f1 = {1};\n" + "int i = 10;\n" + "int i2[2] = {9,12};\n" + "float f = 0.2f;\n" + "\n" + "struct test\n" + "{\n" + " bool b1;\n" + " float f2;\n" + " bool b2;\n" + "};\n" + "test s1 = { true, -0.2f, false };\n" + "\n" + "matrix <uint, 2, 3> m1 = { 1, 2, 3, 4, 5, 6 };\n" + "row_major matrix <uint, 2, 3> m2 = { 1, 2, 3, 4, 5, 6 };\n" + "row_major matrix <bool, 2, 3> m3 = { true, false, true, false, true, false };\n" + "float2x2 m4 = { 1.0f, 2.0f, 3.0f, 4.0f };"; D3D10_EFFECT_VARIABLE_DESC var_desc; ID3D10EffectVectorVariable *vector; ID3D10EffectScalarVariable *scalar; @@ -7631,6 +7246,7 @@ static void test_effect_default_variable_value(void) ID3D10Effect *effect; ID3D10Device *device; int int_v[2], int_s; + ID3D10Blob *blob; ULONG refcount; HRESULT hr; UINT size; @@ -7642,7 +7258,10 @@ static void test_effect_default_variable_value(void) return; }
- hr = create_effect(fx_test_default_variable_value, 0, device, NULL, &effect); + hr = D3D10CompileEffectFromMemory(source, sizeof(source), NULL, NULL, NULL, 0, 0, &blob, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = effect_get_d3d_buffer_size(effect, "$Globals"); @@ -7780,6 +7399,8 @@ static void test_effect_default_variable_value(void)
effect->lpVtbl->Release(effect);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); } @@ -9969,34 +9590,16 @@ static void test_effect_fx_4_1(void) ok(!refcount, "Device has %lu references left.\n", refcount); }
-#if 0 -BlendState blend_state -{ - srcblend = one; -}; -#endif -static DWORD fx_4_1_test_blend_state[] = -{ - 0x43425844, 0xe4566da7, 0x2242fb47, 0xa5924d09, 0x8280296f, 0x00000001, 0x000001a7, 0x00000001, - 0x00000024, 0x30315846, 0x0000017b, 0xfeff1011, 0x00000000, 0x00000000, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000097, 0x00000000, 0x00000000, 0x00000000, 0x00000001, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6e656c42, - 0x61745364, 0x04006574, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, - 0x62000000, 0x646e656c, 0x6174735f, 0x01006574, 0x02000000, 0x02000000, 0x01000000, 0x02000000, - 0x02000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000, - 0x02000000, 0x02000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000, 0x02000000, 0x02000000, - 0x01000000, 0x02000000, 0x02000000, 0x2b000000, 0x0f000000, 0x00000000, 0xff000000, 0x08ffffff, - 0x26000000, 0x00000000, 0x01000000, 0x37000000, 0x26000000, 0x01000000, 0x01000000, 0x43000000, - 0x26000000, 0x02000000, 0x01000000, 0x4f000000, 0x26000000, 0x03000000, 0x01000000, 0x5b000000, - 0x26000000, 0x04000000, 0x01000000, 0x67000000, 0x26000000, 0x05000000, 0x01000000, 0x73000000, - 0x26000000, 0x06000000, 0x01000000, 0x7f000000, 0x26000000, 0x07000000, 0x01000000, 0x8b000000, - 0x00000000, 0x00000000, -}; - static void test_effect_fx_4_1_blend_state(void) { + static const char source[] = + "BlendState blend_state\n" + "{\n" + " srcblend = one;\n" + "};"; ID3D10Effect *effect = NULL; ID3D10Device *device; + ID3D10Blob *blob; ULONG refcount; HRESULT hr;
@@ -10006,9 +9609,14 @@ static void test_effect_fx_4_1_blend_state(void) return; }
- hr = create_effect(fx_4_1_test_blend_state, 0, device, NULL, &effect); + hr = D3DCompile(source, sizeof(source), NULL, NULL, NULL, "main", "fx_4_1", 0, 0, &blob, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = create_effect(ID3D10Blob_GetBufferPointer(blob), 0, device, NULL, &effect); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
+ ID3D10Blob_Release(blob); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); }