Mesa (master): svga: use untyped surface formats in most cases

Brian Paul brianp at kemper.freedesktop.org
Thu Jun 30 20:33:19 UTC 2016


Module: Mesa
Branch: master
Commit: eb0ced74f6decd1bf1e111b162e1389bede89af6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb0ced74f6decd1bf1e111b162e1389bede89af6

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Jun 22 20:42:37 2016 -0600

svga: use untyped surface formats in most cases

This allows us to do copies between different, but compatible, surface
formats such as RGBA8_UNORM, RGBA8_SINT, RGBA8_UINT, etc. for
GL_ARB_copy_image.

Acked-by: Roland Scheidegger <sroland at vmware.com>
Reviewed-by: Charmaine Lee <charmainel at vmware.com>

---

 src/gallium/drivers/svga/svga_resource_texture.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index 0e21f5e..3f91c86 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -945,14 +945,17 @@ svga_texture_create(struct pipe_screen *screen,
       goto fail;
    }
 
-   /* Use typeless formats for sRGB and depth resources.  Typeless
+   /* The actual allocation is done with a typeless format.  Typeless
     * formats can be reinterpreted as other formats.  For example,
     * SVGA3D_R8G8B8A8_UNORM_TYPELESS can be interpreted as
     * SVGA3D_R8G8B8A8_UNORM_SRGB or SVGA3D_R8G8B8A8_UNORM.
+    * Do not use typeless formats for SHARED, DISPLAY_TARGET or SCANOUT
+    * buffers.
     */
-   if (svgascreen->sws->have_vgpu10 &&
-       (util_format_is_srgb(template->format) ||
-        format_has_depth(template->format))) {
+   if (svgascreen->sws->have_vgpu10
+       && ((bindings & (PIPE_BIND_SHARED |
+                        PIPE_BIND_DISPLAY_TARGET |
+                        PIPE_BIND_SCANOUT)) == 0)) {
       SVGA3dSurfaceFormat typeless = svga_typeless_format(tex->key.format);
       if (0) {
          debug_printf("Convert resource type %s -> %s (bind 0x%x)\n",




More information about the mesa-commit mailing list