nine: check hardware support before using vertex texture
authorPavel Ondračka <pavel.ondracka@gmail.com>
Mon, 11 Apr 2022 19:03:25 +0000 (21:03 +0200)
committerPavel Ondračka <pavel.ondracka@gmail.com>
Tue, 12 Apr 2022 05:38:47 +0000 (07:38 +0200)
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15864>

src/gallium/frontends/nine/adapter9.c

index 2097cc1c7519ee101fa497d32970e4fb1df20c45..9853ba76ab5d176d24aa58ab9d7070eaf7fbea9a 100644 (file)
@@ -339,6 +339,10 @@ NineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This,
         bind |= d3d9_get_pipe_depth_format_bindings(CheckFormat);
     }
 
+    if ((Usage & D3DUSAGE_QUERY_VERTEXTEXTURE) &&
+        !screen->get_shader_param(screen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS))
+        return D3DERR_NOTAVAILABLE;
+
     /* API hack because setting RT[0] to NULL is forbidden */
     if (CheckFormat == D3DFMT_NULL && bind == PIPE_BIND_RENDER_TARGET &&
         (RType == D3DRTYPE_SURFACE ||