[Mesa-dev] [PATCH 05/53] r600: use a macro to remove common shader selection code.

Dave Airlie airlied at gmail.com
Mon Nov 30 18:48:42 PST 2015


On 30 November 2015 at 22:20, Oded Gabbay <oded.gabbay at gmail.com> wrote:
> On Mon, Nov 30, 2015 at 8:20 AM, Dave Airlie <airlied at gmail.com> wrote:
>> From: Dave Airlie <airlied at redhat.com>
>>
>> This function is going to get a lot messier with tessellation
>> so I'm going to use some macros to try and clean some bits
>> of common code up.
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>>  src/gallium/drivers/r600/r600_state_common.c | 21 +++++++++------------
>>  1 file changed, 9 insertions(+), 12 deletions(-)
>>
>> diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
>> index b544abb..b6d739d 100644
>> --- a/src/gallium/drivers/r600/r600_state_common.c
>> +++ b/src/gallium/drivers/r600/r600_state_common.c
>> @@ -1288,6 +1288,11 @@ static void r600_update_clip_state(struct r600_context *rctx,
>>                                 r600_mark_atom_dirty(rctx, &rctx->clip_misc_state.atom);
>>         }
>>  }
>> +#define SELECT_SHADER_OR_FAIL(x) do {                                  \
>> +               r600_shader_select(ctx, rctx->x##_shader, &x##_dirty);  \
>> +               if (unlikely(!rctx->x##_shader))                        \
>
> Isn't the above statement missing the "->current" reference ?

Good catch.
Dave.


More information about the mesa-dev mailing list