microsoft/compiler: Support gl_Layer
Maps pretty nicely to SV_RenderTargetArrayIndex, so nothing complicated here. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17039>
This commit is contained in:
committed by
Marge Bot
parent
9c45ee3f86
commit
e11035bf6d
@@ -104,6 +104,8 @@ in_sysvalue_name(nir_variable *var)
|
||||
return "POS";
|
||||
case VARYING_SLOT_FACE:
|
||||
return "FACE";
|
||||
case VARYING_SLOT_LAYER:
|
||||
return "RTINDEX";
|
||||
default:
|
||||
return "NONE";
|
||||
}
|
||||
@@ -326,6 +328,12 @@ get_semantic_name(nir_variable *var, struct semantic_info *info,
|
||||
info->kind = DXIL_SEM_VIEWPORT_ARRAY_INDEX;
|
||||
break;
|
||||
|
||||
case VARYING_SLOT_LAYER:
|
||||
assert(glsl_get_components(var->type) == 1);
|
||||
snprintf(info->name, 64, "%s", "SV_RenderTargetArrayIndex");
|
||||
info->kind = DXIL_SEM_RENDERTARGET_ARRAY_INDEX;
|
||||
break;
|
||||
|
||||
default: {
|
||||
info->index = var->data.driver_location;
|
||||
strcpy(info->name, "TEXCOORD");
|
||||
|
||||
@@ -5440,7 +5440,8 @@ emit_module(struct ntd_context *ctx, const struct nir_to_dxil_options *opts)
|
||||
}
|
||||
} else if (ctx->shader->info.stage == MESA_SHADER_VERTEX ||
|
||||
ctx->shader->info.stage == MESA_SHADER_TESS_EVAL) {
|
||||
if (ctx->shader->info.outputs_written & VARYING_BIT_VIEWPORT)
|
||||
if (ctx->shader->info.outputs_written &
|
||||
(VARYING_BIT_VIEWPORT | VARYING_BIT_LAYER))
|
||||
ctx->mod.feats.array_layer_from_vs_or_ds = true;
|
||||
}
|
||||
|
||||
@@ -5880,6 +5881,7 @@ nir_var_to_dxil_sysvalue_type(nir_variable *var, uint64_t other_stage_mask)
|
||||
case VARYING_SLOT_TESS_LEVEL_INNER:
|
||||
case VARYING_SLOT_TESS_LEVEL_OUTER:
|
||||
case VARYING_SLOT_VIEWPORT:
|
||||
case VARYING_SLOT_LAYER:
|
||||
if (!((1ull << var->data.location) & other_stage_mask))
|
||||
return DXIL_SYSVALUE;
|
||||
FALLTHROUGH;
|
||||
|
||||
Reference in New Issue
Block a user