[Mesa-dev] [PATCH 6/9] i965/fs: Use the LRP instruction for ir_triop_lrp when possible.

Kenneth Graunke kenneth at whitecape.org
Thu Feb 28 14:00:33 PST 2013


On 02/28/2013 11:20 AM, Matt Turner wrote:
> On Tue, Feb 26, 2013 at 9:51 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>>> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp
>>> b/src/mesa/drivers/dri/i965/brw_shader.cpp
>>> index 9ab18cc..6965d72 100644
>>> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
>>> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
>>> @@ -156,7 +156,7 @@ brw_link_shader(struct gl_context *ctx, struct
>>> gl_shader_program *shProg)
>>>                           SUB_TO_ADD_NEG |
>>>                           EXP_TO_EXP2 |
>>>                           LOG_TO_LOG2 |
>>> -                        LRP_TO_ARITH);
>>> +                        (stage == MESA_SHADER_FRAGMENT ? 0 :
>>> LRP_TO_ARITH));
>>
>>
>> Doesn't this need to include a gen check as well?  Perhaps:
>
> Not really, since emit_lrp() has a gen check (and has to have it,
> since emit_lrp() will be used for fragment program's OPCODE_LRP). For
> GLSL, do we gain anything by lowering LRP on gen < 6 in the compiler
> vs the backend, or vice versa?

Oh yeah, I didn't realize you made emit_lrp() handle both the LRP 
instruction and the raw math.  So you're okay as is.



More information about the mesa-dev mailing list