wined3d: Ignore the blitter's depth/colour fill return value in wined3d_device_clear_rendertarget_view().
Direct3D 10 and later don't have a return value, earlier versions seem to claim success even if the fill/clear is unsupported. Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cc25929d3a
commit
49f2a1ab2f
|
@ -1310,8 +1310,7 @@ static void color_fill_test(void)
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
CHECK_FILL_VALUE = 0x1,
|
CHECK_FILL_VALUE = 0x1,
|
||||||
TODO_FILL_RETURN = 0x2,
|
BLOCKS = 0x2,
|
||||||
BLOCKS = 0x4,
|
|
||||||
} flags;
|
} flags;
|
||||||
DWORD fill_value;
|
DWORD fill_value;
|
||||||
}
|
}
|
||||||
|
@ -1337,7 +1336,7 @@ static void color_fill_test(void)
|
||||||
* result on Wine.
|
* result on Wine.
|
||||||
* {D3DFMT_YUY2, "D3DFMT_YUY2", BLOCKS, 0},
|
* {D3DFMT_YUY2, "D3DFMT_YUY2", BLOCKS, 0},
|
||||||
* {D3DFMT_UYVY, "D3DFMT_UYVY", BLOCKS, 0}, */
|
* {D3DFMT_UYVY, "D3DFMT_UYVY", BLOCKS, 0}, */
|
||||||
{D3DFMT_DXT1, "D3DFMT_DXT1", BLOCKS | TODO_FILL_RETURN, 0},
|
{D3DFMT_DXT1, "D3DFMT_DXT1", BLOCKS, 0x00000000},
|
||||||
/* Vendor-specific formats like ATI2N are a non-issue here since they're not
|
/* Vendor-specific formats like ATI2N are a non-issue here since they're not
|
||||||
* supported as offscreen plain surfaces and do not support D3DUSAGE_RENDERTARGET
|
* supported as offscreen plain surfaces and do not support D3DUSAGE_RENDERTARGET
|
||||||
* when created as texture. */
|
* when created as texture. */
|
||||||
|
@ -1447,18 +1446,16 @@ static void color_fill_test(void)
|
||||||
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, fmt=%s.\n", hr, formats[i].name);
|
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, fmt=%s.\n", hr, formats[i].name);
|
||||||
|
|
||||||
hr = IDirect3DDevice9_ColorFill(device, surface, NULL, 0xdeadbeef);
|
hr = IDirect3DDevice9_ColorFill(device, surface, NULL, 0xdeadbeef);
|
||||||
todo_wine_if (formats[i].flags & TODO_FILL_RETURN)
|
|
||||||
ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
|
ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
|
||||||
|
|
||||||
hr = IDirect3DDevice9_ColorFill(device, surface, &rect, 0xdeadbeef);
|
hr = IDirect3DDevice9_ColorFill(device, surface, &rect, 0xdeadbeef);
|
||||||
todo_wine_if (formats[i].flags & TODO_FILL_RETURN)
|
|
||||||
ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
|
ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
hr = IDirect3DDevice9_ColorFill(device, surface, &rect2, 0xdeadbeef);
|
hr = IDirect3DDevice9_ColorFill(device, surface, &rect2, 0xdeadbeef);
|
||||||
if (formats[i].flags & BLOCKS)
|
if (formats[i].flags & BLOCKS)
|
||||||
todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x, fmt=%s.\n", hr, formats[i].name);
|
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x, fmt=%s.\n", hr, formats[i].name);
|
||||||
else
|
else
|
||||||
ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
|
ok(SUCCEEDED(hr), "Failed to color fill, hr %#x, fmt=%s.\n", hr, formats[i].name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4197,9 +4197,11 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blit_op == WINED3D_BLIT_OP_COLOR_FILL)
|
if (blit_op == WINED3D_BLIT_OP_COLOR_FILL)
|
||||||
return blitter->color_fill(device, view, rect, color);
|
blitter->color_fill(device, view, rect, color);
|
||||||
else
|
else
|
||||||
return blitter->depth_fill(device, view, rect, flags, depth, stencil);
|
blitter->depth_fill(device, view, rect, flags, depth, stencil);
|
||||||
|
|
||||||
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
|
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
|
||||||
|
|
Loading…
Reference in New Issue