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

@@ -8,7 +8,7 @@
OpCapability Kernel
OpCapability Int64
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %1 "branch_conditional"
OpEntryPoint Kernel %1 "branch_conditional" %gl_GlobalInvocationID
OpName %res "res"
OpName %lhs "lhs"
OpName %rhs "rhs"
@@ -20,7 +20,7 @@
OpGroupDecorate %5 %res %lhs %rhs
%ulong = OpTypeInt 64 0
%v3ulong = OpTypeVector %ulong 3
%_ptr_UniformConstant_v3ulong = OpTypePointer UniformConstant %v3ulong
%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
%bool = OpTypeBool
%void = OpTypeVoid
%uint = OpTypeInt 32 0
@@ -29,7 +29,7 @@
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
%gl_GlobalInvocationID = OpVariable %_ptr_UniformConstant_v3ulong UniformConstant
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
%1 = OpFunction %void None %17
%res = OpFunctionParameter %_ptr_CrossWorkgroup_uint
%lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint