st/mesa: do vertex and fragment color clamping in shaders

For ARB_color_buffer_float. Most hardware can't do it and st/mesa is
the perfect place for a fallback.
The exceptions are:
- r500 (vertex clamp only)
- nv50 (both)
- nvc0 (both)
- softpipe (both)

We also have to take into account that r300 can do CLAMPED vertex colors only,
while r600 can do UNCLAMPED vertex colors only. The difference can be expressed
with the two new CAPs.
This commit is contained in:
Marek Olšák
2012-01-23 03:11:17 +01:00
parent c2e2b58a58
commit bc1c836938
22 changed files with 147 additions and 56 deletions

View File

@@ -55,6 +55,9 @@ struct st_fp_variant_key
GLuint pixelMaps:1; /**< glDrawPixels w/ pixel lookup map? */
GLuint drawpixels_z:1; /**< glDrawPixels(GL_DEPTH) */
GLuint drawpixels_stencil:1; /**< glDrawPixels(GL_STENCIL) */
/** for ARB_color_buffer_float */
GLuint clamp_color:1;
};
@@ -98,6 +101,9 @@ struct st_vp_variant_key
{
struct st_context *st; /**< variants are per-context */
boolean passthrough_edgeflags;
/** for ARB_color_buffer_float */
boolean clamp_color;
};