summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/radeonsi_shader.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2012-09-27 20:01:33 +0200
committerMichel Dänzer <[email protected]>2012-10-02 17:50:58 +0200
commitc3db19efba8ccdf8df94ab357cf675ba8728f81c (patch)
tree302b930492643818f66a109f98fd0c3b287b90b1 /src/gallium/drivers/radeonsi/radeonsi_shader.c
parentdbb4a7f9502c886885bfd8cc635eb5e52f3d1d39 (diff)
radeonsi: Better indexing of parameters in the pixel shader.
We were previously using the TGSI input index, which can exceed the number of parameters passed from the vertex shader via the parameter cache. Now we use a separate index which only counts those parameters. Prevents piglit regressions with the following fix. Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/radeonsi_shader.c')
-rw-r--r--src/gallium/drivers/radeonsi/radeonsi_shader.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
index 75cb7e120b7..a48234a17ca 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
@@ -236,6 +236,7 @@ static void declare_input_fs(
{
const char * intr_name;
unsigned chan;
+ struct si_shader *shader = &si_shader_ctx->shader->shader;
struct lp_build_context * base =
&si_shader_ctx->radeon_bld.soa.bld_base.base;
struct gallivm_state * gallivm = base->gallivm;
@@ -249,10 +250,7 @@ static void declare_input_fs(
*
*/
LLVMValueRef params = use_sgpr(base->gallivm, SGPR_I32, SI_PS_NUM_USER_SGPR);
-
-
- /* XXX: Is this the input_index? */
- LLVMValueRef attr_number = lp_build_const_int32(gallivm, input_index);
+ LLVMValueRef attr_number;
if (decl->Semantic.Name == TGSI_SEMANTIC_POSITION) {
for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
@@ -268,6 +266,10 @@ static void declare_input_fs(
return;
}
+ shader->input[input_index].param_offset = shader->ninterp++;
+ attr_number = lp_build_const_int32(gallivm,
+ shader->input[input_index].param_offset);
+
/* XXX: Handle all possible interpolation modes */
switch (decl->Interp.Interpolate) {
case TGSI_INTERPOLATE_COLOR: