diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2022-04-15 11:39:42 +0300 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2022-04-15 11:42:52 +0300 |
commit | 2ea1c9b64257e0390d15b9927e7cb67f63661c7d (patch) | |
tree | 2739b1e021bc26f44c630996750e593208230ff6 | |
parent | 6a67891418a3f08be63f92726e049dc788e46f5b (diff) |
HLSL: Implement ViewIndex.
-rw-r--r-- | spirv_hlsl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spirv_hlsl.cpp b/spirv_hlsl.cpp index a0d25eb3..7cd6102f 100644 --- a/spirv_hlsl.cpp +++ b/spirv_hlsl.cpp @@ -726,6 +726,13 @@ void CompilerHLSL::emit_builtin_inputs_in_struct() semantic = "SV_IsFrontFace"; break; + case BuiltInViewIndex: + if (hlsl_options.shader_model < 61 || (get_entry_point().model != ExecutionModelVertex && get_entry_point().model != ExecutionModelFragment)) + SPIRV_CROSS_THROW("View Index input is only supported in VS and PS 6.1 or higher."); + type = "uint"; + semantic = "SV_ViewID"; + break; + case BuiltInNumWorkgroups: case BuiltInSubgroupSize: case BuiltInSubgroupLocalInvocationId: @@ -1139,6 +1146,7 @@ void CompilerHLSL::emit_builtin_variables() break; case BuiltInPrimitiveId: + case BuiltInViewIndex: type = "uint"; break; |