aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-09-05 12:19:22 +0200
committerSamuel Pitoiset <[email protected]>2019-09-06 17:36:49 +0200
commit0bf51b6941b8ad4e122772525c2caf6896bfc0cb (patch)
tree562113d3990ac16721d725bb6b2d6cf892a197a5 /src
parentbcd14756eec808f2f04d38a8880488188eb0eef0 (diff)
radv/gfx10: determine the number of vertices per primitive for TES
This doesn't fix anything known but it's correct now. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_nir_to_llvm.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index 0c13860fe28..1b77bd70eec 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -3125,7 +3125,6 @@ static void
handle_ngg_outputs_post(struct radv_shader_context *ctx)
{
LLVMBuilderRef builder = ctx->ac.builder;
- unsigned num_vertices = 3;
LLVMValueRef tmp;
assert((ctx->stage == MESA_SHADER_VERTEX ||
@@ -3143,6 +3142,22 @@ handle_ngg_outputs_post(struct radv_shader_context *ctx)
ac_unpack_param(&ctx->ac, ctx->gs_vtx_offset[2], 0, 16),
};
+ /* Determine the number of vertices per primitive. */
+ unsigned num_vertices;
+
+ if (ctx->stage == MESA_SHADER_VERTEX) {
+ num_vertices = 3; /* TODO: optimize for points & lines */
+ } else {
+ assert(ctx->stage == MESA_SHADER_TESS_EVAL);
+
+ if (ctx->shader->info.tess.point_mode)
+ num_vertices = 1;
+ else if (ctx->shader->info.tess.primitive_mode == GL_ISOLINES)
+ num_vertices = 2;
+ else
+ num_vertices = 3;
+ }
+
/* TODO: streamout */
/* Copy Primitive IDs from GS threads to the LDS address corresponding