HLSL: Add support for gl_HelperInvocation
This commit is contained in:
parent
6c7a40822f
commit
278a4c80ed
@ -728,6 +728,11 @@ void CompilerHLSL::emit_builtin_inputs_in_struct()
|
||||
// Handled specially.
|
||||
break;
|
||||
|
||||
case BuiltInHelperInvocation:
|
||||
if (hlsl_options.shader_model < 50 || (get_entry_point().model != ExecutionModelFragment && get_entry_point().model != ExecutionModelGLCompute))
|
||||
SPIRV_CROSS_THROW("Helper Invocation input is only supported in PS 5.0 or higher.");
|
||||
break;
|
||||
|
||||
case BuiltInClipDistance:
|
||||
// HLSL is a bit weird here, use SV_ClipDistance0, SV_ClipDistance1 and so on with vectors.
|
||||
for (uint32_t clip = 0; clip < clip_distance_count; clip += 4)
|
||||
@ -984,6 +989,8 @@ std::string CompilerHLSL::builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClas
|
||||
return "WaveGetLaneIndex()";
|
||||
case BuiltInSubgroupSize:
|
||||
return "WaveGetLaneCount()";
|
||||
case BuiltInHelperInvocation:
|
||||
return "IsHelperLane()";
|
||||
|
||||
default:
|
||||
return CompilerGLSL::builtin_to_glsl(builtin, storage);
|
||||
@ -1103,6 +1110,11 @@ void CompilerHLSL::emit_builtin_variables()
|
||||
type = "uint4";
|
||||
break;
|
||||
|
||||
case BuiltInHelperInvocation:
|
||||
if (hlsl_options.shader_model < 50)
|
||||
SPIRV_CROSS_THROW("Need SM 5.0 for Helper Invocation.");
|
||||
break;
|
||||
|
||||
case BuiltInClipDistance:
|
||||
array_size = clip_distance_count;
|
||||
type = "float";
|
||||
@ -2521,6 +2533,7 @@ void CompilerHLSL::emit_hlsl_entry_point()
|
||||
case BuiltInPointCoord:
|
||||
case BuiltInSubgroupSize:
|
||||
case BuiltInSubgroupLocalInvocationId:
|
||||
case BuiltInHelperInvocation:
|
||||
break;
|
||||
|
||||
case BuiltInSubgroupEqMask:
|
||||
|
Loading…
Reference in New Issue
Block a user