Commit 6a062afb authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3dcompiler: Implement D3DCompile2() using vkd3d_shader_compile().

parent aa2851f1
MODULE = d3dcompiler_33.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=33
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_34.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=34
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_35.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=35
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_36.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=36
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_37.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=37
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_38.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=38
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_39.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=39
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_40.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=40
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_41.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=41
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_42.dll
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=42
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_43.dll
IMPORTLIB = d3dcompiler_43
EXTRADEFS = -DD3D_COMPILER_VERSION=43
IMPORTS = wined3d
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
/*
* Copyright 2009 Matteo Bruni
* Copyright 2010 Matteo Bruni for CodeWeavers
* Copyright 2016,2018 Józef Kucia for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -25,8 +26,33 @@
#include "d3dcompiler_private.h"
#include "wpp_private.h"
#include <vkd3d_shader.h>
WINE_DEFAULT_DEBUG_CHANNEL(d3dcompiler);
static HRESULT hresult_from_vkd3d_result(int vkd3d_result)
{
switch (vkd3d_result)
{
case VKD3D_OK:
return S_OK;
case VKD3D_ERROR_INVALID_SHADER:
WARN("Invalid shader bytecode.\n");
/* fall-through */
case VKD3D_ERROR:
return E_FAIL;
case VKD3D_ERROR_OUT_OF_MEMORY:
return E_OUTOFMEMORY;
case VKD3D_ERROR_INVALID_ARGUMENT:
return E_INVALIDARG;
case VKD3D_ERROR_NOT_IMPLEMENTED:
return E_NOTIMPL;
default:
FIXME("Unhandled vkd3d result %d.\n", vkd3d_result);
return E_FAIL;
}
}
#define D3DXERR_INVALIDDATA 0x88760b59
#define BUFFER_INITIAL_CAPACITY 256
......@@ -736,39 +762,179 @@ HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filena
return hr;
}
static int open_include(const char *filename, bool local, const char *parent_data, void *context,
struct vkd3d_shader_code *code)
{
ID3DInclude *iface = context;
unsigned int size = 0;
if (!iface)
return VKD3D_ERROR;
memset(code, 0, sizeof(*code));
if (FAILED(ID3DInclude_Open(iface, local ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM,
filename, parent_data, &code->code, &size)))
return VKD3D_ERROR;
code->size = size;
return VKD3D_OK;
}
static void close_include(const struct vkd3d_shader_code *code, void *context)
{
ID3DInclude *iface = context;
ID3DInclude_Close(iface, code->code);
}
HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename,
const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
const char *target, UINT sflags, UINT eflags, UINT secondary_flags,
const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader,
ID3DBlob **error_messages)
const D3D_SHADER_MACRO *macros, ID3DInclude *include, const char *entry_point,
const char *profile, UINT flags, UINT effect_flags, UINT secondary_flags,
const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader_blob,
ID3DBlob **messages_blob)
{
struct d3dcompiler_include_from_file include_from_file;
struct vkd3d_shader_preprocess_info preprocess_info;
struct vkd3d_shader_hlsl_source_info hlsl_info;
struct vkd3d_shader_compile_option options[2];
struct vkd3d_shader_compile_info compile_info;
struct vkd3d_shader_compile_option *option;
struct vkd3d_shader_code byte_code;
const D3D_SHADER_MACRO *macro;
size_t profile_len, i;
char *messages;
HRESULT hr;
int ret;
TRACE("data %p, data_size %Iu, filename %s, defines %p, include %p, entrypoint %s, "
"target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p, "
"secondary_data_size %Iu, shader %p, error_messages %p.\n",
data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint),
debugstr_a(target), sflags, eflags, secondary_flags, secondary_data,
secondary_data_size, shader, error_messages);
static const char * const d3dbc_profiles[] =
{
"fx_2_",
if (secondary_data)
FIXME("secondary data not implemented yet\n");
"ps.1.",
"ps.2.",
"ps.3.",
if (shader) *shader = NULL;
if (error_messages) *error_messages = NULL;
"ps_1_",
"ps_2_",
"ps_3_",
EnterCriticalSection(&wpp_mutex);
"vs.1.",
"vs.2.",
"vs.3.",
hr = preprocess_shader(data, data_size, filename, defines, include, error_messages);
if (SUCCEEDED(hr))
"vs_1_",
"vs_2_",
"vs_3_",
"tx_1_",
};
TRACE("data %p, data_size %Iu, filename %s, macros %p, include %p, entry_point %s, "
"profile %s, flags %#x, effect_flags %#x, secondary_flags %#x, secondary_data %p, "
"secondary_data_size %Iu, shader_blob %p, messages_blob %p.\n",
data, data_size, debugstr_a(filename), macros, include, debugstr_a(entry_point),
debugstr_a(profile), flags, effect_flags, secondary_flags, secondary_data,
secondary_data_size, shader_blob, messages_blob);
if (include == D3D_COMPILE_STANDARD_FILE_INCLUDE)
{
FIXME("HLSL shader compilation is not yet implemented.\n");
hr = E_NOTIMPL;
include_from_file.ID3DInclude_iface.lpVtbl = &d3dcompiler_include_from_file_vtbl;
include = &include_from_file.ID3DInclude_iface;
}
HeapFree(GetProcessHeap(), 0, wpp_output);
LeaveCriticalSection(&wpp_mutex);
if (flags & ~D3DCOMPILE_DEBUG)
FIXME("Ignoring flags %#x.\n", flags);
if (effect_flags)
FIXME("Ignoring effect flags %#x.\n", effect_flags);
if (secondary_flags)
FIXME("Ignoring secondary flags %#x.\n", secondary_flags);
if (messages_blob)
*messages_blob = NULL;
option = &options[0];
option->name = VKD3D_SHADER_COMPILE_OPTION_API_VERSION;
option->value = VKD3D_SHADER_API_VERSION_1_3;
compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO;
compile_info.next = &preprocess_info;
compile_info.source.code = data;
compile_info.source.size = data_size;
compile_info.source_type = VKD3D_SHADER_SOURCE_HLSL;
compile_info.target_type = VKD3D_SHADER_TARGET_DXBC_TPF;
compile_info.options = options;
compile_info.option_count = 1;
compile_info.log_level = VKD3D_SHADER_LOG_INFO;
compile_info.source_name = filename;
profile_len = strlen(profile);
for (i = 0; i < ARRAY_SIZE(d3dbc_profiles); ++i)
{
size_t len = strlen(d3dbc_profiles[i]);
if (len <= profile_len && !memcmp(profile, d3dbc_profiles[i], len))
{
compile_info.target_type = VKD3D_SHADER_TARGET_D3D_BYTECODE;
break;
}
}
preprocess_info.type = VKD3D_SHADER_STRUCTURE_TYPE_PREPROCESS_INFO;
preprocess_info.next = &hlsl_info;
preprocess_info.macros = (const struct vkd3d_shader_macro *)macros;
preprocess_info.macro_count = 0;
if (macros)
{
for (macro = macros; macro->Name; ++macro)
++preprocess_info.macro_count;
}
preprocess_info.pfn_open_include = open_include;
preprocess_info.pfn_close_include = close_include;
preprocess_info.include_context = include;
hlsl_info.type = VKD3D_SHADER_STRUCTURE_TYPE_HLSL_SOURCE_INFO;
hlsl_info.next = NULL;
hlsl_info.profile = profile;
hlsl_info.entry_point = entry_point;
hlsl_info.secondary_code.code = secondary_data;
hlsl_info.secondary_code.size = secondary_data_size;
if (!(flags & D3DCOMPILE_DEBUG))
{
option = &options[compile_info.option_count++];
option->name = VKD3D_SHADER_COMPILE_OPTION_STRIP_DEBUG;
option->value = true;
}
ret = vkd3d_shader_compile(&compile_info, &byte_code, &messages);
if (messages)
{
if (messages_blob)
{
size_t size = strlen(messages);
if (FAILED(hr = D3DCreateBlob(size, messages_blob)))
{
vkd3d_shader_free_messages(messages);
vkd3d_shader_free_shader_code(&byte_code);
return hr;
}
memcpy(ID3D10Blob_GetBufferPointer(*messages_blob), messages, size);
}
else
vkd3d_shader_free_messages(messages);
}
if (!ret)
{
if (FAILED(hr = D3DCreateBlob(byte_code.size, shader_blob)))
{
vkd3d_shader_free_shader_code(&byte_code);
return hr;
}
memcpy(ID3D10Blob_GetBufferPointer(*shader_blob), byte_code.code, byte_code.size);
}
return hresult_from_vkd3d_result(ret);
}
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename,
......
......@@ -383,9 +383,7 @@ static void test_swizzle(void)
if (!init_test_context(&test_context))
return;
todo_wine ps_code = compile_shader(ps_source, "ps_4_0");
if (ps_code)
{
ps_code = compile_shader(ps_source, "ps_4_0");
cb = create_buffer(test_context.device, D3D11_BIND_CONSTANT_BUFFER, sizeof(uniform), &uniform);
ID3D11DeviceContext_PSSetConstantBuffers(test_context.immediate_context, 0, 1, &cb);
draw_quad(&test_context, ps_code);
......@@ -396,7 +394,6 @@ static void test_swizzle(void)
ID3D11Buffer_Release(cb);
ID3D10Blob_Release(ps_code);
}
release_test_context(&test_context);
}
......@@ -421,9 +418,7 @@ static void test_math(void)
if (!init_test_context(&test_context))
return;
todo_wine ps_code = compile_shader(ps_source, "ps_4_0");
if (ps_code)
{
ps_code = compile_shader(ps_source, "ps_4_0");
cb = create_buffer(test_context.device, D3D11_BIND_CONSTANT_BUFFER, sizeof(uniforms), uniforms);
ID3D11DeviceContext_PSSetConstantBuffers(test_context.immediate_context, 0, 1, &cb);
draw_quad(&test_context, ps_code);
......@@ -434,7 +429,6 @@ static void test_math(void)
ID3D11Buffer_Release(cb);
ID3D10Blob_Release(ps_code);
}
release_test_context(&test_context);
}
......@@ -458,9 +452,7 @@ static void test_conditionals(void)
if (!init_test_context(&test_context))
return;
todo_wine ps_code = compile_shader(ps_source, "ps_4_0");
if (ps_code)
{
ps_code = compile_shader(ps_source, "ps_4_0");
draw_quad(&test_context, ps_code);
init_readback(&test_context, &rb);
......@@ -480,7 +472,6 @@ static void test_conditionals(void)
release_readback(&test_context, &rb);
ID3D10Blob_Release(ps_code);
}
release_test_context(&test_context);
}
......@@ -621,7 +612,8 @@ static void test_sampling(void)
winetest_push_context("Test %u", i);
ID3D11DeviceContext_ClearRenderTargetView(test_context.immediate_context, test_context.rtv, red);
todo_wine ps_code = compile_shader_flags(tests[i], "ps_4_0", D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY);
todo_wine_if (i < 3)
ps_code = compile_shader_flags(tests[i], "ps_4_0", D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY);
if (ps_code)
{
draw_quad(&test_context, ps_code);
......@@ -937,9 +929,11 @@ static void test_reflection(void)
static void check_parameter_desc(const D3D11_SIGNATURE_PARAMETER_DESC *desc,
const D3D11_SIGNATURE_PARAMETER_DESC *expect)
{
todo_wine_if(strcmp(desc->SemanticName, expect->SemanticName))
ok(!strcmp(desc->SemanticName, expect->SemanticName), "Got name %s.\n", debugstr_a(desc->SemanticName));
ok(desc->SemanticIndex == expect->SemanticIndex, "Got index %u.\n", desc->SemanticIndex);
ok(desc->Register == expect->Register, "Got register %u.\n", desc->Register);
todo_wine_if(desc->SystemValueType != expect->SystemValueType)
ok(desc->SystemValueType == expect->SystemValueType, "Got sysval %u.\n", desc->SystemValueType);
ok(desc->ComponentType == expect->ComponentType, "Got data type %u.\n", desc->ComponentType);
ok(desc->Mask == expect->Mask, "Got mask %#x.\n", desc->Mask);
......@@ -1129,7 +1123,7 @@ static void test_semantic_reflection(void)
{
winetest_push_context("Test %u", i);
todo_wine code = compile_shader_flags(tests[i].source, tests[i].target,
todo_wine_if (i > 5) code = compile_shader_flags(tests[i].source, tests[i].target,
tests[i].legacy ? D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY : 0);
if (!code)
{
......@@ -1143,9 +1137,9 @@ static void test_semantic_reflection(void)
hr = reflection->lpVtbl->GetDesc(reflection, &shader_desc);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(shader_desc.InputParameters == tests[i].input_count,
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,
ok(shader_desc.OutputParameters == tests[i].output_count,
"Got %u output parameters.\n", shader_desc.OutputParameters);
for (j = 0; j < shader_desc.InputParameters; ++j)
......
......@@ -454,9 +454,7 @@ static void test_swizzle(void)
for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
todo_wine ps_code = compile_shader(tests[i].source, "ps_2_0");
if (ps_code)
{
ps_code = compile_shader(tests[i].source, "ps_2_0");
if (i == 0)
{
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
......@@ -473,7 +471,6 @@ static void test_swizzle(void)
ID3D10Blob_Release(ps_code);
}
}
release_test_context(&test_context);
}
......@@ -501,9 +498,7 @@ static void test_math(void)
return;
device = test_context.device;
todo_wine ps_code = compile_shader(ps_source, "ps_2_0");
if (ps_code)
{
ps_code = compile_shader(ps_source, "ps_2_0");
hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = ID3DXConstantTable_SetFloat(constants, device, "$u", 2.5f);
......@@ -527,7 +522,6 @@ static void test_math(void)
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
ID3D10Blob_Release(ps_code);
}
release_test_context(&test_context);
}
......@@ -559,29 +553,26 @@ static void test_conditionals(void)
return;
device = test_context.device;
todo_wine ps_code = compile_shader(ps_if_source, "ps_2_0");
if (ps_code)
{
ps_code = compile_shader(ps_if_source, "ps_2_0");
draw_quad(device, ps_code);
init_readback(device, &rb);
for (i = 0; i < 200; i += 40)
{
v = get_readback_vec4(&rb, i, 0);
ok(compare_vec4(v, 0.9f, 0.8f, 0.7f, 0.6f, 0),
todo_wine ok(compare_vec4(v, 0.9f, 0.8f, 0.7f, 0.6f, 0),
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
}
for (i = 240; i < 640; i += 40)
{
v = get_readback_vec4(&rb, i, 0);
ok(compare_vec4(v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
todo_wine ok(compare_vec4(v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
}
release_readback(&rb);
ID3D10Blob_Release(ps_code);
}
todo_wine ps_code = compile_shader(ps_ternary_source, "ps_2_0");
if (ps_code)
......@@ -737,9 +728,7 @@ static void test_comma(void)
if (!init_test_context(&test_context))
return;
todo_wine ps_code = compile_shader(ps_source, "ps_2_0");
if (ps_code)
{
ps_code = compile_shader(ps_source, "ps_2_0");
draw_quad(test_context.device, ps_code);
v = get_color_vec4(test_context.device, 0, 0);
......@@ -747,7 +736,6 @@ static void test_comma(void)
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
ID3D10Blob_Release(ps_code);
}
release_test_context(&test_context);
}
......@@ -774,17 +762,14 @@ static void test_return(void)
if (!init_test_context(&test_context))
return;
todo_wine ps_code = compile_shader(void_source, "ps_2_0");
if (ps_code)
{
ps_code = compile_shader(void_source, "ps_2_0");
draw_quad(test_context.device, ps_code);
v = get_color_vec4(test_context.device, 0, 0);
ok(compare_vec4(&v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
todo_wine ok(compare_vec4(&v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
ID3D10Blob_Release(ps_code);
}
todo_wine ps_code = compile_shader(implicit_conversion_source, "ps_2_0");
if (ps_code)
......@@ -948,9 +933,7 @@ static void test_struct_assignment(void)
if (!init_test_context(&test_context))
return;
todo_wine ps_code = compile_shader(ps_source, "ps_2_0");
if (ps_code)
{
ps_code = compile_shader(ps_source, "ps_2_0");
draw_quad(test_context.device, ps_code);
v = get_color_vec4(test_context.device, 0, 0);
......@@ -958,7 +941,6 @@ static void test_struct_assignment(void)
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
ID3D10Blob_Release(ps_code);
}
release_test_context(&test_context);
}
......@@ -993,22 +975,19 @@ static void test_struct_semantics(void)
if (!init_test_context(&test_context))
return;
todo_wine ps_code = compile_shader(ps_source, "ps_2_0");
if (ps_code)
{
ps_code = compile_shader(ps_source, "ps_2_0");
draw_quad(test_context.device, ps_code);
v = get_color_vec4(test_context.device, 64, 48);
v.z = v.w = 0.0f;
todo_wine ok(compare_vec4(&v, 0.1f, 0.1f, 0.0f, 0.0f, 4096),
ok(compare_vec4(&v, 0.1f, 0.1f, 0.0f, 0.0f, 4096),
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
v = get_color_vec4(test_context.device, 320, 240);
v.z = v.w = 0.0f;
todo_wine ok(compare_vec4(&v, 0.5f, 0.5f, 0.0f, 0.0f, 4096),
ok(compare_vec4(&v, 0.5f, 0.5f, 0.0f, 0.0f, 4096),
"Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
ID3D10Blob_Release(ps_code);
}
release_test_context(&test_context);
}
......@@ -1122,7 +1101,7 @@ static void test_samplers(void)
{
hr = IDirect3DDevice9_Clear(test_context.device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 0, 0), 1.0f, 0);
ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
todo_wine ps_code = compile_shader(tests[i], "ps_2_0");
todo_wine_if (i < 3) ps_code = compile_shader(tests[i], "ps_2_0");
if (ps_code)
{
draw_quad(test_context.device, ps_code);
......@@ -1434,12 +1413,9 @@ 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 %#lx.\n", i, targets[j], hr);
if (hr == E_FAIL)
{
ok(hr == E_FAIL, "Test %u, target %s: Got unexpected hr %#lx.\n", i, targets[j], hr);
ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]);
ID3D10Blob_Release(errors);
}
ok(!compiled, "Test %u, target %s, expected no compiled shader blob.\n", i, targets[j]);
}
}
......@@ -1634,7 +1610,7 @@ static void test_include(void)
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
}
todo_wine_if (i == 1)
todo_wine_if (i != 0)
ok(!errors, "Got unexpected errors.\n");
if (blob)
{
......@@ -1644,7 +1620,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 unexpected hr %#lx.\n", hr);
todo_wine_if (i != 1) 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);
......@@ -1658,9 +1634,8 @@ static void test_include(void)
{
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
}
todo_wine_if (i == 1)
ok(!errors, "Got unexpected errors.\n");
}
if (blob)
{
ID3D10Blob_Release(blob);
......@@ -1676,7 +1651,7 @@ static void test_include(void)
hr = D3DCompileFromFile(L"nonexistent", NULL, NULL, "main", "vs_2_0", 0, 0, &blob, &errors);
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");
todo_wine ok(!errors, "Got unexpected errors.\n");
hr = D3DCompileFromFile(filename, NULL, NULL, "main", "ps_2_0", 0, 0, &blob, &errors);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
......@@ -1689,7 +1664,7 @@ static void test_include(void)
hr = D3DCompileFromFile(filename, NULL, &include.ID3DInclude_iface, "main", "ps_2_0", 0, 0, &blob, &errors);
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");
todo_wine ok(!errors, "Got unexpected errors.\n");
if (blob)
{
ID3D10Blob_Release(blob);
......@@ -1702,7 +1677,7 @@ static void test_include(void)
hr = D3DCompileFromFile(filename, NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_2_0", 0, 0, &blob, &errors);
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");
todo_wine ok(!errors, "Got unexpected errors.\n");
if (blob)
{
ID3D10Blob_Release(blob);
......@@ -1733,9 +1708,8 @@ static void test_include(void)
{
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
}
todo_wine_if (i == 1)
ok(!errors, "Got unexpected errors.\n");
}
if (blob)
{
ID3D10Blob_Release(blob);
......@@ -1748,7 +1722,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 unexpected hr %#lx.\n", hr);
todo_wine ok(!!blob, "Got unexpected blob.\n");
ok(!errors, "Got unexpected errors.\n");
todo_wine ok(!errors, "Got unexpected errors.\n");
if (blob)
{
ID3D10Blob_Release(blob);
......
MODULE = d3dcompiler_46.dll
IMPORTLIB = d3dcompiler_46
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=46
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
MODULE = d3dcompiler_47.dll
IMPORTLIB = d3dcompiler
IMPORTS = dxguid uuid
IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=47
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment