Commit 769e2be5 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Reject blits between depth/stencil and colour resources in the raw blitter.

parent dfb6c307
...@@ -16217,8 +16217,9 @@ static void test_format_compatibility(void) ...@@ -16217,8 +16217,9 @@ static void test_format_compatibility(void)
colour = get_readback_color(&rb, x, y); colour = get_readback_color(&rb, x, y);
expected = test_data[i].success && x >= texel_dwords && y expected = test_data[i].success && x >= texel_dwords && y
? bitmap_data[j - (4 + texel_dwords)] : initial_data[j]; ? bitmap_data[j - (4 + texel_dwords)] : initial_data[j];
ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n", todo_wine_if(test_data[i].dst_ds && colour)
i, colour, x, y, expected); ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n",
i, colour, x, y, expected);
} }
release_resource_readback(&rb); release_resource_readback(&rb);
...@@ -16231,7 +16232,7 @@ static void test_format_compatibility(void) ...@@ -16231,7 +16232,7 @@ static void test_format_compatibility(void)
y = j / 4; y = j / 4;
colour = get_readback_color(&rb, x, y); colour = get_readback_color(&rb, x, y);
expected = test_data[i].success ? bitmap_data[j] : initial_data[j]; expected = test_data[i].success ? bitmap_data[j] : initial_data[j];
todo_wine_if(test_data[i].src_ds) todo_wine_if(test_data[i].dst_ds || test_data[i].src_format == DXGI_FORMAT_R16_TYPELESS)
ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n", ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n",
i, colour, x, y, expected); i, colour, x, y, expected);
} }
......
...@@ -28306,7 +28306,7 @@ static void test_format_compatibility(void) ...@@ -28306,7 +28306,7 @@ static void test_format_compatibility(void)
y = j / 4; y = j / 4;
colour = get_readback_color(&rb, x, y, 0); colour = get_readback_color(&rb, x, y, 0);
expected = test_data[i].success ? bitmap_data[j] : initial_data[j]; expected = test_data[i].success ? bitmap_data[j] : initial_data[j];
todo_wine_if(test_data[i].src_ds || test_data[i].dst_ds) todo_wine_if(!test_data[i].dst_ds && test_data[i].src_format == DXGI_FORMAT_R16_TYPELESS)
ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n", ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n",
i, colour, x, y, expected); i, colour, x, y, expected);
} }
...@@ -6082,12 +6082,19 @@ static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit ...@@ -6082,12 +6082,19 @@ static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
unsigned int src_level, src_layer, dst_level, dst_layer; unsigned int src_level, src_layer, dst_level, dst_layer;
struct wined3d_blitter *next; struct wined3d_blitter *next;
GLuint src_name, dst_name; GLuint src_name, dst_name;
bool src_ds, dst_ds;
DWORD location; DWORD location;
src_ds = src_texture->resource.format->depth_size || src_texture->resource.format->stencil_size;
dst_ds = dst_texture->resource.format->depth_size || dst_texture->resource.format->stencil_size;
/* If we would need to copy from a renderbuffer or drawable, we'd probably /* If we would need to copy from a renderbuffer or drawable, we'd probably
* be better off using the FBO blitter directly, since we'd need to use it * be better off using the FBO blitter directly, since we'd need to use it
* to copy the resource contents to the texture anyway. */ * to copy the resource contents to the texture anyway.
if (op != WINED3D_BLIT_OP_RAW_BLIT *
* We also can't copy between depth/stencil and colour resources, since
* the formats are considered incompatible in OpenGL. */
if (op != WINED3D_BLIT_OP_RAW_BLIT || (src_ds != dst_ds)
|| (src_texture->resource.format->id == dst_texture->resource.format->id || (src_texture->resource.format->id == dst_texture->resource.format->id
&& (!(src_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) && (!(src_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|| !(dst_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))))) || !(dst_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)))))
......
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