microsoft/compiler: Handle SV_ViewportArrayIndex

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14881>
This commit is contained in:
Jesse Natalie 2022-02-04 06:16:05 -08:00 committed by Marge Bot
parent 47f4cb2405
commit 5954c8e524
2 changed files with 7 additions and 0 deletions

View File

@ -315,6 +315,12 @@ get_semantic_name(nir_variable *var, struct semantic_info *info,
info->kind = DXIL_SEM_TESS_FACTOR;
break;
case VARYING_SLOT_VIEWPORT:
assert(glsl_get_components(var->type) == 1);
snprintf(info->name, 64, "%s", "SV_ViewportArrayIndex");
info->kind = DXIL_SEM_VIEWPORT_ARRAY_INDEX;
break;
default: {
info->index = vulkan ?
var->data.location - VARYING_SLOT_VAR0 :

View File

@ -5772,6 +5772,7 @@ nir_var_to_dxil_sysvalue_type(nir_variable *var, uint64_t other_stage_mask)
case VARYING_SLOT_PSIZ:
case VARYING_SLOT_TESS_LEVEL_INNER:
case VARYING_SLOT_TESS_LEVEL_OUTER:
case VARYING_SLOT_VIEWPORT:
if (!((1ull << var->data.location) & other_stage_mask))
return DXIL_SYSVALUE;
FALLTHROUGH;