microsoft/compiler: Primitive ID should only be added as a sysval in geometry shaders
Docs say that its presence in signatures as a "shadow" element (meaning it's not accessed via load/store, but with a dedicated opcode) is legacy. It seems it wasn't carried forward when HS/DS were added in D3D11. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Bill Kristiansen <billkris@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>
This commit is contained in:
parent
ec415a274e
commit
4da51aa88f
|
@ -5462,12 +5462,13 @@ struct sysvalue_name {
|
|||
gl_system_value value;
|
||||
int slot;
|
||||
char *name;
|
||||
gl_shader_stage only_in_shader;
|
||||
} possible_sysvalues[] = {
|
||||
{SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, -1, "SV_VertexID"},
|
||||
{SYSTEM_VALUE_INSTANCE_ID, -1, "SV_InstanceID"},
|
||||
{SYSTEM_VALUE_FRONT_FACE, VARYING_SLOT_FACE, "SV_IsFrontFace"},
|
||||
{SYSTEM_VALUE_PRIMITIVE_ID, VARYING_SLOT_PRIMITIVE_ID, "SV_PrimitiveID"},
|
||||
{SYSTEM_VALUE_SAMPLE_ID, -1, "SV_SampleIndex"},
|
||||
{SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, -1, "SV_VertexID", MESA_SHADER_NONE},
|
||||
{SYSTEM_VALUE_INSTANCE_ID, -1, "SV_InstanceID", MESA_SHADER_NONE},
|
||||
{SYSTEM_VALUE_FRONT_FACE, VARYING_SLOT_FACE, "SV_IsFrontFace", MESA_SHADER_NONE},
|
||||
{SYSTEM_VALUE_PRIMITIVE_ID, VARYING_SLOT_PRIMITIVE_ID, "SV_PrimitiveID", MESA_SHADER_GEOMETRY},
|
||||
{SYSTEM_VALUE_SAMPLE_ID, -1, "SV_SampleIndex", MESA_SHADER_NONE},
|
||||
};
|
||||
|
||||
static bool
|
||||
|
@ -5481,6 +5482,9 @@ allocate_sysvalues(struct ntd_context *ctx)
|
|||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(possible_sysvalues); ++i) {
|
||||
struct sysvalue_name *info = &possible_sysvalues[i];
|
||||
if (info->only_in_shader != MESA_SHADER_NONE &&
|
||||
info->only_in_shader != ctx->shader->info.stage)
|
||||
continue;
|
||||
if (BITSET_TEST(ctx->shader->info.system_values_read, info->value)) {
|
||||
if (!append_input_or_sysvalue(ctx, info->slot,
|
||||
info->value, info->name,
|
||||
|
|
Loading…
Reference in New Issue