svga: return 1 for PIPE_CAP_VERTEX_COLOR_UNCLAMPED query
authorBrian Paul <brianp@vmware.com>
Wed, 4 Apr 2012 22:04:00 +0000 (16:04 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 6 Apr 2012 20:10:50 +0000 (14:10 -0600)
Before, we weren't clamping the vertex colors produced by ARB vertex
programs.  This could result in some rendering being too bright (in
ETQW, for example).

Also add cases for PIPE_CAP_VERTEX_COLOR_CLAMPED and
PIPE_CAP_FRAGMENT_COLOR_CLAMPED with comments to be complete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/drivers/svga/svga_screen.c

index 8badcb2a595296499f0e3b9c0af0c5956d839cd2..b2f3e33a6f0f70985f157ff06598c39beebed75d 100644 (file)
@@ -203,6 +203,13 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
       return 0;
 
+   case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
+      return 1; /* The color outputs of vertex shaders are not clamped */
+   case PIPE_CAP_VERTEX_COLOR_CLAMPED:
+      return 0; /* The driver can't clamp vertex colors */
+   case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
+      return 0; /* The driver can't clamp fragment colors */
+
    default:
       return 0;
    }