zink: add ntv handling for geometry shader variables

these can reuse the unified loader codepath

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7139>
This commit is contained in:
Mike Blumenkrantz 2020-10-14 10:32:36 -04:00
parent 423a342ae7
commit ea2279daf1

View file

@ -68,7 +68,8 @@ struct ntv_context {
unsigned char *shader_slot_map;
unsigned char shader_slots_reserved;
SpvId front_face_var, instance_id_var, vertex_id_var;
SpvId front_face_var, instance_id_var, vertex_id_var,
primitive_id_var, invocation_id_var; // geometry
};
static SpvId
@ -1672,6 +1673,14 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
emit_load_uint_input(ctx, intr, &ctx->vertex_id_var, "gl_VertexId", SpvBuiltInVertexIndex);
break;
case nir_intrinsic_load_primitive_id:
emit_load_uint_input(ctx, intr, &ctx->primitive_id_var, "gl_PrimitiveIdIn", SpvBuiltInPrimitiveId);
break;
case nir_intrinsic_load_invocation_id:
emit_load_uint_input(ctx, intr, &ctx->invocation_id_var, "gl_InvocationId", SpvBuiltInInvocationId);
break;
default:
fprintf(stderr, "emit_intrinsic: not implemented (%s)\n",
nir_intrinsic_infos[intr->intrinsic].name);