From 48edadfd247ca02a9647121496a63f2cf0fa2ece Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Thu, 31 Dec 2015 16:11:41 +0800 Subject: [PATCH 01/24] Parser & SPV: Implement two extensions regarding GLSL sparse texture. Implement extension "GL_ARB_sparse_texture2". Implement extension "GL_ARB_sparse_texture_clamp". --- SPIRV/GlslangToSpv.cpp | 82 ++- SPIRV/SpvBuilder.cpp | 84 ++- SPIRV/SpvBuilder.h | 4 +- Test/baseResults/spv.sparseTexture.frag.out | 522 ++++++++++++++++++ .../spv.sparseTextureClamp.frag.out | 456 +++++++++++++++ Test/spv.sparseTexture.frag | 80 +++ Test/spv.sparseTextureClamp.frag | 70 +++ Test/test-spirv-list | 2 + glslang/Include/intermediate.h | 63 +++ glslang/MachineIndependent/Initialize.cpp | 403 +++++++++----- glslang/MachineIndependent/Versions.cpp | 4 + glslang/MachineIndependent/Versions.h | 2 + 12 files changed, 1621 insertions(+), 151 deletions(-) create mode 100644 Test/baseResults/spv.sparseTexture.frag.out create mode 100644 Test/baseResults/spv.sparseTextureClamp.frag.out create mode 100644 Test/spv.sparseTexture.frag create mode 100644 Test/spv.sparseTextureClamp.frag diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 964ff09e..1b565764 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1884,6 +1884,14 @@ void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments) { const glslang::TIntermSequence& glslangArguments = node.getSequence(); + + glslang::TSampler sampler = {}; + bool cubeCompare = false; + if (node.isTexture()) { + sampler = glslangArguments[0]->getAsTyped()->getType().getSampler(); + cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; + } + for (int i = 0; i < (int)glslangArguments.size(); ++i) { builder.clearAccessChain(); glslangArguments[i]->traverse(this); @@ -1902,6 +1910,51 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if (i == 0) lvalue = true; break; + case glslang::EOpSparseTexture: + if ((cubeCompare && i == 3) || (! cubeCompare && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureClamp: + if ((cubeCompare && i == 4) || (! cubeCompare && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureLod: + case glslang::EOpSparseTextureOffset: + if (i == 3) + lvalue = true; + break; + case glslang::EOpSparseTextureFetch: + if ((sampler.dim != glslang::EsdRect && i == 3) || (sampler.dim == glslang::EsdRect && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureFetchOffset: + if ((sampler.dim != glslang::EsdRect && i == 4) || (sampler.dim == glslang::EsdRect && i == 3)) + lvalue = true; + break; + case glslang::EOpSparseTextureLodOffset: + case glslang::EOpSparseTextureGrad: + case glslang::EOpSparseTextureOffsetClamp: + if (i == 4) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffset: + case glslang::EOpSparseTextureGradClamp: + if (i == 5) + lvalue = true; + break; + case glslang::EOpSparseTextureGradOffsetClamp: + if (i == 6) + lvalue = true; + break; + case glslang::EOpSparseTextureGather: + if ((sampler.shadow && i == 3) || (! sampler.shadow && i == 2)) + lvalue = true; + break; + case glslang::EOpSparseTextureGatherOffset: + case glslang::EOpSparseTextureGatherOffsets: + if ((sampler.shadow && i == 4) || (! sampler.shadow && i == 3)) + lvalue = true; + break; default: break; } @@ -1963,6 +2016,8 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO return builder.createTextureQueryCall(spv::OpImageQueryLod, params); case glslang::EOpTextureQueryLevels: return builder.createTextureQueryCall(spv::OpImageQueryLevels, params); + case glslang::EOpSparseTexelsResident: + return builder.createUnaryOp(spv::OpImageSparseTexelsResident, builder.makeBoolType(), arguments[0]); default: assert(0); break; @@ -1990,7 +2045,11 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO operands.push_back(*opIt); builder.createNoResultOp(spv::OpImageWrite, operands); return spv::NoResult; - } else { + } else if (node->isSparseImage()) { + spv::MissingFunctionality("sparse image functions"); + return spv::NoResult; + } + else { // Process image atomic operations // GLSL "IMAGE_PARAMS" will involve in constructing an image texel pointer and this pointer, @@ -2010,7 +2069,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } // Check for texture functions other than queries - + bool sparse = node->isSparseTexture(); bool cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; // check for bias argument @@ -2021,6 +2080,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO ++nonBiasArgCount; if (cracked.grad) nonBiasArgCount += 2; + if (cracked.lodClamp) + ++nonBiasArgCount; + if (sparse) + ++nonBiasArgCount; if ((int)arguments.size() > nonBiasArgCount) bias = true; @@ -2032,9 +2095,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO int extraArgs = 0; // sort out where Dref is coming from - if (sampler.shadow && sampler.dim == glslang::EsdCube && sampler.arrayed) + if (cubeCompare) { params.Dref = arguments[2]; - else if (sampler.shadow && cracked.gather) { + ++extraArgs; + } else if (sampler.shadow && cracked.gather) { params.Dref = arguments[2]; ++extraArgs; } else if (sampler.shadow) { @@ -2066,6 +2130,14 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO params.offsets = arguments[2 + extraArgs]; ++extraArgs; } + if (cracked.lodClamp) { + params.lodClamp = arguments[2 + extraArgs]; + ++extraArgs; + } + if (sparse) { + params.texelOut = arguments[2 + extraArgs]; + ++extraArgs; + } if (bias) { params.bias = arguments[2 + extraArgs]; ++extraArgs; @@ -2080,7 +2152,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } } - return builder.createTextureCall(precision, convertGlslangToSpvType(node->getType()), cracked.fetch, cracked.proj, cracked.gather, params); + return builder.createTextureCall(precision, convertGlslangToSpvType(node->getType()), sparse, cracked.fetch, cracked.proj, cracked.gather, params); } spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAggregate* node) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 3915b66e..4e0c2e80 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1222,7 +1222,7 @@ Id Builder::createBuiltinCall(Decoration /*precision*/, Id resultType, Id builti // Accept all parameters needed to create a texture instruction. // Create the correct instruction based on the inputs, and make the call. -Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, bool proj, bool gather, const TextureParameters& parameters) +Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, const TextureParameters& parameters) { static const int maxTextureArgs = 10; Id texArgs[maxTextureArgs] = {}; @@ -1275,6 +1275,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask); texArgs[numArgs++] = parameters.sample; } + if (parameters.lodClamp) { + mask = (ImageOperandsMask)(mask | ImageOperandsMinLodMask); + texArgs[numArgs++] = parameters.lodClamp; + } if (mask == ImageOperandsMaskNone) --numArgs; // undo speculative reservation for the mask argument else @@ -1286,35 +1290,68 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b Op opCode; opCode = OpImageSampleImplicitLod; if (fetch) { - opCode = OpImageFetch; + if (sparse) + opCode = OpImageSparseFetch; + else + opCode = OpImageFetch; } else if (gather) { if (parameters.Dref) - opCode = OpImageDrefGather; + if (sparse) + opCode = OpImageSparseDrefGather; + else + opCode = OpImageDrefGather; else - opCode = OpImageGather; + if (sparse) + opCode = OpImageSparseGather; + else + opCode = OpImageGather; } else if (xplicit) { if (parameters.Dref) { if (proj) - opCode = OpImageSampleProjDrefExplicitLod; + if (sparse) + opCode = OpImageSparseSampleProjDrefExplicitLod; + else + opCode = OpImageSampleProjDrefExplicitLod; else - opCode = OpImageSampleDrefExplicitLod; + if (sparse) + opCode = OpImageSparseSampleDrefExplicitLod; + else + opCode = OpImageSampleDrefExplicitLod; } else { if (proj) - opCode = OpImageSampleProjExplicitLod; + if (sparse) + opCode = OpImageSparseSampleProjExplicitLod; + else + opCode = OpImageSampleProjExplicitLod; else - opCode = OpImageSampleExplicitLod; + if (sparse) + opCode = OpImageSparseSampleExplicitLod; + else + opCode = OpImageSampleExplicitLod; } } else { if (parameters.Dref) { if (proj) - opCode = OpImageSampleProjDrefImplicitLod; + if (sparse) + opCode = OpImageSparseSampleProjDrefImplicitLod; + else + opCode = OpImageSampleProjDrefImplicitLod; else - opCode = OpImageSampleDrefImplicitLod; + if (sparse) + opCode = OpImageSparseSampleDrefImplicitLod; + else + opCode = OpImageSampleDrefImplicitLod; } else { if (proj) - opCode = OpImageSampleProjImplicitLod; + if (sparse) + opCode = OpImageSparseSampleProjImplicitLod; + else + opCode = OpImageSampleProjImplicitLod; else - opCode = OpImageSampleImplicitLod; + if (sparse) + opCode = OpImageSparseSampleImplicitLod; + else + opCode = OpImageSampleImplicitLod; } } @@ -1335,6 +1372,15 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b } } + Id typeId0 = 0; + Id typeId1 = 0; + + if (sparse) { + typeId0 = resultType; + typeId1 = getDerefTypeId(parameters.texelOut); + resultType = makeStructResultType(typeId0, typeId1); + } + // Build the SPIR-V instruction Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode); for (int op = 0; op < optArgNum; ++op) @@ -1348,10 +1394,16 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b Id resultId = textureInst->getResultId(); - // When a smear is needed, do it, as per what was computed - // above when resultType was changed to a scalar type. - if (resultType != smearedType) - resultId = smearScalar(precision, resultId, smearedType); + if (sparse) { + // Decode the return type that was a special structure + createStore(createCompositeExtract(resultId, typeId1, 1), parameters.texelOut); + resultId = createCompositeExtract(resultId, typeId0, 0); + } else { + // When a smear is needed, do it, as per what was computed + // above when resultType was changed to a scalar type. + if (resultType != smearedType) + resultId = smearScalar(precision, resultId, smearedType); + } return resultId; } diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index 7bf43962..07c858c6 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -310,10 +310,12 @@ public: Id gradY; Id sample; Id comp; + Id texelOut; + Id lodClamp; }; // Select the correct texture operation based on all inputs, and emit the correct instruction - Id createTextureCall(Decoration precision, Id resultType, bool fetch, bool proj, bool gather, const TextureParameters&); + Id createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, const TextureParameters&); // Emit the OpTextureQuery* instruction that was passed in. // Figure out the right return value and type, and return it. diff --git a/Test/baseResults/spv.sparseTexture.frag.out b/Test/baseResults/spv.sparseTexture.frag.out new file mode 100644 index 00000000..24209e08 --- /dev/null +++ b/Test/baseResults/spv.sparseTexture.frag.out @@ -0,0 +1,522 @@ +spv.sparseTexture.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 399 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 384 + ExecutionMode 4 OriginLowerLeft + Source GLSL 450 + SourceExtension "GL_ARB_sparse_texture2" + Name 4 "main" + Name 8 "resident" + Name 13 "texel" + Name 18 "itexel" + Name 23 "utexel" + Name 29 "s2D" + Name 33 "c2" + Name 35 "ResType" + Name 44 "s3D" + Name 48 "c3" + Name 59 "isCube" + Name 62 "ResType" + Name 71 "s2DShadow" + Name 77 "ResType" + Name 86 "sCubeArrayShadow" + Name 89 "c4" + Name 108 "usCubeArray" + Name 111 "ResType" + Name 140 "us2DRect" + Name 154 "s2DArrayShadow" + Name 186 "s2DMS" + Name 223 "is2DArray" + Name 256 "sCubeShadow" + Name 289 "s2DRectShadow" + Name 360 "offsets" + Name 384 "outColor" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 14: 10(float) Constant 0 + 15: 11(fvec4) ConstantComposite 14 14 14 14 + 16: TypeVector 6(int) 4 + 17: TypePointer Function 16(ivec4) + 19: 16(ivec4) ConstantComposite 9 9 9 9 + 20: TypeInt 32 0 + 21: TypeVector 20(int) 4 + 22: TypePointer Function 21(ivec4) + 24: 20(int) Constant 0 + 25: 21(ivec4) ConstantComposite 24 24 24 24 + 26: TypeImage 10(float) 2D sampled format:Unknown + 27: TypeSampledImage 26 + 28: TypePointer UniformConstant 27 + 29(s2D): 28(ptr) Variable UniformConstant + 31: TypeVector 10(float) 2 + 32: TypePointer UniformConstant 31(fvec2) + 33(c2): 32(ptr) Variable UniformConstant + 35(ResType): TypeStruct 6(int) 11(fvec4) + 41: TypeImage 10(float) 3D sampled format:Unknown + 42: TypeSampledImage 41 + 43: TypePointer UniformConstant 42 + 44(s3D): 43(ptr) Variable UniformConstant + 46: TypeVector 10(float) 3 + 47: TypePointer UniformConstant 46(fvec3) + 48(c3): 47(ptr) Variable UniformConstant + 50: 10(float) Constant 1073741824 + 56: TypeImage 6(int) Cube sampled format:Unknown + 57: TypeSampledImage 56 + 58: TypePointer UniformConstant 57 + 59(isCube): 58(ptr) Variable UniformConstant + 62(ResType): TypeStruct 6(int) 16(ivec4) + 68: TypeImage 10(float) 2D depth sampled format:Unknown + 69: TypeSampledImage 68 + 70: TypePointer UniformConstant 69 + 71(s2DShadow): 70(ptr) Variable UniformConstant + 74: TypePointer Function 10(float) + 77(ResType): TypeStruct 6(int) 10(float) + 83: TypeImage 10(float) Cube depth array sampled format:Unknown + 84: TypeSampledImage 83 + 85: TypePointer UniformConstant 84 +86(sCubeArrayShadow): 85(ptr) Variable UniformConstant + 88: TypePointer UniformConstant 11(fvec4) + 89(c4): 88(ptr) Variable UniformConstant + 91: 10(float) Constant 1065353216 + 105: TypeImage 20(int) Cube array sampled format:Unknown + 106: TypeSampledImage 105 + 107: TypePointer UniformConstant 106 +108(usCubeArray): 107(ptr) Variable UniformConstant + 111(ResType): TypeStruct 6(int) 21(ivec4) + 119: 20(int) Constant 1 + 129: TypeVector 6(int) 3 + 130: 6(int) Constant 2 + 131: 129(ivec3) ConstantComposite 130 130 130 + 137: TypeImage 20(int) Rect sampled format:Unknown + 138: TypeSampledImage 137 + 139: TypePointer UniformConstant 138 + 140(us2DRect): 139(ptr) Variable UniformConstant + 143: TypeVector 6(int) 2 + 144: 6(int) Constant 3 + 145: 143(ivec2) ConstantComposite 144 144 + 151: TypeImage 10(float) 2D depth array sampled format:Unknown + 152: TypeSampledImage 151 + 153: TypePointer UniformConstant 152 +154(s2DArrayShadow): 153(ptr) Variable UniformConstant + 157: 6(int) Constant 5 + 158: 143(ivec2) ConstantComposite 157 157 + 159: 20(int) Constant 2 + 183: TypeImage 10(float) 2D multi-sampled sampled format:Unknown + 184: TypeSampledImage 183 + 185: TypePointer UniformConstant 184 + 186(s2DMS): 185(ptr) Variable UniformConstant + 190: 6(int) Constant 4 + 199: 129(ivec3) ConstantComposite 190 190 190 + 220: TypeImage 6(int) 2D array sampled format:Unknown + 221: TypeSampledImage 220 + 222: TypePointer UniformConstant 221 + 223(is2DArray): 222(ptr) Variable UniformConstant + 226: 6(int) Constant 6 + 227: 143(ivec2) ConstantComposite 226 226 + 235: 6(int) Constant 7 + 236: 143(ivec2) ConstantComposite 235 235 + 253: TypeImage 10(float) Cube depth sampled format:Unknown + 254: TypeSampledImage 253 + 255: TypePointer UniformConstant 254 +256(sCubeShadow): 255(ptr) Variable UniformConstant + 286: TypeImage 10(float) Rect depth sampled format:Unknown + 287: TypeSampledImage 286 + 288: TypePointer UniformConstant 287 +289(s2DRectShadow): 288(ptr) Variable UniformConstant + 294: 20(int) Constant 3 + 306: 143(ivec2) ConstantComposite 130 130 + 335: 143(ivec2) ConstantComposite 190 190 + 357: 20(int) Constant 4 + 358: TypeArray 143(ivec2) 357 + 359: TypePointer UniformConstant 358 + 360(offsets): 359(ptr) Variable UniformConstant + 383: TypePointer Output 11(fvec4) + 384(outColor): 383(ptr) Variable Output + 387: TypeBool + 4(main): 2 Function None 3 + 5: Label + 8(resident): 7(ptr) Variable Function + 13(texel): 12(ptr) Variable Function + 18(itexel): 17(ptr) Variable Function + 23(utexel): 22(ptr) Variable Function + 385: 12(ptr) Variable Function + Store 8(resident) 9 + Store 13(texel) 15 + Store 18(itexel) 19 + Store 23(utexel) 25 + 30: 27 Load 29(s2D) + 34: 31(fvec2) Load 33(c2) + 36: 35(ResType) ImageSparseSampleImplicitLod 30 34 + 37: 11(fvec4) CompositeExtract 36 1 + Store 13(texel) 37 + 38: 6(int) CompositeExtract 36 0 + 39: 6(int) Load 8(resident) + 40: 6(int) BitwiseOr 39 38 + Store 8(resident) 40 + 45: 42 Load 44(s3D) + 49: 46(fvec3) Load 48(c3) + 51: 35(ResType) ImageSparseSampleImplicitLod 45 49 Bias 50 + 52: 11(fvec4) CompositeExtract 51 1 + Store 13(texel) 52 + 53: 6(int) CompositeExtract 51 0 + 54: 6(int) Load 8(resident) + 55: 6(int) BitwiseOr 54 53 + Store 8(resident) 55 + 60: 57 Load 59(isCube) + 61: 46(fvec3) Load 48(c3) + 63: 62(ResType) ImageSparseSampleImplicitLod 60 61 + 64: 16(ivec4) CompositeExtract 63 1 + Store 18(itexel) 64 + 65: 6(int) CompositeExtract 63 0 + 66: 6(int) Load 8(resident) + 67: 6(int) BitwiseOr 66 65 + Store 8(resident) 67 + 72: 69 Load 71(s2DShadow) + 73: 46(fvec3) Load 48(c3) + 75: 74(ptr) AccessChain 13(texel) 24 + 76: 10(float) CompositeExtract 73 2 + 78: 77(ResType) ImageSparseSampleDrefImplicitLod 72 73 76 + 79: 10(float) CompositeExtract 78 1 + Store 75 79 + 80: 6(int) CompositeExtract 78 0 + 81: 6(int) Load 8(resident) + 82: 6(int) BitwiseOr 81 80 + Store 8(resident) 82 + 87: 84 Load 86(sCubeArrayShadow) + 90: 11(fvec4) Load 89(c4) + 92: 74(ptr) AccessChain 13(texel) 24 + 93: 77(ResType) ImageSparseSampleDrefImplicitLod 87 90 91 + 94: 10(float) CompositeExtract 93 1 + Store 92 94 + 95: 6(int) CompositeExtract 93 0 + 96: 6(int) Load 8(resident) + 97: 6(int) BitwiseOr 96 95 + Store 8(resident) 97 + 98: 27 Load 29(s2D) + 99: 31(fvec2) Load 33(c2) + 100: 35(ResType) ImageSparseSampleExplicitLod 98 99 Lod 50 + 101: 11(fvec4) CompositeExtract 100 1 + Store 13(texel) 101 + 102: 6(int) CompositeExtract 100 0 + 103: 6(int) Load 8(resident) + 104: 6(int) BitwiseOr 103 102 + Store 8(resident) 104 + 109: 106 Load 108(usCubeArray) + 110: 11(fvec4) Load 89(c4) + 112:111(ResType) ImageSparseSampleExplicitLod 109 110 Lod 91 + 113: 21(ivec4) CompositeExtract 112 1 + Store 23(utexel) 113 + 114: 6(int) CompositeExtract 112 0 + 115: 6(int) Load 8(resident) + 116: 6(int) BitwiseOr 115 114 + Store 8(resident) 116 + 117: 69 Load 71(s2DShadow) + 118: 46(fvec3) Load 48(c3) + 120: 74(ptr) AccessChain 13(texel) 119 + 121: 10(float) CompositeExtract 118 2 + 122: 77(ResType) ImageSparseSampleDrefExplicitLod 117 118 121 Lod 50 + 123: 10(float) CompositeExtract 122 1 + Store 120 123 + 124: 6(int) CompositeExtract 122 0 + 125: 6(int) Load 8(resident) + 126: 6(int) BitwiseOr 125 124 + Store 8(resident) 126 + 127: 42 Load 44(s3D) + 128: 46(fvec3) Load 48(c3) + 132: 35(ResType) ImageSparseSampleImplicitLod 127 128 Bias ConstOffset 50 131 + 133: 11(fvec4) CompositeExtract 132 1 + Store 13(texel) 133 + 134: 6(int) CompositeExtract 132 0 + 135: 6(int) Load 8(resident) + 136: 6(int) BitwiseOr 135 134 + Store 8(resident) 136 + 141: 138 Load 140(us2DRect) + 142: 31(fvec2) Load 33(c2) + 146:111(ResType) ImageSparseSampleImplicitLod 141 142 ConstOffset 145 + 147: 21(ivec4) CompositeExtract 146 1 + Store 23(utexel) 147 + 148: 6(int) CompositeExtract 146 0 + 149: 6(int) Load 8(resident) + 150: 6(int) BitwiseOr 149 148 + Store 8(resident) 150 + 155: 152 Load 154(s2DArrayShadow) + 156: 11(fvec4) Load 89(c4) + 160: 74(ptr) AccessChain 13(texel) 159 + 161: 10(float) CompositeExtract 156 3 + 162: 77(ResType) ImageSparseSampleDrefImplicitLod 155 156 161 ConstOffset 158 + 163: 10(float) CompositeExtract 162 1 + Store 160 163 + 164: 6(int) CompositeExtract 162 0 + 165: 6(int) Load 8(resident) + 166: 6(int) BitwiseOr 165 164 + Store 8(resident) 166 + 167: 27 Load 29(s2D) + 168: 31(fvec2) Load 33(c2) + 169: 143(ivec2) ConvertFToS 168 + 170: 35(ResType) ImageSparseFetch 167 169 Lod 130 + 171: 11(fvec4) CompositeExtract 170 1 + Store 13(texel) 171 + 172: 6(int) CompositeExtract 170 0 + 173: 6(int) Load 8(resident) + 174: 6(int) BitwiseOr 173 172 + Store 8(resident) 174 + 175: 138 Load 140(us2DRect) + 176: 31(fvec2) Load 33(c2) + 177: 143(ivec2) ConvertFToS 176 + 178:111(ResType) ImageSparseFetch 175 177 + 179: 21(ivec4) CompositeExtract 178 1 + Store 23(utexel) 179 + 180: 6(int) CompositeExtract 178 0 + 181: 6(int) Load 8(resident) + 182: 6(int) BitwiseOr 181 180 + Store 8(resident) 182 + 187: 184 Load 186(s2DMS) + 188: 31(fvec2) Load 33(c2) + 189: 143(ivec2) ConvertFToS 188 + 191: 35(ResType) ImageSparseFetch 187 189 Sample 190 + 192: 11(fvec4) CompositeExtract 191 1 + Store 13(texel) 192 + 193: 6(int) CompositeExtract 191 0 + 194: 6(int) Load 8(resident) + 195: 6(int) BitwiseOr 194 193 + Store 8(resident) 195 + 196: 42 Load 44(s3D) + 197: 46(fvec3) Load 48(c3) + 198: 129(ivec3) ConvertFToS 197 + 200: 35(ResType) ImageSparseFetch 196 198 Lod ConstOffset 130 199 + 201: 11(fvec4) CompositeExtract 200 1 + Store 13(texel) 201 + 202: 6(int) CompositeExtract 200 0 + 203: 6(int) Load 8(resident) + 204: 6(int) BitwiseOr 203 202 + Store 8(resident) 204 + 205: 138 Load 140(us2DRect) + 206: 31(fvec2) Load 33(c2) + 207: 143(ivec2) ConvertFToS 206 + 208:111(ResType) ImageSparseFetch 205 207 ConstOffset 145 + 209: 21(ivec4) CompositeExtract 208 1 + Store 23(utexel) 209 + 210: 6(int) CompositeExtract 208 0 + 211: 6(int) Load 8(resident) + 212: 6(int) BitwiseOr 211 210 + Store 8(resident) 212 + 213: 27 Load 29(s2D) + 214: 31(fvec2) Load 33(c2) + 215: 35(ResType) ImageSparseSampleExplicitLod 213 214 Lod ConstOffset 50 158 + 216: 11(fvec4) CompositeExtract 215 1 + Store 13(texel) 216 + 217: 6(int) CompositeExtract 215 0 + 218: 6(int) Load 8(resident) + 219: 6(int) BitwiseOr 218 217 + Store 8(resident) 219 + 224: 221 Load 223(is2DArray) + 225: 46(fvec3) Load 48(c3) + 228: 62(ResType) ImageSparseSampleExplicitLod 224 225 Lod ConstOffset 50 227 + 229: 16(ivec4) CompositeExtract 228 1 + Store 18(itexel) 229 + 230: 6(int) CompositeExtract 228 0 + 231: 6(int) Load 8(resident) + 232: 6(int) BitwiseOr 231 230 + Store 8(resident) 232 + 233: 69 Load 71(s2DShadow) + 234: 46(fvec3) Load 48(c3) + 237: 74(ptr) AccessChain 13(texel) 159 + 238: 10(float) CompositeExtract 234 2 + 239: 77(ResType) ImageSparseSampleDrefExplicitLod 233 234 238 Lod ConstOffset 50 236 + 240: 10(float) CompositeExtract 239 1 + Store 237 240 + 241: 6(int) CompositeExtract 239 0 + 242: 6(int) Load 8(resident) + 243: 6(int) BitwiseOr 242 241 + Store 8(resident) 243 + 244: 42 Load 44(s3D) + 245: 46(fvec3) Load 48(c3) + 246: 46(fvec3) Load 48(c3) + 247: 46(fvec3) Load 48(c3) + 248: 35(ResType) ImageSparseSampleExplicitLod 244 245 Grad 246 247 + 249: 11(fvec4) CompositeExtract 248 1 + Store 13(texel) 249 + 250: 6(int) CompositeExtract 248 0 + 251: 6(int) Load 8(resident) + 252: 6(int) BitwiseOr 251 250 + Store 8(resident) 252 + 257: 254 Load 256(sCubeShadow) + 258: 11(fvec4) Load 89(c4) + 259: 46(fvec3) Load 48(c3) + 260: 46(fvec3) Load 48(c3) + 261: 74(ptr) AccessChain 13(texel) 119 + 262: 10(float) CompositeExtract 258 3 + 263: 77(ResType) ImageSparseSampleDrefExplicitLod 257 258 262 Grad 259 260 + 264: 10(float) CompositeExtract 263 1 + Store 261 264 + 265: 6(int) CompositeExtract 263 0 + 266: 6(int) Load 8(resident) + 267: 6(int) BitwiseOr 266 265 + Store 8(resident) 267 + 268: 106 Load 108(usCubeArray) + 269: 11(fvec4) Load 89(c4) + 270: 46(fvec3) Load 48(c3) + 271: 46(fvec3) Load 48(c3) + 272:111(ResType) ImageSparseSampleExplicitLod 268 269 Grad 270 271 + 273: 21(ivec4) CompositeExtract 272 1 + Store 23(utexel) 273 + 274: 6(int) CompositeExtract 272 0 + 275: 6(int) Load 8(resident) + 276: 6(int) BitwiseOr 275 274 + Store 8(resident) 276 + 277: 27 Load 29(s2D) + 278: 31(fvec2) Load 33(c2) + 279: 31(fvec2) Load 33(c2) + 280: 31(fvec2) Load 33(c2) + 281: 35(ResType) ImageSparseSampleExplicitLod 277 278 Grad ConstOffset 279 280 158 + 282: 11(fvec4) CompositeExtract 281 1 + Store 13(texel) 282 + 283: 6(int) CompositeExtract 281 0 + 284: 6(int) Load 8(resident) + 285: 6(int) BitwiseOr 284 283 + Store 8(resident) 285 + 290: 287 Load 289(s2DRectShadow) + 291: 46(fvec3) Load 48(c3) + 292: 31(fvec2) Load 33(c2) + 293: 31(fvec2) Load 33(c2) + 295: 74(ptr) AccessChain 13(texel) 294 + 296: 10(float) CompositeExtract 291 2 + 297: 77(ResType) ImageSparseSampleDrefExplicitLod 290 291 296 Grad ConstOffset 292 293 227 + 298: 10(float) CompositeExtract 297 1 + Store 295 298 + 299: 6(int) CompositeExtract 297 0 + 300: 6(int) Load 8(resident) + 301: 6(int) BitwiseOr 300 299 + Store 8(resident) 301 + 302: 221 Load 223(is2DArray) + 303: 46(fvec3) Load 48(c3) + 304: 31(fvec2) Load 33(c2) + 305: 31(fvec2) Load 33(c2) + 307: 62(ResType) ImageSparseSampleExplicitLod 302 303 Grad ConstOffset 304 305 306 + 308: 16(ivec4) CompositeExtract 307 1 + Store 18(itexel) 308 + 309: 6(int) CompositeExtract 307 0 + 310: 6(int) Load 8(resident) + 311: 6(int) BitwiseOr 310 309 + Store 8(resident) 311 + 312: 27 Load 29(s2D) + 313: 31(fvec2) Load 33(c2) + 314: 35(ResType) ImageSparseGather 312 313 9 + 315: 11(fvec4) CompositeExtract 314 1 + Store 13(texel) 315 + 316: 6(int) CompositeExtract 314 0 + 317: 6(int) Load 8(resident) + 318: 6(int) BitwiseOr 317 316 + Store 8(resident) 318 + 319: 221 Load 223(is2DArray) + 320: 46(fvec3) Load 48(c3) + 321: 62(ResType) ImageSparseGather 319 320 130 + 322: 16(ivec4) CompositeExtract 321 1 + Store 18(itexel) 322 + 323: 6(int) CompositeExtract 321 0 + 324: 6(int) Load 8(resident) + 325: 6(int) BitwiseOr 324 323 + Store 8(resident) 325 + 326: 152 Load 154(s2DArrayShadow) + 327: 46(fvec3) Load 48(c3) + 328: 35(ResType) ImageSparseDrefGather 326 327 50 + 329: 11(fvec4) CompositeExtract 328 1 + Store 13(texel) 329 + 330: 6(int) CompositeExtract 328 0 + 331: 6(int) Load 8(resident) + 332: 6(int) BitwiseOr 331 330 + Store 8(resident) 332 + 333: 27 Load 29(s2D) + 334: 31(fvec2) Load 33(c2) + 336: 35(ResType) ImageSparseGather 333 334 9 ConstOffset 335 + 337: 11(fvec4) CompositeExtract 336 1 + Store 13(texel) 337 + 338: 6(int) CompositeExtract 336 0 + 339: 6(int) Load 8(resident) + 340: 6(int) BitwiseOr 339 338 + Store 8(resident) 340 + 341: 221 Load 223(is2DArray) + 342: 46(fvec3) Load 48(c3) + 343: 62(ResType) ImageSparseGather 341 342 130 ConstOffset 158 + 344: 16(ivec4) CompositeExtract 343 1 + Store 18(itexel) 344 + 345: 6(int) CompositeExtract 343 0 + 346: 6(int) Load 8(resident) + 347: 6(int) BitwiseOr 346 345 + Store 8(resident) 347 + 348: 287 Load 289(s2DRectShadow) + 349: 31(fvec2) Load 33(c2) + 350: 35(ResType) ImageSparseDrefGather 348 349 50 ConstOffset 236 + 351: 11(fvec4) CompositeExtract 350 1 + Store 13(texel) 351 + 352: 6(int) CompositeExtract 350 0 + 353: 6(int) Load 8(resident) + 354: 6(int) BitwiseOr 353 352 + Store 8(resident) 354 + 355: 27 Load 29(s2D) + 356: 31(fvec2) Load 33(c2) + 361: 358 Load 360(offsets) + 362: 35(ResType) ImageSparseGather 355 356 9 ConstOffsets 361 + 363: 11(fvec4) CompositeExtract 362 1 + Store 13(texel) 363 + 364: 6(int) CompositeExtract 362 0 + 365: 6(int) Load 8(resident) + 366: 6(int) BitwiseOr 365 364 + Store 8(resident) 366 + 367: 221 Load 223(is2DArray) + 368: 46(fvec3) Load 48(c3) + 369: 358 Load 360(offsets) + 370: 62(ResType) ImageSparseGather 367 368 130 ConstOffsets 369 + 371: 16(ivec4) CompositeExtract 370 1 + Store 18(itexel) 371 + 372: 6(int) CompositeExtract 370 0 + 373: 6(int) Load 8(resident) + 374: 6(int) BitwiseOr 373 372 + Store 8(resident) 374 + 375: 287 Load 289(s2DRectShadow) + 376: 31(fvec2) Load 33(c2) + 377: 358 Load 360(offsets) + 378: 35(ResType) ImageSparseDrefGather 375 376 50 ConstOffsets 377 + 379: 11(fvec4) CompositeExtract 378 1 + Store 13(texel) 379 + 380: 6(int) CompositeExtract 378 0 + 381: 6(int) Load 8(resident) + 382: 6(int) BitwiseOr 381 380 + Store 8(resident) 382 + 386: 6(int) Load 8(resident) + 388: 387(bool) ImageSparseTexelsResident 386 + SelectionMerge 390 None + BranchConditional 388 389 392 + 389: Label + 391: 11(fvec4) Load 13(texel) + Store 385 391 + Branch 390 + 392: Label + 393: 16(ivec4) Load 18(itexel) + 394: 11(fvec4) ConvertSToF 393 + 395: 21(ivec4) Load 23(utexel) + 396: 11(fvec4) ConvertUToF 395 + 397: 11(fvec4) FAdd 394 396 + Store 385 397 + Branch 390 + 390: Label + 398: 11(fvec4) Load 385 + Store 384(outColor) 398 + Return + FunctionEnd diff --git a/Test/baseResults/spv.sparseTextureClamp.frag.out b/Test/baseResults/spv.sparseTextureClamp.frag.out new file mode 100644 index 00000000..42fc27aa --- /dev/null +++ b/Test/baseResults/spv.sparseTextureClamp.frag.out @@ -0,0 +1,456 @@ +spv.sparseTextureClamp.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 360 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 345 + ExecutionMode 4 OriginLowerLeft + Source GLSL 450 + SourceExtension "GL_ARB_sparse_texture_clamp" + Name 4 "main" + Name 8 "resident" + Name 13 "texel" + Name 18 "itexel" + Name 23 "utexel" + Name 29 "s2D" + Name 33 "c2" + Name 36 "lodClamp" + Name 38 "ResType" + Name 47 "s3D" + Name 51 "c3" + Name 63 "isCube" + Name 67 "ResType" + Name 76 "s2DShadow" + Name 83 "ResType" + Name 92 "sCubeArrayShadow" + Name 95 "c4" + Name 154 "us2DRect" + Name 161 "ResType" + Name 170 "s2DArrayShadow" + Name 218 "sCubeShadow" + Name 235 "usCubeArray" + Name 286 "s2DRectShadow" + Name 305 "is2DArray" + Name 345 "outColor" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 14: 10(float) Constant 0 + 15: 11(fvec4) ConstantComposite 14 14 14 14 + 16: TypeVector 6(int) 4 + 17: TypePointer Function 16(ivec4) + 19: 16(ivec4) ConstantComposite 9 9 9 9 + 20: TypeInt 32 0 + 21: TypeVector 20(int) 4 + 22: TypePointer Function 21(ivec4) + 24: 20(int) Constant 0 + 25: 21(ivec4) ConstantComposite 24 24 24 24 + 26: TypeImage 10(float) 2D sampled format:Unknown + 27: TypeSampledImage 26 + 28: TypePointer UniformConstant 27 + 29(s2D): 28(ptr) Variable UniformConstant + 31: TypeVector 10(float) 2 + 32: TypePointer UniformConstant 31(fvec2) + 33(c2): 32(ptr) Variable UniformConstant + 35: TypePointer UniformConstant 10(float) + 36(lodClamp): 35(ptr) Variable UniformConstant + 38(ResType): TypeStruct 6(int) 11(fvec4) + 44: TypeImage 10(float) 3D sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(s3D): 46(ptr) Variable UniformConstant + 49: TypeVector 10(float) 3 + 50: TypePointer UniformConstant 49(fvec3) + 51(c3): 50(ptr) Variable UniformConstant + 54: 10(float) Constant 1073741824 + 60: TypeImage 6(int) Cube sampled format:Unknown + 61: TypeSampledImage 60 + 62: TypePointer UniformConstant 61 + 63(isCube): 62(ptr) Variable UniformConstant + 67(ResType): TypeStruct 6(int) 16(ivec4) + 73: TypeImage 10(float) 2D depth sampled format:Unknown + 74: TypeSampledImage 73 + 75: TypePointer UniformConstant 74 + 76(s2DShadow): 75(ptr) Variable UniformConstant + 80: TypePointer Function 10(float) + 83(ResType): TypeStruct 6(int) 10(float) + 89: TypeImage 10(float) Cube depth array sampled format:Unknown + 90: TypeSampledImage 89 + 91: TypePointer UniformConstant 90 +92(sCubeArrayShadow): 91(ptr) Variable UniformConstant + 94: TypePointer UniformConstant 11(fvec4) + 95(c4): 94(ptr) Variable UniformConstant + 97: 10(float) Constant 1065353216 + 142: TypeVector 6(int) 3 + 143: 6(int) Constant 2 + 144: 142(ivec3) ConstantComposite 143 143 143 + 151: TypeImage 20(int) Rect sampled format:Unknown + 152: TypeSampledImage 151 + 153: TypePointer UniformConstant 152 + 154(us2DRect): 153(ptr) Variable UniformConstant + 157: TypeVector 6(int) 2 + 158: 6(int) Constant 3 + 159: 157(ivec2) ConstantComposite 158 158 + 161(ResType): TypeStruct 6(int) 21(ivec4) + 167: TypeImage 10(float) 2D depth array sampled format:Unknown + 168: TypeSampledImage 167 + 169: TypePointer UniformConstant 168 +170(s2DArrayShadow): 169(ptr) Variable UniformConstant + 173: 6(int) Constant 5 + 174: 157(ivec2) ConstantComposite 173 173 + 176: 20(int) Constant 2 + 215: TypeImage 10(float) Cube depth sampled format:Unknown + 216: TypeSampledImage 215 + 217: TypePointer UniformConstant 216 +218(sCubeShadow): 217(ptr) Variable UniformConstant + 224: 20(int) Constant 1 + 232: TypeImage 20(int) Cube array sampled format:Unknown + 233: TypeSampledImage 232 + 234: TypePointer UniformConstant 233 +235(usCubeArray): 234(ptr) Variable UniformConstant + 283: TypeImage 10(float) Rect depth sampled format:Unknown + 284: TypeSampledImage 283 + 285: TypePointer UniformConstant 284 +286(s2DRectShadow): 285(ptr) Variable UniformConstant + 291: 6(int) Constant 6 + 292: 157(ivec2) ConstantComposite 291 291 + 294: 20(int) Constant 3 + 302: TypeImage 6(int) 2D array sampled format:Unknown + 303: TypeSampledImage 302 + 304: TypePointer UniformConstant 303 + 305(is2DArray): 304(ptr) Variable UniformConstant + 310: 157(ivec2) ConstantComposite 143 143 + 344: TypePointer Output 11(fvec4) + 345(outColor): 344(ptr) Variable Output + 348: TypeBool + 4(main): 2 Function None 3 + 5: Label + 8(resident): 7(ptr) Variable Function + 13(texel): 12(ptr) Variable Function + 18(itexel): 17(ptr) Variable Function + 23(utexel): 22(ptr) Variable Function + 346: 12(ptr) Variable Function + Store 8(resident) 9 + Store 13(texel) 15 + Store 18(itexel) 19 + Store 23(utexel) 25 + 30: 27 Load 29(s2D) + 34: 31(fvec2) Load 33(c2) + 37: 10(float) Load 36(lodClamp) + 39: 38(ResType) ImageSparseSampleImplicitLod 30 34 MinLod 37 + 40: 11(fvec4) CompositeExtract 39 1 + Store 13(texel) 40 + 41: 6(int) CompositeExtract 39 0 + 42: 6(int) Load 8(resident) + 43: 6(int) BitwiseOr 42 41 + Store 8(resident) 43 + 48: 45 Load 47(s3D) + 52: 49(fvec3) Load 51(c3) + 53: 10(float) Load 36(lodClamp) + 55: 38(ResType) ImageSparseSampleImplicitLod 48 52 Bias MinLod 54 53 + 56: 11(fvec4) CompositeExtract 55 1 + Store 13(texel) 56 + 57: 6(int) CompositeExtract 55 0 + 58: 6(int) Load 8(resident) + 59: 6(int) BitwiseOr 58 57 + Store 8(resident) 59 + 64: 61 Load 63(isCube) + 65: 49(fvec3) Load 51(c3) + 66: 10(float) Load 36(lodClamp) + 68: 67(ResType) ImageSparseSampleImplicitLod 64 65 MinLod 66 + 69: 16(ivec4) CompositeExtract 68 1 + Store 18(itexel) 69 + 70: 6(int) CompositeExtract 68 0 + 71: 6(int) Load 8(resident) + 72: 6(int) BitwiseOr 71 70 + Store 8(resident) 72 + 77: 74 Load 76(s2DShadow) + 78: 49(fvec3) Load 51(c3) + 79: 10(float) Load 36(lodClamp) + 81: 80(ptr) AccessChain 13(texel) 24 + 82: 10(float) CompositeExtract 78 2 + 84: 83(ResType) ImageSparseSampleDrefImplicitLod 77 78 82 MinLod 79 + 85: 10(float) CompositeExtract 84 1 + Store 81 85 + 86: 6(int) CompositeExtract 84 0 + 87: 6(int) Load 8(resident) + 88: 6(int) BitwiseOr 87 86 + Store 8(resident) 88 + 93: 90 Load 92(sCubeArrayShadow) + 96: 11(fvec4) Load 95(c4) + 98: 10(float) Load 36(lodClamp) + 99: 80(ptr) AccessChain 13(texel) 24 + 100: 83(ResType) ImageSparseSampleDrefImplicitLod 93 96 97 MinLod 98 + 101: 10(float) CompositeExtract 100 1 + Store 99 101 + 102: 6(int) CompositeExtract 100 0 + 103: 6(int) Load 8(resident) + 104: 6(int) BitwiseOr 103 102 + Store 8(resident) 104 + 105: 27 Load 29(s2D) + 106: 31(fvec2) Load 33(c2) + 107: 10(float) Load 36(lodClamp) + 108: 11(fvec4) ImageSampleImplicitLod 105 106 MinLod 107 + 109: 11(fvec4) Load 13(texel) + 110: 11(fvec4) FAdd 109 108 + Store 13(texel) 110 + 111: 45 Load 47(s3D) + 112: 49(fvec3) Load 51(c3) + 113: 10(float) Load 36(lodClamp) + 114: 11(fvec4) ImageSampleImplicitLod 111 112 Bias MinLod 54 113 + 115: 11(fvec4) Load 13(texel) + 116: 11(fvec4) FAdd 115 114 + Store 13(texel) 116 + 117: 61 Load 63(isCube) + 118: 49(fvec3) Load 51(c3) + 119: 10(float) Load 36(lodClamp) + 120: 16(ivec4) ImageSampleImplicitLod 117 118 MinLod 119 + 121: 16(ivec4) Load 18(itexel) + 122: 16(ivec4) IAdd 121 120 + Store 18(itexel) 122 + 123: 74 Load 76(s2DShadow) + 124: 49(fvec3) Load 51(c3) + 125: 10(float) Load 36(lodClamp) + 126: 10(float) CompositeExtract 124 2 + 127: 10(float) ImageSampleDrefImplicitLod 123 124 126 MinLod 125 + 128: 80(ptr) AccessChain 13(texel) 24 + 129: 10(float) Load 128 + 130: 10(float) FAdd 129 127 + 131: 80(ptr) AccessChain 13(texel) 24 + Store 131 130 + 132: 90 Load 92(sCubeArrayShadow) + 133: 11(fvec4) Load 95(c4) + 134: 10(float) Load 36(lodClamp) + 135: 10(float) ImageSampleDrefImplicitLod 132 133 97 MinLod 134 + 136: 80(ptr) AccessChain 13(texel) 24 + 137: 10(float) Load 136 + 138: 10(float) FAdd 137 135 + 139: 80(ptr) AccessChain 13(texel) 24 + Store 139 138 + 140: 45 Load 47(s3D) + 141: 49(fvec3) Load 51(c3) + 145: 10(float) Load 36(lodClamp) + 146: 38(ResType) ImageSparseSampleImplicitLod 140 141 Bias ConstOffset MinLod 54 144 145 + 147: 11(fvec4) CompositeExtract 146 1 + Store 13(texel) 147 + 148: 6(int) CompositeExtract 146 0 + 149: 6(int) Load 8(resident) + 150: 6(int) BitwiseOr 149 148 + Store 8(resident) 150 + 155: 152 Load 154(us2DRect) + 156: 31(fvec2) Load 33(c2) + 160: 10(float) Load 36(lodClamp) + 162:161(ResType) ImageSparseSampleImplicitLod 155 156 ConstOffset MinLod 159 160 + 163: 21(ivec4) CompositeExtract 162 1 + Store 23(utexel) 163 + 164: 6(int) CompositeExtract 162 0 + 165: 6(int) Load 8(resident) + 166: 6(int) BitwiseOr 165 164 + Store 8(resident) 166 + 171: 168 Load 170(s2DArrayShadow) + 172: 11(fvec4) Load 95(c4) + 175: 10(float) Load 36(lodClamp) + 177: 80(ptr) AccessChain 13(texel) 176 + 178: 10(float) CompositeExtract 172 3 + 179: 83(ResType) ImageSparseSampleDrefImplicitLod 171 172 178 ConstOffset MinLod 174 175 + 180: 10(float) CompositeExtract 179 1 + Store 177 180 + 181: 6(int) CompositeExtract 179 0 + 182: 6(int) Load 8(resident) + 183: 6(int) BitwiseOr 182 181 + Store 8(resident) 183 + 184: 45 Load 47(s3D) + 185: 49(fvec3) Load 51(c3) + 186: 10(float) Load 36(lodClamp) + 187: 11(fvec4) ImageSampleImplicitLod 184 185 Bias ConstOffset MinLod 54 144 186 + 188: 11(fvec4) Load 13(texel) + 189: 11(fvec4) FAdd 188 187 + Store 13(texel) 189 + 190: 152 Load 154(us2DRect) + 191: 31(fvec2) Load 33(c2) + 192: 10(float) Load 36(lodClamp) + 193: 21(ivec4) ImageSampleImplicitLod 190 191 ConstOffset MinLod 159 192 + 194: 21(ivec4) Load 23(utexel) + 195: 21(ivec4) IAdd 194 193 + Store 23(utexel) 195 + 196: 168 Load 170(s2DArrayShadow) + 197: 11(fvec4) Load 95(c4) + 198: 10(float) Load 36(lodClamp) + 199: 10(float) CompositeExtract 197 3 + 200: 10(float) ImageSampleDrefImplicitLod 196 197 199 ConstOffset MinLod 174 198 + 201: 80(ptr) AccessChain 13(texel) 176 + 202: 10(float) Load 201 + 203: 10(float) FAdd 202 200 + 204: 80(ptr) AccessChain 13(texel) 176 + Store 204 203 + 205: 45 Load 47(s3D) + 206: 49(fvec3) Load 51(c3) + 207: 49(fvec3) Load 51(c3) + 208: 49(fvec3) Load 51(c3) + 209: 10(float) Load 36(lodClamp) + 210: 38(ResType) ImageSparseSampleExplicitLod 205 206 Grad MinLod 207 208 209 + 211: 11(fvec4) CompositeExtract 210 1 + Store 13(texel) 211 + 212: 6(int) CompositeExtract 210 0 + 213: 6(int) Load 8(resident) + 214: 6(int) BitwiseOr 213 212 + Store 8(resident) 214 + 219: 216 Load 218(sCubeShadow) + 220: 11(fvec4) Load 95(c4) + 221: 49(fvec3) Load 51(c3) + 222: 49(fvec3) Load 51(c3) + 223: 10(float) Load 36(lodClamp) + 225: 80(ptr) AccessChain 13(texel) 224 + 226: 10(float) CompositeExtract 220 3 + 227: 83(ResType) ImageSparseSampleDrefExplicitLod 219 220 226 Grad MinLod 221 222 223 + 228: 10(float) CompositeExtract 227 1 + Store 225 228 + 229: 6(int) CompositeExtract 227 0 + 230: 6(int) Load 8(resident) + 231: 6(int) BitwiseOr 230 229 + Store 8(resident) 231 + 236: 233 Load 235(usCubeArray) + 237: 11(fvec4) Load 95(c4) + 238: 49(fvec3) Load 51(c3) + 239: 49(fvec3) Load 51(c3) + 240: 10(float) Load 36(lodClamp) + 241:161(ResType) ImageSparseSampleExplicitLod 236 237 Grad MinLod 238 239 240 + 242: 21(ivec4) CompositeExtract 241 1 + Store 23(utexel) 242 + 243: 6(int) CompositeExtract 241 0 + 244: 6(int) Load 8(resident) + 245: 6(int) BitwiseOr 244 243 + Store 8(resident) 245 + 246: 45 Load 47(s3D) + 247: 49(fvec3) Load 51(c3) + 248: 49(fvec3) Load 51(c3) + 249: 49(fvec3) Load 51(c3) + 250: 10(float) Load 36(lodClamp) + 251: 11(fvec4) ImageSampleExplicitLod 246 247 Grad MinLod 248 249 250 + 252: 11(fvec4) Load 13(texel) + 253: 11(fvec4) FAdd 252 251 + Store 13(texel) 253 + 254: 216 Load 218(sCubeShadow) + 255: 11(fvec4) Load 95(c4) + 256: 49(fvec3) Load 51(c3) + 257: 49(fvec3) Load 51(c3) + 258: 10(float) Load 36(lodClamp) + 259: 10(float) CompositeExtract 255 3 + 260: 10(float) ImageSampleDrefExplicitLod 254 255 259 Grad MinLod 256 257 258 + 261: 80(ptr) AccessChain 13(texel) 224 + 262: 10(float) Load 261 + 263: 10(float) FAdd 262 260 + 264: 80(ptr) AccessChain 13(texel) 224 + Store 264 263 + 265: 233 Load 235(usCubeArray) + 266: 11(fvec4) Load 95(c4) + 267: 49(fvec3) Load 51(c3) + 268: 49(fvec3) Load 51(c3) + 269: 10(float) Load 36(lodClamp) + 270: 21(ivec4) ImageSampleExplicitLod 265 266 Grad MinLod 267 268 269 + 271: 21(ivec4) Load 23(utexel) + 272: 21(ivec4) IAdd 271 270 + Store 23(utexel) 272 + 273: 27 Load 29(s2D) + 274: 31(fvec2) Load 33(c2) + 275: 31(fvec2) Load 33(c2) + 276: 31(fvec2) Load 33(c2) + 277: 10(float) Load 36(lodClamp) + 278: 38(ResType) ImageSparseSampleExplicitLod 273 274 Grad ConstOffset MinLod 275 276 174 277 + 279: 11(fvec4) CompositeExtract 278 1 + Store 13(texel) 279 + 280: 6(int) CompositeExtract 278 0 + 281: 6(int) Load 8(resident) + 282: 6(int) BitwiseOr 281 280 + Store 8(resident) 282 + 287: 284 Load 286(s2DRectShadow) + 288: 49(fvec3) Load 51(c3) + 289: 31(fvec2) Load 33(c2) + 290: 31(fvec2) Load 33(c2) + 293: 10(float) Load 36(lodClamp) + 295: 80(ptr) AccessChain 13(texel) 294 + 296: 10(float) CompositeExtract 288 2 + 297: 83(ResType) ImageSparseSampleDrefExplicitLod 287 288 296 Grad ConstOffset MinLod 289 290 292 293 + 298: 10(float) CompositeExtract 297 1 + Store 295 298 + 299: 6(int) CompositeExtract 297 0 + 300: 6(int) Load 8(resident) + 301: 6(int) BitwiseOr 300 299 + Store 8(resident) 301 + 306: 303 Load 305(is2DArray) + 307: 49(fvec3) Load 51(c3) + 308: 31(fvec2) Load 33(c2) + 309: 31(fvec2) Load 33(c2) + 311: 10(float) Load 36(lodClamp) + 312: 67(ResType) ImageSparseSampleExplicitLod 306 307 Grad ConstOffset MinLod 308 309 310 311 + 313: 16(ivec4) CompositeExtract 312 1 + Store 18(itexel) 313 + 314: 6(int) CompositeExtract 312 0 + 315: 6(int) Load 8(resident) + 316: 6(int) BitwiseOr 315 314 + Store 8(resident) 316 + 317: 27 Load 29(s2D) + 318: 31(fvec2) Load 33(c2) + 319: 31(fvec2) Load 33(c2) + 320: 31(fvec2) Load 33(c2) + 321: 10(float) Load 36(lodClamp) + 322: 11(fvec4) ImageSampleExplicitLod 317 318 Grad ConstOffset MinLod 319 320 174 321 + 323: 11(fvec4) Load 13(texel) + 324: 11(fvec4) FAdd 323 322 + Store 13(texel) 324 + 325: 284 Load 286(s2DRectShadow) + 326: 49(fvec3) Load 51(c3) + 327: 31(fvec2) Load 33(c2) + 328: 31(fvec2) Load 33(c2) + 329: 10(float) Load 36(lodClamp) + 330: 10(float) CompositeExtract 326 2 + 331: 10(float) ImageSampleDrefExplicitLod 325 326 330 Grad ConstOffset MinLod 327 328 292 329 + 332: 80(ptr) AccessChain 13(texel) 294 + 333: 10(float) Load 332 + 334: 10(float) FAdd 333 331 + 335: 80(ptr) AccessChain 13(texel) 294 + Store 335 334 + 336: 303 Load 305(is2DArray) + 337: 49(fvec3) Load 51(c3) + 338: 31(fvec2) Load 33(c2) + 339: 31(fvec2) Load 33(c2) + 340: 10(float) Load 36(lodClamp) + 341: 16(ivec4) ImageSampleExplicitLod 336 337 Grad ConstOffset MinLod 338 339 310 340 + 342: 16(ivec4) Load 18(itexel) + 343: 16(ivec4) IAdd 342 341 + Store 18(itexel) 343 + 347: 6(int) Load 8(resident) + 349: 348(bool) ImageSparseTexelsResident 347 + SelectionMerge 351 None + BranchConditional 349 350 353 + 350: Label + 352: 11(fvec4) Load 13(texel) + Store 346 352 + Branch 351 + 353: Label + 354: 16(ivec4) Load 18(itexel) + 355: 11(fvec4) ConvertSToF 354 + 356: 21(ivec4) Load 23(utexel) + 357: 11(fvec4) ConvertUToF 356 + 358: 11(fvec4) FAdd 355 357 + Store 346 358 + Branch 351 + 351: Label + 359: 11(fvec4) Load 346 + Store 345(outColor) 359 + Return + FunctionEnd diff --git a/Test/spv.sparseTexture.frag b/Test/spv.sparseTexture.frag new file mode 100644 index 00000000..06c89e54 --- /dev/null +++ b/Test/spv.sparseTexture.frag @@ -0,0 +1,80 @@ +#version 450 +#extension GL_ARB_sparse_texture2: enable + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DShadow; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DArrayShadow s2DArrayShadow; +uniform sampler2DRectShadow s2DRectShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; +uniform sampler2DMS s2DMS; + +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; + +uniform usamplerCubeArray usCubeArray; +uniform usampler2DRect us2DRect; + +uniform vec2 c2; +uniform vec3 c3; +uniform vec4 c4; + +uniform ivec2 offsets[4]; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureARB(s2D, c2, texel); + resident |= sparseTextureARB(s3D, c3, texel, 2.0); + resident |= sparseTextureARB(isCube, c3, itexel); + resident |= sparseTextureARB(s2DShadow, c3, texel.x); + resident |= sparseTextureARB(sCubeArrayShadow, c4, 1.0, texel.x); + + resident |= sparseTextureLodARB(s2D, c2, 2.0, texel); + resident |= sparseTextureLodARB(usCubeArray, c4, 1.0, utexel); + resident |= sparseTextureLodARB(s2DShadow, c3, 2.0, texel.y); + + resident |= sparseTextureOffsetARB(s3D, c3, ivec3(2), texel, 2.0); + resident |= sparseTextureOffsetARB(us2DRect, c2, ivec2(3), utexel); + resident |= sparseTextureOffsetARB(s2DArrayShadow, c4, ivec2(5), texel.z); + + resident |= sparseTexelFetchARB(s2D, ivec2(c2), 2, texel); + resident |= sparseTexelFetchARB(us2DRect, ivec2(c2), utexel); + resident |= sparseTexelFetchARB(s2DMS, ivec2(c2), 4, texel); + + resident |= sparseTexelFetchOffsetARB(s3D, ivec3(c3), 2, ivec3(4), texel); + resident |= sparseTexelFetchOffsetARB(us2DRect, ivec2(c2), ivec2(3), utexel); + + resident |= sparseTextureLodOffsetARB(s2D, c2, 2.0, ivec2(5), texel); + resident |= sparseTextureLodOffsetARB(is2DArray, c3, 2.0, ivec2(6), itexel); + resident |= sparseTextureLodOffsetARB(s2DShadow, c3, 2.0, ivec2(7), texel.z); + + resident |= sparseTextureGradARB(s3D, c3, c3, c3, texel); + resident |= sparseTextureGradARB(sCubeShadow, c4, c3, c3, texel.y); + resident |= sparseTextureGradARB(usCubeArray, c4, c3, c3, utexel); + + resident |= sparseTextureGradOffsetARB(s2D, c2, c2, c2, ivec2(5), texel); + resident |= sparseTextureGradOffsetARB(s2DRectShadow, c3, c2, c2, ivec2(6), texel.w); + resident |= sparseTextureGradOffsetARB(is2DArray, c3, c2, c2, ivec2(2), itexel); + + resident |= sparseTextureGatherARB(s2D, c2, texel); + resident |= sparseTextureGatherARB(is2DArray, c3, itexel, 2); + resident |= sparseTextureGatherARB(s2DArrayShadow, c3, 2.0, texel); + + resident |= sparseTextureGatherOffsetARB(s2D, c2, ivec2(4), texel); + resident |= sparseTextureGatherOffsetARB(is2DArray, c3, ivec2(5), itexel, 2); + resident |= sparseTextureGatherOffsetARB(s2DRectShadow, c2, 2.0, ivec2(7), texel); + + resident |= sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel); + resident |= sparseTextureGatherOffsetsARB(is2DArray, c3, offsets, itexel, 2); + resident |= sparseTextureGatherOffsetsARB(s2DRectShadow, c2, 2.0, offsets, texel); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +} \ No newline at end of file diff --git a/Test/spv.sparseTextureClamp.frag b/Test/spv.sparseTextureClamp.frag new file mode 100644 index 00000000..848d3774 --- /dev/null +++ b/Test/spv.sparseTextureClamp.frag @@ -0,0 +1,70 @@ +#version 450 +#extension GL_ARB_sparse_texture_clamp: enable + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DShadow; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DArrayShadow s2DArrayShadow; +uniform sampler2DRectShadow s2DRectShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; + +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; + +uniform usamplerCubeArray usCubeArray; +uniform usampler2DRect us2DRect; + +uniform vec2 c2; +uniform vec3 c3; +uniform vec4 c4; + +uniform float lodClamp; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureClampARB(s2D, c2, lodClamp, texel); + resident |= sparseTextureClampARB(s3D, c3, lodClamp, texel, 2.0); + resident |= sparseTextureClampARB(isCube, c3, lodClamp, itexel); + resident |= sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); + resident |= sparseTextureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp, texel.x); + + texel += textureClampARB(s2D, c2, lodClamp); + texel += textureClampARB(s3D, c3, lodClamp, 2.0); + itexel += textureClampARB(isCube, c3, lodClamp); + texel.x += textureClampARB(s2DShadow, c3, lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp); + + resident |= sparseTextureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, texel, 2.0); + resident |= sparseTextureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp, utexel); + resident |= sparseTextureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp, texel.z); + + texel += textureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, 2.0); + utexel += textureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp); + texel.z += textureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp); + + resident |= sparseTextureGradClampARB(s3D, c3, c3, c3, lodClamp, texel); + resident |= sparseTextureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp, texel.y); + resident |= sparseTextureGradClampARB(usCubeArray, c4, c3, c3, lodClamp, utexel); + + texel += textureGradClampARB(s3D, c3, c3, c3, lodClamp); + texel.y += textureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp); + utexel += textureGradClampARB(usCubeArray, c4, c3, c3, lodClamp); + + resident |= sparseTextureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp, texel); + resident |= sparseTextureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp, texel.w); + resident |= sparseTextureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp, itexel); + + texel += textureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp); + texel.w += textureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp); + itexel += textureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +} \ No newline at end of file diff --git a/Test/test-spirv-list b/Test/test-spirv-list index 799148db..af962627 100644 --- a/Test/test-spirv-list +++ b/Test/test-spirv-list @@ -66,6 +66,8 @@ spv.qualifiers.vert spv.shiftOps.frag spv.simpleFunctionCall.frag spv.simpleMat.vert +spv.sparseTexture.frag +spv.sparseTextureClamp.frag spv.structAssignment.frag spv.structDeref.frag spv.structure.frag diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index 59955fcf..cf701776 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -369,6 +369,8 @@ enum TOperator { EOpImageAtomicExchange, EOpImageAtomicCompSwap, + EOpSparseImageLoad, + EOpImageGuardEnd, // @@ -398,6 +400,31 @@ enum TOperator { EOpTextureGather, EOpTextureGatherOffset, EOpTextureGatherOffsets, + EOpTextureClamp, + EOpTextureOffsetClamp, + EOpTextureGradClamp, + EOpTextureGradOffsetClamp, + + EOpSparseTextureGuardBegin, + + EOpSparseTexture, + EOpSparseTextureLod, + EOpSparseTextureOffset, + EOpSparseTextureFetch, + EOpSparseTextureFetchOffset, + EOpSparseTextureLodOffset, + EOpSparseTextureGrad, + EOpSparseTextureGradOffset, + EOpSparseTextureGather, + EOpSparseTextureGatherOffset, + EOpSparseTextureGatherOffsets, + EOpSparseTexelsResident, + EOpSparseTextureClamp, + EOpSparseTextureOffsetClamp, + EOpSparseTextureGradClamp, + EOpSparseTextureGradOffsetClamp, + + EOpSparseTextureGuardEnd, EOpTextureGuardEnd, @@ -622,6 +649,7 @@ struct TCrackedTextureOp { bool offsets; bool gather; bool grad; + bool lodClamp; }; // @@ -637,6 +665,8 @@ public: bool isConstructor() const; bool isTexture() const { return op > EOpTextureGuardBegin && op < EOpTextureGuardEnd; } bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; } + bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; } + bool isSparseImage() const { return op == EOpSparseImageLoad; } // Crack the op into the individual dimensions of texturing operation. void crackTexture(TSampler sampler, TCrackedTextureOp& cracked) const @@ -649,6 +679,7 @@ public: cracked.offsets = false; cracked.gather = false; cracked.grad = false; + cracked.lodClamp = false; switch (op) { case EOpImageQuerySize: @@ -657,25 +688,40 @@ public: case EOpTextureQueryLod: case EOpTextureQueryLevels: case EOpTextureQuerySamples: + case EOpSparseTexelsResident: cracked.query = true; break; case EOpTexture: + case EOpSparseTexture: + break; + case EOpTextureClamp: + case EOpSparseTextureClamp: + cracked.lodClamp = true; break; case EOpTextureProj: cracked.proj = true; break; case EOpTextureLod: + case EOpSparseTextureLod: cracked.lod = true; break; case EOpTextureOffset: + case EOpSparseTextureOffset: cracked.offset = true; break; + case EOpTextureOffsetClamp: + case EOpSparseTextureOffsetClamp: + cracked.offset = true; + cracked.lodClamp = true; + break; case EOpTextureFetch: + case EOpSparseTextureFetch: cracked.fetch = true; if (sampler.dim == Esd1D || (sampler.dim == Esd2D && ! sampler.ms) || sampler.dim == Esd3D) cracked.lod = true; break; case EOpTextureFetchOffset: + case EOpSparseTextureFetchOffset: cracked.fetch = true; cracked.offset = true; if (sampler.dim == Esd1D || (sampler.dim == Esd2D && ! sampler.ms) || sampler.dim == Esd3D) @@ -686,6 +732,7 @@ public: cracked.proj = true; break; case EOpTextureLodOffset: + case EOpSparseTextureLodOffset: cracked.offset = true; cracked.lod = true; break; @@ -699,9 +746,16 @@ public: cracked.proj = true; break; case EOpTextureGrad: + case EOpSparseTextureGrad: cracked.grad = true; break; + case EOpTextureGradClamp: + case EOpSparseTextureGradClamp: + cracked.grad = true; + cracked.lodClamp = true; + break; case EOpTextureGradOffset: + case EOpSparseTextureGradOffset: cracked.grad = true; cracked.offset = true; break; @@ -714,14 +768,23 @@ public: cracked.offset = true; cracked.proj = true; break; + case EOpTextureGradOffsetClamp: + case EOpSparseTextureGradOffsetClamp: + cracked.grad = true; + cracked.offset = true; + cracked.lodClamp = true; + break; case EOpTextureGather: + case EOpSparseTextureGather: cracked.gather = true; break; case EOpTextureGatherOffset: + case EOpSparseTextureGatherOffset: cracked.gather = true; cracked.offset = true; break; case EOpTextureGatherOffsets: + case EOpSparseTextureGatherOffsets: cracked.gather = true; cracked.offsets = true; break; diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index c852d3cb..75e85661 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1956,6 +1956,14 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, i } } } + + // + // sparseTexelsResidentARB() + // + + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append("bool sparseTexelsResidentARB(int code);\n"); + } } // @@ -2069,6 +2077,15 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi commonBuiltins.append(prefixes[sampler.type]); commonBuiltins.append("vec4);\n"); + if (sampler.dim != Esd1D && sampler.dim != EsdBuffer && profile != EEsProfile && version >= 450) { + commonBuiltins.append("int sparseImageLoadARB(readonly volatile coherent "); + commonBuiltins.append(imageParams); + commonBuiltins.append(", out "); + commonBuiltins.append(prefixes[sampler.type]); + commonBuiltins.append("vec4"); + commonBuiltins.append(");\n"); + } + if ( profile != EEsProfile || (profile == EEsProfile && version >= 310)) { if (sampler.type == EbtInt || sampler.type == EbtUint) { @@ -2123,7 +2140,7 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi // // Add all the texture lookup functions for the given type. // -void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int /*version*/, EProfile /*profile*/) +void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) { // // texturing @@ -2196,97 +2213,148 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int /* if (extraProj && (sampler.dim == Esd3D || sampler.shadow)) continue; - TString s; + for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp) { // loop over "bool" lod clamp - // return type - if (sampler.shadow) - s.append("float "); - else { - s.append(prefixes[sampler.type]); - s.append("vec4 "); - } + if (lodClamp && (profile == EEsProfile || version < 450)) + continue; + if (lodClamp && (proj || lod || fetch)) + continue; - // name - if (fetch) - s.append("texel"); - else - s.append("texture"); - if (proj) - s.append("Proj"); - if (lod) - s.append("Lod"); - if (grad) - s.append("Grad"); - if (fetch) - s.append("Fetch"); - if (offset) - s.append("Offset"); - s.append("("); + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not - // sampler type - s.append(typeName); + if (sparse && (profile == EEsProfile || version < 450)) + continue; + // Sparse sampling is not for 1D/1D array texture, buffer texture, and projective texture + if (sparse && (sampler.dim == Esd1D || sampler.dim == EsdBuffer || proj)) + continue; - // P coordinate - if (extraProj) - s.append(",vec4"); - else { - s.append(","); - TBasicType t = fetch ? EbtInt : EbtFloat; - if (totalDims == 1) - s.append(TType::getBasicString(t)); - else { - s.append(prefixes[t]); - s.append("vec"); - s.append(postfixes[totalDims]); + TString s; + + // return type + if (sparse) + s.append("int "); + else { + if (sampler.shadow) + s.append("float "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + } + + // name + if (sparse) { + if (fetch) + s.append("sparseTexel"); + else + s.append("sparseTexture"); + } else { + if (fetch) + s.append("texel"); + else + s.append("texture"); + } + if (proj) + s.append("Proj"); + if (lod) + s.append("Lod"); + if (grad) + s.append("Grad"); + if (fetch) + s.append("Fetch"); + if (offset) + s.append("Offset"); + if (lodClamp) + s.append("Clamp"); + if (lodClamp || sparse) + s.append("ARB"); + s.append("("); + + // sampler type + s.append(typeName); + + // P coordinate + if (extraProj) + s.append(",vec4"); + else { + s.append(","); + TBasicType t = fetch ? EbtInt : EbtFloat; + if (totalDims == 1) + s.append(TType::getBasicString(t)); + else { + s.append(prefixes[t]); + s.append("vec"); + s.append(postfixes[totalDims]); + } + } + + if (bias && compare) + continue; + + // non-optional lod argument (lod that's not driven by lod loop) or sample + if ((fetch && sampler.dim != EsdBuffer && sampler.dim != EsdRect && !sampler.ms) || + (sampler.ms && fetch)) + s.append(",int"); + + // non-optional lod + if (lod) + s.append(",float"); + + // gradient arguments + if (grad) { + if (dimMap[sampler.dim] == 1) + s.append(",float,float"); + else { + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + s.append(",vec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } + + // offset + if (offset) { + if (dimMap[sampler.dim] == 1) + s.append(",int"); + else { + s.append(",ivec"); + s.append(postfixes[dimMap[sampler.dim]]); + } + } + + // non-optional compare + if (compare) + s.append(",float"); + + // lod clamp + if (lodClamp) + s.append(",float"); + + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + if (sampler.shadow) + s.append("float "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + } + + // optional bias + if (bias) + s.append(",float"); + + s.append(");\n"); + + // Add to the per-language set of built-ins + + if (bias) + stageBuiltins[EShLangFragment].append(s); + else + commonBuiltins.append(s); } } - - if (bias && compare) - continue; - - // non-optional lod argument (lod that's not driven by lod loop) or sample - if ((fetch && sampler.dim != EsdBuffer && sampler.dim != EsdRect && !sampler.ms) || - (sampler.ms && fetch)) - s.append(",int"); - - // non-optional lod - if (lod) - s.append(",float"); - - // gradient arguments - if (grad) { - if (dimMap[sampler.dim] == 1) - s.append(",float,float"); - else { - s.append(",vec"); - s.append(postfixes[dimMap[sampler.dim]]); - s.append(",vec"); - s.append(postfixes[dimMap[sampler.dim]]); - } - } - - // offset - if (offset) { - if (dimMap[sampler.dim] == 1) - s.append(",int"); - else { - s.append(",ivec"); - s.append(postfixes[dimMap[sampler.dim]]); - } - } - - // optional bias or non-optional compare - if (bias || compare) - s.append(",float"); - - s.append(");\n"); - - // Add to the per-language set of built-ins - - if (bias) - stageBuiltins[EShLangFragment].append(s); - else - commonBuiltins.append(s); } } } @@ -2303,7 +2371,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int /* // // Add all the texture gather functions for the given type. // -void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int version, EProfile /* profile */) +void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) { switch (sampler.dim) { case Esd2D: @@ -2330,51 +2398,71 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int vers if (offset > 0 && sampler.dim == EsdCube) continue; - TString s; + for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not + if (sparse && (profile == EEsProfile || version < 450)) + continue; - // return type - s.append(prefixes[sampler.type]); - s.append("vec4 "); + TString s; - // name - s.append("textureGather"); - switch (offset) { - case 1: - s.append("Offset"); - break; - case 2: - s.append("Offsets"); - default: - break; + // return type + if (sparse) + s.append("int "); + else { + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // name + if (sparse) + s.append("sparseTextureGather"); + else + s.append("textureGather"); + switch (offset) { + case 1: + s.append("Offset"); + break; + case 2: + s.append("Offsets"); + default: + break; + } + if (sparse) + s.append("ARB"); + s.append("("); + + // sampler type argument + s.append(typeName); + + // P coordinate argument + s.append(",vec"); + int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); + s.append(postfixes[totalDims]); + + // refZ argument + if (sampler.shadow) + s.append(",float"); + + // offset argument + if (offset > 0) { + s.append(",ivec2"); + if (offset == 2) + s.append("[4]"); + } + + // texel out (for sparse texture) + if (sparse) { + s.append(",out "); + s.append(prefixes[sampler.type]); + s.append("vec4 "); + } + + // comp argument + if (comp) + s.append(",int"); + + s.append(");\n"); + commonBuiltins.append(s); } - s.append("("); - - // sampler type argument - s.append(typeName); - - // P coordinate argument - s.append(",vec"); - int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); - s.append(postfixes[totalDims]); - - // refZ argument - if (sampler.shadow) - s.append(",float"); - - // offset argument - if (offset > 0) { - s.append(",ivec2"); - if (offset == 2) - s.append("[4]"); - } - - // comp argument - if (comp) - s.append(",int"); - - s.append(");\n"); - commonBuiltins.append(s); - //printf("%s", s.c_str()); } } } @@ -3164,6 +3252,37 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_ARB_derivative_control); } + // E_GL_ARB_sparse_texture2 + if (profile != EEsProfile) + { + symbolTable.setFunctionExtensions("sparseTextureARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureLodARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelFetchARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelFetchOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureLodOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGradARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGradOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherOffsetARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTextureGatherOffsetsARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseImageLoadARB", 1, &E_GL_ARB_sparse_texture2); + symbolTable.setFunctionExtensions("sparseTexelsResident", 1, &E_GL_ARB_sparse_texture2); + } + + // E_GL_ARB_sparse_texture_clamp + if (profile != EEsProfile) + { + symbolTable.setFunctionExtensions("sparseTextureClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureGradClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("sparseTextureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureGradClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + symbolTable.setFunctionExtensions("textureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); + } + symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); if (profile == EEsProfile) { @@ -3423,6 +3542,32 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.relateToOperator("shadow1DProjLod", EOpTextureProjLod); symbolTable.relateToOperator("shadow2DProjLod", EOpTextureProjLod); } + + if (profile != EEsProfile) + { + symbolTable.relateToOperator("sparseTextureARB", EOpSparseTexture); + symbolTable.relateToOperator("sparseTextureLodARB", EOpSparseTextureLod); + symbolTable.relateToOperator("sparseTextureOffsetARB", EOpSparseTextureOffset); + symbolTable.relateToOperator("sparseTexelFetchARB", EOpSparseTextureFetch); + symbolTable.relateToOperator("sparseTexelFetchOffsetARB", EOpSparseTextureFetchOffset); + symbolTable.relateToOperator("sparseTextureLodOffsetARB", EOpSparseTextureLodOffset); + symbolTable.relateToOperator("sparseTextureGradARB", EOpSparseTextureGrad); + symbolTable.relateToOperator("sparseTextureGradOffsetARB", EOpSparseTextureGradOffset); + symbolTable.relateToOperator("sparseTextureGatherARB", EOpSparseTextureGather); + symbolTable.relateToOperator("sparseTextureGatherOffsetARB", EOpSparseTextureGatherOffset); + symbolTable.relateToOperator("sparseTextureGatherOffsetsARB", EOpSparseTextureGatherOffsets); + symbolTable.relateToOperator("sparseImageLoadARB", EOpSparseImageLoad); + symbolTable.relateToOperator("sparseTexelsResidentARB", EOpSparseTexelsResident); + + symbolTable.relateToOperator("sparseTextureClampARB", EOpSparseTextureClamp); + symbolTable.relateToOperator("sparseTextureOffsetClampARB", EOpSparseTextureOffsetClamp); + symbolTable.relateToOperator("sparseTextureGradClampARB", EOpSparseTextureGradClamp); + symbolTable.relateToOperator("sparseTextureGradOffsetClampARB", EOpSparseTextureGradOffsetClamp); + symbolTable.relateToOperator("textureClampARB", EOpTextureClamp); + symbolTable.relateToOperator("textureOffsetClampARB", EOpTextureOffsetClamp); + symbolTable.relateToOperator("textureGradClampARB", EOpTextureGradClamp); + symbolTable.relateToOperator("textureGradOffsetClampARB", EOpTextureGradOffsetClamp); + } } switch(language) { diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 89534988..fb11f1be 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -173,6 +173,8 @@ void TParseContext::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable; extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable; extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable; + extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable; + extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable; // extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members // #line and #include @@ -274,6 +276,8 @@ const char* TParseContext::getPreamble() "#define GL_ARB_derivative_control 1\n" "#define GL_ARB_shader_texture_image_samples 1\n" "#define GL_ARB_viewport_array 1\n" + "#define GL_ARB_sparse_texture2 1\n" + "#define GL_ARB_sparse_texture_clamp 1\n" "#define GL_GOOGLE_cpp_style_line_directive 1\n" "#define GL_GOOGLE_include_directive 1\n" diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index a30ea7a6..0d79fab4 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -111,6 +111,8 @@ const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_pa const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control"; const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples"; const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array"; +const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; +const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; //const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members // #line and #include From 364c21c8c05d01690acc6b5b38788895487aa9dd Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Wed, 6 Jan 2016 13:41:02 -0500 Subject: [PATCH 02/24] Fix several build warnings/error encountered with VS2013 This also fixes the newlines for spirv.hpp to be consistent with the rest of the files. --- SPIRV/GlslangToSpv.cpp | 2 +- SPIRV/SpvBuilder.cpp | 2 +- SPIRV/spirv.hpp | 1756 +++++++++++++-------------- glslang/MachineIndependent/Scan.cpp | 2 +- 4 files changed, 881 insertions(+), 881 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 964ff09e..43cc03a4 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -2954,7 +2954,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: spv::Op opCode = spv::OpNop; int libCall = -1; - int consumedOperands = operands.size(); + size_t consumedOperands = operands.size(); spv::Id typeId0 = 0; if (consumedOperands > 0) typeId0 = builder.getTypeId(operands[0]); diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 3915b66e..969a6d7c 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1365,7 +1365,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter case OpImageQuerySize: case OpImageQuerySizeLod: { - int numComponents; + int numComponents = 0; switch (getTypeDimensionality(getImageType(parameters.sampler))) { case Dim1D: case DimBuffer: diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp index f3d42a93..0cc43aa4 100755 --- a/SPIRV/spirv.hpp +++ b/SPIRV/spirv.hpp @@ -1,878 +1,878 @@ -// Copyright (c) 2014-2015 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_H -#define spirv_H - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 10000 -#define SPV_REVISION 2 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 2; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_H - +// Copyright (c) 2014-2015 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_H +#define spirv_H + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 10000 +#define SPV_REVISION 2 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010000; +static const unsigned int Revision = 2; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum SourceLanguage { + SourceLanguageUnknown = 0, + SourceLanguageESSL = 1, + SourceLanguageGLSL = 2, + SourceLanguageOpenCL_C = 3, + SourceLanguageOpenCL_CPP = 4, +}; + +enum ExecutionModel { + ExecutionModelVertex = 0, + ExecutionModelTessellationControl = 1, + ExecutionModelTessellationEvaluation = 2, + ExecutionModelGeometry = 3, + ExecutionModelFragment = 4, + ExecutionModelGLCompute = 5, + ExecutionModelKernel = 6, +}; + +enum AddressingModel { + AddressingModelLogical = 0, + AddressingModelPhysical32 = 1, + AddressingModelPhysical64 = 2, +}; + +enum MemoryModel { + MemoryModelSimple = 0, + MemoryModelGLSL450 = 1, + MemoryModelOpenCL = 2, +}; + +enum ExecutionMode { + ExecutionModeInvocations = 0, + ExecutionModeSpacingEqual = 1, + ExecutionModeSpacingFractionalEven = 2, + ExecutionModeSpacingFractionalOdd = 3, + ExecutionModeVertexOrderCw = 4, + ExecutionModeVertexOrderCcw = 5, + ExecutionModePixelCenterInteger = 6, + ExecutionModeOriginUpperLeft = 7, + ExecutionModeOriginLowerLeft = 8, + ExecutionModeEarlyFragmentTests = 9, + ExecutionModePointMode = 10, + ExecutionModeXfb = 11, + ExecutionModeDepthReplacing = 12, + ExecutionModeDepthGreater = 14, + ExecutionModeDepthLess = 15, + ExecutionModeDepthUnchanged = 16, + ExecutionModeLocalSize = 17, + ExecutionModeLocalSizeHint = 18, + ExecutionModeInputPoints = 19, + ExecutionModeInputLines = 20, + ExecutionModeInputLinesAdjacency = 21, + ExecutionModeTriangles = 22, + ExecutionModeInputTrianglesAdjacency = 23, + ExecutionModeQuads = 24, + ExecutionModeIsolines = 25, + ExecutionModeOutputVertices = 26, + ExecutionModeOutputPoints = 27, + ExecutionModeOutputLineStrip = 28, + ExecutionModeOutputTriangleStrip = 29, + ExecutionModeVecTypeHint = 30, + ExecutionModeContractionOff = 31, +}; + +enum StorageClass { + StorageClassUniformConstant = 0, + StorageClassInput = 1, + StorageClassUniform = 2, + StorageClassOutput = 3, + StorageClassWorkgroup = 4, + StorageClassCrossWorkgroup = 5, + StorageClassPrivate = 6, + StorageClassFunction = 7, + StorageClassGeneric = 8, + StorageClassPushConstant = 9, + StorageClassAtomicCounter = 10, + StorageClassImage = 11, +}; + +enum Dim { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + DimCube = 3, + DimRect = 4, + DimBuffer = 5, + DimSubpassData = 6, +}; + +enum SamplerAddressingMode { + SamplerAddressingModeNone = 0, + SamplerAddressingModeClampToEdge = 1, + SamplerAddressingModeClamp = 2, + SamplerAddressingModeRepeat = 3, + SamplerAddressingModeRepeatMirrored = 4, +}; + +enum SamplerFilterMode { + SamplerFilterModeNearest = 0, + SamplerFilterModeLinear = 1, +}; + +enum ImageFormat { + ImageFormatUnknown = 0, + ImageFormatRgba32f = 1, + ImageFormatRgba16f = 2, + ImageFormatR32f = 3, + ImageFormatRgba8 = 4, + ImageFormatRgba8Snorm = 5, + ImageFormatRg32f = 6, + ImageFormatRg16f = 7, + ImageFormatR11fG11fB10f = 8, + ImageFormatR16f = 9, + ImageFormatRgba16 = 10, + ImageFormatRgb10A2 = 11, + ImageFormatRg16 = 12, + ImageFormatRg8 = 13, + ImageFormatR16 = 14, + ImageFormatR8 = 15, + ImageFormatRgba16Snorm = 16, + ImageFormatRg16Snorm = 17, + ImageFormatRg8Snorm = 18, + ImageFormatR16Snorm = 19, + ImageFormatR8Snorm = 20, + ImageFormatRgba32i = 21, + ImageFormatRgba16i = 22, + ImageFormatRgba8i = 23, + ImageFormatR32i = 24, + ImageFormatRg32i = 25, + ImageFormatRg16i = 26, + ImageFormatRg8i = 27, + ImageFormatR16i = 28, + ImageFormatR8i = 29, + ImageFormatRgba32ui = 30, + ImageFormatRgba16ui = 31, + ImageFormatRgba8ui = 32, + ImageFormatR32ui = 33, + ImageFormatRgb10a2ui = 34, + ImageFormatRg32ui = 35, + ImageFormatRg16ui = 36, + ImageFormatRg8ui = 37, + ImageFormatR16ui = 38, + ImageFormatR8ui = 39, +}; + +enum ImageChannelOrder { + ImageChannelOrderR = 0, + ImageChannelOrderA = 1, + ImageChannelOrderRG = 2, + ImageChannelOrderRA = 3, + ImageChannelOrderRGB = 4, + ImageChannelOrderRGBA = 5, + ImageChannelOrderBGRA = 6, + ImageChannelOrderARGB = 7, + ImageChannelOrderIntensity = 8, + ImageChannelOrderLuminance = 9, + ImageChannelOrderRx = 10, + ImageChannelOrderRGx = 11, + ImageChannelOrderRGBx = 12, + ImageChannelOrderDepth = 13, + ImageChannelOrderDepthStencil = 14, + ImageChannelOrdersRGB = 15, + ImageChannelOrdersRGBx = 16, + ImageChannelOrdersRGBA = 17, + ImageChannelOrdersBGRA = 18, +}; + +enum ImageChannelDataType { + ImageChannelDataTypeSnormInt8 = 0, + ImageChannelDataTypeSnormInt16 = 1, + ImageChannelDataTypeUnormInt8 = 2, + ImageChannelDataTypeUnormInt16 = 3, + ImageChannelDataTypeUnormShort565 = 4, + ImageChannelDataTypeUnormShort555 = 5, + ImageChannelDataTypeUnormInt101010 = 6, + ImageChannelDataTypeSignedInt8 = 7, + ImageChannelDataTypeSignedInt16 = 8, + ImageChannelDataTypeSignedInt32 = 9, + ImageChannelDataTypeUnsignedInt8 = 10, + ImageChannelDataTypeUnsignedInt16 = 11, + ImageChannelDataTypeUnsignedInt32 = 12, + ImageChannelDataTypeHalfFloat = 13, + ImageChannelDataTypeFloat = 14, + ImageChannelDataTypeUnormInt24 = 15, + ImageChannelDataTypeUnormInt101010_2 = 16, +}; + +enum ImageOperandsShift { + ImageOperandsBiasShift = 0, + ImageOperandsLodShift = 1, + ImageOperandsGradShift = 2, + ImageOperandsConstOffsetShift = 3, + ImageOperandsOffsetShift = 4, + ImageOperandsConstOffsetsShift = 5, + ImageOperandsSampleShift = 6, + ImageOperandsMinLodShift = 7, +}; + +enum ImageOperandsMask { + ImageOperandsMaskNone = 0, + ImageOperandsBiasMask = 0x00000001, + ImageOperandsLodMask = 0x00000002, + ImageOperandsGradMask = 0x00000004, + ImageOperandsConstOffsetMask = 0x00000008, + ImageOperandsOffsetMask = 0x00000010, + ImageOperandsConstOffsetsMask = 0x00000020, + ImageOperandsSampleMask = 0x00000040, + ImageOperandsMinLodMask = 0x00000080, +}; + +enum FPFastMathModeShift { + FPFastMathModeNotNaNShift = 0, + FPFastMathModeNotInfShift = 1, + FPFastMathModeNSZShift = 2, + FPFastMathModeAllowRecipShift = 3, + FPFastMathModeFastShift = 4, +}; + +enum FPFastMathModeMask { + FPFastMathModeMaskNone = 0, + FPFastMathModeNotNaNMask = 0x00000001, + FPFastMathModeNotInfMask = 0x00000002, + FPFastMathModeNSZMask = 0x00000004, + FPFastMathModeAllowRecipMask = 0x00000008, + FPFastMathModeFastMask = 0x00000010, +}; + +enum FPRoundingMode { + FPRoundingModeRTE = 0, + FPRoundingModeRTZ = 1, + FPRoundingModeRTP = 2, + FPRoundingModeRTN = 3, +}; + +enum LinkageType { + LinkageTypeExport = 0, + LinkageTypeImport = 1, +}; + +enum AccessQualifier { + AccessQualifierReadOnly = 0, + AccessQualifierWriteOnly = 1, + AccessQualifierReadWrite = 2, +}; + +enum FunctionParameterAttribute { + FunctionParameterAttributeZext = 0, + FunctionParameterAttributeSext = 1, + FunctionParameterAttributeByVal = 2, + FunctionParameterAttributeSret = 3, + FunctionParameterAttributeNoAlias = 4, + FunctionParameterAttributeNoCapture = 5, + FunctionParameterAttributeNoWrite = 6, + FunctionParameterAttributeNoReadWrite = 7, +}; + +enum Decoration { + DecorationRelaxedPrecision = 0, + DecorationSpecId = 1, + DecorationBlock = 2, + DecorationBufferBlock = 3, + DecorationRowMajor = 4, + DecorationColMajor = 5, + DecorationArrayStride = 6, + DecorationMatrixStride = 7, + DecorationGLSLShared = 8, + DecorationGLSLPacked = 9, + DecorationCPacked = 10, + DecorationBuiltIn = 11, + DecorationNoPerspective = 13, + DecorationFlat = 14, + DecorationPatch = 15, + DecorationCentroid = 16, + DecorationSample = 17, + DecorationInvariant = 18, + DecorationRestrict = 19, + DecorationAliased = 20, + DecorationVolatile = 21, + DecorationConstant = 22, + DecorationCoherent = 23, + DecorationNonWritable = 24, + DecorationNonReadable = 25, + DecorationUniform = 26, + DecorationSaturatedConversion = 28, + DecorationStream = 29, + DecorationLocation = 30, + DecorationComponent = 31, + DecorationIndex = 32, + DecorationBinding = 33, + DecorationDescriptorSet = 34, + DecorationOffset = 35, + DecorationXfbBuffer = 36, + DecorationXfbStride = 37, + DecorationFuncParamAttr = 38, + DecorationFPRoundingMode = 39, + DecorationFPFastMathMode = 40, + DecorationLinkageAttributes = 41, + DecorationNoContraction = 42, + DecorationInputAttachmentIndex = 43, + DecorationAlignment = 44, +}; + +enum BuiltIn { + BuiltInPosition = 0, + BuiltInPointSize = 1, + BuiltInClipDistance = 3, + BuiltInCullDistance = 4, + BuiltInVertexId = 5, + BuiltInInstanceId = 6, + BuiltInPrimitiveId = 7, + BuiltInInvocationId = 8, + BuiltInLayer = 9, + BuiltInViewportIndex = 10, + BuiltInTessLevelOuter = 11, + BuiltInTessLevelInner = 12, + BuiltInTessCoord = 13, + BuiltInPatchVertices = 14, + BuiltInFragCoord = 15, + BuiltInPointCoord = 16, + BuiltInFrontFacing = 17, + BuiltInSampleId = 18, + BuiltInSamplePosition = 19, + BuiltInSampleMask = 20, + BuiltInFragDepth = 22, + BuiltInHelperInvocation = 23, + BuiltInNumWorkgroups = 24, + BuiltInWorkgroupSize = 25, + BuiltInWorkgroupId = 26, + BuiltInLocalInvocationId = 27, + BuiltInGlobalInvocationId = 28, + BuiltInLocalInvocationIndex = 29, + BuiltInWorkDim = 30, + BuiltInGlobalSize = 31, + BuiltInEnqueuedWorkgroupSize = 32, + BuiltInGlobalOffset = 33, + BuiltInGlobalLinearId = 34, + BuiltInSubgroupSize = 36, + BuiltInSubgroupMaxSize = 37, + BuiltInNumSubgroups = 38, + BuiltInNumEnqueuedSubgroups = 39, + BuiltInSubgroupId = 40, + BuiltInSubgroupLocalInvocationId = 41, + BuiltInVertexIndex = 42, + BuiltInInstanceIndex = 43, +}; + +enum SelectionControlShift { + SelectionControlFlattenShift = 0, + SelectionControlDontFlattenShift = 1, +}; + +enum SelectionControlMask { + SelectionControlMaskNone = 0, + SelectionControlFlattenMask = 0x00000001, + SelectionControlDontFlattenMask = 0x00000002, +}; + +enum LoopControlShift { + LoopControlUnrollShift = 0, + LoopControlDontUnrollShift = 1, +}; + +enum LoopControlMask { + LoopControlMaskNone = 0, + LoopControlUnrollMask = 0x00000001, + LoopControlDontUnrollMask = 0x00000002, +}; + +enum FunctionControlShift { + FunctionControlInlineShift = 0, + FunctionControlDontInlineShift = 1, + FunctionControlPureShift = 2, + FunctionControlConstShift = 3, +}; + +enum FunctionControlMask { + FunctionControlMaskNone = 0, + FunctionControlInlineMask = 0x00000001, + FunctionControlDontInlineMask = 0x00000002, + FunctionControlPureMask = 0x00000004, + FunctionControlConstMask = 0x00000008, +}; + +enum MemorySemanticsShift { + MemorySemanticsAcquireShift = 1, + MemorySemanticsReleaseShift = 2, + MemorySemanticsAcquireReleaseShift = 3, + MemorySemanticsSequentiallyConsistentShift = 4, + MemorySemanticsUniformMemoryShift = 6, + MemorySemanticsSubgroupMemoryShift = 7, + MemorySemanticsWorkgroupMemoryShift = 8, + MemorySemanticsCrossWorkgroupMemoryShift = 9, + MemorySemanticsAtomicCounterMemoryShift = 10, + MemorySemanticsImageMemoryShift = 11, +}; + +enum MemorySemanticsMask { + MemorySemanticsMaskNone = 0, + MemorySemanticsAcquireMask = 0x00000002, + MemorySemanticsReleaseMask = 0x00000004, + MemorySemanticsAcquireReleaseMask = 0x00000008, + MemorySemanticsSequentiallyConsistentMask = 0x00000010, + MemorySemanticsUniformMemoryMask = 0x00000040, + MemorySemanticsSubgroupMemoryMask = 0x00000080, + MemorySemanticsWorkgroupMemoryMask = 0x00000100, + MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + MemorySemanticsAtomicCounterMemoryMask = 0x00000400, + MemorySemanticsImageMemoryMask = 0x00000800, +}; + +enum MemoryAccessShift { + MemoryAccessVolatileShift = 0, + MemoryAccessAlignedShift = 1, + MemoryAccessNontemporalShift = 2, +}; + +enum MemoryAccessMask { + MemoryAccessMaskNone = 0, + MemoryAccessVolatileMask = 0x00000001, + MemoryAccessAlignedMask = 0x00000002, + MemoryAccessNontemporalMask = 0x00000004, +}; + +enum Scope { + ScopeCrossDevice = 0, + ScopeDevice = 1, + ScopeWorkgroup = 2, + ScopeSubgroup = 3, + ScopeInvocation = 4, +}; + +enum GroupOperation { + GroupOperationReduce = 0, + GroupOperationInclusiveScan = 1, + GroupOperationExclusiveScan = 2, +}; + +enum KernelEnqueueFlags { + KernelEnqueueFlagsNoWait = 0, + KernelEnqueueFlagsWaitKernel = 1, + KernelEnqueueFlagsWaitWorkGroup = 2, +}; + +enum KernelProfilingInfoShift { + KernelProfilingInfoCmdExecTimeShift = 0, +}; + +enum KernelProfilingInfoMask { + KernelProfilingInfoMaskNone = 0, + KernelProfilingInfoCmdExecTimeMask = 0x00000001, +}; + +enum Capability { + CapabilityMatrix = 0, + CapabilityShader = 1, + CapabilityGeometry = 2, + CapabilityTessellation = 3, + CapabilityAddresses = 4, + CapabilityLinkage = 5, + CapabilityKernel = 6, + CapabilityVector16 = 7, + CapabilityFloat16Buffer = 8, + CapabilityFloat16 = 9, + CapabilityFloat64 = 10, + CapabilityInt64 = 11, + CapabilityInt64Atomics = 12, + CapabilityImageBasic = 13, + CapabilityImageReadWrite = 14, + CapabilityImageMipmap = 15, + CapabilityPipes = 17, + CapabilityGroups = 18, + CapabilityDeviceEnqueue = 19, + CapabilityLiteralSampler = 20, + CapabilityAtomicStorage = 21, + CapabilityInt16 = 22, + CapabilityTessellationPointSize = 23, + CapabilityGeometryPointSize = 24, + CapabilityImageGatherExtended = 25, + CapabilityStorageImageMultisample = 27, + CapabilityUniformBufferArrayDynamicIndexing = 28, + CapabilitySampledImageArrayDynamicIndexing = 29, + CapabilityStorageBufferArrayDynamicIndexing = 30, + CapabilityStorageImageArrayDynamicIndexing = 31, + CapabilityClipDistance = 32, + CapabilityCullDistance = 33, + CapabilityImageCubeArray = 34, + CapabilitySampleRateShading = 35, + CapabilityImageRect = 36, + CapabilitySampledRect = 37, + CapabilityGenericPointer = 38, + CapabilityInt8 = 39, + CapabilityInputAttachment = 40, + CapabilitySparseResidency = 41, + CapabilityMinLod = 42, + CapabilitySampled1D = 43, + CapabilityImage1D = 44, + CapabilitySampledCubeArray = 45, + CapabilitySampledBuffer = 46, + CapabilityImageBuffer = 47, + CapabilityImageMSArray = 48, + CapabilityStorageImageExtendedFormats = 49, + CapabilityImageQuery = 50, + CapabilityDerivativeControl = 51, + CapabilityInterpolationFunction = 52, + CapabilityTransformFeedback = 53, + CapabilityGeometryStreams = 54, + CapabilityStorageImageReadWithoutFormat = 55, + CapabilityStorageImageWriteWithoutFormat = 56, +}; + +enum Op { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_H + diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp index 25e55d90..80a077ce 100644 --- a/glslang/MachineIndependent/Scan.cpp +++ b/glslang/MachineIndependent/Scan.cpp @@ -309,7 +309,7 @@ struct str_hash unsigned long hash = 5381; int c; - while ((c = *str++)) + while ((c = *str++) != 0) hash = ((hash << 5) + hash) + c; return hash; From e602d25f09d430c26862dfa4a07ec02f38764e96 Mon Sep 17 00:00:00 2001 From: Andrew Woloszyn Date: Tue, 12 Jan 2016 15:45:55 -0500 Subject: [PATCH 03/24] Removed strcpy that copied to itself. Found by running glslang with -fsanitize=address in clang. Also fixes a potential buffer-overrun with return from lReadByte. --- glslang/MachineIndependent/preprocessor/PpTokens.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/glslang/MachineIndependent/preprocessor/PpTokens.cpp index 642793d9..52343b7c 100644 --- a/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -195,7 +195,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) case PpAtomConstUint: len = 0; ch = lReadByte(pTok); - while (ch != 0) { + while (ch != 0 && ch != EndOfInput) { if (len < MaxTokenLength) { tokenText[len] = (char)ch; len++; @@ -215,12 +215,10 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) break; case PpAtomConstFloat: case PpAtomConstDouble: - strcpy(ppToken->name, tokenText); ppToken->dval = atof(ppToken->name); break; case PpAtomConstInt: case PpAtomConstUint: - strcpy(ppToken->name, tokenText); if (len > 0 && tokenText[0] == '0') { if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X')) ppToken->ival = strtol(ppToken->name, 0, 16); From 79b7046a272ffd33f221b85cf45a128fc498680f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 12 Jan 2016 13:04:52 -0800 Subject: [PATCH 04/24] getBaseAlignment: Round up structure sizes to max alignment --- glslang/MachineIndependent/linkValidate.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 7c96d225..664a8dff 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -959,6 +959,11 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b size += memberSize; } + // The structure may have padding at the end; the base offset of + // the member following the sub-structure is rounded up to the next + // multiple of the base alignment of the structure. + RoundToPow2(size, maxAlignment); + return maxAlignment; } From a76766a43474f11b00c89eef6ef3772c6537a4c2 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 13 Jan 2016 17:14:43 -0800 Subject: [PATCH 05/24] getBaseAlignment: Use the rowMajor argument for determining matrix strides The argument version is passed in from above and struct handling ensures that row-majorness gets propagated correctly from one level to the next. If we just look at the type itself and it's embedded in a struct that's declared row-major, we may get the wrong stride. --- glslang/MachineIndependent/linkValidate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 664a8dff..d0e7b021 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -987,7 +987,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b // rules 5 and 7 if (type.isMatrix()) { // rule 5: deref to row, not to column, meaning the size of vector is num columns instead of num rows - TType derefType(type, 0, type.getQualifier().layoutMatrix == ElmRowMajor); + TType derefType(type, 0, rowMajor); alignment = getBaseAlignment(derefType, size, dummyStride, std140, rowMajor); if (std140) From e95fa5e0959d8cff720daa1d9ba10b7f3312f9b2 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Wed, 13 Jan 2016 19:04:19 -0700 Subject: [PATCH 06/24] Tests: Update to match previous pull request. --- Test/baseResults/reflection.vert.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test/baseResults/reflection.vert.out b/Test/baseResults/reflection.vert.out index 7e9d322d..43fb2340 100644 --- a/Test/baseResults/reflection.vert.out +++ b/Test/baseResults/reflection.vert.out @@ -85,7 +85,7 @@ Uniform block reflection: nameless: offset -1, type ffffffff, size 496, index -1 named: offset -1, type ffffffff, size 304, index -1 c_nameless: offset -1, type ffffffff, size 112, index -1 -nested: offset -1, type ffffffff, size 28, index -1 +nested: offset -1, type ffffffff, size 32, index -1 abl[0]: offset -1, type ffffffff, size 4, index -1 abl[1]: offset -1, type ffffffff, size 4, index -1 abl[2]: offset -1, type ffffffff, size 4, index -1 From c57b2a97fa808970a4809c53de605bbf103fce12 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Sat, 16 Jan 2016 15:30:03 -0700 Subject: [PATCH 07/24] Memory/Perf: For link-mode, isolate file I/O so API can be looped over. Separating file I/O from compile/link lets the compile/link be done repeatedly in a loop for testing and measuring of performance and memory footprint, including seeing memory growth over time for functional-level memory-leak testing. While the older compile-only mode already had this functionality, and typically showed no memory leaks, SPIR-V uses the link path, has pending "TODO" for memory freeing, and this shows several kilobytes of leaking per compile-link. Most likely, pending merge request 131 will address much of this. --- StandAlone/StandAlone.cpp | 112 +++++++++++++++++------ glslang/OSDependent/Windows/ossource.cpp | 2 + 2 files changed, 87 insertions(+), 27 deletions(-) diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 92010840..45527d85 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -658,17 +658,27 @@ void StderrIfNonEmpty(const char* str) } } +// Simple bundling of what makes a compilation unit for ease in passing around, +// and separation of handling file IO versus API (programmatic) compilation. +struct ShaderCompUnit { + EShLanguage stage; + std::string fileName; + char** text; // memory owned/managed externally +}; + // -// For linking mode: Will independently parse each item in the worklist, but then put them -// in the same program and link them together. +// For linking mode: Will independently parse each compilation unit, but then put them +// in the same program and link them together, making at most one linked module per +// pipeline stage. // // Uses the new C++ interface instead of the old handle-based interface. // -void CompileAndLinkShaders() + +void CompileAndLinkShaderUnits(std::vector compUnits) { // keep track of what to free std::list shaders; - + EShMessages messages = EShMsgDefault; SetMessageOptions(messages); @@ -677,22 +687,13 @@ void CompileAndLinkShaders() // glslang::TProgram& program = *new glslang::TProgram; - glslang::TWorkItem* workItem; - while (Worklist.remove(workItem)) { - EShLanguage stage = FindLanguage(workItem->name); - glslang::TShader* shader = new glslang::TShader(stage); + for (auto compUnit : compUnits) { + glslang::TShader* shader = new glslang::TShader(compUnit.stage); + shader->setStrings(compUnit.text, 1); shaders.push_back(shader); - - char** shaderStrings = ReadFileData(workItem->name.c_str()); - if (! shaderStrings) { - usage(); - delete &program; - return; - } const int defaultVersion = Options & EOptionDefaultDesktop? 110: 100; - shader->setStrings(shaderStrings, 1); if (Options & EOptionOutputPreprocessed) { std::string str; if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, @@ -703,7 +704,6 @@ void CompileAndLinkShaders() } StderrIfNonEmpty(shader->getInfoLog()); StderrIfNonEmpty(shader->getInfoDebugLog()); - FreeFileData(shaderStrings); continue; } if (! shader->parse(&Resources, defaultVersion, false, messages)) @@ -711,13 +711,12 @@ void CompileAndLinkShaders() program.addShader(shader); - if (! (Options & EOptionSuppressInfolog)) { - PutsIfNonEmpty(workItem->name.c_str()); + if (! (Options & EOptionSuppressInfolog) && + ! (Options & EOptionMemoryLeakMode)) { + PutsIfNonEmpty(compUnit.fileName.c_str()); PutsIfNonEmpty(shader->getInfoLog()); PutsIfNonEmpty(shader->getInfoDebugLog()); } - - FreeFileData(shaderStrings); } // @@ -727,7 +726,8 @@ void CompileAndLinkShaders() if (! (Options & EOptionOutputPreprocessed) && ! program.link(messages)) LinkFailed = true; - if (! (Options & EOptionSuppressInfolog)) { + if (! (Options & EOptionSuppressInfolog) && + ! (Options & EOptionMemoryLeakMode)) { PutsIfNonEmpty(program.getInfoLog()); PutsIfNonEmpty(program.getInfoDebugLog()); } @@ -745,10 +745,15 @@ void CompileAndLinkShaders() if (program.getIntermediate((EShLanguage)stage)) { std::vector spirv; glslang::GlslangToSpv(*program.getIntermediate((EShLanguage)stage), spirv); - glslang::OutputSpv(spirv, GetBinaryName((EShLanguage)stage)); - if (Options & EOptionHumanReadableSpv) { - spv::Parameterize(); - spv::Disassemble(std::cout, spirv); + + // Dump the spv to a file or stdout, etc., but only if not doing + // memory/perf testing, as it's not internal to programmatic use. + if (! (Options & EOptionMemoryLeakMode)) { + glslang::OutputSpv(spirv, GetBinaryName((EShLanguage)stage)); + if (Options & EOptionHumanReadableSpv) { + spv::Parameterize(); + spv::Disassemble(std::cout, spirv); + } } } } @@ -766,6 +771,59 @@ void CompileAndLinkShaders() } } +// +// Do file IO part of compile and link, handing off the pure +// API/programmatic mode to CompileAndLinkShaderUnits(), which can +// be put in a loop for testing memory footprint and performance. +// +// This is just for linking mode: meaning all the shaders will be put into the +// the same program linked together. +// +// This means there are a limited number of work items (not multi-threading mode) +// and that the point is testing at the linking level. Hence, to enable +// performance and memory testing, the actual compile/link can be put in +// a loop, independent of processing the work items and file IO. +// +void CompileAndLinkShaderFiles() +{ + std::vector compUnits; + + // Transfer all the work items from to a simple list of + // of compilation units. (We don't care about the thread + // work-item distribution properties in this path, which + // is okay due to the limited number of shaders, know since + // they are all getting linked together.) + glslang::TWorkItem* workItem; + while (Worklist.remove(workItem)) { + ShaderCompUnit compUnit = { + FindLanguage(workItem->name), + workItem->name, + ReadFileData(workItem->name.c_str()) + }; + + if (! compUnit.text) { + usage(); + return; + } + + compUnits.push_back(compUnit); + } + + // Actual call to programmatic processing of compile and link, + // in a loop for testing memory and performance. This part contains + // all the perf/memory that a programmatic consumer will care about. + for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) { + for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) + CompileAndLinkShaderUnits(compUnits); + + if (Options & EOptionMemoryLeakMode) + glslang::OS_DumpMemoryCounters(); + } + + for (auto c : compUnits) + FreeFileData(c.text); +} + int C_DECL main(int argc, char* argv[]) { ProcessArguments(argc, argv); @@ -803,7 +861,7 @@ int C_DECL main(int argc, char* argv[]) if (Options & EOptionLinkProgram || Options & EOptionOutputPreprocessed) { glslang::InitializeProcess(); - CompileAndLinkShaders(); + CompileAndLinkShaderFiles(); glslang::FinalizeProcess(); } else { ShInitialize(); diff --git a/glslang/OSDependent/Windows/ossource.cpp b/glslang/OSDependent/Windows/ossource.cpp index b5ce18c2..56dbf791 100644 --- a/glslang/OSDependent/Windows/ossource.cpp +++ b/glslang/OSDependent/Windows/ossource.cpp @@ -147,6 +147,8 @@ void OS_Sleep(int milliseconds) Sleep(milliseconds); } +//#define DUMP_COUNTERS + void OS_DumpMemoryCounters() { #ifdef DUMP_COUNTERS From 712ecb96a2256093761ec958a7232445ba19d231 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Sat, 16 Jan 2016 20:37:43 -0700 Subject: [PATCH 08/24] Doubles: Add all the missing built-in double-based prototypes. --- Test/400.frag | 2 +- Test/400.geom | 213 +++ Test/baseResults/400.frag.out | 64 +- Test/baseResults/400.geom.out | 1698 +++++++++++++++++++++ Test/baseResults/spv.400.frag.out | 1483 ++++++++++++++++-- Test/spv.400.frag | 218 +++ glslang/MachineIndependent/Initialize.cpp | 208 +++ 7 files changed, 3699 insertions(+), 187 deletions(-) diff --git a/Test/400.frag b/Test/400.frag index bb4d2b58..059743e4 100644 --- a/Test/400.frag +++ b/Test/400.frag @@ -60,7 +60,7 @@ patch out vec4 patchOut; // ERROR void foo24() { dvec3 df, di; - df = modf(outp.xyz, di); + df = modf(dvec3(outp.xyz), di); } in float in1; diff --git a/Test/400.geom b/Test/400.geom index e2ca9b91..0b77e121 100644 --- a/Test/400.geom +++ b/Test/400.geom @@ -115,3 +115,216 @@ void qlod() lod = textureQueryLod(samp1D, pf); // ERROR, only in fragment lod = textureQueryLod(samp2Ds, pf2); // ERROR, only in fragment } + +void doubles() +{ + double doublev; + dvec2 dvec2v; + dvec3 dvec3v; + dvec4 dvec4v; + + bool boolv; + bvec2 bvec2v; + bvec3 bvec3v; + bvec4 bvec4v; + + doublev = sqrt(2.9); + dvec2v = sqrt(dvec2(2.7)); + dvec3v = sqrt(dvec3(2.0)); + dvec4v = sqrt(dvec4(2.1)); + + doublev += inversesqrt(doublev); + dvec2v += inversesqrt(dvec2v); + dvec3v += inversesqrt(dvec3v); + dvec4v += inversesqrt(dvec4v); + + doublev += abs(doublev); + dvec2v += abs(dvec2v); + dvec3v += abs(dvec3v); + dvec4v += abs(dvec4v); + + doublev += sign(doublev); + dvec2v += sign(dvec2v); + dvec3v += sign(dvec3v); + dvec4v += sign(dvec4v); + + doublev += floor(doublev); + dvec2v += floor(dvec2v); + dvec3v += floor(dvec3v); + dvec4v += floor(dvec4v); + + doublev += trunc(doublev); + dvec2v += trunc(dvec2v); + dvec3v += trunc(dvec3v); + dvec4v += trunc(dvec4v); + + doublev += round(doublev); + dvec2v += round(dvec2v); + dvec3v += round(dvec3v); + dvec4v += round(dvec4v); + + doublev += roundEven(doublev); + dvec2v += roundEven(dvec2v); + dvec3v += roundEven(dvec3v); + dvec4v += roundEven(dvec4v); + + doublev += ceil(doublev); + dvec2v += ceil(dvec2v); + dvec3v += ceil(dvec3v); + dvec4v += ceil(dvec4v); + + doublev += fract(doublev); + dvec2v += fract(dvec2v); + dvec3v += fract(dvec3v); + dvec4v += fract(dvec4v); + + doublev += mod(doublev, doublev); + dvec2v += mod(dvec2v, doublev); + dvec3v += mod(dvec3v, doublev); + dvec4v += mod(dvec4v, doublev); + dvec2v += mod(dvec2v, dvec2v); + dvec3v += mod(dvec3v, dvec3v); + dvec4v += mod(dvec4v, dvec4v); + + doublev += modf(doublev, doublev); + dvec2v += modf(dvec2v, dvec2v); + dvec3v += modf(dvec3v, dvec3v); + dvec4v += modf(dvec4v, dvec4v); + + doublev += min(doublev, doublev); + dvec2v += min(dvec2v, doublev); + dvec3v += min(dvec3v, doublev); + dvec4v += min(dvec4v, doublev); + dvec2v += min(dvec2v, dvec2v); + dvec3v += min(dvec3v, dvec3v); + dvec4v += min(dvec4v, dvec4v); + + doublev += max(doublev, doublev); + dvec2v += max(dvec2v, doublev); + dvec3v += max(dvec3v, doublev); + dvec4v += max(dvec4v, doublev); + dvec2v += max(dvec2v, dvec2v); + dvec3v += max(dvec3v, dvec3v); + dvec4v += max(dvec4v, dvec4v); + + doublev += clamp(doublev, doublev, doublev); + dvec2v += clamp(dvec2v, doublev, doublev); + dvec3v += clamp(dvec3v, doublev, doublev); + dvec4v += clamp(dvec4v, doublev, doublev); + dvec2v += clamp(dvec2v, dvec2v, dvec2v); + dvec3v += clamp(dvec3v, dvec3v, dvec3v); + dvec4v += clamp(dvec4v, dvec4v, dvec4v); + + doublev += mix(doublev, doublev, doublev); + dvec2v += mix(dvec2v, dvec2v, doublev); + dvec3v += mix(dvec3v, dvec3v, doublev); + dvec4v += mix(dvec4v, dvec4v, doublev); + dvec2v += mix(dvec2v, dvec2v, dvec2v); + dvec3v += mix(dvec3v, dvec3v, dvec3v); + dvec4v += mix(dvec4v, dvec4v, dvec4v); + doublev += mix(doublev, doublev, boolv); + dvec2v += mix(dvec2v, dvec2v, bvec2v); + dvec3v += mix(dvec3v, dvec3v, bvec3v); + dvec4v += mix(dvec4v, dvec4v, bvec4v); + + doublev += step(doublev, doublev); + dvec2v += step(dvec2v, dvec2v); + dvec3v += step(dvec3v, dvec3v); + dvec4v += step(dvec4v, dvec4v); + dvec2v += step(doublev, dvec2v); + dvec3v += step(doublev, dvec3v); + dvec4v += step(doublev, dvec4v); + + doublev += smoothstep(doublev, doublev, doublev); + dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); + dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); + dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); + dvec2v += smoothstep(doublev, doublev, dvec2v); + dvec3v += smoothstep(doublev, doublev, dvec3v); + dvec4v += smoothstep(doublev, doublev, dvec4v); + + boolv = isnan(doublev); + bvec2v = isnan(dvec2v); + bvec3v = isnan(dvec3v); + bvec4v = isnan(dvec4v); + + boolv = boolv ? isinf(doublev) : false; + bvec2v = boolv ? isinf(dvec2v) : bvec2(false); + bvec3v = boolv ? isinf(dvec3v) : bvec3(false); + bvec4v = boolv ? isinf(dvec4v) : bvec4(false); + + doublev += length(doublev); + doublev += length(dvec2v); + doublev += length(dvec3v); + doublev += length(dvec4v); + + doublev += distance(doublev, doublev); + doublev += distance(dvec2v, dvec2v); + doublev += distance(dvec3v, dvec3v); + doublev += distance(dvec4v, dvec4v); + + doublev += dot(doublev, doublev); + doublev += dot(dvec2v, dvec2v); + doublev += dot(dvec3v, dvec3v); + doublev += dot(dvec4v, dvec4v); + + dvec3v += cross(dvec3v, dvec3v); + + doublev += normalize(doublev); + dvec2v += normalize(dvec2v); + dvec3v += normalize(dvec3v); + dvec4v += normalize(dvec4v); + + doublev += faceforward(doublev, doublev, doublev); + dvec2v += faceforward(dvec2v, dvec2v, dvec2v); + dvec3v += faceforward(dvec3v, dvec3v, dvec3v); + dvec4v += faceforward(dvec4v, dvec4v, dvec4v); + + doublev += reflect(doublev, doublev); + dvec2v += reflect(dvec2v, dvec2v); + dvec3v += reflect(dvec3v, dvec3v); + dvec4v += reflect(dvec4v, dvec4v); + + doublev += refract(doublev, doublev, doublev); + dvec2v += refract(dvec2v, dvec2v, doublev); + dvec3v += refract(dvec3v, dvec3v, doublev); + dvec4v += refract(dvec4v, dvec4v, doublev); + + dmat2 dmat2v = outerProduct(dvec2v, dvec2v); + dmat3 dmat3v = outerProduct(dvec3v, dvec3v); + dmat4 dmat4v = outerProduct(dvec4v, dvec4v); + dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); + dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); + dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); + dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); + dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); + dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); + + dmat2v *= matrixCompMult(dmat2v, dmat2v); + dmat3v *= matrixCompMult(dmat3v, dmat3v); + dmat4v *= matrixCompMult(dmat4v, dmat4v); + dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); + dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); + dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); + dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); + dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); + dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); + + dmat2v *= transpose(dmat2v); + dmat3v *= transpose(dmat3v); + dmat4v *= transpose(dmat4v); + dmat2x3v = transpose(dmat3x2v); + dmat3x2v = transpose(dmat2x3v); + dmat2x4v = transpose(dmat4x2v); + dmat4x2v = transpose(dmat2x4v); + dmat3x4v = transpose(dmat4x3v); + dmat4x3v = transpose(dmat3x4v); + + doublev += determinant(dmat2v); + doublev += determinant(dmat3v); + doublev += determinant(dmat4v); + + dmat2v *= inverse(dmat2v); + dmat3v *= inverse(dmat3v); + dmat4v *= inverse(dmat4v); +} diff --git a/Test/baseResults/400.frag.out b/Test/baseResults/400.frag.out index 0069585b..33a8c9ab 100644 --- a/Test/baseResults/400.frag.out +++ b/Test/baseResults/400.frag.out @@ -218,26 +218,18 @@ ERROR: node is still EOpNull! 0:? Sequence 0:63 move second child to first child (temp 3-component vector of double) 0:63 'df' (temp 3-component vector of double) -0:63 Convert float to double (temp 3-component vector of double) -0:63 Comma (global 3-component vector of float) -0:63 move second child to first child (temp 3-component vector of float) -0:63 'tempReturn' (global 3-component vector of float) -0:63 modf (global 3-component vector of float) -0:63 vector swizzle (temp 3-component vector of float) -0:63 'outp' (out 4-component vector of float) -0:63 Sequence -0:63 Constant: -0:63 0 (const int) -0:63 Constant: -0:63 1 (const int) -0:63 Constant: -0:63 2 (const int) -0:63 'tempArg' (temp 3-component vector of float) -0:63 move second child to first child (temp 3-component vector of double) -0:63 'di' (temp 3-component vector of double) -0:63 Convert float to double (temp 3-component vector of double) -0:63 'tempArg' (temp 3-component vector of float) -0:63 'tempReturn' (global 3-component vector of float) +0:63 modf (global 3-component vector of double) +0:63 Convert float to double (temp 3-component vector of double) +0:63 vector swizzle (temp 3-component vector of float) +0:63 'outp' (out 4-component vector of float) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 'di' (temp 3-component vector of double) 0:71 Function Definition: foodc1( (global void) 0:71 Function Parameters: 0:73 Sequence @@ -707,26 +699,18 @@ ERROR: node is still EOpNull! 0:? Sequence 0:63 move second child to first child (temp 3-component vector of double) 0:63 'df' (temp 3-component vector of double) -0:63 Convert float to double (temp 3-component vector of double) -0:63 Comma (global 3-component vector of float) -0:63 move second child to first child (temp 3-component vector of float) -0:63 'tempReturn' (global 3-component vector of float) -0:63 modf (global 3-component vector of float) -0:63 vector swizzle (temp 3-component vector of float) -0:63 'outp' (out 4-component vector of float) -0:63 Sequence -0:63 Constant: -0:63 0 (const int) -0:63 Constant: -0:63 1 (const int) -0:63 Constant: -0:63 2 (const int) -0:63 'tempArg' (temp 3-component vector of float) -0:63 move second child to first child (temp 3-component vector of double) -0:63 'di' (temp 3-component vector of double) -0:63 Convert float to double (temp 3-component vector of double) -0:63 'tempArg' (temp 3-component vector of float) -0:63 'tempReturn' (global 3-component vector of float) +0:63 modf (global 3-component vector of double) +0:63 Convert float to double (temp 3-component vector of double) +0:63 vector swizzle (temp 3-component vector of float) +0:63 'outp' (out 4-component vector of float) +0:63 Sequence +0:63 Constant: +0:63 0 (const int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 'di' (temp 3-component vector of double) 0:71 Function Definition: foodc1( (global void) 0:71 Function Parameters: 0:73 Sequence diff --git a/Test/baseResults/400.geom.out b/Test/baseResults/400.geom.out index f120327b..16117e62 100644 --- a/Test/baseResults/400.geom.out +++ b/Test/baseResults/400.geom.out @@ -174,6 +174,855 @@ ERROR: node is still EOpNull! 0:? Sequence 0:115 'lod' (temp 2-component vector of float) 0:116 'lod' (temp 2-component vector of float) +0:119 Function Definition: doubles( (global void) +0:119 Function Parameters: +0:? Sequence +0:131 move second child to first child (temp double) +0:131 'doublev' (temp double) +0:131 Constant: +0:131 1.702939 +0:132 move second child to first child (temp 2-component vector of double) +0:132 'dvec2v' (temp 2-component vector of double) +0:132 Constant: +0:132 1.643168 +0:132 1.643168 +0:133 move second child to first child (temp 3-component vector of double) +0:133 'dvec3v' (temp 3-component vector of double) +0:133 Constant: +0:133 1.414214 +0:133 1.414214 +0:133 1.414214 +0:134 move second child to first child (temp 4-component vector of double) +0:134 'dvec4v' (temp 4-component vector of double) +0:134 Constant: +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:136 add second child into first child (temp double) +0:136 'doublev' (temp double) +0:136 inverse sqrt (global double) +0:136 'doublev' (temp double) +0:137 add second child into first child (temp 2-component vector of double) +0:137 'dvec2v' (temp 2-component vector of double) +0:137 inverse sqrt (global 2-component vector of double) +0:137 'dvec2v' (temp 2-component vector of double) +0:138 add second child into first child (temp 3-component vector of double) +0:138 'dvec3v' (temp 3-component vector of double) +0:138 inverse sqrt (global 3-component vector of double) +0:138 'dvec3v' (temp 3-component vector of double) +0:139 add second child into first child (temp 4-component vector of double) +0:139 'dvec4v' (temp 4-component vector of double) +0:139 inverse sqrt (global 4-component vector of double) +0:139 'dvec4v' (temp 4-component vector of double) +0:141 add second child into first child (temp double) +0:141 'doublev' (temp double) +0:141 Absolute value (global double) +0:141 'doublev' (temp double) +0:142 add second child into first child (temp 2-component vector of double) +0:142 'dvec2v' (temp 2-component vector of double) +0:142 Absolute value (global 2-component vector of double) +0:142 'dvec2v' (temp 2-component vector of double) +0:143 add second child into first child (temp 3-component vector of double) +0:143 'dvec3v' (temp 3-component vector of double) +0:143 Absolute value (global 3-component vector of double) +0:143 'dvec3v' (temp 3-component vector of double) +0:144 add second child into first child (temp 4-component vector of double) +0:144 'dvec4v' (temp 4-component vector of double) +0:144 Absolute value (global 4-component vector of double) +0:144 'dvec4v' (temp 4-component vector of double) +0:146 add second child into first child (temp double) +0:146 'doublev' (temp double) +0:146 Sign (global double) +0:146 'doublev' (temp double) +0:147 add second child into first child (temp 2-component vector of double) +0:147 'dvec2v' (temp 2-component vector of double) +0:147 Sign (global 2-component vector of double) +0:147 'dvec2v' (temp 2-component vector of double) +0:148 add second child into first child (temp 3-component vector of double) +0:148 'dvec3v' (temp 3-component vector of double) +0:148 Sign (global 3-component vector of double) +0:148 'dvec3v' (temp 3-component vector of double) +0:149 add second child into first child (temp 4-component vector of double) +0:149 'dvec4v' (temp 4-component vector of double) +0:149 Sign (global 4-component vector of double) +0:149 'dvec4v' (temp 4-component vector of double) +0:151 add second child into first child (temp double) +0:151 'doublev' (temp double) +0:151 Floor (global double) +0:151 'doublev' (temp double) +0:152 add second child into first child (temp 2-component vector of double) +0:152 'dvec2v' (temp 2-component vector of double) +0:152 Floor (global 2-component vector of double) +0:152 'dvec2v' (temp 2-component vector of double) +0:153 add second child into first child (temp 3-component vector of double) +0:153 'dvec3v' (temp 3-component vector of double) +0:153 Floor (global 3-component vector of double) +0:153 'dvec3v' (temp 3-component vector of double) +0:154 add second child into first child (temp 4-component vector of double) +0:154 'dvec4v' (temp 4-component vector of double) +0:154 Floor (global 4-component vector of double) +0:154 'dvec4v' (temp 4-component vector of double) +0:156 add second child into first child (temp double) +0:156 'doublev' (temp double) +0:156 trunc (global double) +0:156 'doublev' (temp double) +0:157 add second child into first child (temp 2-component vector of double) +0:157 'dvec2v' (temp 2-component vector of double) +0:157 trunc (global 2-component vector of double) +0:157 'dvec2v' (temp 2-component vector of double) +0:158 add second child into first child (temp 3-component vector of double) +0:158 'dvec3v' (temp 3-component vector of double) +0:158 trunc (global 3-component vector of double) +0:158 'dvec3v' (temp 3-component vector of double) +0:159 add second child into first child (temp 4-component vector of double) +0:159 'dvec4v' (temp 4-component vector of double) +0:159 trunc (global 4-component vector of double) +0:159 'dvec4v' (temp 4-component vector of double) +0:161 add second child into first child (temp double) +0:161 'doublev' (temp double) +0:161 round (global double) +0:161 'doublev' (temp double) +0:162 add second child into first child (temp 2-component vector of double) +0:162 'dvec2v' (temp 2-component vector of double) +0:162 round (global 2-component vector of double) +0:162 'dvec2v' (temp 2-component vector of double) +0:163 add second child into first child (temp 3-component vector of double) +0:163 'dvec3v' (temp 3-component vector of double) +0:163 round (global 3-component vector of double) +0:163 'dvec3v' (temp 3-component vector of double) +0:164 add second child into first child (temp 4-component vector of double) +0:164 'dvec4v' (temp 4-component vector of double) +0:164 round (global 4-component vector of double) +0:164 'dvec4v' (temp 4-component vector of double) +0:166 add second child into first child (temp double) +0:166 'doublev' (temp double) +0:166 roundEven (global double) +0:166 'doublev' (temp double) +0:167 add second child into first child (temp 2-component vector of double) +0:167 'dvec2v' (temp 2-component vector of double) +0:167 roundEven (global 2-component vector of double) +0:167 'dvec2v' (temp 2-component vector of double) +0:168 add second child into first child (temp 3-component vector of double) +0:168 'dvec3v' (temp 3-component vector of double) +0:168 roundEven (global 3-component vector of double) +0:168 'dvec3v' (temp 3-component vector of double) +0:169 add second child into first child (temp 4-component vector of double) +0:169 'dvec4v' (temp 4-component vector of double) +0:169 roundEven (global 4-component vector of double) +0:169 'dvec4v' (temp 4-component vector of double) +0:171 add second child into first child (temp double) +0:171 'doublev' (temp double) +0:171 Ceiling (global double) +0:171 'doublev' (temp double) +0:172 add second child into first child (temp 2-component vector of double) +0:172 'dvec2v' (temp 2-component vector of double) +0:172 Ceiling (global 2-component vector of double) +0:172 'dvec2v' (temp 2-component vector of double) +0:173 add second child into first child (temp 3-component vector of double) +0:173 'dvec3v' (temp 3-component vector of double) +0:173 Ceiling (global 3-component vector of double) +0:173 'dvec3v' (temp 3-component vector of double) +0:174 add second child into first child (temp 4-component vector of double) +0:174 'dvec4v' (temp 4-component vector of double) +0:174 Ceiling (global 4-component vector of double) +0:174 'dvec4v' (temp 4-component vector of double) +0:176 add second child into first child (temp double) +0:176 'doublev' (temp double) +0:176 Fraction (global double) +0:176 'doublev' (temp double) +0:177 add second child into first child (temp 2-component vector of double) +0:177 'dvec2v' (temp 2-component vector of double) +0:177 Fraction (global 2-component vector of double) +0:177 'dvec2v' (temp 2-component vector of double) +0:178 add second child into first child (temp 3-component vector of double) +0:178 'dvec3v' (temp 3-component vector of double) +0:178 Fraction (global 3-component vector of double) +0:178 'dvec3v' (temp 3-component vector of double) +0:179 add second child into first child (temp 4-component vector of double) +0:179 'dvec4v' (temp 4-component vector of double) +0:179 Fraction (global 4-component vector of double) +0:179 'dvec4v' (temp 4-component vector of double) +0:181 add second child into first child (temp double) +0:181 'doublev' (temp double) +0:181 mod (global double) +0:181 'doublev' (temp double) +0:181 'doublev' (temp double) +0:182 add second child into first child (temp 2-component vector of double) +0:182 'dvec2v' (temp 2-component vector of double) +0:182 mod (global 2-component vector of double) +0:182 'dvec2v' (temp 2-component vector of double) +0:182 'doublev' (temp double) +0:183 add second child into first child (temp 3-component vector of double) +0:183 'dvec3v' (temp 3-component vector of double) +0:183 mod (global 3-component vector of double) +0:183 'dvec3v' (temp 3-component vector of double) +0:183 'doublev' (temp double) +0:184 add second child into first child (temp 4-component vector of double) +0:184 'dvec4v' (temp 4-component vector of double) +0:184 mod (global 4-component vector of double) +0:184 'dvec4v' (temp 4-component vector of double) +0:184 'doublev' (temp double) +0:185 add second child into first child (temp 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:185 mod (global 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:186 add second child into first child (temp 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:186 mod (global 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:187 add second child into first child (temp 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:187 mod (global 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:189 add second child into first child (temp double) +0:189 'doublev' (temp double) +0:189 modf (global double) +0:189 'doublev' (temp double) +0:189 'doublev' (temp double) +0:190 add second child into first child (temp 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:190 modf (global 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:191 add second child into first child (temp 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:191 modf (global 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:192 add second child into first child (temp 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:192 modf (global 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:194 add second child into first child (temp double) +0:194 'doublev' (temp double) +0:194 min (global double) +0:194 'doublev' (temp double) +0:194 'doublev' (temp double) +0:195 add second child into first child (temp 2-component vector of double) +0:195 'dvec2v' (temp 2-component vector of double) +0:195 min (global 2-component vector of double) +0:195 'dvec2v' (temp 2-component vector of double) +0:195 'doublev' (temp double) +0:196 add second child into first child (temp 3-component vector of double) +0:196 'dvec3v' (temp 3-component vector of double) +0:196 min (global 3-component vector of double) +0:196 'dvec3v' (temp 3-component vector of double) +0:196 'doublev' (temp double) +0:197 add second child into first child (temp 4-component vector of double) +0:197 'dvec4v' (temp 4-component vector of double) +0:197 min (global 4-component vector of double) +0:197 'dvec4v' (temp 4-component vector of double) +0:197 'doublev' (temp double) +0:198 add second child into first child (temp 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:198 min (global 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:199 add second child into first child (temp 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:199 min (global 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:200 add second child into first child (temp 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:200 min (global 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:202 add second child into first child (temp double) +0:202 'doublev' (temp double) +0:202 max (global double) +0:202 'doublev' (temp double) +0:202 'doublev' (temp double) +0:203 add second child into first child (temp 2-component vector of double) +0:203 'dvec2v' (temp 2-component vector of double) +0:203 max (global 2-component vector of double) +0:203 'dvec2v' (temp 2-component vector of double) +0:203 'doublev' (temp double) +0:204 add second child into first child (temp 3-component vector of double) +0:204 'dvec3v' (temp 3-component vector of double) +0:204 max (global 3-component vector of double) +0:204 'dvec3v' (temp 3-component vector of double) +0:204 'doublev' (temp double) +0:205 add second child into first child (temp 4-component vector of double) +0:205 'dvec4v' (temp 4-component vector of double) +0:205 max (global 4-component vector of double) +0:205 'dvec4v' (temp 4-component vector of double) +0:205 'doublev' (temp double) +0:206 add second child into first child (temp 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:206 max (global 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:207 add second child into first child (temp 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:207 max (global 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:208 add second child into first child (temp 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:208 max (global 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:210 add second child into first child (temp double) +0:210 'doublev' (temp double) +0:210 clamp (global double) +0:210 'doublev' (temp double) +0:210 'doublev' (temp double) +0:210 'doublev' (temp double) +0:211 add second child into first child (temp 2-component vector of double) +0:211 'dvec2v' (temp 2-component vector of double) +0:211 clamp (global 2-component vector of double) +0:211 'dvec2v' (temp 2-component vector of double) +0:211 'doublev' (temp double) +0:211 'doublev' (temp double) +0:212 add second child into first child (temp 3-component vector of double) +0:212 'dvec3v' (temp 3-component vector of double) +0:212 clamp (global 3-component vector of double) +0:212 'dvec3v' (temp 3-component vector of double) +0:212 'doublev' (temp double) +0:212 'doublev' (temp double) +0:213 add second child into first child (temp 4-component vector of double) +0:213 'dvec4v' (temp 4-component vector of double) +0:213 clamp (global 4-component vector of double) +0:213 'dvec4v' (temp 4-component vector of double) +0:213 'doublev' (temp double) +0:213 'doublev' (temp double) +0:214 add second child into first child (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 clamp (global 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:215 add second child into first child (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 clamp (global 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:216 add second child into first child (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 clamp (global 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:218 add second child into first child (temp double) +0:218 'doublev' (temp double) +0:218 mix (global double) +0:218 'doublev' (temp double) +0:218 'doublev' (temp double) +0:218 'doublev' (temp double) +0:219 add second child into first child (temp 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 mix (global 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 'doublev' (temp double) +0:220 add second child into first child (temp 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 mix (global 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 'doublev' (temp double) +0:221 add second child into first child (temp 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 mix (global 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 'doublev' (temp double) +0:222 add second child into first child (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 mix (global 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:223 add second child into first child (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 mix (global 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:224 add second child into first child (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 mix (global 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:225 add second child into first child (temp double) +0:225 'doublev' (temp double) +0:225 mix (global double) +0:225 'doublev' (temp double) +0:225 'doublev' (temp double) +0:225 'boolv' (temp bool) +0:226 add second child into first child (temp 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 mix (global 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 'bvec2v' (temp 2-component vector of bool) +0:227 add second child into first child (temp 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 mix (global 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 'bvec3v' (temp 3-component vector of bool) +0:228 add second child into first child (temp 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 mix (global 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 'bvec4v' (temp 4-component vector of bool) +0:230 add second child into first child (temp double) +0:230 'doublev' (temp double) +0:230 step (global double) +0:230 'doublev' (temp double) +0:230 'doublev' (temp double) +0:231 add second child into first child (temp 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:231 step (global 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:232 add second child into first child (temp 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:232 step (global 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:233 add second child into first child (temp 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:233 step (global 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:234 add second child into first child (temp 2-component vector of double) +0:234 'dvec2v' (temp 2-component vector of double) +0:234 step (global 2-component vector of double) +0:234 'doublev' (temp double) +0:234 'dvec2v' (temp 2-component vector of double) +0:235 add second child into first child (temp 3-component vector of double) +0:235 'dvec3v' (temp 3-component vector of double) +0:235 step (global 3-component vector of double) +0:235 'doublev' (temp double) +0:235 'dvec3v' (temp 3-component vector of double) +0:236 add second child into first child (temp 4-component vector of double) +0:236 'dvec4v' (temp 4-component vector of double) +0:236 step (global 4-component vector of double) +0:236 'doublev' (temp double) +0:236 'dvec4v' (temp 4-component vector of double) +0:238 add second child into first child (temp double) +0:238 'doublev' (temp double) +0:238 smoothstep (global double) +0:238 'doublev' (temp double) +0:238 'doublev' (temp double) +0:238 'doublev' (temp double) +0:239 add second child into first child (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 smoothstep (global 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:240 add second child into first child (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 smoothstep (global 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:241 add second child into first child (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 smoothstep (global 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:242 add second child into first child (temp 2-component vector of double) +0:242 'dvec2v' (temp 2-component vector of double) +0:242 smoothstep (global 2-component vector of double) +0:242 'doublev' (temp double) +0:242 'doublev' (temp double) +0:242 'dvec2v' (temp 2-component vector of double) +0:243 add second child into first child (temp 3-component vector of double) +0:243 'dvec3v' (temp 3-component vector of double) +0:243 smoothstep (global 3-component vector of double) +0:243 'doublev' (temp double) +0:243 'doublev' (temp double) +0:243 'dvec3v' (temp 3-component vector of double) +0:244 add second child into first child (temp 4-component vector of double) +0:244 'dvec4v' (temp 4-component vector of double) +0:244 smoothstep (global 4-component vector of double) +0:244 'doublev' (temp double) +0:244 'doublev' (temp double) +0:244 'dvec4v' (temp 4-component vector of double) +0:246 move second child to first child (temp bool) +0:246 'boolv' (temp bool) +0:246 isnan (global bool) +0:246 'doublev' (temp double) +0:247 move second child to first child (temp 2-component vector of bool) +0:247 'bvec2v' (temp 2-component vector of bool) +0:247 isnan (global 2-component vector of bool) +0:247 'dvec2v' (temp 2-component vector of double) +0:248 move second child to first child (temp 3-component vector of bool) +0:248 'bvec3v' (temp 3-component vector of bool) +0:248 isnan (global 3-component vector of bool) +0:248 'dvec3v' (temp 3-component vector of double) +0:249 move second child to first child (temp 4-component vector of bool) +0:249 'bvec4v' (temp 4-component vector of bool) +0:249 isnan (global 4-component vector of bool) +0:249 'dvec4v' (temp 4-component vector of double) +0:251 move second child to first child (temp bool) +0:251 'boolv' (temp bool) +0:251 Test condition and select (temp bool) +0:251 Condition +0:251 'boolv' (temp bool) +0:251 true case +0:251 isinf (global bool) +0:251 'doublev' (temp double) +0:251 false case +0:251 Constant: +0:251 false (const bool) +0:252 move second child to first child (temp 2-component vector of bool) +0:252 'bvec2v' (temp 2-component vector of bool) +0:252 Test condition and select (temp 2-component vector of bool) +0:252 Condition +0:252 'boolv' (temp bool) +0:252 true case +0:252 isinf (global 2-component vector of bool) +0:252 'dvec2v' (temp 2-component vector of double) +0:252 false case +0:252 Constant: +0:252 false (const bool) +0:252 false (const bool) +0:253 move second child to first child (temp 3-component vector of bool) +0:253 'bvec3v' (temp 3-component vector of bool) +0:253 Test condition and select (temp 3-component vector of bool) +0:253 Condition +0:253 'boolv' (temp bool) +0:253 true case +0:253 isinf (global 3-component vector of bool) +0:253 'dvec3v' (temp 3-component vector of double) +0:253 false case +0:253 Constant: +0:253 false (const bool) +0:253 false (const bool) +0:253 false (const bool) +0:254 move second child to first child (temp 4-component vector of bool) +0:254 'bvec4v' (temp 4-component vector of bool) +0:254 Test condition and select (temp 4-component vector of bool) +0:254 Condition +0:254 'boolv' (temp bool) +0:254 true case +0:254 isinf (global 4-component vector of bool) +0:254 'dvec4v' (temp 4-component vector of double) +0:254 false case +0:254 Constant: +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:256 add second child into first child (temp double) +0:256 'doublev' (temp double) +0:256 length (global double) +0:256 'doublev' (temp double) +0:257 add second child into first child (temp double) +0:257 'doublev' (temp double) +0:257 length (global double) +0:257 'dvec2v' (temp 2-component vector of double) +0:258 add second child into first child (temp double) +0:258 'doublev' (temp double) +0:258 length (global double) +0:258 'dvec3v' (temp 3-component vector of double) +0:259 add second child into first child (temp double) +0:259 'doublev' (temp double) +0:259 length (global double) +0:259 'dvec4v' (temp 4-component vector of double) +0:261 add second child into first child (temp double) +0:261 'doublev' (temp double) +0:261 distance (global double) +0:261 'doublev' (temp double) +0:261 'doublev' (temp double) +0:262 add second child into first child (temp double) +0:262 'doublev' (temp double) +0:262 distance (global double) +0:262 'dvec2v' (temp 2-component vector of double) +0:262 'dvec2v' (temp 2-component vector of double) +0:263 add second child into first child (temp double) +0:263 'doublev' (temp double) +0:263 distance (global double) +0:263 'dvec3v' (temp 3-component vector of double) +0:263 'dvec3v' (temp 3-component vector of double) +0:264 add second child into first child (temp double) +0:264 'doublev' (temp double) +0:264 distance (global double) +0:264 'dvec4v' (temp 4-component vector of double) +0:264 'dvec4v' (temp 4-component vector of double) +0:266 add second child into first child (temp double) +0:266 'doublev' (temp double) +0:266 dot-product (global double) +0:266 'doublev' (temp double) +0:266 'doublev' (temp double) +0:267 add second child into first child (temp double) +0:267 'doublev' (temp double) +0:267 dot-product (global double) +0:267 'dvec2v' (temp 2-component vector of double) +0:267 'dvec2v' (temp 2-component vector of double) +0:268 add second child into first child (temp double) +0:268 'doublev' (temp double) +0:268 dot-product (global double) +0:268 'dvec3v' (temp 3-component vector of double) +0:268 'dvec3v' (temp 3-component vector of double) +0:269 add second child into first child (temp double) +0:269 'doublev' (temp double) +0:269 dot-product (global double) +0:269 'dvec4v' (temp 4-component vector of double) +0:269 'dvec4v' (temp 4-component vector of double) +0:271 add second child into first child (temp 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:271 cross-product (global 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:273 add second child into first child (temp double) +0:273 'doublev' (temp double) +0:273 normalize (global double) +0:273 'doublev' (temp double) +0:274 add second child into first child (temp 2-component vector of double) +0:274 'dvec2v' (temp 2-component vector of double) +0:274 normalize (global 2-component vector of double) +0:274 'dvec2v' (temp 2-component vector of double) +0:275 add second child into first child (temp 3-component vector of double) +0:275 'dvec3v' (temp 3-component vector of double) +0:275 normalize (global 3-component vector of double) +0:275 'dvec3v' (temp 3-component vector of double) +0:276 add second child into first child (temp 4-component vector of double) +0:276 'dvec4v' (temp 4-component vector of double) +0:276 normalize (global 4-component vector of double) +0:276 'dvec4v' (temp 4-component vector of double) +0:278 add second child into first child (temp double) +0:278 'doublev' (temp double) +0:278 face-forward (global double) +0:278 'doublev' (temp double) +0:278 'doublev' (temp double) +0:278 'doublev' (temp double) +0:279 add second child into first child (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 face-forward (global 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:280 add second child into first child (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 face-forward (global 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:281 add second child into first child (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 face-forward (global 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:283 add second child into first child (temp double) +0:283 'doublev' (temp double) +0:283 reflect (global double) +0:283 'doublev' (temp double) +0:283 'doublev' (temp double) +0:284 add second child into first child (temp 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:284 reflect (global 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:285 add second child into first child (temp 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:285 reflect (global 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:286 add second child into first child (temp 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:286 reflect (global 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:288 add second child into first child (temp double) +0:288 'doublev' (temp double) +0:288 refract (global double) +0:288 'doublev' (temp double) +0:288 'doublev' (temp double) +0:288 'doublev' (temp double) +0:289 add second child into first child (temp 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 refract (global 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 'doublev' (temp double) +0:290 add second child into first child (temp 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 refract (global 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 'doublev' (temp double) +0:291 add second child into first child (temp 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 refract (global 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 'doublev' (temp double) +0:293 Sequence +0:293 move second child to first child (temp 2X2 matrix of double) +0:293 'dmat2v' (temp 2X2 matrix of double) +0:293 outer product (global 2X2 matrix of double) +0:293 'dvec2v' (temp 2-component vector of double) +0:293 'dvec2v' (temp 2-component vector of double) +0:294 Sequence +0:294 move second child to first child (temp 3X3 matrix of double) +0:294 'dmat3v' (temp 3X3 matrix of double) +0:294 outer product (global 3X3 matrix of double) +0:294 'dvec3v' (temp 3-component vector of double) +0:294 'dvec3v' (temp 3-component vector of double) +0:295 Sequence +0:295 move second child to first child (temp 4X4 matrix of double) +0:295 'dmat4v' (temp 4X4 matrix of double) +0:295 outer product (global 4X4 matrix of double) +0:295 'dvec4v' (temp 4-component vector of double) +0:295 'dvec4v' (temp 4-component vector of double) +0:296 Sequence +0:296 move second child to first child (temp 2X3 matrix of double) +0:296 'dmat2x3v' (temp 2X3 matrix of double) +0:296 outer product (global 2X3 matrix of double) +0:296 'dvec3v' (temp 3-component vector of double) +0:296 'dvec2v' (temp 2-component vector of double) +0:297 Sequence +0:297 move second child to first child (temp 3X2 matrix of double) +0:297 'dmat3x2v' (temp 3X2 matrix of double) +0:297 outer product (global 3X2 matrix of double) +0:297 'dvec2v' (temp 2-component vector of double) +0:297 'dvec3v' (temp 3-component vector of double) +0:298 Sequence +0:298 move second child to first child (temp 2X4 matrix of double) +0:298 'dmat2x4v' (temp 2X4 matrix of double) +0:298 outer product (global 2X4 matrix of double) +0:298 'dvec4v' (temp 4-component vector of double) +0:298 'dvec2v' (temp 2-component vector of double) +0:299 Sequence +0:299 move second child to first child (temp 4X2 matrix of double) +0:299 'dmat4x2v' (temp 4X2 matrix of double) +0:299 outer product (global 4X2 matrix of double) +0:299 'dvec2v' (temp 2-component vector of double) +0:299 'dvec4v' (temp 4-component vector of double) +0:300 Sequence +0:300 move second child to first child (temp 3X4 matrix of double) +0:300 'dmat3x4v' (temp 3X4 matrix of double) +0:300 outer product (global 3X4 matrix of double) +0:300 'dvec4v' (temp 4-component vector of double) +0:300 'dvec3v' (temp 3-component vector of double) +0:301 Sequence +0:301 move second child to first child (temp 4X3 matrix of double) +0:301 'dmat4x3v' (temp 4X3 matrix of double) +0:301 outer product (global 4X3 matrix of double) +0:301 'dvec3v' (temp 3-component vector of double) +0:301 'dvec4v' (temp 4-component vector of double) +0:303 matrix mult second child into first child (temp 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:303 component-wise multiply (global 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:304 matrix mult second child into first child (temp 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:304 component-wise multiply (global 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:305 matrix mult second child into first child (temp 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:305 component-wise multiply (global 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:306 move second child to first child (temp 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:306 component-wise multiply (global 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:307 move second child to first child (temp 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:307 component-wise multiply (global 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:308 move second child to first child (temp 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:308 component-wise multiply (global 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:309 move second child to first child (temp 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:309 component-wise multiply (global 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:310 move second child to first child (temp 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:310 component-wise multiply (global 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:311 move second child to first child (temp 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:311 component-wise multiply (global 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:313 matrix mult second child into first child (temp 2X2 matrix of double) +0:313 'dmat2v' (temp 2X2 matrix of double) +0:313 transpose (global 2X2 matrix of double) +0:313 'dmat2v' (temp 2X2 matrix of double) +0:314 matrix mult second child into first child (temp 3X3 matrix of double) +0:314 'dmat3v' (temp 3X3 matrix of double) +0:314 transpose (global 3X3 matrix of double) +0:314 'dmat3v' (temp 3X3 matrix of double) +0:315 matrix mult second child into first child (temp 4X4 matrix of double) +0:315 'dmat4v' (temp 4X4 matrix of double) +0:315 transpose (global 4X4 matrix of double) +0:315 'dmat4v' (temp 4X4 matrix of double) +0:316 move second child to first child (temp 2X3 matrix of double) +0:316 'dmat2x3v' (temp 2X3 matrix of double) +0:316 transpose (global 2X3 matrix of double) +0:316 'dmat3x2v' (temp 3X2 matrix of double) +0:317 move second child to first child (temp 3X2 matrix of double) +0:317 'dmat3x2v' (temp 3X2 matrix of double) +0:317 transpose (global 3X2 matrix of double) +0:317 'dmat2x3v' (temp 2X3 matrix of double) +0:318 move second child to first child (temp 2X4 matrix of double) +0:318 'dmat2x4v' (temp 2X4 matrix of double) +0:318 transpose (global 2X4 matrix of double) +0:318 'dmat4x2v' (temp 4X2 matrix of double) +0:319 move second child to first child (temp 4X2 matrix of double) +0:319 'dmat4x2v' (temp 4X2 matrix of double) +0:319 transpose (global 4X2 matrix of double) +0:319 'dmat2x4v' (temp 2X4 matrix of double) +0:320 move second child to first child (temp 3X4 matrix of double) +0:320 'dmat3x4v' (temp 3X4 matrix of double) +0:320 transpose (global 3X4 matrix of double) +0:320 'dmat4x3v' (temp 4X3 matrix of double) +0:321 move second child to first child (temp 4X3 matrix of double) +0:321 'dmat4x3v' (temp 4X3 matrix of double) +0:321 transpose (global 4X3 matrix of double) +0:321 'dmat3x4v' (temp 3X4 matrix of double) +0:323 add second child into first child (temp double) +0:323 'doublev' (temp double) +0:323 determinant (global double) +0:323 'dmat2v' (temp 2X2 matrix of double) +0:324 add second child into first child (temp double) +0:324 'doublev' (temp double) +0:324 determinant (global double) +0:324 'dmat3v' (temp 3X3 matrix of double) +0:325 add second child into first child (temp double) +0:325 'doublev' (temp double) +0:325 determinant (global double) +0:325 'dmat4v' (temp 4X4 matrix of double) +0:327 matrix mult second child into first child (temp 2X2 matrix of double) +0:327 'dmat2v' (temp 2X2 matrix of double) +0:327 inverse (global 2X2 matrix of double) +0:327 'dmat2v' (temp 2X2 matrix of double) +0:328 matrix mult second child into first child (temp 3X3 matrix of double) +0:328 'dmat3v' (temp 3X3 matrix of double) +0:328 inverse (global 3X3 matrix of double) +0:328 'dmat3v' (temp 3X3 matrix of double) +0:329 matrix mult second child into first child (temp 4X4 matrix of double) +0:329 'dmat4v' (temp 4X4 matrix of double) +0:329 inverse (global 4X4 matrix of double) +0:329 'dmat4v' (temp 4X4 matrix of double) 0:? Linker Objects 0:? 'bn' (in 3-element array of block{in int a}) 0:? 'gl_in' (in 3-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize}) @@ -347,6 +1196,855 @@ ERROR: node is still EOpNull! 0:? Sequence 0:115 'lod' (temp 2-component vector of float) 0:116 'lod' (temp 2-component vector of float) +0:119 Function Definition: doubles( (global void) +0:119 Function Parameters: +0:? Sequence +0:131 move second child to first child (temp double) +0:131 'doublev' (temp double) +0:131 Constant: +0:131 1.702939 +0:132 move second child to first child (temp 2-component vector of double) +0:132 'dvec2v' (temp 2-component vector of double) +0:132 Constant: +0:132 1.643168 +0:132 1.643168 +0:133 move second child to first child (temp 3-component vector of double) +0:133 'dvec3v' (temp 3-component vector of double) +0:133 Constant: +0:133 1.414214 +0:133 1.414214 +0:133 1.414214 +0:134 move second child to first child (temp 4-component vector of double) +0:134 'dvec4v' (temp 4-component vector of double) +0:134 Constant: +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:134 1.449138 +0:136 add second child into first child (temp double) +0:136 'doublev' (temp double) +0:136 inverse sqrt (global double) +0:136 'doublev' (temp double) +0:137 add second child into first child (temp 2-component vector of double) +0:137 'dvec2v' (temp 2-component vector of double) +0:137 inverse sqrt (global 2-component vector of double) +0:137 'dvec2v' (temp 2-component vector of double) +0:138 add second child into first child (temp 3-component vector of double) +0:138 'dvec3v' (temp 3-component vector of double) +0:138 inverse sqrt (global 3-component vector of double) +0:138 'dvec3v' (temp 3-component vector of double) +0:139 add second child into first child (temp 4-component vector of double) +0:139 'dvec4v' (temp 4-component vector of double) +0:139 inverse sqrt (global 4-component vector of double) +0:139 'dvec4v' (temp 4-component vector of double) +0:141 add second child into first child (temp double) +0:141 'doublev' (temp double) +0:141 Absolute value (global double) +0:141 'doublev' (temp double) +0:142 add second child into first child (temp 2-component vector of double) +0:142 'dvec2v' (temp 2-component vector of double) +0:142 Absolute value (global 2-component vector of double) +0:142 'dvec2v' (temp 2-component vector of double) +0:143 add second child into first child (temp 3-component vector of double) +0:143 'dvec3v' (temp 3-component vector of double) +0:143 Absolute value (global 3-component vector of double) +0:143 'dvec3v' (temp 3-component vector of double) +0:144 add second child into first child (temp 4-component vector of double) +0:144 'dvec4v' (temp 4-component vector of double) +0:144 Absolute value (global 4-component vector of double) +0:144 'dvec4v' (temp 4-component vector of double) +0:146 add second child into first child (temp double) +0:146 'doublev' (temp double) +0:146 Sign (global double) +0:146 'doublev' (temp double) +0:147 add second child into first child (temp 2-component vector of double) +0:147 'dvec2v' (temp 2-component vector of double) +0:147 Sign (global 2-component vector of double) +0:147 'dvec2v' (temp 2-component vector of double) +0:148 add second child into first child (temp 3-component vector of double) +0:148 'dvec3v' (temp 3-component vector of double) +0:148 Sign (global 3-component vector of double) +0:148 'dvec3v' (temp 3-component vector of double) +0:149 add second child into first child (temp 4-component vector of double) +0:149 'dvec4v' (temp 4-component vector of double) +0:149 Sign (global 4-component vector of double) +0:149 'dvec4v' (temp 4-component vector of double) +0:151 add second child into first child (temp double) +0:151 'doublev' (temp double) +0:151 Floor (global double) +0:151 'doublev' (temp double) +0:152 add second child into first child (temp 2-component vector of double) +0:152 'dvec2v' (temp 2-component vector of double) +0:152 Floor (global 2-component vector of double) +0:152 'dvec2v' (temp 2-component vector of double) +0:153 add second child into first child (temp 3-component vector of double) +0:153 'dvec3v' (temp 3-component vector of double) +0:153 Floor (global 3-component vector of double) +0:153 'dvec3v' (temp 3-component vector of double) +0:154 add second child into first child (temp 4-component vector of double) +0:154 'dvec4v' (temp 4-component vector of double) +0:154 Floor (global 4-component vector of double) +0:154 'dvec4v' (temp 4-component vector of double) +0:156 add second child into first child (temp double) +0:156 'doublev' (temp double) +0:156 trunc (global double) +0:156 'doublev' (temp double) +0:157 add second child into first child (temp 2-component vector of double) +0:157 'dvec2v' (temp 2-component vector of double) +0:157 trunc (global 2-component vector of double) +0:157 'dvec2v' (temp 2-component vector of double) +0:158 add second child into first child (temp 3-component vector of double) +0:158 'dvec3v' (temp 3-component vector of double) +0:158 trunc (global 3-component vector of double) +0:158 'dvec3v' (temp 3-component vector of double) +0:159 add second child into first child (temp 4-component vector of double) +0:159 'dvec4v' (temp 4-component vector of double) +0:159 trunc (global 4-component vector of double) +0:159 'dvec4v' (temp 4-component vector of double) +0:161 add second child into first child (temp double) +0:161 'doublev' (temp double) +0:161 round (global double) +0:161 'doublev' (temp double) +0:162 add second child into first child (temp 2-component vector of double) +0:162 'dvec2v' (temp 2-component vector of double) +0:162 round (global 2-component vector of double) +0:162 'dvec2v' (temp 2-component vector of double) +0:163 add second child into first child (temp 3-component vector of double) +0:163 'dvec3v' (temp 3-component vector of double) +0:163 round (global 3-component vector of double) +0:163 'dvec3v' (temp 3-component vector of double) +0:164 add second child into first child (temp 4-component vector of double) +0:164 'dvec4v' (temp 4-component vector of double) +0:164 round (global 4-component vector of double) +0:164 'dvec4v' (temp 4-component vector of double) +0:166 add second child into first child (temp double) +0:166 'doublev' (temp double) +0:166 roundEven (global double) +0:166 'doublev' (temp double) +0:167 add second child into first child (temp 2-component vector of double) +0:167 'dvec2v' (temp 2-component vector of double) +0:167 roundEven (global 2-component vector of double) +0:167 'dvec2v' (temp 2-component vector of double) +0:168 add second child into first child (temp 3-component vector of double) +0:168 'dvec3v' (temp 3-component vector of double) +0:168 roundEven (global 3-component vector of double) +0:168 'dvec3v' (temp 3-component vector of double) +0:169 add second child into first child (temp 4-component vector of double) +0:169 'dvec4v' (temp 4-component vector of double) +0:169 roundEven (global 4-component vector of double) +0:169 'dvec4v' (temp 4-component vector of double) +0:171 add second child into first child (temp double) +0:171 'doublev' (temp double) +0:171 Ceiling (global double) +0:171 'doublev' (temp double) +0:172 add second child into first child (temp 2-component vector of double) +0:172 'dvec2v' (temp 2-component vector of double) +0:172 Ceiling (global 2-component vector of double) +0:172 'dvec2v' (temp 2-component vector of double) +0:173 add second child into first child (temp 3-component vector of double) +0:173 'dvec3v' (temp 3-component vector of double) +0:173 Ceiling (global 3-component vector of double) +0:173 'dvec3v' (temp 3-component vector of double) +0:174 add second child into first child (temp 4-component vector of double) +0:174 'dvec4v' (temp 4-component vector of double) +0:174 Ceiling (global 4-component vector of double) +0:174 'dvec4v' (temp 4-component vector of double) +0:176 add second child into first child (temp double) +0:176 'doublev' (temp double) +0:176 Fraction (global double) +0:176 'doublev' (temp double) +0:177 add second child into first child (temp 2-component vector of double) +0:177 'dvec2v' (temp 2-component vector of double) +0:177 Fraction (global 2-component vector of double) +0:177 'dvec2v' (temp 2-component vector of double) +0:178 add second child into first child (temp 3-component vector of double) +0:178 'dvec3v' (temp 3-component vector of double) +0:178 Fraction (global 3-component vector of double) +0:178 'dvec3v' (temp 3-component vector of double) +0:179 add second child into first child (temp 4-component vector of double) +0:179 'dvec4v' (temp 4-component vector of double) +0:179 Fraction (global 4-component vector of double) +0:179 'dvec4v' (temp 4-component vector of double) +0:181 add second child into first child (temp double) +0:181 'doublev' (temp double) +0:181 mod (global double) +0:181 'doublev' (temp double) +0:181 'doublev' (temp double) +0:182 add second child into first child (temp 2-component vector of double) +0:182 'dvec2v' (temp 2-component vector of double) +0:182 mod (global 2-component vector of double) +0:182 'dvec2v' (temp 2-component vector of double) +0:182 'doublev' (temp double) +0:183 add second child into first child (temp 3-component vector of double) +0:183 'dvec3v' (temp 3-component vector of double) +0:183 mod (global 3-component vector of double) +0:183 'dvec3v' (temp 3-component vector of double) +0:183 'doublev' (temp double) +0:184 add second child into first child (temp 4-component vector of double) +0:184 'dvec4v' (temp 4-component vector of double) +0:184 mod (global 4-component vector of double) +0:184 'dvec4v' (temp 4-component vector of double) +0:184 'doublev' (temp double) +0:185 add second child into first child (temp 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:185 mod (global 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:185 'dvec2v' (temp 2-component vector of double) +0:186 add second child into first child (temp 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:186 mod (global 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:186 'dvec3v' (temp 3-component vector of double) +0:187 add second child into first child (temp 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:187 mod (global 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:187 'dvec4v' (temp 4-component vector of double) +0:189 add second child into first child (temp double) +0:189 'doublev' (temp double) +0:189 modf (global double) +0:189 'doublev' (temp double) +0:189 'doublev' (temp double) +0:190 add second child into first child (temp 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:190 modf (global 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:190 'dvec2v' (temp 2-component vector of double) +0:191 add second child into first child (temp 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:191 modf (global 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:191 'dvec3v' (temp 3-component vector of double) +0:192 add second child into first child (temp 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:192 modf (global 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:192 'dvec4v' (temp 4-component vector of double) +0:194 add second child into first child (temp double) +0:194 'doublev' (temp double) +0:194 min (global double) +0:194 'doublev' (temp double) +0:194 'doublev' (temp double) +0:195 add second child into first child (temp 2-component vector of double) +0:195 'dvec2v' (temp 2-component vector of double) +0:195 min (global 2-component vector of double) +0:195 'dvec2v' (temp 2-component vector of double) +0:195 'doublev' (temp double) +0:196 add second child into first child (temp 3-component vector of double) +0:196 'dvec3v' (temp 3-component vector of double) +0:196 min (global 3-component vector of double) +0:196 'dvec3v' (temp 3-component vector of double) +0:196 'doublev' (temp double) +0:197 add second child into first child (temp 4-component vector of double) +0:197 'dvec4v' (temp 4-component vector of double) +0:197 min (global 4-component vector of double) +0:197 'dvec4v' (temp 4-component vector of double) +0:197 'doublev' (temp double) +0:198 add second child into first child (temp 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:198 min (global 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:198 'dvec2v' (temp 2-component vector of double) +0:199 add second child into first child (temp 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:199 min (global 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:199 'dvec3v' (temp 3-component vector of double) +0:200 add second child into first child (temp 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:200 min (global 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:200 'dvec4v' (temp 4-component vector of double) +0:202 add second child into first child (temp double) +0:202 'doublev' (temp double) +0:202 max (global double) +0:202 'doublev' (temp double) +0:202 'doublev' (temp double) +0:203 add second child into first child (temp 2-component vector of double) +0:203 'dvec2v' (temp 2-component vector of double) +0:203 max (global 2-component vector of double) +0:203 'dvec2v' (temp 2-component vector of double) +0:203 'doublev' (temp double) +0:204 add second child into first child (temp 3-component vector of double) +0:204 'dvec3v' (temp 3-component vector of double) +0:204 max (global 3-component vector of double) +0:204 'dvec3v' (temp 3-component vector of double) +0:204 'doublev' (temp double) +0:205 add second child into first child (temp 4-component vector of double) +0:205 'dvec4v' (temp 4-component vector of double) +0:205 max (global 4-component vector of double) +0:205 'dvec4v' (temp 4-component vector of double) +0:205 'doublev' (temp double) +0:206 add second child into first child (temp 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:206 max (global 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:206 'dvec2v' (temp 2-component vector of double) +0:207 add second child into first child (temp 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:207 max (global 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:207 'dvec3v' (temp 3-component vector of double) +0:208 add second child into first child (temp 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:208 max (global 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:208 'dvec4v' (temp 4-component vector of double) +0:210 add second child into first child (temp double) +0:210 'doublev' (temp double) +0:210 clamp (global double) +0:210 'doublev' (temp double) +0:210 'doublev' (temp double) +0:210 'doublev' (temp double) +0:211 add second child into first child (temp 2-component vector of double) +0:211 'dvec2v' (temp 2-component vector of double) +0:211 clamp (global 2-component vector of double) +0:211 'dvec2v' (temp 2-component vector of double) +0:211 'doublev' (temp double) +0:211 'doublev' (temp double) +0:212 add second child into first child (temp 3-component vector of double) +0:212 'dvec3v' (temp 3-component vector of double) +0:212 clamp (global 3-component vector of double) +0:212 'dvec3v' (temp 3-component vector of double) +0:212 'doublev' (temp double) +0:212 'doublev' (temp double) +0:213 add second child into first child (temp 4-component vector of double) +0:213 'dvec4v' (temp 4-component vector of double) +0:213 clamp (global 4-component vector of double) +0:213 'dvec4v' (temp 4-component vector of double) +0:213 'doublev' (temp double) +0:213 'doublev' (temp double) +0:214 add second child into first child (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 clamp (global 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:214 'dvec2v' (temp 2-component vector of double) +0:215 add second child into first child (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 clamp (global 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:215 'dvec3v' (temp 3-component vector of double) +0:216 add second child into first child (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 clamp (global 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:216 'dvec4v' (temp 4-component vector of double) +0:218 add second child into first child (temp double) +0:218 'doublev' (temp double) +0:218 mix (global double) +0:218 'doublev' (temp double) +0:218 'doublev' (temp double) +0:218 'doublev' (temp double) +0:219 add second child into first child (temp 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 mix (global 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 'dvec2v' (temp 2-component vector of double) +0:219 'doublev' (temp double) +0:220 add second child into first child (temp 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 mix (global 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 'dvec3v' (temp 3-component vector of double) +0:220 'doublev' (temp double) +0:221 add second child into first child (temp 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 mix (global 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 'dvec4v' (temp 4-component vector of double) +0:221 'doublev' (temp double) +0:222 add second child into first child (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 mix (global 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:222 'dvec2v' (temp 2-component vector of double) +0:223 add second child into first child (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 mix (global 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:223 'dvec3v' (temp 3-component vector of double) +0:224 add second child into first child (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 mix (global 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:224 'dvec4v' (temp 4-component vector of double) +0:225 add second child into first child (temp double) +0:225 'doublev' (temp double) +0:225 mix (global double) +0:225 'doublev' (temp double) +0:225 'doublev' (temp double) +0:225 'boolv' (temp bool) +0:226 add second child into first child (temp 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 mix (global 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 'dvec2v' (temp 2-component vector of double) +0:226 'bvec2v' (temp 2-component vector of bool) +0:227 add second child into first child (temp 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 mix (global 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 'dvec3v' (temp 3-component vector of double) +0:227 'bvec3v' (temp 3-component vector of bool) +0:228 add second child into first child (temp 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 mix (global 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 'dvec4v' (temp 4-component vector of double) +0:228 'bvec4v' (temp 4-component vector of bool) +0:230 add second child into first child (temp double) +0:230 'doublev' (temp double) +0:230 step (global double) +0:230 'doublev' (temp double) +0:230 'doublev' (temp double) +0:231 add second child into first child (temp 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:231 step (global 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:231 'dvec2v' (temp 2-component vector of double) +0:232 add second child into first child (temp 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:232 step (global 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:232 'dvec3v' (temp 3-component vector of double) +0:233 add second child into first child (temp 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:233 step (global 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:233 'dvec4v' (temp 4-component vector of double) +0:234 add second child into first child (temp 2-component vector of double) +0:234 'dvec2v' (temp 2-component vector of double) +0:234 step (global 2-component vector of double) +0:234 'doublev' (temp double) +0:234 'dvec2v' (temp 2-component vector of double) +0:235 add second child into first child (temp 3-component vector of double) +0:235 'dvec3v' (temp 3-component vector of double) +0:235 step (global 3-component vector of double) +0:235 'doublev' (temp double) +0:235 'dvec3v' (temp 3-component vector of double) +0:236 add second child into first child (temp 4-component vector of double) +0:236 'dvec4v' (temp 4-component vector of double) +0:236 step (global 4-component vector of double) +0:236 'doublev' (temp double) +0:236 'dvec4v' (temp 4-component vector of double) +0:238 add second child into first child (temp double) +0:238 'doublev' (temp double) +0:238 smoothstep (global double) +0:238 'doublev' (temp double) +0:238 'doublev' (temp double) +0:238 'doublev' (temp double) +0:239 add second child into first child (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 smoothstep (global 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:239 'dvec2v' (temp 2-component vector of double) +0:240 add second child into first child (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 smoothstep (global 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:240 'dvec3v' (temp 3-component vector of double) +0:241 add second child into first child (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 smoothstep (global 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:241 'dvec4v' (temp 4-component vector of double) +0:242 add second child into first child (temp 2-component vector of double) +0:242 'dvec2v' (temp 2-component vector of double) +0:242 smoothstep (global 2-component vector of double) +0:242 'doublev' (temp double) +0:242 'doublev' (temp double) +0:242 'dvec2v' (temp 2-component vector of double) +0:243 add second child into first child (temp 3-component vector of double) +0:243 'dvec3v' (temp 3-component vector of double) +0:243 smoothstep (global 3-component vector of double) +0:243 'doublev' (temp double) +0:243 'doublev' (temp double) +0:243 'dvec3v' (temp 3-component vector of double) +0:244 add second child into first child (temp 4-component vector of double) +0:244 'dvec4v' (temp 4-component vector of double) +0:244 smoothstep (global 4-component vector of double) +0:244 'doublev' (temp double) +0:244 'doublev' (temp double) +0:244 'dvec4v' (temp 4-component vector of double) +0:246 move second child to first child (temp bool) +0:246 'boolv' (temp bool) +0:246 isnan (global bool) +0:246 'doublev' (temp double) +0:247 move second child to first child (temp 2-component vector of bool) +0:247 'bvec2v' (temp 2-component vector of bool) +0:247 isnan (global 2-component vector of bool) +0:247 'dvec2v' (temp 2-component vector of double) +0:248 move second child to first child (temp 3-component vector of bool) +0:248 'bvec3v' (temp 3-component vector of bool) +0:248 isnan (global 3-component vector of bool) +0:248 'dvec3v' (temp 3-component vector of double) +0:249 move second child to first child (temp 4-component vector of bool) +0:249 'bvec4v' (temp 4-component vector of bool) +0:249 isnan (global 4-component vector of bool) +0:249 'dvec4v' (temp 4-component vector of double) +0:251 move second child to first child (temp bool) +0:251 'boolv' (temp bool) +0:251 Test condition and select (temp bool) +0:251 Condition +0:251 'boolv' (temp bool) +0:251 true case +0:251 isinf (global bool) +0:251 'doublev' (temp double) +0:251 false case +0:251 Constant: +0:251 false (const bool) +0:252 move second child to first child (temp 2-component vector of bool) +0:252 'bvec2v' (temp 2-component vector of bool) +0:252 Test condition and select (temp 2-component vector of bool) +0:252 Condition +0:252 'boolv' (temp bool) +0:252 true case +0:252 isinf (global 2-component vector of bool) +0:252 'dvec2v' (temp 2-component vector of double) +0:252 false case +0:252 Constant: +0:252 false (const bool) +0:252 false (const bool) +0:253 move second child to first child (temp 3-component vector of bool) +0:253 'bvec3v' (temp 3-component vector of bool) +0:253 Test condition and select (temp 3-component vector of bool) +0:253 Condition +0:253 'boolv' (temp bool) +0:253 true case +0:253 isinf (global 3-component vector of bool) +0:253 'dvec3v' (temp 3-component vector of double) +0:253 false case +0:253 Constant: +0:253 false (const bool) +0:253 false (const bool) +0:253 false (const bool) +0:254 move second child to first child (temp 4-component vector of bool) +0:254 'bvec4v' (temp 4-component vector of bool) +0:254 Test condition and select (temp 4-component vector of bool) +0:254 Condition +0:254 'boolv' (temp bool) +0:254 true case +0:254 isinf (global 4-component vector of bool) +0:254 'dvec4v' (temp 4-component vector of double) +0:254 false case +0:254 Constant: +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:254 false (const bool) +0:256 add second child into first child (temp double) +0:256 'doublev' (temp double) +0:256 length (global double) +0:256 'doublev' (temp double) +0:257 add second child into first child (temp double) +0:257 'doublev' (temp double) +0:257 length (global double) +0:257 'dvec2v' (temp 2-component vector of double) +0:258 add second child into first child (temp double) +0:258 'doublev' (temp double) +0:258 length (global double) +0:258 'dvec3v' (temp 3-component vector of double) +0:259 add second child into first child (temp double) +0:259 'doublev' (temp double) +0:259 length (global double) +0:259 'dvec4v' (temp 4-component vector of double) +0:261 add second child into first child (temp double) +0:261 'doublev' (temp double) +0:261 distance (global double) +0:261 'doublev' (temp double) +0:261 'doublev' (temp double) +0:262 add second child into first child (temp double) +0:262 'doublev' (temp double) +0:262 distance (global double) +0:262 'dvec2v' (temp 2-component vector of double) +0:262 'dvec2v' (temp 2-component vector of double) +0:263 add second child into first child (temp double) +0:263 'doublev' (temp double) +0:263 distance (global double) +0:263 'dvec3v' (temp 3-component vector of double) +0:263 'dvec3v' (temp 3-component vector of double) +0:264 add second child into first child (temp double) +0:264 'doublev' (temp double) +0:264 distance (global double) +0:264 'dvec4v' (temp 4-component vector of double) +0:264 'dvec4v' (temp 4-component vector of double) +0:266 add second child into first child (temp double) +0:266 'doublev' (temp double) +0:266 dot-product (global double) +0:266 'doublev' (temp double) +0:266 'doublev' (temp double) +0:267 add second child into first child (temp double) +0:267 'doublev' (temp double) +0:267 dot-product (global double) +0:267 'dvec2v' (temp 2-component vector of double) +0:267 'dvec2v' (temp 2-component vector of double) +0:268 add second child into first child (temp double) +0:268 'doublev' (temp double) +0:268 dot-product (global double) +0:268 'dvec3v' (temp 3-component vector of double) +0:268 'dvec3v' (temp 3-component vector of double) +0:269 add second child into first child (temp double) +0:269 'doublev' (temp double) +0:269 dot-product (global double) +0:269 'dvec4v' (temp 4-component vector of double) +0:269 'dvec4v' (temp 4-component vector of double) +0:271 add second child into first child (temp 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:271 cross-product (global 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:271 'dvec3v' (temp 3-component vector of double) +0:273 add second child into first child (temp double) +0:273 'doublev' (temp double) +0:273 normalize (global double) +0:273 'doublev' (temp double) +0:274 add second child into first child (temp 2-component vector of double) +0:274 'dvec2v' (temp 2-component vector of double) +0:274 normalize (global 2-component vector of double) +0:274 'dvec2v' (temp 2-component vector of double) +0:275 add second child into first child (temp 3-component vector of double) +0:275 'dvec3v' (temp 3-component vector of double) +0:275 normalize (global 3-component vector of double) +0:275 'dvec3v' (temp 3-component vector of double) +0:276 add second child into first child (temp 4-component vector of double) +0:276 'dvec4v' (temp 4-component vector of double) +0:276 normalize (global 4-component vector of double) +0:276 'dvec4v' (temp 4-component vector of double) +0:278 add second child into first child (temp double) +0:278 'doublev' (temp double) +0:278 face-forward (global double) +0:278 'doublev' (temp double) +0:278 'doublev' (temp double) +0:278 'doublev' (temp double) +0:279 add second child into first child (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 face-forward (global 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:279 'dvec2v' (temp 2-component vector of double) +0:280 add second child into first child (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 face-forward (global 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:280 'dvec3v' (temp 3-component vector of double) +0:281 add second child into first child (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 face-forward (global 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:281 'dvec4v' (temp 4-component vector of double) +0:283 add second child into first child (temp double) +0:283 'doublev' (temp double) +0:283 reflect (global double) +0:283 'doublev' (temp double) +0:283 'doublev' (temp double) +0:284 add second child into first child (temp 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:284 reflect (global 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:284 'dvec2v' (temp 2-component vector of double) +0:285 add second child into first child (temp 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:285 reflect (global 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:285 'dvec3v' (temp 3-component vector of double) +0:286 add second child into first child (temp 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:286 reflect (global 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:286 'dvec4v' (temp 4-component vector of double) +0:288 add second child into first child (temp double) +0:288 'doublev' (temp double) +0:288 refract (global double) +0:288 'doublev' (temp double) +0:288 'doublev' (temp double) +0:288 'doublev' (temp double) +0:289 add second child into first child (temp 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 refract (global 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 'dvec2v' (temp 2-component vector of double) +0:289 'doublev' (temp double) +0:290 add second child into first child (temp 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 refract (global 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 'dvec3v' (temp 3-component vector of double) +0:290 'doublev' (temp double) +0:291 add second child into first child (temp 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 refract (global 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 'dvec4v' (temp 4-component vector of double) +0:291 'doublev' (temp double) +0:293 Sequence +0:293 move second child to first child (temp 2X2 matrix of double) +0:293 'dmat2v' (temp 2X2 matrix of double) +0:293 outer product (global 2X2 matrix of double) +0:293 'dvec2v' (temp 2-component vector of double) +0:293 'dvec2v' (temp 2-component vector of double) +0:294 Sequence +0:294 move second child to first child (temp 3X3 matrix of double) +0:294 'dmat3v' (temp 3X3 matrix of double) +0:294 outer product (global 3X3 matrix of double) +0:294 'dvec3v' (temp 3-component vector of double) +0:294 'dvec3v' (temp 3-component vector of double) +0:295 Sequence +0:295 move second child to first child (temp 4X4 matrix of double) +0:295 'dmat4v' (temp 4X4 matrix of double) +0:295 outer product (global 4X4 matrix of double) +0:295 'dvec4v' (temp 4-component vector of double) +0:295 'dvec4v' (temp 4-component vector of double) +0:296 Sequence +0:296 move second child to first child (temp 2X3 matrix of double) +0:296 'dmat2x3v' (temp 2X3 matrix of double) +0:296 outer product (global 2X3 matrix of double) +0:296 'dvec3v' (temp 3-component vector of double) +0:296 'dvec2v' (temp 2-component vector of double) +0:297 Sequence +0:297 move second child to first child (temp 3X2 matrix of double) +0:297 'dmat3x2v' (temp 3X2 matrix of double) +0:297 outer product (global 3X2 matrix of double) +0:297 'dvec2v' (temp 2-component vector of double) +0:297 'dvec3v' (temp 3-component vector of double) +0:298 Sequence +0:298 move second child to first child (temp 2X4 matrix of double) +0:298 'dmat2x4v' (temp 2X4 matrix of double) +0:298 outer product (global 2X4 matrix of double) +0:298 'dvec4v' (temp 4-component vector of double) +0:298 'dvec2v' (temp 2-component vector of double) +0:299 Sequence +0:299 move second child to first child (temp 4X2 matrix of double) +0:299 'dmat4x2v' (temp 4X2 matrix of double) +0:299 outer product (global 4X2 matrix of double) +0:299 'dvec2v' (temp 2-component vector of double) +0:299 'dvec4v' (temp 4-component vector of double) +0:300 Sequence +0:300 move second child to first child (temp 3X4 matrix of double) +0:300 'dmat3x4v' (temp 3X4 matrix of double) +0:300 outer product (global 3X4 matrix of double) +0:300 'dvec4v' (temp 4-component vector of double) +0:300 'dvec3v' (temp 3-component vector of double) +0:301 Sequence +0:301 move second child to first child (temp 4X3 matrix of double) +0:301 'dmat4x3v' (temp 4X3 matrix of double) +0:301 outer product (global 4X3 matrix of double) +0:301 'dvec3v' (temp 3-component vector of double) +0:301 'dvec4v' (temp 4-component vector of double) +0:303 matrix mult second child into first child (temp 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:303 component-wise multiply (global 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:303 'dmat2v' (temp 2X2 matrix of double) +0:304 matrix mult second child into first child (temp 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:304 component-wise multiply (global 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:304 'dmat3v' (temp 3X3 matrix of double) +0:305 matrix mult second child into first child (temp 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:305 component-wise multiply (global 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:305 'dmat4v' (temp 4X4 matrix of double) +0:306 move second child to first child (temp 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:306 component-wise multiply (global 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:306 'dmat2x3v' (temp 2X3 matrix of double) +0:307 move second child to first child (temp 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:307 component-wise multiply (global 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:307 'dmat2x4v' (temp 2X4 matrix of double) +0:308 move second child to first child (temp 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:308 component-wise multiply (global 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:308 'dmat3x2v' (temp 3X2 matrix of double) +0:309 move second child to first child (temp 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:309 component-wise multiply (global 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:309 'dmat3x4v' (temp 3X4 matrix of double) +0:310 move second child to first child (temp 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:310 component-wise multiply (global 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:310 'dmat4x2v' (temp 4X2 matrix of double) +0:311 move second child to first child (temp 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:311 component-wise multiply (global 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:311 'dmat4x3v' (temp 4X3 matrix of double) +0:313 matrix mult second child into first child (temp 2X2 matrix of double) +0:313 'dmat2v' (temp 2X2 matrix of double) +0:313 transpose (global 2X2 matrix of double) +0:313 'dmat2v' (temp 2X2 matrix of double) +0:314 matrix mult second child into first child (temp 3X3 matrix of double) +0:314 'dmat3v' (temp 3X3 matrix of double) +0:314 transpose (global 3X3 matrix of double) +0:314 'dmat3v' (temp 3X3 matrix of double) +0:315 matrix mult second child into first child (temp 4X4 matrix of double) +0:315 'dmat4v' (temp 4X4 matrix of double) +0:315 transpose (global 4X4 matrix of double) +0:315 'dmat4v' (temp 4X4 matrix of double) +0:316 move second child to first child (temp 2X3 matrix of double) +0:316 'dmat2x3v' (temp 2X3 matrix of double) +0:316 transpose (global 2X3 matrix of double) +0:316 'dmat3x2v' (temp 3X2 matrix of double) +0:317 move second child to first child (temp 3X2 matrix of double) +0:317 'dmat3x2v' (temp 3X2 matrix of double) +0:317 transpose (global 3X2 matrix of double) +0:317 'dmat2x3v' (temp 2X3 matrix of double) +0:318 move second child to first child (temp 2X4 matrix of double) +0:318 'dmat2x4v' (temp 2X4 matrix of double) +0:318 transpose (global 2X4 matrix of double) +0:318 'dmat4x2v' (temp 4X2 matrix of double) +0:319 move second child to first child (temp 4X2 matrix of double) +0:319 'dmat4x2v' (temp 4X2 matrix of double) +0:319 transpose (global 4X2 matrix of double) +0:319 'dmat2x4v' (temp 2X4 matrix of double) +0:320 move second child to first child (temp 3X4 matrix of double) +0:320 'dmat3x4v' (temp 3X4 matrix of double) +0:320 transpose (global 3X4 matrix of double) +0:320 'dmat4x3v' (temp 4X3 matrix of double) +0:321 move second child to first child (temp 4X3 matrix of double) +0:321 'dmat4x3v' (temp 4X3 matrix of double) +0:321 transpose (global 4X3 matrix of double) +0:321 'dmat3x4v' (temp 3X4 matrix of double) +0:323 add second child into first child (temp double) +0:323 'doublev' (temp double) +0:323 determinant (global double) +0:323 'dmat2v' (temp 2X2 matrix of double) +0:324 add second child into first child (temp double) +0:324 'doublev' (temp double) +0:324 determinant (global double) +0:324 'dmat3v' (temp 3X3 matrix of double) +0:325 add second child into first child (temp double) +0:325 'doublev' (temp double) +0:325 determinant (global double) +0:325 'dmat4v' (temp 4X4 matrix of double) +0:327 matrix mult second child into first child (temp 2X2 matrix of double) +0:327 'dmat2v' (temp 2X2 matrix of double) +0:327 inverse (global 2X2 matrix of double) +0:327 'dmat2v' (temp 2X2 matrix of double) +0:328 matrix mult second child into first child (temp 3X3 matrix of double) +0:328 'dmat3v' (temp 3X3 matrix of double) +0:328 inverse (global 3X3 matrix of double) +0:328 'dmat3v' (temp 3X3 matrix of double) +0:329 matrix mult second child into first child (temp 4X4 matrix of double) +0:329 'dmat4v' (temp 4X4 matrix of double) +0:329 inverse (global 4X4 matrix of double) +0:329 'dmat4v' (temp 4X4 matrix of double) 0:? Linker Objects 0:? 'bn' (in 3-element array of block{in int a}) 0:? 'gl_in' (in 3-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize}) diff --git a/Test/baseResults/spv.400.frag.out b/Test/baseResults/spv.400.frag.out index 39fefd24..f0709740 100644 --- a/Test/baseResults/spv.400.frag.out +++ b/Test/baseResults/spv.400.frag.out @@ -7,168 +7,1359 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 125 +// Id's are bound by 1104 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 44 50 56 69 96 117 119 + EntryPoint Fragment 4 "main" 13 1025 1031 1036 1048 1074 1095 1097 ExecutionMode 4 OriginLowerLeft Source GLSL 400 SourceExtension "GL_ARB_separate_shader_objects" Name 4 "main" Name 6 "foo23(" - Name 11 "outp" - Name 15 "u2drs" - Name 36 "v" - Name 42 "arrayedSampler" - Name 44 "i" - Name 50 "c2D" - Name 56 "gl_ClipDistance" - Name 69 "uoutp" - Name 73 "samp2dr" - Name 96 "ioutp" - Name 100 "isamp2DA" - Name 117 "gl_FragCoord" - Name 119 "vl2" - Decorate 44(i) Flat - Decorate 56(gl_ClipDistance) BuiltIn ClipDistance - Decorate 117(gl_FragCoord) BuiltIn FragCoord - Decorate 119(vl2) Location 6 + Name 8 "doubles(" + Name 13 "outp" + Name 17 "u2drs" + Name 39 "doublev" + Name 43 "dvec2v" + Name 48 "dvec3v" + Name 53 "dvec4v" + Name 428 "boolv" + Name 437 "bvec2v" + Name 446 "bvec3v" + Name 455 "bvec4v" + Name 737 "dmat2v" + Name 743 "dmat3v" + Name 749 "dmat4v" + Name 755 "dmat2x3v" + Name 761 "dmat3x2v" + Name 767 "dmat2x4v" + Name 773 "dmat4x2v" + Name 779 "dmat3x4v" + Name 785 "dmat4x3v" + Name 1017 "v" + Name 1023 "arrayedSampler" + Name 1025 "i" + Name 1031 "c2D" + Name 1036 "gl_ClipDistance" + Name 1048 "uoutp" + Name 1052 "samp2dr" + Name 1074 "ioutp" + Name 1078 "isamp2DA" + Name 1095 "gl_FragCoord" + Name 1097 "vl2" + Decorate 1025(i) Flat + Decorate 1036(gl_ClipDistance) BuiltIn ClipDistance + Decorate 1095(gl_FragCoord) BuiltIn FragCoord + Decorate 1097(vl2) Location 6 2: TypeVoid 3: TypeFunction 2 - 8: TypeFloat 32 - 9: TypeVector 8(float) 4 - 10: TypePointer Output 9(fvec4) - 11(outp): 10(ptr) Variable Output - 12: TypeImage 8(float) Rect depth sampled format:Unknown - 13: TypeSampledImage 12 - 14: TypePointer UniformConstant 13 - 15(u2drs): 14(ptr) Variable UniformConstant - 18: TypeVector 8(float) 2 - 19: 8(float) Constant 0 - 20: 18(fvec2) ConstantComposite 19 19 - 21: TypeInt 32 1 - 22: TypeVector 21(int) 2 - 23: 21(int) Constant 3 - 24: 21(int) Constant 4 - 25: 22(ivec2) ConstantComposite 23 24 - 28: TypeInt 32 0 - 29: 28(int) Constant 0 - 30: TypePointer Output 8(float) - 35: TypePointer Function 9(fvec4) - 37: TypeImage 8(float) 2D sampled format:Unknown - 38: TypeSampledImage 37 - 39: 28(int) Constant 5 - 40: TypeArray 38 39 - 41: TypePointer UniformConstant 40 -42(arrayedSampler): 41(ptr) Variable UniformConstant - 43: TypePointer Input 21(int) - 44(i): 43(ptr) Variable Input - 46: TypePointer UniformConstant 38 - 49: TypePointer Input 18(fvec2) - 50(c2D): 49(ptr) Variable Input - 53: 28(int) Constant 2 - 54: TypeArray 8(float) 53 - 55: TypePointer Input 54 -56(gl_ClipDistance): 55(ptr) Variable Input - 57: 21(int) Constant 1 - 58: TypePointer Input 8(float) - 62: TypeVector 8(float) 3 - 67: TypeVector 28(int) 4 - 68: TypePointer Output 67(ivec4) - 69(uoutp): 68(ptr) Variable Output - 70: TypeImage 28(int) Rect sampled format:Unknown - 71: TypeSampledImage 70 - 72: TypePointer UniformConstant 71 - 73(samp2dr): 72(ptr) Variable UniformConstant - 76: 28(int) Constant 4 - 77: TypeArray 22(ivec2) 76 - 78: 21(int) Constant 2 - 79: 22(ivec2) ConstantComposite 57 78 - 80: 21(int) Constant 15 - 81: 21(int) Constant 16 - 82: 22(ivec2) ConstantComposite 80 81 - 83: 21(int) Constant 4294967294 - 84: 21(int) Constant 0 - 85: 22(ivec2) ConstantComposite 83 84 - 86: 77 ConstantComposite 79 25 82 85 - 94: TypeVector 21(int) 4 - 95: TypePointer Output 94(ivec4) - 96(ioutp): 95(ptr) Variable Output - 97: TypeImage 21(int) 2D array sampled format:Unknown - 98: TypeSampledImage 97 - 99: TypePointer UniformConstant 98 - 100(isamp2DA): 99(ptr) Variable UniformConstant - 102: 8(float) Constant 1036831949 - 103: 62(fvec3) ConstantComposite 102 102 102 - 104: 22(ivec2) ConstantComposite 57 57 - 116: TypePointer Input 9(fvec4) -117(gl_FragCoord): 116(ptr) Variable Input - 119(vl2): 116(ptr) Variable Input + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Output 11(fvec4) + 13(outp): 12(ptr) Variable Output + 14: TypeImage 10(float) Rect depth sampled format:Unknown + 15: TypeSampledImage 14 + 16: TypePointer UniformConstant 15 + 17(u2drs): 16(ptr) Variable UniformConstant + 20: TypeVector 10(float) 2 + 21: 10(float) Constant 0 + 22: 20(fvec2) ConstantComposite 21 21 + 23: TypeInt 32 1 + 24: TypeVector 23(int) 2 + 25: 23(int) Constant 3 + 26: 23(int) Constant 4 + 27: 24(ivec2) ConstantComposite 25 26 + 30: TypeInt 32 0 + 31: 30(int) Constant 0 + 32: TypePointer Output 10(float) + 37: TypeFloat 64 + 38: TypePointer Function 37(float) + 40: 37(float) Constant 2507418074 1073430332 + 41: TypeVector 37(float) 2 + 42: TypePointer Function 41(fvec2) + 44: 37(float) Constant 796182188 1073367658 + 45: 41(fvec2) ConstantComposite 44 44 + 46: TypeVector 37(float) 3 + 47: TypePointer Function 46(fvec3) + 49: 37(float) Constant 1719614413 1073127582 + 50: 46(fvec3) ConstantComposite 49 49 49 + 51: TypeVector 37(float) 4 + 52: TypePointer Function 51(fvec4) + 426: TypeBool + 427: TypePointer Function 426(bool) + 435: TypeVector 426(bool) 2 + 436: TypePointer Function 435(bvec2) + 444: TypeVector 426(bool) 3 + 445: TypePointer Function 444(bvec3) + 453: TypeVector 426(bool) 4 + 454: TypePointer Function 453(bvec4) + 561: 426(bool) ConstantFalse + 570: 435(bvec2) ConstantComposite 561 561 + 579: 444(bvec3) ConstantComposite 561 561 561 + 588: 453(bvec4) ConstantComposite 561 561 561 561 + 735: TypeMatrix 41(fvec2) 2 + 736: TypePointer Function 735 + 741: TypeMatrix 46(fvec3) 3 + 742: TypePointer Function 741 + 747: TypeMatrix 51(fvec4) 4 + 748: TypePointer Function 747 + 753: TypeMatrix 46(fvec3) 2 + 754: TypePointer Function 753 + 759: TypeMatrix 41(fvec2) 3 + 760: TypePointer Function 759 + 765: TypeMatrix 51(fvec4) 2 + 766: TypePointer Function 765 + 771: TypeMatrix 41(fvec2) 4 + 772: TypePointer Function 771 + 777: TypeMatrix 51(fvec4) 3 + 778: TypePointer Function 777 + 783: TypeMatrix 46(fvec3) 4 + 784: TypePointer Function 783 + 952: 30(int) Constant 1 + 956: 30(int) Constant 2 + 960: 30(int) Constant 3 + 964: 23(int) Constant 1 + 968: 23(int) Constant 2 + 994: 10(float) Constant 1065353216 + 1016: TypePointer Function 11(fvec4) + 1018: TypeImage 10(float) 2D sampled format:Unknown + 1019: TypeSampledImage 1018 + 1020: 30(int) Constant 5 + 1021: TypeArray 1019 1020 + 1022: TypePointer UniformConstant 1021 +1023(arrayedSampler): 1022(ptr) Variable UniformConstant + 1024: TypePointer Input 23(int) + 1025(i): 1024(ptr) Variable Input + 1027: TypePointer UniformConstant 1019 + 1030: TypePointer Input 20(fvec2) + 1031(c2D): 1030(ptr) Variable Input + 1034: TypeArray 10(float) 956 + 1035: TypePointer Input 1034 +1036(gl_ClipDistance): 1035(ptr) Variable Input + 1037: TypePointer Input 10(float) + 1041: TypeVector 10(float) 3 + 1046: TypeVector 30(int) 4 + 1047: TypePointer Output 1046(ivec4) + 1048(uoutp): 1047(ptr) Variable Output + 1049: TypeImage 30(int) Rect sampled format:Unknown + 1050: TypeSampledImage 1049 + 1051: TypePointer UniformConstant 1050 + 1052(samp2dr): 1051(ptr) Variable UniformConstant + 1055: 30(int) Constant 4 + 1056: TypeArray 24(ivec2) 1055 + 1057: 24(ivec2) ConstantComposite 964 968 + 1058: 23(int) Constant 15 + 1059: 23(int) Constant 16 + 1060: 24(ivec2) ConstantComposite 1058 1059 + 1061: 23(int) Constant 4294967294 + 1062: 23(int) Constant 0 + 1063: 24(ivec2) ConstantComposite 1061 1062 + 1064: 1056 ConstantComposite 1057 27 1060 1063 + 1072: TypeVector 23(int) 4 + 1073: TypePointer Output 1072(ivec4) + 1074(ioutp): 1073(ptr) Variable Output + 1075: TypeImage 23(int) 2D array sampled format:Unknown + 1076: TypeSampledImage 1075 + 1077: TypePointer UniformConstant 1076 + 1078(isamp2DA): 1077(ptr) Variable UniformConstant + 1080: 10(float) Constant 1036831949 + 1081: 1041(fvec3) ConstantComposite 1080 1080 1080 + 1082: 24(ivec2) ConstantComposite 964 964 + 1094: TypePointer Input 11(fvec4) +1095(gl_FragCoord): 1094(ptr) Variable Input + 1097(vl2): 1094(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 36(v): 35(ptr) Variable Function - 45: 21(int) Load 44(i) - 47: 46(ptr) AccessChain 42(arrayedSampler) 45 - 48: 38 Load 47 - 51: 18(fvec2) Load 50(c2D) - 52: 9(fvec4) ImageSampleImplicitLod 48 51 - Store 36(v) 52 - 59: 58(ptr) AccessChain 56(gl_ClipDistance) 57 - 60: 8(float) Load 59 - 61: 30(ptr) AccessChain 11(outp) 29 - Store 61 60 - 63: 9(fvec4) Load 36(v) - 64: 62(fvec3) VectorShuffle 63 63 1 2 3 - 65: 9(fvec4) Load 11(outp) - 66: 9(fvec4) VectorShuffle 65 64 0 4 5 6 - Store 11(outp) 66 - 74: 71 Load 73(samp2dr) - 75: 18(fvec2) Load 50(c2D) - 87: 67(ivec4) ImageGather 74 75 78 ConstOffsets 86 - Store 69(uoutp) 87 - 88: 46(ptr) AccessChain 42(arrayedSampler) 84 - 89: 38 Load 88 - 90: 18(fvec2) Load 50(c2D) - 91: 9(fvec4) ImageGather 89 90 84 - 92: 9(fvec4) Load 11(outp) - 93: 9(fvec4) FAdd 92 91 - Store 11(outp) 93 - 101: 98 Load 100(isamp2DA) - 105: 94(ivec4) ImageGather 101 103 23 ConstOffset 104 - Store 96(ioutp) 105 - 106: 98 Load 100(isamp2DA) - 107: 94(ivec4) ImageGather 106 103 23 ConstOffset 104 - 108: 94(ivec4) Load 96(ioutp) - 109: 94(ivec4) IAdd 108 107 - Store 96(ioutp) 109 - 110: 98 Load 100(isamp2DA) - 111: 21(int) Load 44(i) - 112: 22(ivec2) CompositeConstruct 111 111 - 113: 94(ivec4) ImageGather 110 103 84 Offset 112 - 114: 94(ivec4) Load 96(ioutp) - 115: 94(ivec4) IAdd 114 113 - Store 96(ioutp) 115 - 118: 9(fvec4) Load 117(gl_FragCoord) - 120: 9(fvec4) Load 119(vl2) - 121: 9(fvec4) FAdd 118 120 - 122: 9(fvec4) Load 11(outp) - 123: 9(fvec4) FAdd 122 121 - Store 11(outp) 123 - 124: 2 FunctionCall 6(foo23() + 1017(v): 1016(ptr) Variable Function + 1026: 23(int) Load 1025(i) + 1028: 1027(ptr) AccessChain 1023(arrayedSampler) 1026 + 1029: 1019 Load 1028 + 1032: 20(fvec2) Load 1031(c2D) + 1033: 11(fvec4) ImageSampleImplicitLod 1029 1032 + Store 1017(v) 1033 + 1038: 1037(ptr) AccessChain 1036(gl_ClipDistance) 964 + 1039: 10(float) Load 1038 + 1040: 32(ptr) AccessChain 13(outp) 31 + Store 1040 1039 + 1042: 11(fvec4) Load 1017(v) + 1043: 1041(fvec3) VectorShuffle 1042 1042 1 2 3 + 1044: 11(fvec4) Load 13(outp) + 1045: 11(fvec4) VectorShuffle 1044 1043 0 4 5 6 + Store 13(outp) 1045 + 1053: 1050 Load 1052(samp2dr) + 1054: 20(fvec2) Load 1031(c2D) + 1065: 1046(ivec4) ImageGather 1053 1054 968 ConstOffsets 1064 + Store 1048(uoutp) 1065 + 1066: 1027(ptr) AccessChain 1023(arrayedSampler) 1062 + 1067: 1019 Load 1066 + 1068: 20(fvec2) Load 1031(c2D) + 1069: 11(fvec4) ImageGather 1067 1068 1062 + 1070: 11(fvec4) Load 13(outp) + 1071: 11(fvec4) FAdd 1070 1069 + Store 13(outp) 1071 + 1079: 1076 Load 1078(isamp2DA) + 1083: 1072(ivec4) ImageGather 1079 1081 25 ConstOffset 1082 + Store 1074(ioutp) 1083 + 1084: 1076 Load 1078(isamp2DA) + 1085: 1072(ivec4) ImageGather 1084 1081 25 ConstOffset 1082 + 1086: 1072(ivec4) Load 1074(ioutp) + 1087: 1072(ivec4) IAdd 1086 1085 + Store 1074(ioutp) 1087 + 1088: 1076 Load 1078(isamp2DA) + 1089: 23(int) Load 1025(i) + 1090: 24(ivec2) CompositeConstruct 1089 1089 + 1091: 1072(ivec4) ImageGather 1088 1081 1062 Offset 1090 + 1092: 1072(ivec4) Load 1074(ioutp) + 1093: 1072(ivec4) IAdd 1092 1091 + Store 1074(ioutp) 1093 + 1096: 11(fvec4) Load 1095(gl_FragCoord) + 1098: 11(fvec4) Load 1097(vl2) + 1099: 11(fvec4) FAdd 1096 1098 + 1100: 11(fvec4) Load 13(outp) + 1101: 11(fvec4) FAdd 1100 1099 + Store 13(outp) 1101 + 1102: 2 FunctionCall 6(foo23() + 1103: 2 FunctionCall 8(doubles() Return FunctionEnd 6(foo23(): 2 Function None 3 7: Label - 16: 13 Load 15(u2drs) - 17: 9(fvec4) Load 11(outp) - 26: 8(float) CompositeExtract 17 2 - 27: 8(float) ImageSampleProjDrefExplicitLod 16 17 26 Grad ConstOffset 20 20 25 - 31: 30(ptr) AccessChain 11(outp) 29 - 32: 8(float) Load 31 - 33: 8(float) FAdd 32 27 - 34: 30(ptr) AccessChain 11(outp) 29 - Store 34 33 + 18: 15 Load 17(u2drs) + 19: 11(fvec4) Load 13(outp) + 28: 10(float) CompositeExtract 19 2 + 29: 10(float) ImageSampleProjDrefExplicitLod 18 19 28 Grad ConstOffset 22 22 27 + 33: 32(ptr) AccessChain 13(outp) 31 + 34: 10(float) Load 33 + 35: 10(float) FAdd 34 29 + 36: 32(ptr) AccessChain 13(outp) 31 + Store 36 35 + Return + FunctionEnd + 8(doubles(): 2 Function None 3 + 9: Label + 39(doublev): 38(ptr) Variable Function + 43(dvec2v): 42(ptr) Variable Function + 48(dvec3v): 47(ptr) Variable Function + 53(dvec4v): 52(ptr) Variable Function + 428(boolv): 427(ptr) Variable Function + 437(bvec2v): 436(ptr) Variable Function + 446(bvec3v): 445(ptr) Variable Function + 455(bvec4v): 454(ptr) Variable Function + 554: 427(ptr) Variable Function + 563: 436(ptr) Variable Function + 572: 445(ptr) Variable Function + 581: 454(ptr) Variable Function + 737(dmat2v): 736(ptr) Variable Function + 743(dmat3v): 742(ptr) Variable Function + 749(dmat4v): 748(ptr) Variable Function + 755(dmat2x3v): 754(ptr) Variable Function + 761(dmat3x2v): 760(ptr) Variable Function + 767(dmat2x4v): 766(ptr) Variable Function + 773(dmat4x2v): 772(ptr) Variable Function + 779(dmat3x4v): 778(ptr) Variable Function + 785(dmat4x3v): 784(ptr) Variable Function + Store 39(doublev) 40 + Store 43(dvec2v) 45 + Store 48(dvec3v) 50 + 54: 37(float) Load 39(doublev) + 55: 51(fvec4) CompositeConstruct 54 54 54 54 + 56: 51(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 55 + Store 53(dvec4v) 56 + 57: 37(float) Load 39(doublev) + 58: 37(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 57 + 59: 37(float) Load 39(doublev) + 60: 37(float) FAdd 59 58 + Store 39(doublev) 60 + 61: 41(fvec2) Load 43(dvec2v) + 62: 41(fvec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 61 + 63: 41(fvec2) Load 43(dvec2v) + 64: 41(fvec2) FAdd 63 62 + Store 43(dvec2v) 64 + 65: 46(fvec3) Load 48(dvec3v) + 66: 46(fvec3) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 65 + 67: 46(fvec3) Load 48(dvec3v) + 68: 46(fvec3) FAdd 67 66 + Store 48(dvec3v) 68 + 69: 51(fvec4) Load 53(dvec4v) + 70: 51(fvec4) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 69 + 71: 51(fvec4) Load 53(dvec4v) + 72: 51(fvec4) FAdd 71 70 + Store 53(dvec4v) 72 + 73: 37(float) Load 39(doublev) + 74: 37(float) ExtInst 1(GLSL.std.450) 4(FAbs) 73 + 75: 37(float) Load 39(doublev) + 76: 37(float) FAdd 75 74 + Store 39(doublev) 76 + 77: 41(fvec2) Load 43(dvec2v) + 78: 41(fvec2) ExtInst 1(GLSL.std.450) 4(FAbs) 77 + 79: 41(fvec2) Load 43(dvec2v) + 80: 41(fvec2) FAdd 79 78 + Store 43(dvec2v) 80 + 81: 46(fvec3) Load 48(dvec3v) + 82: 46(fvec3) ExtInst 1(GLSL.std.450) 4(FAbs) 81 + 83: 46(fvec3) Load 48(dvec3v) + 84: 46(fvec3) FAdd 83 82 + Store 48(dvec3v) 84 + 85: 51(fvec4) Load 53(dvec4v) + 86: 51(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 85 + 87: 51(fvec4) Load 53(dvec4v) + 88: 51(fvec4) FAdd 87 86 + Store 53(dvec4v) 88 + 89: 37(float) Load 39(doublev) + 90: 37(float) ExtInst 1(GLSL.std.450) 6(FSign) 89 + 91: 37(float) Load 39(doublev) + 92: 37(float) FAdd 91 90 + Store 39(doublev) 92 + 93: 41(fvec2) Load 43(dvec2v) + 94: 41(fvec2) ExtInst 1(GLSL.std.450) 6(FSign) 93 + 95: 41(fvec2) Load 43(dvec2v) + 96: 41(fvec2) FAdd 95 94 + Store 43(dvec2v) 96 + 97: 46(fvec3) Load 48(dvec3v) + 98: 46(fvec3) ExtInst 1(GLSL.std.450) 6(FSign) 97 + 99: 46(fvec3) Load 48(dvec3v) + 100: 46(fvec3) FAdd 99 98 + Store 48(dvec3v) 100 + 101: 51(fvec4) Load 53(dvec4v) + 102: 51(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 101 + 103: 51(fvec4) Load 53(dvec4v) + 104: 51(fvec4) FAdd 103 102 + Store 53(dvec4v) 104 + 105: 37(float) Load 39(doublev) + 106: 37(float) ExtInst 1(GLSL.std.450) 8(Floor) 105 + 107: 37(float) Load 39(doublev) + 108: 37(float) FAdd 107 106 + Store 39(doublev) 108 + 109: 41(fvec2) Load 43(dvec2v) + 110: 41(fvec2) ExtInst 1(GLSL.std.450) 8(Floor) 109 + 111: 41(fvec2) Load 43(dvec2v) + 112: 41(fvec2) FAdd 111 110 + Store 43(dvec2v) 112 + 113: 46(fvec3) Load 48(dvec3v) + 114: 46(fvec3) ExtInst 1(GLSL.std.450) 8(Floor) 113 + 115: 46(fvec3) Load 48(dvec3v) + 116: 46(fvec3) FAdd 115 114 + Store 48(dvec3v) 116 + 117: 51(fvec4) Load 53(dvec4v) + 118: 51(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 117 + 119: 51(fvec4) Load 53(dvec4v) + 120: 51(fvec4) FAdd 119 118 + Store 53(dvec4v) 120 + 121: 37(float) Load 39(doublev) + 122: 37(float) ExtInst 1(GLSL.std.450) 3(Trunc) 121 + 123: 37(float) Load 39(doublev) + 124: 37(float) FAdd 123 122 + Store 39(doublev) 124 + 125: 41(fvec2) Load 43(dvec2v) + 126: 41(fvec2) ExtInst 1(GLSL.std.450) 3(Trunc) 125 + 127: 41(fvec2) Load 43(dvec2v) + 128: 41(fvec2) FAdd 127 126 + Store 43(dvec2v) 128 + 129: 46(fvec3) Load 48(dvec3v) + 130: 46(fvec3) ExtInst 1(GLSL.std.450) 3(Trunc) 129 + 131: 46(fvec3) Load 48(dvec3v) + 132: 46(fvec3) FAdd 131 130 + Store 48(dvec3v) 132 + 133: 51(fvec4) Load 53(dvec4v) + 134: 51(fvec4) ExtInst 1(GLSL.std.450) 3(Trunc) 133 + 135: 51(fvec4) Load 53(dvec4v) + 136: 51(fvec4) FAdd 135 134 + Store 53(dvec4v) 136 + 137: 37(float) Load 39(doublev) + 138: 37(float) ExtInst 1(GLSL.std.450) 1(Round) 137 + 139: 37(float) Load 39(doublev) + 140: 37(float) FAdd 139 138 + Store 39(doublev) 140 + 141: 41(fvec2) Load 43(dvec2v) + 142: 41(fvec2) ExtInst 1(GLSL.std.450) 1(Round) 141 + 143: 41(fvec2) Load 43(dvec2v) + 144: 41(fvec2) FAdd 143 142 + Store 43(dvec2v) 144 + 145: 46(fvec3) Load 48(dvec3v) + 146: 46(fvec3) ExtInst 1(GLSL.std.450) 1(Round) 145 + 147: 46(fvec3) Load 48(dvec3v) + 148: 46(fvec3) FAdd 147 146 + Store 48(dvec3v) 148 + 149: 51(fvec4) Load 53(dvec4v) + 150: 51(fvec4) ExtInst 1(GLSL.std.450) 1(Round) 149 + 151: 51(fvec4) Load 53(dvec4v) + 152: 51(fvec4) FAdd 151 150 + Store 53(dvec4v) 152 + 153: 37(float) Load 39(doublev) + 154: 37(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 153 + 155: 37(float) Load 39(doublev) + 156: 37(float) FAdd 155 154 + Store 39(doublev) 156 + 157: 41(fvec2) Load 43(dvec2v) + 158: 41(fvec2) ExtInst 1(GLSL.std.450) 2(RoundEven) 157 + 159: 41(fvec2) Load 43(dvec2v) + 160: 41(fvec2) FAdd 159 158 + Store 43(dvec2v) 160 + 161: 46(fvec3) Load 48(dvec3v) + 162: 46(fvec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 161 + 163: 46(fvec3) Load 48(dvec3v) + 164: 46(fvec3) FAdd 163 162 + Store 48(dvec3v) 164 + 165: 51(fvec4) Load 53(dvec4v) + 166: 51(fvec4) ExtInst 1(GLSL.std.450) 2(RoundEven) 165 + 167: 51(fvec4) Load 53(dvec4v) + 168: 51(fvec4) FAdd 167 166 + Store 53(dvec4v) 168 + 169: 37(float) Load 39(doublev) + 170: 37(float) ExtInst 1(GLSL.std.450) 9(Ceil) 169 + 171: 37(float) Load 39(doublev) + 172: 37(float) FAdd 171 170 + Store 39(doublev) 172 + 173: 41(fvec2) Load 43(dvec2v) + 174: 41(fvec2) ExtInst 1(GLSL.std.450) 9(Ceil) 173 + 175: 41(fvec2) Load 43(dvec2v) + 176: 41(fvec2) FAdd 175 174 + Store 43(dvec2v) 176 + 177: 46(fvec3) Load 48(dvec3v) + 178: 46(fvec3) ExtInst 1(GLSL.std.450) 9(Ceil) 177 + 179: 46(fvec3) Load 48(dvec3v) + 180: 46(fvec3) FAdd 179 178 + Store 48(dvec3v) 180 + 181: 51(fvec4) Load 53(dvec4v) + 182: 51(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 181 + 183: 51(fvec4) Load 53(dvec4v) + 184: 51(fvec4) FAdd 183 182 + Store 53(dvec4v) 184 + 185: 37(float) Load 39(doublev) + 186: 37(float) ExtInst 1(GLSL.std.450) 10(Fract) 185 + 187: 37(float) Load 39(doublev) + 188: 37(float) FAdd 187 186 + Store 39(doublev) 188 + 189: 41(fvec2) Load 43(dvec2v) + 190: 41(fvec2) ExtInst 1(GLSL.std.450) 10(Fract) 189 + 191: 41(fvec2) Load 43(dvec2v) + 192: 41(fvec2) FAdd 191 190 + Store 43(dvec2v) 192 + 193: 46(fvec3) Load 48(dvec3v) + 194: 46(fvec3) ExtInst 1(GLSL.std.450) 10(Fract) 193 + 195: 46(fvec3) Load 48(dvec3v) + 196: 46(fvec3) FAdd 195 194 + Store 48(dvec3v) 196 + 197: 51(fvec4) Load 53(dvec4v) + 198: 51(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 197 + 199: 51(fvec4) Load 53(dvec4v) + 200: 51(fvec4) FAdd 199 198 + Store 53(dvec4v) 200 + 201: 37(float) Load 39(doublev) + 202: 37(float) Load 39(doublev) + 203: 37(float) FMod 201 202 + 204: 37(float) Load 39(doublev) + 205: 37(float) FAdd 204 203 + Store 39(doublev) 205 + 206: 41(fvec2) Load 43(dvec2v) + 207: 37(float) Load 39(doublev) + 208: 41(fvec2) CompositeConstruct 207 207 + 209: 41(fvec2) FMod 206 208 + 210: 41(fvec2) Load 43(dvec2v) + 211: 41(fvec2) FAdd 210 209 + Store 43(dvec2v) 211 + 212: 46(fvec3) Load 48(dvec3v) + 213: 37(float) Load 39(doublev) + 214: 46(fvec3) CompositeConstruct 213 213 213 + 215: 46(fvec3) FMod 212 214 + 216: 46(fvec3) Load 48(dvec3v) + 217: 46(fvec3) FAdd 216 215 + Store 48(dvec3v) 217 + 218: 51(fvec4) Load 53(dvec4v) + 219: 37(float) Load 39(doublev) + 220: 51(fvec4) CompositeConstruct 219 219 219 219 + 221: 51(fvec4) FMod 218 220 + 222: 51(fvec4) Load 53(dvec4v) + 223: 51(fvec4) FAdd 222 221 + Store 53(dvec4v) 223 + 224: 41(fvec2) Load 43(dvec2v) + 225: 41(fvec2) Load 43(dvec2v) + 226: 41(fvec2) FMod 224 225 + 227: 41(fvec2) Load 43(dvec2v) + 228: 41(fvec2) FAdd 227 226 + Store 43(dvec2v) 228 + 229: 46(fvec3) Load 48(dvec3v) + 230: 46(fvec3) Load 48(dvec3v) + 231: 46(fvec3) FMod 229 230 + 232: 46(fvec3) Load 48(dvec3v) + 233: 46(fvec3) FAdd 232 231 + Store 48(dvec3v) 233 + 234: 51(fvec4) Load 53(dvec4v) + 235: 51(fvec4) Load 53(dvec4v) + 236: 51(fvec4) FMod 234 235 + 237: 51(fvec4) Load 53(dvec4v) + 238: 51(fvec4) FAdd 237 236 + Store 53(dvec4v) 238 + 239: 37(float) Load 39(doublev) + 240: 37(float) ExtInst 1(GLSL.std.450) 35(Modf) 239 39(doublev) + 241: 37(float) Load 39(doublev) + 242: 37(float) FAdd 241 240 + Store 39(doublev) 242 + 243: 41(fvec2) Load 43(dvec2v) + 244: 41(fvec2) ExtInst 1(GLSL.std.450) 35(Modf) 243 43(dvec2v) + 245: 41(fvec2) Load 43(dvec2v) + 246: 41(fvec2) FAdd 245 244 + Store 43(dvec2v) 246 + 247: 46(fvec3) Load 48(dvec3v) + 248: 46(fvec3) ExtInst 1(GLSL.std.450) 35(Modf) 247 48(dvec3v) + 249: 46(fvec3) Load 48(dvec3v) + 250: 46(fvec3) FAdd 249 248 + Store 48(dvec3v) 250 + 251: 51(fvec4) Load 53(dvec4v) + 252: 51(fvec4) ExtInst 1(GLSL.std.450) 35(Modf) 251 53(dvec4v) + 253: 51(fvec4) Load 53(dvec4v) + 254: 51(fvec4) FAdd 253 252 + Store 53(dvec4v) 254 + 255: 37(float) Load 39(doublev) + 256: 37(float) Load 39(doublev) + 257: 37(float) ExtInst 1(GLSL.std.450) 37(FMin) 255 256 + 258: 37(float) Load 39(doublev) + 259: 37(float) FAdd 258 257 + Store 39(doublev) 259 + 260: 41(fvec2) Load 43(dvec2v) + 261: 37(float) Load 39(doublev) + 262: 41(fvec2) CompositeConstruct 261 261 + 263: 41(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 260 262 + 264: 41(fvec2) Load 43(dvec2v) + 265: 41(fvec2) FAdd 264 263 + Store 43(dvec2v) 265 + 266: 46(fvec3) Load 48(dvec3v) + 267: 37(float) Load 39(doublev) + 268: 46(fvec3) CompositeConstruct 267 267 267 + 269: 46(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 266 268 + 270: 46(fvec3) Load 48(dvec3v) + 271: 46(fvec3) FAdd 270 269 + Store 48(dvec3v) 271 + 272: 51(fvec4) Load 53(dvec4v) + 273: 37(float) Load 39(doublev) + 274: 51(fvec4) CompositeConstruct 273 273 273 273 + 275: 51(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 272 274 + 276: 51(fvec4) Load 53(dvec4v) + 277: 51(fvec4) FAdd 276 275 + Store 53(dvec4v) 277 + 278: 41(fvec2) Load 43(dvec2v) + 279: 41(fvec2) Load 43(dvec2v) + 280: 41(fvec2) ExtInst 1(GLSL.std.450) 37(FMin) 278 279 + 281: 41(fvec2) Load 43(dvec2v) + 282: 41(fvec2) FAdd 281 280 + Store 43(dvec2v) 282 + 283: 46(fvec3) Load 48(dvec3v) + 284: 46(fvec3) Load 48(dvec3v) + 285: 46(fvec3) ExtInst 1(GLSL.std.450) 37(FMin) 283 284 + 286: 46(fvec3) Load 48(dvec3v) + 287: 46(fvec3) FAdd 286 285 + Store 48(dvec3v) 287 + 288: 51(fvec4) Load 53(dvec4v) + 289: 51(fvec4) Load 53(dvec4v) + 290: 51(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 288 289 + 291: 51(fvec4) Load 53(dvec4v) + 292: 51(fvec4) FAdd 291 290 + Store 53(dvec4v) 292 + 293: 37(float) Load 39(doublev) + 294: 37(float) Load 39(doublev) + 295: 37(float) ExtInst 1(GLSL.std.450) 40(FMax) 293 294 + 296: 37(float) Load 39(doublev) + 297: 37(float) FAdd 296 295 + Store 39(doublev) 297 + 298: 41(fvec2) Load 43(dvec2v) + 299: 37(float) Load 39(doublev) + 300: 41(fvec2) CompositeConstruct 299 299 + 301: 41(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 298 300 + 302: 41(fvec2) Load 43(dvec2v) + 303: 41(fvec2) FAdd 302 301 + Store 43(dvec2v) 303 + 304: 46(fvec3) Load 48(dvec3v) + 305: 37(float) Load 39(doublev) + 306: 46(fvec3) CompositeConstruct 305 305 305 + 307: 46(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 304 306 + 308: 46(fvec3) Load 48(dvec3v) + 309: 46(fvec3) FAdd 308 307 + Store 48(dvec3v) 309 + 310: 51(fvec4) Load 53(dvec4v) + 311: 37(float) Load 39(doublev) + 312: 51(fvec4) CompositeConstruct 311 311 311 311 + 313: 51(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 310 312 + 314: 51(fvec4) Load 53(dvec4v) + 315: 51(fvec4) FAdd 314 313 + Store 53(dvec4v) 315 + 316: 41(fvec2) Load 43(dvec2v) + 317: 41(fvec2) Load 43(dvec2v) + 318: 41(fvec2) ExtInst 1(GLSL.std.450) 40(FMax) 316 317 + 319: 41(fvec2) Load 43(dvec2v) + 320: 41(fvec2) FAdd 319 318 + Store 43(dvec2v) 320 + 321: 46(fvec3) Load 48(dvec3v) + 322: 46(fvec3) Load 48(dvec3v) + 323: 46(fvec3) ExtInst 1(GLSL.std.450) 40(FMax) 321 322 + 324: 46(fvec3) Load 48(dvec3v) + 325: 46(fvec3) FAdd 324 323 + Store 48(dvec3v) 325 + 326: 51(fvec4) Load 53(dvec4v) + 327: 51(fvec4) Load 53(dvec4v) + 328: 51(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 326 327 + 329: 51(fvec4) Load 53(dvec4v) + 330: 51(fvec4) FAdd 329 328 + Store 53(dvec4v) 330 + 331: 37(float) Load 39(doublev) + 332: 37(float) Load 39(doublev) + 333: 37(float) Load 39(doublev) + 334: 37(float) ExtInst 1(GLSL.std.450) 43(FClamp) 331 332 333 + 335: 37(float) Load 39(doublev) + 336: 37(float) FAdd 335 334 + Store 39(doublev) 336 + 337: 41(fvec2) Load 43(dvec2v) + 338: 37(float) Load 39(doublev) + 339: 37(float) Load 39(doublev) + 340: 41(fvec2) CompositeConstruct 338 338 + 341: 41(fvec2) CompositeConstruct 339 339 + 342: 41(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 337 340 341 + 343: 41(fvec2) Load 43(dvec2v) + 344: 41(fvec2) FAdd 343 342 + Store 43(dvec2v) 344 + 345: 46(fvec3) Load 48(dvec3v) + 346: 37(float) Load 39(doublev) + 347: 37(float) Load 39(doublev) + 348: 46(fvec3) CompositeConstruct 346 346 346 + 349: 46(fvec3) CompositeConstruct 347 347 347 + 350: 46(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 345 348 349 + 351: 46(fvec3) Load 48(dvec3v) + 352: 46(fvec3) FAdd 351 350 + Store 48(dvec3v) 352 + 353: 51(fvec4) Load 53(dvec4v) + 354: 37(float) Load 39(doublev) + 355: 37(float) Load 39(doublev) + 356: 51(fvec4) CompositeConstruct 354 354 354 354 + 357: 51(fvec4) CompositeConstruct 355 355 355 355 + 358: 51(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 353 356 357 + 359: 51(fvec4) Load 53(dvec4v) + 360: 51(fvec4) FAdd 359 358 + Store 53(dvec4v) 360 + 361: 41(fvec2) Load 43(dvec2v) + 362: 41(fvec2) Load 43(dvec2v) + 363: 41(fvec2) Load 43(dvec2v) + 364: 41(fvec2) ExtInst 1(GLSL.std.450) 43(FClamp) 361 362 363 + 365: 41(fvec2) Load 43(dvec2v) + 366: 41(fvec2) FAdd 365 364 + Store 43(dvec2v) 366 + 367: 46(fvec3) Load 48(dvec3v) + 368: 46(fvec3) Load 48(dvec3v) + 369: 46(fvec3) Load 48(dvec3v) + 370: 46(fvec3) ExtInst 1(GLSL.std.450) 43(FClamp) 367 368 369 + 371: 46(fvec3) Load 48(dvec3v) + 372: 46(fvec3) FAdd 371 370 + Store 48(dvec3v) 372 + 373: 51(fvec4) Load 53(dvec4v) + 374: 51(fvec4) Load 53(dvec4v) + 375: 51(fvec4) Load 53(dvec4v) + 376: 51(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 373 374 375 + 377: 51(fvec4) Load 53(dvec4v) + 378: 51(fvec4) FAdd 377 376 + Store 53(dvec4v) 378 + 379: 37(float) Load 39(doublev) + 380: 37(float) Load 39(doublev) + 381: 37(float) Load 39(doublev) + 382: 37(float) ExtInst 1(GLSL.std.450) 46(FMix) 379 380 381 + 383: 37(float) Load 39(doublev) + 384: 37(float) FAdd 383 382 + Store 39(doublev) 384 + 385: 41(fvec2) Load 43(dvec2v) + 386: 41(fvec2) Load 43(dvec2v) + 387: 37(float) Load 39(doublev) + 388: 41(fvec2) CompositeConstruct 387 387 + 389: 41(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 385 386 388 + 390: 41(fvec2) Load 43(dvec2v) + 391: 41(fvec2) FAdd 390 389 + Store 43(dvec2v) 391 + 392: 46(fvec3) Load 48(dvec3v) + 393: 46(fvec3) Load 48(dvec3v) + 394: 37(float) Load 39(doublev) + 395: 46(fvec3) CompositeConstruct 394 394 394 + 396: 46(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 392 393 395 + 397: 46(fvec3) Load 48(dvec3v) + 398: 46(fvec3) FAdd 397 396 + Store 48(dvec3v) 398 + 399: 51(fvec4) Load 53(dvec4v) + 400: 51(fvec4) Load 53(dvec4v) + 401: 37(float) Load 39(doublev) + 402: 51(fvec4) CompositeConstruct 401 401 401 401 + 403: 51(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 399 400 402 + 404: 51(fvec4) Load 53(dvec4v) + 405: 51(fvec4) FAdd 404 403 + Store 53(dvec4v) 405 + 406: 41(fvec2) Load 43(dvec2v) + 407: 41(fvec2) Load 43(dvec2v) + 408: 41(fvec2) Load 43(dvec2v) + 409: 41(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 406 407 408 + 410: 41(fvec2) Load 43(dvec2v) + 411: 41(fvec2) FAdd 410 409 + Store 43(dvec2v) 411 + 412: 46(fvec3) Load 48(dvec3v) + 413: 46(fvec3) Load 48(dvec3v) + 414: 46(fvec3) Load 48(dvec3v) + 415: 46(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 412 413 414 + 416: 46(fvec3) Load 48(dvec3v) + 417: 46(fvec3) FAdd 416 415 + Store 48(dvec3v) 417 + 418: 51(fvec4) Load 53(dvec4v) + 419: 51(fvec4) Load 53(dvec4v) + 420: 51(fvec4) Load 53(dvec4v) + 421: 51(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 418 419 420 + 422: 51(fvec4) Load 53(dvec4v) + 423: 51(fvec4) FAdd 422 421 + Store 53(dvec4v) 423 + 424: 37(float) Load 39(doublev) + 425: 37(float) Load 39(doublev) + 429: 426(bool) Load 428(boolv) + 430: 37(float) ExtInst 1(GLSL.std.450) 46(FMix) 424 425 429 + 431: 37(float) Load 39(doublev) + 432: 37(float) FAdd 431 430 + Store 39(doublev) 432 + 433: 41(fvec2) Load 43(dvec2v) + 434: 41(fvec2) Load 43(dvec2v) + 438: 435(bvec2) Load 437(bvec2v) + 439: 41(fvec2) ExtInst 1(GLSL.std.450) 46(FMix) 433 434 438 + 440: 41(fvec2) Load 43(dvec2v) + 441: 41(fvec2) FAdd 440 439 + Store 43(dvec2v) 441 + 442: 46(fvec3) Load 48(dvec3v) + 443: 46(fvec3) Load 48(dvec3v) + 447: 444(bvec3) Load 446(bvec3v) + 448: 46(fvec3) ExtInst 1(GLSL.std.450) 46(FMix) 442 443 447 + 449: 46(fvec3) Load 48(dvec3v) + 450: 46(fvec3) FAdd 449 448 + Store 48(dvec3v) 450 + 451: 51(fvec4) Load 53(dvec4v) + 452: 51(fvec4) Load 53(dvec4v) + 456: 453(bvec4) Load 455(bvec4v) + 457: 51(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 451 452 456 + 458: 51(fvec4) Load 53(dvec4v) + 459: 51(fvec4) FAdd 458 457 + Store 53(dvec4v) 459 + 460: 37(float) Load 39(doublev) + 461: 37(float) Load 39(doublev) + 462: 37(float) ExtInst 1(GLSL.std.450) 48(Step) 460 461 + 463: 37(float) Load 39(doublev) + 464: 37(float) FAdd 463 462 + Store 39(doublev) 464 + 465: 41(fvec2) Load 43(dvec2v) + 466: 41(fvec2) Load 43(dvec2v) + 467: 41(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 465 466 + 468: 41(fvec2) Load 43(dvec2v) + 469: 41(fvec2) FAdd 468 467 + Store 43(dvec2v) 469 + 470: 46(fvec3) Load 48(dvec3v) + 471: 46(fvec3) Load 48(dvec3v) + 472: 46(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 470 471 + 473: 46(fvec3) Load 48(dvec3v) + 474: 46(fvec3) FAdd 473 472 + Store 48(dvec3v) 474 + 475: 51(fvec4) Load 53(dvec4v) + 476: 51(fvec4) Load 53(dvec4v) + 477: 51(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 475 476 + 478: 51(fvec4) Load 53(dvec4v) + 479: 51(fvec4) FAdd 478 477 + Store 53(dvec4v) 479 + 480: 37(float) Load 39(doublev) + 481: 41(fvec2) Load 43(dvec2v) + 482: 41(fvec2) CompositeConstruct 480 480 + 483: 41(fvec2) ExtInst 1(GLSL.std.450) 48(Step) 482 481 + 484: 41(fvec2) Load 43(dvec2v) + 485: 41(fvec2) FAdd 484 483 + Store 43(dvec2v) 485 + 486: 37(float) Load 39(doublev) + 487: 46(fvec3) Load 48(dvec3v) + 488: 46(fvec3) CompositeConstruct 486 486 486 + 489: 46(fvec3) ExtInst 1(GLSL.std.450) 48(Step) 488 487 + 490: 46(fvec3) Load 48(dvec3v) + 491: 46(fvec3) FAdd 490 489 + Store 48(dvec3v) 491 + 492: 37(float) Load 39(doublev) + 493: 51(fvec4) Load 53(dvec4v) + 494: 51(fvec4) CompositeConstruct 492 492 492 492 + 495: 51(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 494 493 + 496: 51(fvec4) Load 53(dvec4v) + 497: 51(fvec4) FAdd 496 495 + Store 53(dvec4v) 497 + 498: 37(float) Load 39(doublev) + 499: 37(float) Load 39(doublev) + 500: 37(float) Load 39(doublev) + 501: 37(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 498 499 500 + 502: 37(float) Load 39(doublev) + 503: 37(float) FAdd 502 501 + Store 39(doublev) 503 + 504: 41(fvec2) Load 43(dvec2v) + 505: 41(fvec2) Load 43(dvec2v) + 506: 41(fvec2) Load 43(dvec2v) + 507: 41(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 504 505 506 + 508: 41(fvec2) Load 43(dvec2v) + 509: 41(fvec2) FAdd 508 507 + Store 43(dvec2v) 509 + 510: 46(fvec3) Load 48(dvec3v) + 511: 46(fvec3) Load 48(dvec3v) + 512: 46(fvec3) Load 48(dvec3v) + 513: 46(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 510 511 512 + 514: 46(fvec3) Load 48(dvec3v) + 515: 46(fvec3) FAdd 514 513 + Store 48(dvec3v) 515 + 516: 51(fvec4) Load 53(dvec4v) + 517: 51(fvec4) Load 53(dvec4v) + 518: 51(fvec4) Load 53(dvec4v) + 519: 51(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 516 517 518 + 520: 51(fvec4) Load 53(dvec4v) + 521: 51(fvec4) FAdd 520 519 + Store 53(dvec4v) 521 + 522: 37(float) Load 39(doublev) + 523: 37(float) Load 39(doublev) + 524: 41(fvec2) Load 43(dvec2v) + 525: 41(fvec2) CompositeConstruct 522 522 + 526: 41(fvec2) CompositeConstruct 523 523 + 527: 41(fvec2) ExtInst 1(GLSL.std.450) 49(SmoothStep) 525 526 524 + 528: 41(fvec2) Load 43(dvec2v) + 529: 41(fvec2) FAdd 528 527 + Store 43(dvec2v) 529 + 530: 37(float) Load 39(doublev) + 531: 37(float) Load 39(doublev) + 532: 46(fvec3) Load 48(dvec3v) + 533: 46(fvec3) CompositeConstruct 530 530 530 + 534: 46(fvec3) CompositeConstruct 531 531 531 + 535: 46(fvec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 533 534 532 + 536: 46(fvec3) Load 48(dvec3v) + 537: 46(fvec3) FAdd 536 535 + Store 48(dvec3v) 537 + 538: 37(float) Load 39(doublev) + 539: 37(float) Load 39(doublev) + 540: 51(fvec4) Load 53(dvec4v) + 541: 51(fvec4) CompositeConstruct 538 538 538 538 + 542: 51(fvec4) CompositeConstruct 539 539 539 539 + 543: 51(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 541 542 540 + 544: 51(fvec4) Load 53(dvec4v) + 545: 51(fvec4) FAdd 544 543 + Store 53(dvec4v) 545 + 546: 37(float) Load 39(doublev) + 547: 426(bool) IsNan 546 + Store 428(boolv) 547 + 548: 41(fvec2) Load 43(dvec2v) + 549: 435(bvec2) IsNan 548 + Store 437(bvec2v) 549 + 550: 46(fvec3) Load 48(dvec3v) + 551: 444(bvec3) IsNan 550 + Store 446(bvec3v) 551 + 552: 51(fvec4) Load 53(dvec4v) + 553: 453(bvec4) IsNan 552 + Store 455(bvec4v) 553 + 555: 426(bool) Load 428(boolv) + SelectionMerge 557 None + BranchConditional 555 556 560 + 556: Label + 558: 37(float) Load 39(doublev) + 559: 426(bool) IsInf 558 + Store 554 559 + Branch 557 + 560: Label + Store 554 561 + Branch 557 + 557: Label + 562: 426(bool) Load 554 + Store 428(boolv) 562 + 564: 426(bool) Load 428(boolv) + SelectionMerge 566 None + BranchConditional 564 565 569 + 565: Label + 567: 41(fvec2) Load 43(dvec2v) + 568: 435(bvec2) IsInf 567 + Store 563 568 + Branch 566 + 569: Label + Store 563 570 + Branch 566 + 566: Label + 571: 435(bvec2) Load 563 + Store 437(bvec2v) 571 + 573: 426(bool) Load 428(boolv) + SelectionMerge 575 None + BranchConditional 573 574 578 + 574: Label + 576: 46(fvec3) Load 48(dvec3v) + 577: 444(bvec3) IsInf 576 + Store 572 577 + Branch 575 + 578: Label + Store 572 579 + Branch 575 + 575: Label + 580: 444(bvec3) Load 572 + Store 446(bvec3v) 580 + 582: 426(bool) Load 428(boolv) + SelectionMerge 584 None + BranchConditional 582 583 587 + 583: Label + 585: 51(fvec4) Load 53(dvec4v) + 586: 453(bvec4) IsInf 585 + Store 581 586 + Branch 584 + 587: Label + Store 581 588 + Branch 584 + 584: Label + 589: 453(bvec4) Load 581 + Store 455(bvec4v) 589 + 590: 37(float) Load 39(doublev) + 591: 37(float) ExtInst 1(GLSL.std.450) 66(Length) 590 + 592: 37(float) Load 39(doublev) + 593: 37(float) FAdd 592 591 + Store 39(doublev) 593 + 594: 41(fvec2) Load 43(dvec2v) + 595: 37(float) ExtInst 1(GLSL.std.450) 66(Length) 594 + 596: 37(float) Load 39(doublev) + 597: 37(float) FAdd 596 595 + Store 39(doublev) 597 + 598: 46(fvec3) Load 48(dvec3v) + 599: 37(float) ExtInst 1(GLSL.std.450) 66(Length) 598 + 600: 37(float) Load 39(doublev) + 601: 37(float) FAdd 600 599 + Store 39(doublev) 601 + 602: 51(fvec4) Load 53(dvec4v) + 603: 37(float) ExtInst 1(GLSL.std.450) 66(Length) 602 + 604: 37(float) Load 39(doublev) + 605: 37(float) FAdd 604 603 + Store 39(doublev) 605 + 606: 37(float) Load 39(doublev) + 607: 37(float) Load 39(doublev) + 608: 37(float) ExtInst 1(GLSL.std.450) 67(Distance) 606 607 + 609: 37(float) Load 39(doublev) + 610: 37(float) FAdd 609 608 + Store 39(doublev) 610 + 611: 41(fvec2) Load 43(dvec2v) + 612: 41(fvec2) Load 43(dvec2v) + 613: 37(float) ExtInst 1(GLSL.std.450) 67(Distance) 611 612 + 614: 37(float) Load 39(doublev) + 615: 37(float) FAdd 614 613 + Store 39(doublev) 615 + 616: 46(fvec3) Load 48(dvec3v) + 617: 46(fvec3) Load 48(dvec3v) + 618: 37(float) ExtInst 1(GLSL.std.450) 67(Distance) 616 617 + 619: 37(float) Load 39(doublev) + 620: 37(float) FAdd 619 618 + Store 39(doublev) 620 + 621: 51(fvec4) Load 53(dvec4v) + 622: 51(fvec4) Load 53(dvec4v) + 623: 37(float) ExtInst 1(GLSL.std.450) 67(Distance) 621 622 + 624: 37(float) Load 39(doublev) + 625: 37(float) FAdd 624 623 + Store 39(doublev) 625 + 626: 37(float) Load 39(doublev) + 627: 37(float) Load 39(doublev) + 628: 37(float) FMul 626 627 + 629: 37(float) Load 39(doublev) + 630: 37(float) FAdd 629 628 + Store 39(doublev) 630 + 631: 41(fvec2) Load 43(dvec2v) + 632: 41(fvec2) Load 43(dvec2v) + 633: 37(float) Dot 631 632 + 634: 37(float) Load 39(doublev) + 635: 37(float) FAdd 634 633 + Store 39(doublev) 635 + 636: 46(fvec3) Load 48(dvec3v) + 637: 46(fvec3) Load 48(dvec3v) + 638: 37(float) Dot 636 637 + 639: 37(float) Load 39(doublev) + 640: 37(float) FAdd 639 638 + Store 39(doublev) 640 + 641: 51(fvec4) Load 53(dvec4v) + 642: 51(fvec4) Load 53(dvec4v) + 643: 37(float) Dot 641 642 + 644: 37(float) Load 39(doublev) + 645: 37(float) FAdd 644 643 + Store 39(doublev) 645 + 646: 46(fvec3) Load 48(dvec3v) + 647: 46(fvec3) Load 48(dvec3v) + 648: 46(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 646 647 + 649: 46(fvec3) Load 48(dvec3v) + 650: 46(fvec3) FAdd 649 648 + Store 48(dvec3v) 650 + 651: 37(float) Load 39(doublev) + 652: 37(float) ExtInst 1(GLSL.std.450) 69(Normalize) 651 + 653: 37(float) Load 39(doublev) + 654: 37(float) FAdd 653 652 + Store 39(doublev) 654 + 655: 41(fvec2) Load 43(dvec2v) + 656: 41(fvec2) ExtInst 1(GLSL.std.450) 69(Normalize) 655 + 657: 41(fvec2) Load 43(dvec2v) + 658: 41(fvec2) FAdd 657 656 + Store 43(dvec2v) 658 + 659: 46(fvec3) Load 48(dvec3v) + 660: 46(fvec3) ExtInst 1(GLSL.std.450) 69(Normalize) 659 + 661: 46(fvec3) Load 48(dvec3v) + 662: 46(fvec3) FAdd 661 660 + Store 48(dvec3v) 662 + 663: 51(fvec4) Load 53(dvec4v) + 664: 51(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 663 + 665: 51(fvec4) Load 53(dvec4v) + 666: 51(fvec4) FAdd 665 664 + Store 53(dvec4v) 666 + 667: 37(float) Load 39(doublev) + 668: 37(float) Load 39(doublev) + 669: 37(float) Load 39(doublev) + 670: 37(float) ExtInst 1(GLSL.std.450) 70(FaceForward) 667 668 669 + 671: 37(float) Load 39(doublev) + 672: 37(float) FAdd 671 670 + Store 39(doublev) 672 + 673: 41(fvec2) Load 43(dvec2v) + 674: 41(fvec2) Load 43(dvec2v) + 675: 41(fvec2) Load 43(dvec2v) + 676: 41(fvec2) ExtInst 1(GLSL.std.450) 70(FaceForward) 673 674 675 + 677: 41(fvec2) Load 43(dvec2v) + 678: 41(fvec2) FAdd 677 676 + Store 43(dvec2v) 678 + 679: 46(fvec3) Load 48(dvec3v) + 680: 46(fvec3) Load 48(dvec3v) + 681: 46(fvec3) Load 48(dvec3v) + 682: 46(fvec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 679 680 681 + 683: 46(fvec3) Load 48(dvec3v) + 684: 46(fvec3) FAdd 683 682 + Store 48(dvec3v) 684 + 685: 51(fvec4) Load 53(dvec4v) + 686: 51(fvec4) Load 53(dvec4v) + 687: 51(fvec4) Load 53(dvec4v) + 688: 51(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 685 686 687 + 689: 51(fvec4) Load 53(dvec4v) + 690: 51(fvec4) FAdd 689 688 + Store 53(dvec4v) 690 + 691: 37(float) Load 39(doublev) + 692: 37(float) Load 39(doublev) + 693: 37(float) ExtInst 1(GLSL.std.450) 71(Reflect) 691 692 + 694: 37(float) Load 39(doublev) + 695: 37(float) FAdd 694 693 + Store 39(doublev) 695 + 696: 41(fvec2) Load 43(dvec2v) + 697: 41(fvec2) Load 43(dvec2v) + 698: 41(fvec2) ExtInst 1(GLSL.std.450) 71(Reflect) 696 697 + 699: 41(fvec2) Load 43(dvec2v) + 700: 41(fvec2) FAdd 699 698 + Store 43(dvec2v) 700 + 701: 46(fvec3) Load 48(dvec3v) + 702: 46(fvec3) Load 48(dvec3v) + 703: 46(fvec3) ExtInst 1(GLSL.std.450) 71(Reflect) 701 702 + 704: 46(fvec3) Load 48(dvec3v) + 705: 46(fvec3) FAdd 704 703 + Store 48(dvec3v) 705 + 706: 51(fvec4) Load 53(dvec4v) + 707: 51(fvec4) Load 53(dvec4v) + 708: 51(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 706 707 + 709: 51(fvec4) Load 53(dvec4v) + 710: 51(fvec4) FAdd 709 708 + Store 53(dvec4v) 710 + 711: 37(float) Load 39(doublev) + 712: 37(float) Load 39(doublev) + 713: 37(float) Load 39(doublev) + 714: 37(float) ExtInst 1(GLSL.std.450) 72(Refract) 711 712 713 + 715: 37(float) Load 39(doublev) + 716: 37(float) FAdd 715 714 + Store 39(doublev) 716 + 717: 41(fvec2) Load 43(dvec2v) + 718: 41(fvec2) Load 43(dvec2v) + 719: 37(float) Load 39(doublev) + 720: 41(fvec2) ExtInst 1(GLSL.std.450) 72(Refract) 717 718 719 + 721: 41(fvec2) Load 43(dvec2v) + 722: 41(fvec2) FAdd 721 720 + Store 43(dvec2v) 722 + 723: 46(fvec3) Load 48(dvec3v) + 724: 46(fvec3) Load 48(dvec3v) + 725: 37(float) Load 39(doublev) + 726: 46(fvec3) ExtInst 1(GLSL.std.450) 72(Refract) 723 724 725 + 727: 46(fvec3) Load 48(dvec3v) + 728: 46(fvec3) FAdd 727 726 + Store 48(dvec3v) 728 + 729: 51(fvec4) Load 53(dvec4v) + 730: 51(fvec4) Load 53(dvec4v) + 731: 37(float) Load 39(doublev) + 732: 51(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 729 730 731 + 733: 51(fvec4) Load 53(dvec4v) + 734: 51(fvec4) FAdd 733 732 + Store 53(dvec4v) 734 + 738: 41(fvec2) Load 43(dvec2v) + 739: 41(fvec2) Load 43(dvec2v) + 740: 735 OuterProduct 738 739 + Store 737(dmat2v) 740 + 744: 46(fvec3) Load 48(dvec3v) + 745: 46(fvec3) Load 48(dvec3v) + 746: 741 OuterProduct 744 745 + Store 743(dmat3v) 746 + 750: 51(fvec4) Load 53(dvec4v) + 751: 51(fvec4) Load 53(dvec4v) + 752: 747 OuterProduct 750 751 + Store 749(dmat4v) 752 + 756: 46(fvec3) Load 48(dvec3v) + 757: 41(fvec2) Load 43(dvec2v) + 758: 753 OuterProduct 756 757 + Store 755(dmat2x3v) 758 + 762: 41(fvec2) Load 43(dvec2v) + 763: 46(fvec3) Load 48(dvec3v) + 764: 759 OuterProduct 762 763 + Store 761(dmat3x2v) 764 + 768: 51(fvec4) Load 53(dvec4v) + 769: 41(fvec2) Load 43(dvec2v) + 770: 765 OuterProduct 768 769 + Store 767(dmat2x4v) 770 + 774: 41(fvec2) Load 43(dvec2v) + 775: 51(fvec4) Load 53(dvec4v) + 776: 771 OuterProduct 774 775 + Store 773(dmat4x2v) 776 + 780: 51(fvec4) Load 53(dvec4v) + 781: 46(fvec3) Load 48(dvec3v) + 782: 777 OuterProduct 780 781 + Store 779(dmat3x4v) 782 + 786: 46(fvec3) Load 48(dvec3v) + 787: 51(fvec4) Load 53(dvec4v) + 788: 783 OuterProduct 786 787 + Store 785(dmat4x3v) 788 + 789: 735 Load 737(dmat2v) + 790: 735 Load 737(dmat2v) + 791: 41(fvec2) CompositeExtract 789 0 + 792: 41(fvec2) CompositeExtract 790 0 + 793: 41(fvec2) FMul 791 792 + 794: 41(fvec2) CompositeExtract 789 1 + 795: 41(fvec2) CompositeExtract 790 1 + 796: 41(fvec2) FMul 794 795 + 797: 735 CompositeConstruct 793 796 + 798: 735 Load 737(dmat2v) + 799: 735 MatrixTimesMatrix 798 797 + Store 737(dmat2v) 799 + 800: 741 Load 743(dmat3v) + 801: 741 Load 743(dmat3v) + 802: 46(fvec3) CompositeExtract 800 0 + 803: 46(fvec3) CompositeExtract 801 0 + 804: 46(fvec3) FMul 802 803 + 805: 46(fvec3) CompositeExtract 800 1 + 806: 46(fvec3) CompositeExtract 801 1 + 807: 46(fvec3) FMul 805 806 + 808: 46(fvec3) CompositeExtract 800 2 + 809: 46(fvec3) CompositeExtract 801 2 + 810: 46(fvec3) FMul 808 809 + 811: 741 CompositeConstruct 804 807 810 + 812: 741 Load 743(dmat3v) + 813: 741 MatrixTimesMatrix 812 811 + Store 743(dmat3v) 813 + 814: 747 Load 749(dmat4v) + 815: 747 Load 749(dmat4v) + 816: 51(fvec4) CompositeExtract 814 0 + 817: 51(fvec4) CompositeExtract 815 0 + 818: 51(fvec4) FMul 816 817 + 819: 51(fvec4) CompositeExtract 814 1 + 820: 51(fvec4) CompositeExtract 815 1 + 821: 51(fvec4) FMul 819 820 + 822: 51(fvec4) CompositeExtract 814 2 + 823: 51(fvec4) CompositeExtract 815 2 + 824: 51(fvec4) FMul 822 823 + 825: 51(fvec4) CompositeExtract 814 3 + 826: 51(fvec4) CompositeExtract 815 3 + 827: 51(fvec4) FMul 825 826 + 828: 747 CompositeConstruct 818 821 824 827 + 829: 747 Load 749(dmat4v) + 830: 747 MatrixTimesMatrix 829 828 + Store 749(dmat4v) 830 + 831: 753 Load 755(dmat2x3v) + 832: 753 Load 755(dmat2x3v) + 833: 46(fvec3) CompositeExtract 831 0 + 834: 46(fvec3) CompositeExtract 832 0 + 835: 46(fvec3) FMul 833 834 + 836: 46(fvec3) CompositeExtract 831 1 + 837: 46(fvec3) CompositeExtract 832 1 + 838: 46(fvec3) FMul 836 837 + 839: 753 CompositeConstruct 835 838 + Store 755(dmat2x3v) 839 + 840: 765 Load 767(dmat2x4v) + 841: 765 Load 767(dmat2x4v) + 842: 51(fvec4) CompositeExtract 840 0 + 843: 51(fvec4) CompositeExtract 841 0 + 844: 51(fvec4) FMul 842 843 + 845: 51(fvec4) CompositeExtract 840 1 + 846: 51(fvec4) CompositeExtract 841 1 + 847: 51(fvec4) FMul 845 846 + 848: 765 CompositeConstruct 844 847 + Store 767(dmat2x4v) 848 + 849: 759 Load 761(dmat3x2v) + 850: 759 Load 761(dmat3x2v) + 851: 41(fvec2) CompositeExtract 849 0 + 852: 41(fvec2) CompositeExtract 850 0 + 853: 41(fvec2) FMul 851 852 + 854: 41(fvec2) CompositeExtract 849 1 + 855: 41(fvec2) CompositeExtract 850 1 + 856: 41(fvec2) FMul 854 855 + 857: 41(fvec2) CompositeExtract 849 2 + 858: 41(fvec2) CompositeExtract 850 2 + 859: 41(fvec2) FMul 857 858 + 860: 759 CompositeConstruct 853 856 859 + Store 761(dmat3x2v) 860 + 861: 777 Load 779(dmat3x4v) + 862: 777 Load 779(dmat3x4v) + 863: 51(fvec4) CompositeExtract 861 0 + 864: 51(fvec4) CompositeExtract 862 0 + 865: 51(fvec4) FMul 863 864 + 866: 51(fvec4) CompositeExtract 861 1 + 867: 51(fvec4) CompositeExtract 862 1 + 868: 51(fvec4) FMul 866 867 + 869: 51(fvec4) CompositeExtract 861 2 + 870: 51(fvec4) CompositeExtract 862 2 + 871: 51(fvec4) FMul 869 870 + 872: 777 CompositeConstruct 865 868 871 + Store 779(dmat3x4v) 872 + 873: 771 Load 773(dmat4x2v) + 874: 771 Load 773(dmat4x2v) + 875: 41(fvec2) CompositeExtract 873 0 + 876: 41(fvec2) CompositeExtract 874 0 + 877: 41(fvec2) FMul 875 876 + 878: 41(fvec2) CompositeExtract 873 1 + 879: 41(fvec2) CompositeExtract 874 1 + 880: 41(fvec2) FMul 878 879 + 881: 41(fvec2) CompositeExtract 873 2 + 882: 41(fvec2) CompositeExtract 874 2 + 883: 41(fvec2) FMul 881 882 + 884: 41(fvec2) CompositeExtract 873 3 + 885: 41(fvec2) CompositeExtract 874 3 + 886: 41(fvec2) FMul 884 885 + 887: 771 CompositeConstruct 877 880 883 886 + Store 773(dmat4x2v) 887 + 888: 783 Load 785(dmat4x3v) + 889: 783 Load 785(dmat4x3v) + 890: 46(fvec3) CompositeExtract 888 0 + 891: 46(fvec3) CompositeExtract 889 0 + 892: 46(fvec3) FMul 890 891 + 893: 46(fvec3) CompositeExtract 888 1 + 894: 46(fvec3) CompositeExtract 889 1 + 895: 46(fvec3) FMul 893 894 + 896: 46(fvec3) CompositeExtract 888 2 + 897: 46(fvec3) CompositeExtract 889 2 + 898: 46(fvec3) FMul 896 897 + 899: 46(fvec3) CompositeExtract 888 3 + 900: 46(fvec3) CompositeExtract 889 3 + 901: 46(fvec3) FMul 899 900 + 902: 783 CompositeConstruct 892 895 898 901 + Store 785(dmat4x3v) 902 + 903: 735 Load 737(dmat2v) + 904: 735 Transpose 903 + 905: 735 Load 737(dmat2v) + 906: 735 MatrixTimesMatrix 905 904 + Store 737(dmat2v) 906 + 907: 741 Load 743(dmat3v) + 908: 741 Transpose 907 + 909: 741 Load 743(dmat3v) + 910: 741 MatrixTimesMatrix 909 908 + Store 743(dmat3v) 910 + 911: 747 Load 749(dmat4v) + 912: 747 Transpose 911 + 913: 747 Load 749(dmat4v) + 914: 747 MatrixTimesMatrix 913 912 + Store 749(dmat4v) 914 + 915: 759 Load 761(dmat3x2v) + 916: 753 Transpose 915 + Store 755(dmat2x3v) 916 + 917: 753 Load 755(dmat2x3v) + 918: 759 Transpose 917 + Store 761(dmat3x2v) 918 + 919: 771 Load 773(dmat4x2v) + 920: 765 Transpose 919 + Store 767(dmat2x4v) 920 + 921: 765 Load 767(dmat2x4v) + 922: 771 Transpose 921 + Store 773(dmat4x2v) 922 + 923: 783 Load 785(dmat4x3v) + 924: 777 Transpose 923 + Store 779(dmat3x4v) 924 + 925: 777 Load 779(dmat3x4v) + 926: 783 Transpose 925 + Store 785(dmat4x3v) 926 + 927: 735 Load 737(dmat2v) + 928: 37(float) ExtInst 1(GLSL.std.450) 33(Determinant) 927 + 929: 37(float) Load 39(doublev) + 930: 37(float) FAdd 929 928 + Store 39(doublev) 930 + 931: 741 Load 743(dmat3v) + 932: 37(float) ExtInst 1(GLSL.std.450) 33(Determinant) 931 + 933: 37(float) Load 39(doublev) + 934: 37(float) FAdd 933 932 + Store 39(doublev) 934 + 935: 747 Load 749(dmat4v) + 936: 37(float) ExtInst 1(GLSL.std.450) 33(Determinant) 935 + 937: 37(float) Load 39(doublev) + 938: 37(float) FAdd 937 936 + Store 39(doublev) 938 + 939: 735 Load 737(dmat2v) + 940: 735 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 939 + 941: 735 Load 737(dmat2v) + 942: 735 MatrixTimesMatrix 941 940 + Store 737(dmat2v) 942 + 943: 741 Load 743(dmat3v) + 944: 741 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 943 + 945: 741 Load 743(dmat3v) + 946: 741 MatrixTimesMatrix 945 944 + Store 743(dmat3v) 946 + 947: 747 Load 749(dmat4v) + 948: 747 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 947 + 949: 747 Load 749(dmat4v) + 950: 747 MatrixTimesMatrix 949 948 + Store 749(dmat4v) 950 + 951: 37(float) Load 39(doublev) + 953: 38(ptr) AccessChain 43(dvec2v) 952 + 954: 37(float) Load 953 + 955: 37(float) FAdd 951 954 + 957: 38(ptr) AccessChain 48(dvec3v) 956 + 958: 37(float) Load 957 + 959: 37(float) FAdd 955 958 + 961: 38(ptr) AccessChain 53(dvec4v) 960 + 962: 37(float) Load 961 + 963: 37(float) FAdd 959 962 + 965: 38(ptr) AccessChain 737(dmat2v) 964 952 + 966: 37(float) Load 965 + 967: 37(float) FAdd 963 966 + 969: 38(ptr) AccessChain 743(dmat3v) 968 956 + 970: 37(float) Load 969 + 971: 37(float) FAdd 967 970 + 972: 38(ptr) AccessChain 749(dmat4v) 25 960 + 973: 37(float) Load 972 + 974: 37(float) FAdd 971 973 + 975: 38(ptr) AccessChain 755(dmat2x3v) 964 952 + 976: 37(float) Load 975 + 977: 37(float) FAdd 974 976 + 978: 38(ptr) AccessChain 761(dmat3x2v) 964 952 + 979: 37(float) Load 978 + 980: 37(float) FAdd 977 979 + 981: 38(ptr) AccessChain 779(dmat3x4v) 968 956 + 982: 37(float) Load 981 + 983: 37(float) FAdd 980 982 + 984: 38(ptr) AccessChain 785(dmat4x3v) 968 956 + 985: 37(float) Load 984 + 986: 37(float) FAdd 983 985 + 987: 38(ptr) AccessChain 767(dmat2x4v) 964 952 + 988: 37(float) Load 987 + 989: 37(float) FAdd 986 988 + 990: 38(ptr) AccessChain 773(dmat4x2v) 964 952 + 991: 37(float) Load 990 + 992: 37(float) FAdd 989 991 + 993: 426(bool) Load 428(boolv) + 995: 10(float) Select 993 994 21 + 996: 37(float) FConvert 995 + 997: 37(float) FAdd 992 996 + 998: 435(bvec2) Load 437(bvec2v) + 999: 426(bool) CompositeExtract 998 0 + 1000: 10(float) Select 999 994 21 + 1001: 37(float) FConvert 1000 + 1002: 37(float) FAdd 997 1001 + 1003: 444(bvec3) Load 446(bvec3v) + 1004: 426(bool) CompositeExtract 1003 0 + 1005: 10(float) Select 1004 994 21 + 1006: 37(float) FConvert 1005 + 1007: 37(float) FAdd 1002 1006 + 1008: 453(bvec4) Load 455(bvec4v) + 1009: 426(bool) CompositeExtract 1008 0 + 1010: 10(float) Select 1009 994 21 + 1011: 37(float) FConvert 1010 + 1012: 37(float) FAdd 1007 1011 + 1013: 10(float) FConvert 1012 + 1014: 11(fvec4) Load 13(outp) + 1015: 11(fvec4) VectorTimesScalar 1014 1013 + Store 13(outp) 1015 Return FunctionEnd diff --git a/Test/spv.400.frag b/Test/spv.400.frag index f35537c9..2014b5b0 100644 --- a/Test/spv.400.frag +++ b/Test/spv.400.frag @@ -21,6 +21,223 @@ void foo23() outp.x += textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]); } +void doubles() +{ + double doublev; + dvec2 dvec2v; + dvec3 dvec3v; + dvec4 dvec4v; + + bool boolv; + bvec2 bvec2v; + bvec3 bvec3v; + bvec4 bvec4v; + + doublev = sqrt(2.9); + dvec2v = sqrt(dvec2(2.7)); + dvec3v = sqrt(dvec3(2.0)); + dvec4v = sqrt(dvec4(doublev)); + + doublev += inversesqrt(doublev); + dvec2v += inversesqrt(dvec2v); + dvec3v += inversesqrt(dvec3v); + dvec4v += inversesqrt(dvec4v); + + doublev += abs(doublev); + dvec2v += abs(dvec2v); + dvec3v += abs(dvec3v); + dvec4v += abs(dvec4v); + + doublev += sign(doublev); + dvec2v += sign(dvec2v); + dvec3v += sign(dvec3v); + dvec4v += sign(dvec4v); + + doublev += floor(doublev); + dvec2v += floor(dvec2v); + dvec3v += floor(dvec3v); + dvec4v += floor(dvec4v); + + doublev += trunc(doublev); + dvec2v += trunc(dvec2v); + dvec3v += trunc(dvec3v); + dvec4v += trunc(dvec4v); + + doublev += round(doublev); + dvec2v += round(dvec2v); + dvec3v += round(dvec3v); + dvec4v += round(dvec4v); + + doublev += roundEven(doublev); + dvec2v += roundEven(dvec2v); + dvec3v += roundEven(dvec3v); + dvec4v += roundEven(dvec4v); + + doublev += ceil(doublev); + dvec2v += ceil(dvec2v); + dvec3v += ceil(dvec3v); + dvec4v += ceil(dvec4v); + + doublev += fract(doublev); + dvec2v += fract(dvec2v); + dvec3v += fract(dvec3v); + dvec4v += fract(dvec4v); + + doublev += mod(doublev, doublev); + dvec2v += mod(dvec2v, doublev); + dvec3v += mod(dvec3v, doublev); + dvec4v += mod(dvec4v, doublev); + dvec2v += mod(dvec2v, dvec2v); + dvec3v += mod(dvec3v, dvec3v); + dvec4v += mod(dvec4v, dvec4v); + + doublev += modf(doublev, doublev); + dvec2v += modf(dvec2v, dvec2v); + dvec3v += modf(dvec3v, dvec3v); + dvec4v += modf(dvec4v, dvec4v); + + doublev += min(doublev, doublev); + dvec2v += min(dvec2v, doublev); + dvec3v += min(dvec3v, doublev); + dvec4v += min(dvec4v, doublev); + dvec2v += min(dvec2v, dvec2v); + dvec3v += min(dvec3v, dvec3v); + dvec4v += min(dvec4v, dvec4v); + + doublev += max(doublev, doublev); + dvec2v += max(dvec2v, doublev); + dvec3v += max(dvec3v, doublev); + dvec4v += max(dvec4v, doublev); + dvec2v += max(dvec2v, dvec2v); + dvec3v += max(dvec3v, dvec3v); + dvec4v += max(dvec4v, dvec4v); + + doublev += clamp(doublev, doublev, doublev); + dvec2v += clamp(dvec2v, doublev, doublev); + dvec3v += clamp(dvec3v, doublev, doublev); + dvec4v += clamp(dvec4v, doublev, doublev); + dvec2v += clamp(dvec2v, dvec2v, dvec2v); + dvec3v += clamp(dvec3v, dvec3v, dvec3v); + dvec4v += clamp(dvec4v, dvec4v, dvec4v); + + doublev += mix(doublev, doublev, doublev); + dvec2v += mix(dvec2v, dvec2v, doublev); + dvec3v += mix(dvec3v, dvec3v, doublev); + dvec4v += mix(dvec4v, dvec4v, doublev); + dvec2v += mix(dvec2v, dvec2v, dvec2v); + dvec3v += mix(dvec3v, dvec3v, dvec3v); + dvec4v += mix(dvec4v, dvec4v, dvec4v); + doublev += mix(doublev, doublev, boolv); + dvec2v += mix(dvec2v, dvec2v, bvec2v); + dvec3v += mix(dvec3v, dvec3v, bvec3v); + dvec4v += mix(dvec4v, dvec4v, bvec4v); + + doublev += step(doublev, doublev); + dvec2v += step(dvec2v, dvec2v); + dvec3v += step(dvec3v, dvec3v); + dvec4v += step(dvec4v, dvec4v); + dvec2v += step(doublev, dvec2v); + dvec3v += step(doublev, dvec3v); + dvec4v += step(doublev, dvec4v); + + doublev += smoothstep(doublev, doublev, doublev); + dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); + dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); + dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); + dvec2v += smoothstep(doublev, doublev, dvec2v); + dvec3v += smoothstep(doublev, doublev, dvec3v); + dvec4v += smoothstep(doublev, doublev, dvec4v); + + boolv = isnan(doublev); + bvec2v = isnan(dvec2v); + bvec3v = isnan(dvec3v); + bvec4v = isnan(dvec4v); + + boolv = boolv ? isinf(doublev) : false; + bvec2v = boolv ? isinf(dvec2v) : bvec2(false); + bvec3v = boolv ? isinf(dvec3v) : bvec3(false); + bvec4v = boolv ? isinf(dvec4v) : bvec4(false); + + doublev += length(doublev); + doublev += length(dvec2v); + doublev += length(dvec3v); + doublev += length(dvec4v); + + doublev += distance(doublev, doublev); + doublev += distance(dvec2v, dvec2v); + doublev += distance(dvec3v, dvec3v); + doublev += distance(dvec4v, dvec4v); + + doublev += dot(doublev, doublev); + doublev += dot(dvec2v, dvec2v); + doublev += dot(dvec3v, dvec3v); + doublev += dot(dvec4v, dvec4v); + + dvec3v += cross(dvec3v, dvec3v); + + doublev += normalize(doublev); + dvec2v += normalize(dvec2v); + dvec3v += normalize(dvec3v); + dvec4v += normalize(dvec4v); + + doublev += faceforward(doublev, doublev, doublev); + dvec2v += faceforward(dvec2v, dvec2v, dvec2v); + dvec3v += faceforward(dvec3v, dvec3v, dvec3v); + dvec4v += faceforward(dvec4v, dvec4v, dvec4v); + + doublev += reflect(doublev, doublev); + dvec2v += reflect(dvec2v, dvec2v); + dvec3v += reflect(dvec3v, dvec3v); + dvec4v += reflect(dvec4v, dvec4v); + + doublev += refract(doublev, doublev, doublev); + dvec2v += refract(dvec2v, dvec2v, doublev); + dvec3v += refract(dvec3v, dvec3v, doublev); + dvec4v += refract(dvec4v, dvec4v, doublev); + + dmat2 dmat2v = outerProduct(dvec2v, dvec2v); + dmat3 dmat3v = outerProduct(dvec3v, dvec3v); + dmat4 dmat4v = outerProduct(dvec4v, dvec4v); + dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); + dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); + dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); + dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); + dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); + dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); + + dmat2v *= matrixCompMult(dmat2v, dmat2v); + dmat3v *= matrixCompMult(dmat3v, dmat3v); + dmat4v *= matrixCompMult(dmat4v, dmat4v); + dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); // For now, relying on no dead-code elimination + dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); + dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); + dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); + dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); + dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); + + dmat2v *= transpose(dmat2v); + dmat3v *= transpose(dmat3v); + dmat4v *= transpose(dmat4v); + dmat2x3v = transpose(dmat3x2v); // For now, relying on no dead-code elimination + dmat3x2v = transpose(dmat2x3v); + dmat2x4v = transpose(dmat4x2v); + dmat4x2v = transpose(dmat2x4v); + dmat3x4v = transpose(dmat4x3v); + dmat4x3v = transpose(dmat3x4v); + + doublev += determinant(dmat2v); + doublev += determinant(dmat3v); + doublev += determinant(dmat4v); + + dmat2v *= inverse(dmat2v); + dmat3v *= inverse(dmat3v); + dmat4v *= inverse(dmat4v); + + outp *= float(doublev + dvec2v.y + dvec3v.z + dvec4v.w + + dmat2v[1][1] + dmat3v[2][2] + dmat4v[3][3] + dmat2x3v[1][1] + dmat3x2v[1][1] + dmat3x4v[2][2] + dmat4x3v[2][2] + dmat2x4v[1][1] + dmat4x2v[1][1] + + float(boolv) + float(bvec2v.x) + float(bvec3v.x) + float(bvec4v.x)); +} + void main() { vec4 v; @@ -38,5 +255,6 @@ void main() outp += gl_FragCoord + vl2; foo23(); + doubles(); } diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 75e85661..089751b1 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -419,6 +419,214 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) "\n"); } + // + // double functions added to desktop 4.00, but not fma, frexp, ldexp, or pack/unpack + // + if (profile != EEsProfile && version >= 400) { + commonBuiltins.append( + + "double sqrt(double);" + "dvec2 sqrt(dvec2);" + "dvec3 sqrt(dvec3);" + "dvec4 sqrt(dvec4);" + + "double inversesqrt(double);" + "dvec2 inversesqrt(dvec2);" + "dvec3 inversesqrt(dvec3);" + "dvec4 inversesqrt(dvec4);" + + "double abs(double);" + "dvec2 abs(dvec2);" + "dvec3 abs(dvec3);" + "dvec4 abs(dvec4);" + + "double sign(double);" + "dvec2 sign(dvec2);" + "dvec3 sign(dvec3);" + "dvec4 sign(dvec4);" + + "double floor(double);" + "dvec2 floor(dvec2);" + "dvec3 floor(dvec3);" + "dvec4 floor(dvec4);" + + "double trunc(double);" + "dvec2 trunc(dvec2);" + "dvec3 trunc(dvec3);" + "dvec4 trunc(dvec4);" + + "double round(double);" + "dvec2 round(dvec2);" + "dvec3 round(dvec3);" + "dvec4 round(dvec4);" + + "double roundEven(double);" + "dvec2 roundEven(dvec2);" + "dvec3 roundEven(dvec3);" + "dvec4 roundEven(dvec4);" + + "double ceil(double);" + "dvec2 ceil(dvec2);" + "dvec3 ceil(dvec3);" + "dvec4 ceil(dvec4);" + + "double fract(double);" + "dvec2 fract(dvec2);" + "dvec3 fract(dvec3);" + "dvec4 fract(dvec4);" + + "double mod(double, double);" + "dvec2 mod(dvec2 , double);" + "dvec3 mod(dvec3 , double);" + "dvec4 mod(dvec4 , double);" + "dvec2 mod(dvec2 , dvec2);" + "dvec3 mod(dvec3 , dvec3);" + "dvec4 mod(dvec4 , dvec4);" + + "double modf(double, out double);" + "dvec2 modf(dvec2, out dvec2);" + "dvec3 modf(dvec3, out dvec3);" + "dvec4 modf(dvec4, out dvec4);" + + "double min(double, double);" + "dvec2 min(dvec2, double);" + "dvec3 min(dvec3, double);" + "dvec4 min(dvec4, double);" + "dvec2 min(dvec2, dvec2);" + "dvec3 min(dvec3, dvec3);" + "dvec4 min(dvec4, dvec4);" + + "double max(double, double);" + "dvec2 max(dvec2 , double);" + "dvec3 max(dvec3 , double);" + "dvec4 max(dvec4 , double);" + "dvec2 max(dvec2 , dvec2);" + "dvec3 max(dvec3 , dvec3);" + "dvec4 max(dvec4 , dvec4);" + + "double clamp(double, double, double);" + "dvec2 clamp(dvec2 , double, double);" + "dvec3 clamp(dvec3 , double, double);" + "dvec4 clamp(dvec4 , double, double);" + "dvec2 clamp(dvec2 , dvec2 , dvec2);" + "dvec3 clamp(dvec3 , dvec3 , dvec3);" + "dvec4 clamp(dvec4 , dvec4 , dvec4);" + + "double mix(double, double, double);" + "dvec2 mix(dvec2, dvec2, double);" + "dvec3 mix(dvec3, dvec3, double);" + "dvec4 mix(dvec4, dvec4, double);" + "dvec2 mix(dvec2, dvec2, dvec2);" + "dvec3 mix(dvec3, dvec3, dvec3);" + "dvec4 mix(dvec4, dvec4, dvec4);" + "double mix(double, double, bool);" + "dvec2 mix(dvec2, dvec2, bvec2);" + "dvec3 mix(dvec3, dvec3, bvec3);" + "dvec4 mix(dvec4, dvec4, bvec4);" + + "double step(double, double);" + "dvec2 step(dvec2 , dvec2);" + "dvec3 step(dvec3 , dvec3);" + "dvec4 step(dvec4 , dvec4);" + "dvec2 step(double, dvec2);" + "dvec3 step(double, dvec3);" + "dvec4 step(double, dvec4);" + + "double smoothstep(double, double, double);" + "dvec2 smoothstep(dvec2 , dvec2 , dvec2);" + "dvec3 smoothstep(dvec3 , dvec3 , dvec3);" + "dvec4 smoothstep(dvec4 , dvec4 , dvec4);" + "dvec2 smoothstep(double, double, dvec2);" + "dvec3 smoothstep(double, double, dvec3);" + "dvec4 smoothstep(double, double, dvec4);" + + "bool isnan(double);" + "bvec2 isnan(dvec2);" + "bvec3 isnan(dvec3);" + "bvec4 isnan(dvec4);" + + "bool isinf(double);" + "bvec2 isinf(dvec2);" + "bvec3 isinf(dvec3);" + "bvec4 isinf(dvec4);" + + "double length(double);" + "double length(dvec2);" + "double length(dvec3);" + "double length(dvec4);" + + "double distance(double, double);" + "double distance(dvec2 , dvec2);" + "double distance(dvec3 , dvec3);" + "double distance(dvec4 , dvec4);" + + "double dot(double, double);" + "double dot(dvec2 , dvec2);" + "double dot(dvec3 , dvec3);" + "double dot(dvec4 , dvec4);" + + "dvec3 cross(dvec3, dvec3);" + + "double normalize(double);" + "dvec2 normalize(dvec2);" + "dvec3 normalize(dvec3);" + "dvec4 normalize(dvec4);" + + "double faceforward(double, double, double);" + "dvec2 faceforward(dvec2, dvec2, dvec2);" + "dvec3 faceforward(dvec3, dvec3, dvec3);" + "dvec4 faceforward(dvec4, dvec4, dvec4);" + + "double reflect(double, double);" + "dvec2 reflect(dvec2 , dvec2 );" + "dvec3 reflect(dvec3 , dvec3 );" + "dvec4 reflect(dvec4 , dvec4 );" + + "double refract(double, double, double);" + "dvec2 refract(dvec2 , dvec2 , double);" + "dvec3 refract(dvec3 , dvec3 , double);" + "dvec4 refract(dvec4 , dvec4 , double);" + + "dmat2 matrixCompMult(dmat2, dmat2);" + "dmat3 matrixCompMult(dmat3, dmat3);" + "dmat4 matrixCompMult(dmat4, dmat4);" + "dmat2x3 matrixCompMult(dmat2x3, dmat2x3);" + "dmat2x4 matrixCompMult(dmat2x4, dmat2x4);" + "dmat3x2 matrixCompMult(dmat3x2, dmat3x2);" + "dmat3x4 matrixCompMult(dmat3x4, dmat3x4);" + "dmat4x2 matrixCompMult(dmat4x2, dmat4x2);" + "dmat4x3 matrixCompMult(dmat4x3, dmat4x3);" + + "dmat2 outerProduct(dvec2, dvec2);" + "dmat3 outerProduct(dvec3, dvec3);" + "dmat4 outerProduct(dvec4, dvec4);" + "dmat2x3 outerProduct(dvec3, dvec2);" + "dmat3x2 outerProduct(dvec2, dvec3);" + "dmat2x4 outerProduct(dvec4, dvec2);" + "dmat4x2 outerProduct(dvec2, dvec4);" + "dmat3x4 outerProduct(dvec4, dvec3);" + "dmat4x3 outerProduct(dvec3, dvec4);" + + "dmat2 transpose(dmat2);" + "dmat3 transpose(dmat3);" + "dmat4 transpose(dmat4);" + "dmat2x3 transpose(dmat3x2);" + "dmat3x2 transpose(dmat2x3);" + "dmat2x4 transpose(dmat4x2);" + "dmat4x2 transpose(dmat2x4);" + "dmat3x4 transpose(dmat4x3);" + "dmat4x3 transpose(dmat3x4);" + + "double determinant(dmat2);" + "double determinant(dmat3);" + "double determinant(dmat4);" + + "dmat2 inverse(dmat2);" + "dmat3 inverse(dmat3);" + "dmat4 inverse(dmat4);" + ); + } + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 430)) { commonBuiltins.append( From b891c2b8272859f32bf92ca30fca5841139c78a8 Mon Sep 17 00:00:00 2001 From: Andrew Woloszyn Date: Mon, 18 Jan 2016 09:26:25 -0500 Subject: [PATCH 09/24] Freed up some memory when no longer needed in glslangValidator. --- StandAlone/StandAlone.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 92010840..f47410b8 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -435,6 +435,8 @@ void ProcessConfigFile() } if (configStrings) FreeFileData(configStrings); + else + delete[] config; } // thread-safe list of shaders to asynchronously grab and compile @@ -805,6 +807,11 @@ int C_DECL main(int argc, char* argv[]) glslang::InitializeProcess(); CompileAndLinkShaders(); glslang::FinalizeProcess(); + for (int w = 0; w < NumWorkItems; ++w) { + if (Work[w]) { + delete Work[w]; + } + } } else { ShInitialize(); @@ -837,6 +844,8 @@ int C_DECL main(int argc, char* argv[]) ShFinalize(); } + delete[] Work; + if (CompileFailed) return EFailCompile; if (LinkFailed) From b7946d16bbfc80e8d743e2c3f62794c8f3295b64 Mon Sep 17 00:00:00 2001 From: Andrew Woloszyn Date: Mon, 18 Jan 2016 09:23:56 -0500 Subject: [PATCH 10/24] Free memory associated with SPIR-V generation. --- SPIRV/SpvBuilder.cpp | 136 ++++++++++---------- SPIRV/SpvBuilder.h | 24 ++-- SPIRV/spvIR.h | 30 +++-- glslang/Include/intermediate.h | 4 +- glslang/MachineIndependent/Intermediate.cpp | 8 +- 5 files changed, 109 insertions(+), 93 deletions(-) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 969a6d7c..7b17e17d 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -77,7 +77,7 @@ Id Builder::import(const char* name) Instruction* import = new Instruction(getUniqueId(), NoType, OpExtInstImport); import->addStringOperand(name); - imports.push_back(import); + imports.push_back(std::unique_ptr(import)); return import->getResultId(); } @@ -88,7 +88,7 @@ Id Builder::makeVoidType() if (groupedTypes[OpTypeVoid].size() == 0) { type = new Instruction(getUniqueId(), NoType, OpTypeVoid); groupedTypes[OpTypeVoid].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); } else type = groupedTypes[OpTypeVoid].back(); @@ -102,7 +102,7 @@ Id Builder::makeBoolType() if (groupedTypes[OpTypeBool].size() == 0) { type = new Instruction(getUniqueId(), NoType, OpTypeBool); groupedTypes[OpTypeBool].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); } else type = groupedTypes[OpTypeBool].back(); @@ -116,7 +116,7 @@ Id Builder::makeSamplerType() if (groupedTypes[OpTypeSampler].size() == 0) { type = new Instruction(getUniqueId(), NoType, OpTypeSampler); groupedTypes[OpTypeSampler].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); } else type = groupedTypes[OpTypeSampler].back(); @@ -140,7 +140,7 @@ Id Builder::makePointer(StorageClass storageClass, Id pointee) type->addImmediateOperand(storageClass); type->addIdOperand(pointee); groupedTypes[OpTypePointer].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -162,7 +162,7 @@ Id Builder::makeIntegerType(int width, bool hasSign) type->addImmediateOperand(width); type->addImmediateOperand(hasSign ? 1 : 0); groupedTypes[OpTypeInt].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -182,7 +182,7 @@ Id Builder::makeFloatType(int width) type = new Instruction(getUniqueId(), NoType, OpTypeFloat); type->addImmediateOperand(width); groupedTypes[OpTypeFloat].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -202,7 +202,7 @@ Id Builder::makeStructType(std::vector& members, const char* name) for (int op = 0; op < (int)members.size(); ++op) type->addIdOperand(members[op]); groupedTypes[OpTypeStruct].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); addName(type->getResultId(), name); @@ -249,7 +249,7 @@ Id Builder::makeVectorType(Id component, int size) type->addIdOperand(component); type->addImmediateOperand(size); groupedTypes[OpTypeVector].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -275,7 +275,7 @@ Id Builder::makeMatrixType(Id component, int cols, int rows) type->addIdOperand(column); type->addImmediateOperand(cols); groupedTypes[OpTypeMatrix].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -305,7 +305,7 @@ Id Builder::makeArrayType(Id element, unsigned size, int stride) type->addIdOperand(element); type->addIdOperand(sizeId); groupedTypes[OpTypeArray].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -315,7 +315,7 @@ Id Builder::makeRuntimeArray(Id element) { Instruction* type = new Instruction(getUniqueId(), NoType, OpTypeRuntimeArray); type->addIdOperand(element); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -346,7 +346,7 @@ Id Builder::makeFunctionType(Id returnType, std::vector& paramTypes) for (int p = 0; p < (int)paramTypes.size(); ++p) type->addIdOperand(paramTypes[p]); groupedTypes[OpTypeFunction].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -379,7 +379,7 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo type->addImmediateOperand((unsigned int)format); groupedTypes[OpTypeImage].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -400,7 +400,7 @@ Id Builder::makeSampledImageType(Id imageType) type->addIdOperand(imageType); groupedTypes[OpTypeSampledImage].push_back(type); - constantsTypesGlobals.push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); @@ -594,7 +594,7 @@ Id Builder::makeBoolConstant(bool b, bool specConstant) // Make it Instruction* c = new Instruction(getUniqueId(), typeId, opcode); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[OpTypeBool].push_back(c); module.mapInstruction(c); @@ -610,7 +610,7 @@ Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[OpTypeInt].push_back(c); module.mapInstruction(c); @@ -628,7 +628,7 @@ Id Builder::makeFloatConstant(float f, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[OpTypeFloat].push_back(c); module.mapInstruction(c); @@ -649,7 +649,7 @@ Id Builder::makeDoubleConstant(double d, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(op1); c->addImmediateOperand(op2); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[OpTypeFloat].push_back(c); module.mapInstruction(c); @@ -708,7 +708,7 @@ Id Builder::makeCompositeConstant(Id typeId, std::vector& members) Instruction* c = new Instruction(getUniqueId(), typeId, OpConstantComposite); for (int op = 0; op < (int)members.size(); ++op) c->addIdOperand(members[op]); - constantsTypesGlobals.push_back(c); + constantsTypesGlobals.push_back(std::unique_ptr(c)); groupedConstants[typeClass].push_back(c); module.mapInstruction(c); @@ -722,7 +722,7 @@ Instruction* Builder::addEntryPoint(ExecutionModel model, Function* function, co entryPoint->addIdOperand(function->getId()); entryPoint->addStringOperand(name); - entryPoints.push_back(entryPoint); + entryPoints.push_back(std::unique_ptr(entryPoint)); return entryPoint; } @@ -740,7 +740,7 @@ void Builder::addExecutionMode(Function* entryPoint, ExecutionMode mode, int val if (value3 >= 0) instr->addImmediateOperand(value3); - executionModes.push_back(instr); + executionModes.push_back(std::unique_ptr(instr)); } void Builder::addName(Id id, const char* string) @@ -749,7 +749,7 @@ void Builder::addName(Id id, const char* string) name->addIdOperand(id); name->addStringOperand(string); - names.push_back(name); + names.push_back(std::unique_ptr(name)); } void Builder::addMemberName(Id id, int memberNumber, const char* string) @@ -759,7 +759,7 @@ void Builder::addMemberName(Id id, int memberNumber, const char* string) name->addImmediateOperand(memberNumber); name->addStringOperand(string); - names.push_back(name); + names.push_back(std::unique_ptr(name)); } void Builder::addLine(Id target, Id fileName, int lineNum, int column) @@ -770,7 +770,7 @@ void Builder::addLine(Id target, Id fileName, int lineNum, int column) line->addImmediateOperand(lineNum); line->addImmediateOperand(column); - lines.push_back(line); + lines.push_back(std::unique_ptr(line)); } void Builder::addDecoration(Id id, Decoration decoration, int num) @@ -783,7 +783,7 @@ void Builder::addDecoration(Id id, Decoration decoration, int num) if (num >= 0) dec->addImmediateOperand(num); - decorations.push_back(dec); + decorations.push_back(std::unique_ptr(dec)); } void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num) @@ -795,7 +795,7 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat if (num >= 0) dec->addImmediateOperand(num); - decorations.push_back(dec); + decorations.push_back(std::unique_ptr(dec)); } // Comments in header @@ -827,6 +827,8 @@ Function* Builder::makeFunctionEntry(Id returnType, const char* name, std::vecto if (name) addName(function->getId(), name); + functions.push_back(std::unique_ptr(function)); + return function; } @@ -836,9 +838,9 @@ void Builder::makeReturn(bool implicit, Id retVal) if (retVal) { Instruction* inst = new Instruction(NoResult, NoType, OpReturnValue); inst->addIdOperand(retVal); - buildPoint->addInstruction(inst); + buildPoint->addInstruction(std::unique_ptr(inst)); } else - buildPoint->addInstruction(new Instruction(NoResult, NoType, OpReturn)); + buildPoint->addInstruction(std::unique_ptr(new Instruction(NoResult, NoType, OpReturn))); if (! implicit) createAndSetNoPredecessorBlock("post-return"); @@ -878,7 +880,7 @@ void Builder::leaveFunction() // Comments in header void Builder::makeDiscard() { - buildPoint->addInstruction(new Instruction(OpKill)); + buildPoint->addInstruction(std::unique_ptr(new Instruction(OpKill))); createAndSetNoPredecessorBlock("post-discard"); } @@ -892,11 +894,11 @@ Id Builder::createVariable(StorageClass storageClass, Id type, const char* name) switch (storageClass) { case StorageClassFunction: // Validation rules require the declaration in the entry block - buildPoint->getParent().addLocalVariable(inst); + buildPoint->getParent().addLocalVariable(std::unique_ptr(inst)); break; default: - constantsTypesGlobals.push_back(inst); + constantsTypesGlobals.push_back(std::unique_ptr(inst)); module.mapInstruction(inst); break; } @@ -911,7 +913,7 @@ Id Builder::createVariable(StorageClass storageClass, Id type, const char* name) Id Builder::createUndefined(Id type) { Instruction* inst = new Instruction(getUniqueId(), type, OpUndef); - buildPoint->addInstruction(inst); + buildPoint->addInstruction(std::unique_ptr(inst)); return inst->getResultId(); } @@ -921,7 +923,7 @@ void Builder::createStore(Id rValue, Id lValue) Instruction* store = new Instruction(OpStore); store->addIdOperand(lValue); store->addIdOperand(rValue); - buildPoint->addInstruction(store); + buildPoint->addInstruction(std::unique_ptr(store)); } // Comments in header @@ -929,7 +931,7 @@ Id Builder::createLoad(Id lValue) { Instruction* load = new Instruction(getUniqueId(), getDerefTypeId(lValue), OpLoad); load->addIdOperand(lValue); - buildPoint->addInstruction(load); + buildPoint->addInstruction(std::unique_ptr(load)); return load->getResultId(); } @@ -955,7 +957,7 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, std::vectoraddIdOperand(base); for (int i = 0; i < (int)offsets.size(); ++i) chain->addIdOperand(offsets[i]); - buildPoint->addInstruction(chain); + buildPoint->addInstruction(std::unique_ptr(chain)); return chain->getResultId(); } @@ -965,7 +967,7 @@ Id Builder::createArrayLength(Id base, unsigned int member) Instruction* length = new Instruction(getUniqueId(), makeIntType(32), OpArrayLength); length->addIdOperand(base); length->addImmediateOperand(member); - buildPoint->addInstruction(length); + buildPoint->addInstruction(std::unique_ptr(length)); return length->getResultId(); } @@ -975,7 +977,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index) Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); extract->addIdOperand(composite); extract->addImmediateOperand(index); - buildPoint->addInstruction(extract); + buildPoint->addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -986,7 +988,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, std::vectoraddIdOperand(composite); for (int i = 0; i < (int)indexes.size(); ++i) extract->addImmediateOperand(indexes[i]); - buildPoint->addInstruction(extract); + buildPoint->addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -997,7 +999,7 @@ Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, unsigned i insert->addIdOperand(object); insert->addIdOperand(composite); insert->addImmediateOperand(index); - buildPoint->addInstruction(insert); + buildPoint->addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -1009,7 +1011,7 @@ Id Builder::createCompositeInsert(Id object, Id composite, Id typeId, std::vecto insert->addIdOperand(composite); for (int i = 0; i < (int)indexes.size(); ++i) insert->addImmediateOperand(indexes[i]); - buildPoint->addInstruction(insert); + buildPoint->addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -1019,7 +1021,7 @@ Id Builder::createVectorExtractDynamic(Id vector, Id typeId, Id componentIndex) Instruction* extract = new Instruction(getUniqueId(), typeId, OpVectorExtractDynamic); extract->addIdOperand(vector); extract->addIdOperand(componentIndex); - buildPoint->addInstruction(extract); + buildPoint->addInstruction(std::unique_ptr(extract)); return extract->getResultId(); } @@ -1030,7 +1032,7 @@ Id Builder::createVectorInsertDynamic(Id vector, Id typeId, Id component, Id com insert->addIdOperand(vector); insert->addIdOperand(component); insert->addIdOperand(componentIndex); - buildPoint->addInstruction(insert); + buildPoint->addInstruction(std::unique_ptr(insert)); return insert->getResultId(); } @@ -1039,7 +1041,7 @@ Id Builder::createVectorInsertDynamic(Id vector, Id typeId, Id component, Id com void Builder::createNoResultOp(Op opCode) { Instruction* op = new Instruction(opCode); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } // An opcode that has one operand, no result id, and no type @@ -1047,7 +1049,7 @@ void Builder::createNoResultOp(Op opCode, Id operand) { Instruction* op = new Instruction(opCode); op->addIdOperand(operand); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } // An opcode that has one operand, no result id, and no type @@ -1056,7 +1058,7 @@ void Builder::createNoResultOp(Op opCode, const std::vector& operands) Instruction* op = new Instruction(opCode); for (auto operand : operands) op->addIdOperand(operand); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask semantics) @@ -1065,7 +1067,7 @@ void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemantic op->addImmediateOperand(makeUintConstant(execution)); op->addImmediateOperand(makeUintConstant(memory)); op->addImmediateOperand(makeUintConstant(semantics)); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemantics) @@ -1073,7 +1075,7 @@ void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemant Instruction* op = new Instruction(OpMemoryBarrier); op->addImmediateOperand(makeUintConstant(executionScope)); op->addImmediateOperand(makeUintConstant(memorySemantics)); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); } // An opcode that has one operands, a result id, and a type @@ -1081,7 +1083,7 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand) { Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(operand); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1091,7 +1093,7 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right) Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(left); op->addIdOperand(right); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1102,7 +1104,7 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3) op->addIdOperand(op1); op->addIdOperand(op2); op->addIdOperand(op3); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1112,7 +1114,7 @@ Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) Instruction* op = new Instruction(getUniqueId(), typeId, opCode); for (auto operand : operands) op->addIdOperand(operand); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1123,7 +1125,7 @@ Id Builder::createFunctionCall(spv::Function* function, std::vector& ar op->addIdOperand(function->getId()); for (int a = 0; a < (int)args.size(); ++a) op->addIdOperand(args[a]); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1140,7 +1142,7 @@ Id Builder::createRvalueSwizzle(Id typeId, Id source, std::vector& cha swizzle->addIdOperand(source); for (int i = 0; i < (int)channels.size(); ++i) swizzle->addImmediateOperand(channels[i]); - buildPoint->addInstruction(swizzle); + buildPoint->addInstruction(std::unique_ptr(swizzle)); return swizzle->getResultId(); } @@ -1171,7 +1173,7 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, std::vectoraddImmediateOperand(components[i]); - buildPoint->addInstruction(swizzle); + buildPoint->addInstruction(std::unique_ptr(swizzle)); return swizzle->getResultId(); } @@ -1202,7 +1204,7 @@ Id Builder::smearScalar(Decoration /*precision*/, Id scalar, Id vectorType) Instruction* smear = new Instruction(getUniqueId(), vectorType, OpCompositeConstruct); for (int c = 0; c < numComponents; ++c) smear->addIdOperand(scalar); - buildPoint->addInstruction(smear); + buildPoint->addInstruction(std::unique_ptr(smear)); return smear->getResultId(); } @@ -1216,7 +1218,7 @@ Id Builder::createBuiltinCall(Decoration /*precision*/, Id resultType, Id builti for (int arg = 0; arg < (int)args.size(); ++arg) inst->addIdOperand(args[arg]); - buildPoint->addInstruction(inst); + buildPoint->addInstruction(std::unique_ptr(inst)); return inst->getResultId(); } @@ -1344,7 +1346,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b for (int op = optArgNum + 1; op < numArgs; ++op) textureInst->addIdOperand(texArgs[op]); setPrecision(textureInst->getResultId(), precision); - buildPoint->addInstruction(textureInst); + buildPoint->addInstruction(std::unique_ptr(textureInst)); Id resultId = textureInst->getResultId(); @@ -1412,7 +1414,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter query->addIdOperand(parameters.coords); if (parameters.lod) query->addIdOperand(parameters.lod); - buildPoint->addInstruction(query); + buildPoint->addInstruction(std::unique_ptr(query)); return query->getResultId(); } @@ -1494,7 +1496,7 @@ Id Builder::createCompositeConstruct(Id typeId, std::vector& constituents) Instruction* op = new Instruction(getUniqueId(), typeId, OpCompositeConstruct); for (int c = 0; c < (int)constituents.size(); ++c) op->addIdOperand(constituents[c]); - buildPoint->addInstruction(op); + buildPoint->addInstruction(std::unique_ptr(op)); return op->getResultId(); } @@ -1710,7 +1712,7 @@ void Builder::makeSwitch(Id selector, int numSegments, std::vector& caseVal switchInst->addImmediateOperand(caseValues[i]); switchInst->addIdOperand(segmentBlocks[valueIndexToSegment[i]]->getId()); } - buildPoint->addInstruction(switchInst); + buildPoint->addInstruction(std::unique_ptr(switchInst)); // push the merge block switchMerges.push(mergeBlock); @@ -1781,7 +1783,7 @@ void Builder::makeNewLoop(bool loopTestFirst) // but we don't yet know where they will come from. loop.isFirstIteration->addIdOperand(makeBoolConstant(true)); loop.isFirstIteration->addIdOperand(preheader->getId()); - getBuildPoint()->addInstruction(loop.isFirstIteration); + getBuildPoint()->addInstruction(std::unique_ptr(loop.isFirstIteration)); // Mark the end of the structured loop. This must exist in the loop header block. createLoopMerge(loop.merge, loop.header, LoopControlMaskNone); @@ -2203,7 +2205,7 @@ void Builder::createBranch(Block* block) { Instruction* branch = new Instruction(OpBranch); branch->addIdOperand(block->getId()); - buildPoint->addInstruction(branch); + buildPoint->addInstruction(std::unique_ptr(branch)); block->addPredecessor(buildPoint); } @@ -2212,7 +2214,7 @@ void Builder::createSelectionMerge(Block* mergeBlock, unsigned int control) Instruction* merge = new Instruction(OpSelectionMerge); merge->addIdOperand(mergeBlock->getId()); merge->addImmediateOperand(control); - buildPoint->addInstruction(merge); + buildPoint->addInstruction(std::unique_ptr(merge)); } void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control) @@ -2221,7 +2223,7 @@ void Builder::createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned merge->addIdOperand(mergeBlock->getId()); merge->addIdOperand(continueBlock->getId()); merge->addImmediateOperand(control); - buildPoint->addInstruction(merge); + buildPoint->addInstruction(std::unique_ptr(merge)); } void Builder::createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock) @@ -2230,12 +2232,12 @@ void Builder::createConditionalBranch(Id condition, Block* thenBlock, Block* els branch->addIdOperand(condition); branch->addIdOperand(thenBlock->getId()); branch->addIdOperand(elseBlock->getId()); - buildPoint->addInstruction(branch); + buildPoint->addInstruction(std::unique_ptr(branch)); thenBlock->addPredecessor(buildPoint); elseBlock->addPredecessor(buildPoint); } -void Builder::dumpInstructions(std::vector& out, const std::vector& instructions) const +void Builder::dumpInstructions(std::vector& out, const std::vector >& instructions) const { for (int i = 0; i < (int)instructions.size(); ++i) { instructions[i]->dump(out); diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index 7bf43962..026e81d5 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -52,6 +52,7 @@ #include "spvIR.h" #include +#include #include #include @@ -201,11 +202,13 @@ public: void setBuildPoint(Block* bp) { buildPoint = bp; } Block* getBuildPoint() const { return buildPoint; } - // Make the main function. + // Make the main function. The returned pointer is only valid + // for the lifetime of this builder. Function* makeMain(); // Make a shader-style function, and create its entry block if entry is non-zero. // Return the function, pass back the entry. + // The returned pointer is only valid for the lifetime of this builder. Function* makeFunctionEntry(Id returnType, const char* name, std::vector& paramTypes, Block **entry = 0); // Create a return. An 'implicit' return is one not appearing in the source @@ -516,7 +519,7 @@ protected: void createSelectionMerge(Block* mergeBlock, unsigned int control); void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control); void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); - void dumpInstructions(std::vector&, const std::vector&) const; + void dumpInstructions(std::vector&, const std::vector >&) const; struct Loop; // Defined below. void createBranchToLoopHeaderFromInside(const Loop& loop); @@ -535,14 +538,15 @@ protected: AccessChain accessChain; // special blocks of instructions for output - std::vector imports; - std::vector entryPoints; - std::vector executionModes; - std::vector names; - std::vector lines; - std::vector decorations; - std::vector constantsTypesGlobals; - std::vector externals; + std::vector > imports; + std::vector > entryPoints; + std::vector > executionModes; + std::vector > names; + std::vector > lines; + std::vector > decorations; + std::vector > constantsTypesGlobals; + std::vector > externals; + std::vector > functions; // not output, internally used for quick & dirty canonical (unique) creation std::vector groupedConstants[OpConstant]; // all types appear before OpConstant diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 92911854..e763dbb9 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -54,6 +54,7 @@ #include #include +#include #include namespace spv { @@ -155,15 +156,14 @@ public: Block(Id id, Function& parent); virtual ~Block() { - // TODO: free instructions } Id getId() { return instructions.front()->getResultId(); } Function& getParent() const { return parent; } - void addInstruction(Instruction* inst); + void addInstruction(std::unique_ptr inst); void addPredecessor(Block* pred) { predecessors.push_back(pred); } - void addLocalVariable(Instruction* inst) { localVariables.push_back(inst); } + void addLocalVariable(std::unique_ptr inst) { localVariables.push_back(std::move(inst)); } int getNumPredecessors() const { return (int)predecessors.size(); } void setUnreachable() { unreachable = true; } bool isUnreachable() const { return unreachable; } @@ -205,9 +205,9 @@ protected: // To enforce keeping parent and ownership in sync: friend Function; - std::vector instructions; + std::vector > instructions; std::vector predecessors; - std::vector localVariables; + std::vector > localVariables; Function& parent; // track whether this block is known to be uncreachable (not necessarily @@ -240,7 +240,7 @@ public: Module& getParent() const { return parent; } Block* getEntryBlock() const { return blocks.front(); } Block* getLastBlock() const { return blocks.back(); } - void addLocalVariable(Instruction* inst); + void addLocalVariable(std::unique_ptr inst); Id getReturnType() const { return functionInstruction.getTypeId(); } void dump(std::vector& out) const { @@ -341,22 +341,24 @@ __inline Function::Function(Id id, Id resultType, Id functionType, Id firstParam } } -__inline void Function::addLocalVariable(Instruction* inst) +__inline void Function::addLocalVariable(std::unique_ptr inst) { - blocks[0]->addLocalVariable(inst); - parent.mapInstruction(inst); + Instruction* raw_instruction = inst.get(); + blocks[0]->addLocalVariable(std::move(inst)); + parent.mapInstruction(raw_instruction); } __inline Block::Block(Id id, Function& parent) : parent(parent), unreachable(false) { - instructions.push_back(new Instruction(id, NoType, OpLabel)); + instructions.push_back(std::unique_ptr(new Instruction(id, NoType, OpLabel))); } -__inline void Block::addInstruction(Instruction* inst) +__inline void Block::addInstruction(std::unique_ptr inst) { - instructions.push_back(inst); - if (inst->getResultId()) - parent.getParent().mapInstruction(inst); + Instruction* raw_instruction = inst.get(); + instructions.push_back(std::move(inst)); + if (raw_instruction->getResultId()) + parent.getParent().mapInstruction(raw_instruction); } }; // end spv namespace diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index 59955fcf..ebd4439c 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -784,7 +784,9 @@ class TIntermAggregate : public TIntermOperator { public: TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { } TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { } - ~TIntermAggregate() { delete pragmaTable; } + // Since pragmaTable is allocated with the PoolAllocator, we + // only want to destroy it, not free the associated memory. + ~TIntermAggregate() { pragmaTable->~TPragmaTable(); } virtual TIntermAggregate* getAsAggregate() { return this; } virtual const TIntermAggregate* getAsAggregate() const { return this; } virtual void setOperator(TOperator o) { op = o; } diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 2e9fa85c..4d60dcd8 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -1613,7 +1613,13 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable) { assert(!pragmaTable); - pragmaTable = new TPragmaTable(); + + // We allocate this with the thread-pool allocator because the destructors + // for TIntermNode's are never called. When TIntermNodes are no longer + // needed, the pool allocator destroys all memory at once without + // destruction. + void* memory = GetThreadPoolAllocator().allocate(sizeof(TPragmaTable)); + pragmaTable = new(memory) TPragmaTable(); *pragmaTable = pTable; } From 28ad350b35faa3beb5da684c24886d00887ab86d Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Mon, 18 Jan 2016 11:10:40 -0700 Subject: [PATCH 11/24] Memory: remove a part of the last merge request that causes crashes in multi-threaded mode. --- glslang/Include/intermediate.h | 4 +--- glslang/MachineIndependent/Intermediate.cpp | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index 20d73232..cf701776 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -847,9 +847,7 @@ class TIntermAggregate : public TIntermOperator { public: TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { } TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { } - // Since pragmaTable is allocated with the PoolAllocator, we - // only want to destroy it, not free the associated memory. - ~TIntermAggregate() { pragmaTable->~TPragmaTable(); } + ~TIntermAggregate() { delete pragmaTable; } virtual TIntermAggregate* getAsAggregate() { return this; } virtual const TIntermAggregate* getAsAggregate() const { return this; } virtual void setOperator(TOperator o) { op = o; } diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 4d60dcd8..2e9fa85c 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -1613,13 +1613,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable) { assert(!pragmaTable); - - // We allocate this with the thread-pool allocator because the destructors - // for TIntermNode's are never called. When TIntermNodes are no longer - // needed, the pool allocator destroys all memory at once without - // destruction. - void* memory = GetThreadPoolAllocator().allocate(sizeof(TPragmaTable)); - pragmaTable = new(memory) TPragmaTable(); + pragmaTable = new TPragmaTable(); *pragmaTable = pTable; } From 5fe789b4afb8d1e8067e3a91001399572cbd4db3 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Sun, 17 Jan 2016 23:27:45 -0500 Subject: [PATCH 12/24] Add Block::successors. --- SPIRV/SpvBuilder.cpp | 2 +- SPIRV/spvIR.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 4d5ce419..29f48602 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -857,7 +857,7 @@ void Builder::leaveFunction() if (! block->isTerminated()) { // Whether we're in an unreachable (non-entry) block. - bool unreachable = function.getEntryBlock() != block && block->getNumPredecessors() == 0; + bool unreachable = function.getEntryBlock() != block && block->getPredecessors().empty(); if (unreachable) { // Given that this block is at the end of a function, it must be right after an diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index e763dbb9..38e51971 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -162,9 +162,10 @@ public: Function& getParent() const { return parent; } void addInstruction(std::unique_ptr inst); - void addPredecessor(Block* pred) { predecessors.push_back(pred); } + void addPredecessor(Block* pred) { predecessors.push_back(pred); pred->successors.push_back(this);} void addLocalVariable(std::unique_ptr inst) { localVariables.push_back(std::move(inst)); } - int getNumPredecessors() const { return (int)predecessors.size(); } + const std::vector getPredecessors() const { return predecessors; } + const std::vector getSuccessors() const { return successors; } void setUnreachable() { unreachable = true; } bool isUnreachable() const { return unreachable; } @@ -206,7 +207,7 @@ protected: friend Function; std::vector > instructions; - std::vector predecessors; + std::vector predecessors, successors; std::vector > localVariables; Function& parent; From 454796e008b1c541734eda997a1afc9d6da257bd Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Mon, 18 Jan 2016 16:18:01 -0500 Subject: [PATCH 13/24] Call addPredecessor() on OpSwitch blocks. --- SPIRV/SpvBuilder.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 29f48602..5536a55a 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1759,10 +1759,13 @@ void Builder::makeSwitch(Id selector, int numSegments, std::vector& caseVal // make the switch instruction Instruction* switchInst = new Instruction(NoResult, NoType, OpSwitch); switchInst->addIdOperand(selector); - switchInst->addIdOperand(defaultSegment >= 0 ? segmentBlocks[defaultSegment]->getId() : mergeBlock->getId()); + auto defaultOrMerge = (defaultSegment >= 0) ? segmentBlocks[defaultSegment] : mergeBlock; + switchInst->addIdOperand(defaultOrMerge->getId()); + defaultOrMerge->addPredecessor(buildPoint); for (int i = 0; i < (int)caseValues.size(); ++i) { switchInst->addImmediateOperand(caseValues[i]); switchInst->addIdOperand(segmentBlocks[valueIndexToSegment[i]]->getId()); + segmentBlocks[valueIndexToSegment[i]]->addPredecessor(buildPoint); } buildPoint->addInstruction(std::unique_ptr(switchInst)); From 44bfb0d0cd3417f9d2494d9055d89b45cbf30ff8 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Mon, 18 Jan 2016 16:18:37 -0500 Subject: [PATCH 14/24] Implement inReadableOrder(). --- SPIRV/CMakeLists.txt | 1 + SPIRV/InReadableOrder.cpp | 64 +++++++++++++++++++++++++++++++++++++++ SPIRV/spvIR.h | 28 ++++++++++++++--- 3 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 SPIRV/InReadableOrder.cpp diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt index 945350e7..50cda686 100755 --- a/SPIRV/CMakeLists.txt +++ b/SPIRV/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8) set(SOURCES GlslangToSpv.cpp + InReadableOrder.cpp SpvBuilder.cpp SPVRemapper.cpp doc.cpp diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp new file mode 100644 index 00000000..f0812126 --- /dev/null +++ b/SPIRV/InReadableOrder.cpp @@ -0,0 +1,64 @@ +// The SPIR-V spec requires code blocks to appear in an order satisfying the +// dominator-tree direction (ie, dominator before the dominated). This is, +// actually, easy to achieve: any pre-order CFG traversal algorithm will do it. +// Because such algorithms visit a block only after traversing some path to it +// from the root, they necessarily visit the block's idom first. +// +// But not every graph-traversal algorithm outputs blocks in an order that +// appears logical to human readers. The problem is that unrelated branches may +// be interspersed with each other, and merge blocks may come before some of the +// branches being merged. +// +// A good, human-readable order of blocks may be achieved by performing +// depth-first search but delaying merge nodes until after all their branches +// have been visited. This is implemented below by the inReadableOrder() +// function. + +#include "spvIR.h" + +#include +#include +#include +#include + +using spv::Block; +using spv::Id; +using BlockSet = std::unordered_set; +using IdToBool = std::unordered_map; + +namespace { +// True if any of prerequisites have not yet been visited. +bool delay(const BlockSet& prereqs, const IdToBool& visited) { + return std::any_of(prereqs.begin(), prereqs.end(), + [&visited](Id b) { return !visited.count(b); }); +} +} + +void spv::inReadableOrder(Block* root, std::function callback) { + // Prerequisites for a merge block; must be completed prior to visiting the + // merge block. + std::unordered_map prereqs; + IdToBool visited; // Whether a block has already been visited. + std::deque worklist; // DFS worklist + worklist.push_back(root); + while (!worklist.empty()) { + Block* current = worklist.front(); + worklist.pop_front(); + // Nodes may be pushed repeadetly (before they're first visited) if they + // have multiple predecessors. Skip the already-visited ones. + if (visited[current->getId()]) continue; + callback(current); + visited[current->getId()] = true; + if (auto merge = current->getMergeInstruction()) { + auto& mergePrereqs = prereqs[merge->getIdOperand(0)]; + // Delay visiting merge blocks until all branches are visited. + for (const auto succ : current->getSuccessors()) + mergePrereqs.insert(succ->getId()); + } + for (auto succ : current->getSuccessors()) { + if (!visited[succ->getId()] && !delay(prereqs[succ->getId()], visited)) { + worklist.push_back(succ); + } + } + } +} diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 38e51971..a854384f 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -52,10 +52,11 @@ #include "spirv.hpp" -#include +#include +#include #include #include -#include +#include namespace spv { @@ -157,7 +158,7 @@ public: virtual ~Block() { } - + Id getId() { return instructions.front()->getResultId(); } Function& getParent() const { return parent; } @@ -168,6 +169,19 @@ public: const std::vector getSuccessors() const { return successors; } void setUnreachable() { unreachable = true; } bool isUnreachable() const { return unreachable; } + // Returns the block's merge instruction, if one exists (otherwise null). + const Instruction* getMergeInstruction() const { + if (instructions.size() < 2) return nullptr; + const Instruction* nextToLast = *(instructions.cend() - 2); + switch (nextToLast->getOpCode()) { + case OpSelectionMerge: + case OpLoopMerge: + return nextToLast; + default: + return nullptr; + } + return nullptr; + } bool isTerminated() const { @@ -217,6 +231,11 @@ protected: bool unreachable; }; +// Traverses the control-flow graph rooted at root in an order suited for +// readable code generation. Invokes callback at every node in the traversal +// order. +void inReadableOrder(Block* root, std::function callback); + // // SPIR-V IR Function. // @@ -253,8 +272,7 @@ public: parameterInstructions[p]->dump(out); // Blocks - for (int b = 0; b < (int)blocks.size(); ++b) - blocks[b]->dump(out); + inReadableOrder(blocks[0], [&out](const Block* b) { b->dump(out); }); Instruction end(0, 0, OpFunctionEnd); end.dump(out); } From baa55a15916cc0a58d981f053c3604766173451e Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Mon, 18 Jan 2016 17:12:59 -0500 Subject: [PATCH 15/24] Add spv.branch-return.vert and fix inReadableOrder(). --- SPIRV/InReadableOrder.cpp | 7 ++- Test/baseResults/spv.branch-return.vert.out | 63 +++++++++++++++++++++ Test/spv.branch-return.vert | 10 ++++ Test/test-spirv-list | 1 + 4 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 Test/baseResults/spv.branch-return.vert.out create mode 100644 Test/spv.branch-return.vert diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index f0812126..f88e41a8 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -27,10 +27,11 @@ using BlockSet = std::unordered_set; using IdToBool = std::unordered_map; namespace { -// True if any of prerequisites have not yet been visited. -bool delay(const BlockSet& prereqs, const IdToBool& visited) { +// True if any of prerequisites have not yet been visited. May add new, +// zero-initialized, values to visited, but doesn't modify any existing values. +bool delay(const BlockSet& prereqs, IdToBool& visited) { return std::any_of(prereqs.begin(), prereqs.end(), - [&visited](Id b) { return !visited.count(b); }); + [&visited](Id b) { return !visited[b]; }); } } diff --git a/Test/baseResults/spv.branch-return.vert.out b/Test/baseResults/spv.branch-return.vert.out new file mode 100644 index 00000000..75ebefe1 --- /dev/null +++ b/Test/baseResults/spv.branch-return.vert.out @@ -0,0 +1,63 @@ +spv.branch-return.vert + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 35 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 8 19 34 + Source ESSL 300 + Name 4 "main" + Name 8 "gl_InstanceID" + Name 19 "gl_Position" + Name 34 "gl_VertexID" + Decorate 8(gl_InstanceID) BuiltIn InstanceId + Decorate 19(gl_Position) BuiltIn Position + Decorate 34(gl_VertexID) BuiltIn VertexId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Input 6(int) +8(gl_InstanceID): 7(ptr) Variable Input + 16: TypeFloat 32 + 17: TypeVector 16(float) 4 + 18: TypePointer Output 17(fvec4) + 19(gl_Position): 18(ptr) Variable Output + 20: 16(float) Constant 0 + 21: 17(fvec4) ConstantComposite 20 20 20 20 + 26: 16(float) Constant 1039918957 + 27: TypeInt 32 0 + 28: 27(int) Constant 0 + 29: TypePointer Output 16(float) + 34(gl_VertexID): 7(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 9: 6(int) Load 8(gl_InstanceID) + SelectionMerge 14 None + Switch 9 14 + case 0: 10 + case 1: 11 + case 2: 12 + case 3: 13 + 10: Label + Return + 11: Label + Store 19(gl_Position) 21 + Branch 14 + 12: Label + Return + 13: Label + Return + 14: Label + 30: 29(ptr) AccessChain 19(gl_Position) 28 + 31: 16(float) Load 30 + 32: 16(float) FAdd 31 26 + 33: 29(ptr) AccessChain 19(gl_Position) 28 + Store 33 32 + Return + FunctionEnd diff --git a/Test/spv.branch-return.vert b/Test/spv.branch-return.vert new file mode 100644 index 00000000..0b5897bf --- /dev/null +++ b/Test/spv.branch-return.vert @@ -0,0 +1,10 @@ +#version 300 es +void main() { + switch (gl_InstanceID) { + case 0: return; + case 1: gl_Position = vec4(0.0); break; + case 2: return; + case 3: return; + } + gl_Position.x += 0.123; +} diff --git a/Test/test-spirv-list b/Test/test-spirv-list index af962627..13ff7c0a 100644 --- a/Test/test-spirv-list +++ b/Test/test-spirv-list @@ -32,6 +32,7 @@ spv.always-discard.frag spv.always-discard2.frag spv.bitCast.frag spv.bool.vert +spv.branch-return.vert spv.conditionalDiscard.frag spv.conversion.frag spv.dataOut.frag From 9c591487adfce2b92a92b4a682a11de6560e3b6a Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Mon, 18 Jan 2016 17:33:25 -0500 Subject: [PATCH 16/24] Fix spv.branch-return.vert. --- SPIRV/InReadableOrder.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index f88e41a8..b24d3ef2 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -39,7 +39,7 @@ void spv::inReadableOrder(Block* root, std::function callback) { // Prerequisites for a merge block; must be completed prior to visiting the // merge block. std::unordered_map prereqs; - IdToBool visited; // Whether a block has already been visited. + IdToBool visited; // Whether a block has already been visited. std::deque worklist; // DFS worklist worklist.push_back(root); while (!worklist.empty()) { @@ -48,18 +48,22 @@ void spv::inReadableOrder(Block* root, std::function callback) { // Nodes may be pushed repeadetly (before they're first visited) if they // have multiple predecessors. Skip the already-visited ones. if (visited[current->getId()]) continue; + if (delay(prereqs[current->getId()], visited)) { + // Not every prerequisite has been visited -- push it off for later. + worklist.push_back(current); + continue; + } callback(current); visited[current->getId()] = true; if (auto merge = current->getMergeInstruction()) { - auto& mergePrereqs = prereqs[merge->getIdOperand(0)]; + Id mergeId = merge->getIdOperand(0); + auto& mergePrereqs = prereqs[mergeId]; // Delay visiting merge blocks until all branches are visited. for (const auto succ : current->getSuccessors()) - mergePrereqs.insert(succ->getId()); + if (succ->getId() != mergeId) mergePrereqs.insert(succ->getId()); } for (auto succ : current->getSuccessors()) { - if (!visited[succ->getId()] && !delay(prereqs[succ->getId()], visited)) { - worklist.push_back(succ); - } + if (!visited[succ->getId()]) worklist.push_back(succ); } } } From 38d039d0637a20c01f55645c3961a564d9f29e3f Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 10:01:27 -0500 Subject: [PATCH 17/24] Rework inReadableOrder() as a recursive descent. Add a test for unreachable merge block. Update test results with the new order: mainly delaying merge blocks and removing unreachable ones. --- SPIRV/InReadableOrder.cpp | 77 +++++++++---------- SPIRV/spvIR.h | 13 +++- Test/baseResults/spv.always-discard.frag.out | 19 ----- .../spv.do-while-continue-break.vert.out | 6 -- .../spv.for-continue-break.vert.out | 6 -- .../spv.merge-unreachable.frag.out | 47 +++++++++++ Test/baseResults/spv.switch.frag.out | 56 +++++++------- .../spv.while-continue-break.vert.out | 6 -- Test/spv.merge-unreachable.frag | 7 ++ Test/test-spirv-list | 1 + 10 files changed, 131 insertions(+), 107 deletions(-) mode change 100755 => 100644 Test/baseResults/spv.always-discard.frag.out mode change 100755 => 100644 Test/baseResults/spv.do-while-continue-break.vert.out mode change 100755 => 100644 Test/baseResults/spv.for-continue-break.vert.out create mode 100644 Test/baseResults/spv.merge-unreachable.frag.out mode change 100755 => 100644 Test/baseResults/spv.while-continue-break.vert.out create mode 100644 Test/spv.merge-unreachable.frag diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index b24d3ef2..de506f41 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -17,53 +17,52 @@ #include "spvIR.h" #include +#include #include #include -#include using spv::Block; using spv::Id; -using BlockSet = std::unordered_set; -using IdToBool = std::unordered_map; namespace { -// True if any of prerequisites have not yet been visited. May add new, -// zero-initialized, values to visited, but doesn't modify any existing values. -bool delay(const BlockSet& prereqs, IdToBool& visited) { - return std::any_of(prereqs.begin(), prereqs.end(), - [&visited](Id b) { return !visited[b]; }); -} +// Traverses CFG in a readable order, invoking a pre-set callback on each block. +// Use by calling visit() on the root block. +class ReadableOrderTraverser { + public: + explicit ReadableOrderTraverser(std::function callback) + : callback_(callback) {} + + // Visits the block if it hasn't been visited already and isn't currently + // being delayed. Invokes callback(block), then descends into its successors. + // Delays merge-block processing until all the branches have been completed. + void visit(Block* block) { + assert(block); + if (visited_[block] || delayed_[block]) return; + callback_(block); + visited_[block] = true; + Block* mergeBlock = nullptr; + auto mergeInst = block->getMergeInstruction(); + if (mergeInst) { + Id mergeId = mergeInst->getIdOperand(0); + mergeBlock = + block->getParent().getParent().getInstruction(mergeId)->getBlock(); + delayed_[mergeBlock] = true; + } + for (const auto succ : block->getSuccessors()) + if (succ != mergeBlock) visit(succ); + if (mergeBlock) { + delayed_[mergeBlock] = false; + visit(mergeBlock); + } + } + + private: + std::function callback_; + // Whether a block has already been visited or is being delayed. + std::unordered_map visited_, delayed_; +}; } void spv::inReadableOrder(Block* root, std::function callback) { - // Prerequisites for a merge block; must be completed prior to visiting the - // merge block. - std::unordered_map prereqs; - IdToBool visited; // Whether a block has already been visited. - std::deque worklist; // DFS worklist - worklist.push_back(root); - while (!worklist.empty()) { - Block* current = worklist.front(); - worklist.pop_front(); - // Nodes may be pushed repeadetly (before they're first visited) if they - // have multiple predecessors. Skip the already-visited ones. - if (visited[current->getId()]) continue; - if (delay(prereqs[current->getId()], visited)) { - // Not every prerequisite has been visited -- push it off for later. - worklist.push_back(current); - continue; - } - callback(current); - visited[current->getId()] = true; - if (auto merge = current->getMergeInstruction()) { - Id mergeId = merge->getIdOperand(0); - auto& mergePrereqs = prereqs[mergeId]; - // Delay visiting merge blocks until all branches are visited. - for (const auto succ : current->getSuccessors()) - if (succ->getId() != mergeId) mergePrereqs.insert(succ->getId()); - } - for (auto succ : current->getSuccessors()) { - if (!visited[succ->getId()]) worklist.push_back(succ); - } - } + ReadableOrderTraverser(callback).visit(root); } diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index a854384f..307711bf 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -60,6 +60,7 @@ namespace spv { +class Block; class Function; class Module; @@ -108,6 +109,8 @@ public: addImmediateOperand(word); } } + void setBlock(Block* b) { block = b; } + Block* getBlock() { return block; } Op getOpCode() const { return opCode; } int getNumOperands() const { return (int)operands.size(); } Id getResultId() const { return resultId; } @@ -146,6 +149,7 @@ protected: Op opCode; std::vector operands; std::string originalString; // could be optimized away; convenience for getting string operand + Block* block; }; // @@ -165,8 +169,8 @@ public: void addInstruction(std::unique_ptr inst); void addPredecessor(Block* pred) { predecessors.push_back(pred); pred->successors.push_back(this);} void addLocalVariable(std::unique_ptr inst) { localVariables.push_back(std::move(inst)); } - const std::vector getPredecessors() const { return predecessors; } - const std::vector getSuccessors() const { return successors; } + const std::vector& getPredecessors() const { return predecessors; } + const std::vector& getSuccessors() const { return successors; } void setUnreachable() { unreachable = true; } bool isUnreachable() const { return unreachable; } // Returns the block's merge instruction, if one exists (otherwise null). @@ -370,12 +374,15 @@ __inline void Function::addLocalVariable(std::unique_ptr inst) __inline Block::Block(Id id, Function& parent) : parent(parent), unreachable(false) { instructions.push_back(std::unique_ptr(new Instruction(id, NoType, OpLabel))); + instructions.back()->setBlock(this); + parent.getParent().mapInstruction(instructions.back()); } __inline void Block::addInstruction(std::unique_ptr inst) { - Instruction* raw_instruction = inst.get(); + Instruction* raw_instruction = inst.get(); instructions.push_back(std::move(inst)); + raw_instruction->setBlock(this); if (raw_instruction->getResultId()) parent.getParent().mapInstruction(raw_instruction); } diff --git a/Test/baseResults/spv.always-discard.frag.out b/Test/baseResults/spv.always-discard.frag.out old mode 100755 new mode 100644 index a639515b..73e34bdc --- a/Test/baseResults/spv.always-discard.frag.out +++ b/Test/baseResults/spv.always-discard.frag.out @@ -110,23 +110,4 @@ Linked fragment stage: Branch 49 49: Label Kill - 69: Label - 70: 6(float) Load 36(radius) - 72: 46(bool) FOrdGreaterThanEqual 70 71 - SelectionMerge 74 None - BranchConditional 72 73 74 - 73: Label - 75: 6(float) Load 36(radius) - 77: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 75 76 - 78: 6(float) FDiv 77 27 - 79: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 78 - 80: 7(fvec4) Load 15(color) - 81: 7(fvec4) CompositeConstruct 79 79 79 79 - 82: 7(fvec4) FSub 80 81 - Store 15(color) 82 - Branch 74 - 74: Label - 83: 7(fvec4) Load 15(color) - Store 59(gl_FragColor) 83 - Return FunctionEnd diff --git a/Test/baseResults/spv.do-while-continue-break.vert.out b/Test/baseResults/spv.do-while-continue-break.vert.out old mode 100755 new mode 100644 index c483861c..44a1730d --- a/Test/baseResults/spv.do-while-continue-break.vert.out +++ b/Test/baseResults/spv.do-while-continue-break.vert.out @@ -81,9 +81,6 @@ Linked vertex stage: 28: Label Store 30(B) 19 Branch 10 - 32: Label - Store 33(C) 26 - Branch 29 29: Label 34: 6(int) Load 8(i) 36: 14(bool) IEqual 34 35 @@ -92,9 +89,6 @@ Linked vertex stage: 37: Label Store 39(D) 40 Branch 11 - 41: Label - Store 42(E) 43 - Branch 38 38: Label Store 44(F) 45 Branch 10 diff --git a/Test/baseResults/spv.for-continue-break.vert.out b/Test/baseResults/spv.for-continue-break.vert.out old mode 100755 new mode 100644 index 92976eb5..c759fc65 --- a/Test/baseResults/spv.for-continue-break.vert.out +++ b/Test/baseResults/spv.for-continue-break.vert.out @@ -70,9 +70,6 @@ Linked vertex stage: 27: 6(int) IAdd 26 18 Store 8(i) 27 Branch 10 - 28: Label - Store 29(C) 18 - Branch 24 24: Label 30: 6(int) Load 8(i) 32: 6(int) SMod 30 31 @@ -82,9 +79,6 @@ Linked vertex stage: 34: Label Store 36(D) 18 Branch 11 - 37: Label - Store 38(E) 18 - Branch 35 35: Label Store 39(F) 40 41: 6(int) Load 8(i) diff --git a/Test/baseResults/spv.merge-unreachable.frag.out b/Test/baseResults/spv.merge-unreachable.frag.out new file mode 100644 index 00000000..65429768 --- /dev/null +++ b/Test/baseResults/spv.merge-unreachable.frag.out @@ -0,0 +1,47 @@ +spv.merge-unreachable.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 + ExecutionMode 4 OriginLowerLeft + Source GLSL 450 + Name 4 "main" + Name 9 "v" + Decorate 9(v) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Input 7(fvec4) + 9(v): 8(ptr) Variable Input + 11: 6(float) Constant 1036831949 + 12: 6(float) Constant 1045220557 + 13: 6(float) Constant 1050253722 + 14: 6(float) Constant 1053609165 + 15: 7(fvec4) ConstantComposite 11 12 13 14 + 16: TypeBool + 17: TypeVector 16(bool) 4 + 4(main): 2 Function None 3 + 5: Label + 10: 7(fvec4) Load 9(v) + 18: 17(bvec4) FOrdEqual 10 15 + 19: 16(bool) All 18 + SelectionMerge 21 None + BranchConditional 19 20 23 + 20: Label + Kill + 23: Label + Return + 21: Label + Return + FunctionEnd diff --git a/Test/baseResults/spv.switch.frag.out b/Test/baseResults/spv.switch.frag.out index 0d430832..918c1d66 100755 --- a/Test/baseResults/spv.switch.frag.out +++ b/Test/baseResults/spv.switch.frag.out @@ -106,6 +106,11 @@ Linked fragment stage: Switch 65 68 case 1: 66 case 2: 67 + 68: Label + 80: 6(float) Load 73(x) + 81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80 + Store 71(f) 81 + Branch 69 66: Label 74: 6(float) Load 73(x) 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 @@ -116,17 +121,19 @@ Linked fragment stage: 78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77 Store 71(f) 78 Branch 69 - 68: Label - 80: 6(float) Load 73(x) - 81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80 - Store 71(f) 81 - Branch 69 69: Label 83: 9(int) Load 60(c) SelectionMerge 87 None Switch 83 86 case 1: 84 case 2: 85 + 86: Label + 97: 6(float) Load 73(x) + 98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97 + 99: 6(float) Load 71(f) + 100: 6(float) FAdd 99 98 + Store 71(f) 100 + Branch 87 84: Label 88: 6(float) Load 73(x) 89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88 @@ -141,13 +148,6 @@ Linked fragment stage: 95: 6(float) FAdd 94 93 Store 71(f) 95 Branch 87 - 86: Label - 97: 6(float) Load 73(x) - 98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97 - 99: 6(float) Load 71(f) - 100: 6(float) FAdd 99 98 - Store 71(f) 100 - Branch 87 87: Label 102: 9(int) Load 60(c) SelectionMerge 105 None @@ -174,6 +174,13 @@ Linked fragment stage: Switch 117 120 case 1: 118 case 2: 119 + 120: Label + 148: 6(float) Load 73(x) + 149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148 + 150: 6(float) Load 71(f) + 151: 6(float) FAdd 150 149 + Store 71(f) 151 + Branch 121 118: Label 122: 6(float) Load 73(x) 123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122 @@ -207,13 +214,6 @@ Linked fragment stage: Branch 131 131: Label Branch 121 - 120: Label - 148: 6(float) Load 73(x) - 149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148 - 150: 6(float) Load 71(f) - 151: 6(float) FAdd 150 149 - Store 71(f) 151 - Branch 121 121: Label Store 153(i) 154 Branch 155 @@ -228,6 +228,13 @@ Linked fragment stage: Switch 162 165 case 1: 163 case 2: 164 + 165: Label + 196: 6(float) Load 73(x) + 197: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 196 + 198: 6(float) Load 71(f) + 199: 6(float) FAdd 198 197 + Store 71(f) 199 + Branch 166 163: Label 167: 6(float) Load 73(x) 168: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 167 @@ -265,13 +272,6 @@ Linked fragment stage: 193: 6(float) FAdd 192 191 Store 71(f) 193 Branch 166 - 165: Label - 196: 6(float) Load 73(x) - 197: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 196 - 198: 6(float) Load 71(f) - 199: 6(float) FAdd 198 197 - Store 71(f) 199 - Branch 166 166: Label 201: 6(float) Load 71(f) 203: 160(bool) FOrdLessThan 201 202 @@ -331,10 +331,10 @@ Linked fragment stage: SelectionMerge 254 None Switch 251 253 case 0: 252 - 252: Label - Branch 254 253: Label Branch 254 + 252: Label + Branch 254 254: Label 258: 9(int) Load 60(c) SelectionMerge 260 None diff --git a/Test/baseResults/spv.while-continue-break.vert.out b/Test/baseResults/spv.while-continue-break.vert.out old mode 100755 new mode 100644 index 5d6094f5..b2ccbaaa --- a/Test/baseResults/spv.while-continue-break.vert.out +++ b/Test/baseResults/spv.while-continue-break.vert.out @@ -60,9 +60,6 @@ Linked vertex stage: 23: Label Store 25(B) 20 Branch 10 - 26: Label - Store 27(C) 20 - Branch 24 24: Label 28: 6(int) Load 8(i) 30: 6(int) SMod 28 29 @@ -72,9 +69,6 @@ Linked vertex stage: 32: Label Store 25(B) 20 Branch 11 - 34: Label - Store 27(C) 20 - Branch 33 33: Label 35: 6(int) Load 8(i) 36: 6(int) IAdd 35 18 diff --git a/Test/spv.merge-unreachable.frag b/Test/spv.merge-unreachable.frag new file mode 100644 index 00000000..12f57cd1 --- /dev/null +++ b/Test/spv.merge-unreachable.frag @@ -0,0 +1,7 @@ +#version 450 +layout(location=1) in highp vec4 v; +void main (void) +{ + if (v == vec4(0.1,0.2,0.3,0.4)) discard; + else return; +} diff --git a/Test/test-spirv-list b/Test/test-spirv-list index 13ff7c0a..d0661245 100644 --- a/Test/test-spirv-list +++ b/Test/test-spirv-list @@ -57,6 +57,7 @@ spv.loopsArtificial.frag spv.matFun.vert spv.matrix.frag spv.matrix2.frag +spv.merge-unreachable.frag spv.newTexture.frag spv.nonSquare.vert spv.Operations.frag From 377f0cab2613de3f9c67cd881db7170b63eb862d Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 10:17:33 -0500 Subject: [PATCH 18/24] Fix merge issues. --- SPIRV/spvIR.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 307711bf..91e42aa3 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -176,7 +176,7 @@ public: // Returns the block's merge instruction, if one exists (otherwise null). const Instruction* getMergeInstruction() const { if (instructions.size() < 2) return nullptr; - const Instruction* nextToLast = *(instructions.cend() - 2); + const Instruction* nextToLast = (instructions.cend() - 2)->get(); switch (nextToLast->getOpCode()) { case OpSelectionMerge: case OpLoopMerge: @@ -375,7 +375,7 @@ __inline Block::Block(Id id, Function& parent) : parent(parent), unreachable(fal { instructions.push_back(std::unique_ptr(new Instruction(id, NoType, OpLabel))); instructions.back()->setBlock(this); - parent.getParent().mapInstruction(instructions.back()); + parent.getParent().mapInstruction(instructions.back().get()); } __inline void Block::addInstruction(std::unique_ptr inst) From fa242904b04edd7f0c21cc005b0a25fe8c48784f Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 11:31:55 -0500 Subject: [PATCH 19/24] Make Instruction::getBlock() const. --- SPIRV/spvIR.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 91e42aa3..688068da 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -110,7 +110,7 @@ public: } } void setBlock(Block* b) { block = b; } - Block* getBlock() { return block; } + Block* getBlock() const { return block; } Op getOpCode() const { return opCode; } int getNumOperands() const { return (int)operands.size(); } Id getResultId() const { return resultId; } From 57bbde4a99b17865498e915d2eb29190def6f4b7 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 11:44:53 -0500 Subject: [PATCH 20/24] Add copyright, remove unused #includes. --- SPIRV/InReadableOrder.cpp | 40 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index de506f41..a87622a8 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -1,3 +1,41 @@ +// +//Copyright (C) 2016 LunarG, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. + +// +// Author: Dejan Mircevski, Google +// + // The SPIR-V spec requires code blocks to appear in an order satisfying the // dominator-tree direction (ie, dominator before the dominated). This is, // actually, easy to achieve: any pre-order CFG traversal algorithm will do it. @@ -16,9 +54,7 @@ #include "spvIR.h" -#include #include -#include #include using spv::Block; From a7e734962ec9d27aeb56a8db8109454f3a78475a Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 11:49:37 -0500 Subject: [PATCH 21/24] Remove a redundant check before visit(succ). --- SPIRV/InReadableOrder.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index a87622a8..36594530 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -84,8 +84,7 @@ class ReadableOrderTraverser { block->getParent().getParent().getInstruction(mergeId)->getBlock(); delayed_[mergeBlock] = true; } - for (const auto succ : block->getSuccessors()) - if (succ != mergeBlock) visit(succ); + for (const auto succ : block->getSuccessors()) visit(succ); if (mergeBlock) { delayed_[mergeBlock] = false; visit(mergeBlock); From 34bc6c389690df7937dfeb9cad7d473775ecb1fd Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 14:08:32 -0500 Subject: [PATCH 22/24] Explicitly initialize Instruction::block. --- SPIRV/spvIR.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 688068da..ea8548e3 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -77,8 +77,8 @@ const MemorySemanticsMask MemorySemanticsAllMemory = (MemorySemanticsMask)0x3FF; class Instruction { public: - Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode) { } - explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode) { } + Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(nullptr) { } + explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { } virtual ~Instruction() {} void addIdOperand(Id id) { operands.push_back(id); } void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); } From cce6a8acaf61d3de38e0f5b0934b577e7648cc57 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 14:50:12 -0500 Subject: [PATCH 23/24] (C) Google --- SPIRV/InReadableOrder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index 36594530..6299b4ef 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -1,5 +1,5 @@ // -//Copyright (C) 2016 LunarG, Inc. +//Copyright (C) 2016 Google, Inc. // //All rights reserved. // From 159b59faa717d85b90b94aa4315306972c026f8f Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 14:52:31 -0500 Subject: [PATCH 24/24] Reformat to better match existing style. --- SPIRV/InReadableOrder.cpp | 63 ++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index 6299b4ef..4eb56d64 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -64,40 +64,41 @@ namespace { // Traverses CFG in a readable order, invoking a pre-set callback on each block. // Use by calling visit() on the root block. class ReadableOrderTraverser { - public: - explicit ReadableOrderTraverser(std::function callback) - : callback_(callback) {} - - // Visits the block if it hasn't been visited already and isn't currently - // being delayed. Invokes callback(block), then descends into its successors. - // Delays merge-block processing until all the branches have been completed. - void visit(Block* block) { - assert(block); - if (visited_[block] || delayed_[block]) return; - callback_(block); - visited_[block] = true; - Block* mergeBlock = nullptr; - auto mergeInst = block->getMergeInstruction(); - if (mergeInst) { - Id mergeId = mergeInst->getIdOperand(0); - mergeBlock = - block->getParent().getParent().getInstruction(mergeId)->getBlock(); - delayed_[mergeBlock] = true; +public: + explicit ReadableOrderTraverser(std::function callback) : callback_(callback) {} + // Visits the block if it hasn't been visited already and isn't currently + // being delayed. Invokes callback(block), then descends into its successors. + // Delays merge-block processing until all the branches have been completed. + void visit(Block* block) + { + assert(block); + if (visited_[block] || delayed_[block]) + return; + callback_(block); + visited_[block] = true; + Block* mergeBlock = nullptr; + auto mergeInst = block->getMergeInstruction(); + if (mergeInst) { + Id mergeId = mergeInst->getIdOperand(0); + mergeBlock = block->getParent().getParent().getInstruction(mergeId)->getBlock(); + delayed_[mergeBlock] = true; + } + for (const auto succ : block->getSuccessors()) + visit(succ); + if (mergeBlock) { + delayed_[mergeBlock] = false; + visit(mergeBlock); + } } - for (const auto succ : block->getSuccessors()) visit(succ); - if (mergeBlock) { - delayed_[mergeBlock] = false; - visit(mergeBlock); - } - } - private: - std::function callback_; - // Whether a block has already been visited or is being delayed. - std::unordered_map visited_, delayed_; +private: + std::function callback_; + // Whether a block has already been visited or is being delayed. + std::unordered_map visited_, delayed_; }; } -void spv::inReadableOrder(Block* root, std::function callback) { - ReadableOrderTraverser(callback).visit(root); +void spv::inReadableOrder(Block* root, std::function callback) +{ + ReadableOrderTraverser(callback).visit(root); }