From: Kieran Duggan kieranduggan15@gmail.com
Signed-off-by: Kieran Duggan kieranduggan15@gmail.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Add missing todo_wine.
dlls/d3dx9_36/tests/core.c | 84 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 19 deletions(-)
diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c index 75d33c1e0dc..91e458bbb88 100644 --- a/dlls/d3dx9_36/tests/core.c +++ b/dlls/d3dx9_36/tests/core.c @@ -305,23 +305,28 @@ static void test_ID3DXSprite(IDirect3DDevice9 *device)
static void test_ID3DXFont(IDirect3DDevice9 *device) { - D3DXFONT_DESCA desc; - ID3DXFont *font; - HRESULT hr; - int ref; - int i; - static const struct { - INT font_height; - UINT expected_size; - DWORD expected_levels; - } texture_tests[] = { + static const WCHAR testW[] = {'t','e','s','t',0}; + static const struct + { + int font_height; + unsigned int expected_size; + unsigned int expected_levels; + } + tests[] = + { { 6, 128, 4 }, { 8, 128, 4 }, { 10, 256, 5 }, { 12, 256, 5 }, - { 72, 256, 8 } + { 72, 256, 8 }, }; - + const unsigned int size = ARRAY_SIZE(testW); + D3DXFONT_DESCA desc; + ID3DXSprite *sprite; + int ref, i, height; + ID3DXFont *font; + HRESULT hr; + RECT rect;
/* D3DXCreateFont */ ref = get_ref((IUnknown*)device); @@ -463,8 +468,6 @@ static void test_ID3DXFont(IDirect3DDevice9 *device) /* ID3DXFont_PreloadText */ hr = D3DXCreateFontA(device, 12, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font); if(SUCCEEDED(hr)) { - const WCHAR testW[] = {'t','e','s','t',0}; - todo_wine { hr = ID3DXFont_PreloadTextA(font, NULL, -1); ok(hr == D3DERR_INVALIDCALL, "ID3DXFont_PreloadTextA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); @@ -552,7 +555,8 @@ static void test_ID3DXFont(IDirect3DDevice9 *device) check_release((IUnknown*)font, 0); } else skip("Failed to create a ID3DXFont object\n");
- for(i = 0; i < ARRAY_SIZE(texture_tests); i++) { + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { HDC hdc; DWORD ret; HRESULT hr; @@ -560,7 +564,8 @@ static void test_ID3DXFont(IDirect3DDevice9 *device) char c = 'a'; IDirect3DTexture9 *texture;
- hr = D3DXCreateFontA(device, texture_tests[i].font_height, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font); + hr = D3DXCreateFontA(device, tests[i].font_height, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, + OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font); if(FAILED(hr)) { skip("Failed to create a ID3DXFont object\n"); continue; @@ -578,17 +583,58 @@ static void test_ID3DXFont(IDirect3DDevice9 *device) D3DSURFACE_DESC desc;
levels = IDirect3DTexture9_GetLevelCount(texture); - ok(levels == texture_tests[i].expected_levels, "Got levels %u, expected %u\n", levels, texture_tests[i].expected_levels); + ok(levels == tests[i].expected_levels, "Got levels %u, expected %u\n", + levels, tests[i].expected_levels); hr = IDirect3DTexture9_GetLevelDesc(texture, 0, &desc); ok(hr == D3D_OK, "IDirect3DTexture9_GetLevelDesc failed\n"); ok(desc.Format == D3DFMT_A8R8G8B8, "Got format %#x, expected %#x\n", desc.Format, D3DFMT_A8R8G8B8); ok(desc.Usage == 0, "Got usage %#x, expected %#x\n", desc.Usage, 0); - ok(desc.Width == texture_tests[i].expected_size, "Got width %u, expected %u\n", desc.Width, texture_tests[i].expected_size); - ok(desc.Height == texture_tests[i].expected_size, "Got height %u, expected %u\n", desc.Height, texture_tests[i].expected_size); + ok(desc.Width == tests[i].expected_size, "Got width %u, expected %u\n", + desc.Width, tests[i].expected_size); + ok(desc.Height == tests[i].expected_size, "Got height %u, expected %u\n", + desc.Height, tests[i].expected_size); ok(desc.Pool == D3DPOOL_MANAGED, "Got pool %u, expected %u\n", desc.Pool, D3DPOOL_MANAGED);
IDirect3DTexture9_Release(texture); } + + /* ID3DXFontImpl_DrawText */ + D3DXCreateSprite(device, &sprite); + SetRect(&rect, 0, 0, 640, 480); + + IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0); + + IDirect3DDevice9_BeginScene(device); + hr = ID3DXSprite_Begin(sprite, D3DXSPRITE_ALPHABLEND); + ok (hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + todo_wine + { + height = ID3DXFont_DrawTextW(font, sprite, testW, -1, &rect, DT_TOP, 0xffffffff); + ok(height == tests[i].font_height, "Got unexpected height %u.\n", height); + height = ID3DXFont_DrawTextW(font, sprite, testW, size, &rect, DT_TOP, 0xffffffff); + ok(height == tests[i].font_height, "Got unexpected height %u.\n", height); + height = ID3DXFont_DrawTextW(font, sprite, testW, size, &rect, DT_RIGHT, 0xffffffff); + ok(height == tests[i].font_height, "Got unexpected height %u.\n", height); + height = ID3DXFont_DrawTextW(font, sprite, testW, size, &rect, DT_LEFT | DT_NOCLIP, + 0xffffffff); + ok(height == tests[i].font_height, "Got unexpected height %u.\n", height); + } + + SetRect(&rect, 0, 0, 0, 0); + height = ID3DXFont_DrawTextW(font, sprite, testW, size, &rect, + DT_LEFT | DT_CALCRECT, 0xffffffff); + todo_wine ok(height == tests[i].font_height, "Got unexpected height %u.\n", height); + ok(!rect.left, "Got unexpected rect left %d.\n", rect.left); + ok(!rect.top, "Got unexpected rect top %d.\n", rect.top); + todo_wine ok(rect.right, "Got unexpected rect right %d.\n", rect.right); + todo_wine ok(rect.bottom == tests[i].font_height, "Got unexpected rect bottom %d.\n", rect.bottom); + + hr = ID3DXSprite_End(sprite); + ok (hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + IDirect3DDevice9_EndScene(device); + ID3DXSprite_Release(sprite); + ID3DXFont_Release(font); } }
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Restore _UNORM and _SNORM for semantics / declarations.
dlls/wined3d/glsl_shader.c | 8 -------- dlls/wined3d/shader.c | 4 ---- dlls/wined3d/shader_sm4.c | 44 ++++++++++++++++++------------------------ dlls/wined3d/wined3d_private.h | 4 ---- 4 files changed, 19 insertions(+), 41 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 86259ae4755..f1f3020d53d 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -3093,8 +3093,6 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * case WINED3D_DATA_INT: sprintf(register_name, "%#x", reg->u.immconst_data[0]); break; - case WINED3D_DATA_RESOURCE: - case WINED3D_DATA_SAMPLER: case WINED3D_DATA_UINT: sprintf(register_name, "%#xu", reg->u.immconst_data[0]); break; @@ -3129,8 +3127,6 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * reg->u.immconst_data[0], reg->u.immconst_data[1], reg->u.immconst_data[2], reg->u.immconst_data[3]); break; - case WINED3D_DATA_RESOURCE: - case WINED3D_DATA_SAMPLER: case WINED3D_DATA_UINT: sprintf(register_name, "uvec4(%#xu, %#xu, %#xu, %#xu)", reg->u.immconst_data[0], reg->u.immconst_data[1], @@ -3342,8 +3338,6 @@ static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *dst_param, co case WINED3D_DATA_INT: string_buffer_sprintf(dst_param, "floatBitsToInt(%s)", src_param); return; - case WINED3D_DATA_RESOURCE: - case WINED3D_DATA_SAMPLER: case WINED3D_DATA_UINT: string_buffer_sprintf(dst_param, "floatBitsToUint(%s)", src_param); return; @@ -3457,8 +3451,6 @@ static DWORD shader_glsl_append_dst_ext(struct wined3d_string_buffer *buffer, shader_addline(buffer, "%s%s = %sintBitsToFloat(", glsl_dst.reg_name, glsl_dst.mask_str, shift_glsl_tab[dst->shift]); break; - case WINED3D_DATA_RESOURCE: - case WINED3D_DATA_SAMPLER: case WINED3D_DATA_UINT: shader_addline(buffer, "%s%s = %suintBitsToFloat(", glsl_dst.reg_name, glsl_dst.mask_str, shift_glsl_tab[dst->shift]); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 20d4f0773dd..44879f8b7c4 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2448,8 +2448,6 @@ static void shader_dump_register(struct wined3d_string_buffer *buffer, case WINED3D_DATA_INT: shader_addline(buffer, "%d", reg->u.immconst_data[0]); break; - case WINED3D_DATA_RESOURCE: - case WINED3D_DATA_SAMPLER: case WINED3D_DATA_UINT: shader_addline(buffer, "%u", reg->u.immconst_data[0]); break; @@ -2472,8 +2470,6 @@ static void shader_dump_register(struct wined3d_string_buffer *buffer, reg->u.immconst_data[0], reg->u.immconst_data[1], reg->u.immconst_data[2], reg->u.immconst_data[3]); break; - case WINED3D_DATA_RESOURCE: - case WINED3D_DATA_SAMPLER: case WINED3D_DATA_UINT: shader_addline(buffer, "%u, %u, %u, %u", reg->u.immconst_data[0], reg->u.immconst_data[1], diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index b119e8feaa8..acde7a56d1c 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -565,8 +565,8 @@ static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins, { enum wined3d_sm4_resource_type resource_type; enum wined3d_sm4_data_type data_type; - enum wined3d_data_type reg_data_type; DWORD components; + BOOL uav;
resource_type = (opcode_token & WINED3D_SM4_RESOURCE_TYPE_MASK) >> WINED3D_SM4_RESOURCE_TYPE_SHIFT; if (!resource_type || (resource_type >= ARRAY_SIZE(resource_type_table))) @@ -578,8 +578,8 @@ static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins, { ins->declaration.semantic.resource_type = resource_type_table[resource_type]; } - reg_data_type = opcode == WINED3D_SM4_OP_DCL_RESOURCE ? WINED3D_DATA_RESOURCE : WINED3D_DATA_UAV; - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], reg_data_type, &ins->declaration.semantic.reg); + uav = opcode != WINED3D_SM4_OP_DCL_RESOURCE; + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.semantic.reg);
components = *tokens++; if ((components & 0xfff0) != (components & 0xf) * 0x1110) @@ -596,7 +596,7 @@ static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins, ins->declaration.semantic.resource_data_type = data_type_table[data_type]; }
- if (reg_data_type == WINED3D_DATA_UAV) + if (uav) ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT; }
@@ -616,14 +616,14 @@ static void shader_sm4_read_dcl_sampler(struct wined3d_shader_instruction *ins, ins->flags = (opcode_token & WINED3D_SM4_SAMPLER_MODE_MASK) >> WINED3D_SM4_SAMPLER_MODE_SHIFT; if (ins->flags & ~WINED3D_SM4_SAMPLER_COMPARISON) FIXME("Unhandled sampler mode %#x.\n", ins->flags); - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_SAMPLER, &ins->declaration.dst); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.dst); }
static void shader_sm4_read_dcl_index_range(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_OPAQUE, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.index_range.first_register); ins->declaration.index_range.last_register = *tokens; } @@ -731,7 +731,7 @@ static void shader_sm5_read_fcall(struct wined3d_shader_instruction *ins, struct wined3d_sm4_data *priv) { priv->src_param[0].reg.u.fp_body_idx = *tokens++; - shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_OPAQUE, &priv->src_param[0]); + shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &priv->src_param[0]); }
static void shader_sm5_read_dcl_function_body(struct wined3d_shader_instruction *ins, @@ -812,7 +812,7 @@ static void shader_sm5_read_dcl_uav_raw(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UAV, &ins->declaration.dst); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.dst); ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT; }
@@ -820,7 +820,7 @@ static void shader_sm5_read_dcl_uav_structured(struct wined3d_shader_instruction DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UAV, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.structured_resource.reg); ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT; ins->declaration.structured_resource.byte_stride = *tokens; @@ -854,7 +854,7 @@ static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instru DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_RESOURCE, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.structured_resource.reg); ins->declaration.structured_resource.byte_stride = *tokens; if (ins->declaration.structured_resource.byte_stride % 4) @@ -865,7 +865,7 @@ static void shader_sm5_read_dcl_resource_raw(struct wined3d_shader_instruction * DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_RESOURCE, &ins->declaration.dst); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.dst); }
static void shader_sm5_read_sync(struct wined3d_shader_instruction *ins, @@ -875,15 +875,13 @@ static void shader_sm5_read_sync(struct wined3d_shader_instruction *ins, ins->flags = (opcode_token & WINED3D_SM5_SYNC_FLAGS_MASK) >> WINED3D_SM5_SYNC_FLAGS_SHIFT; }
-/* - * f -> WINED3D_DATA_FLOAT - * i -> WINED3D_DATA_INT - * u -> WINED3D_DATA_UINT - * O -> WINED3D_DATA_OPAQUE - * R -> WINED3D_DATA_RESOURCE - * S -> WINED3D_DATA_SAMPLER - * U -> WINED3D_DATA_UAV - */ +/* f -> FLOAT + * i -> INT + * u -> UINT + * O -> OPAQUE + * R -> RESOURCE + * S -> SAMPLER + * U -> UAV */ static const struct wined3d_sm4_opcode_info opcode_table[] = { {WINED3D_SM4_OP_ADD, WINED3DSIH_ADD, "f", "ff"}, @@ -1207,15 +1205,11 @@ static enum wined3d_data_type map_data_type(char t) case 'i': return WINED3D_DATA_INT; case 'u': - return WINED3D_DATA_UINT; case 'O': - return WINED3D_DATA_OPAQUE; case 'R': - return WINED3D_DATA_RESOURCE; case 'S': - return WINED3D_DATA_SAMPLER; case 'U': - return WINED3D_DATA_UAV; + return WINED3D_DATA_UINT; default: ERR("Invalid data type '%c'.\n", t); return WINED3D_DATA_FLOAT; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9aa70817f5d..b65288dc415 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -504,13 +504,9 @@ enum wined3d_data_type { WINED3D_DATA_FLOAT, WINED3D_DATA_INT, - WINED3D_DATA_RESOURCE, - WINED3D_DATA_SAMPLER, - WINED3D_DATA_UAV, WINED3D_DATA_UINT, WINED3D_DATA_UNORM, WINED3D_DATA_SNORM, - WINED3D_DATA_OPAQUE, };
enum wined3d_immconst_type
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2-ish: Leave the enum around only for the semantic data type / shader_dump_decl_usage().
dlls/wined3d/glsl_shader.c | 100 ++++++++++++++++++++--------------------- dlls/wined3d/shader.c | 45 +++++++++++++------ dlls/wined3d/shader_sm1.c | 14 +++--- dlls/wined3d/shader_sm4.c | 56 +++++++++++------------ dlls/wined3d/wined3d_private.h | 4 +- 5 files changed, 117 insertions(+), 102 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index f1f3020d53d..cd4780a6419 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -88,7 +88,7 @@ struct glsl_sample_function struct wined3d_string_buffer *name; unsigned int coord_mask; unsigned int deriv_mask; - enum wined3d_data_type data_type; + enum wined3d_component_type data_type; BOOL output_single_component; unsigned int offset_size; }; @@ -2522,17 +2522,15 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
switch (reg_maps->resource_info[entry->resource_idx].data_type) { - case WINED3D_DATA_FLOAT: - case WINED3D_DATA_UNORM: - case WINED3D_DATA_SNORM: + case WINED3D_TYPE_FLOAT: sampler_type_prefix = ""; break;
- case WINED3D_DATA_INT: + case WINED3D_TYPE_INT: sampler_type_prefix = "i"; break;
- case WINED3D_DATA_UINT: + case WINED3D_TYPE_UINT: sampler_type_prefix = "u"; break;
@@ -2640,19 +2638,17 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
switch (reg_maps->uav_resource_info[i].data_type) { - case WINED3D_DATA_FLOAT: - case WINED3D_DATA_UNORM: - case WINED3D_DATA_SNORM: + case WINED3D_TYPE_FLOAT: image_type_prefix = ""; read_format = "r32f"; break;
- case WINED3D_DATA_INT: + case WINED3D_TYPE_INT: image_type_prefix = "i"; read_format = "r32i"; break;
- case WINED3D_DATA_UINT: + case WINED3D_TYPE_UINT: image_type_prefix = "u"; read_format = "r32ui"; break; @@ -2848,7 +2844,7 @@ static void shader_glsl_fixup_scalar_register_variable(char *register_name, /** Writes the GLSL variable name that corresponds to the register that the * DX opcode parameter is trying to access */ static void shader_glsl_get_register_name(const struct wined3d_shader_register *reg, - enum wined3d_data_type data_type, char *register_name, BOOL *is_color, + enum wined3d_component_type data_type, char *register_name, BOOL *is_color, const struct wined3d_shader_instruction *ins) { /* oPos, oFog and oPts in D3D */ @@ -3084,16 +3080,16 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * case WINED3D_IMMCONST_SCALAR: switch (data_type) { - case WINED3D_DATA_FLOAT: + case WINED3D_TYPE_FLOAT: if (gl_info->supported[ARB_SHADER_BIT_ENCODING]) sprintf(register_name, "uintBitsToFloat(%#xu)", reg->u.immconst_data[0]); else wined3d_ftoa(*(const float *)reg->u.immconst_data, register_name); break; - case WINED3D_DATA_INT: + case WINED3D_TYPE_INT: sprintf(register_name, "%#x", reg->u.immconst_data[0]); break; - case WINED3D_DATA_UINT: + case WINED3D_TYPE_UINT: sprintf(register_name, "%#xu", reg->u.immconst_data[0]); break; default: @@ -3105,7 +3101,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * case WINED3D_IMMCONST_VEC4: switch (data_type) { - case WINED3D_DATA_FLOAT: + case WINED3D_TYPE_FLOAT: if (gl_info->supported[ARB_SHADER_BIT_ENCODING]) { sprintf(register_name, "uintBitsToFloat(uvec4(%#xu, %#xu, %#xu, %#xu))", @@ -3122,12 +3118,12 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register * imm_str[0], imm_str[1], imm_str[2], imm_str[3]); } break; - case WINED3D_DATA_INT: + case WINED3D_TYPE_INT: sprintf(register_name, "ivec4(%#x, %#x, %#x, %#x)", reg->u.immconst_data[0], reg->u.immconst_data[1], reg->u.immconst_data[2], reg->u.immconst_data[3]); break; - case WINED3D_DATA_UINT: + case WINED3D_TYPE_UINT: sprintf(register_name, "uvec4(%#xu, %#xu, %#xu, %#xu)", reg->u.immconst_data[0], reg->u.immconst_data[1], reg->u.immconst_data[2], reg->u.immconst_data[3]); @@ -3323,22 +3319,22 @@ static void shader_glsl_get_swizzle(const struct wined3d_shader_src_param *param }
static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *dst_param, const char *src_param, - enum wined3d_data_type dst_data_type, enum wined3d_data_type src_data_type) + enum wined3d_component_type dst_type, enum wined3d_component_type src_type) { - if (dst_data_type == src_data_type) + if (dst_type == src_type) { string_buffer_sprintf(dst_param, "%s", src_param); return; }
- if (src_data_type == WINED3D_DATA_FLOAT) + if (src_type == WINED3D_TYPE_FLOAT) { - switch (dst_data_type) + switch (dst_type) { - case WINED3D_DATA_INT: + case WINED3D_TYPE_INT: string_buffer_sprintf(dst_param, "floatBitsToInt(%s)", src_param); return; - case WINED3D_DATA_UINT: + case WINED3D_TYPE_UINT: string_buffer_sprintf(dst_param, "floatBitsToUint(%s)", src_param); return; default: @@ -3346,19 +3342,19 @@ static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *dst_param, co } }
- if (src_data_type == WINED3D_DATA_UINT && dst_data_type == WINED3D_DATA_FLOAT) + if (src_type == WINED3D_TYPE_UINT && dst_type == WINED3D_TYPE_FLOAT) { string_buffer_sprintf(dst_param, "uintBitsToFloat(%s)", src_param); return; }
- if (src_data_type == WINED3D_DATA_INT && dst_data_type == WINED3D_DATA_FLOAT) + if (src_type == WINED3D_TYPE_INT && dst_type == WINED3D_TYPE_FLOAT) { string_buffer_sprintf(dst_param, "intBitsToFloat(%s)", src_param); return; }
- FIXME("Unhandled cast from %#x to %#x.\n", src_data_type, dst_data_type); + FIXME("Unhandled cast from %#x to %#x.\n", src_type, dst_type); string_buffer_sprintf(dst_param, "%s", src_param); }
@@ -3367,11 +3363,11 @@ static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *dst_param, co * caller needs this information as well. */ static void shader_glsl_add_src_param_ext(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_src_param *wined3d_src, DWORD mask, struct glsl_src_param *glsl_src, - enum wined3d_data_type data_type) + enum wined3d_component_type data_type) { struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; struct wined3d_string_buffer *reg_name = string_buffer_get(priv->string_buffers); - enum wined3d_data_type param_data_type; + enum wined3d_component_type param_data_type; BOOL is_color = FALSE; char swizzle_str[6];
@@ -3396,10 +3392,10 @@ static void shader_glsl_add_src_param_ext(const struct wined3d_shader_instructio case WINED3DSPR_PRIMID: case WINED3DSPR_THREADGROUPID: case WINED3DSPR_THREADID: - param_data_type = WINED3D_DATA_INT; + param_data_type = WINED3D_TYPE_INT; break; default: - param_data_type = WINED3D_DATA_FLOAT; + param_data_type = WINED3D_TYPE_FLOAT; break; }
@@ -3434,7 +3430,7 @@ static DWORD shader_glsl_add_dst_param(const struct wined3d_shader_instruction * /* Append the destination part of the instruction to the buffer, return the effective write mask */ static DWORD shader_glsl_append_dst_ext(struct wined3d_string_buffer *buffer, const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *dst, - enum wined3d_data_type data_type) + enum wined3d_component_type data_type) { struct glsl_dst_param glsl_dst; DWORD mask; @@ -3443,15 +3439,15 @@ static DWORD shader_glsl_append_dst_ext(struct wined3d_string_buffer *buffer, { switch (data_type) { - case WINED3D_DATA_FLOAT: + case WINED3D_TYPE_FLOAT: shader_addline(buffer, "%s%s = %s(", glsl_dst.reg_name, glsl_dst.mask_str, shift_glsl_tab[dst->shift]); break; - case WINED3D_DATA_INT: + case WINED3D_TYPE_INT: shader_addline(buffer, "%s%s = %sintBitsToFloat(", glsl_dst.reg_name, glsl_dst.mask_str, shift_glsl_tab[dst->shift]); break; - case WINED3D_DATA_UINT: + case WINED3D_TYPE_UINT: shader_addline(buffer, "%s%s = %suintBitsToFloat(", glsl_dst.reg_name, glsl_dst.mask_str, shift_glsl_tab[dst->shift]); break; @@ -4013,7 +4009,7 @@ static void shader_glsl_udiv(const struct wined3d_shader_instruction *ins) shader_glsl_add_src_param(ins, &ins->src[1], write_mask, &src1_param); shader_addline(buffer, "%s %% %s);\n", src0_param.param_str, src1_param.param_str);
- shader_glsl_append_dst_ext(buffer, ins, &ins->dst[0], WINED3D_DATA_FLOAT); + shader_glsl_append_dst_ext(buffer, ins, &ins->dst[0], WINED3D_TYPE_FLOAT); shader_addline(buffer, "tmp0%s);\n", dst_mask); } else @@ -4291,7 +4287,7 @@ static void shader_glsl_bitwise_op(const struct wined3d_shader_instruction *ins) dst.write_mask = ins->dst[0].write_mask & (WINED3DSP_WRITEMASK_0 << i); if (tmp_dst && (write_mask = shader_glsl_get_write_mask(&dst, mask_char))) shader_addline(buffer, "tmp0%s = %sBitsToFloat(", mask_char, - dst.reg.data_type == WINED3D_DATA_INT ? "int" : "uint"); + dst.reg.data_type == WINED3D_TYPE_INT ? "int" : "uint"); else if (!(write_mask = shader_glsl_append_dst_ext(buffer, ins, &dst, dst.reg.data_type))) continue;
@@ -4305,7 +4301,7 @@ static void shader_glsl_bitwise_op(const struct wined3d_shader_instruction *ins)
if (tmp_dst) { - shader_glsl_append_dst_ext(buffer, ins, &ins->dst[0], WINED3D_DATA_FLOAT); + shader_glsl_append_dst_ext(buffer, ins, &ins->dst[0], WINED3D_TYPE_FLOAT); shader_glsl_get_write_mask(&ins->dst[0], mask_char); shader_addline(buffer, "tmp0%s);\n", mask_char); } @@ -5445,7 +5441,7 @@ static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins) struct wined3d_string_buffer *buffer = ins->ctx->buffer; enum wined3d_shader_resource_type resource_type; struct wined3d_string_buffer *address; - enum wined3d_data_type data_type; + enum wined3d_component_type data_type; unsigned int resource_idx, stride; const char *op, *resource; DWORD coord_mask; @@ -5461,7 +5457,7 @@ static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins) return; } resource = "g"; - data_type = WINED3D_DATA_UINT; + data_type = WINED3D_TYPE_UINT; coord_mask = 1; stride = reg_maps->tgsm[resource_idx].stride; } @@ -5513,7 +5509,7 @@ static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins) op = "atomicMax"; else op = "imageAtomicMax"; - if (data_type != WINED3D_DATA_INT) + if (data_type != WINED3D_TYPE_INT) { FIXME("Unhandled opcode %#x for unsigned integers.\n", ins->handler_idx); return; @@ -5525,7 +5521,7 @@ static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins) op = "atomicMin"; else op = "imageAtomicMin"; - if (data_type != WINED3D_DATA_INT) + if (data_type != WINED3D_TYPE_INT) { FIXME("Unhandled opcode %#x for unsigned integers.\n", ins->handler_idx); return; @@ -5544,7 +5540,7 @@ static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins) op = "atomicMax"; else op = "imageAtomicMax"; - if (data_type != WINED3D_DATA_UINT) + if (data_type != WINED3D_TYPE_UINT) { FIXME("Unhandled opcode %#x for signed integers.\n", ins->handler_idx); return; @@ -5556,7 +5552,7 @@ static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins) op = "atomicMin"; else op = "imageAtomicMin"; - if (data_type != WINED3D_DATA_UINT) + if (data_type != WINED3D_TYPE_UINT) { FIXME("Unhandled opcode %#x for signed integers.\n", ins->handler_idx); return; @@ -5640,7 +5636,7 @@ static void shader_glsl_ld_uav(const struct wined3d_shader_instruction *ins) const struct wined3d_shader_version *version = ®_maps->shader_version; enum wined3d_shader_resource_type resource_type; struct glsl_src_param image_coord_param; - enum wined3d_data_type data_type; + enum wined3d_component_type data_type; DWORD coord_mask, write_mask; unsigned int uav_idx; char dst_swizzle[6]; @@ -5761,7 +5757,7 @@ static void shader_glsl_store_uav(const struct wined3d_shader_instruction *ins) const struct wined3d_shader_version *version = ®_maps->shader_version; struct glsl_src_param image_coord_param, image_data_param; enum wined3d_shader_resource_type resource_type; - enum wined3d_data_type data_type; + enum wined3d_component_type data_type; unsigned int uav_idx; DWORD coord_mask;
@@ -5951,7 +5947,7 @@ static void shader_glsl_resinfo(const struct wined3d_shader_instruction *ins) enum wined3d_shader_resource_type resource_type; enum wined3d_shader_register_type reg_type; unsigned int resource_idx, bind_idx, i; - enum wined3d_data_type dst_data_type; + enum wined3d_component_type dst_data_type; struct glsl_src_param lod_param; BOOL supports_mipmaps; char dst_swizzle[6]; @@ -5959,7 +5955,7 @@ static void shader_glsl_resinfo(const struct wined3d_shader_instruction *ins)
dst_data_type = ins->dst[0].reg.data_type; if (ins->flags == WINED3DSI_RESINFO_UINT) - dst_data_type = WINED3D_DATA_UINT; + dst_data_type = WINED3D_TYPE_UINT; else if (ins->flags) FIXME("Unhandled flags %#x.\n", ins->flags);
@@ -5987,7 +5983,7 @@ static void shader_glsl_resinfo(const struct wined3d_shader_instruction *ins) write_mask = shader_glsl_append_dst_ext(buffer, ins, &ins->dst[0], dst_data_type); shader_glsl_get_swizzle(&ins->src[1], FALSE, write_mask, dst_swizzle);
- if (dst_data_type == WINED3D_DATA_UINT) + if (dst_data_type == WINED3D_TYPE_UINT) shader_addline(buffer, "uvec4("); else shader_addline(buffer, "vec4("); @@ -6040,21 +6036,21 @@ static void shader_glsl_sample_info(const struct wined3d_shader_instruction *ins const struct wined3d_shader_dst_param *dst = ins->dst; const struct wined3d_shader_src_param *src = ins->src; enum wined3d_shader_resource_type resource_type; - enum wined3d_data_type dst_data_type; + enum wined3d_component_type dst_data_type; unsigned int resource_idx, bind_idx; char dst_swizzle[6]; DWORD write_mask;
dst_data_type = dst->reg.data_type; if (ins->flags == WINED3DSI_SAMPLE_INFO_UINT) - dst_data_type = WINED3D_DATA_UINT; + dst_data_type = WINED3D_TYPE_UINT; else if (ins->flags) FIXME("Unhandled flags %#x.\n", ins->flags);
write_mask = shader_glsl_append_dst_ext(buffer, ins, dst, dst_data_type); shader_glsl_get_swizzle(src, FALSE, write_mask, dst_swizzle);
- if (dst_data_type == WINED3D_DATA_UINT) + if (dst_data_type == WINED3D_TYPE_UINT) shader_addline(buffer, "uvec4("); else shader_addline(buffer, "vec4("); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 44879f8b7c4..7c6b1243d79 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1030,6 +1030,23 @@ static HRESULT shader_scan_output_signature(struct wined3d_shader *shader) return WINED3D_OK; }
+static enum wined3d_component_type component_type_from_data_type(enum wined3d_data_type type) +{ + switch (type) + { + case WINED3D_DATA_FLOAT: + case WINED3D_DATA_UNORM: + case WINED3D_DATA_SNORM: + return WINED3D_TYPE_FLOAT; + case WINED3D_DATA_INT: + return WINED3D_TYPE_INT; + case WINED3D_DATA_UINT: + return WINED3D_TYPE_UINT; + } + ERR("Unexpected data type %u.\n", type); + return WINED3D_TYPE_FLOAT; +} + /* Note that this does not count the loop register as an address register. */ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD constf_size) { @@ -1128,7 +1145,8 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co break; } reg_maps->resource_info[reg_idx].type = semantic->resource_type; - reg_maps->resource_info[reg_idx].data_type = semantic->resource_data_type; + reg_maps->resource_info[reg_idx].data_type = + component_type_from_data_type(semantic->resource_data_type); break;
case WINED3DSPR_UAV: @@ -1138,7 +1156,8 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co break; } reg_maps->uav_resource_info[reg_idx].type = semantic->resource_type; - reg_maps->uav_resource_info[reg_idx].data_type = semantic->resource_data_type; + reg_maps->uav_resource_info[reg_idx].data_type = + component_type_from_data_type(semantic->resource_data_type); if (ins.flags) FIXME("Ignoring typed UAV flags %#x.\n", ins.flags); break; @@ -1270,7 +1289,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co break; } reg_maps->resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_BUFFER; - reg_maps->resource_info[reg_idx].data_type = WINED3D_DATA_UINT; + reg_maps->resource_info[reg_idx].data_type = WINED3D_TYPE_UINT; reg_maps->resource_info[reg_idx].flags = WINED3D_VIEW_BUFFER_RAW; } else if (ins.handler_idx == WINED3DSIH_DCL_RESOURCE_STRUCTURED) @@ -1282,7 +1301,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co break; } reg_maps->resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_BUFFER; - reg_maps->resource_info[reg_idx].data_type = WINED3D_DATA_UINT; + reg_maps->resource_info[reg_idx].data_type = WINED3D_TYPE_UINT; reg_maps->resource_info[reg_idx].flags = 0; reg_maps->resource_info[reg_idx].stride = ins.declaration.structured_resource.byte_stride / 4; } @@ -1356,7 +1375,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co if (ins.flags) FIXME("Ignoring raw UAV flags %#x.\n", ins.flags); reg_maps->uav_resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_BUFFER; - reg_maps->uav_resource_info[reg_idx].data_type = WINED3D_DATA_UINT; + reg_maps->uav_resource_info[reg_idx].data_type = WINED3D_TYPE_UINT; reg_maps->uav_resource_info[reg_idx].flags = WINED3D_VIEW_BUFFER_RAW; } else if (ins.handler_idx == WINED3DSIH_DCL_UAV_STRUCTURED) @@ -1370,7 +1389,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co if (ins.flags) FIXME("Ignoring structured UAV flags %#x.\n", ins.flags); reg_maps->uav_resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_BUFFER; - reg_maps->uav_resource_info[reg_idx].data_type = WINED3D_DATA_UINT; + reg_maps->uav_resource_info[reg_idx].data_type = WINED3D_TYPE_UINT; reg_maps->uav_resource_info[reg_idx].flags = 0; reg_maps->uav_resource_info[reg_idx].stride = ins.declaration.structured_resource.byte_stride / 4; } @@ -1609,7 +1628,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, DWORD co
TRACE("Setting fake 2D resource for 1.x pixelshader.\n"); reg_maps->resource_info[reg_idx].type = WINED3D_SHADER_RESOURCE_TEXTURE_2D; - reg_maps->resource_info[reg_idx].data_type = WINED3D_DATA_FLOAT; + reg_maps->resource_info[reg_idx].data_type = WINED3D_TYPE_FLOAT; shader_record_sample(reg_maps, reg_idx, reg_idx, reg_idx);
/* texbem is only valid with < 1.4 pixel shaders */ @@ -2442,13 +2461,13 @@ static void shader_dump_register(struct wined3d_string_buffer *buffer, case WINED3D_IMMCONST_SCALAR: switch (reg->data_type) { - case WINED3D_DATA_FLOAT: + case WINED3D_TYPE_FLOAT: shader_addline(buffer, "%.8e", *(const float *)reg->u.immconst_data); break; - case WINED3D_DATA_INT: + case WINED3D_TYPE_INT: shader_addline(buffer, "%d", reg->u.immconst_data[0]); break; - case WINED3D_DATA_UINT: + case WINED3D_TYPE_UINT: shader_addline(buffer, "%u", reg->u.immconst_data[0]); break; default: @@ -2460,17 +2479,17 @@ static void shader_dump_register(struct wined3d_string_buffer *buffer, case WINED3D_IMMCONST_VEC4: switch (reg->data_type) { - case WINED3D_DATA_FLOAT: + case WINED3D_TYPE_FLOAT: shader_addline(buffer, "%.8e, %.8e, %.8e, %.8e", *(const float *)®->u.immconst_data[0], *(const float *)®->u.immconst_data[1], *(const float *)®->u.immconst_data[2], *(const float *)®->u.immconst_data[3]); break; - case WINED3D_DATA_INT: + case WINED3D_TYPE_INT: shader_addline(buffer, "%d, %d, %d, %d", reg->u.immconst_data[0], reg->u.immconst_data[1], reg->u.immconst_data[2], reg->u.immconst_data[3]); break; - case WINED3D_DATA_UINT: + case WINED3D_TYPE_UINT: shader_addline(buffer, "%u, %u, %u, %u", reg->u.immconst_data[0], reg->u.immconst_data[1], reg->u.immconst_data[2], reg->u.immconst_data[3]); diff --git a/dlls/wined3d/shader_sm1.c b/dlls/wined3d/shader_sm1.c index 0c6bb933174..b57b67b8dcc 100644 --- a/dlls/wined3d/shader_sm1.c +++ b/dlls/wined3d/shader_sm1.c @@ -468,7 +468,7 @@ static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_ { src->reg.type = ((param & WINED3D_SM1_REGISTER_TYPE_MASK) >> WINED3D_SM1_REGISTER_TYPE_SHIFT) | ((param & WINED3D_SM1_REGISTER_TYPE_MASK2) >> WINED3D_SM1_REGISTER_TYPE_SHIFT2); - src->reg.data_type = WINED3D_DATA_FLOAT; + src->reg.data_type = WINED3D_TYPE_FLOAT; src->reg.idx[0].offset = param & WINED3D_SM1_REGISTER_NUMBER_MASK; src->reg.idx[0].rel_addr = rel_addr; src->reg.idx[1].offset = ~0U; @@ -482,7 +482,7 @@ static void shader_parse_dst_param(DWORD param, const struct wined3d_shader_src_ { dst->reg.type = ((param & WINED3D_SM1_REGISTER_TYPE_MASK) >> WINED3D_SM1_REGISTER_TYPE_SHIFT) | ((param & WINED3D_SM1_REGISTER_TYPE_MASK2) >> WINED3D_SM1_REGISTER_TYPE_SHIFT2); - dst->reg.data_type = WINED3D_DATA_FLOAT; + dst->reg.data_type = WINED3D_TYPE_FLOAT; dst->reg.idx[0].offset = param & WINED3D_SM1_REGISTER_NUMBER_MASK; dst->reg.idx[0].rel_addr = rel_addr; dst->reg.idx[1].offset = ~0U; @@ -645,12 +645,12 @@ static void shader_sm1_read_semantic(const DWORD **ptr, struct wined3d_shader_se { semantic->resource_type = resource_type_table[resource_type]; } - semantic->resource_data_type = WINED3D_DATA_FLOAT; + semantic->resource_data_type = WINED3D_TYPE_FLOAT; shader_parse_dst_param(dst_token, NULL, &semantic->reg); }
static void shader_sm1_read_immconst(const DWORD **ptr, struct wined3d_shader_src_param *src_param, - enum wined3d_immconst_type type, enum wined3d_data_type data_type) + enum wined3d_immconst_type type, enum wined3d_component_type data_type) { unsigned int count = type == WINED3D_IMMCONST_VEC4 ? 4 : 1; src_param->reg.type = WINED3DSPR_IMMCONST; @@ -761,17 +761,17 @@ static void shader_sm1_read_instruction(void *data, const DWORD **ptr, struct wi else if (ins->handler_idx == WINED3DSIH_DEF) { shader_sm1_read_dst_param(priv, &p, &priv->dst_param, &priv->dst_rel_addr); - shader_sm1_read_immconst(&p, &priv->src_param[0], WINED3D_IMMCONST_VEC4, WINED3D_DATA_FLOAT); + shader_sm1_read_immconst(&p, &priv->src_param[0], WINED3D_IMMCONST_VEC4, WINED3D_TYPE_FLOAT); } else if (ins->handler_idx == WINED3DSIH_DEFB) { shader_sm1_read_dst_param(priv, &p, &priv->dst_param, &priv->dst_rel_addr); - shader_sm1_read_immconst(&p, &priv->src_param[0], WINED3D_IMMCONST_SCALAR, WINED3D_DATA_UINT); + shader_sm1_read_immconst(&p, &priv->src_param[0], WINED3D_IMMCONST_SCALAR, WINED3D_TYPE_UINT); } else if (ins->handler_idx == WINED3DSIH_DEFI) { shader_sm1_read_dst_param(priv, &p, &priv->dst_param, &priv->dst_rel_addr); - shader_sm1_read_immconst(&p, &priv->src_param[0], WINED3D_IMMCONST_VEC4, WINED3D_DATA_INT); + shader_sm1_read_immconst(&p, &priv->src_param[0], WINED3D_IMMCONST_VEC4, WINED3D_TYPE_INT); } else { diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index acde7a56d1c..7508dda4e07 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -517,15 +517,15 @@ static const enum wined3d_data_type data_type_table[] = };
static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, - enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param); + enum wined3d_component_type data_type, struct wined3d_shader_src_param *src_param); static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, - enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param); + enum wined3d_component_type data_type, struct wined3d_shader_dst_param *dst_param);
static void shader_sm4_read_conditional_op(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &priv->src_param[0]); + shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &priv->src_param[0]); ins->flags = (opcode_token & WINED3D_SM4_CONDITIONAL_NZ) ? WINED3D_SHADER_CONDITIONAL_OP_NZ : WINED3D_SHADER_CONDITIONAL_OP_Z; } @@ -579,7 +579,7 @@ static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins, ins->declaration.semantic.resource_type = resource_type_table[resource_type]; } uav = opcode != WINED3D_SM4_OP_DCL_RESOURCE; - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.semantic.reg); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &ins->declaration.semantic.reg);
components = *tokens++; if ((components & 0xfff0) != (components & 0xf) * 0x1110) @@ -589,7 +589,7 @@ static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins, if (!data_type || (data_type >= ARRAY_SIZE(data_type_table))) { FIXME("Unhandled data type %#x.\n", data_type); - ins->declaration.semantic.resource_data_type = WINED3D_DATA_FLOAT; + ins->declaration.semantic.resource_data_type = WINED3D_TYPE_FLOAT; } else { @@ -604,7 +604,7 @@ static void shader_sm4_read_dcl_constant_buffer(struct wined3d_shader_instructio DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, &ins->declaration.src); + shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_FLOAT, &ins->declaration.src); if (opcode_token & WINED3D_SM4_INDEX_TYPE_MASK) ins->flags |= WINED3DSI_INDEXED_DYNAMIC; } @@ -616,14 +616,14 @@ static void shader_sm4_read_dcl_sampler(struct wined3d_shader_instruction *ins, ins->flags = (opcode_token & WINED3D_SM4_SAMPLER_MODE_MASK) >> WINED3D_SM4_SAMPLER_MODE_SHIFT; if (ins->flags & ~WINED3D_SM4_SAMPLER_COMPARISON) FIXME("Unhandled sampler mode %#x.\n", ins->flags); - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.dst); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &ins->declaration.dst); }
static void shader_sm4_read_dcl_index_range(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &ins->declaration.index_range.first_register); ins->declaration.index_range.last_register = *tokens; } @@ -680,14 +680,14 @@ static void shader_sm4_read_declaration_dst(struct wined3d_shader_instruction *i DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, &ins->declaration.dst); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_FLOAT, &ins->declaration.dst); }
static void shader_sm4_read_declaration_register_semantic(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_FLOAT, &ins->declaration.register_semantic.reg); ins->declaration.register_semantic.sysval_semantic = *tokens; } @@ -697,7 +697,7 @@ static void shader_sm4_read_dcl_input_ps(struct wined3d_shader_instruction *ins, struct wined3d_sm4_data *priv) { ins->flags = (opcode_token & WINED3D_SM4_INTERPOLATION_MODE_MASK) >> WINED3D_SM4_INTERPOLATION_MODE_SHIFT; - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, &ins->declaration.dst); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_FLOAT, &ins->declaration.dst); }
static void shader_sm4_read_dcl_input_ps_siv(struct wined3d_shader_instruction *ins, @@ -705,7 +705,7 @@ static void shader_sm4_read_dcl_input_ps_siv(struct wined3d_shader_instruction * struct wined3d_sm4_data *priv) { ins->flags = (opcode_token & WINED3D_SM4_INTERPOLATION_MODE_MASK) >> WINED3D_SM4_INTERPOLATION_MODE_SHIFT; - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_FLOAT, &ins->declaration.register_semantic.reg); ins->declaration.register_semantic.sysval_semantic = *tokens; } @@ -731,7 +731,7 @@ static void shader_sm5_read_fcall(struct wined3d_shader_instruction *ins, struct wined3d_sm4_data *priv) { priv->src_param[0].reg.u.fp_body_idx = *tokens++; - shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &priv->src_param[0]); + shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &priv->src_param[0]); }
static void shader_sm5_read_dcl_function_body(struct wined3d_shader_instruction *ins, @@ -812,7 +812,7 @@ static void shader_sm5_read_dcl_uav_raw(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.dst); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &ins->declaration.dst); ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT; }
@@ -820,7 +820,7 @@ static void shader_sm5_read_dcl_uav_structured(struct wined3d_shader_instruction DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &ins->declaration.structured_resource.reg); ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT; ins->declaration.structured_resource.byte_stride = *tokens; @@ -832,7 +832,7 @@ static void shader_sm5_read_dcl_tgsm_raw(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, &ins->declaration.tgsm_raw.reg); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_FLOAT, &ins->declaration.tgsm_raw.reg); ins->declaration.tgsm_raw.byte_count = *tokens; if (ins->declaration.tgsm_raw.byte_count % 4) FIXME("Byte count %u is not multiple of 4.\n", ins->declaration.tgsm_raw.byte_count); @@ -842,7 +842,7 @@ static void shader_sm5_read_dcl_tgsm_structured(struct wined3d_shader_instructio DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_FLOAT, &ins->declaration.tgsm_structured.reg); ins->declaration.tgsm_structured.byte_stride = *tokens++; ins->declaration.tgsm_structured.structure_count = *tokens; @@ -854,7 +854,7 @@ static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instru DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &ins->declaration.structured_resource.reg); ins->declaration.structured_resource.byte_stride = *tokens; if (ins->declaration.structured_resource.byte_stride % 4) @@ -865,7 +865,7 @@ static void shader_sm5_read_dcl_resource_raw(struct wined3d_shader_instruction * DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv) { - shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &ins->declaration.dst); + shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_TYPE_UINT, &ins->declaration.dst); }
static void shader_sm5_read_sync(struct wined3d_shader_instruction *ins, @@ -1196,23 +1196,23 @@ static void map_register(const struct wined3d_sm4_data *priv, struct wined3d_sha } }
-static enum wined3d_data_type map_data_type(char t) +static enum wined3d_component_type map_data_type(char t) { switch (t) { case 'f': - return WINED3D_DATA_FLOAT; + return WINED3D_TYPE_FLOAT; case 'i': - return WINED3D_DATA_INT; + return WINED3D_TYPE_INT; case 'u': case 'O': case 'R': case 'S': case 'U': - return WINED3D_DATA_UINT; + return WINED3D_TYPE_UINT; default: ERR("Invalid data type '%c'.\n", t); - return WINED3D_DATA_FLOAT; + return WINED3D_TYPE_FLOAT; } }
@@ -1376,7 +1376,7 @@ static BOOL shader_sm4_read_reg_idx(struct wined3d_sm4_data *priv, const DWORD * reg_idx->offset = *(*ptr)++; else reg_idx->offset = 0; - shader_sm4_read_src_param(priv, ptr, end, WINED3D_DATA_INT, rel_addr); + shader_sm4_read_src_param(priv, ptr, end, WINED3D_TYPE_INT, rel_addr); } else { @@ -1388,7 +1388,7 @@ static BOOL shader_sm4_read_reg_idx(struct wined3d_sm4_data *priv, const DWORD * }
static BOOL shader_sm4_read_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, - enum wined3d_data_type data_type, struct wined3d_shader_register *param, + enum wined3d_component_type data_type, struct wined3d_shader_register *param, enum wined3d_shader_src_modifier *modifier) { enum wined3d_sm4_register_type register_type; @@ -1520,7 +1520,7 @@ static BOOL shader_sm4_read_param(struct wined3d_sm4_data *priv, const DWORD **p }
static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, - enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param) + enum wined3d_component_type data_type, struct wined3d_shader_src_param *src_param) { DWORD token;
@@ -1571,7 +1571,7 @@ static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD }
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, - enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param) + enum wined3d_component_type data_type, struct wined3d_shader_dst_param *dst_param) { enum wined3d_shader_src_modifier modifier; DWORD token; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b65288dc415..6aa1d497df1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -933,7 +933,7 @@ struct wined3d_shader_version struct wined3d_shader_resource_info { enum wined3d_shader_resource_type type; - enum wined3d_data_type data_type; + enum wined3d_component_type data_type; unsigned int flags; unsigned int stride; }; @@ -1071,7 +1071,7 @@ struct wined3d_shader_register_index struct wined3d_shader_register { enum wined3d_shader_register_type type; - enum wined3d_data_type data_type; + enum wined3d_component_type data_type; struct wined3d_shader_register_index idx[2]; enum wined3d_immconst_type immconst_type; union
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/glsl_shader.c | 128 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 111 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index cd4780a6419..d5dc8be136a 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -3318,12 +3318,12 @@ static void shader_glsl_get_swizzle(const struct wined3d_shader_src_param *param shader_glsl_swizzle_to_str(param->swizzle, fixup, mask, swizzle_str); }
-static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *dst_param, const char *src_param, +static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *buffer, const char *arg, enum wined3d_component_type dst_type, enum wined3d_component_type src_type) { if (dst_type == src_type) { - string_buffer_sprintf(dst_param, "%s", src_param); + string_buffer_sprintf(buffer, "%s", arg); return; }
@@ -3332,10 +3332,10 @@ static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *dst_param, co switch (dst_type) { case WINED3D_TYPE_INT: - string_buffer_sprintf(dst_param, "floatBitsToInt(%s)", src_param); + string_buffer_sprintf(buffer, "floatBitsToInt(%s)", arg); return; case WINED3D_TYPE_UINT: - string_buffer_sprintf(dst_param, "floatBitsToUint(%s)", src_param); + string_buffer_sprintf(buffer, "floatBitsToUint(%s)", arg); return; default: break; @@ -3344,18 +3344,18 @@ static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *dst_param, co
if (src_type == WINED3D_TYPE_UINT && dst_type == WINED3D_TYPE_FLOAT) { - string_buffer_sprintf(dst_param, "uintBitsToFloat(%s)", src_param); + string_buffer_sprintf(buffer, "uintBitsToFloat(%s)", arg); return; }
if (src_type == WINED3D_TYPE_INT && dst_type == WINED3D_TYPE_FLOAT) { - string_buffer_sprintf(dst_param, "intBitsToFloat(%s)", src_param); + string_buffer_sprintf(buffer, "intBitsToFloat(%s)", arg); return; }
FIXME("Unhandled cast from %#x to %#x.\n", src_type, dst_type); - string_buffer_sprintf(dst_param, "%s", src_param); + string_buffer_sprintf(buffer, "%s", arg); }
/* From a given parameter token, generate the corresponding GLSL string. @@ -7616,9 +7616,48 @@ static void shader_glsl_enable_extensions(struct wined3d_string_buffer *buffer, shader_addline(buffer, "#extension GL_EXT_texture_array : enable\n"); }
+static void shader_glsl_generate_color_output(struct wined3d_string_buffer *buffer, + const struct wined3d_gl_info *gl_info, const struct wined3d_shader *shader, + struct wined3d_string_buffer_list *string_buffers) +{ + const struct wined3d_shader_signature *output_signature = &shader->output_signature; + struct wined3d_string_buffer *src, *assignment; + unsigned int i; + + if (output_signature->element_count) + { + src = string_buffer_get(string_buffers); + assignment = string_buffer_get(string_buffers); + for (i = 0; i < output_signature->element_count; ++i) + { + const struct wined3d_shader_signature_element *output = &output_signature->elements[i]; + + /* register_idx is set to ~0u for non-color outputs. */ + if (output->register_idx == ~0u) + continue; + shader_addline(buffer, "color_out%u = ", output->semantic_idx); + string_buffer_sprintf(src, "ps_out[%u]", output->semantic_idx); + shader_glsl_sprintf_cast(assignment, src->buffer, output->component_type, WINED3D_TYPE_FLOAT); + shader_addline(buffer, "%s;\n", assignment->buffer); + } + string_buffer_release(string_buffers, src); + string_buffer_release(string_buffers, assignment); + } + else + { + DWORD mask = shader->reg_maps.rt_mask; + + while (mask) + { + i = wined3d_bit_scan(&mask); + shader_addline(buffer, "color_out%u = ps_out[%u];\n", i, i); + } + } +} + static void shader_glsl_generate_ps_epilogue(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, - const struct ps_compile_args *args) + const struct ps_compile_args *args, struct wined3d_string_buffer_list *string_buffers) { const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
@@ -7637,6 +7676,26 @@ static void shader_glsl_generate_ps_epilogue(const struct wined3d_gl_info *gl_in
if (reg_maps->sample_mask) shader_addline(buffer, "gl_SampleMask[0] = floatBitsToInt(sample_mask);\n"); + + if (!needs_legacy_glsl_syntax(gl_info)) + shader_glsl_generate_color_output(buffer, gl_info, shader, string_buffers); +} + +static const char *shader_glsl_get_ps_output_format(enum wined3d_component_type component_type) +{ + static const char formats[][6] = + { + "", /* WINED3D_TYPE_UNKNOWN */ + "uvec4", /* WINED3D_TYPE_UINT */ + "ivec4", /* WINED3D_TYPE_INT */ + "vec4", /* WINED3D_TYPE_FLOAT */ + }; + if (component_type < WINED3D_TYPE_UNKNOWN || component_type > WINED3D_TYPE_FLOAT) + { + WARN("Unexpected component_type %#x.\n", component_type); + return formats[WINED3D_TYPE_FLOAT]; + } + return formats[component_type]; }
/* Context activation is done by the caller. */ @@ -7819,9 +7878,35 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
if (!needs_legacy_glsl_syntax(gl_info)) { - if (shader_glsl_use_explicit_attrib_location(gl_info)) - shader_addline(buffer, "layout(location = 0) "); - shader_addline(buffer, "out vec4 ps_out[%u];\n", gl_info->limits.buffers); + const struct wined3d_shader_signature *output_signature = &shader->output_signature; + + shader_addline(buffer, "vec4 ps_out[%u];\n", gl_info->limits.buffers); + if (output_signature->element_count) + { + for (i = 0; i < output_signature->element_count; ++i) + { + const struct wined3d_shader_signature_element *output = &output_signature->elements[i]; + + if (output->register_idx == ~0u) + continue; + if (shader_glsl_use_explicit_attrib_location(gl_info)) + shader_addline(buffer, "layout(location = %u) ", output->semantic_idx); + shader_addline(buffer, "out %s color_out%u;\n", + shader_glsl_get_ps_output_format(output->component_type), output->semantic_idx); + } + } + else + { + DWORD mask = reg_maps->rt_mask; + + while (mask) + { + i = wined3d_bit_scan(&mask); + if (shader_glsl_use_explicit_attrib_location(gl_info)) + shader_addline(buffer, "layout(location = %u) ", i); + shader_addline(buffer, "out vec4 color_out%u;\n", i); + } + } }
if (shader->limits->constant_float + extra_constants_needed >= gl_info->limits.glsl_ps_float_constants) @@ -7906,7 +7991,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
/* In SM4+ the shader epilogue is generated by the "ret" instruction. */ if (reg_maps->shader_version.major < 4) - shader_glsl_generate_ps_epilogue(gl_info, buffer, shader, args); + shader_glsl_generate_ps_epilogue(gl_info, buffer, shader, args, string_buffers);
shader_addline(buffer, "}\n");
@@ -8403,7 +8488,7 @@ static void shader_glsl_generate_shader_epilogue(const struct wined3d_shader_con switch (shader->reg_maps.shader_version.type) { case WINED3D_SHADER_TYPE_PIXEL: - shader_glsl_generate_ps_epilogue(gl_info, buffer, shader, priv->cur_ps_args); + shader_glsl_generate_ps_epilogue(gl_info, buffer, shader, priv->cur_ps_args, priv->string_buffers); break; case WINED3D_SHADER_TYPE_VERTEX: shader_glsl_generate_vs_epilogue(gl_info, buffer, shader, priv->cur_vs_args); @@ -9539,9 +9624,10 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
if (!needs_legacy_glsl_syntax(gl_info)) { + shader_addline(buffer, "vec4 ps_out[1];\n"); if (shader_glsl_use_explicit_attrib_location(gl_info)) shader_addline(buffer, "layout(location = 0) "); - shader_addline(buffer, "out vec4 ps_out[1];\n"); + shader_addline(buffer, "out vec4 color_out0;\n"); }
shader_addline(buffer, "vec4 tmp0, tmp1;\n"); @@ -9881,6 +9967,8 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * shader_glsl_generate_fog_code(buffer, gl_info, settings->fog);
shader_glsl_generate_alpha_test(buffer, gl_info, alpha_test_func); + if (!needs_legacy_glsl_syntax(gl_info)) + shader_addline(buffer, "color_out0 = ps_out[0];\n");
shader_addline(buffer, "}\n");
@@ -10422,13 +10510,17 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const } } checkGLcall("glBindAttribLocation"); - string_buffer_release(&priv->string_buffers, tmp_name);
if (!needs_legacy_glsl_syntax(gl_info)) { - GL_EXTCALL(glBindFragDataLocation(program_id, 0, "ps_out")); - checkGLcall("glBindFragDataLocation"); + for (i = 0; i < MAX_RENDER_TARGET_VIEWS; ++i) + { + string_buffer_sprintf(tmp_name, "color_out%u", i); + GL_EXTCALL(glBindFragDataLocation(program_id, i, tmp_name->buffer)); + checkGLcall("glBindFragDataLocation"); + } } + string_buffer_release(&priv->string_buffers, tmp_name); }
if (hshader) @@ -12796,6 +12888,8 @@ static GLuint glsl_blitter_generate_program(struct wined3d_glsl_blitter *blitter shader_glsl_add_version_declaration(buffer, gl_info); shader_addline(buffer, "uniform sampler%s sampler;\n", tex_type); declare_in_varying(gl_info, buffer, FALSE, "vec3 out_texcoord;\n"); + /* TODO: Declare the out variable with the correct type (and put it in the + * blitter args). */ if (!needs_legacy_glsl_syntax(gl_info)) shader_addline(buffer, "out vec4 ps_out[1];\n");
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- They can be triggered by the application and, indeed, some appeared in the tests.
dlls/d3dx10_43/async.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c index 1555a3d11e4..c7d80c9db46 100644 --- a/dlls/d3dx10_43/async.c +++ b/dlls/d3dx10_43/async.c @@ -115,7 +115,7 @@ static HRESULT WINAPI filedataloader_Load(ID3DX10DataLoader *iface) CloseHandle(file); if (!ret) { - ERR("Failed to read file contents.\n"); + WARN("Failed to read file contents.\n"); HeapFree(GetProcessHeap(), 0, data); return E_FAIL; } @@ -175,7 +175,7 @@ static HRESULT WINAPI resourcedataloader_Load(ID3DX10DataLoader *iface) hglobal = LoadResource(loader->u.resource.module, loader->u.resource.rsrc); if (!hglobal) { - ERR("Failed to load resource.\n"); + WARN("Failed to load resource.\n"); return E_FAIL; }
@@ -349,7 +349,7 @@ HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE module, const char *reso
if (!(rsrc = FindResourceA(module, resource, (const char *)RT_RCDATA))) { - ERR("Failed to find resource.\n"); + WARN("Failed to find resource.\n"); HeapFree(GetProcessHeap(), 0, object); return D3DX10_ERR_INVALID_DATA; } @@ -381,7 +381,7 @@ HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE module, const WCHAR *res
if (!(rsrc = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA))) { - ERR("Failed to find resource.\n"); + WARN("Failed to find resource.\n"); HeapFree(GetProcessHeap(), 0, object); return D3DX10_ERR_INVALID_DATA; }