GLSL/HLSL: Disallow VariablePointers capability outright.

Cannot be supported, error out early.
This commit is contained in:
Hans-Kristian Arntzen 2020-12-07 12:16:02 +01:00
parent 6d10da0224
commit dc940846d7
6 changed files with 14 additions and 4 deletions

View File

@ -4,9 +4,9 @@
; Bound: 31
; Schema: 0
OpCapability Shader
OpCapability VariablePointers
;OpCapability VariablePointers
OpExtension "SPV_KHR_storage_buffer_storage_class"
OpExtension "SPV_KHR_variable_pointers"
;OpExtension "SPV_KHR_variable_pointers"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %22 "main" %gl_WorkGroupID
OpSource OpenCL_C 120

View File

@ -4,9 +4,9 @@
; Bound: 31
; Schema: 0
OpCapability Shader
OpCapability VariablePointers
;OpCapability VariablePointers
OpExtension "SPV_KHR_storage_buffer_storage_class"
OpExtension "SPV_KHR_variable_pointers"
;OpExtension "SPV_KHR_variable_pointers"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %22 "main" %gl_WorkGroupID
OpSource OpenCL_C 120

View File

@ -502,6 +502,10 @@ void CompilerGLSL::find_static_extensions()
}
break;
case CapabilityVariablePointers:
case CapabilityVariablePointersStorageBuffer:
SPIRV_CROSS_THROW("VariablePointers capability is not supported in GLSL.");
default:
break;
}

View File

@ -5616,6 +5616,12 @@ void CompilerHLSL::validate_shader_model()
if (hlsl_options.shader_model < 51)
SPIRV_CROSS_THROW(
"Shader model 5.1 or higher is required to use bindless resources or NonUniformResourceIndex.");
break;
case CapabilityVariablePointers:
case CapabilityVariablePointersStorageBuffer:
SPIRV_CROSS_THROW("VariablePointers capability is not supported in HLSL.");
default:
break;
}