aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-10-06 00:17:42 +0200
committerMarek Olšák <[email protected]>2015-07-23 00:59:31 +0200
commit2ecb06b946ff8bf4a96de79ab81926fa1bf5a93f (patch)
treed1d8dce9dda4dfcef8a3870b14e7e4f5ea77eeff /src/gallium
parent1bc0fba572363f5460be7343cff8b8b7a315d755 (diff)
radeonsi: make ES2GS offset sgpr location dynamic
It will have a different location in the tessellation evaluation shader. Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c6
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.h3
2 files changed, 3 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 955e780faf2..d0e7fa95cf7 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -72,6 +72,7 @@ struct si_shader_context
int param_streamout_offset[4];
int param_vertex_id;
int param_instance_id;
+ int param_es2gs_offset;
LLVMTargetMachineRef tm;
LLVMValueRef const_md;
LLVMValueRef const_resource[SI_NUM_CONST_BUFFERS];
@@ -1332,7 +1333,7 @@ static void si_llvm_emit_es_epilogue(struct lp_build_tgsi_context * bld_base)
struct tgsi_shader_info *info = &es->selector->info;
LLVMTypeRef i32 = LLVMInt32TypeInContext(gallivm->context);
LLVMValueRef soffset = LLVMGetParam(si_shader_ctx->radeon_bld.main_fn,
- SI_PARAM_ES2GS_OFFSET);
+ si_shader_ctx->param_es2gs_offset);
unsigned chan;
int i;
@@ -2385,8 +2386,7 @@ static void create_function(struct si_shader_context *si_shader_ctx)
num_params = SI_PARAM_START_INSTANCE+1;
if (shader->key.vs.as_es) {
- params[SI_PARAM_ES2GS_OFFSET] = i32;
- num_params++;
+ params[si_shader_ctx->param_es2gs_offset = num_params++] = i32;
} else {
if (shader->is_gs_copy_shader) {
last_array_pointer = SI_PARAM_CONST;
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index c12782f288c..be3e98a361a 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -62,9 +62,6 @@ struct radeon_shader_reloc;
#define SI_PARAM_START_INSTANCE 6
/* the other VS parameters are assigned dynamically */
-/* ES only parameters */
-#define SI_PARAM_ES2GS_OFFSET 7
-
/* GS only parameters */
#define SI_PARAM_GS2VS_OFFSET 4
#define SI_PARAM_GS_WAVE_ID 5