Zebediah Figura : wined3d: Check for UAV support in wined3d_check_device_format.
Alexandre Julliard
julliard at winehq.org
Wed Sep 30 14:35:30 CDT 2020
Module: wine
Branch: master
Commit: 76653835532efb68ce1ce0d3eb34367e0c770262
URL: https://source.winehq.org/git/wine.git/?a=commit;h=76653835532efb68ce1ce0d3eb34367e0c770262
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Tue Sep 29 16:06:17 2020 -0500
wined3d: Check for UAV support in wined3d_check_device_format.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/directx.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 386d84e54e..0fa05a06be 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",
More information about the wine-cvs
mailing list