r600g: cleanup magic numbers in set_xx_sampler
authorMarek Olšák <maraeo@gmail.com>
Tue, 21 Feb 2012 19:24:34 +0000 (20:24 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 23 Feb 2012 19:29:56 +0000 (20:29 +0100)
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/evergreen_hw_context.c
src/gallium/drivers/r600/r600_hw_context.c

index 989473b6ff5de43db98a0cf46bdf02ddcc8c21a3..0bc28632e09fef54fc8b3df12a726d8c35248f09 100644 (file)
@@ -820,7 +820,7 @@ void evergreen_context_pipe_state_set_ps_sampler(struct r600_context *ctx, struc
 {
        unsigned offset;
 
-       offset = 0x0003C000 + id * 0xc;
+       offset = R_03C000_SQ_TEX_SAMPLER_WORD0_0 + 12*id;
        r600_context_pipe_state_set_sampler(ctx, state, offset);
        evergreen_context_pipe_state_set_sampler_border(ctx, state, R_00A400_TD_PS_SAMPLER0_BORDER_INDEX, id);
 }
@@ -829,7 +829,7 @@ void evergreen_context_pipe_state_set_vs_sampler(struct r600_context *ctx, struc
 {
        unsigned offset;
 
-       offset = 0x0003C0D8 + id * 0xc;
+       offset = R_03C000_SQ_TEX_SAMPLER_WORD0_0 + 12*(id + 18);
        r600_context_pipe_state_set_sampler(ctx, state, offset);
        evergreen_context_pipe_state_set_sampler_border(ctx, state, R_00A414_TD_VS_SAMPLER0_BORDER_INDEX, id);
 }
index 526b02afbf07437396fb67dbc1dae8d659a7d74c..c1fa9db08a0a668a7de4be4d2ea2badff836fa4b 100644 (file)
@@ -1059,9 +1059,9 @@ void r600_context_pipe_state_set_ps_sampler(struct r600_context *ctx, struct r60
 {
        unsigned offset;
 
-       offset = 0x0003C000 + id * 0xc;
+       offset = R_03C000_SQ_TEX_SAMPLER_WORD0_0 + 12*id;
        r600_context_pipe_state_set_sampler(ctx, state, offset);
-       offset = 0x0000A400 + id * 0x10;
+       offset = R_00A400_TD_PS_SAMPLER0_BORDER_RED + 16*id;
        r600_context_pipe_state_set_sampler_border(ctx, state, offset);
 }
 
@@ -1069,9 +1069,9 @@ void r600_context_pipe_state_set_vs_sampler(struct r600_context *ctx, struct r60
 {
        unsigned offset;
 
-       offset = 0x0003C0D8 + id * 0xc;
+       offset = R_03C000_SQ_TEX_SAMPLER_WORD0_0 + 12*(id + 18);
        r600_context_pipe_state_set_sampler(ctx, state, offset);
-       offset = 0x0000A600 + id * 0x10;
+       offset = R_00A600_TD_VS_SAMPLER0_BORDER_RED + 16*id;
        r600_context_pipe_state_set_sampler_border(ctx, state, offset);
 }