d3dcompiler/tests: Build without -DWINE_NO_LONG_TYPES.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-08 19:48:44 +01:00 committed by Alexandre Julliard
parent 7bba86db28
commit 58d20aae37
8 changed files with 378 additions and 375 deletions

View File

@ -1,6 +1,6 @@
TESTDLL = d3dcompiler_43.dll
IMPORTS = d3d9 user32 d3dcompiler_43
EXTRADEFS = -DWINE_NO_LONG_TYPES -DD3D_COMPILER_VERSION=43
EXTRADEFS = -DD3D_COMPILER_VERSION=43
C_SRCS = \
asm.c \

View File

@ -39,7 +39,7 @@ struct shader_test {
static void dump_shader(DWORD *shader) {
unsigned int i = 0, j = 0;
do {
trace("0x%08x ", shader[i]);
trace("0x%08lx ", shader[i]);
j++;
i++;
if(j == 6) trace("\n");
@ -59,7 +59,7 @@ static void exec_tests(const char *name, struct shader_test tests[], unsigned in
messages = NULL;
hr = D3DAssemble(tests[i].text, strlen(tests[i].text), NULL, NULL,
NULL, D3DCOMPILE_SKIP_VALIDATION, &shader, &messages);
ok(hr == S_OK, "Test %s, shader %d: D3DAssemble failed with error 0x%x - %d\n", name, i, hr, hr & 0x0000FFFF);
ok(hr == S_OK, "Test %s, shader %u: D3DAssemble failed with error %#lx - %ld.\n", name, i, hr, hr & 0xffff);
if(messages) {
trace("D3DAssemble messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
ID3D10Blob_Release(messages);
@ -1413,10 +1413,9 @@ static void failure_test(void) {
shader = NULL;
messages = NULL;
hr = D3DAssemble(tests[i], strlen(tests[i]), NULL, NULL, NULL, D3DCOMPILE_SKIP_VALIDATION, &shader, &messages);
ok(hr == D3DXERR_INVALIDDATA, "Failure test, shader %d: "
"expected D3DAssemble failure with D3DXERR_INVALIDDATA, "
"got 0x%x - %d\n", i, hr, hr & 0x0000FFFF);
if(messages) {
ok(hr == D3DXERR_INVALIDDATA, "Test %u: Got unexpected hr %#lx.\n", i, hr);
if (messages)
{
trace("D3DAssemble messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
ID3D10Blob_Release(messages);
}
@ -1539,8 +1538,9 @@ static void assembleshader_test(void) {
shader = NULL;
messages = NULL;
hr = D3DAssemble(test1, strlen(test1), NULL, defines, NULL, D3DCOMPILE_SKIP_VALIDATION, &shader, &messages);
ok(hr == S_OK, "defines test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
if(messages) {
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (messages)
{
trace("D3DAssemble messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
ID3D10Blob_Release(messages);
}
@ -1549,14 +1549,16 @@ static void assembleshader_test(void) {
/* NULL messages test */
shader = NULL;
hr = D3DAssemble(test1, strlen(test1), NULL, defines, NULL, D3DCOMPILE_SKIP_VALIDATION, &shader, NULL);
ok(hr == S_OK, "NULL messages test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
if(shader) ID3D10Blob_Release(shader);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (shader)
ID3D10Blob_Release(shader);
/* NULL shader test */
messages = NULL;
hr = D3DAssemble(test1, strlen(test1), NULL, defines, NULL, D3DCOMPILE_SKIP_VALIDATION, NULL, &messages);
ok(hr == S_OK, "NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
if(messages) {
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (messages)
{
trace("D3DAssemble messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
ID3D10Blob_Release(messages);
}
@ -1567,8 +1569,9 @@ static void assembleshader_test(void) {
include.ID3DInclude_iface.lpVtbl = &D3DInclude_Vtbl;
hr = D3DAssemble(testshader, strlen(testshader), NULL, NULL,
&include.ID3DInclude_iface, D3DCOMPILE_SKIP_VALIDATION, &shader, &messages);
ok(hr == S_OK, "D3DInclude test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
if(messages) {
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (messages)
{
trace("D3DAssemble messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
ID3D10Blob_Release(messages);
}
@ -1578,8 +1581,9 @@ static void assembleshader_test(void) {
shader = NULL;
messages = NULL;
hr = D3DAssemble(NULL, 0, NULL, NULL, NULL, D3DCOMPILE_SKIP_VALIDATION, &shader, &messages);
ok(hr == D3DXERR_INVALIDDATA, "NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
if(messages) {
ok(hr == D3DXERR_INVALIDDATA, "Got unexpected hr %#lx.\n", hr);
if (messages)
{
trace("D3DAssemble messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
ID3D10Blob_Release(messages);
}
@ -1638,7 +1642,7 @@ static void d3dpreprocess_test(void)
shader = NULL;
messages = NULL;
hr = D3DPreprocess(test1, strlen(test1), NULL, defines, NULL, &shader, &messages);
ok(hr == S_OK, "pDefines test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (messages)
{
trace("D3DPreprocess messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
@ -1649,13 +1653,14 @@ static void d3dpreprocess_test(void)
/* NULL messages test */
shader = NULL;
hr = D3DPreprocess(test1, strlen(test1), NULL, defines, NULL, &shader, NULL);
ok(hr == S_OK, "NULL messages test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
if (shader) ID3D10Blob_Release(shader);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (shader)
ID3D10Blob_Release(shader);
/* NULL shader test */
messages = NULL;
hr = D3DPreprocess(test1, strlen(test1), NULL, defines, NULL, NULL, &messages);
ok(hr == E_INVALIDARG, "NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
if (messages)
{
trace("D3DPreprocess messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
@ -1666,7 +1671,7 @@ static void d3dpreprocess_test(void)
shader = NULL;
messages = NULL;
hr = D3DPreprocess(quotation_marks_test, strlen(quotation_marks_test), NULL, NULL, NULL, &shader, &messages);
todo_wine ok(hr == S_OK, "quotation marks test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (messages)
{
trace("D3DPreprocess messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
@ -1682,7 +1687,7 @@ static void d3dpreprocess_test(void)
messages = NULL;
hr = D3DPreprocess(include_test_shaders[i], strlen(include_test_shaders[i]), NULL, NULL,
&include.ID3DInclude_iface, &shader, &messages);
ok(hr == S_OK, "pInclude test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
ok(hr == S_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
if (messages)
{
trace("D3DPreprocess messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
@ -1695,7 +1700,7 @@ static void d3dpreprocess_test(void)
shader = NULL;
messages = NULL;
hr = D3DPreprocess(NULL, 0, NULL, NULL, NULL, &shader, &messages);
ok(hr == E_INVALIDARG, "NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
if (messages)
{
trace("D3DPreprocess messages:\n%s", (char *)ID3D10Blob_GetBufferPointer(messages));
@ -1727,14 +1732,13 @@ static void test_disassemble_shader(void)
hr = D3DDisassemble(vs_2_0, 0, 0, NULL, &blob);
todo_wine
#if D3D_COMPILER_VERSION >= 46
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
#else
ok(hr == E_FAIL, "Unexpected hr %#x.\n", hr);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
#endif
hr = D3DDisassemble(vs_2_0, sizeof(vs_2_0), 0, NULL, &blob);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
ID3D10Blob_Release(blob);
}

View File

@ -57,16 +57,16 @@ static void test_create_blob(void)
ULONG refcount;
hr = D3DCreateBlob(1, NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DCreateBlob failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DCreateBlob(0, NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DCreateBlob failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DCreateBlob(0, &blob);
ok(hr == S_OK, "D3DCreateBlob failed with %x\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
}
static const D3D_BLOB_PART parts[] =
@ -128,55 +128,55 @@ static void test_get_blob_part(void)
#endif
hr = D3DCreateBlob(1, &blob2);
ok(hr == S_OK, "D3DCreateBlob failed with %x\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
blob = blob2;
/* invalid cases */
hr = D3DGetBlobPart(NULL, test_blob_part[6], D3D_BLOB_INPUT_SIGNATURE_BLOB, 0, &blob);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
ok(blob2 == blob, "D3DGetBlobPart failed got %p, expected %p\n", blob, blob2);
hr = D3DGetBlobPart(NULL, 0, D3D_BLOB_INPUT_SIGNATURE_BLOB, 0, &blob);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
ok(blob2 == blob, "D3DGetBlobPart failed got %p, expected %p\n", blob, blob2);
hr = D3DGetBlobPart(NULL, test_blob_part[6], D3D_BLOB_INPUT_SIGNATURE_BLOB, 0, NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DGetBlobPart(NULL, 0, D3D_BLOB_INPUT_SIGNATURE_BLOB, 0, NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DGetBlobPart(test_blob_part, 0, D3D_BLOB_INPUT_SIGNATURE_BLOB, 0, &blob);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
ok(blob2 == blob, "D3DGetBlobPart failed got %p, expected %p\n", blob, blob2);
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_INPUT_SIGNATURE_BLOB, 0, NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DGetBlobPart(test_blob_part, 0, D3D_BLOB_INPUT_SIGNATURE_BLOB, 0, NULL);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_INPUT_SIGNATURE_BLOB, 1, &blob);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
ok(blob2 == blob, "D3DGetBlobPart failed got %p, expected %p\n", blob, blob2);
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], 0xffffffff, 0, &blob);
ok(hr == D3DERR_INVALIDCALL, "D3DGetBlobPart failed with %x\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
ok(blob2 == blob, "D3DGetBlobPart failed got %p, expected %p\n", blob, blob2);
refcount = ID3D10Blob_Release(blob2);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_INPUT_SIGNATURE_BLOB */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_INPUT_SIGNATURE_BLOB, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 124, "GetBufferSize failed, got %lu, expected %u\n", size, 124);
ok(size == 124, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_ISGN == *(dword+9), "ISGN got %#x, expected %#x.\n", *(dword+9), TAG_ISGN);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_ISGN == *(dword + 9), "ISGN got %#lx, expected %#lx.\n", *(dword + 9), TAG_ISGN);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -184,30 +184,30 @@ static void test_get_blob_part(void)
if (parts[i] == D3D_BLOB_INPUT_SIGNATURE_BLOB)
{
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob2);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
}
else
{
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
}
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_OUTPUT_SIGNATURE_BLOB */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_OUTPUT_SIGNATURE_BLOB, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 88, "GetBufferSize failed, got %lu, expected %u\n", size, 88);
ok(size == 88, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_OSGN == *(dword+9), "OSGN got %#x, expected %#x.\n", *(dword+9), TAG_OSGN);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_OSGN == *(dword + 9), "OSGN got %#lx, expected %#lx.\n", *(dword + 9), TAG_OSGN);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -215,31 +215,31 @@ static void test_get_blob_part(void)
if (parts[i] == D3D_BLOB_OUTPUT_SIGNATURE_BLOB)
{
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob2);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
}
else
{
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
}
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 180, "GetBufferSize failed, got %lu, expected %u\n", size, 180);
ok(size == 180, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_ISGN == *(dword+10), "ISGN got %#x, expected %#x.\n", *(dword+10), TAG_ISGN);
ok(TAG_OSGN == *(dword+32), "OSGN got %#x, expected %#x.\n", *(dword+32), TAG_OSGN);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_ISGN == *(dword + 10), "ISGN got %#lx, expected %#lx.\n", *(dword + 10), TAG_ISGN);
ok(TAG_OSGN == *(dword + 32), "OSGN got %#lx, expected %#lx.\n", *(dword + 32), TAG_OSGN);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -249,41 +249,41 @@ static void test_get_blob_part(void)
|| parts[i] == D3D_BLOB_INPUT_SIGNATURE_BLOB
|| parts[i] == D3D_BLOB_OUTPUT_SIGNATURE_BLOB)
{
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob2);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
}
else
{
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
}
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB, 0, &blob);
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* D3D_BLOB_ALL_SIGNATURE_BLOB */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_ALL_SIGNATURE_BLOB, 0, &blob);
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* D3D_BLOB_DEBUG_INFO */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_DEBUG_INFO, 0, &blob);
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* D3D_BLOB_LEGACY_SHADER */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_LEGACY_SHADER, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 92, "GetBufferSize failed, got %lu, expected %u\n", size, 92);
ok(size == 92, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(test_blob_part[0] != *dword, "DXBC failed got %#x.\n", *dword);
ok(test_blob_part[0] != *dword, "DXBC failed got %#lx.\n", *dword);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -292,21 +292,21 @@ static void test_get_blob_part(void)
#if D3D_COMPILER_VERSION >= 46
todo_wine
#endif
ok(hr == expected, "D3DGetBlobPart failed, got %x, expected %x\n", hr, expected);
ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_XNA_PREPASS_SHADER */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_XNA_PREPASS_SHADER, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 68, "GetBufferSize failed, got %lu, expected %u\n", size, 68);
ok(size == 68, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(test_blob_part[0] != *dword, "DXBC failed got %#x.\n", *dword);
ok(test_blob_part[0] != *dword, "DXBC failed got %#lx.\n", *dword);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -315,21 +315,21 @@ static void test_get_blob_part(void)
#if D3D_COMPILER_VERSION >= 46
todo_wine
#endif
ok(hr == expected, "D3DGetBlobPart failed, got %x, expected %x\n", hr, expected);
ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_XNA_SHADER */
hr = D3DGetBlobPart(test_blob_part, test_blob_part[6], D3D_BLOB_XNA_SHADER, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 68, "GetBufferSize failed, got %lu, expected %u\n", size, 68);
ok(size == 68, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(test_blob_part[0] != *dword, "DXBC failed got %#x.\n", *dword);
ok(test_blob_part[0] != *dword, "DXBC failed got %#lx.\n", *dword);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -338,82 +338,82 @@ static void test_get_blob_part(void)
#if D3D_COMPILER_VERSION >= 46
todo_wine
#endif
ok(hr == expected, "D3DGetBlobPart failed, got %x, expected %x\n", hr, expected);
ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* check corner cases for D3DStripShader */
hr = D3DStripShader(test_blob_part, test_blob_part[6], 0xffffffff, &blob);
ok(hr == S_OK, "D3DStripShader failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
hr = D3DStripShader(test_blob_part, test_blob_part[6], 0, &blob);
ok(hr == S_OK, "D3DStripShader failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
hr = D3DStripShader(NULL, test_blob_part[6], 0, &blob);
ok(hr == D3DERR_INVALIDCALL, "D3DStripShader failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DStripShader(test_blob_part, 2, 0, &blob);
ok(hr == D3DERR_INVALIDCALL, "D3DStripShader failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DStripShader(test_blob_part, test_blob_part[6], 0, NULL);
ok(hr == E_FAIL, "D3DStripShader failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = D3DStripShader(NULL, test_blob_part[6], 0, NULL);
ok(hr == E_FAIL, "D3DStripShader failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = D3DStripShader(test_blob_part, 0, 0, NULL);
ok(hr == E_FAIL, "D3DStripShader failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* D3DCOMPILER_STRIP_DEBUG_INFO */
hr = D3DStripShader(test_blob_part, test_blob_part[6], D3DCOMPILER_STRIP_DEBUG_INFO, &blob);
ok(hr == S_OK, "D3DStripShader failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 736, "GetBufferSize failed, got %lu, expected %u\n", size, 736);
ok(size == 736, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_XNAS == *(dword+16), "XNAS got %#x, expected %#x.\n", *(dword+16), TAG_XNAS);
ok(TAG_XNAP == *(dword+35), "XNAP got %#x, expected %#x.\n", *(dword+35), TAG_XNAP);
ok(TAG_Aon9 == *(dword+54), "Aon9 got %#x, expected %#x.\n", *(dword+54), TAG_Aon9);
ok(TAG_SHDR == *(dword+79), "SHDR got %#x, expected %#x.\n", *(dword+79), TAG_SHDR);
ok(TAG_STAT == *(dword+96), "STAT got %#x, expected %#x.\n", *(dword+96), TAG_STAT);
ok(TAG_RDEF == *(dword+127), "RDEF got %#x, expected %#x.\n", *(dword+127), TAG_RDEF);
ok(TAG_ISGN == *(dword+149), "ISGN got %#x, expected %#x.\n", *(dword+149), TAG_ISGN);
ok(TAG_OSGN == *(dword+171), "OSGN got %#x, expected %#x.\n", *(dword+171), TAG_OSGN);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_XNAS == *(dword + 16), "XNAS got %#lx, expected %#lx.\n", *(dword + 16), TAG_XNAS);
ok(TAG_XNAP == *(dword + 35), "XNAP got %#lx, expected %#lx.\n", *(dword + 35), TAG_XNAP);
ok(TAG_Aon9 == *(dword + 54), "Aon9 got %#lx, expected %#lx.\n", *(dword + 54), TAG_Aon9);
ok(TAG_SHDR == *(dword + 79), "SHDR got %#lx, expected %#lx.\n", *(dword + 79), TAG_SHDR);
ok(TAG_STAT == *(dword + 96), "STAT got %#lx, expected %#lx.\n", *(dword + 96), TAG_STAT);
ok(TAG_RDEF == *(dword + 127), "RDEF got %#lx, expected %#lx.\n", *(dword + 127), TAG_RDEF);
ok(TAG_ISGN == *(dword + 149), "ISGN got %#lx, expected %#lx.\n", *(dword + 149), TAG_ISGN);
ok(TAG_OSGN == *(dword + 171), "OSGN got %#lx, expected %#lx.\n", *(dword + 171), TAG_OSGN);
hr = D3DGetBlobPart(dword, size, D3D_BLOB_DEBUG_INFO, 0, &blob2);
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3DCOMPILER_STRIP_REFLECTION_DATA */
hr = D3DStripShader(test_blob_part, test_blob_part[6], D3DCOMPILER_STRIP_REFLECTION_DATA, &blob);
ok(hr == S_OK, "D3DStripShader failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 516, "GetBufferSize failed, got %lu, expected %u\n", size, 516);
ok(size == 516, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_XNAS == *(dword+14), "XNAS got %#x, expected %#x.\n", *(dword+14), TAG_XNAS);
ok(TAG_XNAP == *(dword+33), "XNAP got %#x, expected %#x.\n", *(dword+33), TAG_XNAP);
ok(TAG_Aon9 == *(dword+52), "Aon9 got %#x, expected %#x.\n", *(dword+52), TAG_Aon9);
ok(TAG_SHDR == *(dword+77), "SHDR got %#x, expected %#x.\n", *(dword+77), TAG_SHDR);
ok(TAG_ISGN == *(dword+94), "ISGN got %#x, expected %#x.\n", *(dword+94), TAG_ISGN);
ok(TAG_OSGN == *(dword+116), "OSGN got %#x, expected %#x.\n", *(dword+116), TAG_OSGN);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_XNAS == *(dword + 14), "XNAS got %#lx, expected %#lx.\n", *(dword + 14), TAG_XNAS);
ok(TAG_XNAP == *(dword + 33), "XNAP got %#lx, expected %#lx.\n", *(dword + 33), TAG_XNAP);
ok(TAG_Aon9 == *(dword + 52), "Aon9 got %#lx, expected %#lx.\n", *(dword + 52), TAG_Aon9);
ok(TAG_SHDR == *(dword + 77), "SHDR got %#lx, expected %#lx.\n", *(dword + 77), TAG_SHDR);
ok(TAG_ISGN == *(dword + 94), "ISGN got %#lx, expected %#lx.\n", *(dword + 94), TAG_ISGN);
ok(TAG_OSGN == *(dword + 116), "OSGN got %#lx, expected %#lx.\n", *(dword + 116), TAG_OSGN);
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
}
/*
@ -619,14 +619,14 @@ static void test_get_blob_part2(void)
/* D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB */
hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 232, "GetBufferSize failed, got %lu, expected %u\n", size, 232);
ok(size == 232, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_PCSG == *(dword+9), "PCSG got %#x, expected %#x.\n", *(dword+9), TAG_PCSG);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_PCSG == *(dword + 9), "PCSG got %#lx, expected %#lx.\n", *(dword + 9), TAG_PCSG);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -634,32 +634,32 @@ static void test_get_blob_part2(void)
if (parts[i] == D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB)
{
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob2);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
}
else
{
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
}
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_ALL_SIGNATURE_BLOB */
hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_ALL_SIGNATURE_BLOB, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 344, "GetBufferSize failed, got %lu, expected %u\n", size, 344);
ok(size == 344, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_ISGN == *(dword+11), "ISGN got %#x, expected %#x.\n", *(dword+11), TAG_ISGN);
ok(TAG_OSGN == *(dword+24), "OSGN got %#x, expected %#x.\n", *(dword+24), TAG_OSGN);
ok(TAG_PCSG == *(dword+37), "PCSG got %#x, expected %#x.\n", *(dword+37), TAG_PCSG);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_ISGN == *(dword + 11), "ISGN got %#lx, expected %#lx.\n", *(dword + 11), TAG_ISGN);
ok(TAG_OSGN == *(dword + 24), "OSGN got %#lx, expected %#lx.\n", *(dword + 24), TAG_OSGN);
ok(TAG_PCSG == *(dword + 37), "PCSG got %#lx, expected %#lx.\n", *(dword + 37), TAG_PCSG);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -671,29 +671,29 @@ static void test_get_blob_part2(void)
|| parts[i] == D3D_BLOB_INPUT_SIGNATURE_BLOB
|| parts[i] == D3D_BLOB_OUTPUT_SIGNATURE_BLOB)
{
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob2);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
}
else
{
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
}
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_DEBUG_INFO */
hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_DEBUG_INFO, 0, &blob);
ok(hr == S_OK, "D3DGetBlobPart failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 4055, "GetBufferSize failed, got %lu, expected %u\n", size, 4055);
ok(size == 4055, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC != *dword, "DXBC failed got %#x.\n", *dword);
ok(TAG_DXBC != *dword, "DXBC failed got %#lx.\n", *dword);
for (i = 0; i < ARRAY_SIZE(parts); i++)
{
@ -702,63 +702,63 @@ static void test_get_blob_part2(void)
#if D3D_COMPILER_VERSION >= 46
todo_wine
#endif
ok(hr == expected, "D3DGetBlobPart failed, got %x, expected %x\n", hr, expected);
ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
}
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3D_BLOB_LEGACY_SHADER */
hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_LEGACY_SHADER, 0, &blob);
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* D3D_BLOB_XNA_PREPASS_SHADER */
hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_XNA_PREPASS_SHADER, 0, &blob);
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* D3D_BLOB_XNA_SHADER */
hr = D3DGetBlobPart(test_blob_part2, test_blob_part2[6], D3D_BLOB_XNA_SHADER, 0, &blob);
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* D3DCOMPILER_STRIP_DEBUG_INFO */
hr = D3DStripShader(test_blob_part2, test_blob_part2[6], D3DCOMPILER_STRIP_DEBUG_INFO, &blob);
ok(hr == S_OK, "D3DStripShader failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 952, "GetBufferSize failed, got %lu, expected %u\n", size, 952);
ok(size == 952, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_RDEF == *(dword+14), "RDEF got %#x, expected %#x.\n", *(dword+14), TAG_RDEF);
ok(TAG_ISGN == *(dword+44), "ISGN got %#x, expected %#x.\n", *(dword+44), TAG_ISGN);
ok(TAG_OSGN == *(dword+57), "OSGN got %#x, expected %#x.\n", *(dword+57), TAG_OSGN);
ok(TAG_PCSG == *(dword+70), "PCSG got %#x, expected %#x.\n", *(dword+70), TAG_PCSG);
ok(TAG_SHEX == *(dword+119), "SHEX got %#x, expected %#x.\n", *(dword+119), TAG_SHEX);
ok(TAG_STAT == *(dword+199), "STAT got %#x, expected %#x.\n", *(dword+199), TAG_STAT);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_RDEF == *(dword + 14), "RDEF got %#lx, expected %#lx.\n", *(dword + 14), TAG_RDEF);
ok(TAG_ISGN == *(dword + 44), "ISGN got %#lx, expected %#lx.\n", *(dword + 44), TAG_ISGN);
ok(TAG_OSGN == *(dword + 57), "OSGN got %#lx, expected %#lx.\n", *(dword + 57), TAG_OSGN);
ok(TAG_PCSG == *(dword + 70), "PCSG got %#lx, expected %#lx.\n", *(dword + 70), TAG_PCSG);
ok(TAG_SHEX == *(dword + 119), "SHEX got %#lx, expected %#lx.\n", *(dword + 119), TAG_SHEX);
ok(TAG_STAT == *(dword + 199), "STAT got %#lx, expected %#lx.\n", *(dword + 199), TAG_STAT);
hr = D3DGetBlobPart(dword, size, D3D_BLOB_DEBUG_INFO, 0, &blob2);
ok(hr == E_FAIL, "D3DGetBlobPart failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
/* D3DCOMPILER_STRIP_REFLECTION_DATA */
hr = D3DStripShader(test_blob_part2, test_blob_part2[6], D3DCOMPILER_STRIP_REFLECTION_DATA, &blob);
ok(hr == S_OK, "D3DStripShader failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
size = ID3D10Blob_GetBufferSize(blob);
ok(size == 4735, "GetBufferSize failed, got %lu, expected %u\n", size, 4735);
ok(size == 4735, "Got unexpected size %Iu.\n", size);
dword = ((DWORD*)ID3D10Blob_GetBufferPointer(blob));
ok(TAG_DXBC == *dword, "DXBC got %#x, expected %#x.\n", *dword, TAG_DXBC);
ok(TAG_ISGN == *(dword+13), "ISGN got %#x, expected %#x.\n", *(dword+13), TAG_ISGN);
ok(TAG_OSGN == *(dword+26), "OSGN got %#x, expected %#x.\n", *(dword+26), TAG_OSGN);
ok(TAG_PCSG == *(dword+39), "PCSG got %#x, expected %#x.\n", *(dword+39), TAG_PCSG);
ok(TAG_SHEX == *(dword+88), "SHEX got %#x, expected %#x.\n", *(dword+88), TAG_SHEX);
ok(TAG_SDBG == *(dword+168), "SDBG got %#x, expected %#x.\n", *(dword+168), TAG_SDBG);
ok(TAG_DXBC == *dword, "DXBC got %#lx, expected %#lx.\n", *dword, TAG_DXBC);
ok(TAG_ISGN == *(dword + 13), "ISGN got %#lx, expected %#lx.\n", *(dword + 13), TAG_ISGN);
ok(TAG_OSGN == *(dword + 26), "OSGN got %#lx, expected %#lx.\n", *(dword + 26), TAG_OSGN);
ok(TAG_PCSG == *(dword + 39), "PCSG got %#lx, expected %#lx.\n", *(dword + 39), TAG_PCSG);
ok(TAG_SHEX == *(dword + 88), "SHEX got %#lx, expected %#lx.\n", *(dword + 88), TAG_SHEX);
ok(TAG_SDBG == *(dword + 168), "SDBG got %#lx, expected %#lx.\n", *(dword + 168), TAG_SDBG);
refcount = ID3D10Blob_Release(blob);
ok(!refcount, "ID3DBlob has %u references left\n", refcount);
ok(!refcount, "ID3DBlob has %lu references left.\n", refcount);
}
#if D3D_COMPILER_VERSION >= 46
@ -820,10 +820,10 @@ static void test_D3DReadFileToBlob(void)
HRESULT hr;
hr = D3DReadFileToBlob(filename, NULL);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#x.\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#lx.\n", hr);
hr = D3DReadFileToBlob(filename, &blob);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#x.\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#lx.\n", hr);
if (0)
{
@ -839,7 +839,7 @@ static void test_D3DReadFileToBlob(void)
return;
}
hr = D3DReadFileToBlob(filename, &blob);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
data_size = ID3D10Blob_GetBufferSize(blob);
ok(!data_size, "Got unexpected data size.\n");
DeleteFileW(filename);
@ -851,7 +851,7 @@ static void test_D3DReadFileToBlob(void)
return;
}
hr = D3DReadFileToBlob(filename, &blob);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
data_size = ID3D10Blob_GetBufferSize(blob);
ok(data_size == ARRAY_SIZE(test_cso_data), "Got unexpected data size.\n");
data = ID3D10Blob_GetBufferPointer(blob);
@ -870,21 +870,21 @@ static void test_D3DWriteBlobToFile(void)
GetTempFileNameW(temp_dir, NULL, 0, filename);
hr = D3DCreateBlob(16, &blob);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = D3DWriteBlobToFile(blob, filename, FALSE);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "Unexpected hr %#x.\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "Got unexpected hr %#lx.\n", hr);
hr = D3DWriteBlobToFile(blob, filename, TRUE);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
DeleteFileW(filename);
hr = D3DWriteBlobToFile(blob, filename, FALSE);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = D3DWriteBlobToFile(blob, filename, FALSE);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "Unexpected hr %#x.\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "Got unexpected hr %#lx.\n", hr);
DeleteFileW(filename);

View File

@ -47,7 +47,7 @@ static ID3D10Blob *compile_shader_(unsigned int line, const char *source, const
HRESULT hr;
hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", target, flags, 0, &blob, &errors);
ok_(__FILE__, line)(hr == S_OK, "Failed to compile shader, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == S_OK, "Failed to compile shader, hr %#lx.\n", hr);
if (errors)
{
if (winetest_debug > 1)
@ -128,12 +128,12 @@ static IDXGISwapChain *create_swapchain(ID3D11Device *device, HWND window)
HRESULT hr;
hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device);
ok(SUCCEEDED(hr), "Failed to get DXGI device, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDXGIDevice_GetAdapter(dxgi_device, &adapter);
ok(SUCCEEDED(hr), "Failed to get adapter, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
IDXGIDevice_Release(dxgi_device);
hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory);
ok(SUCCEEDED(hr), "Failed to get factory, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
IDXGIAdapter_Release(adapter);
dxgi_desc.BufferDesc.Width = 640;
@ -153,7 +153,7 @@ static IDXGISwapChain *create_swapchain(ID3D11Device *device, HWND window)
dxgi_desc.Flags = 0;
hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &dxgi_desc, &swapchain);
ok(SUCCEEDED(hr), "Failed to create swapchain, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
IDXGIFactory_Release(factory);
return swapchain;
@ -195,10 +195,10 @@ static BOOL init_test_context_(unsigned int line, struct test_context *context)
context->swapchain = create_swapchain(context->device, context->window);
hr = ID3D11Device_CreateTexture2D(context->device, &texture_desc, NULL, &context->rt);
ok_(__FILE__, line)(hr == S_OK, "Failed to create texture, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == S_OK, "Failed to create texture, hr %#lx.\n", hr);
hr = ID3D11Device_CreateRenderTargetView(context->device, (ID3D11Resource *)context->rt, NULL, &context->rtv);
ok_(__FILE__, line)(hr == S_OK, "Failed to create rendertarget view, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == S_OK, "Failed to create rendertarget view, hr %#lx.\n", hr);
ID3D11Device_GetImmediateContext(context->device, &context->immediate_context);
@ -234,7 +234,7 @@ static void release_test_context_(unsigned int line, struct test_context *contex
DestroyWindow(context->window);
ref = ID3D11Device_Release(context->device);
ok_(__FILE__, line)(!ref, "Device has %u references left.\n", ref);
ok_(__FILE__, line)(!ref, "Device has %lu references left.\n", ref);
}
#define create_buffer(a, b, c, d) create_buffer_(__LINE__, a, b, c, d)
@ -252,7 +252,7 @@ static ID3D11Buffer *create_buffer_(unsigned int line, ID3D11Device *device,
HRESULT hr;
hr = ID3D11Device_CreateBuffer(device, &buffer_desc, data ? &resource_data : NULL, &buffer);
ok_(__FILE__, line)(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == S_OK, "Failed to create buffer, hr %#lx.\n", hr);
return buffer;
}
@ -289,11 +289,11 @@ static void draw_quad_(unsigned int line, struct test_context *context, ID3D10Bl
hr = ID3D11Device_CreateInputLayout(device, default_layout_desc, ARRAY_SIZE(default_layout_desc),
ID3D10Blob_GetBufferPointer(vs_code), ID3D10Blob_GetBufferSize(vs_code), &context->input_layout);
ok_(__FILE__, line)(hr == S_OK, "Failed to create input layout, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == S_OK, "Failed to create input layout, hr %#lx.\n", hr);
hr = ID3D11Device_CreateVertexShader(device, ID3D10Blob_GetBufferPointer(vs_code),
ID3D10Blob_GetBufferSize(vs_code), NULL, &context->vs);
ok_(__FILE__, line)(hr == S_OK, "Failed to create vertex shader, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == S_OK, "Failed to create vertex shader, hr %#lx.\n", hr);
}
if (!context->vb)
@ -301,7 +301,7 @@ static void draw_quad_(unsigned int line, struct test_context *context, ID3D10Bl
hr = ID3D11Device_CreatePixelShader(device, ID3D10Blob_GetBufferPointer(ps_code),
ID3D10Blob_GetBufferSize(ps_code), NULL, &ps);
ok_(__FILE__, line)(hr == S_OK, "Failed to create pixel shader, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == S_OK, "Failed to create pixel shader, hr %#lx.\n", hr);
ID3D11DeviceContext_IASetInputLayout(context->immediate_context, context->input_layout);
ID3D11DeviceContext_IASetPrimitiveTopology(context->immediate_context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
@ -333,11 +333,11 @@ static void init_readback(struct test_context *context, struct readback *rb)
texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
texture_desc.MiscFlags = 0;
hr = ID3D11Device_CreateTexture2D(context->device, &texture_desc, NULL, (ID3D11Texture2D **)&rb->resource);
ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ID3D11DeviceContext_CopyResource(context->immediate_context, rb->resource, (ID3D11Resource *)context->rt);
hr = ID3D11DeviceContext_Map(context->immediate_context, rb->resource, 0, D3D11_MAP_READ, 0, &rb->map_desc);
ok(hr == S_OK, "Failed to map texture, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
}
static void release_readback(struct test_context *context, struct readback *rb)
@ -604,16 +604,16 @@ static void test_sampling(void)
return;
hr = ID3D11Device_CreateTexture2D(test_context.device, &texture_desc, &resource_data, &texture);
ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srv_desc.Texture2D.MipLevels = 1;
hr = ID3D11Device_CreateShaderResourceView(test_context.device, (ID3D11Resource *)texture, &srv_desc, &srv);
ok(hr == S_OK, "Failed to create SRV, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ID3D11DeviceContext_PSSetShaderResources(test_context.immediate_context, 0, 1, &srv);
hr = ID3D11Device_CreateSamplerState(test_context.device, &sampler_desc, &sampler);
ok(hr == S_OK, "Failed to create sampler, hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ID3D11DeviceContext_PSSetSamplers(test_context.immediate_context, 0, 1, &sampler);
for (i = 0; i < ARRAY_SIZE(tests); ++i)
@ -831,10 +831,10 @@ static void test_reflection(void)
hr = D3DReflect(ID3D10Blob_GetBufferPointer(code), ID3D10Blob_GetBufferSize(code),
&IID_ID3D11ShaderReflection, (void **)&reflection);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = reflection->lpVtbl->GetDesc(reflection, &shader_desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(shader_desc.ConstantBuffers == ARRAY_SIZE(vs_buffers), "Got %u buffers.\n", shader_desc.ConstantBuffers);
ok(shader_desc.BoundResources == ARRAY_SIZE(vs_bindings), "Got %u resources.\n", shader_desc.BoundResources);
@ -844,7 +844,7 @@ static void test_reflection(void)
cbuffer = reflection->lpVtbl->GetConstantBufferByIndex(reflection, i);
hr = cbuffer->lpVtbl->GetDesc(cbuffer, &buffer_desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!strcmp(buffer_desc.Name, vs_buffers[i].desc.Name), "Got name %s.\n", debugstr_a(buffer_desc.Name));
ok(buffer_desc.Type == vs_buffers[i].desc.Type, "Got type %#x.\n", buffer_desc.Type);
ok(buffer_desc.Variables == vs_buffers[i].desc.Variables, "Got %u variables.\n", buffer_desc.Variables);
@ -859,7 +859,7 @@ static void test_reflection(void)
var = cbuffer->lpVtbl->GetVariableByIndex(cbuffer, j);
hr = var->lpVtbl->GetDesc(var, &var_desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!strcmp(var_desc.Name, expect->var_desc.Name), "Got name %s.\n", debugstr_a(var_desc.Name));
ok(var_desc.StartOffset == expect->var_desc.StartOffset, "Got offset %u.\n", var_desc.StartOffset);
ok(var_desc.Size == expect->var_desc.Size, "Got size %u.\n", var_desc.Size);
@ -868,7 +868,7 @@ static void test_reflection(void)
type = var->lpVtbl->GetType(var);
hr = type->lpVtbl->GetDesc(type, &type_desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
check_type_desc(&type_desc, &expect->type_desc);
for (k = 0; k < type_desc.Members; ++k)
@ -877,7 +877,7 @@ static void test_reflection(void)
field = type->lpVtbl->GetMemberTypeByIndex(type, k);
hr = field->lpVtbl->GetDesc(field, &type_desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
check_type_desc(&type_desc, &vs_buffers[i].vars[j].field_types[k]);
winetest_pop_context();
@ -896,7 +896,7 @@ static void test_reflection(void)
winetest_push_context("Binding %u", i);
hr = reflection->lpVtbl->GetResourceBindingDesc(reflection, i, &desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
check_resource_binding(&desc, &vs_bindings[i]);
winetest_pop_context();
@ -904,15 +904,15 @@ static void test_reflection(void)
ID3D10Blob_Release(code);
refcount = reflection->lpVtbl->Release(reflection);
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
code = compile_shader_flags(ps_source, "ps_4_0", D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY);
hr = D3DReflect(ID3D10Blob_GetBufferPointer(code), ID3D10Blob_GetBufferSize(code),
&IID_ID3D11ShaderReflection, (void **)&reflection);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = reflection->lpVtbl->GetDesc(reflection, &shader_desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!shader_desc.ConstantBuffers, "Got %u buffers.\n", shader_desc.ConstantBuffers);
ok(shader_desc.BoundResources == ARRAY_SIZE(ps_bindings), "Got %u resources.\n", shader_desc.BoundResources);
@ -923,7 +923,7 @@ static void test_reflection(void)
winetest_push_context("Binding %u", i);
hr = reflection->lpVtbl->GetResourceBindingDesc(reflection, i, &desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
check_resource_binding(&desc, &ps_bindings[i]);
winetest_pop_context();
@ -931,7 +931,7 @@ static void test_reflection(void)
ID3D10Blob_Release(code);
refcount = reflection->lpVtbl->Release(reflection);
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
}
static void check_parameter_desc(const D3D11_SIGNATURE_PARAMETER_DESC *desc,
@ -1139,10 +1139,10 @@ static void test_semantic_reflection(void)
hr = D3DReflect(ID3D10Blob_GetBufferPointer(code), ID3D10Blob_GetBufferSize(code),
&IID_ID3D11ShaderReflection, (void **)&reflection);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = reflection->lpVtbl->GetDesc(reflection, &shader_desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(shader_desc.InputParameters == tests[i].input_count,
"Got %u input parameters.\n", shader_desc.InputParameters);
todo_wine ok(shader_desc.OutputParameters == tests[i].output_count,
@ -1152,7 +1152,7 @@ static void test_semantic_reflection(void)
{
winetest_push_context("Input %u", j);
hr = reflection->lpVtbl->GetInputParameterDesc(reflection, j, &desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
check_parameter_desc(&desc, &tests[i].inputs[j]);
winetest_pop_context();
}
@ -1161,14 +1161,14 @@ static void test_semantic_reflection(void)
{
winetest_push_context("Output %u", j);
hr = reflection->lpVtbl->GetOutputParameterDesc(reflection, j, &desc);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
check_parameter_desc(&desc, &tests[i].outputs[j]);
winetest_pop_context();
}
ID3D10Blob_Release(code);
refcount = reflection->lpVtbl->Release(reflection);
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
winetest_pop_context();
}

View File

@ -106,7 +106,7 @@ static ID3D10Blob *compile_shader_(unsigned int line, const char *source, const
HRESULT hr;
hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", target, 0, 0, &blob, &errors);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to compile shader, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to compile shader, hr %#lx.\n", hr);
if (errors)
{
if (winetest_debug > 1)
@ -141,12 +141,12 @@ static IDirect3DDevice9 *create_device(HWND window)
IDirect3D9_Release(d3d);
if (FAILED(hr))
{
skip("Failed to create a 3D device, hr %#x.\n", hr);
skip("Failed to create a 3D device, hr %#lx.\n", hr);
return NULL;
}
hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
ok(hr == D3D_OK, "Failed to get device caps, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0) || caps.VertexShaderVersion < D3DVS_VERSION(2, 0))
{
skip("No shader model 2 support.\n");
@ -157,13 +157,13 @@ static IDirect3DDevice9 *create_device(HWND window)
if (FAILED(hr = IDirect3DDevice9_CreateRenderTarget(device, 640, 480, D3DFMT_A32B32G32R32F,
D3DMULTISAMPLE_NONE, 0, FALSE, &rt, NULL)))
{
skip("Failed to create an A32B32G32R32F surface, hr %#x.\n", hr);
skip("Failed to create an A32B32G32R32F surface, hr %#lx.\n", hr);
IDirect3DDevice9_Release(device);
return NULL;
}
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetRenderTarget(device, 0, rt);
ok(hr == D3D_OK, "Failed to set render target, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
IDirect3DSurface9_Release(rt);
return device;
@ -198,7 +198,7 @@ static BOOL init_test_context_(unsigned int line, struct test_context *context)
static void release_test_context_(unsigned int line, struct test_context *context)
{
ULONG ref = IDirect3DDevice9_Release(context->device);
ok_(__FILE__, line)(!ref, "Device has %u references left.\n", ref);
ok_(__FILE__, line)(!ref, "Device has %lu references left.\n", ref);
DestroyWindow(context->window);
}
@ -238,33 +238,33 @@ static void draw_quad_(unsigned int line, IDirect3DDevice9 *device, ID3D10Blob *
"}";
hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to create vertex declaration, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to create vertex declaration, hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexDeclaration(device, vertex_declaration);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to set vertex declaration, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to set vertex declaration, hr %#lx.\n", hr);
vs_code = compile_shader(vs_source, "vs_2_0");
hr = IDirect3DDevice9_CreateVertexShader(device, ID3D10Blob_GetBufferPointer(vs_code), &vs);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to create vertex shader, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to create vertex shader, hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetVertexShader(device, vs);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to set vertex shader, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to set vertex shader, hr %#lx.\n", hr);
hr = IDirect3DDevice9_CreatePixelShader(device, ID3D10Blob_GetBufferPointer(ps_code), &ps);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to create pixel shader, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to create pixel shader, hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetPixelShader(device, ps);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to set pixel shader, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to set pixel shader, hr %#lx.\n", hr);
hr = IDirect3DDevice9_BeginScene(device);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to draw, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to draw, hr %#lx.\n", hr);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad));
ok_(__FILE__, line)(hr == D3D_OK, "Failed to draw, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to draw, hr %#lx.\n", hr);
hr = IDirect3DDevice9_EndScene(device);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to draw, hr %#x.\n", hr);
ok_(__FILE__, line)(hr == D3D_OK, "Failed to draw, hr %#lx.\n", hr);
IDirect3DVertexDeclaration9_Release(vertex_declaration);
IDirect3DVertexShader9_Release(vs);
@ -285,19 +285,19 @@ static void init_readback(IDirect3DDevice9 *device, struct readback *rb)
HRESULT hr;
hr = IDirect3DDevice9Ex_GetRenderTarget(device, 0, &rt);
ok(hr == D3D_OK, "Failed to get render target, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DSurface9_GetDesc(rt, &desc);
ok(hr == D3D_OK, "Failed to get surface desc, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9Ex_CreateOffscreenPlainSurface(device, desc.Width, desc.Height,
desc.Format, D3DPOOL_SYSTEMMEM, &rb->surface, NULL);
ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9Ex_GetRenderTargetData(device, rt, rb->surface);
ok(hr == D3D_OK, "Failed to get render target data, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DSurface9_LockRect(rb->surface, &rb->rect, NULL, D3DLOCK_READONLY);
ok(hr == D3D_OK, "Failed to lock surface, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
IDirect3DSurface9_Release(rt);
}
@ -460,9 +460,9 @@ static void test_swizzle(void)
if (i == 0)
{
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetVector(constants, device, "color", &color);
ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ID3DXConstantTable_Release(constants);
}
draw_quad(device, ps_code);
@ -505,19 +505,19 @@ static void test_math(void)
if (ps_code)
{
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetFloat(constants, device, "$u", 2.5f);
ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetFloat(constants, device, "$v", 0.3f);
ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetFloat(constants, device, "$w", 0.2f);
ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetFloat(constants, device, "$x", 0.7f);
ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetFloat(constants, device, "$y", 0.1f);
ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetFloat(constants, device, "$z", 1.5f);
ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ID3DXConstantTable_Release(constants);
draw_quad(device, ps_code);
@ -661,9 +661,9 @@ static void test_float_vectors(void)
if (ps_code)
{
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Failed to get constants, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetInt(constants, device, "i", 2);
ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ID3DXConstantTable_Release(constants);
draw_quad(device, ps_code);
@ -882,11 +882,11 @@ static void test_majority(void)
if (ps_code)
{
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetMatrix(constants, device, "r", &matrix);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetMatrix(constants, device, "c", &matrix);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ID3DXConstantTable_Release(constants);
draw_quad(test_context.device, ps_code);
@ -902,11 +902,11 @@ static void test_majority(void)
if (ps_code)
{
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetMatrix(constants, device, "r", &matrix);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetMatrix(constants, device, "c", &matrix);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ID3DXConstantTable_Release(constants);
draw_quad(test_context.device, ps_code);
@ -1039,9 +1039,9 @@ static void test_global_initializer(void)
if (ps_code)
{
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetDefaults(constants, test_context.device);
ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ID3DXConstantTable_Release(constants);
draw_quad(test_context.device, ps_code);
@ -1104,24 +1104,24 @@ static void test_samplers(void)
hr = IDirect3DDevice9_CreateTexture(test_context.device, 2, 2, 1, D3DUSAGE_DYNAMIC,
D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture, NULL);
ok(hr == D3D_OK, "Failed to create texture, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DTexture9_LockRect(texture, 0, &map_desc, NULL, D3DLOCK_DISCARD);
ok(hr == D3D_OK, "Failed to map texture, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
memset(map_desc.pBits, 0, 2 * map_desc.Pitch);
((DWORD *)map_desc.pBits)[1] = 0x00ff00ff;
hr = IDirect3DTexture9_UnlockRect(texture, 0);
ok(hr == D3D_OK, "Failed to unmap texture, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetTexture(test_context.device, 0, (IDirect3DBaseTexture9 *)texture);
ok(hr == D3D_OK, "Failed to set texture, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_SetSamplerState(test_context.device, 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
ok(hr == D3D_OK, "Failed to set sampler state, hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
hr = IDirect3DDevice9_Clear(test_context.device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 0, 0), 1.0f, 0);
ok(hr == D3D_OK, "Test %u: Failed to clear, hr %#x.\n", i, hr);
ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
todo_wine ps_code = compile_shader(tests[i], "ps_2_0");
if (ps_code)
{
@ -1253,11 +1253,11 @@ static void test_constant_table(void)
return;
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Got hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_GetDesc(constants, &table_desc);
ok(hr == D3D_OK, "Got hr %#x.\n", hr);
ok(table_desc.Version == D3DPS_VERSION(2, 0), "Got Version %#x.\n", table_desc.Version);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ok(table_desc.Version == D3DPS_VERSION(2, 0), "Got unexpected version %#lx.\n", table_desc.Version);
ok(table_desc.Constants == ARRAY_SIZE(expect_constants), "Got %u constants.\n", table_desc.Constants);
for (i = 0; i < table_desc.Constants; ++i)
@ -1269,7 +1269,7 @@ static void test_constant_table(void)
memset(&desc, 0xcc, sizeof(desc));
count = 1;
hr = ID3DXConstantTable_GetConstantDesc(constants, handle, &desc, &count);
ok(hr == D3D_OK, "Got hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ok(count == 1, "Got count %u.\n", count);
sprintf(prefix, "Test %u", i);
check_constant_desc(prefix, &desc, &expect_constants[i], FALSE);
@ -1283,7 +1283,7 @@ static void test_constant_table(void)
memset(&desc, 0xcc, sizeof(desc));
count = 1;
hr = ID3DXConstantTable_GetConstantDesc(constants, field, &desc, &count);
ok(hr == D3D_OK, "Got hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ok(count == 1, "Got count %u.\n", count);
sprintf(prefix, "Test %u, %u", i, j);
check_constant_desc(prefix, &desc, &expect_fields_f[j], !!j);
@ -1296,7 +1296,7 @@ static void test_constant_table(void)
memset(&desc, 0xcc, sizeof(desc));
count = 1;
hr = ID3DXConstantTable_GetConstantDesc(constants, field, &desc, &count);
ok(hr == D3D_OK, "Got hr %#x.\n", hr);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
ok(count == 1, "Got count %u.\n", count);
sprintf(prefix, "Test %u", i);
check_constant_desc(prefix, &desc, &expect_fields_j, FALSE);
@ -1434,7 +1434,7 @@ static void test_fail(void)
{
compiled = errors = NULL;
hr = D3DCompile(tests[i], strlen(tests[i]), NULL, NULL, NULL, "test", targets[j], 0, 0, &compiled, &errors);
todo_wine ok(hr == E_FAIL, "Test %u, target %s, got unexpected hr %#x.\n", i, targets[j], hr);
todo_wine ok(hr == E_FAIL, "Test %u, target %s: Got unexpected hr %#lx.\n", i, targets[j], hr);
if (hr == E_FAIL)
{
ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]);
@ -1631,7 +1631,7 @@ static void test_include(void)
hr = tests[i](filename_a, &include.ID3DInclude_iface, &blob, &errors);
todo_wine_if (i != 0)
{
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
}
todo_wine_if (i == 1)
@ -1644,7 +1644,7 @@ static void test_include(void)
#if D3D_COMPILER_VERSION >= 46
hr = tests[i](NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, &blob, &errors);
todo_wine_if (i == 0) ok(hr == (i == 0 ? D3DXERR_INVALIDDATA : E_FAIL), "Got hr %#x.\n", hr);
todo_wine_if (i == 0) ok(hr == (i == 0 ? D3DXERR_INVALIDDATA : E_FAIL), "Got unexpected hr %#lx.\n", hr);
ok(!blob, "Got unexpected blob.\n");
ok(!!errors, "Got unexpected errors.\n");
ID3D10Blob_Release(errors);
@ -1656,7 +1656,7 @@ static void test_include(void)
hr = tests[i](filename_a, D3D_COMPILE_STANDARD_FILE_INCLUDE, &blob, &errors);
todo_wine_if (i != 0)
{
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
}
todo_wine_if (i == 1)
@ -1674,12 +1674,12 @@ static void test_include(void)
#if D3D_COMPILER_VERSION >= 46
hr = D3DCompileFromFile(L"nonexistent", NULL, NULL, "main", "vs_2_0", 0, 0, &blob, &errors);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got hr %#x.\n", hr);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#lx.\n", hr);
ok(!blob, "Got unexpected blob.\n");
ok(!errors, "Got unexpected errors.\n");
hr = D3DCompileFromFile(filename, NULL, NULL, "main", "ps_2_0", 0, 0, &blob, &errors);
ok(hr == E_FAIL, "Got hr %#x.\n", hr);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(!blob, "Got unexpected blob.\n");
ok(!!errors, "Got unexpected errors.\n");
trace("%s.\n", (char *)ID3D10Blob_GetBufferPointer(errors));
@ -1687,7 +1687,7 @@ static void test_include(void)
errors = NULL;
hr = D3DCompileFromFile(filename, NULL, &include.ID3DInclude_iface, "main", "ps_2_0", 0, 0, &blob, &errors);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!!blob, "Got unexpected blob.\n");
ok(!errors, "Got unexpected errors.\n");
if (blob)
@ -1700,7 +1700,7 @@ static void test_include(void)
* instead of using the immediate parent, as it would be the case for
* standard C preprocessor includes. */
hr = D3DCompileFromFile(filename, NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_2_0", 0, 0, &blob, &errors);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!!blob, "Got unexpected blob.\n");
ok(!errors, "Got unexpected errors.\n");
if (blob)
@ -1712,7 +1712,7 @@ static void test_include(void)
sprintf(ps_absolute_buffer, ps_absolute_template, include_filename);
hr = D3DCompile(ps_absolute_buffer, sizeof(ps_absolute_buffer), filename_a, NULL,
D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_2_0", 0, 0, &blob, &errors);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!!blob, "Got unexpected blob.\n");
todo_wine ok(!errors, "Got unexpected errors.\n");
if (blob)
@ -1731,7 +1731,7 @@ static void test_include(void)
hr = tests[i](NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, &blob, &errors);
todo_wine_if (i != 0)
{
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
}
todo_wine_if (i == 1)
@ -1746,7 +1746,7 @@ static void test_include(void)
}
hr = D3DCompileFromFile(L"source.ps", NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_2_0", 0, 0, &blob, &errors);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!!blob, "Got unexpected blob.\n");
ok(!errors, "Got unexpected errors.\n");
if (blob)

View File

@ -22,9 +22,6 @@
* The functions are e.g.: D3DGet*SignatureBlob, D3DReflect
*/
#ifndef WINE_NO_LONG_TYPES
#define WINE_NO_LONG_TYPES
#endif
#define COBJMACROS
#include "initguid.h"
#include "d3dcompiler.h"
@ -93,22 +90,22 @@ static void test_reflection_references(void)
ULONG count;
hr = D3DReflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == S_OK, "D3DReflect failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D11ShaderReflection, (void **)&ref11_test);
ok(hr == S_OK, "QueryInterface failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
count = ref11_test->lpVtbl->Release(ref11_test);
ok(count == 1, "Release failed %u\n", count);
ok(count == 1, "Release failed %lu\n", count);
hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D10ShaderReflection, (void **)&ref10);
ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x\n", hr, E_NOINTERFACE);
ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x\n", hr, E_NOINTERFACE);
ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
count = ref11->lpVtbl->Release(ref11);
ok(count == 0, "Release failed %u\n", count);
ok(!count, "Got unexpected count %lu.\n", count);
/* check invalid cases */
#if D3D_COMPILER_VERSION >= 46
@ -118,21 +115,21 @@ static void test_reflection_references(void)
#endif
hr = D3DReflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D10ShaderReflection, (void **)&ref10);
ok(hr == expected || broken(hr == E_NOINTERFACE) /* Windows 8 */,
"D3DReflect failed, got %x, expected %x\n", hr, expected);
"Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
hr = D3DReflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
ok(hr == expected || broken(hr == E_NOINTERFACE) /* Windows 8 */,
"D3DReflect failed, got %x, expected %x\n", hr, expected);
"Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
hr = D3DReflect(NULL, test_reflection_blob[6], &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
ok(hr == D3DERR_INVALIDCALL, "D3DReflect failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DReflect(NULL, test_reflection_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == D3DERR_INVALIDCALL, "D3DReflect failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
/* returns different errors with different sizes */
hr = D3DReflect(test_reflection_blob, 31, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
ok(hr == D3DERR_INVALIDCALL, "D3DReflect failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
#if D3D_COMPILER_VERSION >= 46
expected = D3DERR_INVALIDCALL;
@ -140,19 +137,19 @@ static void test_reflection_references(void)
expected = E_FAIL;
#endif
hr = D3DReflect(test_reflection_blob, 32, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
ok(hr == expected, "Got %x, expected %x.\n", hr, expected);
ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
hr = D3DReflect(test_reflection_blob, test_reflection_blob[6]-1, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
ok(hr == expected, "Got %x, expected %x.\n", hr, expected);
ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
hr = D3DReflect(test_reflection_blob, 31, &IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == D3DERR_INVALIDCALL, "Got %x, expected %x.\n", hr, D3DERR_INVALIDCALL);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
hr = D3DReflect(test_reflection_blob, 32, &IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == expected, "Got %x, expected %x.\n", hr, expected);
ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
hr = D3DReflect(test_reflection_blob, test_reflection_blob[6]-1, &IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == expected, "Got %x, expected %x.\n", hr, expected);
ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
}
#endif
@ -168,51 +165,52 @@ static void test_reflection_interfaces(void)
expected_hr = D3D_COMPILER_VERSION < 46 ? E_NOINTERFACE : D3D_COMPILER_VERSION == 46 ? E_INVALIDARG : S_OK;
hr = call_reflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D12ShaderReflection, (void **)&ref12);
/* Broken with older d3dcompiler_46, d3dcompiler_47. */
ok(hr == expected_hr || broken(hr == E_NOINTERFACE), "Got unexpected hr %#x.\n", hr);
ok(hr == expected_hr || broken(hr == E_NOINTERFACE),
"Got unexpected hr %#lx, expected %#lx.\n", hr, expected_hr);
if (hr != S_OK)
return;
hr = call_reflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ref12->lpVtbl->QueryInterface(ref12, &IID_ID3D11ShaderReflection, (void **)&iface);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(iface == (void *)ref12, "Got unexpected interfaces %p, %p.\n", iface, ref12);
hr = iface->lpVtbl->QueryInterface(iface, &IID_IUnknown, (void **)&iunk);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(iface == iunk, "Got unexpected iface %p.\n", iface);
iface->lpVtbl->Release(iunk);
iface->lpVtbl->Release(iface);
hr = ref12->lpVtbl->QueryInterface(ref12, &IID_IUnknown, (void **)&iface);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(iface == (IUnknown *)ref12, "Got unexpected iface %p.\n", iface);
iface->lpVtbl->Release(iface);
hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D12ShaderReflection, (void **)&iface);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(iface == (void *)ref11, "Got unexpected interfaces %p, %p.\n", iface, ref11);
hr = iface->lpVtbl->QueryInterface(iface, &IID_IUnknown, (void **)&iunk);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(iface == iunk, "Got unexpected iface %p.\n", iface);
iface->lpVtbl->Release(iunk);
iface->lpVtbl->Release(iface);
hr = ref11->lpVtbl->QueryInterface(ref11, &IID_IUnknown, (void **)&iface);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(iface == (IUnknown *)ref11, "Got unexpected iface %p.\n", iface);
iface->lpVtbl->Release(iface);
hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D10ShaderReflection, (void **)&iface);
ok(hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
hr = ref12->lpVtbl->QueryInterface(ref12, &IID_ID3D10ShaderReflection, (void **)&iface);
ok(hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr);
ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
count = ref12->lpVtbl->Release(ref12);
ok(!count, "Got unexpected ref count %u.\n", count);
ok(!count, "Got unexpected ref count %lu.\n", count);
count = ref11->lpVtbl->Release(ref11);
ok(!count, "Got unexpected ref count %u.\n", count);
ok(!count, "Got unexpected ref count %lu.\n", count);
}
#endif
@ -402,15 +400,15 @@ static void test_reflection_desc_vs(void)
#endif
hr = call_reflect(test_reflection_desc_vs_blob, test_reflection_desc_vs_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == S_OK, "D3DReflect failed %x\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D12ShaderReflection, (void **)&ref12);
hr = ref11->lpVtbl->GetDesc(ref11, NULL);
ok(hr == E_FAIL, "GetDesc failed %x\n", hr);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetDesc(ref11, &sdesc11);
ok(hr == S_OK, "GetDesc failed %x\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(sdesc11.Version == 65601, "GetDesc failed, got %u, expected %u\n", sdesc11.Version, 65601);
ok(strcmp(sdesc11.Creator, (char*) shader_creator) == 0, "GetDesc failed, got \"%s\", expected \"%s\"\n", sdesc11.Creator, (char*)shader_creator);
@ -454,7 +452,7 @@ static void test_reflection_desc_vs(void)
if (ref12)
{
hr = ref12->lpVtbl->GetDesc(ref12, &sdesc12);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!memcmp(&sdesc11, &sdesc12, sizeof(sdesc12)), "D3D11 and D3D12 descs do not match.\n");
}
@ -503,7 +501,7 @@ static void test_reflection_desc_vs(void)
pdesc = &test_reflection_desc_vs_resultin[i];
hr = ref11->lpVtbl->GetInputParameterDesc(ref11, i, &desc11);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
ok(!strcmp(desc11.SemanticName, pdesc->SemanticName), "Got unexpected SemanticName \"%s\", i %u.\n",
desc11.SemanticName, i);
@ -529,7 +527,7 @@ static void test_reflection_desc_vs(void)
if (ref12)
{
hr = ref12->lpVtbl->GetInputParameterDesc(ref12, i, &desc12);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
ok(!memcmp(&desc12, &desc11, sizeof(desc11)), "D3D11 and D3D12 descs do not match.\n");
}
@ -540,7 +538,7 @@ static void test_reflection_desc_vs(void)
pdesc = &test_reflection_desc_vs_resultout[i];
hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, i, &desc11);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
ok(!strcmp(desc11.SemanticName, pdesc->SemanticName), "Got unexpected SemanticName \"%s\", i %u.\n",
desc11.SemanticName, i);
@ -566,7 +564,7 @@ static void test_reflection_desc_vs(void)
if (ref12)
{
hr = ref12->lpVtbl->GetOutputParameterDesc(ref12, i, &desc12);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
ok(!memcmp(&desc12, &desc11, sizeof(desc11)), "D3D11 and D3D12 descs do not match.\n");
}
@ -575,11 +573,11 @@ static void test_reflection_desc_vs(void)
if (ref12)
{
count = ref12->lpVtbl->Release(ref12);
ok(count == 1, "Got unexpected ref count %u.\n", count);
ok(count == 1, "Got unexpected ref count %lu.\n", count);
}
count = ref11->lpVtbl->Release(ref11);
ok(count == 0, "Got unexpected ref count %u.\n", count);
ok(count == 0, "Got unexpected ref count %lu.\n", count);
}
/*
@ -758,10 +756,10 @@ static void test_reflection_desc_ps(void)
#endif
hr = call_reflect(test_reflection_desc_ps_blob, test_reflection_desc_ps_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == S_OK, "D3DReflect failed %x\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetDesc(ref11, &sdesc11);
ok(hr == S_OK, "GetDesc failed %x\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(sdesc11.Version == 65, "GetDesc failed, got %u, expected %u\n", sdesc11.Version, 65);
ok(strcmp(sdesc11.Creator, (char*) shader_creator) == 0, "GetDesc failed, got \"%s\", expected \"%s\"\n", sdesc11.Creator, (char*)shader_creator);
@ -818,20 +816,20 @@ static void test_reflection_desc_ps(void)
/* check invalid Get*ParameterDesc cases*/
hr = ref11->lpVtbl->GetInputParameterDesc(ref11, 0, NULL);
ok(hr == E_INVALIDARG, "GetInputParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetInputParameterDesc(ref11, 0xffffffff, &desc);
ok(hr == E_INVALIDARG, "GetInputParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0, NULL);
ok(hr == E_INVALIDARG, "GetOutputParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0xffffffff, &desc);
ok(hr == E_INVALIDARG, "GetOutputParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
#if D3D_COMPILER_VERSION
hr = ref11->lpVtbl->GetPatchConstantParameterDesc(ref11, 0, &desc);
ok(hr == E_INVALIDARG, "GetPatchConstantParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
#endif
/* GetIn/OutputParameterDesc */
@ -840,7 +838,7 @@ static void test_reflection_desc_ps(void)
pdesc = &test_reflection_desc_ps_resultin[i];
hr = ref11->lpVtbl->GetInputParameterDesc(ref11, i, &desc);
ok(hr == S_OK, "GetInputParameterDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "GetInputParameterDesc(%u) SemanticName failed, got \"%s\", expected \"%s\"\n",
i, desc.SemanticName, pdesc->SemanticName);
@ -868,7 +866,7 @@ static void test_reflection_desc_ps(void)
pdesc = &test_reflection_desc_ps_resultout[i];
hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, i, &desc);
ok(hr == S_OK, "GetOutputParameterDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "GetOutputParameterDesc(%u) SemanticName failed, got \"%s\", expected \"%s\"\n",
i, desc.SemanticName, pdesc->SemanticName);
@ -898,7 +896,7 @@ static void test_reflection_desc_ps(void)
}
count = ref11->lpVtbl->Release(ref11);
ok(count == 0, "Release failed %u\n", count);
ok(!count, "Got unexpected count %lu.\n", count);
}
/* The following shaders are stripped, in order to show that the correct
@ -1038,17 +1036,17 @@ static void test_reflection_desc_ps_output(void)
hr = call_reflect(tests[i].blob, tests[i].blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
if (!D3D_COMPILER_VERSION)
{
todo_wine ok(hr == E_INVALIDARG, "(%u): got unexpected hr %x.\n", i, hr);
todo_wine ok(hr == E_INVALIDARG, "%u: Got unexpected hr %#lx.\n", i, hr);
if (SUCCEEDED(hr))
ref11->lpVtbl->Release(ref11);
continue;
}
ok(hr == S_OK, "(%u): got unexpected hr %x.\n", i, hr);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
pdesc = &tests[i].desc;
hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0, &desc);
ok(hr == S_OK, "(%u): GetOutputParameterDesc failed, got %x, expected %x\n", i, hr, S_OK);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "(%u): GetOutputParameterDesc SemanticName failed, got \"%s\", expected \"%s\"\n",
i, desc.SemanticName, pdesc->SemanticName);
@ -1077,7 +1075,7 @@ static void test_reflection_desc_ps_output(void)
ok(!desc.Stream, "(%u): got unexpected Stream %u.\n", i, desc.Stream);
count = ref11->lpVtbl->Release(ref11);
ok(count == 0, "(%u): Release failed %u\n", i, count);
ok(!count, "%u: Got unexpected count %lu.\n", i, count);
}
}
@ -1181,7 +1179,8 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
expected_hr = D3D_COMPILER_VERSION < 47 && target_version >= 0x501 ? E_INVALIDARG : S_OK;
/* Older d3dcompiler_47 does not support sm5.1. */
ok(hr == expected_hr || broken(hr == E_INVALIDARG && target_version >= 0x501), "Got unexpected hr %x.\n", hr);
ok(hr == expected_hr || broken(hr == E_INVALIDARG && target_version >= 0x501),
"Got unexpected hr %#lx, expected %#lx.\n", hr, expected_hr);
if (hr == E_INVALIDARG)
return;
@ -1204,23 +1203,23 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
/* check invalid cases */
hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, 0, NULL);
ok(hr == E_INVALIDARG, "Got unexpected hr %x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, 0xffffffff, &desc11);
ok(hr == E_INVALIDARG, "Got unexpected hr %x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
#if D3D_COMPILER_VERSION
hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, NULL, &desc11);
ok(hr == E_INVALIDARG, "Got unexpected hr %x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "sam", NULL);
ok(hr == E_INVALIDARG, "Got unexpected hr %x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "invalid", NULL);
ok(hr == E_INVALIDARG, "Got unexpected hr %x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "invalid", &desc11);
ok(hr == E_INVALIDARG, "Got unexpected hr %x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
#endif
/* GetResourceBindingDesc */
@ -1229,7 +1228,7 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
pdesc = &result[i];
hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, i, &desc11);
ok(hr == S_OK, "Got unexpected hr %x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc11.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc11.Name, i);
ok(desc11.Type == pdesc->Type, "Got unexpected Type %#x, i %u.\n", desc11.Type, i);
@ -1253,7 +1252,7 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
desc12.uID = 0xdeadbeef;
hr = ref12->lpVtbl->GetResourceBindingDesc(ref12, i, &desc12);
ok(hr == S_OK, "Got unexpected hr %x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
@ -1265,7 +1264,7 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
desc12.Space = 0xdeadbeef;
desc12.uID = 0xdeadbeef;
hr = ref12_from_d3d11->lpVtbl->GetResourceBindingDesc(ref12_from_d3d11, i, &desc12);
ok(hr == S_OK, "Got unexpected hr %x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
@ -1283,7 +1282,7 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
desc12.Space = 0xdeadbeef;
desc12.uID = 0xdeadbeef;
hr = ref11_from_d3d12->lpVtbl->GetResourceBindingDesc(ref11_from_d3d12, i, &desc12);
ok(hr == S_OK, "Got unexpected hr %x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
"D3D11 and D3D12 descs do not match.\n");
@ -1299,7 +1298,7 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
pdesc = &result[i];
hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, pdesc->Name, &desc11);
ok(hr == S_OK, "Got unexpected hr %x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc11.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc11.Name, i);
ok(desc11.Type == pdesc->Type, "Got unexpected Type %#x, i %u.\n", desc11.Type, i);
@ -1317,7 +1316,7 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
desc12.uID = 0xdeadbeef;
hr = ref12->lpVtbl->GetResourceBindingDescByName(ref12, pdesc->Name, &desc12);
ok(hr == S_OK, "Got unexpected hr %x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
@ -1329,7 +1328,7 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
desc12.Space = 0xdeadbeef;
desc12.uID = 0xdeadbeef;
hr = ref12_from_d3d11->lpVtbl->GetResourceBindingDescByName(ref12_from_d3d11, pdesc->Name, &desc12);
ok(hr == S_OK, "Got unexpected hr %x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
@ -1344,7 +1343,7 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
desc12.Space = 0xdeadbeef;
desc12.uID = 0xdeadbeef;
hr = ref11_from_d3d12->lpVtbl->GetResourceBindingDescByName(ref11_from_d3d12, pdesc->Name, &desc12);
ok(hr == S_OK, "Got unexpected hr %x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
"D3D11 and D3D12 descs do not match.\n");
@ -1357,17 +1356,17 @@ static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADE
if (ref12)
{
count = ref11_from_d3d12->lpVtbl->Release(ref11_from_d3d12);
ok(count == 1, "Got unexpected ref count %u.\n", count);
ok(count == 1, "Got unexpected ref count %lu.\n", count);
count = ref12->lpVtbl->Release(ref12);
ok(!count, "Got unexpected ref count %u.\n", count);
ok(!count, "Got unexpected ref count %lu.\n", count);
count = ref12_from_d3d11->lpVtbl->Release(ref12_from_d3d11);
ok(count == 1, "Got unexpected ref count %u.\n", count);
ok(count == 1, "Got unexpected ref count %lu.\n", count);
}
count = ref11->lpVtbl->Release(ref11);
ok(!count, "Got unexpected ref count %u.\n", count);
ok(!count, "Got unexpected ref count %lu.\n", count);
}
#if D3D_COMPILER_VERSION
@ -1618,7 +1617,7 @@ static void test_reflection_constant_buffer(void)
hr = call_reflect(test_reflection_constant_buffer_blob, test_reflection_constant_buffer_blob[6],
&IID_ID3D11ShaderReflection, (void **)&ref11);
ok(hr == S_OK, "D3DReflect failed %x\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
#if D3D_COMPILER_VERSION
call_reflect(test_reflection_constant_buffer_blob, test_reflection_constant_buffer_blob[6],
@ -1626,7 +1625,7 @@ static void test_reflection_constant_buffer(void)
#endif
hr = ref11->lpVtbl->GetDesc(ref11, &sdesc);
ok(hr == S_OK, "GetDesc failed %x\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
expected = D3D_COMPILER_VERSION ? 80 : 64;
ok(sdesc.Version == expected, "Got unexpected version %u.\n", sdesc.Version);
@ -1758,33 +1757,33 @@ static void test_reflection_constant_buffer(void)
}
hr = cb11_dummy->lpVtbl->GetDesc(cb11_dummy, NULL);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = cb11_dummy->lpVtbl->GetDesc(cb11_dummy, &cbdesc);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = cb11_valid->lpVtbl->GetDesc(cb11_valid, NULL);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* variable calls */
hr = v11_dummy->lpVtbl->GetDesc(v11_dummy, NULL);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = v11_dummy->lpVtbl->GetDesc(v11_dummy, &vdesc);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = v11_valid->lpVtbl->GetDesc(v11_valid, NULL);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
/* type calls */
hr = t11_dummy->lpVtbl->GetDesc(t11_dummy, NULL);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = t11_dummy->lpVtbl->GetDesc(t11_dummy, &tdesc);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = t11_valid->lpVtbl->GetDesc(t11_valid, NULL);
ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
string = t11_dummy->lpVtbl->GetMemberTypeName(t11_dummy, 0xffffffff);
ok(!strcmp(string, "$Invalid"), "GetMemberTypeName failed, got \"%s\", expected \"%s\"\n", string, "$Invalid");
@ -1812,16 +1811,16 @@ static void test_reflection_constant_buffer(void)
#if D3D_COMPILER_VERSION
hr = t11_dummy->lpVtbl->IsEqual(t11_dummy, t11_dummy);
ok(hr == E_FAIL, "IsEqual failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11_dummy);
ok(hr == S_FALSE, "IsEqual failed, got %x, expected %x\n", hr, S_FALSE);
ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
hr = t11_dummy->lpVtbl->IsEqual(t11_dummy, t11_valid);
ok(hr == E_FAIL, "IsEqual failed, got %x, expected %x\n", hr, E_FAIL);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11_valid);
ok(hr == S_OK, "IsEqual failed, got %x, expected %x\n", hr, S_OK);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
#endif
/* constant buffers */
@ -1833,7 +1832,7 @@ static void test_reflection_constant_buffer(void)
ok(cb11_dummy != cb11, "Got dummy constant buffer, i %u.\n", i);
hr = cb11->lpVtbl->GetDesc(cb11, &cbdesc);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(cbdesc.Name, pcbdesc->Name), "Got unexpected name \"%s\", i %u.\n", cbdesc.Name, i);
ok(cbdesc.Type == pcbdesc->Type, "Got unexpected Type %#x, i %u.\n", cbdesc.Type, i);
@ -1847,7 +1846,7 @@ static void test_reflection_constant_buffer(void)
ok(cb12_dummy != cb12, "Got dummy constant buffer, i %u.\n", i);
hr = cb12->lpVtbl->GetDesc(cb12, &cbdesc12);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(cbdesc12.Name, pcbdesc->Name), "Got unexpected name \"%s\", i %u.\n", cbdesc.Name, i);
ok(cbdesc.Type == pcbdesc->Type, "Got unexpected Type %#x, i %u.\n", cbdesc.Type, i);
@ -1881,7 +1880,7 @@ static void test_reflection_constant_buffer(void)
}
hr = v11->lpVtbl->GetDesc(v11, &vdesc);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(vdesc.Name, pvdesc->Name), "Got unexpected name \"%s\", i %u", vdesc.Name, i);
ok(vdesc.StartOffset == pvdesc->StartOffset, "Got unexpected StartOffset %u, i %u.\n",
@ -1900,7 +1899,7 @@ static void test_reflection_constant_buffer(void)
v12 = ref12->lpVtbl->GetVariableByName(ref12, pvdesc->Name);
ok(v12_dummy != v12, "Test %u, got unexpected variable %p.\n", i, v12);
hr = v12->lpVtbl->GetDesc(v12, &vdesc12);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!strcmp(vdesc12.Name, pvdesc->Name), "Got unexpected name \"%s\", i %u", vdesc12.Name, i);
ok(!memcmp(&vdesc12.StartOffset, &vdesc.StartOffset,
sizeof(vdesc) - offsetof(D3D11_SHADER_VARIABLE_DESC, StartOffset)),
@ -1919,7 +1918,7 @@ static void test_reflection_constant_buffer(void)
ok(t11_dummy != t11, "Got unexpected type %p, i %u.\n", t11, i);
hr = t11->lpVtbl->GetDesc(t11, &tdesc);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(tdesc.Class == ptdesc->Class, "Got unexpected Class %u, i %u.\n", tdesc.Class, i);
ok(tdesc.Type == ptdesc->Type, "Got unexpected Type %u, i %u.\n", tdesc.Type, i);
@ -1936,7 +1935,7 @@ static void test_reflection_constant_buffer(void)
ok(t12_dummy != t12, "Got unexpected type %p, i %u.\n", t12, i);
hr = t12->lpVtbl->GetDesc(t12, &tdesc12);
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
ok(!memcmp(&tdesc12, &tdesc, offsetof(D3D11_SHADER_TYPE_DESC, Name)),
"D3D11 and D3D12 descs do not match.\n");
ok(!strcmp(tdesc12.Name, ptdesc->Name), "Got unexpected Name %s, i %u.\n", debugstr_a(tdesc12.Name), i);
@ -1974,10 +1973,10 @@ static void test_reflection_constant_buffer(void)
#if D3D_COMPILER_VERSION
/* float vs float (in struct) */
hr = t11->lpVtbl->IsEqual(t11, t11_valid);
ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr);
ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11);
ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr);
ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
/* float vs float */
t = t11->lpVtbl->GetMemberTypeByIndex(t11, 0);
@ -1987,7 +1986,7 @@ static void test_reflection_constant_buffer(void)
ok(t2 != t11_dummy, "Got unexpected type %p.\n", t2);
hr = t->lpVtbl->IsEqual(t, t2);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
#endif
if (ref12)
@ -2017,10 +2016,10 @@ static void test_reflection_constant_buffer(void)
ok(!strcmp(string, "b"), "Got unexpected string \"%s\".\n", string);
hr = t12->lpVtbl->IsEqual(t12, t12_valid);
ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr);
ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
hr = t12_valid->lpVtbl->IsEqual(t12_valid, t12);
ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr);
ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
mt12 = t12->lpVtbl->GetMemberTypeByIndex(t12, 0);
ok(mt12 != t12_dummy, "Got unexpected type %p.\n", mt12);
@ -2029,13 +2028,13 @@ static void test_reflection_constant_buffer(void)
ok(mt12_2 != t12_dummy, "Got unexpected type %p.\n", mt12_2);
hr = mt12->lpVtbl->IsEqual(mt12, mt12_2);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
count = ref12->lpVtbl->Release(ref12);
ok(!count, "Got unexpected ref count %u.\n", count);
ok(!count, "Got unexpected ref count %lu.\n", count);
}
count = ref11->lpVtbl->Release(ref11);
ok(!count, "Got unexpected ref count %u.\n", count);
ok(!count, "Got unexpected ref count %lu.\n", count);
}
/*

View File

@ -1,6 +1,6 @@
TESTDLL = d3dcompiler_46.dll
IMPORTS = d3d9 user32 d3dcompiler_46
EXTRADEFS = -DWINE_NO_LONG_TYPES -DD3D_COMPILER_VERSION=46
EXTRADEFS = -DD3D_COMPILER_VERSION=46
PARENTSRC = ../../d3dcompiler_43/tests
C_SRCS = \

View File

@ -1,6 +1,6 @@
TESTDLL = d3dcompiler_47.dll
IMPORTS = d3d9 user32 d3dcompiler
EXTRADEFS = -DWINE_NO_LONG_TYPES -DD3D_COMPILER_VERSION=47
EXTRADEFS = -DD3D_COMPILER_VERSION=47
PARENTSRC = ../../d3dcompiler_43/tests
C_SRCS = \