[Mesa-dev] [PATCH 19/20] gallium/radeon: set VPORT_ZMIN/MAX registers correctly

Marek Olšák maraeo at gmail.com
Tue Aug 30 07:06:16 UTC 2016


On Mon, Aug 29, 2016 at 10:33 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> On Mon, Aug 29, 2016 at 5:28 PM, Marek Olšák <maraeo at gmail.com> wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> Calculate depth ranges from viewport states and
>> pipe_rasterizer_state::clip_halfz.
>>
>> The evergreend.h change is required to silence a warning.
>>
>> This fixes this recently updated piglit: arb_depth_clamp/depth-clamp-range
>> ---
>>  src/gallium/drivers/r600/evergreen_state.c    |  1 +
>>  src/gallium/drivers/r600/evergreend.h         |  4 +-
>>  src/gallium/drivers/r600/r600_hw_context.c    |  1 +
>>  src/gallium/drivers/r600/r600_pipe.h          |  1 +
>>  src/gallium/drivers/r600/r600_state.c         |  1 +
>>  src/gallium/drivers/r600/r600_state_common.c  |  2 +-
>>  src/gallium/drivers/radeon/r600_pipe_common.h |  5 +-
>>  src/gallium/drivers/radeon/r600_viewport.c    | 73 ++++++++++++++++++++++++---
>>  src/gallium/drivers/radeon/r600d_common.h     |  2 +
>>  src/gallium/drivers/radeonsi/si_hw_context.c  |  1 +
>>  src/gallium/drivers/radeonsi/si_state.c       |  3 +-
>>  src/gallium/drivers/radeonsi/si_state.h       |  1 +
>>  12 files changed, 82 insertions(+), 13 deletions(-)
>>
>> diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
>> index 11c8161..5ca5453 100644
>> --- a/src/gallium/drivers/r600/evergreen_state.c
>> +++ b/src/gallium/drivers/r600/evergreen_state.c
>> @@ -466,20 +466,21 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
>>         float psize_min, psize_max;
>>         struct r600_rasterizer_state *rs = CALLOC_STRUCT(r600_rasterizer_state);
>>
>>         if (!rs) {
>>                 return NULL;
>>         }
>>
>>         r600_init_command_buffer(&rs->buffer, 30);
>>
>>         rs->scissor_enable = state->scissor;
>> +       rs->clip_halfz = state->clip_halfz;
>>         rs->flatshade = state->flatshade;
>>         rs->sprite_coord_enable = state->sprite_coord_enable;
>>         rs->two_side = state->light_twoside;
>>         rs->clip_plane_enable = state->clip_plane_enable;
>>         rs->pa_sc_line_stipple = state->line_stipple_enable ?
>>                                 S_028A0C_LINE_PATTERN(state->line_stipple_pattern) |
>>                                 S_028A0C_REPEAT_COUNT(state->line_stipple_factor) : 0;
>>         rs->pa_cl_clip_cntl =
>>                 S_028810_DX_CLIP_SPACE_DEF(state->clip_halfz) |
>>                 S_028810_ZCLIP_NEAR_DISABLE(!state->depth_clip) |
>> diff --git a/src/gallium/drivers/r600/evergreend.h b/src/gallium/drivers/r600/evergreend.h
>> index a81b6c5..3f33e42 100644
>> --- a/src/gallium/drivers/r600/evergreend.h
>> +++ b/src/gallium/drivers/r600/evergreend.h
>> @@ -1856,22 +1856,22 @@
>>  #define R_0283DC_SQ_VTX_SEMANTIC_23                  0x000283DC
>>  #define R_0283E0_SQ_VTX_SEMANTIC_24                  0x000283E0
>>  #define R_0283E4_SQ_VTX_SEMANTIC_25                  0x000283E4
>>  #define R_0283E8_SQ_VTX_SEMANTIC_26                  0x000283E8
>>  #define R_0283EC_SQ_VTX_SEMANTIC_27                  0x000283EC
>>  #define R_0283F0_SQ_VTX_SEMANTIC_28                  0x000283F0
>>  #define R_0283F4_SQ_VTX_SEMANTIC_29                  0x000283F4
>>  #define R_0283F8_SQ_VTX_SEMANTIC_30                  0x000283F8
>>  #define R_0283FC_SQ_VTX_SEMANTIC_31                  0x000283FC
>>  #define R_0288F0_SQ_VTX_SEMANTIC_CLEAR               0x000288F0
>> -#define R_0282D0_PA_SC_VPORT_ZMIN_0                  0x000282D0
>> -#define R_0282D4_PA_SC_VPORT_ZMAX_0                  0x000282D4
>> +#define R_0282D0_PA_SC_VPORT_ZMIN_0                                     0x0282D0
>> +#define R_0282D4_PA_SC_VPORT_ZMAX_0                                     0x0282D4
>
> Could you align these the same as the other registers.
>
> With that, patches 1-11,13-16,18-20 are
>
> Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
>
> Patches 12 and 17 look good to me, but I can't ascertain anything
> about correctness as they almost entirely depend on unodcumented
> hardware facts that I don't know and hence don't get my r-b. I don't
> if there is a preferred tag for this?

Acked-by.

Marek


More information about the mesa-dev mailing list