diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 386d84e54ef..0fa05a06be6 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1618,7 +1618,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, case WINED3D_RTYPE_NONE: allowed_usage = 0; allowed_bind_flags = WINED3D_BIND_RENDER_TARGET - | WINED3D_BIND_DEPTH_STENCIL; + | WINED3D_BIND_DEPTH_STENCIL + | WINED3D_BIND_UNORDERED_ACCESS; gl_type = WINED3D_GL_RES_TYPE_TEX_2D; gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D; break; @@ -1633,7 +1634,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, | WINED3DUSAGE_QUERY_SRGBWRITE | WINED3DUSAGE_QUERY_VERTEXTEXTURE | WINED3DUSAGE_QUERY_WRAPANDMIP; - allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE; + allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE + | WINED3D_BIND_UNORDERED_ACCESS; gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_1D; break; @@ -1642,7 +1644,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, if (bind_flags & WINED3D_BIND_RENDER_TARGET) allowed_usage |= WINED3DUSAGE_QUERY_SRGBWRITE; allowed_bind_flags = WINED3D_BIND_RENDER_TARGET - | WINED3D_BIND_DEPTH_STENCIL; + | WINED3D_BIND_DEPTH_STENCIL + | WINED3D_BIND_UNORDERED_ACCESS; if (!(bind_flags & WINED3D_BIND_SHADER_RESOURCE)) { if (!wined3d_check_surface_format(format)) @@ -1683,7 +1686,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, | WINED3DUSAGE_QUERY_SRGBWRITE | WINED3DUSAGE_QUERY_VERTEXTEXTURE | WINED3DUSAGE_QUERY_WRAPANDMIP; - allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE; + allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE + | WINED3D_BIND_UNORDERED_ACCESS; gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D; break; @@ -1713,6 +1717,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, format_flags |= WINED3DFMT_FLAG_RENDERTARGET; if (bind_flags & WINED3D_BIND_DEPTH_STENCIL) format_flags |= WINED3DFMT_FLAG_DEPTH_STENCIL; + if (bind_flags & WINED3D_BIND_UNORDERED_ACCESS) + format_flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; if (usage & WINED3DUSAGE_QUERY_FILTER) format_flags |= WINED3DFMT_FLAG_FILTERING; if (usage & WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING) @@ -1754,6 +1760,13 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, return WINED3DERR_NOTAVAILABLE; } + if ((bind_flags & WINED3D_BIND_UNORDERED_ACCESS) && wined3d_format_is_typeless(format)) + { + TRACE("Requested WINED3D_BIND_UNORDERED_ACCESS, but format %s is typeless.\n", + debug_d3dformat(check_format_id)); + return WINED3DERR_NOTAVAILABLE; + } + if ((format->flags[gl_type] & format_flags) != format_flags) { TRACE("Requested format flags %#x, but format %s only has %#x.\n",