[Mesa-dev] [PATCH 3/4] radeonsi: Rearrange si_create_dsa_state

Alex Deucher alexdeucher at gmail.com
Tue Dec 3 15:04:16 PST 2013


On Tue, Dec 3, 2013 at 5:59 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Tue, Dec 3, 2013 at 2:56 PM, Alex Deucher <alexdeucher at gmail.com> wrote:
>> On Tue, Dec 3, 2013 at 3:33 PM, Andreas Hartmetz <ahartmetz at gmail.com> wrote:
>>> Reduce scope of variables and divide the code more clearly into
>>> sections dealing with one thing.
>>> ---
>>>  src/gallium/drivers/radeonsi/si_state.c | 38 +++++++++++++++++++--------------
>>>  1 file changed, 22 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
>>> index 7bae72a..24c9cf3 100644
>>> --- a/src/gallium/drivers/radeonsi/si_state.c
>>> +++ b/src/gallium/drivers/radeonsi/si_state.c
>>> @@ -706,25 +706,20 @@ static void *si_create_dsa_state(struct pipe_context *ctx,
>>>                                  const struct pipe_depth_stencil_alpha_state *state)
>>>  {
>>>         struct si_state_dsa *dsa = CALLOC_STRUCT(si_state_dsa);
>>> -       struct si_pm4_state *pm4 = &dsa->pm4;
>>> -       unsigned db_depth_control;
>>> -       unsigned db_render_override, db_render_control;
>>> -       uint32_t db_stencil_control = 0;
>>> -
>>
>> Please don't mix code and declarations, some compilers don't like that.
>
> We avoid that in core Mesa because of MSVC, but I don't think radeonsi
> will ever be compiled with MSVC?

It might be, plus there may be other compilers that don't like it.
Additionally, none of the other functions in radeonsi do it so it's a
departure from the overall coding style of the driver.

Alex


More information about the mesa-dev mailing list