virgl: stricter usage of compressed 3d textures
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 28 Mar 2019 18:03:47 +0000 (19:03 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 2 Apr 2019 07:48:46 +0000 (07:48 +0000)
Using RGTC, ETC1, ETC2 or S3TC for 3D-textures isn't alowed by any of
OpenGL 4.6, OpenGL ES 3.2, ARB_texture_compression_rgtc,
EXT_texture_compression_rgtc, OES_compressed_ETC1_RGB8_texture,
S3_s3tc or EXT_texture_compression_s3tc specifications.

So let's not allow any of those compressed 3d-textures at all. It's not
going to work once it hits the OpenGL driver in virglrenderer.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/virgl_screen.c

index e2b2712d942527cc709f6052c83b9c6373c4d2f2..651b73b0eb0b4e19e213cc0f0b685c5b9a5df46d 100644 (file)
@@ -625,6 +625,12 @@ virgl_is_format_supported( struct pipe_screen *screen,
        target != PIPE_BUFFER)
       return FALSE;
 
+   if ((format_desc->layout == UTIL_FORMAT_LAYOUT_RGTC ||
+        format_desc->layout == UTIL_FORMAT_LAYOUT_ETC ||
+        format_desc->layout == UTIL_FORMAT_LAYOUT_S3TC) &&
+       target == PIPE_TEXTURE_3D)
+      return FALSE;
+
    if (bind & PIPE_BIND_RENDER_TARGET) {
       /* For ARB_framebuffer_no_attachments. */
       if (format == PIPE_FORMAT_NONE)