HLSL: fix BuiltInLayer to emit semantic 'SV_RenderTargetArrayIndex' instead of 'SV_RenderTargetIndex'

This commit is contained in:
iwubcode 2022-05-21 00:52:23 -05:00
parent b3ff97d0fe
commit a6976d596a

View File

@ -645,9 +645,9 @@ void CompilerHLSL::emit_builtin_outputs_in_struct()
case BuiltInLayer: case BuiltInLayer:
if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelGeometry) if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelGeometry)
SPIRV_CROSS_THROW("Render target index output is only supported in GS 5.0 or higher."); SPIRV_CROSS_THROW("Render target array index output is only supported in GS 5.0 or higher.");
type = "uint"; type = "uint";
semantic = "SV_RenderTargetIndex"; semantic = "SV_RenderTargetArrayIndex";
break; break;
default: default:
@ -797,9 +797,9 @@ void CompilerHLSL::emit_builtin_inputs_in_struct()
case BuiltInLayer: case BuiltInLayer:
if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment) if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment)
SPIRV_CROSS_THROW("Render target index input is only supported in PS 5.0 or higher."); SPIRV_CROSS_THROW("Render target array index input is only supported in PS 5.0 or higher.");
type = "uint"; type = "uint";
semantic = "SV_RenderTargetIndex"; semantic = "SV_RenderTargetArrayIndex";
break; break;
default: default: