SPIR-V: BuiltIn variables use the Input storage class (#769)

The OpenCL SPIR-V Environment Specification was updated to mandate that
all variables decorated with `BuiltIn` must be in the `Input` storage
class, see https://github.com/KhronosGroup/OpenCL-Docs/pull/278.

Global variables with the Input storage class have to be listed in the
entry points’ interface, which was also taken care of in this commit.
This commit is contained in:
Pierre Moreau
2020-07-03 10:21:41 +02:00
committed by GitHub
parent 96ea9d6011
commit a69f3ca8cf
684 changed files with 1040 additions and 1034 deletions

View File

@@ -9,7 +9,7 @@
OpCapability Kernel
%1 = OpExtInstImport "OpenCL.std"
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %2 "fmath_spv"
OpEntryPoint Kernel %2 "fmath_spv" %gl_GlobalInvocationID
OpName %res "res"
OpName %lhs "lhs"
OpName %rhs "rhs"
@@ -22,13 +22,13 @@
OpGroupDecorate %7 %res %lhs %rhs
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_UniformConstant_v3uint = OpTypePointer UniformConstant %v3uint
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%void = OpTypeVoid
%double = OpTypeFloat 64
%v2double = OpTypeVector %double 2
%_ptr_CrossWorkgroup_v2double = OpTypePointer CrossWorkgroup %v2double
%16 = OpTypeFunction %void %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double %_ptr_CrossWorkgroup_v2double
%gl_GlobalInvocationID = OpVariable %_ptr_UniformConstant_v3uint UniformConstant
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%2 = OpFunction %void None %16
%res = OpFunctionParameter %_ptr_CrossWorkgroup_v2double
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_v2double