i965: Avoid recompiles for fragment clamping on non-clamping APIs. 08/6208/1
authorEric Anholt <eric@anholt.net>
Mon, 15 Apr 2013 23:44:55 +0000 (16:44 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 25 Apr 2013 19:03:00 +0000 (12:03 -0700)
Removes 75/78 state-dependent recompiles in GLB2.7 (the remaining 3 are
due to FBO-rendering size predictions).  We currently expose
GL_ARB_color_buffer_float on GL core, so we may mis-predict there, but I'm
about to send a patch for removing that silly extension in that case.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_vs.c

index 5f659b1..66e78d0 100644 (file)
@@ -3153,7 +3153,7 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
       }
    }
 
-   key.clamp_fragment_color = true;
+   key.clamp_fragment_color = ctx->API == API_OPENGL_COMPAT;
 
    for (int i = 0; i < MAX_SAMPLERS; i++) {
       if (fp->Base.ShadowSamplers & (1 << i)) {
index 998edb0..6eb916e 100644 (file)
@@ -564,7 +564,7 @@ brw_vs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
    memset(&key, 0, sizeof(key));
 
    key.base.program_string_id = bvp->id;
-   key.base.clamp_vertex_color = true;
+   key.base.clamp_vertex_color = ctx->API == API_OPENGL_COMPAT;
 
    for (int i = 0; i < MAX_SAMPLERS; i++) {
       if (vp->Base.ShadowSamplers & (1 << i)) {