Mesa (master): ac/radeonsi: add load_local_group_size() to the abi

Timothy Arceri tarceri at kemper.freedesktop.org
Tue Feb 6 21:46:48 UTC 2018


Module: Mesa
Branch: master
Commit: d116af383ffef775ccfc8f2f64b603aebb6b374a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d116af383ffef775ccfc8f2f64b603aebb6b374a

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Fri Feb  2 13:14:41 2018 +1100

ac/radeonsi: add load_local_group_size() to the abi

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/amd/common/ac_nir_to_llvm.c          | 3 +++
 src/amd/common/ac_shader_abi.h           | 2 ++
 src/gallium/drivers/radeonsi/si_shader.c | 1 +
 3 files changed, 6 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index ae569d4c7f..9dcbe25380 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -4308,6 +4308,9 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
 		result = ctx->abi->base_vertex;
 		break;
 	}
+	case nir_intrinsic_load_local_group_size:
+		result = ctx->abi->load_local_group_size(ctx->abi);
+		break;
 	case nir_intrinsic_load_vertex_id_zero_base: {
 		result = ctx->abi->vertex_id;
 		break;
diff --git a/src/amd/common/ac_shader_abi.h b/src/amd/common/ac_shader_abi.h
index 9a35ff925b..55842ea342 100644
--- a/src/amd/common/ac_shader_abi.h
+++ b/src/amd/common/ac_shader_abi.h
@@ -157,6 +157,8 @@ struct ac_shader_abi {
 	LLVMValueRef (*load_sample_position)(struct ac_shader_abi *abi,
 					     LLVMValueRef sample_id);
 
+	LLVMValueRef (*load_local_group_size)(struct ac_shader_abi *abi);
+
 	/* Whether to clamp the shadow reference value to [0,1]on VI. Radeonsi currently
 	 * uses it due to promoting D16 to D32, but radv needs it off. */
 	bool clamp_shadow_reference;
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 808d55b8ce..bb8cf8f779 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5985,6 +5985,7 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx,
 		ctx->abi.load_sample_position = load_sample_position;
 		break;
 	case PIPE_SHADER_COMPUTE:
+		ctx->abi.load_local_group_size = get_block_size;
 		break;
 	default:
 		assert(!"Unsupported shader type");




More information about the mesa-commit mailing list