[Mesa-dev] [PATCH] i965: Avoid recompiles for fragment clamping on non-clamping APIs.

Jordan Justen jljusten at gmail.com
Tue Apr 23 21:15:44 PDT 2013


On Tue, Apr 23, 2013 at 5:41 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On 04/19/2013 10:54 AM, Eric Anholt wrote:
>>
>> Removes 75/78 state-dependent recompiles in GLB2.7 (the remaining 3 are
>> due to FBO-rendering size predictions).
>
>
> AFAICT ClampColor is not deprecated in OpenGL Core.  It doesn't exist in ES,
> though.
>
> If you change it to _mesa_is_desktop_gl(ctx), you can have a R-b.

glspec31.20090528, E.1 Profiles and Deprecated Features of OpenGL 3.0:

"Note that the FrontFace and ClampColor commands are not deprecated,
as they still affect other non-deprecated functionality; however, the Clam-
pColor targets CLAMP_VERTEX_COLOR and CLAMP_FRAGMENT_COLOR are
deprecated."

Does that mean Eric's original change is okay?

-Jordan

>> ---
>>   src/mesa/drivers/dri/i965/brw_fs.cpp |    2 +-
>>   src/mesa/drivers/dri/i965/brw_vs.c   |    2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp
>> b/src/mesa/drivers/dri/i965/brw_fs.cpp
>> index 5f659b1..66e78d0 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
>> @@ -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)) {
>> diff --git a/src/mesa/drivers/dri/i965/brw_vs.c
>> b/src/mesa/drivers/dri/i965/brw_vs.c
>> index 998edb0..6eb916e 100644
>> --- a/src/mesa/drivers/dri/i965/brw_vs.c
>> +++ b/src/mesa/drivers/dri/i965/brw_vs.c
>> @@ -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)) {
>>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list