gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 10 Jan 2012 13:37:33 +0000 (14:37 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 12 Jan 2012 10:20:16 +0000 (11:20 +0100)
Some hardware versions rely on it to render correctly.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
src/gallium/drivers/svga/svga_resource_texture.c

index d3748420c0af690cc0509f30a9802b9158758b14..92286f90fb78012b5f2dbe417b0da87ca8c1b851 100644 (file)
@@ -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;