Unverified Commit 34170157 by John Kessenich Committed by GitHub

Merge pull request #1946 from KhronosGroup/extend-web

Web: Extend with compute stage, SSBOs, and atomics on SSBO memory.
parents a3f0da56 f8d1d744
388096 ../build/install/bin/glslangValidator.exe
396288 ../build/install/bin/glslangValidator.exe
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 7
; Bound: 108
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %gl_NumWorkGroups %gl_WorkGroupID %gl_LocalInvocationID %gl_GlobalInvocationID %gl_LocalInvocationIndex
OpExecutionMode %main LocalSize 2 5 7
OpSource ESSL 310
OpName %main "main"
OpName %bName "bName"
OpMemberName %bName 0 "size"
OpMemberName %bName 1 "count"
OpMemberName %bName 2 "data"
OpName %bInst "bInst"
OpName %s "s"
OpName %arrX "arrX"
OpName %arrY "arrY"
OpName %arrZ "arrZ"
OpName %gl_NumWorkGroups "gl_NumWorkGroups"
OpName %gl_WorkGroupID "gl_WorkGroupID"
OpName %gl_LocalInvocationID "gl_LocalInvocationID"
OpName %gl_GlobalInvocationID "gl_GlobalInvocationID"
OpName %gl_LocalInvocationIndex "gl_LocalInvocationIndex"
OpDecorate %_runtimearr_v4float ArrayStride 16
OpMemberDecorate %bName 0 Offset 0
OpMemberDecorate %bName 1 Offset 16
OpMemberDecorate %bName 2 Offset 32
OpDecorate %bName BufferBlock
OpDecorate %bInst DescriptorSet 0
OpDecorate %bInst Binding 0
OpDecorate %39 SpecId 18
OpDecorate %41 SpecId 19
OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
OpDecorate %gl_NumWorkGroups BuiltIn NumWorkgroups
OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId
OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex
%void = OpTypeVoid
%3 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%int = OpTypeInt 32 1
%v3uint = OpTypeVector %uint 3
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_runtimearr_v4float = OpTypeRuntimeArray %v4float
%bName = OpTypeStruct %int %v3uint %_runtimearr_v4float
%_ptr_Uniform_bName = OpTypePointer Uniform %bName
%bInst = OpVariable %_ptr_Uniform_bName Uniform
%int_2 = OpConstant %int 2
%int_0 = OpConstant %int 0
%_ptr_Uniform_int = OpTypePointer Uniform %int
%float_7 = OpConstant %float 7
%24 = OpConstantComposite %v4float %float_7 %float_7 %float_7 %float_7
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%uint_1 = OpConstant %uint 1
%uint_3400 = OpConstant %uint 3400
%uint_72 = OpConstant %uint 72
%uint_197645 = OpConstant %uint 197645
%_arr_v4float_uint_197645 = OpTypeArray %v4float %uint_197645
%_ptr_Workgroup__arr_v4float_uint_197645 = OpTypePointer Workgroup %_arr_v4float_uint_197645
%s = OpVariable %_ptr_Workgroup__arr_v4float_uint_197645 Workgroup
%int_3 = OpConstant %int 3
%float_0 = OpConstant %float 0
%39 = OpSpecConstant %uint 2
%uint_5 = OpConstant %uint 5
%41 = OpSpecConstant %uint 7
%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %39 %uint_5 %41
%uint_0 = OpConstant %uint 0
%_arr_int_44 = OpTypeArray %int %44
%_ptr_Private__arr_int_44 = OpTypePointer Private %_arr_int_44
%arrX = OpVariable %_ptr_Private__arr_int_44 Private
%_ptr_Private_int = OpTypePointer Private %int
%_arr_int_52 = OpTypeArray %int %52
%_ptr_Private__arr_int_52 = OpTypePointer Private %_arr_int_52
%arrY = OpVariable %_ptr_Private__arr_int_52 Private
%_arr_int_59 = OpTypeArray %int %59
%_ptr_Private__arr_int_59 = OpTypePointer Private %_arr_int_59
%arrZ = OpVariable %_ptr_Private__arr_int_59 Private
%_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
%int_1 = OpConstant %int 1
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%gl_NumWorkGroups = OpVariable %_ptr_Input_v3uint Input
%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input
%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%_ptr_Input_uint = OpTypePointer Input %uint
%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input
%_ptr_Uniform_v3uint = OpTypePointer Uniform %v3uint
%int_5 = OpConstant %int 5
%int_197645 = OpConstant %int 197645
%main = OpFunction %void None %3
%5 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%20 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%21 = OpLoad %int %20
%22 = OpSDiv %int %21 %int_2
%26 = OpAccessChain %_ptr_Uniform_v4float %bInst %int_2 %22
%27 = OpLoad %v4float %26
%28 = OpFMul %v4float %27 %24
%29 = OpAccessChain %_ptr_Uniform_v4float %bInst %int_2 %22
OpStore %29 %28
OpMemoryBarrier %uint_1 %uint_3400
OpMemoryBarrier %uint_2 %uint_3400
OpMemoryBarrier %uint_1 %uint_264
OpMemoryBarrier %uint_1 %uint_72
%44 = OpCompositeExtract %uint %gl_WorkGroupSize 0
%49 = OpAccessChain %_ptr_Private_int %arrX %int_0
%50 = OpLoad %int %49
%51 = OpConvertSToF %float %50
%52 = OpCompositeExtract %uint %gl_WorkGroupSize 1
%56 = OpAccessChain %_ptr_Private_int %arrY %int_0
%57 = OpLoad %int %56
%58 = OpConvertSToF %float %57
%59 = OpCompositeExtract %uint %gl_WorkGroupSize 2
%63 = OpAccessChain %_ptr_Private_int %arrZ %int_0
%64 = OpLoad %int %63
%65 = OpConvertSToF %float %64
%66 = OpCompositeConstruct %v4float %float_0 %51 %58 %65
%68 = OpAccessChain %_ptr_Workgroup_v4float %s %int_3
OpStore %68 %66
%72 = OpLoad %v3uint %gl_NumWorkGroups
%73 = OpIAdd %v3uint %72 %gl_WorkGroupSize
%75 = OpLoad %v3uint %gl_WorkGroupID
%76 = OpIAdd %v3uint %73 %75
%78 = OpLoad %v3uint %gl_LocalInvocationID
%79 = OpIAdd %v3uint %76 %78
%81 = OpLoad %v3uint %gl_GlobalInvocationID
%84 = OpLoad %uint %gl_LocalInvocationIndex
%85 = OpCompositeConstruct %v3uint %84 %84 %84
%86 = OpIMul %v3uint %81 %85
%87 = OpIAdd %v3uint %79 %86
%89 = OpAccessChain %_ptr_Uniform_v3uint %bInst %int_1
OpStore %89 %87
%90 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%91 = OpAtomicIAdd %int %90 %uint_1 %uint_0 %int_2
%92 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%93 = OpAtomicSMin %int %92 %uint_1 %uint_0 %int_2
%94 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%95 = OpAtomicSMax %int %94 %uint_1 %uint_0 %int_2
%96 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%97 = OpAtomicAnd %int %96 %uint_1 %uint_0 %int_2
%98 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%99 = OpAtomicOr %int %98 %uint_1 %uint_0 %int_2
%100 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%101 = OpAtomicXor %int %100 %uint_1 %uint_0 %int_2
%102 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%103 = OpAtomicExchange %int %102 %uint_1 %uint_0 %int_2
%104 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
%106 = OpAtomicCompareExchange %int %104 %uint_1 %uint_0 %uint_0 %int_2 %int_5
OpReturn
OpFunctionEnd
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 7
; Bound: 99
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %color %i
OpExecutionMode %main OriginUpperLeft
OpSource ESSL 310
OpName %main "main"
OpName %color "color"
OpName %t2d "t2d"
OpName %s "s"
OpName %t3d "t3d"
OpName %sA "sA"
OpName %sShadow "sShadow"
OpName %i "i"
OpName %tex2D "tex2D"
OpName %texCube "texCube"
OpName %tex2DArray "tex2DArray"
OpName %itex2D "itex2D"
OpName %itex3D "itex3D"
OpName %itexCube "itexCube"
OpName %itex2DArray "itex2DArray"
OpName %utex2D "utex2D"
OpName %utex3D "utex3D"
OpName %utexCube "utexCube"
OpName %utex2DArray "utex2DArray"
OpName %tex3D "tex3D"
OpDecorate %color Location 0
OpDecorate %t2d RelaxedPrecision
OpDecorate %t2d DescriptorSet 0
OpDecorate %t2d Binding 3
OpDecorate %14 RelaxedPrecision
OpDecorate %s DescriptorSet 0
OpDecorate %s Binding 0
OpDecorate %23 RelaxedPrecision
OpDecorate %t3d DescriptorSet 0
OpDecorate %t3d Binding 4
OpDecorate %sA DescriptorSet 0
OpDecorate %sA Binding 2
OpDecorate %48 RelaxedPrecision
OpDecorate %51 RelaxedPrecision
OpDecorate %sShadow DescriptorSet 0
OpDecorate %sShadow Binding 1
OpDecorate %i RelaxedPrecision
OpDecorate %i Flat
OpDecorate %i Location 0
OpDecorate %tex2D RelaxedPrecision
OpDecorate %tex2D DescriptorSet 0
OpDecorate %tex2D Binding 5
OpDecorate %texCube RelaxedPrecision
OpDecorate %texCube DescriptorSet 0
OpDecorate %texCube Binding 6
OpDecorate %tex2DArray DescriptorSet 0
OpDecorate %tex2DArray Binding 15
OpDecorate %itex2D DescriptorSet 0
OpDecorate %itex2D Binding 16
OpDecorate %itex3D DescriptorSet 0
OpDecorate %itex3D Binding 17
OpDecorate %itexCube DescriptorSet 0
OpDecorate %itexCube Binding 18
OpDecorate %itex2DArray DescriptorSet 0
OpDecorate %itex2DArray Binding 19
OpDecorate %utex2D DescriptorSet 0
OpDecorate %utex2D Binding 20
OpDecorate %utex3D DescriptorSet 0
OpDecorate %utex3D Binding 21
OpDecorate %utexCube DescriptorSet 0
OpDecorate %utexCube Binding 22
OpDecorate %utex2DArray DescriptorSet 0
OpDecorate %utex2DArray Binding 23
OpDecorate %tex3D DescriptorSet 0
OpDecorate %tex3D Binding 36
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%color = OpVariable %_ptr_Output_v4float Output
%10 = OpTypeImage %float 2D 0 0 0 1 Unknown
%11 = OpTypeSampledImage %10
%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
%t2d = OpVariable %_ptr_UniformConstant_11 UniformConstant
%15 = OpTypeSampler
%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
%s = OpVariable %_ptr_UniformConstant_15 UniformConstant
%v2float = OpTypeVector %float 2
%float_0_5 = OpConstant %float 0.5
%22 = OpConstantComposite %v2float %float_0_5 %float_0_5
%24 = OpTypeImage %float 3D 0 0 0 1 Unknown
%25 = OpTypeSampledImage %24
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_25_uint_4 = OpTypeArray %25 %uint_4
%_ptr_UniformConstant__arr_25_uint_4 = OpTypePointer UniformConstant %_arr_25_uint_4
%t3d = OpVariable %_ptr_UniformConstant__arr_25_uint_4 UniformConstant
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
%_arr_15_uint_4 = OpTypeArray %15 %uint_4
%_ptr_UniformConstant__arr_15_uint_4 = OpTypePointer UniformConstant %_arr_15_uint_4
%sA = OpVariable %_ptr_UniformConstant__arr_15_uint_4 UniformConstant
%int_2 = OpConstant %int 2
%v3float = OpTypeVector %float 3
%44 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
%sShadow = OpVariable %_ptr_UniformConstant_15 UniformConstant
%_ptr_Input_int = OpTypePointer Input %int
%i = OpVariable %_ptr_Input_int Input
%tex2D = OpVariable %_ptr_UniformConstant_11 UniformConstant
%58 = OpTypeImage %float Cube 0 0 0 1 Unknown
%59 = OpTypeSampledImage %58
%_ptr_UniformConstant_59 = OpTypePointer UniformConstant %59
%texCube = OpVariable %_ptr_UniformConstant_59 UniformConstant
%62 = OpTypeImage %float 2D 0 1 0 1 Unknown
%63 = OpTypeSampledImage %62
%_ptr_UniformConstant_63 = OpTypePointer UniformConstant %63
%tex2DArray = OpVariable %_ptr_UniformConstant_63 UniformConstant
%66 = OpTypeImage %int 2D 0 0 0 1 Unknown
%67 = OpTypeSampledImage %66
%_ptr_UniformConstant_67 = OpTypePointer UniformConstant %67
%itex2D = OpVariable %_ptr_UniformConstant_67 UniformConstant
%70 = OpTypeImage %int 3D 0 0 0 1 Unknown
%71 = OpTypeSampledImage %70
%_ptr_UniformConstant_71 = OpTypePointer UniformConstant %71
%itex3D = OpVariable %_ptr_UniformConstant_71 UniformConstant
%74 = OpTypeImage %int Cube 0 0 0 1 Unknown
%75 = OpTypeSampledImage %74
%_ptr_UniformConstant_75 = OpTypePointer UniformConstant %75
%itexCube = OpVariable %_ptr_UniformConstant_75 UniformConstant
%78 = OpTypeImage %int 2D 0 1 0 1 Unknown
%79 = OpTypeSampledImage %78
%_ptr_UniformConstant_79 = OpTypePointer UniformConstant %79
%itex2DArray = OpVariable %_ptr_UniformConstant_79 UniformConstant
%82 = OpTypeImage %uint 2D 0 0 0 1 Unknown
%83 = OpTypeSampledImage %82
%_ptr_UniformConstant_83 = OpTypePointer UniformConstant %83
%utex2D = OpVariable %_ptr_UniformConstant_83 UniformConstant
%86 = OpTypeImage %uint 3D 0 0 0 1 Unknown
%87 = OpTypeSampledImage %86
%_ptr_UniformConstant_87 = OpTypePointer UniformConstant %87
%utex3D = OpVariable %_ptr_UniformConstant_87 UniformConstant
%90 = OpTypeImage %uint Cube 0 0 0 1 Unknown
%91 = OpTypeSampledImage %90
%_ptr_UniformConstant_91 = OpTypePointer UniformConstant %91
%utexCube = OpVariable %_ptr_UniformConstant_91 UniformConstant
%94 = OpTypeImage %uint 2D 0 1 0 1 Unknown
%95 = OpTypeSampledImage %94
%_ptr_UniformConstant_95 = OpTypePointer UniformConstant %95
%utex2DArray = OpVariable %_ptr_UniformConstant_95 UniformConstant
%tex3D = OpVariable %_ptr_UniformConstant_25 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%14 = OpLoad %11 %t2d
%18 = OpLoad %15 %s
%19 = OpSampledImage %11 %14 %18
%23 = OpImageSampleImplicitLod %v4float %19 %22
OpStore %color %23
%34 = OpAccessChain %_ptr_UniformConstant_25 %t3d %int_1
%35 = OpLoad %25 %34
%40 = OpAccessChain %_ptr_UniformConstant_15 %sA %int_2
%41 = OpLoad %15 %40
%42 = OpSampledImage %25 %35 %41
%45 = OpImageSampleImplicitLod %v4float %42 %44
%46 = OpLoad %v4float %color
%47 = OpFAdd %v4float %46 %45
OpStore %color %47
%48 = OpLoad %11 %t2d
%49 = OpLoad %15 %s
%50 = OpSampledImage %11 %48 %49
%51 = OpImageSampleImplicitLod %v4float %50 %22
%52 = OpLoad %v4float %color
%53 = OpFAdd %v4float %52 %51
OpStore %color %53
OpReturn
OpFunctionEnd
#version 310 es
layout(local_size_x_id = 18, local_size_z_id = 19) in;
layout(local_size_x = 2) in;
layout(local_size_y = 5) in;
layout(local_size_z = 7) in;
const int total = gl_MaxComputeWorkGroupCount.x
+ gl_MaxComputeWorkGroupCount.y
+ gl_MaxComputeWorkGroupCount.z
+ gl_MaxComputeUniformComponents
+ gl_MaxComputeTextureImageUnits;
shared vec4 s[total];
int arrX[gl_WorkGroupSize.x];
int arrY[gl_WorkGroupSize.y];
int arrZ[gl_WorkGroupSize.z];
layout(binding = 0, set = 0) buffer bName {
int size;
uvec3 count;
vec4 data[];
} bInst;
void main()
{
barrier();
bInst.data[bInst.size / 2] *= vec4(7.0);
memoryBarrier();
groupMemoryBarrier();
memoryBarrierShared();
memoryBarrierBuffer();
s[3] = vec4(0, arrX[0], arrY[0], arrZ[0]);
bInst.count = gl_NumWorkGroups + gl_WorkGroupSize + gl_WorkGroupID + gl_LocalInvocationID +
gl_GlobalInvocationID * gl_LocalInvocationIndex;
atomicAdd(bInst.size, 2);
atomicMin(bInst.size, 2);
atomicMax(bInst.size, 2);
atomicAnd(bInst.size, 2);
atomicOr(bInst.size, 2);
atomicXor(bInst.size, 2);
atomicExchange(bInst.size, 2);
atomicCompSwap(bInst.size, 5, 2);
}
#version 310 es
precision highp sampler;
precision highp samplerShadow;
precision highp texture2DArray;
precision highp itexture2D;
precision highp itexture3D;
precision highp itextureCube;
precision highp itexture2DArray;
precision highp utexture2D;
precision highp utexture3D;
precision highp utextureCube;
precision highp utexture2DArray;
precision highp texture3D;
precision highp float;
layout(binding = 0) uniform sampler s;
layout(binding = 1) uniform samplerShadow sShadow;
layout(binding = 2) uniform sampler sA[4];
layout(binding = 3) uniform texture2D t2d;
layout(binding = 4) uniform texture3D t3d[4];
layout(location = 0) flat in int i;
layout(location = 0) out vec4 color;
void main()
{
color = texture(sampler2D(t2d, s), vec2(0.5));
color += texture(sampler3D(t3d[1], sA[2]), vec3(0.5));
color += texture(sampler2D(t2d, s), vec2(0.5));
}
layout(binding = 5) uniform texture2D tex2D;
layout(binding = 6) uniform textureCube texCube;
layout(binding = 15) uniform texture2DArray tex2DArray;
layout(binding = 16) uniform itexture2D itex2D;
layout(binding = 17) uniform itexture3D itex3D;
layout(binding = 18) uniform itextureCube itexCube;
layout(binding = 19) uniform itexture2DArray itex2DArray;
layout(binding = 20) uniform utexture2D utex2D;
layout(binding = 21) uniform utexture3D utex3D;
layout(binding = 22) uniform utextureCube utexCube;
layout(binding = 23) uniform utexture2DArray utex2DArray;
layout(binding = 36) uniform texture3D tex3D;
void foo()
{
sampler2D (tex2D, s);
samplerCube (texCube, s);
samplerCubeShadow (texCube, sShadow);
sampler2DArray (tex2DArray, s);
sampler2DArrayShadow (tex2DArray, sShadow);
isampler2D (itex2D, s);
isampler3D (itex3D, s);
isamplerCube (itexCube, s);
isampler2DArray (itex2DArray, s);
usampler2D (utex2D, s);
usampler3D (utex3D, s);
usamplerCube (utexCube, s);
usampler2DArray (utex2DArray, s);
sampler3D (tex3D, s);
sampler2DShadow (tex2D, sShadow);
}
......@@ -5,3 +5,5 @@ web.controlFlow.frag
web.operations.frag
web.texture.frag
web.array.frag
web.separate.frag
web.comp
......@@ -79,6 +79,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool ms : 1;
bool image : 1; // image, combined should be false
bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler
bool sampler : 1; // true means a pure sampler, other fields should be clear()
#ifdef ENABLE_HLSL
unsigned int vectorSize : 3; // vector return type size.
unsigned int getVectorSize() const { return vectorSize; }
......@@ -105,8 +106,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isRect() const { return false; }
bool isSubpass() const { return false; }
bool isCombined() const { return true; }
bool isPureSampler() const { return false; }
bool isTexture() const { return false; }
bool isImage() const { return false; }
bool isImageClass() const { return false; }
bool isMultiSample() const { return false; }
......@@ -114,7 +113,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
void setExternal(bool e) { }
bool isYuv() const { return false; }
#else
bool sampler : 1; // true means a pure sampler, other fields should be clear()
bool external : 1; // GL_OES_EGL_image_external
bool yuv : 1; // GL_EXT_YUV_target
// Some languages support structures as sample results. Storing the whole structure in the
......@@ -125,8 +123,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isRect() const { return dim == EsdRect; }
bool isSubpass() const { return dim == EsdSubpass; }
bool isCombined() const { return combined; }
bool isPureSampler() const { return sampler; }
bool isTexture() const { return !sampler && !image; }
bool isImage() const { return image && !isSubpass(); }
bool isImageClass() const { return image; }
bool isMultiSample() const { return ms; }
......@@ -134,6 +130,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
void setExternal(bool e) { external = e; }
bool isYuv() const { return yuv; }
#endif
bool isTexture() const { return !sampler && !image; }
bool isPureSampler() const { return sampler; }
void setCombined(bool c) { combined = c; }
void setBasicType(TBasicType t) { type = t; }
TBasicType getBasicType() const { return type; }
......@@ -149,8 +148,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
ms = false;
image = false;
combined = false;
#ifndef GLSLANG_WEB
sampler = false;
#ifndef GLSLANG_WEB
external = false;
yuv = false;
#endif
......@@ -197,6 +196,14 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
ms = m;
}
// make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword
void setPureSampler(bool s)
{
clear();
sampler = true;
shadow = s;
}
#ifndef GLSLANG_WEB
// make a subpass input attachment
void setSubpass(TBasicType t, bool m = false)
......@@ -207,14 +214,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
dim = EsdSubpass;
ms = m;
}
// make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword
void setPureSampler(bool s)
{
clear();
sampler = true;
shadow = s;
}
#endif
bool operator==(const TSampler& right) const
......@@ -529,6 +528,7 @@ public:
void clearMemory()
{
#ifndef GLSLANG_WEB
coherent = false;
devicecoherent = false;
queuefamilycoherent = false;
......@@ -539,6 +539,7 @@ public:
restrict = false;
readonly = false;
writeonly = false;
#endif
}
const char* semanticName;
......@@ -551,16 +552,6 @@ public:
bool centroid : 1;
bool smooth : 1;
bool flat : 1;
bool coherent : 1;
bool devicecoherent : 1;
bool queuefamilycoherent : 1;
bool workgroupcoherent : 1;
bool subgroupcoherent : 1;
bool nonprivate : 1;
bool volatil : 1;
bool restrict : 1;
bool readonly : 1;
bool writeonly : 1;
// having a constant_id is not sufficient: expressions have no id, but are still specConstant
bool specConstant : 1;
bool nonUniform : 1;
......@@ -568,6 +559,9 @@ public:
#ifdef GLSLANG_WEB
bool isWriteOnly() const { return false; }
bool isReadOnly() const { return false; }
bool isRestrict() const { return false; }
bool isCoherent() const { return false; }
bool isVolatile() const { return false; }
bool isSample() const { return false; }
bool isMemory() const { return false; }
bool isMemoryQualifierImageAndSSBOOnly() const { return false; }
......@@ -589,8 +583,21 @@ public:
bool perTaskNV : 1;
bool patch : 1;
bool sample : 1;
bool restrict : 1;
bool readonly : 1;
bool writeonly : 1;
bool coherent : 1;
bool volatil : 1;
bool devicecoherent : 1;
bool queuefamilycoherent : 1;
bool workgroupcoherent : 1;
bool subgroupcoherent : 1;
bool nonprivate : 1;
bool isWriteOnly() const { return writeonly; }
bool isReadOnly() const { return readonly; }
bool isRestrict() const { return restrict; }
bool isCoherent() const { return coherent; }
bool isVolatile() const { return volatil; }
bool isSample() const { return sample; }
bool isMemory() const
{
......@@ -781,8 +788,8 @@ public:
{
layoutLocation = layoutLocationEnd;
layoutComponent = layoutComponentEnd;
layoutIndex = layoutIndexEnd;
#ifndef GLSLANG_WEB
layoutIndex = layoutIndexEnd;
clearStreamLayout();
clearXfbLayout();
#endif
......@@ -887,7 +894,9 @@ public:
layoutSet = layoutSetEnd;
layoutBinding = layoutBindingEnd;
#ifndef GLSLANG_WEB
layoutAttachment = layoutAttachmentEnd;
#endif
}
bool hasMatrix() const
......@@ -924,6 +933,7 @@ public:
bool hasOffset() const { return false; }
bool isNonPerspective() const { return false; }
bool hasIndex() const { return false; }
unsigned getIndex() const { return 0; }
bool hasComponent() const { return false; }
bool hasStream() const { return false; }
bool hasFormat() const { return false; }
......@@ -948,6 +958,7 @@ public:
{
return layoutIndex != layoutIndexEnd;
}
unsigned getIndex() const { return layoutIndex; }
bool hasComponent() const
{
return layoutComponent != layoutComponentEnd;
......@@ -1922,6 +1933,7 @@ public:
case EbtFloat: return "float";
case EbtInt: return "int";
case EbtUint: return "uint";
case EbtSampler: return "sampler/image";
#ifndef GLSLANG_WEB
case EbtVoid: return "void";
case EbtDouble: return "double";
......@@ -1934,7 +1946,6 @@ public:
case EbtUint64: return "uint64_t";
case EbtBool: return "bool";
case EbtAtomicUint: return "atomic_uint";
case EbtSampler: return "sampler/image";
case EbtStruct: return "structure";
case EbtBlock: return "block";
case EbtAccStructNV: return "accelerationStructureNV";
......
......@@ -1310,11 +1310,13 @@ public:
bool isSparseTexture() const { return false; }
bool isImageFootprint() const { return false; }
bool isSparseImage() const { return false; }
bool isSubgroup() const { return false; }
#else
bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; }
bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; }
bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
bool isSparseImage() const { return op == EOpSparseImageLoad; }
bool isSubgroup() const { return op > EOpSubgroupGuardStart && op < EOpSubgroupGuardStop; }
#endif
void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
......
......@@ -801,10 +801,8 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
//
// Add a new newNode for the conversion.
//
TIntermUnary* newNode = nullptr;
TOperator newOp = EOpNull;
#ifndef GLSLANG_WEB
bool convertToIntTypes = (convertTo == EbtInt8 || convertTo == EbtUint8 ||
convertTo == EbtInt16 || convertTo == EbtUint16 ||
convertTo == EbtInt || convertTo == EbtUint ||
......@@ -838,7 +836,10 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
(node->getBasicType() == EbtFloat16 && ! convertToFloatTypes))
return nullptr;
}
#endif
TIntermUnary* newNode = nullptr;
TOperator newOp = EOpNull;
if (!buildConvertOp(convertTo, node->getBasicType(), newOp)) {
return nullptr;
}
......@@ -847,11 +848,14 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
newNode = addUnaryNode(newOp, node, node->getLoc(), newType);
if (node->getAsConstantUnion()) {
#ifndef GLSLANG_WEB
// 8/16-bit storage extensions don't support 8/16-bit constants, so don't fold conversions
// to those types
if ((getArithemeticInt8Enabled() || !(convertTo == EbtInt8 || convertTo == EbtUint8)) &&
(getArithemeticInt16Enabled() || !(convertTo == EbtInt16 || convertTo == EbtUint16)) &&
(getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16))) {
(getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16)))
#endif
{
TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType);
if (folded)
return folded;
......
......@@ -343,6 +343,7 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["const"] = CONST;
(*KeywordMap)["uniform"] = UNIFORM;
(*KeywordMap)["buffer"] = BUFFER;
(*KeywordMap)["in"] = IN;
(*KeywordMap)["out"] = OUT;
(*KeywordMap)["smooth"] = SMOOTH;
......@@ -410,7 +411,6 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["attribute"] = ATTRIBUTE;
(*KeywordMap)["varying"] = VARYING;
(*KeywordMap)["noperspective"] = NOPERSPECTIVE;
(*KeywordMap)["buffer"] = BUFFER;
(*KeywordMap)["coherent"] = COHERENT;
(*KeywordMap)["devicecoherent"] = DEVICECOHERENT;
(*KeywordMap)["queuefamilycoherent"] = QUEUEFAMILYCOHERENT;
......@@ -564,10 +564,6 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["sampler2D"] = SAMPLER2D;
(*KeywordMap)["samplerCube"] = SAMPLERCUBE;
(*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY;
(*KeywordMap)["samplerCubeArrayShadow"] = SAMPLERCUBEARRAYSHADOW;
(*KeywordMap)["isamplerCubeArray"] = ISAMPLERCUBEARRAY;
(*KeywordMap)["usamplerCubeArray"] = USAMPLERCUBEARRAY;
(*KeywordMap)["samplerCubeShadow"] = SAMPLERCUBESHADOW;
(*KeywordMap)["sampler2DArray"] = SAMPLER2DARRAY;
(*KeywordMap)["sampler2DArrayShadow"] = SAMPLER2DARRAYSHADOW;
......@@ -582,7 +578,30 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["sampler3D"] = SAMPLER3D;
(*KeywordMap)["sampler2DShadow"] = SAMPLER2DSHADOW;
(*KeywordMap)["texture2D"] = TEXTURE2D;
(*KeywordMap)["textureCube"] = TEXTURECUBE;
(*KeywordMap)["texture2DArray"] = TEXTURE2DARRAY;
(*KeywordMap)["itexture2D"] = ITEXTURE2D;
(*KeywordMap)["itexture3D"] = ITEXTURE3D;
(*KeywordMap)["itextureCube"] = ITEXTURECUBE;
(*KeywordMap)["itexture2DArray"] = ITEXTURE2DARRAY;
(*KeywordMap)["utexture2D"] = UTEXTURE2D;
(*KeywordMap)["utexture3D"] = UTEXTURE3D;
(*KeywordMap)["utextureCube"] = UTEXTURECUBE;
(*KeywordMap)["utexture2DArray"] = UTEXTURE2DARRAY;
(*KeywordMap)["texture3D"] = TEXTURE3D;
(*KeywordMap)["sampler"] = SAMPLER;
(*KeywordMap)["samplerShadow"] = SAMPLERSHADOW;
#ifndef GLSLANG_WEB
(*KeywordMap)["textureCubeArray"] = TEXTURECUBEARRAY;
(*KeywordMap)["itextureCubeArray"] = ITEXTURECUBEARRAY;
(*KeywordMap)["utextureCubeArray"] = UTEXTURECUBEARRAY;
(*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY;
(*KeywordMap)["samplerCubeArrayShadow"] = SAMPLERCUBEARRAYSHADOW;
(*KeywordMap)["isamplerCubeArray"] = ISAMPLERCUBEARRAY;
(*KeywordMap)["usamplerCubeArray"] = USAMPLERCUBEARRAY;
(*KeywordMap)["sampler1DArrayShadow"] = SAMPLER1DARRAYSHADOW;
(*KeywordMap)["isampler1DArray"] = ISAMPLER1DARRAY;
(*KeywordMap)["usampler1D"] = USAMPLER1D;
......@@ -609,28 +628,11 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["__samplerExternal2DY2YEXT"] = SAMPLEREXTERNAL2DY2YEXT; // GL_EXT_YUV_target
(*KeywordMap)["sampler"] = SAMPLER;
(*KeywordMap)["samplerShadow"] = SAMPLERSHADOW;
(*KeywordMap)["texture2D"] = TEXTURE2D;
(*KeywordMap)["textureCube"] = TEXTURECUBE;
(*KeywordMap)["textureCubeArray"] = TEXTURECUBEARRAY;
(*KeywordMap)["itextureCubeArray"] = ITEXTURECUBEARRAY;
(*KeywordMap)["utextureCubeArray"] = UTEXTURECUBEARRAY;
(*KeywordMap)["itexture1DArray"] = ITEXTURE1DARRAY;
(*KeywordMap)["utexture1D"] = UTEXTURE1D;
(*KeywordMap)["itexture1D"] = ITEXTURE1D;
(*KeywordMap)["utexture1DArray"] = UTEXTURE1DARRAY;
(*KeywordMap)["textureBuffer"] = TEXTUREBUFFER;
(*KeywordMap)["texture2DArray"] = TEXTURE2DARRAY;
(*KeywordMap)["itexture2D"] = ITEXTURE2D;
(*KeywordMap)["itexture3D"] = ITEXTURE3D;
(*KeywordMap)["itextureCube"] = ITEXTURECUBE;
(*KeywordMap)["itexture2DArray"] = ITEXTURE2DARRAY;
(*KeywordMap)["utexture2D"] = UTEXTURE2D;
(*KeywordMap)["utexture3D"] = UTEXTURE3D;
(*KeywordMap)["utextureCube"] = UTEXTURECUBE;
(*KeywordMap)["utexture2DArray"] = UTEXTURE2DARRAY;
(*KeywordMap)["itexture2DRect"] = ITEXTURE2DRECT;
(*KeywordMap)["utexture2DRect"] = UTEXTURE2DRECT;
(*KeywordMap)["itextureBuffer"] = ITEXTUREBUFFER;
......@@ -642,7 +644,6 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["itexture2DMSArray"] = ITEXTURE2DMSARRAY;
(*KeywordMap)["utexture2DMSArray"] = UTEXTURE2DMSARRAY;
(*KeywordMap)["texture1D"] = TEXTURE1D;
(*KeywordMap)["texture3D"] = TEXTURE3D;
(*KeywordMap)["texture2DRect"] = TEXTURE2DRECT;
(*KeywordMap)["texture1DArray"] = TEXTURE1DARRAY;
......@@ -904,6 +905,13 @@ int TScanContext::tokenizeIdentifier()
case CASE:
return keyword;
case BUFFER:
afterBuffer = true;
if ((parseContext.isEsProfile() && parseContext.version < 310) ||
(!parseContext.isEsProfile() && parseContext.version < 430))
return identifierOrType();
return keyword;
case STRUCT:
afterStruct = true;
return keyword;
......@@ -997,12 +1005,6 @@ int TScanContext::tokenizeIdentifier()
if (parseContext.isEsProfile() && parseContext.version >= 300)
reservedWord();
return keyword;
case BUFFER:
afterBuffer = true;
if ((parseContext.isEsProfile() && parseContext.version < 310) ||
(!parseContext.isEsProfile() && parseContext.version < 430))
return identifierOrType();
return keyword;
case PAYLOADNV:
case PAYLOADINNV:
case HITATTRNV:
......@@ -1057,13 +1059,12 @@ int TScanContext::tokenizeIdentifier()
case SUBROUTINE:
return es30ReservedFromGLSL(400);
#endif
case SHARED:
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
(!parseContext.isEsProfile() && parseContext.version < 140))
return identifierOrType();
return keyword;
#endif
case LAYOUT:
{
const int numLayoutExts = 2;
......@@ -1321,7 +1322,6 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
#endif
case SAMPLERCUBEARRAY:
case SAMPLERCUBEARRAYSHADOW:
......@@ -1335,6 +1335,15 @@ int TScanContext::tokenizeIdentifier()
reservedWord();
return keyword;
case TEXTURECUBEARRAY:
case ITEXTURECUBEARRAY:
case UTEXTURECUBEARRAY:
if (parseContext.spvVersion.vulkan > 0)
return keyword;
else
return identifierOrType();
#endif
case UINT:
case UVEC2:
case UVEC3:
......@@ -1369,6 +1378,25 @@ int TScanContext::tokenizeIdentifier()
}
return keyword;
case TEXTURE2D:
case TEXTURECUBE:
case TEXTURE2DARRAY:
case ITEXTURE2D:
case ITEXTURE3D:
case ITEXTURECUBE:
case ITEXTURE2DARRAY:
case UTEXTURE2D:
case UTEXTURE3D:
case UTEXTURECUBE:
case UTEXTURE2DARRAY:
case TEXTURE3D:
case SAMPLER:
case SAMPLERSHADOW:
if (parseContext.spvVersion.vulkan > 0)
return keyword;
else
return identifierOrType();
#ifndef GLSLANG_WEB
case ISAMPLER1D:
case ISAMPLER1DARRAY:
......@@ -1458,25 +1486,11 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
case TEXTURE2D:
case TEXTURECUBE:
case TEXTURECUBEARRAY:
case ITEXTURECUBEARRAY:
case UTEXTURECUBEARRAY:
case ITEXTURE1DARRAY:
case UTEXTURE1D:
case ITEXTURE1D:
case UTEXTURE1DARRAY:
case TEXTUREBUFFER:
case TEXTURE2DARRAY:
case ITEXTURE2D:
case ITEXTURE3D:
case ITEXTURECUBE:
case ITEXTURE2DARRAY:
case UTEXTURE2D:
case UTEXTURE3D:
case UTEXTURECUBE:
case UTEXTURE2DARRAY:
case ITEXTURE2DRECT:
case UTEXTURE2DRECT:
case ITEXTUREBUFFER:
......@@ -1488,11 +1502,8 @@ int TScanContext::tokenizeIdentifier()
case ITEXTURE2DMSARRAY:
case UTEXTURE2DMSARRAY:
case TEXTURE1D:
case TEXTURE3D:
case TEXTURE2DRECT:
case TEXTURE1DARRAY:
case SAMPLER:
case SAMPLERSHADOW:
if (parseContext.spvVersion.vulkan > 0)
return keyword;
else
......
......@@ -288,6 +288,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
TSymbolTable** symbolTables)
{
#ifdef GLSLANG_WEB
profile = EEsProfile;
version = 310;
#endif
(*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source,
infoSink, *symbolTables[language]);
......@@ -304,6 +309,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
//
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
{
#ifdef GLSLANG_WEB
profile = EEsProfile;
version = 310;
#endif
std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
if (builtInParseables == nullptr)
......@@ -341,6 +351,7 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
(profile == EEsProfile && version >= 310))
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source,
infoSink, commonTable, symbolTables);
#endif
// check for compute
if ((profile != EEsProfile && version >= 420) ||
......@@ -375,7 +386,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
(profile == EEsProfile && version >= 320))
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTaskNV, source,
infoSink, commonTable, symbolTables);
#endif
return true;
}
......@@ -871,6 +881,11 @@ bool ProcessDeferred(
bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
versionNotFirst, defaultVersion, source, version, profile, spvVersion);
#ifdef GLSLANG_WEB
profile = EEsProfile;
version = 310;
#endif
bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
#ifndef GLSLANG_WEB
bool warnVersionNotFirst = false;
......
......@@ -527,11 +527,11 @@ const char* StageName(EShLanguage stage)
switch(stage) {
case EShLangVertex: return "vertex";
case EShLangFragment: return "fragment";
case EShLangCompute: return "compute";
#ifndef GLSLANG_WEB
case EShLangTessControl: return "tessellation control";
case EShLangTessEvaluation: return "tessellation evaluation";
case EShLangGeometry: return "geometry";
case EShLangCompute: return "compute";
case EShLangRayGenNV: return "ray-generation";
case EShLangIntersectNV: return "intersection";
case EShLangAnyHitNV: return "any-hit";
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -496,6 +496,7 @@ void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
//
void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, bool crossStage)
{
#ifndef GLSLANG_WEB
bool writeTypeComparison = false;
// Types have to match
......@@ -546,7 +547,6 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
writeTypeComparison = true;
}
#ifndef GLSLANG_WEB
// Memory...
if (symbol.getQualifier().coherent != unitSymbol.getQualifier().coherent ||
symbol.getQualifier().devicecoherent != unitSymbol.getQualifier().devicecoherent ||
......@@ -561,7 +561,6 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
error(infoSink, "Memory qualifiers must match:");
writeTypeComparison = true;
}
#endif
// Layouts...
// TODO: 4.4 enhanced layouts: Generalize to include offset/align: current spec
......@@ -591,6 +590,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
if (writeTypeComparison)
infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus \"" <<
unitSymbol.getType().getCompleteString() << "\"\n";
#endif
}
//
......@@ -1095,7 +1095,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
}
// combine location and component ranges
TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.layoutIndex : 0);
TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.getIndex() : 0);
// check for collisions, except for vertex inputs on desktop targeting OpenGL
if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
......
......@@ -147,6 +147,7 @@ struct TOffsetRange {
TRange offset;
};
#ifndef GLSLANG_WEB
// Things that need to be tracked per xfb buffer.
struct TXfbBuffer {
TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false),
......@@ -158,6 +159,7 @@ struct TXfbBuffer {
bool contains32BitType;
bool contains16BitType;
};
#endif
// Track a set of strings describing how the module was processed.
// Using the form:
......@@ -267,7 +269,6 @@ public:
uniformLocationBase(0)
#endif
{
#ifndef GLSLANG_WEB
localSize[0] = 1;
localSize[1] = 1;
localSize[2] = 1;
......@@ -277,6 +278,7 @@ public:
localSizeSpecId[0] = TQualifier::layoutNotSet;
localSizeSpecId[1] = TQualifier::layoutNotSet;
localSizeSpecId[2] = TQualifier::layoutNotSet;
#ifndef GLSLANG_WEB
xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
shiftBinding.fill(0);
#endif
......@@ -465,7 +467,23 @@ public:
bool usingStorageBuffer() const { return useStorageBuffer; }
void setDepthReplacing() { depthReplacing = true; }
bool isDepthReplacing() const { return depthReplacing; }
bool setLocalSize(int dim, int size)
{
if (localSizeNotDefault[dim])
return size == localSize[dim];
localSizeNotDefault[dim] = true;
localSize[dim] = size;
return true;
}
unsigned int getLocalSize(int dim) const { return localSize[dim]; }
bool setLocalSizeSpecId(int dim, int id)
{
if (localSizeSpecId[dim] != TQualifier::layoutNotSet)
return id == localSizeSpecId[dim];
localSizeSpecId[dim] = id;
return true;
}
int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; }
#ifdef GLSLANG_WEB
void output(TInfoSink&, bool tree) { }
......@@ -492,6 +510,7 @@ public:
bool usingVariablePointers() const { return false; }
unsigned getXfbStride(int buffer) const { return 0; }
bool hasLayoutDerivativeModeNone() const { return false; }
ComputeDerivativeMode getLayoutDerivativeModeNone() const { return LayoutDerivativeNone; }
#else
void output(TInfoSink&, bool tree);
......@@ -655,24 +674,6 @@ public:
}
TInterlockOrdering getInterlockOrdering() const { return interlockOrdering; }
bool setLocalSize(int dim, int size)
{
if (localSizeNotDefault[dim])
return size == localSize[dim];
localSizeNotDefault[dim] = true;
localSize[dim] = size;
return true;
}
unsigned int getLocalSize(int dim) const { return localSize[dim]; }
bool setLocalSizeSpecId(int dim, int id)
{
if (localSizeSpecId[dim] != TQualifier::layoutNotSet)
return id == localSizeSpecId[dim];
localSizeSpecId[dim] = id;
return true;
}
int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; }
void setXfbMode() { xfbMode = true; }
bool getXfbMode() const { return xfbMode; }
void setMultiStream() { multiStream = true; }
......@@ -757,7 +758,7 @@ public:
void setBinaryDoubleOutput() { binaryDoubleOutput = true; }
bool getBinaryDoubleOutput() { return binaryDoubleOutput; }
#endif
#endif // GLSLANG_WEB
#ifdef ENABLE_HLSL
void setHlslFunctionality1() { hlslFunctionality1 = true; }
......@@ -920,6 +921,9 @@ protected:
bool useStorageBuffer;
bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN
bool depthReplacing;
int localSize[3];
bool localSizeNotDefault[3];
int localSizeSpecId[3];
#ifndef GLSLANG_WEB
bool useVulkanMemoryModel;
int invocations;
......@@ -932,9 +936,6 @@ protected:
TVertexOrder vertexOrder;
TInterlockOrdering interlockOrdering;
bool pointMode;
int localSize[3];
bool localSizeNotDefault[3];
int localSizeSpecId[3];
bool earlyFragmentTests;
bool postDepthCoverage;
TLayoutDepth depthLayout;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment