From 1ee57b16beec5a9128c75a3191eed051317e9836 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Thu, 30 Mar 2017 14:14:27 +0200 Subject: [PATCH] radeonsi: bump RADEON_LLVM_MAX_SYSTEM_VALUES MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ARB_shader_ballot introduces 7 new system values that can be used in all shader stages. Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_shader.c | 2 ++ src/gallium/drivers/radeonsi/si_shader_internal.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 29d3dd4578d..600f2e31029 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -1376,6 +1376,8 @@ static void declare_system_value(struct si_shader_context *ctx, struct gallivm_state *gallivm = &ctx->gallivm; LLVMValueRef value = 0; + assert(index < RADEON_LLVM_MAX_SYSTEM_VALUES); + switch (decl->Semantic.Name) { case TGSI_SEMANTIC_INSTANCEID: value = LLVMGetParam(ctx->main_fn, diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h index 47aeb5d3b82..fd7deec49bf 100644 --- a/src/gallium/drivers/radeonsi/si_shader_internal.h +++ b/src/gallium/drivers/radeonsi/si_shader_internal.h @@ -43,7 +43,7 @@ struct ac_shader_binary; #define RADEON_LLVM_INITIAL_CF_DEPTH 4 -#define RADEON_LLVM_MAX_SYSTEM_VALUES 4 +#define RADEON_LLVM_MAX_SYSTEM_VALUES 11 #define RADEON_LLVM_MAX_ADDRS 16 struct si_llvm_flow; -- 2.30.2