[PATCH 2/3] wined3d: Check for UAV support in wined3d_check_device_format.

Zebediah Figura z.figura12 at gmail.com
Tue Sep 29 16:06:17 CDT 2020


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 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 f51aae95507..e7b4bebc703 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1614,7 +1614,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;
@@ -1629,7 +1630,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;
 
@@ -1638,7 +1640,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))
@@ -1679,7 +1682,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;
 
@@ -1709,6 +1713,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)
@@ -1750,6 +1756,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",
-- 
2.28.0




More information about the wine-devel mailing list