Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Flip around the WINED3D_RTYPE_BUFFER check.
dlls/wined3d/resource.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index f37c313e023..6215da8ce0f 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -121,26 +121,26 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * if (base_type == WINED3D_GL_RES_TYPE_COUNT) base_type = gl_type;
- if (type != WINED3D_RTYPE_BUFFER) + if (type == WINED3D_RTYPE_BUFFER) + break; + + if ((bind_flags & WINED3D_BIND_RENDER_TARGET) + && !(format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET)) { - if ((bind_flags & WINED3D_BIND_RENDER_TARGET) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET)) - { - WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id)); - continue; - } - if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_DEPTH_STENCIL)) - { - WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id)); - continue; - } - if ((bind_flags & WINED3D_BIND_SHADER_RESOURCE) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE)) - { - WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); - continue; - } + WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id)); + continue; + } + if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL) + && !(format->flags[gl_type] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + { + WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id)); + continue; + } + if ((bind_flags & WINED3D_BIND_SHADER_RESOURCE) + && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE)) + { + WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); + continue; } if (((width & (width - 1)) || (height & (height - 1))) && !d3d_info->texture_npot
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/context_gl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 224c46efb6f..da7c70a8863 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -3944,11 +3944,12 @@ static BOOL context_apply_draw_state(struct wined3d_context *context, unsigned int state_id = base + wined3d_bit_scan(&dirty_mask);
state_table[state_id].apply(context, state, state_id); - context->dirty_graphics_states[i] &= ~(1u << (state_id - base)); } base += sizeof(dirty_mask) * CHAR_BIT; }
+ memset(context->dirty_graphics_states, 0, sizeof(context->dirty_graphics_states)); + if (context->shader_update_mask & ~(1u << WINED3D_SHADER_TYPE_COMPUTE)) { device->shader_backend->shader_select(device->shader_priv, context, state);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
That's apparently the case on Vista (and Wine when compiled without jxrlib).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51305 Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3dx10_43/tests/d3dx10.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 30d766bf244..f00c6fe0484 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1887,7 +1887,8 @@ static void test_get_image_info(void) winetest_push_context("Test %u", i);
hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#x.\n", hr); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
@@ -1909,12 +1910,14 @@ static void test_get_image_info(void) create_file(test_filename, test_image[i].data, test_image[i].size, path);
hr = D3DX10GetImageInfoFromFileW(path, NULL, &image_info, NULL); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#x.\n", hr); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
hr = D3DX10GetImageInfoFromFileA(get_str_a(path), NULL, &image_info, NULL); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#x.\n", hr); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
@@ -1940,12 +1943,14 @@ static void test_get_image_info(void) resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size);
hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, NULL); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#x.\n", hr); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, NULL); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#x.\n", hr); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
@@ -2000,7 +2005,8 @@ static void test_create_texture(void)
hr = D3DX10CreateTextureFromMemory(device, test_image[i].data, test_image[i].size, NULL, NULL, &resource, NULL); todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE) - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + "Got unexpected hr %#x.\n", hr); if (hr == S_OK) { check_resource_info(resource, test_image + i, __LINE__);
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51305 Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3dx10_43/tests/d3dx10.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index f00c6fe0484..9a4de2e5ad1 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1943,13 +1943,15 @@ static void test_get_image_info(void) resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size);
hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, NULL); - ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP) + || broken(hr == D3DX10_ERR_INVALID_DATA) /* Vista */, "Got unexpected hr %#x.\n", hr); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, NULL); - ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP), + ok(hr == S_OK || (hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP) + || broken(hr == D3DX10_ERR_INVALID_DATA) /* Vista */, "Got unexpected hr %#x.\n", hr); if (hr == S_OK) check_image_info(&image_info, test_image + i, __LINE__);
Only the first two components are explicitly set from the vertex attribute data.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51304 Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 87f63023c58..03ded640e8f 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -1001,9 +1001,11 @@ static void test_struct_semantics(void) 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), "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), "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);