On 14 March 2016 at 00:03, Józef Kucia jkucia@codeweavers.com wrote:
@@ -4100,7 +4110,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi rect = &r; }
- return wined3d_rendertarget_view_clear(view, rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
- if (!(flags & WINED3DCLEAR_TARGET) == !(flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)))
- {
ERR("Color and depth/stencil clears are mutually exclusive.\n");
return WINED3DERR_INVALIDCALL;
- }
You may not need this. The documentation suggests depth/stencil views can only be created on depth formats, and I'd be inclined to believe it. IIRC it doesn't say much about creating rendertarget views on depth/stencil formats, but I wouldn't be all that surprised if that's not allowed either. In that case you'd just need to check the flags against the format capabilities.
+const char *debug_color(const struct wined3d_color *color) +{
- if (!color)
return "(null)";
- return wine_dbg_sprintf("{%.8e, %.8e, %.8e, %.8e}",
color->r, color->g, color->b, color->a);
+}
This is fine, but might as well be a separate change. There are a couple of other places where we trace wined3d_color values as well, the easiest way to find them is probably to look for the format string.
On Mon, Mar 14, 2016 at 1:41 PM, Henri Verbeet hverbeet@gmail.com wrote:
On 14 March 2016 at 00:03, Józef Kucia jkucia@codeweavers.com wrote:
@@ -4100,7 +4110,13 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi rect = &r; }
- return wined3d_rendertarget_view_clear(view, rect, WINED3DCLEAR_TARGET, color, 0.0f, 0);
- if (!(flags & WINED3DCLEAR_TARGET) == !(flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)))
- {
ERR("Color and depth/stencil clears are mutually exclusive.\n");
return WINED3DERR_INVALIDCALL;
- }
You may not need this. The documentation suggests depth/stencil views can only be created on depth formats, and I'd be inclined to believe it. IIRC it doesn't say much about creating rendertarget views on depth/stencil formats, but I wouldn't be all that surprised if that's not allowed either. In that case you'd just need to check the flags against the format capabilities.
I expect this isn't needed. I've added this as a safety check. I guess I'll add some tests for CreateDepthStencilView() and CreateRenderTargetView().