nv30: disable rendering to 3D textures
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 1 Jan 2019 20:06:34 +0000 (15:06 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 1 Jan 2019 20:11:14 +0000 (15:11 -0500)
There's no way to tell the 3D engine about swizzling on such textures.
While rendering to NPOT ones may be possible, there's no great way to
expose that in gallium, nor would there be any practical benefit.

Fixes the non-compressed-format "copyteximage 3D" failures. Something
odd going on with the compressed formats.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv30/nv30_screen.c

index d7563f4a60e1c0989bc3769529811983f4ac4ad1..2b69a8f696824aeaa8d30ea13a50e31d084eb2ce 100644 (file)
@@ -435,6 +435,12 @@ nv30_screen_is_format_supported(struct pipe_screen *pscreen,
    if (MAX2(1, sample_count) != MAX2(1, storage_sample_count))
       return false;
 
+   /* No way to render to a swizzled 3d texture. We don't necessarily know if
+    * it's swizzled or not here, but we have to assume anyways.
+    */
+   if (target == PIPE_TEXTURE_3D && (bindings & PIPE_BIND_RENDER_TARGET))
+      return false;
+
    /* shared is always supported */
    bindings &= ~PIPE_BIND_SHARED;