summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-06-20 14:03:10 +1000
committerDave Airlie <[email protected]>2017-06-26 08:45:22 +1000
commita563f611c3d3cdb2ca8a60d5eb4086cab5fa0f31 (patch)
treeb2ee1e35d6429314254f4ed3ce1789ff7f2bf6ed /src/amd
parent4042892cee83cb04ca50908926d95215d7ab1d42 (diff)
radv: set prim_id for geometry shaders
Noticed in passing. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c5
-rw-r--r--src/amd/common/ac_nir_to_llvm.h1
-rw-r--r--src/amd/vulkan/si_cmd_buffer.c5
3 files changed, 9 insertions, 2 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 4d9c070dabe..afef3fd28d4 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3867,9 +3867,10 @@ static void visit_intrinsic(struct nir_to_llvm_context *ctx,
result = ctx->gs_invocation_id;
break;
case nir_intrinsic_load_primitive_id:
- if (ctx->stage == MESA_SHADER_GEOMETRY)
+ if (ctx->stage == MESA_SHADER_GEOMETRY) {
+ ctx->shader_info->gs.uses_prim_id = true;
result = ctx->gs_prim_id;
- else if (ctx->stage == MESA_SHADER_TESS_CTRL) {
+ } else if (ctx->stage == MESA_SHADER_TESS_CTRL) {
ctx->shader_info->tcs.uses_prim_id = true;
result = ctx->tcs_patch_id;
} else if (ctx->stage == MESA_SHADER_TESS_EVAL) {
diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h
index 9ea3156b255..724d5e6b0fd 100644
--- a/src/amd/common/ac_nir_to_llvm.h
+++ b/src/amd/common/ac_nir_to_llvm.h
@@ -178,6 +178,7 @@ struct ac_shader_variant_info {
unsigned invocations;
unsigned gsvs_vertex_size;
unsigned max_gsvs_emit_size;
+ bool uses_prim_id;
} gs;
struct {
bool uses_prim_id;
diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c
index 962b76fe9d9..86e8e3e4986 100644
--- a/src/amd/vulkan/si_cmd_buffer.c
+++ b/src/amd/vulkan/si_cmd_buffer.c
@@ -789,6 +789,11 @@ si_get_ia_multi_vgt_param(struct radv_cmd_buffer *cmd_buffer,
partial_es_wave = true;
if (radv_pipeline_has_gs(cmd_buffer->state.pipeline)) {
+
+ if (radv_pipeline_has_gs(cmd_buffer->state.pipeline) &&
+ cmd_buffer->state.pipeline->shaders[MESA_SHADER_GEOMETRY]->info.gs.uses_prim_id)
+ ia_switch_on_eoi = true;
+
/* GS requirement. */
if (SI_GS_PER_ES / primgroup_size >= cmd_buffer->device->gs_table_depth - 3)
partial_es_wave = true;