Mesa (master): r600g: cleanup magic numbers in set_xx_sampler
Marek Olšák
mareko at kemper.freedesktop.org
Thu Feb 23 20:52:57 UTC 2012
Module: Mesa
Branch: master
Commit: 5b84a8c3c3f85cd6b109861c6eebe3ece29d664e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b84a8c3c3f85cd6b109861c6eebe3ece29d664e
Author: Marek Olšák <maraeo at gmail.com>
Date: Tue Feb 21 20:24:34 2012 +0100
r600g: cleanup magic numbers in set_xx_sampler
Reviewed-by: Jerome Glisse <jglisse at redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
---
src/gallium/drivers/r600/evergreen_hw_context.c | 4 ++--
src/gallium/drivers/r600/r600_hw_context.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c b/src/gallium/drivers/r600/evergreen_hw_context.c
index 989473b..0bc2863 100644
--- a/src/gallium/drivers/r600/evergreen_hw_context.c
+++ b/src/gallium/drivers/r600/evergreen_hw_context.c
@@ -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);
}
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
index 526b02a..c1fa9db 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -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);
}
More information about the mesa-commit
mailing list