Mesa (8.0): gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device

Thomas Hellstrom thomash at kemper.freedesktop.org
Thu Jan 12 10:28:34 UTC 2012


Module: Mesa
Branch: 8.0
Commit: 7465c5d9761762134db86505a637676cc79e622f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7465c5d9761762134db86505a637676cc79e622f

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Tue Jan 10 14:37:33 2012 +0100

gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device

Some hardware versions rely on it to render correctly.

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: José Fonseca <jfonseca at vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob at vmware.com>

---

 src/gallium/drivers/svga/svga_resource_texture.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index d374842..92286f9 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -454,16 +454,19 @@ svga_texture_create(struct pipe_screen *screen,
    }
 
    /* 
-    * XXX: Never pass the SVGA3D_SURFACE_HINT_RENDERTARGET hint. Mesa cannot
+    * Note: Previously we never passed the
+    * SVGA3D_SURFACE_HINT_RENDERTARGET hint. Mesa cannot
     * know beforehand whether a texture will be used as a rendertarget or not
     * and it always requests PIPE_BIND_RENDER_TARGET, therefore
     * passing the SVGA3D_SURFACE_HINT_RENDERTARGET here defeats its purpose.
+    *
+    * However, this was changed since other state trackers
+    * (XA for example) uses it accurately and certain device versions
+    * relies on it in certain situations to render correctly.
     */
-#if 0
    if((template->bind & PIPE_BIND_RENDER_TARGET) &&
       !util_format_is_s3tc(template->format))
       tex->key.flags |= SVGA3D_SURFACE_HINT_RENDERTARGET;
-#endif
    
    if(template->bind & PIPE_BIND_DEPTH_STENCIL)
       tex->key.flags |= SVGA3D_SURFACE_HINT_DEPTHSTENCIL;




More information about the mesa-commit mailing list