[SpirvTranslator] Fix SPIR-V viewport/layer capability handling

This commit is contained in:
ParantezTech 2026-09-22 04:20:21 +03:00
parent 5c347d2cb2
commit 54ab51e117
2 changed files with 6 additions and 4 deletions

View File

@ -5165,9 +5165,13 @@ public static partial class Gen5SpirvTranslator
SpirvBuiltIn.PointSize,
"gl_PointSize");
}
if (needLayer || needViewport)
{
_module.AddExtension("SPV_EXT_shader_viewport_index_layer");
_module.AddCapability(SpirvCapability.ShaderViewportIndexLayerExt);
}
if (needLayer)
{
_module.AddCapability(SpirvCapability.ShaderLayer);
_layerOutput = DeclareBuiltInOutput(
_uintType,
SpirvBuiltIn.Layer,
@ -5175,7 +5179,6 @@ public static partial class Gen5SpirvTranslator
}
if (needViewport)
{
_module.AddCapability(SpirvCapability.ShaderViewportIndex);
_viewportIndexOutput = DeclareBuiltInOutput(
_uintType,
SpirvBuiltIn.ViewportIndex,

View File

@ -207,8 +207,7 @@ public enum SpirvCapability : uint
GroupNonUniformVote = 62,
GroupNonUniformBallot = 64,
GroupNonUniformShuffle = 65,
ShaderLayer = 5253,
ShaderViewportIndex = 5254,
ShaderViewportIndexLayerExt = 5254,
RuntimeDescriptorArray = 5302,
PhysicalStorageBufferAddresses = 5347,
}