Merge pull request #1946 from KhronosGroup/extend-web
Web: Extend with compute stage, SSBOs, and atomics on SSBO memory.
This commit is contained in:
		
						commit
						341701573a
					
				@ -292,8 +292,8 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
 | 
				
			|||||||
    switch (stage) {
 | 
					    switch (stage) {
 | 
				
			||||||
    case EShLangVertex:           return spv::ExecutionModelVertex;
 | 
					    case EShLangVertex:           return spv::ExecutionModelVertex;
 | 
				
			||||||
    case EShLangFragment:         return spv::ExecutionModelFragment;
 | 
					    case EShLangFragment:         return spv::ExecutionModelFragment;
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    case EShLangCompute:          return spv::ExecutionModelGLCompute;
 | 
					    case EShLangCompute:          return spv::ExecutionModelGLCompute;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    case EShLangTessControl:      return spv::ExecutionModelTessellationControl;
 | 
					    case EShLangTessControl:      return spv::ExecutionModelTessellationControl;
 | 
				
			||||||
    case EShLangTessEvaluation:   return spv::ExecutionModelTessellationEvaluation;
 | 
					    case EShLangTessEvaluation:   return spv::ExecutionModelTessellationEvaluation;
 | 
				
			||||||
    case EShLangGeometry:         return spv::ExecutionModelGeometry;
 | 
					    case EShLangGeometry:         return spv::ExecutionModelGeometry;
 | 
				
			||||||
@ -374,22 +374,20 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto
 | 
				
			|||||||
// Translate glslang type to SPIR-V memory decorations.
 | 
					// Translate glslang type to SPIR-V memory decorations.
 | 
				
			||||||
void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector<spv::Decoration>& memory, bool useVulkanMemoryModel)
 | 
					void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector<spv::Decoration>& memory, bool useVulkanMemoryModel)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    if (!useVulkanMemoryModel) {
 | 
					    if (!useVulkanMemoryModel) {
 | 
				
			||||||
        if (qualifier.coherent)
 | 
					        if (qualifier.isCoherent())
 | 
				
			||||||
            memory.push_back(spv::DecorationCoherent);
 | 
					            memory.push_back(spv::DecorationCoherent);
 | 
				
			||||||
        if (qualifier.volatil) {
 | 
					        if (qualifier.isVolatile()) {
 | 
				
			||||||
            memory.push_back(spv::DecorationVolatile);
 | 
					            memory.push_back(spv::DecorationVolatile);
 | 
				
			||||||
            memory.push_back(spv::DecorationCoherent);
 | 
					            memory.push_back(spv::DecorationCoherent);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (qualifier.restrict)
 | 
					    if (qualifier.isRestrict())
 | 
				
			||||||
        memory.push_back(spv::DecorationRestrict);
 | 
					        memory.push_back(spv::DecorationRestrict);
 | 
				
			||||||
    if (qualifier.isReadOnly())
 | 
					    if (qualifier.isReadOnly())
 | 
				
			||||||
        memory.push_back(spv::DecorationNonWritable);
 | 
					        memory.push_back(spv::DecorationNonWritable);
 | 
				
			||||||
    if (qualifier.isWriteOnly())
 | 
					    if (qualifier.isWriteOnly())
 | 
				
			||||||
       memory.push_back(spv::DecorationNonReadable);
 | 
					       memory.push_back(spv::DecorationNonReadable);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Translate glslang type to SPIR-V layout decorations.
 | 
					// Translate glslang type to SPIR-V layout decorations.
 | 
				
			||||||
@ -673,6 +671,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
 | 
				
			|||||||
    case glslang::EbvFace:                 return spv::BuiltInFrontFacing;
 | 
					    case glslang::EbvFace:                 return spv::BuiltInFrontFacing;
 | 
				
			||||||
    case glslang::EbvFragDepth:            return spv::BuiltInFragDepth;
 | 
					    case glslang::EbvFragDepth:            return spv::BuiltInFragDepth;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case glslang::EbvNumWorkGroups:        return spv::BuiltInNumWorkgroups;
 | 
				
			||||||
 | 
					    case glslang::EbvWorkGroupSize:        return spv::BuiltInWorkgroupSize;
 | 
				
			||||||
 | 
					    case glslang::EbvWorkGroupId:          return spv::BuiltInWorkgroupId;
 | 
				
			||||||
 | 
					    case glslang::EbvLocalInvocationId:    return spv::BuiltInLocalInvocationId;
 | 
				
			||||||
 | 
					    case glslang::EbvLocalInvocationIndex: return spv::BuiltInLocalInvocationIndex;
 | 
				
			||||||
 | 
					    case glslang::EbvGlobalInvocationId:   return spv::BuiltInGlobalInvocationId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    // These *Distance capabilities logically belong here, but if the member is declared and
 | 
					    // These *Distance capabilities logically belong here, but if the member is declared and
 | 
				
			||||||
    // then never used, consumers of SPIR-V prefer the capability not be declared.
 | 
					    // then never used, consumers of SPIR-V prefer the capability not be declared.
 | 
				
			||||||
@ -757,12 +762,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
 | 
				
			|||||||
    case glslang::EbvTessCoord:            return spv::BuiltInTessCoord;
 | 
					    case glslang::EbvTessCoord:            return spv::BuiltInTessCoord;
 | 
				
			||||||
    case glslang::EbvPatchVertices:        return spv::BuiltInPatchVertices;
 | 
					    case glslang::EbvPatchVertices:        return spv::BuiltInPatchVertices;
 | 
				
			||||||
    case glslang::EbvHelperInvocation:     return spv::BuiltInHelperInvocation;
 | 
					    case glslang::EbvHelperInvocation:     return spv::BuiltInHelperInvocation;
 | 
				
			||||||
    case glslang::EbvNumWorkGroups:        return spv::BuiltInNumWorkgroups;
 | 
					 | 
				
			||||||
    case glslang::EbvWorkGroupSize:        return spv::BuiltInWorkgroupSize;
 | 
					 | 
				
			||||||
    case glslang::EbvWorkGroupId:          return spv::BuiltInWorkgroupId;
 | 
					 | 
				
			||||||
    case glslang::EbvLocalInvocationId:    return spv::BuiltInLocalInvocationId;
 | 
					 | 
				
			||||||
    case glslang::EbvLocalInvocationIndex: return spv::BuiltInLocalInvocationIndex;
 | 
					 | 
				
			||||||
    case glslang::EbvGlobalInvocationId:   return spv::BuiltInGlobalInvocationId;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case glslang::EbvSubGroupSize:
 | 
					    case glslang::EbvSubGroupSize:
 | 
				
			||||||
        builder.addExtension(spv::E_SPV_KHR_shader_ballot);
 | 
					        builder.addExtension(spv::E_SPV_KHR_shader_ballot);
 | 
				
			||||||
@ -1203,8 +1202,8 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
 | 
				
			|||||||
    case glslang::EvqGlobal:        return spv::StorageClassPrivate;
 | 
					    case glslang::EvqGlobal:        return spv::StorageClassPrivate;
 | 
				
			||||||
    case glslang::EvqConstReadOnly: return spv::StorageClassFunction;
 | 
					    case glslang::EvqConstReadOnly: return spv::StorageClassFunction;
 | 
				
			||||||
    case glslang::EvqTemporary:     return spv::StorageClassFunction;
 | 
					    case glslang::EvqTemporary:     return spv::StorageClassFunction;
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    case glslang::EvqShared:           return spv::StorageClassWorkgroup;
 | 
					    case glslang::EvqShared:           return spv::StorageClassWorkgroup;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    case glslang::EvqPayloadNV:        return spv::StorageClassRayPayloadNV;
 | 
					    case glslang::EvqPayloadNV:        return spv::StorageClassRayPayloadNV;
 | 
				
			||||||
    case glslang::EvqPayloadInNV:      return spv::StorageClassIncomingRayPayloadNV;
 | 
					    case glslang::EvqPayloadInNV:      return spv::StorageClassIncomingRayPayloadNV;
 | 
				
			||||||
    case glslang::EvqHitAttrNV:        return spv::StorageClassHitAttributeNV;
 | 
					    case glslang::EvqHitAttrNV:        return spv::StorageClassHitAttributeNV;
 | 
				
			||||||
@ -1465,13 +1464,20 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
 | 
				
			|||||||
        if (mode != spv::ExecutionModeMax)
 | 
					        if (mode != spv::ExecutionModeMax)
 | 
				
			||||||
            builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
 | 
					            builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
 | 
				
			||||||
        switch (glslangIntermediate->getInterlockOrdering()) {
 | 
					        switch (glslangIntermediate->getInterlockOrdering()) {
 | 
				
			||||||
        case glslang::EioPixelInterlockOrdered:         mode = spv::ExecutionModePixelInterlockOrderedEXT;          break;
 | 
					        case glslang::EioPixelInterlockOrdered:         mode = spv::ExecutionModePixelInterlockOrderedEXT;
 | 
				
			||||||
        case glslang::EioPixelInterlockUnordered:       mode = spv::ExecutionModePixelInterlockUnorderedEXT;          break;
 | 
					            break;
 | 
				
			||||||
        case glslang::EioSampleInterlockOrdered:        mode = spv::ExecutionModeSampleInterlockOrderedEXT;          break;
 | 
					        case glslang::EioPixelInterlockUnordered:       mode = spv::ExecutionModePixelInterlockUnorderedEXT;
 | 
				
			||||||
        case glslang::EioSampleInterlockUnordered:      mode = spv::ExecutionModeSampleInterlockUnorderedEXT;          break;
 | 
					            break;
 | 
				
			||||||
        case glslang::EioShadingRateInterlockOrdered:   mode = spv::ExecutionModeShadingRateInterlockOrderedEXT;          break;
 | 
					        case glslang::EioSampleInterlockOrdered:        mode = spv::ExecutionModeSampleInterlockOrderedEXT;
 | 
				
			||||||
        case glslang::EioShadingRateInterlockUnordered: mode = spv::ExecutionModeShadingRateInterlockUnorderedEXT;          break;
 | 
					            break;
 | 
				
			||||||
        default:                                        mode = spv::ExecutionModeMax;                   break;
 | 
					        case glslang::EioSampleInterlockUnordered:      mode = spv::ExecutionModeSampleInterlockUnorderedEXT;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        case glslang::EioShadingRateInterlockOrdered:   mode = spv::ExecutionModeShadingRateInterlockOrderedEXT;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        case glslang::EioShadingRateInterlockUnordered: mode = spv::ExecutionModeShadingRateInterlockUnorderedEXT;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        default:                                        mode = spv::ExecutionModeMax;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (mode != spv::ExecutionModeMax) {
 | 
					        if (mode != spv::ExecutionModeMax) {
 | 
				
			||||||
            builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
 | 
					            builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
 | 
				
			||||||
@ -1489,7 +1495,6 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    case EShLangCompute:
 | 
					    case EShLangCompute:
 | 
				
			||||||
        builder.addCapability(spv::CapabilityShader);
 | 
					        builder.addCapability(spv::CapabilityShader);
 | 
				
			||||||
        builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
 | 
					        builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
 | 
				
			||||||
@ -1505,6 +1510,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
 | 
				
			|||||||
            builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives);
 | 
					            builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    case EShLangTessEvaluation:
 | 
					    case EShLangTessEvaluation:
 | 
				
			||||||
    case EShLangTessControl:
 | 
					    case EShLangTessControl:
 | 
				
			||||||
        builder.addCapability(spv::CapabilityTessellation);
 | 
					        builder.addCapability(spv::CapabilityTessellation);
 | 
				
			||||||
@ -2546,7 +2552,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
 | 
				
			|||||||
        binOp = glslang::EOpMod;
 | 
					        binOp = glslang::EOpMod;
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    case glslang::EOpEmitVertex:
 | 
					    case glslang::EOpEmitVertex:
 | 
				
			||||||
    case glslang::EOpEndPrimitive:
 | 
					    case glslang::EOpEndPrimitive:
 | 
				
			||||||
    case glslang::EOpBarrier:
 | 
					    case glslang::EOpBarrier:
 | 
				
			||||||
@ -2570,10 +2575,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
 | 
				
			|||||||
        // These all have 0 operands and will naturally finish up in the code below for 0 operands
 | 
					        // These all have 0 operands and will naturally finish up in the code below for 0 operands
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case glslang::EOpAtomicStore:
 | 
					 | 
				
			||||||
        noReturnValue = true;
 | 
					 | 
				
			||||||
        // fallthrough
 | 
					 | 
				
			||||||
    case glslang::EOpAtomicLoad:
 | 
					 | 
				
			||||||
    case glslang::EOpAtomicAdd:
 | 
					    case glslang::EOpAtomicAdd:
 | 
				
			||||||
    case glslang::EOpAtomicMin:
 | 
					    case glslang::EOpAtomicMin:
 | 
				
			||||||
    case glslang::EOpAtomicMax:
 | 
					    case glslang::EOpAtomicMax:
 | 
				
			||||||
@ -2585,6 +2586,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
 | 
				
			|||||||
        atomic = true;
 | 
					        atomic = true;
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
 | 
					    case glslang::EOpAtomicStore:
 | 
				
			||||||
 | 
					        noReturnValue = true;
 | 
				
			||||||
 | 
					        // fallthrough
 | 
				
			||||||
 | 
					    case glslang::EOpAtomicLoad:
 | 
				
			||||||
 | 
					        atomic = true;
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case glslang::EOpAtomicCounterAdd:
 | 
					    case glslang::EOpAtomicCounterAdd:
 | 
				
			||||||
    case glslang::EOpAtomicCounterSubtract:
 | 
					    case glslang::EOpAtomicCounterSubtract:
 | 
				
			||||||
    case glslang::EOpAtomicCounterMin:
 | 
					    case glslang::EOpAtomicCounterMin:
 | 
				
			||||||
@ -2667,6 +2676,19 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
 | 
				
			|||||||
            if (arg == 1)
 | 
					            if (arg == 1)
 | 
				
			||||||
                lvalue = true;
 | 
					                lvalue = true;
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case glslang::EOpAtomicAdd:
 | 
				
			||||||
 | 
					        case glslang::EOpAtomicMin:
 | 
				
			||||||
 | 
					        case glslang::EOpAtomicMax:
 | 
				
			||||||
 | 
					        case glslang::EOpAtomicAnd:
 | 
				
			||||||
 | 
					        case glslang::EOpAtomicOr:
 | 
				
			||||||
 | 
					        case glslang::EOpAtomicXor:
 | 
				
			||||||
 | 
					        case glslang::EOpAtomicExchange:
 | 
				
			||||||
 | 
					        case glslang::EOpAtomicCompSwap:
 | 
				
			||||||
 | 
					            if (arg == 0)
 | 
				
			||||||
 | 
					                lvalue = true;
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        case glslang::EOpFrexp:
 | 
					        case glslang::EOpFrexp:
 | 
				
			||||||
            if (arg == 1)
 | 
					            if (arg == 1)
 | 
				
			||||||
@ -2685,14 +2707,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
 | 
				
			|||||||
                    invertedType = convertGlslangToSpvType(glslangOperands[0]->getAsBinaryNode()->getLeft()->getType());
 | 
					                    invertedType = convertGlslangToSpvType(glslangOperands[0]->getAsBinaryNode()->getLeft()->getType());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        case glslang::EOpAtomicAdd:
 | 
					 | 
				
			||||||
        case glslang::EOpAtomicMin:
 | 
					 | 
				
			||||||
        case glslang::EOpAtomicMax:
 | 
					 | 
				
			||||||
        case glslang::EOpAtomicAnd:
 | 
					 | 
				
			||||||
        case glslang::EOpAtomicOr:
 | 
					 | 
				
			||||||
        case glslang::EOpAtomicXor:
 | 
					 | 
				
			||||||
        case glslang::EOpAtomicExchange:
 | 
					 | 
				
			||||||
        case glslang::EOpAtomicCompSwap:
 | 
					 | 
				
			||||||
        case glslang::EOpAtomicLoad:
 | 
					        case glslang::EOpAtomicLoad:
 | 
				
			||||||
        case glslang::EOpAtomicStore:
 | 
					        case glslang::EOpAtomicStore:
 | 
				
			||||||
        case glslang::EOpAtomicCounterAdd:
 | 
					        case glslang::EOpAtomicCounterAdd:
 | 
				
			||||||
@ -2818,12 +2832,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        builder.createNoResultOp(spv::OpCooperativeMatrixStoreNV, idImmOps);
 | 
					        builder.createNoResultOp(spv::OpCooperativeMatrixStoreNV, idImmOps);
 | 
				
			||||||
        result = 0;
 | 
					        result = 0;
 | 
				
			||||||
    } else if (atomic) {
 | 
					 | 
				
			||||||
        // Handle all atomics
 | 
					 | 
				
			||||||
        result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags);
 | 
					 | 
				
			||||||
    } else
 | 
					    } else
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    {
 | 
					    if (atomic) {
 | 
				
			||||||
 | 
					        // Handle all atomics
 | 
				
			||||||
 | 
					        result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
        // Pass through to generic operations.
 | 
					        // Pass through to generic operations.
 | 
				
			||||||
        switch (glslangOperands.size()) {
 | 
					        switch (glslangOperands.size()) {
 | 
				
			||||||
        case 0:
 | 
					        case 0:
 | 
				
			||||||
@ -3535,8 +3549,8 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
 | 
				
			|||||||
                builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
 | 
					                builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
 | 
				
			||||||
                builder.addCapability(spv::CapabilityRuntimeDescriptorArrayEXT);
 | 
					                builder.addCapability(spv::CapabilityRuntimeDescriptorArrayEXT);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            spvType = builder.makeRuntimeArray(spvType);
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					            spvType = builder.makeRuntimeArray(spvType);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (stride > 0)
 | 
					        if (stride > 0)
 | 
				
			||||||
            builder.addDecoration(spvType, spv::DecorationArrayStride, stride);
 | 
					            builder.addDecoration(spvType, spv::DecorationArrayStride, stride);
 | 
				
			||||||
@ -3701,6 +3715,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
 | 
				
			|||||||
            for (unsigned int i = 0; i < memory.size(); ++i)
 | 
					            for (unsigned int i = 0; i < memory.size(); ++i)
 | 
				
			||||||
                builder.addMemberDecoration(spvType, member, memory[i]);
 | 
					                builder.addMemberDecoration(spvType, member, memory[i]);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Location assignment was already completed correctly by the front end,
 | 
					        // Location assignment was already completed correctly by the front end,
 | 
				
			||||||
@ -4159,9 +4174,11 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
 | 
				
			|||||||
            // memory and use RestrictPointer/AliasedPointer.
 | 
					            // memory and use RestrictPointer/AliasedPointer.
 | 
				
			||||||
            if (originalParam(type.getQualifier().storage, type, false) ||
 | 
					            if (originalParam(type.getQualifier().storage, type, false) ||
 | 
				
			||||||
                !writableParam(type.getQualifier().storage)) {
 | 
					                !writableParam(type.getQualifier().storage)) {
 | 
				
			||||||
                decorations.push_back(type.getQualifier().restrict ? spv::DecorationRestrict : spv::DecorationAliased);
 | 
					                decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrict :
 | 
				
			||||||
 | 
					                                                                         spv::DecorationAliased);
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                decorations.push_back(type.getQualifier().restrict ? spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT);
 | 
					                decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrictPointerEXT :
 | 
				
			||||||
 | 
					                                                                         spv::DecorationAliasedPointerEXT);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@ -4969,6 +4986,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    // nonprivate
 | 
					    // nonprivate
 | 
				
			||||||
    if (imageType.getQualifier().nonprivate) {
 | 
					    if (imageType.getQualifier().nonprivate) {
 | 
				
			||||||
        params.nonprivate = true;
 | 
					        params.nonprivate = true;
 | 
				
			||||||
@ -4978,6 +4996,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
 | 
				
			|||||||
    if (imageType.getQualifier().volatil) {
 | 
					    if (imageType.getQualifier().volatil) {
 | 
				
			||||||
        params.volatil = true;
 | 
					        params.volatil = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::vector<spv::Id> result( 1, 
 | 
					    std::vector<spv::Id> result( 1, 
 | 
				
			||||||
        builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather,
 | 
					        builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather,
 | 
				
			||||||
@ -7170,6 +7189,48 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
 | 
				
			|||||||
    case glslang::EOpRefract:
 | 
					    case glslang::EOpRefract:
 | 
				
			||||||
        libCall = spv::GLSLstd450Refract;
 | 
					        libCall = spv::GLSLstd450Refract;
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					    case glslang::EOpBarrier:
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // This is for the extended controlBarrier function, with four operands.
 | 
				
			||||||
 | 
					            // The unextended barrier() goes through createNoArgOperation.
 | 
				
			||||||
 | 
					            assert(operands.size() == 4);
 | 
				
			||||||
 | 
					            unsigned int executionScope = builder.getConstantScalar(operands[0]);
 | 
				
			||||||
 | 
					            unsigned int memoryScope = builder.getConstantScalar(operands[1]);
 | 
				
			||||||
 | 
					            unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]);
 | 
				
			||||||
 | 
					            builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
 | 
				
			||||||
 | 
					            if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
 | 
				
			||||||
 | 
					                             spv::MemorySemanticsMakeVisibleKHRMask |
 | 
				
			||||||
 | 
					                             spv::MemorySemanticsOutputMemoryKHRMask |
 | 
				
			||||||
 | 
					                             spv::MemorySemanticsVolatileMask)) {
 | 
				
			||||||
 | 
					                builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) {
 | 
				
			||||||
 | 
					                builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return 0;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					    case glslang::EOpMemoryBarrier:
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // This is for the extended memoryBarrier function, with three operands.
 | 
				
			||||||
 | 
					            // The unextended memoryBarrier() goes through createNoArgOperation.
 | 
				
			||||||
 | 
					            assert(operands.size() == 3);
 | 
				
			||||||
 | 
					            unsigned int memoryScope = builder.getConstantScalar(operands[0]);
 | 
				
			||||||
 | 
					            unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]);
 | 
				
			||||||
 | 
					            builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
 | 
				
			||||||
 | 
					            if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
 | 
				
			||||||
 | 
					                             spv::MemorySemanticsMakeVisibleKHRMask |
 | 
				
			||||||
 | 
					                             spv::MemorySemanticsOutputMemoryKHRMask |
 | 
				
			||||||
 | 
					                             spv::MemorySemanticsVolatileMask)) {
 | 
				
			||||||
 | 
					                builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) {
 | 
				
			||||||
 | 
					                builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return 0;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    case glslang::EOpInterpolateAtSample:
 | 
					    case glslang::EOpInterpolateAtSample:
 | 
				
			||||||
        if (typeProxy == glslang::EbtFloat16)
 | 
					        if (typeProxy == glslang::EbtFloat16)
 | 
				
			||||||
@ -7328,47 +7389,6 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
 | 
				
			|||||||
        extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter);
 | 
					        extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter);
 | 
				
			||||||
        libCall = spv::InterpolateAtVertexAMD;
 | 
					        libCall = spv::InterpolateAtVertexAMD;
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case glslang::EOpBarrier:
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            // This is for the extended controlBarrier function, with four operands.
 | 
					 | 
				
			||||||
            // The unextended barrier() goes through createNoArgOperation.
 | 
					 | 
				
			||||||
            assert(operands.size() == 4);
 | 
					 | 
				
			||||||
            unsigned int executionScope = builder.getConstantScalar(operands[0]);
 | 
					 | 
				
			||||||
            unsigned int memoryScope = builder.getConstantScalar(operands[1]);
 | 
					 | 
				
			||||||
            unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]);
 | 
					 | 
				
			||||||
            builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
 | 
					 | 
				
			||||||
            if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
 | 
					 | 
				
			||||||
                             spv::MemorySemanticsMakeVisibleKHRMask |
 | 
					 | 
				
			||||||
                             spv::MemorySemanticsOutputMemoryKHRMask |
 | 
					 | 
				
			||||||
                             spv::MemorySemanticsVolatileMask)) {
 | 
					 | 
				
			||||||
                builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) {
 | 
					 | 
				
			||||||
                builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
    case glslang::EOpMemoryBarrier:
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            // This is for the extended memoryBarrier function, with three operands.
 | 
					 | 
				
			||||||
            // The unextended memoryBarrier() goes through createNoArgOperation.
 | 
					 | 
				
			||||||
            assert(operands.size() == 3);
 | 
					 | 
				
			||||||
            unsigned int memoryScope = builder.getConstantScalar(operands[0]);
 | 
					 | 
				
			||||||
            unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]);
 | 
					 | 
				
			||||||
            builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
 | 
					 | 
				
			||||||
            if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
 | 
					 | 
				
			||||||
                             spv::MemorySemanticsMakeVisibleKHRMask |
 | 
					 | 
				
			||||||
                             spv::MemorySemanticsOutputMemoryKHRMask |
 | 
					 | 
				
			||||||
                             spv::MemorySemanticsVolatileMask)) {
 | 
					 | 
				
			||||||
                builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) {
 | 
					 | 
				
			||||||
                builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case glslang::EOpReportIntersectionNV:
 | 
					    case glslang::EOpReportIntersectionNV:
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -7476,17 +7496,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
 | 
				
			|||||||
// Intrinsics with no arguments (or no return value, and no precision).
 | 
					// Intrinsics with no arguments (or no return value, and no precision).
 | 
				
			||||||
spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId)
 | 
					spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    // GLSL memory barriers use queuefamily scope in new model, device scope in old model
 | 
					    // GLSL memory barriers use queuefamily scope in new model, device scope in old model
 | 
				
			||||||
    spv::Scope memoryBarrierScope = glslangIntermediate->usingVulkanMemoryModel() ? spv::ScopeQueueFamilyKHR : spv::ScopeDevice;
 | 
					    spv::Scope memoryBarrierScope = glslangIntermediate->usingVulkanMemoryModel() ? spv::ScopeQueueFamilyKHR : spv::ScopeDevice;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (op) {
 | 
					    switch (op) {
 | 
				
			||||||
    case glslang::EOpEmitVertex:
 | 
					 | 
				
			||||||
        builder.createNoResultOp(spv::OpEmitVertex);
 | 
					 | 
				
			||||||
        return 0;
 | 
					 | 
				
			||||||
    case glslang::EOpEndPrimitive:
 | 
					 | 
				
			||||||
        builder.createNoResultOp(spv::OpEndPrimitive);
 | 
					 | 
				
			||||||
        return 0;
 | 
					 | 
				
			||||||
    case glslang::EOpBarrier:
 | 
					    case glslang::EOpBarrier:
 | 
				
			||||||
        if (glslangIntermediate->getStage() == EShLangTessControl) {
 | 
					        if (glslangIntermediate->getStage() == EShLangTessControl) {
 | 
				
			||||||
            if (glslangIntermediate->usingVulkanMemoryModel()) {
 | 
					            if (glslangIntermediate->usingVulkanMemoryModel()) {
 | 
				
			||||||
@ -7507,18 +7520,10 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
 | 
				
			|||||||
        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAllMemory |
 | 
					        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAllMemory |
 | 
				
			||||||
                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
					                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
    case glslang::EOpMemoryBarrierAtomicCounter:
 | 
					 | 
				
			||||||
        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAtomicCounterMemoryMask |
 | 
					 | 
				
			||||||
                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
					 | 
				
			||||||
        return 0;
 | 
					 | 
				
			||||||
    case glslang::EOpMemoryBarrierBuffer:
 | 
					    case glslang::EOpMemoryBarrierBuffer:
 | 
				
			||||||
        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsUniformMemoryMask |
 | 
					        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsUniformMemoryMask |
 | 
				
			||||||
                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
					                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
    case glslang::EOpMemoryBarrierImage:
 | 
					 | 
				
			||||||
        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsImageMemoryMask |
 | 
					 | 
				
			||||||
                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
					 | 
				
			||||||
        return 0;
 | 
					 | 
				
			||||||
    case glslang::EOpMemoryBarrierShared:
 | 
					    case glslang::EOpMemoryBarrierShared:
 | 
				
			||||||
        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsWorkgroupMemoryMask |
 | 
					        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsWorkgroupMemoryMask |
 | 
				
			||||||
                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
					                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
				
			||||||
@ -7527,6 +7532,15 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
 | 
				
			|||||||
        builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsAllMemory |
 | 
					        builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsAllMemory |
 | 
				
			||||||
                                                         spv::MemorySemanticsAcquireReleaseMask);
 | 
					                                                         spv::MemorySemanticsAcquireReleaseMask);
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
 | 
					    case glslang::EOpMemoryBarrierAtomicCounter:
 | 
				
			||||||
 | 
					        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAtomicCounterMemoryMask |
 | 
				
			||||||
 | 
					                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					    case glslang::EOpMemoryBarrierImage:
 | 
				
			||||||
 | 
					        builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsImageMemoryMask |
 | 
				
			||||||
 | 
					                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
    case glslang::EOpAllMemoryBarrierWithGroupSync:
 | 
					    case glslang::EOpAllMemoryBarrierWithGroupSync:
 | 
				
			||||||
        builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice,
 | 
					        builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice,
 | 
				
			||||||
                                        spv::MemorySemanticsAllMemory |
 | 
					                                        spv::MemorySemanticsAllMemory |
 | 
				
			||||||
@ -7571,6 +7585,14 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
 | 
				
			|||||||
        builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsWorkgroupMemoryMask |
 | 
					        builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsWorkgroupMemoryMask |
 | 
				
			||||||
                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
					                                                        spv::MemorySemanticsAcquireReleaseMask);
 | 
				
			||||||
        return spv::NoResult;
 | 
					        return spv::NoResult;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case glslang::EOpEmitVertex:
 | 
				
			||||||
 | 
					        builder.createNoResultOp(spv::OpEmitVertex);
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					    case glslang::EOpEndPrimitive:
 | 
				
			||||||
 | 
					        builder.createNoResultOp(spv::OpEndPrimitive);
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case glslang::EOpSubgroupElect: {
 | 
					    case glslang::EOpSubgroupElect: {
 | 
				
			||||||
        std::vector<spv::Id> operands;
 | 
					        std::vector<spv::Id> operands;
 | 
				
			||||||
        return createSubgroupOperation(op, typeId, operands, glslang::EbtVoid);
 | 
					        return createSubgroupOperation(op, typeId, operands, glslang::EbtVoid);
 | 
				
			||||||
@ -7618,10 +7640,10 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
 | 
				
			|||||||
        builder.addCapability(spv::CapabilityShaderClockKHR);
 | 
					        builder.addCapability(spv::CapabilityShaderClockKHR);
 | 
				
			||||||
        return builder.createOp(spv::OpReadClockKHR, typeId, args);
 | 
					        return builder.createOp(spv::OpReadClockKHR, typeId, args);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    default:
 | 
					    default:
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    logger->missingFunctionality("unknown operation with no arguments");
 | 
					    logger->missingFunctionality("unknown operation with no arguments");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -7826,7 +7848,6 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // We now know we have a specialization constant to build
 | 
					    // We now know we have a specialization constant to build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    // gl_WorkGroupSize is a special case until the front-end handles hierarchical specialization constants,
 | 
					    // gl_WorkGroupSize is a special case until the front-end handles hierarchical specialization constants,
 | 
				
			||||||
    // even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ...
 | 
					    // even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ...
 | 
				
			||||||
    if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) {
 | 
					    if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) {
 | 
				
			||||||
@ -7841,7 +7862,6 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true);
 | 
					        return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // An AST node labelled as specialization constant should be a symbol node.
 | 
					    // An AST node labelled as specialization constant should be a symbol node.
 | 
				
			||||||
    // Its initializer should either be a sub tree with constant nodes, or a constant union array.
 | 
					    // Its initializer should either be a sub tree with constant nodes, or a constant union array.
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +1 @@
 | 
				
			|||||||
388096 ../build/install/bin/glslangValidator.exe
 | 
					396288 ../build/install/bin/glslangValidator.exe
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										157
									
								
								Test/baseResults/web.comp.out
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										157
									
								
								Test/baseResults/web.comp.out
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,157 @@
 | 
				
			|||||||
 | 
					; SPIR-V
 | 
				
			||||||
 | 
					; Version: 1.0
 | 
				
			||||||
 | 
					; Generator: Khronos Glslang Reference Front End; 7
 | 
				
			||||||
 | 
					; Bound: 108
 | 
				
			||||||
 | 
					; Schema: 0
 | 
				
			||||||
 | 
					               OpCapability Shader
 | 
				
			||||||
 | 
					          %1 = OpExtInstImport "GLSL.std.450"
 | 
				
			||||||
 | 
					               OpMemoryModel Logical GLSL450
 | 
				
			||||||
 | 
					               OpEntryPoint GLCompute %main "main" %gl_NumWorkGroups %gl_WorkGroupID %gl_LocalInvocationID %gl_GlobalInvocationID %gl_LocalInvocationIndex
 | 
				
			||||||
 | 
					               OpExecutionMode %main LocalSize 2 5 7
 | 
				
			||||||
 | 
					               OpSource ESSL 310
 | 
				
			||||||
 | 
					               OpName %main "main"
 | 
				
			||||||
 | 
					               OpName %bName "bName"
 | 
				
			||||||
 | 
					               OpMemberName %bName 0 "size"
 | 
				
			||||||
 | 
					               OpMemberName %bName 1 "count"
 | 
				
			||||||
 | 
					               OpMemberName %bName 2 "data"
 | 
				
			||||||
 | 
					               OpName %bInst "bInst"
 | 
				
			||||||
 | 
					               OpName %s "s"
 | 
				
			||||||
 | 
					               OpName %arrX "arrX"
 | 
				
			||||||
 | 
					               OpName %arrY "arrY"
 | 
				
			||||||
 | 
					               OpName %arrZ "arrZ"
 | 
				
			||||||
 | 
					               OpName %gl_NumWorkGroups "gl_NumWorkGroups"
 | 
				
			||||||
 | 
					               OpName %gl_WorkGroupID "gl_WorkGroupID"
 | 
				
			||||||
 | 
					               OpName %gl_LocalInvocationID "gl_LocalInvocationID"
 | 
				
			||||||
 | 
					               OpName %gl_GlobalInvocationID "gl_GlobalInvocationID"
 | 
				
			||||||
 | 
					               OpName %gl_LocalInvocationIndex "gl_LocalInvocationIndex"
 | 
				
			||||||
 | 
					               OpDecorate %_runtimearr_v4float ArrayStride 16
 | 
				
			||||||
 | 
					               OpMemberDecorate %bName 0 Offset 0
 | 
				
			||||||
 | 
					               OpMemberDecorate %bName 1 Offset 16
 | 
				
			||||||
 | 
					               OpMemberDecorate %bName 2 Offset 32
 | 
				
			||||||
 | 
					               OpDecorate %bName BufferBlock
 | 
				
			||||||
 | 
					               OpDecorate %bInst DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %bInst Binding 0
 | 
				
			||||||
 | 
					               OpDecorate %39 SpecId 18
 | 
				
			||||||
 | 
					               OpDecorate %41 SpecId 19
 | 
				
			||||||
 | 
					               OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
 | 
				
			||||||
 | 
					               OpDecorate %gl_NumWorkGroups BuiltIn NumWorkgroups
 | 
				
			||||||
 | 
					               OpDecorate %gl_WorkGroupID BuiltIn WorkgroupId
 | 
				
			||||||
 | 
					               OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId
 | 
				
			||||||
 | 
					               OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
 | 
				
			||||||
 | 
					               OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex
 | 
				
			||||||
 | 
					       %void = OpTypeVoid
 | 
				
			||||||
 | 
					          %3 = OpTypeFunction %void
 | 
				
			||||||
 | 
					       %uint = OpTypeInt 32 0
 | 
				
			||||||
 | 
					     %uint_2 = OpConstant %uint 2
 | 
				
			||||||
 | 
					   %uint_264 = OpConstant %uint 264
 | 
				
			||||||
 | 
					        %int = OpTypeInt 32 1
 | 
				
			||||||
 | 
					     %v3uint = OpTypeVector %uint 3
 | 
				
			||||||
 | 
					      %float = OpTypeFloat 32
 | 
				
			||||||
 | 
					    %v4float = OpTypeVector %float 4
 | 
				
			||||||
 | 
					%_runtimearr_v4float = OpTypeRuntimeArray %v4float
 | 
				
			||||||
 | 
					      %bName = OpTypeStruct %int %v3uint %_runtimearr_v4float
 | 
				
			||||||
 | 
					%_ptr_Uniform_bName = OpTypePointer Uniform %bName
 | 
				
			||||||
 | 
					      %bInst = OpVariable %_ptr_Uniform_bName Uniform
 | 
				
			||||||
 | 
					      %int_2 = OpConstant %int 2
 | 
				
			||||||
 | 
					      %int_0 = OpConstant %int 0
 | 
				
			||||||
 | 
					%_ptr_Uniform_int = OpTypePointer Uniform %int
 | 
				
			||||||
 | 
					    %float_7 = OpConstant %float 7
 | 
				
			||||||
 | 
					         %24 = OpConstantComposite %v4float %float_7 %float_7 %float_7 %float_7
 | 
				
			||||||
 | 
					%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 | 
				
			||||||
 | 
					     %uint_1 = OpConstant %uint 1
 | 
				
			||||||
 | 
					  %uint_3400 = OpConstant %uint 3400
 | 
				
			||||||
 | 
					    %uint_72 = OpConstant %uint 72
 | 
				
			||||||
 | 
					%uint_197645 = OpConstant %uint 197645
 | 
				
			||||||
 | 
					%_arr_v4float_uint_197645 = OpTypeArray %v4float %uint_197645
 | 
				
			||||||
 | 
					%_ptr_Workgroup__arr_v4float_uint_197645 = OpTypePointer Workgroup %_arr_v4float_uint_197645
 | 
				
			||||||
 | 
					          %s = OpVariable %_ptr_Workgroup__arr_v4float_uint_197645 Workgroup
 | 
				
			||||||
 | 
					      %int_3 = OpConstant %int 3
 | 
				
			||||||
 | 
					    %float_0 = OpConstant %float 0
 | 
				
			||||||
 | 
					         %39 = OpSpecConstant %uint 2
 | 
				
			||||||
 | 
					     %uint_5 = OpConstant %uint 5
 | 
				
			||||||
 | 
					         %41 = OpSpecConstant %uint 7
 | 
				
			||||||
 | 
					%gl_WorkGroupSize = OpSpecConstantComposite %v3uint %39 %uint_5 %41
 | 
				
			||||||
 | 
					     %uint_0 = OpConstant %uint 0
 | 
				
			||||||
 | 
					%_arr_int_44 = OpTypeArray %int %44
 | 
				
			||||||
 | 
					%_ptr_Private__arr_int_44 = OpTypePointer Private %_arr_int_44
 | 
				
			||||||
 | 
					       %arrX = OpVariable %_ptr_Private__arr_int_44 Private
 | 
				
			||||||
 | 
					%_ptr_Private_int = OpTypePointer Private %int
 | 
				
			||||||
 | 
					%_arr_int_52 = OpTypeArray %int %52
 | 
				
			||||||
 | 
					%_ptr_Private__arr_int_52 = OpTypePointer Private %_arr_int_52
 | 
				
			||||||
 | 
					       %arrY = OpVariable %_ptr_Private__arr_int_52 Private
 | 
				
			||||||
 | 
					%_arr_int_59 = OpTypeArray %int %59
 | 
				
			||||||
 | 
					%_ptr_Private__arr_int_59 = OpTypePointer Private %_arr_int_59
 | 
				
			||||||
 | 
					       %arrZ = OpVariable %_ptr_Private__arr_int_59 Private
 | 
				
			||||||
 | 
					%_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
 | 
				
			||||||
 | 
					      %int_1 = OpConstant %int 1
 | 
				
			||||||
 | 
					%_ptr_Input_v3uint = OpTypePointer Input %v3uint
 | 
				
			||||||
 | 
					%gl_NumWorkGroups = OpVariable %_ptr_Input_v3uint Input
 | 
				
			||||||
 | 
					%gl_WorkGroupID = OpVariable %_ptr_Input_v3uint Input
 | 
				
			||||||
 | 
					%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input
 | 
				
			||||||
 | 
					%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
 | 
				
			||||||
 | 
					%_ptr_Input_uint = OpTypePointer Input %uint
 | 
				
			||||||
 | 
					%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input
 | 
				
			||||||
 | 
					%_ptr_Uniform_v3uint = OpTypePointer Uniform %v3uint
 | 
				
			||||||
 | 
					      %int_5 = OpConstant %int 5
 | 
				
			||||||
 | 
					 %int_197645 = OpConstant %int 197645
 | 
				
			||||||
 | 
					       %main = OpFunction %void None %3
 | 
				
			||||||
 | 
					          %5 = OpLabel
 | 
				
			||||||
 | 
					               OpControlBarrier %uint_2 %uint_2 %uint_264
 | 
				
			||||||
 | 
					         %20 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					         %21 = OpLoad %int %20
 | 
				
			||||||
 | 
					         %22 = OpSDiv %int %21 %int_2
 | 
				
			||||||
 | 
					         %26 = OpAccessChain %_ptr_Uniform_v4float %bInst %int_2 %22
 | 
				
			||||||
 | 
					         %27 = OpLoad %v4float %26
 | 
				
			||||||
 | 
					         %28 = OpFMul %v4float %27 %24
 | 
				
			||||||
 | 
					         %29 = OpAccessChain %_ptr_Uniform_v4float %bInst %int_2 %22
 | 
				
			||||||
 | 
					               OpStore %29 %28
 | 
				
			||||||
 | 
					               OpMemoryBarrier %uint_1 %uint_3400
 | 
				
			||||||
 | 
					               OpMemoryBarrier %uint_2 %uint_3400
 | 
				
			||||||
 | 
					               OpMemoryBarrier %uint_1 %uint_264
 | 
				
			||||||
 | 
					               OpMemoryBarrier %uint_1 %uint_72
 | 
				
			||||||
 | 
					         %44 = OpCompositeExtract %uint %gl_WorkGroupSize 0
 | 
				
			||||||
 | 
					         %49 = OpAccessChain %_ptr_Private_int %arrX %int_0
 | 
				
			||||||
 | 
					         %50 = OpLoad %int %49
 | 
				
			||||||
 | 
					         %51 = OpConvertSToF %float %50
 | 
				
			||||||
 | 
					         %52 = OpCompositeExtract %uint %gl_WorkGroupSize 1
 | 
				
			||||||
 | 
					         %56 = OpAccessChain %_ptr_Private_int %arrY %int_0
 | 
				
			||||||
 | 
					         %57 = OpLoad %int %56
 | 
				
			||||||
 | 
					         %58 = OpConvertSToF %float %57
 | 
				
			||||||
 | 
					         %59 = OpCompositeExtract %uint %gl_WorkGroupSize 2
 | 
				
			||||||
 | 
					         %63 = OpAccessChain %_ptr_Private_int %arrZ %int_0
 | 
				
			||||||
 | 
					         %64 = OpLoad %int %63
 | 
				
			||||||
 | 
					         %65 = OpConvertSToF %float %64
 | 
				
			||||||
 | 
					         %66 = OpCompositeConstruct %v4float %float_0 %51 %58 %65
 | 
				
			||||||
 | 
					         %68 = OpAccessChain %_ptr_Workgroup_v4float %s %int_3
 | 
				
			||||||
 | 
					               OpStore %68 %66
 | 
				
			||||||
 | 
					         %72 = OpLoad %v3uint %gl_NumWorkGroups
 | 
				
			||||||
 | 
					         %73 = OpIAdd %v3uint %72 %gl_WorkGroupSize
 | 
				
			||||||
 | 
					         %75 = OpLoad %v3uint %gl_WorkGroupID
 | 
				
			||||||
 | 
					         %76 = OpIAdd %v3uint %73 %75
 | 
				
			||||||
 | 
					         %78 = OpLoad %v3uint %gl_LocalInvocationID
 | 
				
			||||||
 | 
					         %79 = OpIAdd %v3uint %76 %78
 | 
				
			||||||
 | 
					         %81 = OpLoad %v3uint %gl_GlobalInvocationID
 | 
				
			||||||
 | 
					         %84 = OpLoad %uint %gl_LocalInvocationIndex
 | 
				
			||||||
 | 
					         %85 = OpCompositeConstruct %v3uint %84 %84 %84
 | 
				
			||||||
 | 
					         %86 = OpIMul %v3uint %81 %85
 | 
				
			||||||
 | 
					         %87 = OpIAdd %v3uint %79 %86
 | 
				
			||||||
 | 
					         %89 = OpAccessChain %_ptr_Uniform_v3uint %bInst %int_1
 | 
				
			||||||
 | 
					               OpStore %89 %87
 | 
				
			||||||
 | 
					         %90 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					         %91 = OpAtomicIAdd %int %90 %uint_1 %uint_0 %int_2
 | 
				
			||||||
 | 
					         %92 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					         %93 = OpAtomicSMin %int %92 %uint_1 %uint_0 %int_2
 | 
				
			||||||
 | 
					         %94 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					         %95 = OpAtomicSMax %int %94 %uint_1 %uint_0 %int_2
 | 
				
			||||||
 | 
					         %96 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					         %97 = OpAtomicAnd %int %96 %uint_1 %uint_0 %int_2
 | 
				
			||||||
 | 
					         %98 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					         %99 = OpAtomicOr %int %98 %uint_1 %uint_0 %int_2
 | 
				
			||||||
 | 
					        %100 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					        %101 = OpAtomicXor %int %100 %uint_1 %uint_0 %int_2
 | 
				
			||||||
 | 
					        %102 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					        %103 = OpAtomicExchange %int %102 %uint_1 %uint_0 %int_2
 | 
				
			||||||
 | 
					        %104 = OpAccessChain %_ptr_Uniform_int %bInst %int_0
 | 
				
			||||||
 | 
					        %106 = OpAtomicCompareExchange %int %104 %uint_1 %uint_0 %uint_0 %int_2 %int_5
 | 
				
			||||||
 | 
					               OpReturn
 | 
				
			||||||
 | 
					               OpFunctionEnd
 | 
				
			||||||
							
								
								
									
										178
									
								
								Test/baseResults/web.separate.frag.out
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										178
									
								
								Test/baseResults/web.separate.frag.out
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,178 @@
 | 
				
			|||||||
 | 
					; SPIR-V
 | 
				
			||||||
 | 
					; Version: 1.0
 | 
				
			||||||
 | 
					; Generator: Khronos Glslang Reference Front End; 7
 | 
				
			||||||
 | 
					; Bound: 99
 | 
				
			||||||
 | 
					; Schema: 0
 | 
				
			||||||
 | 
					               OpCapability Shader
 | 
				
			||||||
 | 
					          %1 = OpExtInstImport "GLSL.std.450"
 | 
				
			||||||
 | 
					               OpMemoryModel Logical GLSL450
 | 
				
			||||||
 | 
					               OpEntryPoint Fragment %main "main" %color %i
 | 
				
			||||||
 | 
					               OpExecutionMode %main OriginUpperLeft
 | 
				
			||||||
 | 
					               OpSource ESSL 310
 | 
				
			||||||
 | 
					               OpName %main "main"
 | 
				
			||||||
 | 
					               OpName %color "color"
 | 
				
			||||||
 | 
					               OpName %t2d "t2d"
 | 
				
			||||||
 | 
					               OpName %s "s"
 | 
				
			||||||
 | 
					               OpName %t3d "t3d"
 | 
				
			||||||
 | 
					               OpName %sA "sA"
 | 
				
			||||||
 | 
					               OpName %sShadow "sShadow"
 | 
				
			||||||
 | 
					               OpName %i "i"
 | 
				
			||||||
 | 
					               OpName %tex2D "tex2D"
 | 
				
			||||||
 | 
					               OpName %texCube "texCube"
 | 
				
			||||||
 | 
					               OpName %tex2DArray "tex2DArray"
 | 
				
			||||||
 | 
					               OpName %itex2D "itex2D"
 | 
				
			||||||
 | 
					               OpName %itex3D "itex3D"
 | 
				
			||||||
 | 
					               OpName %itexCube "itexCube"
 | 
				
			||||||
 | 
					               OpName %itex2DArray "itex2DArray"
 | 
				
			||||||
 | 
					               OpName %utex2D "utex2D"
 | 
				
			||||||
 | 
					               OpName %utex3D "utex3D"
 | 
				
			||||||
 | 
					               OpName %utexCube "utexCube"
 | 
				
			||||||
 | 
					               OpName %utex2DArray "utex2DArray"
 | 
				
			||||||
 | 
					               OpName %tex3D "tex3D"
 | 
				
			||||||
 | 
					               OpDecorate %color Location 0
 | 
				
			||||||
 | 
					               OpDecorate %t2d RelaxedPrecision
 | 
				
			||||||
 | 
					               OpDecorate %t2d DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %t2d Binding 3
 | 
				
			||||||
 | 
					               OpDecorate %14 RelaxedPrecision
 | 
				
			||||||
 | 
					               OpDecorate %s DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %s Binding 0
 | 
				
			||||||
 | 
					               OpDecorate %23 RelaxedPrecision
 | 
				
			||||||
 | 
					               OpDecorate %t3d DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %t3d Binding 4
 | 
				
			||||||
 | 
					               OpDecorate %sA DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %sA Binding 2
 | 
				
			||||||
 | 
					               OpDecorate %48 RelaxedPrecision
 | 
				
			||||||
 | 
					               OpDecorate %51 RelaxedPrecision
 | 
				
			||||||
 | 
					               OpDecorate %sShadow DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %sShadow Binding 1
 | 
				
			||||||
 | 
					               OpDecorate %i RelaxedPrecision
 | 
				
			||||||
 | 
					               OpDecorate %i Flat
 | 
				
			||||||
 | 
					               OpDecorate %i Location 0
 | 
				
			||||||
 | 
					               OpDecorate %tex2D RelaxedPrecision
 | 
				
			||||||
 | 
					               OpDecorate %tex2D DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %tex2D Binding 5
 | 
				
			||||||
 | 
					               OpDecorate %texCube RelaxedPrecision
 | 
				
			||||||
 | 
					               OpDecorate %texCube DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %texCube Binding 6
 | 
				
			||||||
 | 
					               OpDecorate %tex2DArray DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %tex2DArray Binding 15
 | 
				
			||||||
 | 
					               OpDecorate %itex2D DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %itex2D Binding 16
 | 
				
			||||||
 | 
					               OpDecorate %itex3D DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %itex3D Binding 17
 | 
				
			||||||
 | 
					               OpDecorate %itexCube DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %itexCube Binding 18
 | 
				
			||||||
 | 
					               OpDecorate %itex2DArray DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %itex2DArray Binding 19
 | 
				
			||||||
 | 
					               OpDecorate %utex2D DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %utex2D Binding 20
 | 
				
			||||||
 | 
					               OpDecorate %utex3D DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %utex3D Binding 21
 | 
				
			||||||
 | 
					               OpDecorate %utexCube DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %utexCube Binding 22
 | 
				
			||||||
 | 
					               OpDecorate %utex2DArray DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %utex2DArray Binding 23
 | 
				
			||||||
 | 
					               OpDecorate %tex3D DescriptorSet 0
 | 
				
			||||||
 | 
					               OpDecorate %tex3D Binding 36
 | 
				
			||||||
 | 
					       %void = OpTypeVoid
 | 
				
			||||||
 | 
					          %3 = OpTypeFunction %void
 | 
				
			||||||
 | 
					      %float = OpTypeFloat 32
 | 
				
			||||||
 | 
					    %v4float = OpTypeVector %float 4
 | 
				
			||||||
 | 
					%_ptr_Output_v4float = OpTypePointer Output %v4float
 | 
				
			||||||
 | 
					      %color = OpVariable %_ptr_Output_v4float Output
 | 
				
			||||||
 | 
					         %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %11 = OpTypeSampledImage %10
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
 | 
				
			||||||
 | 
					        %t2d = OpVariable %_ptr_UniformConstant_11 UniformConstant
 | 
				
			||||||
 | 
					         %15 = OpTypeSampler
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
 | 
				
			||||||
 | 
					          %s = OpVariable %_ptr_UniformConstant_15 UniformConstant
 | 
				
			||||||
 | 
					    %v2float = OpTypeVector %float 2
 | 
				
			||||||
 | 
					  %float_0_5 = OpConstant %float 0.5
 | 
				
			||||||
 | 
					         %22 = OpConstantComposite %v2float %float_0_5 %float_0_5
 | 
				
			||||||
 | 
					         %24 = OpTypeImage %float 3D 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %25 = OpTypeSampledImage %24
 | 
				
			||||||
 | 
					       %uint = OpTypeInt 32 0
 | 
				
			||||||
 | 
					     %uint_4 = OpConstant %uint 4
 | 
				
			||||||
 | 
					%_arr_25_uint_4 = OpTypeArray %25 %uint_4
 | 
				
			||||||
 | 
					%_ptr_UniformConstant__arr_25_uint_4 = OpTypePointer UniformConstant %_arr_25_uint_4
 | 
				
			||||||
 | 
					        %t3d = OpVariable %_ptr_UniformConstant__arr_25_uint_4 UniformConstant
 | 
				
			||||||
 | 
					        %int = OpTypeInt 32 1
 | 
				
			||||||
 | 
					      %int_1 = OpConstant %int 1
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
 | 
				
			||||||
 | 
					%_arr_15_uint_4 = OpTypeArray %15 %uint_4
 | 
				
			||||||
 | 
					%_ptr_UniformConstant__arr_15_uint_4 = OpTypePointer UniformConstant %_arr_15_uint_4
 | 
				
			||||||
 | 
					         %sA = OpVariable %_ptr_UniformConstant__arr_15_uint_4 UniformConstant
 | 
				
			||||||
 | 
					      %int_2 = OpConstant %int 2
 | 
				
			||||||
 | 
					    %v3float = OpTypeVector %float 3
 | 
				
			||||||
 | 
					         %44 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
 | 
				
			||||||
 | 
					    %sShadow = OpVariable %_ptr_UniformConstant_15 UniformConstant
 | 
				
			||||||
 | 
					%_ptr_Input_int = OpTypePointer Input %int
 | 
				
			||||||
 | 
					          %i = OpVariable %_ptr_Input_int Input
 | 
				
			||||||
 | 
					      %tex2D = OpVariable %_ptr_UniformConstant_11 UniformConstant
 | 
				
			||||||
 | 
					         %58 = OpTypeImage %float Cube 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %59 = OpTypeSampledImage %58
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_59 = OpTypePointer UniformConstant %59
 | 
				
			||||||
 | 
					    %texCube = OpVariable %_ptr_UniformConstant_59 UniformConstant
 | 
				
			||||||
 | 
					         %62 = OpTypeImage %float 2D 0 1 0 1 Unknown
 | 
				
			||||||
 | 
					         %63 = OpTypeSampledImage %62
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_63 = OpTypePointer UniformConstant %63
 | 
				
			||||||
 | 
					 %tex2DArray = OpVariable %_ptr_UniformConstant_63 UniformConstant
 | 
				
			||||||
 | 
					         %66 = OpTypeImage %int 2D 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %67 = OpTypeSampledImage %66
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_67 = OpTypePointer UniformConstant %67
 | 
				
			||||||
 | 
					     %itex2D = OpVariable %_ptr_UniformConstant_67 UniformConstant
 | 
				
			||||||
 | 
					         %70 = OpTypeImage %int 3D 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %71 = OpTypeSampledImage %70
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_71 = OpTypePointer UniformConstant %71
 | 
				
			||||||
 | 
					     %itex3D = OpVariable %_ptr_UniformConstant_71 UniformConstant
 | 
				
			||||||
 | 
					         %74 = OpTypeImage %int Cube 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %75 = OpTypeSampledImage %74
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_75 = OpTypePointer UniformConstant %75
 | 
				
			||||||
 | 
					   %itexCube = OpVariable %_ptr_UniformConstant_75 UniformConstant
 | 
				
			||||||
 | 
					         %78 = OpTypeImage %int 2D 0 1 0 1 Unknown
 | 
				
			||||||
 | 
					         %79 = OpTypeSampledImage %78
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_79 = OpTypePointer UniformConstant %79
 | 
				
			||||||
 | 
					%itex2DArray = OpVariable %_ptr_UniformConstant_79 UniformConstant
 | 
				
			||||||
 | 
					         %82 = OpTypeImage %uint 2D 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %83 = OpTypeSampledImage %82
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_83 = OpTypePointer UniformConstant %83
 | 
				
			||||||
 | 
					     %utex2D = OpVariable %_ptr_UniformConstant_83 UniformConstant
 | 
				
			||||||
 | 
					         %86 = OpTypeImage %uint 3D 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %87 = OpTypeSampledImage %86
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_87 = OpTypePointer UniformConstant %87
 | 
				
			||||||
 | 
					     %utex3D = OpVariable %_ptr_UniformConstant_87 UniformConstant
 | 
				
			||||||
 | 
					         %90 = OpTypeImage %uint Cube 0 0 0 1 Unknown
 | 
				
			||||||
 | 
					         %91 = OpTypeSampledImage %90
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_91 = OpTypePointer UniformConstant %91
 | 
				
			||||||
 | 
					   %utexCube = OpVariable %_ptr_UniformConstant_91 UniformConstant
 | 
				
			||||||
 | 
					         %94 = OpTypeImage %uint 2D 0 1 0 1 Unknown
 | 
				
			||||||
 | 
					         %95 = OpTypeSampledImage %94
 | 
				
			||||||
 | 
					%_ptr_UniformConstant_95 = OpTypePointer UniformConstant %95
 | 
				
			||||||
 | 
					%utex2DArray = OpVariable %_ptr_UniformConstant_95 UniformConstant
 | 
				
			||||||
 | 
					      %tex3D = OpVariable %_ptr_UniformConstant_25 UniformConstant
 | 
				
			||||||
 | 
					       %main = OpFunction %void None %3
 | 
				
			||||||
 | 
					          %5 = OpLabel
 | 
				
			||||||
 | 
					         %14 = OpLoad %11 %t2d
 | 
				
			||||||
 | 
					         %18 = OpLoad %15 %s
 | 
				
			||||||
 | 
					         %19 = OpSampledImage %11 %14 %18
 | 
				
			||||||
 | 
					         %23 = OpImageSampleImplicitLod %v4float %19 %22
 | 
				
			||||||
 | 
					               OpStore %color %23
 | 
				
			||||||
 | 
					         %34 = OpAccessChain %_ptr_UniformConstant_25 %t3d %int_1
 | 
				
			||||||
 | 
					         %35 = OpLoad %25 %34
 | 
				
			||||||
 | 
					         %40 = OpAccessChain %_ptr_UniformConstant_15 %sA %int_2
 | 
				
			||||||
 | 
					         %41 = OpLoad %15 %40
 | 
				
			||||||
 | 
					         %42 = OpSampledImage %25 %35 %41
 | 
				
			||||||
 | 
					         %45 = OpImageSampleImplicitLod %v4float %42 %44
 | 
				
			||||||
 | 
					         %46 = OpLoad %v4float %color
 | 
				
			||||||
 | 
					         %47 = OpFAdd %v4float %46 %45
 | 
				
			||||||
 | 
					               OpStore %color %47
 | 
				
			||||||
 | 
					         %48 = OpLoad %11 %t2d
 | 
				
			||||||
 | 
					         %49 = OpLoad %15 %s
 | 
				
			||||||
 | 
					         %50 = OpSampledImage %11 %48 %49
 | 
				
			||||||
 | 
					         %51 = OpImageSampleImplicitLod %v4float %50 %22
 | 
				
			||||||
 | 
					         %52 = OpLoad %v4float %color
 | 
				
			||||||
 | 
					         %53 = OpFAdd %v4float %52 %51
 | 
				
			||||||
 | 
					               OpStore %color %53
 | 
				
			||||||
 | 
					               OpReturn
 | 
				
			||||||
 | 
					               OpFunctionEnd
 | 
				
			||||||
							
								
								
									
										50
									
								
								Test/web.comp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								Test/web.comp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
				
			|||||||
 | 
					#version 310 es
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					layout(local_size_x_id = 18, local_size_z_id = 19) in;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					layout(local_size_x = 2) in;
 | 
				
			||||||
 | 
					layout(local_size_y = 5) in;
 | 
				
			||||||
 | 
					layout(local_size_z = 7) in;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const int total = gl_MaxComputeWorkGroupCount.x
 | 
				
			||||||
 | 
					                + gl_MaxComputeWorkGroupCount.y
 | 
				
			||||||
 | 
					                + gl_MaxComputeWorkGroupCount.z
 | 
				
			||||||
 | 
					                + gl_MaxComputeUniformComponents
 | 
				
			||||||
 | 
					                + gl_MaxComputeTextureImageUnits;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					shared vec4 s[total];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int arrX[gl_WorkGroupSize.x];
 | 
				
			||||||
 | 
					int arrY[gl_WorkGroupSize.y];
 | 
				
			||||||
 | 
					int arrZ[gl_WorkGroupSize.z];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					layout(binding = 0, set = 0) buffer bName {
 | 
				
			||||||
 | 
					    int size;
 | 
				
			||||||
 | 
					    uvec3 count;
 | 
				
			||||||
 | 
					    vec4 data[];
 | 
				
			||||||
 | 
					} bInst;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    barrier();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bInst.data[bInst.size / 2] *= vec4(7.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    memoryBarrier();
 | 
				
			||||||
 | 
					    groupMemoryBarrier();
 | 
				
			||||||
 | 
					    memoryBarrierShared();
 | 
				
			||||||
 | 
					    memoryBarrierBuffer();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    s[3] = vec4(0, arrX[0], arrY[0], arrZ[0]);
 | 
				
			||||||
 | 
					    bInst.count = gl_NumWorkGroups + gl_WorkGroupSize + gl_WorkGroupID + gl_LocalInvocationID +
 | 
				
			||||||
 | 
					                  gl_GlobalInvocationID * gl_LocalInvocationIndex;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    atomicAdd(bInst.size, 2);
 | 
				
			||||||
 | 
					    atomicMin(bInst.size, 2);
 | 
				
			||||||
 | 
					    atomicMax(bInst.size, 2);
 | 
				
			||||||
 | 
					    atomicAnd(bInst.size, 2);
 | 
				
			||||||
 | 
					    atomicOr(bInst.size, 2);
 | 
				
			||||||
 | 
					    atomicXor(bInst.size, 2);
 | 
				
			||||||
 | 
					    atomicExchange(bInst.size, 2);
 | 
				
			||||||
 | 
					    atomicCompSwap(bInst.size, 5, 2);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										63
									
								
								Test/web.separate.frag
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								Test/web.separate.frag
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,63 @@
 | 
				
			|||||||
 | 
					#version 310 es
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					precision highp sampler;
 | 
				
			||||||
 | 
					precision highp samplerShadow;
 | 
				
			||||||
 | 
					precision highp texture2DArray;
 | 
				
			||||||
 | 
					precision highp itexture2D;
 | 
				
			||||||
 | 
					precision highp itexture3D;
 | 
				
			||||||
 | 
					precision highp itextureCube;
 | 
				
			||||||
 | 
					precision highp itexture2DArray;
 | 
				
			||||||
 | 
					precision highp utexture2D;
 | 
				
			||||||
 | 
					precision highp utexture3D;
 | 
				
			||||||
 | 
					precision highp utextureCube;
 | 
				
			||||||
 | 
					precision highp utexture2DArray;
 | 
				
			||||||
 | 
					precision highp texture3D;
 | 
				
			||||||
 | 
					precision highp float;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					layout(binding = 0) uniform sampler s;
 | 
				
			||||||
 | 
					layout(binding = 1) uniform samplerShadow sShadow;
 | 
				
			||||||
 | 
					layout(binding = 2) uniform sampler sA[4];
 | 
				
			||||||
 | 
					layout(binding = 3) uniform texture2D t2d;
 | 
				
			||||||
 | 
					layout(binding = 4) uniform texture3D t3d[4];
 | 
				
			||||||
 | 
					layout(location = 0) flat in int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					layout(location = 0) out vec4 color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    color = texture(sampler2D(t2d, s), vec2(0.5));
 | 
				
			||||||
 | 
					    color += texture(sampler3D(t3d[1], sA[2]), vec3(0.5));
 | 
				
			||||||
 | 
					    color += texture(sampler2D(t2d, s), vec2(0.5));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					layout(binding =  5) uniform texture2D                 tex2D;
 | 
				
			||||||
 | 
					layout(binding =  6) uniform textureCube               texCube;
 | 
				
			||||||
 | 
					layout(binding = 15) uniform texture2DArray            tex2DArray;
 | 
				
			||||||
 | 
					layout(binding = 16) uniform itexture2D                itex2D;
 | 
				
			||||||
 | 
					layout(binding = 17) uniform itexture3D                itex3D;
 | 
				
			||||||
 | 
					layout(binding = 18) uniform itextureCube              itexCube;
 | 
				
			||||||
 | 
					layout(binding = 19) uniform itexture2DArray           itex2DArray;
 | 
				
			||||||
 | 
					layout(binding = 20) uniform utexture2D                utex2D;
 | 
				
			||||||
 | 
					layout(binding = 21) uniform utexture3D                utex3D;
 | 
				
			||||||
 | 
					layout(binding = 22) uniform utextureCube              utexCube;
 | 
				
			||||||
 | 
					layout(binding = 23) uniform utexture2DArray           utex2DArray;
 | 
				
			||||||
 | 
					layout(binding = 36) uniform texture3D                 tex3D;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void foo()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    sampler2D              (tex2D, s);
 | 
				
			||||||
 | 
					    samplerCube            (texCube, s);
 | 
				
			||||||
 | 
					    samplerCubeShadow      (texCube, sShadow);
 | 
				
			||||||
 | 
					    sampler2DArray         (tex2DArray, s);
 | 
				
			||||||
 | 
					    sampler2DArrayShadow   (tex2DArray, sShadow);
 | 
				
			||||||
 | 
					    isampler2D             (itex2D, s);
 | 
				
			||||||
 | 
					    isampler3D             (itex3D, s);
 | 
				
			||||||
 | 
					    isamplerCube           (itexCube, s);
 | 
				
			||||||
 | 
					    isampler2DArray        (itex2DArray, s);
 | 
				
			||||||
 | 
					    usampler2D             (utex2D, s);
 | 
				
			||||||
 | 
					    usampler3D             (utex3D, s);
 | 
				
			||||||
 | 
					    usamplerCube           (utexCube, s);
 | 
				
			||||||
 | 
					    usampler2DArray        (utex2DArray, s);
 | 
				
			||||||
 | 
					    sampler3D              (tex3D, s);
 | 
				
			||||||
 | 
					    sampler2DShadow        (tex2D, sShadow);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -5,3 +5,5 @@ web.controlFlow.frag
 | 
				
			|||||||
web.operations.frag
 | 
					web.operations.frag
 | 
				
			||||||
web.texture.frag
 | 
					web.texture.frag
 | 
				
			||||||
web.array.frag
 | 
					web.array.frag
 | 
				
			||||||
 | 
					web.separate.frag
 | 
				
			||||||
 | 
					web.comp
 | 
				
			||||||
 | 
				
			|||||||
@ -79,6 +79,7 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 | 
				
			|||||||
    bool         ms : 1;
 | 
					    bool         ms : 1;
 | 
				
			||||||
    bool      image : 1;  // image, combined should be false
 | 
					    bool      image : 1;  // image, combined should be false
 | 
				
			||||||
    bool   combined : 1;  // true means texture is combined with a sampler, false means texture with no sampler
 | 
					    bool   combined : 1;  // true means texture is combined with a sampler, false means texture with no sampler
 | 
				
			||||||
 | 
					    bool    sampler : 1;  // true means a pure sampler, other fields should be clear()
 | 
				
			||||||
#ifdef ENABLE_HLSL
 | 
					#ifdef ENABLE_HLSL
 | 
				
			||||||
    unsigned int vectorSize : 3;  // vector return type size.
 | 
					    unsigned int vectorSize : 3;  // vector return type size.
 | 
				
			||||||
    unsigned int getVectorSize() const { return vectorSize; }
 | 
					    unsigned int getVectorSize() const { return vectorSize; }
 | 
				
			||||||
@ -105,8 +106,6 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 | 
				
			|||||||
    bool isRect()        const { return false; }
 | 
					    bool isRect()        const { return false; }
 | 
				
			||||||
    bool isSubpass()     const { return false; }
 | 
					    bool isSubpass()     const { return false; }
 | 
				
			||||||
    bool isCombined()    const { return true; }
 | 
					    bool isCombined()    const { return true; }
 | 
				
			||||||
    bool isPureSampler() const { return false; }
 | 
					 | 
				
			||||||
    bool isTexture()     const { return false; }
 | 
					 | 
				
			||||||
    bool isImage()       const { return false; }
 | 
					    bool isImage()       const { return false; }
 | 
				
			||||||
    bool isImageClass()  const { return false; }
 | 
					    bool isImageClass()  const { return false; }
 | 
				
			||||||
    bool isMultiSample() const { return false; }
 | 
					    bool isMultiSample() const { return false; }
 | 
				
			||||||
@ -114,7 +113,6 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 | 
				
			|||||||
    void setExternal(bool e) { }
 | 
					    void setExternal(bool e) { }
 | 
				
			||||||
    bool isYuv()         const { return false; }
 | 
					    bool isYuv()         const { return false; }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    bool    sampler : 1;  // true means a pure sampler, other fields should be clear()
 | 
					 | 
				
			||||||
    bool   external : 1;  // GL_OES_EGL_image_external
 | 
					    bool   external : 1;  // GL_OES_EGL_image_external
 | 
				
			||||||
    bool        yuv : 1;  // GL_EXT_YUV_target
 | 
					    bool        yuv : 1;  // GL_EXT_YUV_target
 | 
				
			||||||
    // Some languages support structures as sample results.  Storing the whole structure in the
 | 
					    // Some languages support structures as sample results.  Storing the whole structure in the
 | 
				
			||||||
@ -125,8 +123,6 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 | 
				
			|||||||
    bool isRect()        const { return dim == EsdRect; }
 | 
					    bool isRect()        const { return dim == EsdRect; }
 | 
				
			||||||
    bool isSubpass()     const { return dim == EsdSubpass; }
 | 
					    bool isSubpass()     const { return dim == EsdSubpass; }
 | 
				
			||||||
    bool isCombined()    const { return combined; }
 | 
					    bool isCombined()    const { return combined; }
 | 
				
			||||||
    bool isPureSampler() const { return sampler; }
 | 
					 | 
				
			||||||
    bool isTexture()     const { return !sampler && !image; }
 | 
					 | 
				
			||||||
    bool isImage()       const { return image && !isSubpass(); }
 | 
					    bool isImage()       const { return image && !isSubpass(); }
 | 
				
			||||||
    bool isImageClass()  const { return image; }
 | 
					    bool isImageClass()  const { return image; }
 | 
				
			||||||
    bool isMultiSample() const { return ms; }
 | 
					    bool isMultiSample() const { return ms; }
 | 
				
			||||||
@ -134,6 +130,9 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 | 
				
			|||||||
    void setExternal(bool e) { external = e; }
 | 
					    void setExternal(bool e) { external = e; }
 | 
				
			||||||
    bool isYuv()         const { return yuv; }
 | 
					    bool isYuv()         const { return yuv; }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					    bool isTexture()     const { return !sampler && !image; }
 | 
				
			||||||
 | 
					    bool isPureSampler() const { return sampler; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setCombined(bool c) { combined = c; }
 | 
					    void setCombined(bool c) { combined = c; }
 | 
				
			||||||
    void setBasicType(TBasicType t) { type = t; }
 | 
					    void setBasicType(TBasicType t) { type = t; }
 | 
				
			||||||
    TBasicType getBasicType()  const { return type; }
 | 
					    TBasicType getBasicType()  const { return type; }
 | 
				
			||||||
@ -149,8 +148,8 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 | 
				
			|||||||
        ms = false;
 | 
					        ms = false;
 | 
				
			||||||
        image = false;
 | 
					        image = false;
 | 
				
			||||||
        combined = false;
 | 
					        combined = false;
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
        sampler = false;
 | 
					        sampler = false;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        external = false;
 | 
					        external = false;
 | 
				
			||||||
        yuv = false;
 | 
					        yuv = false;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@ -197,6 +196,14 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 | 
				
			|||||||
        ms = m;
 | 
					        ms = m;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword
 | 
				
			||||||
 | 
					    void setPureSampler(bool s)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        clear();
 | 
				
			||||||
 | 
					        sampler = true;
 | 
				
			||||||
 | 
					        shadow = s;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    // make a subpass input attachment
 | 
					    // make a subpass input attachment
 | 
				
			||||||
    void setSubpass(TBasicType t, bool m = false)
 | 
					    void setSubpass(TBasicType t, bool m = false)
 | 
				
			||||||
@ -207,14 +214,6 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 | 
				
			|||||||
        dim = EsdSubpass;
 | 
					        dim = EsdSubpass;
 | 
				
			||||||
        ms = m;
 | 
					        ms = m;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    // make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword
 | 
					 | 
				
			||||||
    void setPureSampler(bool s)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        clear();
 | 
					 | 
				
			||||||
        sampler = true;
 | 
					 | 
				
			||||||
        shadow = s;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool operator==(const TSampler& right) const
 | 
					    bool operator==(const TSampler& right) const
 | 
				
			||||||
@ -529,6 +528,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void clearMemory()
 | 
					    void clearMemory()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        coherent     = false;
 | 
					        coherent     = false;
 | 
				
			||||||
        devicecoherent = false;
 | 
					        devicecoherent = false;
 | 
				
			||||||
        queuefamilycoherent = false;
 | 
					        queuefamilycoherent = false;
 | 
				
			||||||
@ -539,6 +539,7 @@ public:
 | 
				
			|||||||
        restrict     = false;
 | 
					        restrict     = false;
 | 
				
			||||||
        readonly     = false;
 | 
					        readonly     = false;
 | 
				
			||||||
        writeonly    = false;
 | 
					        writeonly    = false;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const char*         semanticName;
 | 
					    const char*         semanticName;
 | 
				
			||||||
@ -551,16 +552,6 @@ public:
 | 
				
			|||||||
    bool centroid     : 1;
 | 
					    bool centroid     : 1;
 | 
				
			||||||
    bool smooth       : 1;
 | 
					    bool smooth       : 1;
 | 
				
			||||||
    bool flat         : 1;
 | 
					    bool flat         : 1;
 | 
				
			||||||
    bool coherent     : 1;
 | 
					 | 
				
			||||||
    bool devicecoherent : 1;
 | 
					 | 
				
			||||||
    bool queuefamilycoherent : 1;
 | 
					 | 
				
			||||||
    bool workgroupcoherent : 1;
 | 
					 | 
				
			||||||
    bool subgroupcoherent  : 1;
 | 
					 | 
				
			||||||
    bool nonprivate   : 1;
 | 
					 | 
				
			||||||
    bool volatil      : 1;
 | 
					 | 
				
			||||||
    bool restrict     : 1;
 | 
					 | 
				
			||||||
    bool readonly     : 1;
 | 
					 | 
				
			||||||
    bool writeonly    : 1;
 | 
					 | 
				
			||||||
    // having a constant_id is not sufficient: expressions have no id, but are still specConstant
 | 
					    // having a constant_id is not sufficient: expressions have no id, but are still specConstant
 | 
				
			||||||
    bool specConstant : 1;
 | 
					    bool specConstant : 1;
 | 
				
			||||||
    bool nonUniform   : 1;
 | 
					    bool nonUniform   : 1;
 | 
				
			||||||
@ -568,6 +559,9 @@ public:
 | 
				
			|||||||
#ifdef GLSLANG_WEB
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
    bool isWriteOnly() const { return false; }
 | 
					    bool isWriteOnly() const { return false; }
 | 
				
			||||||
    bool isReadOnly() const { return false; }
 | 
					    bool isReadOnly() const { return false; }
 | 
				
			||||||
 | 
					    bool isRestrict() const { return false; }
 | 
				
			||||||
 | 
					    bool isCoherent() const { return false; }
 | 
				
			||||||
 | 
					    bool isVolatile() const { return false; }
 | 
				
			||||||
    bool isSample() const { return false; }
 | 
					    bool isSample() const { return false; }
 | 
				
			||||||
    bool isMemory() const { return false; }
 | 
					    bool isMemory() const { return false; }
 | 
				
			||||||
    bool isMemoryQualifierImageAndSSBOOnly() const { return false; }
 | 
					    bool isMemoryQualifierImageAndSSBOOnly() const { return false; }
 | 
				
			||||||
@ -589,8 +583,21 @@ public:
 | 
				
			|||||||
    bool perTaskNV : 1;
 | 
					    bool perTaskNV : 1;
 | 
				
			||||||
    bool patch        : 1;
 | 
					    bool patch        : 1;
 | 
				
			||||||
    bool sample       : 1;
 | 
					    bool sample       : 1;
 | 
				
			||||||
 | 
					    bool restrict     : 1;
 | 
				
			||||||
 | 
					    bool readonly     : 1;
 | 
				
			||||||
 | 
					    bool writeonly    : 1;
 | 
				
			||||||
 | 
					    bool coherent     : 1;
 | 
				
			||||||
 | 
					    bool volatil      : 1;
 | 
				
			||||||
 | 
					    bool devicecoherent : 1;
 | 
				
			||||||
 | 
					    bool queuefamilycoherent : 1;
 | 
				
			||||||
 | 
					    bool workgroupcoherent : 1;
 | 
				
			||||||
 | 
					    bool subgroupcoherent  : 1;
 | 
				
			||||||
 | 
					    bool nonprivate   : 1;
 | 
				
			||||||
    bool isWriteOnly() const { return writeonly; }
 | 
					    bool isWriteOnly() const { return writeonly; }
 | 
				
			||||||
    bool isReadOnly() const { return readonly; }
 | 
					    bool isReadOnly() const { return readonly; }
 | 
				
			||||||
 | 
					    bool isRestrict() const { return restrict; }
 | 
				
			||||||
 | 
					    bool isCoherent() const { return coherent; }
 | 
				
			||||||
 | 
					    bool isVolatile() const { return volatil; }
 | 
				
			||||||
    bool isSample() const { return sample; }
 | 
					    bool isSample() const { return sample; }
 | 
				
			||||||
    bool isMemory() const
 | 
					    bool isMemory() const
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -781,8 +788,8 @@ public:
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        layoutLocation = layoutLocationEnd;
 | 
					        layoutLocation = layoutLocationEnd;
 | 
				
			||||||
        layoutComponent = layoutComponentEnd;
 | 
					        layoutComponent = layoutComponentEnd;
 | 
				
			||||||
        layoutIndex = layoutIndexEnd;
 | 
					 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
 | 
					        layoutIndex = layoutIndexEnd;
 | 
				
			||||||
        clearStreamLayout();
 | 
					        clearStreamLayout();
 | 
				
			||||||
        clearXfbLayout();
 | 
					        clearXfbLayout();
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@ -887,7 +894,9 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        layoutSet = layoutSetEnd;
 | 
					        layoutSet = layoutSetEnd;
 | 
				
			||||||
        layoutBinding = layoutBindingEnd;
 | 
					        layoutBinding = layoutBindingEnd;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        layoutAttachment = layoutAttachmentEnd;
 | 
					        layoutAttachment = layoutAttachmentEnd;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool hasMatrix() const
 | 
					    bool hasMatrix() const
 | 
				
			||||||
@ -924,6 +933,7 @@ public:
 | 
				
			|||||||
    bool hasOffset() const { return false; }
 | 
					    bool hasOffset() const { return false; }
 | 
				
			||||||
    bool isNonPerspective() const { return false; }
 | 
					    bool isNonPerspective() const { return false; }
 | 
				
			||||||
    bool hasIndex() const { return false; }
 | 
					    bool hasIndex() const { return false; }
 | 
				
			||||||
 | 
					    unsigned getIndex() const { return 0; }
 | 
				
			||||||
    bool hasComponent() const { return false; }
 | 
					    bool hasComponent() const { return false; }
 | 
				
			||||||
    bool hasStream() const { return false; }
 | 
					    bool hasStream() const { return false; }
 | 
				
			||||||
    bool hasFormat() const { return false; }
 | 
					    bool hasFormat() const { return false; }
 | 
				
			||||||
@ -948,6 +958,7 @@ public:
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        return layoutIndex != layoutIndexEnd;
 | 
					        return layoutIndex != layoutIndexEnd;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    unsigned getIndex() const { return layoutIndex; }
 | 
				
			||||||
    bool hasComponent() const
 | 
					    bool hasComponent() const
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return layoutComponent != layoutComponentEnd;
 | 
					        return layoutComponent != layoutComponentEnd;
 | 
				
			||||||
@ -1922,6 +1933,7 @@ public:
 | 
				
			|||||||
        case EbtFloat:             return "float";
 | 
					        case EbtFloat:             return "float";
 | 
				
			||||||
        case EbtInt:               return "int";
 | 
					        case EbtInt:               return "int";
 | 
				
			||||||
        case EbtUint:              return "uint";
 | 
					        case EbtUint:              return "uint";
 | 
				
			||||||
 | 
					        case EbtSampler:           return "sampler/image";
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        case EbtVoid:              return "void";
 | 
					        case EbtVoid:              return "void";
 | 
				
			||||||
        case EbtDouble:            return "double";
 | 
					        case EbtDouble:            return "double";
 | 
				
			||||||
@ -1934,7 +1946,6 @@ public:
 | 
				
			|||||||
        case EbtUint64:            return "uint64_t";
 | 
					        case EbtUint64:            return "uint64_t";
 | 
				
			||||||
        case EbtBool:              return "bool";
 | 
					        case EbtBool:              return "bool";
 | 
				
			||||||
        case EbtAtomicUint:        return "atomic_uint";
 | 
					        case EbtAtomicUint:        return "atomic_uint";
 | 
				
			||||||
        case EbtSampler:           return "sampler/image";
 | 
					 | 
				
			||||||
        case EbtStruct:            return "structure";
 | 
					        case EbtStruct:            return "structure";
 | 
				
			||||||
        case EbtBlock:             return "block";
 | 
					        case EbtBlock:             return "block";
 | 
				
			||||||
        case EbtAccStructNV:       return "accelerationStructureNV";
 | 
					        case EbtAccStructNV:       return "accelerationStructureNV";
 | 
				
			||||||
 | 
				
			|||||||
@ -1310,11 +1310,13 @@ public:
 | 
				
			|||||||
    bool isSparseTexture()  const { return false; }
 | 
					    bool isSparseTexture()  const { return false; }
 | 
				
			||||||
    bool isImageFootprint() const { return false; }
 | 
					    bool isImageFootprint() const { return false; }
 | 
				
			||||||
    bool isSparseImage()    const { return false; }
 | 
					    bool isSparseImage()    const { return false; }
 | 
				
			||||||
 | 
					    bool isSubgroup()       const { return false; }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    bool isImage()    const { return op > EOpImageGuardBegin    && op < EOpImageGuardEnd; }
 | 
					    bool isImage()    const { return op > EOpImageGuardBegin    && op < EOpImageGuardEnd; }
 | 
				
			||||||
    bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; }
 | 
					    bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; }
 | 
				
			||||||
    bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
 | 
					    bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
 | 
				
			||||||
    bool isSparseImage()   const { return op == EOpSparseImageLoad; }
 | 
					    bool isSparseImage()   const { return op == EOpSparseImageLoad; }
 | 
				
			||||||
 | 
					    bool isSubgroup() const { return op > EOpSubgroupGuardStart && op < EOpSubgroupGuardStop; }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
 | 
					    void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
 | 
				
			||||||
 | 
				
			|||||||
@ -85,18 +85,18 @@ const int TypeStringScalarMask = ~TypeStringColumnMask;         // take type to
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
enum ArgType {
 | 
					enum ArgType {
 | 
				
			||||||
    // numbers hardcoded to correspond to 'TypeString'; order and value matter
 | 
					    // numbers hardcoded to correspond to 'TypeString'; order and value matter
 | 
				
			||||||
    TypeB =   1 << 0,  // Boolean
 | 
					    TypeB    = 1 << 0,  // Boolean
 | 
				
			||||||
    TypeF =   1 << 1,  // float 32
 | 
					    TypeF    = 1 << 1,  // float 32
 | 
				
			||||||
    TypeI =   1 << 2,  // int 32
 | 
					    TypeI    = 1 << 2,  // int 32
 | 
				
			||||||
    TypeU =   1 << 3,  // uint 32
 | 
					    TypeU    = 1 << 3,  // uint 32
 | 
				
			||||||
    TypeF16 = 1 << 4,  // float 16
 | 
					    TypeF16  = 1 << 4,  // float 16
 | 
				
			||||||
    TypeF64 = 1 << 5,  // float 64
 | 
					    TypeF64  = 1 << 5,  // float 64
 | 
				
			||||||
    TypeI8  = 1 << 6,  // int 8
 | 
					    TypeI8   = 1 << 6,  // int 8
 | 
				
			||||||
    TypeI16 = 1 << 7,  // int 16
 | 
					    TypeI16  = 1 << 7,  // int 16
 | 
				
			||||||
    TypeI64 = 1 << 8,  // int 64
 | 
					    TypeI64  = 1 << 8,  // int 64
 | 
				
			||||||
    TypeU8  = 1 << 9,  // uint 8
 | 
					    TypeU8   = 1 << 9,  // uint 8
 | 
				
			||||||
    TypeU16 = 1 << 10, // uint 16
 | 
					    TypeU16  = 1 << 10, // uint 16
 | 
				
			||||||
    TypeU64 = 1 << 11, // uint 64
 | 
					    TypeU64  = 1 << 11, // uint 64
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
// Mixtures of the above, to help the function tables
 | 
					// Mixtures of the above, to help the function tables
 | 
				
			||||||
const ArgType TypeFI  = static_cast<ArgType>(TypeF | TypeI);
 | 
					const ArgType TypeFI  = static_cast<ArgType>(TypeF | TypeI);
 | 
				
			||||||
@ -106,22 +106,22 @@ const ArgType TypeIU  = static_cast<ArgType>(TypeI | TypeU);
 | 
				
			|||||||
// The relationships between arguments and return type, whether anything is
 | 
					// The relationships between arguments and return type, whether anything is
 | 
				
			||||||
// output, or other unusual situations.
 | 
					// output, or other unusual situations.
 | 
				
			||||||
enum ArgClass {
 | 
					enum ArgClass {
 | 
				
			||||||
    ClassRegular = 0,    // nothing special, just all vector widths with matching return type; traditional arithmetic
 | 
					    ClassRegular     = 0,  // nothing special, just all vector widths with matching return type; traditional arithmetic
 | 
				
			||||||
    ClassLS   = 1 << 0,  // the last argument is also held fixed as a (type-matched) scalar while the others cycle
 | 
					    ClassLS     = 1 << 0,  // the last argument is also held fixed as a (type-matched) scalar while the others cycle
 | 
				
			||||||
    ClassXLS  = 1 << 1,  // the last argument is exclusively a (type-matched) scalar while the others cycle
 | 
					    ClassXLS    = 1 << 1,  // the last argument is exclusively a (type-matched) scalar while the others cycle
 | 
				
			||||||
    ClassLS2  = 1 << 2,  // the last two arguments are held fixed as a (type-matched) scalar while the others cycle
 | 
					    ClassLS2    = 1 << 2,  // the last two arguments are held fixed as a (type-matched) scalar while the others cycle
 | 
				
			||||||
    ClassFS   = 1 << 3,  // the first argument is held fixed as a (type-matched) scalar while the others cycle
 | 
					    ClassFS     = 1 << 3,  // the first argument is held fixed as a (type-matched) scalar while the others cycle
 | 
				
			||||||
    ClassFS2  = 1 << 4,  // the first two arguments are held fixed as a (type-matched) scalar while the others cycle
 | 
					    ClassFS2    = 1 << 4,  // the first two arguments are held fixed as a (type-matched) scalar while the others cycle
 | 
				
			||||||
    ClassLO   = 1 << 5,  // the last argument is an output
 | 
					    ClassLO     = 1 << 5,  // the last argument is an output
 | 
				
			||||||
    ClassB    = 1 << 6,  // return type cycles through only bool/bvec, matching vector width of args
 | 
					    ClassB      = 1 << 6,  // return type cycles through only bool/bvec, matching vector width of args
 | 
				
			||||||
    ClassLB   = 1 << 7,  // last argument cycles through only bool/bvec, matching vector width of args
 | 
					    ClassLB     = 1 << 7,  // last argument cycles through only bool/bvec, matching vector width of args
 | 
				
			||||||
    ClassV1   = 1 << 8,  // scalar only
 | 
					    ClassV1     = 1 << 8,  // scalar only
 | 
				
			||||||
    ClassFIO  = 1 << 9,  // first argument is inout
 | 
					    ClassFIO    = 1 << 9,  // first argument is inout
 | 
				
			||||||
    ClassRS   = 1 << 10, // the return is held scalar as the arguments cycle
 | 
					    ClassRS     = 1 << 10, // the return is held scalar as the arguments cycle
 | 
				
			||||||
    ClassNS   = 1 << 11, // no scalar prototype
 | 
					    ClassNS     = 1 << 11, // no scalar prototype
 | 
				
			||||||
    ClassCV   = 1 << 12, // first argument is 'coherent volatile'
 | 
					    ClassCV     = 1 << 12, // first argument is 'coherent volatile'
 | 
				
			||||||
    ClassFO   = 1 << 13, // first argument is output
 | 
					    ClassFO     = 1 << 13, // first argument is output
 | 
				
			||||||
    ClassV3   = 1 << 14, // vec3 only
 | 
					    ClassV3     = 1 << 14, // vec3 only
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
// Mixtures of the above, to help the function tables
 | 
					// Mixtures of the above, to help the function tables
 | 
				
			||||||
const ArgClass ClassV1FIOCV = (ArgClass)(ClassV1 | ClassFIO | ClassCV);
 | 
					const ArgClass ClassV1FIOCV = (ArgClass)(ClassV1 | ClassFIO | ClassCV);
 | 
				
			||||||
@ -147,6 +147,7 @@ EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECo
 | 
				
			|||||||
// Declare pointers to put into the table for versioning.
 | 
					// Declare pointers to put into the table for versioning.
 | 
				
			||||||
#ifdef GLSLANG_WEB
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
    const Versioning* Es300Desktop130 = nullptr;
 | 
					    const Versioning* Es300Desktop130 = nullptr;
 | 
				
			||||||
 | 
					    const Versioning* Es310Desktop430 = nullptr;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    const Versioning Es300Desktop130Version[] = { { EEsProfile,      0, 300, 0, nullptr },
 | 
					    const Versioning Es300Desktop130Version[] = { { EEsProfile,      0, 300, 0, nullptr },
 | 
				
			||||||
                                                  { EDesktopProfile, 0, 130, 0, nullptr },
 | 
					                                                  { EDesktopProfile, 0, 130, 0, nullptr },
 | 
				
			||||||
@ -256,7 +257,6 @@ const BuiltInFunction BaseFunctions[] = {
 | 
				
			|||||||
    { EOpGreaterThanEqual, "greaterThanEqual", 2,   TypeU,     ClassBNS,     Es300Desktop130 },
 | 
					    { EOpGreaterThanEqual, "greaterThanEqual", 2,   TypeU,     ClassBNS,     Es300Desktop130 },
 | 
				
			||||||
    { EOpVectorEqual,      "equal",            2,   TypeU,     ClassBNS,     Es300Desktop130 },
 | 
					    { EOpVectorEqual,      "equal",            2,   TypeU,     ClassBNS,     Es300Desktop130 },
 | 
				
			||||||
    { EOpVectorNotEqual,   "notEqual",         2,   TypeU,     ClassBNS,     Es300Desktop130 },
 | 
					    { EOpVectorNotEqual,   "notEqual",         2,   TypeU,     ClassBNS,     Es300Desktop130 },
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    { EOpAtomicAdd,        "atomicAdd",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
					    { EOpAtomicAdd,        "atomicAdd",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
				
			||||||
    { EOpAtomicMin,        "atomicMin",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
					    { EOpAtomicMin,        "atomicMin",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
				
			||||||
    { EOpAtomicMax,        "atomicMax",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
					    { EOpAtomicMax,        "atomicMax",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
				
			||||||
@ -265,9 +265,11 @@ const BuiltInFunction BaseFunctions[] = {
 | 
				
			|||||||
    { EOpAtomicXor,        "atomicXor",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
					    { EOpAtomicXor,        "atomicXor",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
				
			||||||
    { EOpAtomicExchange,   "atomicExchange",   2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
					    { EOpAtomicExchange,   "atomicExchange",   2,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
				
			||||||
    { EOpAtomicCompSwap,   "atomicCompSwap",   3,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
					    { EOpAtomicCompSwap,   "atomicCompSwap",   3,   TypeIU,    ClassV1FIOCV, Es310Desktop430 },
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    { EOpMix,              "mix",              3,   TypeB,     ClassRegular, Es310Desktop450 },
 | 
					    { EOpMix,              "mix",              3,   TypeB,     ClassRegular, Es310Desktop450 },
 | 
				
			||||||
    { EOpMix,              "mix",              3,   TypeIU,    ClassLB,      Es310Desktop450 },
 | 
					    { EOpMix,              "mix",              3,   TypeIU,    ClassLB,      Es310Desktop450 },
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    { EOpNull }
 | 
					    { EOpNull }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -278,6 +280,59 @@ const BuiltInFunction DerivativeFunctions[] = {
 | 
				
			|||||||
    { EOpNull }
 | 
					    { EOpNull }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// For functions declared some other way, but still use the table to relate to operator.
 | 
				
			||||||
 | 
					struct CustomFunction {
 | 
				
			||||||
 | 
					    TOperator op;                 // operator to map the name to
 | 
				
			||||||
 | 
					    const char* name;             // function name
 | 
				
			||||||
 | 
					    const Versioning* versioning; // nullptr means always a valid version
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const CustomFunction CustomFunctions[] = {
 | 
				
			||||||
 | 
					    { EOpBarrier,             "barrier",             nullptr },
 | 
				
			||||||
 | 
					    { EOpMemoryBarrierShared, "memoryBarrierShared", nullptr },
 | 
				
			||||||
 | 
					    { EOpGroupMemoryBarrier,  "groupMemoryBarrier",  nullptr },
 | 
				
			||||||
 | 
					    { EOpMemoryBarrier,       "memoryBarrier",       nullptr },
 | 
				
			||||||
 | 
					    { EOpMemoryBarrierBuffer, "memoryBarrierBuffer", nullptr },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    { EOpPackSnorm2x16,       "packSnorm2x16",       nullptr },
 | 
				
			||||||
 | 
					    { EOpUnpackSnorm2x16,     "unpackSnorm2x16",     nullptr },
 | 
				
			||||||
 | 
					    { EOpPackUnorm2x16,       "packUnorm2x16",       nullptr },
 | 
				
			||||||
 | 
					    { EOpUnpackUnorm2x16,     "unpackUnorm2x16",     nullptr },
 | 
				
			||||||
 | 
					    { EOpPackHalf2x16,        "packHalf2x16",        nullptr },
 | 
				
			||||||
 | 
					    { EOpUnpackHalf2x16,      "unpackHalf2x16",      nullptr },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    { EOpMul,                 "matrixCompMult",      nullptr },
 | 
				
			||||||
 | 
					    { EOpOuterProduct,        "outerProduct",        nullptr },
 | 
				
			||||||
 | 
					    { EOpTranspose,           "transpose",           nullptr },
 | 
				
			||||||
 | 
					    { EOpDeterminant,         "determinant",         nullptr },
 | 
				
			||||||
 | 
					    { EOpMatrixInverse,       "inverse",             nullptr },
 | 
				
			||||||
 | 
					    { EOpFloatBitsToInt,      "floatBitsToInt",      nullptr },
 | 
				
			||||||
 | 
					    { EOpFloatBitsToUint,     "floatBitsToUint",     nullptr },
 | 
				
			||||||
 | 
					    { EOpIntBitsToFloat,      "intBitsToFloat",      nullptr },
 | 
				
			||||||
 | 
					    { EOpUintBitsToFloat,     "uintBitsToFloat",     nullptr },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    { EOpTextureQuerySize,      "textureSize",           nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureQueryLod,       "textureQueryLod",       nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureQueryLevels,    "textureQueryLevels",    nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureQuerySamples,   "textureSamples",        nullptr },
 | 
				
			||||||
 | 
					    { EOpTexture,               "texture",               nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureProj,           "textureProj",           nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureLod,            "textureLod",            nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureOffset,         "textureOffset",         nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureFetch,          "texelFetch",            nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureFetchOffset,    "texelFetchOffset",      nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureProjOffset,     "textureProjOffset",     nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureLodOffset,      "textureLodOffset",      nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureProjLod,        "textureProjLod",        nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureProjLodOffset,  "textureProjLodOffset",  nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureGrad,           "textureGrad",           nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureGradOffset,     "textureGradOffset",     nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureProjGrad,       "textureProjGrad",       nullptr },
 | 
				
			||||||
 | 
					    { EOpTextureProjGradOffset, "textureProjGradOffset", nullptr },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    { EOpNull }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// For the given table of functions, add all the indicated prototypes for each
 | 
					// For the given table of functions, add all the indicated prototypes for each
 | 
				
			||||||
// one, to be returned in the passed in decls.
 | 
					// one, to be returned in the passed in decls.
 | 
				
			||||||
void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
 | 
					void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
 | 
				
			||||||
@ -331,8 +386,10 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
 | 
				
			|||||||
                if (arg == function.numArguments - 1 && (function.classes & ClassLO))
 | 
					                if (arg == function.numArguments - 1 && (function.classes & ClassLO))
 | 
				
			||||||
                    decls.append("out ");
 | 
					                    decls.append("out ");
 | 
				
			||||||
                if (arg == 0) {
 | 
					                if (arg == 0) {
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
                    if (function.classes & ClassCV)
 | 
					                    if (function.classes & ClassCV)
 | 
				
			||||||
                        decls.append("coherent volatile ");
 | 
					                        decls.append("coherent volatile ");
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
                    if (function.classes & ClassFIO)
 | 
					                    if (function.classes & ClassFIO)
 | 
				
			||||||
                        decls.append("inout ");
 | 
					                        decls.append("inout ");
 | 
				
			||||||
                    if (function.classes & ClassFO)
 | 
					                    if (function.classes & ClassFO)
 | 
				
			||||||
@ -382,9 +439,10 @@ bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile
 | 
				
			|||||||
// Relate a single table of built-ins to their AST operator.
 | 
					// Relate a single table of built-ins to their AST operator.
 | 
				
			||||||
// This can get called redundantly (especially for the common built-ins, when
 | 
					// This can get called redundantly (especially for the common built-ins, when
 | 
				
			||||||
// called once per stage). This is a performance issue only, not a correctness
 | 
					// called once per stage). This is a performance issue only, not a correctness
 | 
				
			||||||
// concern.  It is done for quality arising from simplicity, as there are subtlies
 | 
					// concern.  It is done for quality arising from simplicity, as there are subtleties
 | 
				
			||||||
// to get correct if instead trying to do it surgically.
 | 
					// to get correct if instead trying to do it surgically.
 | 
				
			||||||
void RelateTabledBuiltins(const BuiltInFunction* functions, TSymbolTable& symbolTable)
 | 
					template<class FunctionT>
 | 
				
			||||||
 | 
					void RelateTabledBuiltins(const FunctionT* functions, TSymbolTable& symbolTable)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    while (functions->op != EOpNull) {
 | 
					    while (functions->op != EOpNull) {
 | 
				
			||||||
        symbolTable.relateToOperator(functions->name, functions->op);
 | 
					        symbolTable.relateToOperator(functions->name, functions->op);
 | 
				
			||||||
@ -408,10 +466,6 @@ void TBuiltIns::addTabledBuiltins(int version, EProfile profile, const SpvVersio
 | 
				
			|||||||
    forEachFunction(commonBuiltins, BaseFunctions);
 | 
					    forEachFunction(commonBuiltins, BaseFunctions);
 | 
				
			||||||
    forEachFunction(stageBuiltins[EShLangFragment], DerivativeFunctions);
 | 
					    forEachFunction(stageBuiltins[EShLangFragment], DerivativeFunctions);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef GLSLANG_WEB
 | 
					 | 
				
			||||||
    return;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450))
 | 
					    if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450))
 | 
				
			||||||
        forEachFunction(stageBuiltins[EShLangCompute], DerivativeFunctions);
 | 
					        forEachFunction(stageBuiltins[EShLangCompute], DerivativeFunctions);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -421,6 +475,7 @@ void TBuiltIns::relateTabledBuiltins(int /* version */, EProfile /* profile */,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    RelateTabledBuiltins(BaseFunctions, symbolTable);
 | 
					    RelateTabledBuiltins(BaseFunctions, symbolTable);
 | 
				
			||||||
    RelateTabledBuiltins(DerivativeFunctions, symbolTable);
 | 
					    RelateTabledBuiltins(DerivativeFunctions, symbolTable);
 | 
				
			||||||
 | 
					    RelateTabledBuiltins(CustomFunctions, symbolTable);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline bool IncludeLegacy(int version, EProfile profile, const SpvVersion& spvVersion)
 | 
					inline bool IncludeLegacy(int version, EProfile profile, const SpvVersion& spvVersion)
 | 
				
			||||||
@ -465,7 +520,7 @@ TBuiltIns::TBuiltIns()
 | 
				
			|||||||
    dimMap[Esd1D] = 1;
 | 
					    dimMap[Esd1D] = 1;
 | 
				
			||||||
    dimMap[EsdRect] = 2;
 | 
					    dimMap[EsdRect] = 2;
 | 
				
			||||||
    dimMap[EsdBuffer] = 1;
 | 
					    dimMap[EsdBuffer] = 1;
 | 
				
			||||||
    dimMap[EsdSubpass] = 2;  // potientially unused for now
 | 
					    dimMap[EsdSubpass] = 2;  // potentially unused for now
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -484,6 +539,10 @@ TBuiltIns::~TBuiltIns()
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion)
 | 
					void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
 | 
					    version = 310;
 | 
				
			||||||
 | 
					    profile = EEsProfile;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    addTabledBuiltins(version, profile, spvVersion);
 | 
					    addTabledBuiltins(version, profile, spvVersion);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //============================================================================
 | 
					    //============================================================================
 | 
				
			||||||
@ -1306,14 +1365,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 | 
				
			|||||||
        commonBuiltins.append(
 | 
					        commonBuiltins.append(
 | 
				
			||||||
            "mediump vec2 unpackHalf2x16(highp uint);"
 | 
					            "mediump vec2 unpackHalf2x16(highp uint);"
 | 
				
			||||||
            "\n");
 | 
					            "\n");
 | 
				
			||||||
    }
 | 
					    } else if (profile != EEsProfile && version >= 420) {
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    else if (profile != EEsProfile && version >= 420) {
 | 
					 | 
				
			||||||
        commonBuiltins.append(
 | 
					        commonBuiltins.append(
 | 
				
			||||||
            "        vec2 unpackHalf2x16(highp uint);"
 | 
					            "        vec2 unpackHalf2x16(highp uint);"
 | 
				
			||||||
            "\n");
 | 
					            "\n");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    if ((profile == EEsProfile && version >= 310) ||
 | 
					    if ((profile == EEsProfile && version >= 310) ||
 | 
				
			||||||
        (profile != EEsProfile && version >= 400)) {
 | 
					        (profile != EEsProfile && version >= 400)) {
 | 
				
			||||||
        commonBuiltins.append(
 | 
					        commonBuiltins.append(
 | 
				
			||||||
@ -3795,6 +3853,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 | 
				
			|||||||
            "void EndPrimitive();"
 | 
					            "void EndPrimitive();"
 | 
				
			||||||
            "\n");
 | 
					            "\n");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //============================================================================
 | 
					    //============================================================================
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
@ -3824,15 +3883,20 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 | 
				
			|||||||
            );
 | 
					            );
 | 
				
			||||||
    if ((profile != EEsProfile && version >= 420) || esBarrier) {
 | 
					    if ((profile != EEsProfile && version >= 420) || esBarrier) {
 | 
				
			||||||
        commonBuiltins.append(
 | 
					        commonBuiltins.append(
 | 
				
			||||||
            "void memoryBarrierAtomicCounter();"
 | 
					 | 
				
			||||||
            "void memoryBarrierBuffer();"
 | 
					            "void memoryBarrierBuffer();"
 | 
				
			||||||
            "void memoryBarrierImage();"
 | 
					 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
        stageBuiltins[EShLangCompute].append(
 | 
					        stageBuiltins[EShLangCompute].append(
 | 
				
			||||||
            "void memoryBarrierShared();"
 | 
					            "void memoryBarrierShared();"
 | 
				
			||||||
            "void groupMemoryBarrier();"
 | 
					            "void groupMemoryBarrier();"
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
 | 
					    if ((profile != EEsProfile && version >= 420) || esBarrier) {
 | 
				
			||||||
 | 
					        commonBuiltins.append(
 | 
				
			||||||
 | 
					            "void memoryBarrierAtomicCounter();"
 | 
				
			||||||
 | 
					            "void memoryBarrierImage();"
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
 | 
					    if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
 | 
				
			||||||
        stageBuiltins[EShLangMeshNV].append(
 | 
					        stageBuiltins[EShLangMeshNV].append(
 | 
				
			||||||
            "void memoryBarrierShared();"
 | 
					            "void memoryBarrierShared();"
 | 
				
			||||||
@ -4279,6 +4343,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            "\n");
 | 
					            "\n");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //============================================================================
 | 
					    //============================================================================
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
@ -4308,6 +4373,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 | 
				
			|||||||
            "\n");
 | 
					            "\n");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    //============================================================================
 | 
					    //============================================================================
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    // Define the interface to the mesh/task shader.
 | 
					    // Define the interface to the mesh/task shader.
 | 
				
			||||||
@ -5314,10 +5380,9 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
 | 
				
			|||||||
#ifdef GLSLANG_WEB
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
            const int ms = 0;
 | 
					            const int ms = 0;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
            for (int ms = 0; ms <= 1; ++ms)
 | 
					            for (int ms = 0; ms <= 1; ++ms) // loop over "bool" multisample or not
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
                if ((ms || image) && shadow)
 | 
					                if ((ms || image) && shadow)
 | 
				
			||||||
                    continue;
 | 
					                    continue;
 | 
				
			||||||
                if (ms && profile != EEsProfile && version < 150)
 | 
					                if (ms && profile != EEsProfile && version < 150)
 | 
				
			||||||
@ -5326,7 +5391,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
 | 
				
			|||||||
                    continue;
 | 
					                    continue;
 | 
				
			||||||
                if (ms && profile == EEsProfile && version < 310)
 | 
					                if (ms && profile == EEsProfile && version < 310)
 | 
				
			||||||
                    continue;
 | 
					                    continue;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not
 | 
					                for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not
 | 
				
			||||||
#ifdef GLSLANG_WEB
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
@ -5431,14 +5495,12 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    // sparseTexelsResidentARB()
 | 
					    // sparseTexelsResidentARB()
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    if (profile != EEsProfile && version >= 450) {
 | 
					    if (profile != EEsProfile && version >= 450) {
 | 
				
			||||||
        commonBuiltins.append("bool sparseTexelsResidentARB(int code);\n");
 | 
					        commonBuiltins.append("bool sparseTexelsResidentARB(int code);\n");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
@ -5725,6 +5787,11 @@ void TBuiltIns::addSubpassSampling(TSampler sampler, const TString& typeName, in
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
 | 
					void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
 | 
					    profile = EEsProfile;
 | 
				
			||||||
 | 
					    version = 310;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    // texturing
 | 
					    // texturing
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
@ -6005,6 +6072,11 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
 | 
					void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
 | 
					    profile = EEsProfile;
 | 
				
			||||||
 | 
					    version = 310;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (sampler.dim) {
 | 
					    switch (sampler.dim) {
 | 
				
			||||||
    case Esd2D:
 | 
					    case Esd2D:
 | 
				
			||||||
    case EsdRect:
 | 
					    case EsdRect:
 | 
				
			||||||
@ -6243,6 +6315,11 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language)
 | 
					void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
 | 
					    version = 310;
 | 
				
			||||||
 | 
					    profile = EEsProfile;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    // Initialize the context-dependent (resource-dependent) built-in strings for parsing.
 | 
					    // Initialize the context-dependent (resource-dependent) built-in strings for parsing.
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
@ -6300,9 +6377,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
 | 
				
			|||||||
            s.append(builtInConstant);
 | 
					            s.append(builtInConstant);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
        if (version >= 310) {
 | 
					        if (version >= 310) {
 | 
				
			||||||
            // geometry
 | 
					            // geometry
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -6584,8 +6659,29 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
 | 
				
			|||||||
            snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackInterleavedComponents = %d;", resources.maxTransformFeedbackInterleavedComponents);
 | 
					            snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackInterleavedComponents = %d;", resources.maxTransformFeedbackInterleavedComponents);
 | 
				
			||||||
            s.append(builtInConstant);
 | 
					            s.append(builtInConstant);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // compute
 | 
				
			||||||
 | 
					    if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) {
 | 
				
			||||||
 | 
					        snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX,
 | 
				
			||||||
 | 
					                                                                                                         resources.maxComputeWorkGroupCountY,
 | 
				
			||||||
 | 
					                                                                                                         resources.maxComputeWorkGroupCountZ);
 | 
				
			||||||
 | 
					        s.append(builtInConstant);
 | 
				
			||||||
 | 
					        snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX,
 | 
				
			||||||
 | 
					                                                                                                        resources.maxComputeWorkGroupSizeY,
 | 
				
			||||||
 | 
					                                                                                                        resources.maxComputeWorkGroupSizeZ);
 | 
				
			||||||
 | 
					        s.append(builtInConstant);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeUniformComponents = %d;", resources.maxComputeUniformComponents);
 | 
				
			||||||
 | 
					        s.append(builtInConstant);
 | 
				
			||||||
 | 
					        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits);
 | 
				
			||||||
 | 
					        s.append(builtInConstant);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        s.append("\n");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    // images (some in compute below)
 | 
					    // images (some in compute below)
 | 
				
			||||||
    if ((profile == EEsProfile && version >= 310) ||
 | 
					    if ((profile == EEsProfile && version >= 310) ||
 | 
				
			||||||
        (profile != EEsProfile && version >= 130)) {
 | 
					        (profile != EEsProfile && version >= 130)) {
 | 
				
			||||||
@ -6601,6 +6697,18 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
 | 
				
			|||||||
        s.append(builtInConstant);
 | 
					        s.append(builtInConstant);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // compute
 | 
				
			||||||
 | 
					    if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) {
 | 
				
			||||||
 | 
					        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeImageUniforms = %d;", resources.maxComputeImageUniforms);
 | 
				
			||||||
 | 
					        s.append(builtInConstant);
 | 
				
			||||||
 | 
					        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounters = %d;", resources.maxComputeAtomicCounters);
 | 
				
			||||||
 | 
					        s.append(builtInConstant);
 | 
				
			||||||
 | 
					        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounterBuffers = %d;", resources.maxComputeAtomicCounterBuffers);
 | 
				
			||||||
 | 
					        s.append(builtInConstant);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        s.append("\n");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // atomic counters (some in compute below)
 | 
					    // atomic counters (some in compute below)
 | 
				
			||||||
    if ((profile == EEsProfile && version >= 310) ||
 | 
					    if ((profile == EEsProfile && version >= 310) ||
 | 
				
			||||||
        (profile != EEsProfile && version >= 420)) {
 | 
					        (profile != EEsProfile && version >= 420)) {
 | 
				
			||||||
@ -6638,31 +6746,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
 | 
				
			|||||||
        s.append("\n");
 | 
					        s.append("\n");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // compute
 | 
					 | 
				
			||||||
    if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) {
 | 
					 | 
				
			||||||
        snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX,
 | 
					 | 
				
			||||||
                                                                                                         resources.maxComputeWorkGroupCountY,
 | 
					 | 
				
			||||||
                                                                                                         resources.maxComputeWorkGroupCountZ);
 | 
					 | 
				
			||||||
        s.append(builtInConstant);
 | 
					 | 
				
			||||||
        snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX,
 | 
					 | 
				
			||||||
                                                                                                        resources.maxComputeWorkGroupSizeY,
 | 
					 | 
				
			||||||
                                                                                                        resources.maxComputeWorkGroupSizeZ);
 | 
					 | 
				
			||||||
        s.append(builtInConstant);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeUniformComponents = %d;", resources.maxComputeUniformComponents);
 | 
					 | 
				
			||||||
        s.append(builtInConstant);
 | 
					 | 
				
			||||||
        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits);
 | 
					 | 
				
			||||||
        s.append(builtInConstant);
 | 
					 | 
				
			||||||
        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeImageUniforms = %d;", resources.maxComputeImageUniforms);
 | 
					 | 
				
			||||||
        s.append(builtInConstant);
 | 
					 | 
				
			||||||
        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounters = %d;", resources.maxComputeAtomicCounters);
 | 
					 | 
				
			||||||
        s.append(builtInConstant);
 | 
					 | 
				
			||||||
        snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounterBuffers = %d;", resources.maxComputeAtomicCounterBuffers);
 | 
					 | 
				
			||||||
        s.append(builtInConstant);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        s.append("\n");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // GL_ARB_cull_distance
 | 
					    // GL_ARB_cull_distance
 | 
				
			||||||
    if (profile != EEsProfile && version >= 450) {
 | 
					    if (profile != EEsProfile && version >= 450) {
 | 
				
			||||||
        snprintf(builtInConstant, maxSize, "const int gl_MaxCullDistances = %d;",                resources.maxCullDistances);
 | 
					        snprintf(builtInConstant, maxSize, "const int gl_MaxCullDistances = %d;",                resources.maxCullDistances);
 | 
				
			||||||
@ -6781,6 +6864,11 @@ static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVar
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable)
 | 
					void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
 | 
					    version = 310;
 | 
				
			||||||
 | 
					    profile = EEsProfile;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    // Tag built-in variables and functions with additional qualifier and extension information
 | 
					    // Tag built-in variables and functions with additional qualifier and extension information
 | 
				
			||||||
    // that cannot be declared with the text strings.
 | 
					    // that cannot be declared with the text strings.
 | 
				
			||||||
@ -7547,7 +7635,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    case EShLangCompute:
 | 
					    case EShLangCompute:
 | 
				
			||||||
        BuiltInVariable("gl_NumWorkGroups",         EbvNumWorkGroups,        symbolTable);
 | 
					        BuiltInVariable("gl_NumWorkGroups",         EbvNumWorkGroups,        symbolTable);
 | 
				
			||||||
        BuiltInVariable("gl_WorkGroupSize",         EbvWorkGroupSize,        symbolTable);
 | 
					        BuiltInVariable("gl_WorkGroupSize",         EbvWorkGroupSize,        symbolTable);
 | 
				
			||||||
@ -7555,6 +7642,15 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
        BuiltInVariable("gl_LocalInvocationID",     EbvLocalInvocationId,    symbolTable);
 | 
					        BuiltInVariable("gl_LocalInvocationID",     EbvLocalInvocationId,    symbolTable);
 | 
				
			||||||
        BuiltInVariable("gl_GlobalInvocationID",    EbvGlobalInvocationId,   symbolTable);
 | 
					        BuiltInVariable("gl_GlobalInvocationID",    EbvGlobalInvocationId,   symbolTable);
 | 
				
			||||||
        BuiltInVariable("gl_LocalInvocationIndex",  EbvLocalInvocationIndex, symbolTable);
 | 
					        BuiltInVariable("gl_LocalInvocationIndex",  EbvLocalInvocationIndex, symbolTable);
 | 
				
			||||||
 | 
					        BuiltInVariable("gl_DeviceIndex",           EbvDeviceIndex,          symbolTable);
 | 
				
			||||||
 | 
					        BuiltInVariable("gl_ViewIndex",             EbvViewIndex,            symbolTable);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
 | 
					        if ((profile != EEsProfile && version >= 140) ||
 | 
				
			||||||
 | 
					            (profile == EEsProfile && version >= 310)) {
 | 
				
			||||||
 | 
					            symbolTable.setVariableExtensions("gl_DeviceIndex",  1, &E_GL_EXT_device_group);
 | 
				
			||||||
 | 
					            symbolTable.setVariableExtensions("gl_ViewIndex",    1, &E_GL_EXT_multiview);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (profile != EEsProfile && version < 430) {
 | 
					        if (profile != EEsProfile && version < 430) {
 | 
				
			||||||
            symbolTable.setVariableExtensions("gl_NumWorkGroups",        1, &E_GL_ARB_compute_shader);
 | 
					            symbolTable.setVariableExtensions("gl_NumWorkGroups",        1, &E_GL_ARB_compute_shader);
 | 
				
			||||||
@ -7636,14 +7732,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
            BuiltInVariable("gl_SMIDNV",                EbvSMID,            symbolTable);
 | 
					            BuiltInVariable("gl_SMIDNV",                EbvSMID,            symbolTable);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ((profile != EEsProfile && version >= 140) ||
 | 
					 | 
				
			||||||
            (profile == EEsProfile && version >= 310)) {
 | 
					 | 
				
			||||||
            symbolTable.setVariableExtensions("gl_DeviceIndex",  1, &E_GL_EXT_device_group);
 | 
					 | 
				
			||||||
            BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
 | 
					 | 
				
			||||||
            symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
 | 
					 | 
				
			||||||
            BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // GL_KHR_shader_subgroup
 | 
					        // GL_KHR_shader_subgroup
 | 
				
			||||||
        if ((profile == EEsProfile && version >= 310) ||
 | 
					        if ((profile == EEsProfile && version >= 310) ||
 | 
				
			||||||
            (profile != EEsProfile && version >= 140)) {
 | 
					            (profile != EEsProfile && version >= 140)) {
 | 
				
			||||||
@ -7674,8 +7762,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
            symbolTable.setFunctionExtensions("dFdyCoarse",             1, &E_GL_NV_compute_shader_derivatives);
 | 
					            symbolTable.setFunctionExtensions("dFdyCoarse",             1, &E_GL_NV_compute_shader_derivatives);
 | 
				
			||||||
            symbolTable.setFunctionExtensions("fwidthCoarse",           1, &E_GL_NV_compute_shader_derivatives);
 | 
					            symbolTable.setFunctionExtensions("fwidthCoarse",           1, &E_GL_NV_compute_shader_derivatives);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    case EShLangRayGenNV:
 | 
					    case EShLangRayGenNV:
 | 
				
			||||||
    case EShLangIntersectNV:
 | 
					    case EShLangIntersectNV:
 | 
				
			||||||
    case EShLangAnyHitNV:
 | 
					    case EShLangAnyHitNV:
 | 
				
			||||||
@ -8034,21 +8124,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    relateTabledBuiltins(version, profile, spvVersion, language, symbolTable);
 | 
					    relateTabledBuiltins(version, profile, spvVersion, language, symbolTable);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    symbolTable.relateToOperator("matrixCompMult",   EOpMul);
 | 
					 | 
				
			||||||
    // 120 and 150 are correct for both ES and desktop
 | 
					 | 
				
			||||||
    if (version >= 120) {
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("outerProduct", EOpOuterProduct);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("transpose", EOpTranspose);
 | 
					 | 
				
			||||||
        if (version >= 150) {
 | 
					 | 
				
			||||||
            symbolTable.relateToOperator("determinant", EOpDeterminant);
 | 
					 | 
				
			||||||
            symbolTable.relateToOperator("inverse", EOpMatrixInverse);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("floatBitsToInt",  EOpFloatBitsToInt);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("floatBitsToUint", EOpFloatBitsToUint);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("intBitsToFloat",  EOpIntBitsToFloat);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("uintBitsToFloat", EOpUintBitsToFloat);
 | 
					 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    symbolTable.relateToOperator("doubleBitsToInt64",  EOpDoubleBitsToInt64);
 | 
					    symbolTable.relateToOperator("doubleBitsToInt64",  EOpDoubleBitsToInt64);
 | 
				
			||||||
    symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
 | 
					    symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
 | 
				
			||||||
@ -8063,14 +8138,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    symbolTable.relateToOperator("int16BitsToHalf",  EOpInt16BitsToFloat16);
 | 
					    symbolTable.relateToOperator("int16BitsToHalf",  EOpInt16BitsToFloat16);
 | 
				
			||||||
    symbolTable.relateToOperator("uint16BitsToHalf", EOpUint16BitsToFloat16);
 | 
					    symbolTable.relateToOperator("uint16BitsToHalf", EOpUint16BitsToFloat16);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    symbolTable.relateToOperator("packSnorm2x16",   EOpPackSnorm2x16);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("packUnorm2x16",   EOpPackUnorm2x16);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("unpackUnorm2x16", EOpUnpackUnorm2x16);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("packSnorm4x8",    EOpPackSnorm4x8);
 | 
					    symbolTable.relateToOperator("packSnorm4x8",    EOpPackSnorm4x8);
 | 
				
			||||||
    symbolTable.relateToOperator("unpackSnorm4x8",  EOpUnpackSnorm4x8);
 | 
					    symbolTable.relateToOperator("unpackSnorm4x8",  EOpUnpackSnorm4x8);
 | 
				
			||||||
    symbolTable.relateToOperator("packUnorm4x8",    EOpPackUnorm4x8);
 | 
					    symbolTable.relateToOperator("packUnorm4x8",    EOpPackUnorm4x8);
 | 
				
			||||||
@ -8078,17 +8146,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    symbolTable.relateToOperator("packDouble2x32",    EOpPackDouble2x32);
 | 
					    symbolTable.relateToOperator("packDouble2x32",    EOpPackDouble2x32);
 | 
				
			||||||
    symbolTable.relateToOperator("unpackDouble2x32",  EOpUnpackDouble2x32);
 | 
					    symbolTable.relateToOperator("unpackDouble2x32",  EOpUnpackDouble2x32);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("packHalf2x16",    EOpPackHalf2x16);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("unpackHalf2x16",  EOpUnpackHalf2x16);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    symbolTable.relateToOperator("packInt2x32",     EOpPackInt2x32);
 | 
					    symbolTable.relateToOperator("packInt2x32",     EOpPackInt2x32);
 | 
				
			||||||
    symbolTable.relateToOperator("unpackInt2x32",   EOpUnpackInt2x32);
 | 
					    symbolTable.relateToOperator("unpackInt2x32",   EOpUnpackInt2x32);
 | 
				
			||||||
    symbolTable.relateToOperator("packUint2x32",    EOpPackUint2x32);
 | 
					    symbolTable.relateToOperator("packUint2x32",    EOpPackUint2x32);
 | 
				
			||||||
    symbolTable.relateToOperator("unpackUint2x32",  EOpUnpackUint2x32);
 | 
					    symbolTable.relateToOperator("unpackUint2x32",  EOpUnpackUint2x32);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("packInt2x16",     EOpPackInt2x16);
 | 
					    symbolTable.relateToOperator("packInt2x16",     EOpPackInt2x16);
 | 
				
			||||||
    symbolTable.relateToOperator("unpackInt2x16",   EOpUnpackInt2x16);
 | 
					    symbolTable.relateToOperator("unpackInt2x16",   EOpUnpackInt2x16);
 | 
				
			||||||
    symbolTable.relateToOperator("packUint2x16",    EOpPackUint2x16);
 | 
					    symbolTable.relateToOperator("packUint2x16",    EOpPackUint2x16);
 | 
				
			||||||
@ -8109,11 +8172,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
    symbolTable.relateToOperator("unpack16",        EOpUnpack16);
 | 
					    symbolTable.relateToOperator("unpack16",        EOpUnpack16);
 | 
				
			||||||
    symbolTable.relateToOperator("unpack8",         EOpUnpack8);
 | 
					    symbolTable.relateToOperator("unpack8",         EOpUnpack8);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    symbolTable.relateToOperator("barrier",                    EOpBarrier);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("controlBarrier",             EOpBarrier);
 | 
					    symbolTable.relateToOperator("controlBarrier",             EOpBarrier);
 | 
				
			||||||
    symbolTable.relateToOperator("memoryBarrier",              EOpMemoryBarrier);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierAtomicCounter);
 | 
					    symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierAtomicCounter);
 | 
				
			||||||
    symbolTable.relateToOperator("memoryBarrierBuffer",        EOpMemoryBarrierBuffer);
 | 
					 | 
				
			||||||
    symbolTable.relateToOperator("memoryBarrierImage",         EOpMemoryBarrierImage);
 | 
					    symbolTable.relateToOperator("memoryBarrierImage",         EOpMemoryBarrierImage);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    symbolTable.relateToOperator("atomicLoad",     EOpAtomicLoad);
 | 
					    symbolTable.relateToOperator("atomicLoad",     EOpAtomicLoad);
 | 
				
			||||||
@ -8156,10 +8216,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
    symbolTable.relateToOperator("findMSB",           EOpFindMSB);
 | 
					    symbolTable.relateToOperator("findMSB",           EOpFindMSB);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    symbolTable.relateToOperator("helperInvocationEXT",  EOpIsHelperInvocation);
 | 
					    symbolTable.relateToOperator("helperInvocationEXT",  EOpIsHelperInvocation);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (PureOperatorBuiltins) {
 | 
					    if (PureOperatorBuiltins) {
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("imageSize",               EOpImageQuerySize);
 | 
					        symbolTable.relateToOperator("imageSize",               EOpImageQuerySize);
 | 
				
			||||||
        symbolTable.relateToOperator("imageSamples",            EOpImageQuerySamples);
 | 
					        symbolTable.relateToOperator("imageSamples",            EOpImageQuerySamples);
 | 
				
			||||||
        symbolTable.relateToOperator("imageLoad",               EOpImageLoad);
 | 
					        symbolTable.relateToOperator("imageLoad",               EOpImageLoad);
 | 
				
			||||||
@ -8177,28 +8235,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        symbolTable.relateToOperator("subpassLoad",             EOpSubpassLoad);
 | 
					        symbolTable.relateToOperator("subpassLoad",             EOpSubpassLoad);
 | 
				
			||||||
        symbolTable.relateToOperator("subpassLoadMS",           EOpSubpassLoadMS);
 | 
					        symbolTable.relateToOperator("subpassLoadMS",           EOpSubpassLoadMS);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        symbolTable.relateToOperator("textureSize",             EOpTextureQuerySize);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureQueryLod",         EOpTextureQueryLod);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureQueryLevels",      EOpTextureQueryLevels);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureSamples",          EOpTextureQuerySamples);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("texture",                 EOpTexture);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureProj",             EOpTextureProj);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureLod",              EOpTextureLod);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureOffset",           EOpTextureOffset);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("texelFetch",              EOpTextureFetch);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("texelFetchOffset",        EOpTextureFetchOffset);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureProjOffset",       EOpTextureProjOffset);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureLodOffset",        EOpTextureLodOffset);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureProjLod",          EOpTextureProjLod);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureProjLodOffset",    EOpTextureProjLodOffset);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureGrad",             EOpTextureGrad);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureGradOffset",       EOpTextureGradOffset);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureProjGrad",         EOpTextureProjGrad);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureProjGradOffset",   EOpTextureProjGradOffset);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("textureGather",           EOpTextureGather);
 | 
					        symbolTable.relateToOperator("textureGather",           EOpTextureGather);
 | 
				
			||||||
        symbolTable.relateToOperator("textureGatherOffset",     EOpTextureGatherOffset);
 | 
					        symbolTable.relateToOperator("textureGatherOffset",     EOpTextureGatherOffset);
 | 
				
			||||||
        symbolTable.relateToOperator("textureGatherOffsets",    EOpTextureGatherOffsets);
 | 
					        symbolTable.relateToOperator("textureGatherOffsets",    EOpTextureGatherOffsets);
 | 
				
			||||||
@ -8440,10 +8477,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
            symbolTable.relateToOperator("shadow2DEXT",              EOpTexture);
 | 
					            symbolTable.relateToOperator("shadow2DEXT",              EOpTexture);
 | 
				
			||||||
            symbolTable.relateToOperator("shadow2DProjEXT",          EOpTextureProj);
 | 
					            symbolTable.relateToOperator("shadow2DProjEXT",          EOpTextureProj);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    switch(language) {
 | 
					    switch(language) {
 | 
				
			||||||
    case EShLangVertex:
 | 
					    case EShLangVertex:
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
@ -8481,8 +8516,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 | 
				
			|||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case EShLangCompute:
 | 
					    case EShLangCompute:
 | 
				
			||||||
        symbolTable.relateToOperator("memoryBarrierShared",         EOpMemoryBarrierShared);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("groupMemoryBarrier",          EOpGroupMemoryBarrier);
 | 
					 | 
				
			||||||
        symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared);
 | 
					        symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared);
 | 
				
			||||||
        if ((profile != EEsProfile && version >= 450) ||
 | 
					        if ((profile != EEsProfile && version >= 450) ||
 | 
				
			||||||
            (profile == EEsProfile && version >= 320)) {
 | 
					            (profile == EEsProfile && version >= 320)) {
 | 
				
			||||||
 | 
				
			|||||||
@ -801,10 +801,8 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
 | 
				
			|||||||
    //
 | 
					    //
 | 
				
			||||||
    // Add a new newNode for the conversion.
 | 
					    // Add a new newNode for the conversion.
 | 
				
			||||||
    //
 | 
					    //
 | 
				
			||||||
    TIntermUnary* newNode = nullptr;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    TOperator newOp = EOpNull;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    bool convertToIntTypes = (convertTo == EbtInt8  || convertTo == EbtUint8  ||
 | 
					    bool convertToIntTypes = (convertTo == EbtInt8  || convertTo == EbtUint8  ||
 | 
				
			||||||
                              convertTo == EbtInt16 || convertTo == EbtUint16 ||
 | 
					                              convertTo == EbtInt16 || convertTo == EbtUint16 ||
 | 
				
			||||||
                              convertTo == EbtInt   || convertTo == EbtUint   ||
 | 
					                              convertTo == EbtInt   || convertTo == EbtUint   ||
 | 
				
			||||||
@ -838,7 +836,10 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
 | 
				
			|||||||
            (node->getBasicType() == EbtFloat16 && ! convertToFloatTypes))
 | 
					            (node->getBasicType() == EbtFloat16 && ! convertToFloatTypes))
 | 
				
			||||||
            return nullptr;
 | 
					            return nullptr;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    TIntermUnary* newNode = nullptr;
 | 
				
			||||||
 | 
					    TOperator newOp = EOpNull;
 | 
				
			||||||
    if (!buildConvertOp(convertTo, node->getBasicType(), newOp)) {
 | 
					    if (!buildConvertOp(convertTo, node->getBasicType(), newOp)) {
 | 
				
			||||||
        return nullptr;
 | 
					        return nullptr;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -847,11 +848,14 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
 | 
				
			|||||||
    newNode = addUnaryNode(newOp, node, node->getLoc(), newType);
 | 
					    newNode = addUnaryNode(newOp, node, node->getLoc(), newType);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (node->getAsConstantUnion()) {
 | 
					    if (node->getAsConstantUnion()) {
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        // 8/16-bit storage extensions don't support 8/16-bit constants, so don't fold conversions
 | 
					        // 8/16-bit storage extensions don't support 8/16-bit constants, so don't fold conversions
 | 
				
			||||||
        // to those types
 | 
					        // to those types
 | 
				
			||||||
        if ((getArithemeticInt8Enabled() || !(convertTo == EbtInt8 || convertTo == EbtUint8)) &&
 | 
					        if ((getArithemeticInt8Enabled() || !(convertTo == EbtInt8 || convertTo == EbtUint8)) &&
 | 
				
			||||||
            (getArithemeticInt16Enabled() || !(convertTo == EbtInt16 || convertTo == EbtUint16)) &&
 | 
					            (getArithemeticInt16Enabled() || !(convertTo == EbtInt16 || convertTo == EbtUint16)) &&
 | 
				
			||||||
            (getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16))) {
 | 
					            (getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16)))
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
            TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType);
 | 
					            TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType);
 | 
				
			||||||
            if (folded)
 | 
					            if (folded)
 | 
				
			||||||
                return folded;
 | 
					                return folded;
 | 
				
			||||||
 | 
				
			|||||||
@ -1160,6 +1160,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
 | 
				
			|||||||
                    const TQualifier& argQualifier = argType.getQualifier();
 | 
					                    const TQualifier& argQualifier = argType.getQualifier();
 | 
				
			||||||
                    if (argQualifier.isMemory() && (argType.containsOpaque() || argType.isReference())) {
 | 
					                    if (argQualifier.isMemory() && (argType.containsOpaque() || argType.isReference())) {
 | 
				
			||||||
                        const char* message = "argument cannot drop memory qualifier when passed to formal parameter";
 | 
					                        const char* message = "argument cannot drop memory qualifier when passed to formal parameter";
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
                        if (argQualifier.volatil && ! formalQualifier.volatil)
 | 
					                        if (argQualifier.volatil && ! formalQualifier.volatil)
 | 
				
			||||||
                            error(arguments->getLoc(), message, "volatile", "");
 | 
					                            error(arguments->getLoc(), message, "volatile", "");
 | 
				
			||||||
                        if (argQualifier.coherent && ! (formalQualifier.devicecoherent || formalQualifier.coherent))
 | 
					                        if (argQualifier.coherent && ! (formalQualifier.devicecoherent || formalQualifier.coherent))
 | 
				
			||||||
@ -1179,6 +1180,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
 | 
				
			|||||||
                        // Don't check 'restrict', it is different than the rest:
 | 
					                        // Don't check 'restrict', it is different than the rest:
 | 
				
			||||||
                        // "...but only restrict can be taken away from a calling argument, by a formal parameter that
 | 
					                        // "...but only restrict can be taken away from a calling argument, by a formal parameter that
 | 
				
			||||||
                        // lacks the restrict qualifier..."
 | 
					                        // lacks the restrict qualifier..."
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    if (!builtIn && argQualifier.getFormat() != formalQualifier.getFormat()) {
 | 
					                    if (!builtIn && argQualifier.getFormat() != formalQualifier.getFormat()) {
 | 
				
			||||||
                        // we have mismatched formats, which should only be allowed if writeonly
 | 
					                        // we have mismatched formats, which should only be allowed if writeonly
 | 
				
			||||||
@ -2201,7 +2203,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
 | 
				
			|||||||
        break;
 | 
					        break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (callNode.getOp() > EOpSubgroupGuardStart && callNode.getOp() < EOpSubgroupGuardStop) {
 | 
					    if (callNode.isSubgroup()) {
 | 
				
			||||||
        // these require SPIR-V 1.3
 | 
					        // these require SPIR-V 1.3
 | 
				
			||||||
        if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_3)
 | 
					        if (spvVersion.spv > 0 && spvVersion.spv < EShTargetSpv_1_3)
 | 
				
			||||||
            error(loc, "requires SPIR-V 1.3", "subgroup op", "");
 | 
					            error(loc, "requires SPIR-V 1.3", "subgroup op", "");
 | 
				
			||||||
@ -2779,6 +2781,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
 | 
				
			|||||||
    // it, in which case the type comes from the argument instead of from the
 | 
					    // it, in which case the type comes from the argument instead of from the
 | 
				
			||||||
    // constructor function.
 | 
					    // constructor function.
 | 
				
			||||||
    switch (op) {
 | 
					    switch (op) {
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    case EOpConstructNonuniform:
 | 
					    case EOpConstructNonuniform:
 | 
				
			||||||
        if (node != nullptr && node->getAsTyped() != nullptr) {
 | 
					        if (node != nullptr && node->getAsTyped() != nullptr) {
 | 
				
			||||||
            type.shallowCopy(node->getAsTyped()->getType());
 | 
					            type.shallowCopy(node->getAsTyped()->getType());
 | 
				
			||||||
@ -2786,6 +2789,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
 | 
				
			|||||||
            type.getQualifier().nonUniform = true;
 | 
					            type.getQualifier().nonUniform = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    default:
 | 
					    default:
 | 
				
			||||||
        type.shallowCopy(function.getType());
 | 
					        type.shallowCopy(function.getType());
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
@ -2794,10 +2798,8 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
 | 
				
			|||||||
    // See if it's a matrix
 | 
					    // See if it's a matrix
 | 
				
			||||||
    bool constructingMatrix = false;
 | 
					    bool constructingMatrix = false;
 | 
				
			||||||
    switch (op) {
 | 
					    switch (op) {
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    case EOpConstructTextureSampler:
 | 
					    case EOpConstructTextureSampler:
 | 
				
			||||||
        return constructorTextureSamplerError(loc, function);
 | 
					        return constructorTextureSamplerError(loc, function);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
    case EOpConstructMat2x2:
 | 
					    case EOpConstructMat2x2:
 | 
				
			||||||
    case EOpConstructMat2x3:
 | 
					    case EOpConstructMat2x3:
 | 
				
			||||||
    case EOpConstructMat2x4:
 | 
					    case EOpConstructMat2x4:
 | 
				
			||||||
@ -3389,11 +3391,11 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
 | 
				
			|||||||
                    requireProfile(loc, ~EEsProfile, "fragment-shader struct input containing an array");
 | 
					                    requireProfile(loc, ~EEsProfile, "fragment-shader struct input containing an array");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
       case EShLangCompute:
 | 
					       case EShLangCompute:
 | 
				
			||||||
            if (! symbolTable.atBuiltInLevel())
 | 
					            if (! symbolTable.atBuiltInLevel())
 | 
				
			||||||
                error(loc, "global storage input qualifier cannot be used in a compute shader", "in", "");
 | 
					                error(loc, "global storage input qualifier cannot be used in a compute shader", "in", "");
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
       case EShLangTessControl:
 | 
					       case EShLangTessControl:
 | 
				
			||||||
            if (qualifier.patch)
 | 
					            if (qualifier.patch)
 | 
				
			||||||
                error(loc, "can only use on output in tessellation-control shader", "patch", "");
 | 
					                error(loc, "can only use on output in tessellation-control shader", "patch", "");
 | 
				
			||||||
@ -3434,10 +3436,10 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
 | 
				
			|||||||
                error(loc, "cannot contain a double, int64, or uint64", GetStorageQualifierString(qualifier.storage), "");
 | 
					                error(loc, "cannot contain a double, int64, or uint64", GetStorageQualifierString(qualifier.storage), "");
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
        case EShLangCompute:
 | 
					        case EShLangCompute:
 | 
				
			||||||
            error(loc, "global storage output qualifier cannot be used in a compute shader", "out", "");
 | 
					            error(loc, "global storage output qualifier cannot be used in a compute shader", "out", "");
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        case EShLangTessEvaluation:
 | 
					        case EShLangTessEvaluation:
 | 
				
			||||||
            if (qualifier.patch)
 | 
					            if (qualifier.patch)
 | 
				
			||||||
                error(loc, "can only use on input in tessellation-evaluation shader", "patch", "");
 | 
					                error(loc, "can only use on input in tessellation-evaluation shader", "patch", "");
 | 
				
			||||||
@ -3815,10 +3817,6 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua
 | 
				
			|||||||
    // for ES, if size isn't coming from an initializer, it has to be explicitly declared now,
 | 
					    // for ES, if size isn't coming from an initializer, it has to be explicitly declared now,
 | 
				
			||||||
    // with very few exceptions
 | 
					    // with very few exceptions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // last member of ssbo block exception:
 | 
					 | 
				
			||||||
    if (qualifier.storage == EvqBuffer && lastMember)
 | 
					 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // implicitly-sized io exceptions:
 | 
					    // implicitly-sized io exceptions:
 | 
				
			||||||
    switch (language) {
 | 
					    switch (language) {
 | 
				
			||||||
    case EShLangGeometry:
 | 
					    case EShLangGeometry:
 | 
				
			||||||
@ -3853,6 +3851,10 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // last member of ssbo block exception:
 | 
				
			||||||
 | 
					    if (qualifier.storage == EvqBuffer && lastMember)
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    arraySizeRequiredCheck(loc, *arraySizes);
 | 
					    arraySizeRequiredCheck(loc, *arraySizes);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -4477,6 +4479,7 @@ void TParseContext::paramCheckFixStorage(const TSourceLoc& loc, const TStorageQu
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& qualifier, TType& type)
 | 
					void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& qualifier, TType& type)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    if (qualifier.isMemory()) {
 | 
					    if (qualifier.isMemory()) {
 | 
				
			||||||
        type.getQualifier().volatil   = qualifier.volatil;
 | 
					        type.getQualifier().volatil   = qualifier.volatil;
 | 
				
			||||||
        type.getQualifier().coherent  = qualifier.coherent;
 | 
					        type.getQualifier().coherent  = qualifier.coherent;
 | 
				
			||||||
@ -4489,6 +4492,7 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali
 | 
				
			|||||||
        type.getQualifier().writeonly = qualifier.writeonly;
 | 
					        type.getQualifier().writeonly = qualifier.writeonly;
 | 
				
			||||||
        type.getQualifier().restrict  = qualifier.restrict;
 | 
					        type.getQualifier().restrict  = qualifier.restrict;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (qualifier.isAuxiliary() ||
 | 
					    if (qualifier.isAuxiliary() ||
 | 
				
			||||||
        qualifier.isInterpolation())
 | 
					        qualifier.isInterpolation())
 | 
				
			||||||
@ -5295,11 +5299,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
 | 
				
			|||||||
            error(loc, "needs a literal integer", "buffer_reference_align", "");
 | 
					            error(loc, "needs a literal integer", "buffer_reference_align", "");
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (language) {
 | 
					    switch (language) {
 | 
				
			||||||
    case EShLangVertex:
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    case EShLangTessControl:
 | 
					    case EShLangTessControl:
 | 
				
			||||||
        if (id == "vertices") {
 | 
					        if (id == "vertices") {
 | 
				
			||||||
            if (value == 0)
 | 
					            if (value == 0)
 | 
				
			||||||
@ -5312,9 +5315,6 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case EShLangTessEvaluation:
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    case EShLangGeometry:
 | 
					    case EShLangGeometry:
 | 
				
			||||||
        if (id == "invocations") {
 | 
					        if (id == "invocations") {
 | 
				
			||||||
            profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, nullptr, "invocations");
 | 
					            profileRequires(loc, ECompatibilityProfile | ECoreProfile, 400, nullptr, "invocations");
 | 
				
			||||||
@ -5387,16 +5387,17 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    case EShLangTaskNV:
 | 
					    case EShLangTaskNV:
 | 
				
			||||||
        // Fall through
 | 
					        // Fall through
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    case EShLangCompute:
 | 
					    case EShLangCompute:
 | 
				
			||||||
        if (id.compare(0, 11, "local_size_") == 0) {
 | 
					        if (id.compare(0, 11, "local_size_") == 0) {
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
            if (language == EShLangMeshNV || language == EShLangTaskNV) {
 | 
					            if (language == EShLangMeshNV || language == EShLangTaskNV) {
 | 
				
			||||||
                requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "gl_WorkGroupSize");
 | 
					                requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "gl_WorkGroupSize");
 | 
				
			||||||
            }
 | 
					            } else {
 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize");
 | 
					                profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize");
 | 
				
			||||||
                profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize");
 | 
					                profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
            if (nonLiteral)
 | 
					            if (nonLiteral)
 | 
				
			||||||
                error(loc, "needs a literal integer", "local_size", "");
 | 
					                error(loc, "needs a literal integer", "local_size", "");
 | 
				
			||||||
            if (id.size() == 12 && value == 0) {
 | 
					            if (id.size() == 12 && value == 0) {
 | 
				
			||||||
@ -5434,12 +5435,11 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    default:
 | 
					    default:
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // GLSLANG_WEB
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), "");
 | 
					    error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), "");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -7386,6 +7386,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
 | 
				
			|||||||
    for (unsigned int member = 0; member < typeList.size(); ++member) {
 | 
					    for (unsigned int member = 0; member < typeList.size(); ++member) {
 | 
				
			||||||
        TQualifier& memberQualifier = typeList[member].type->getQualifier();
 | 
					        TQualifier& memberQualifier = typeList[member].type->getQualifier();
 | 
				
			||||||
        const TSourceLoc& memberLoc = typeList[member].loc;
 | 
					        const TSourceLoc& memberLoc = typeList[member].loc;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        if (memberQualifier.hasStream()) {
 | 
					        if (memberQualifier.hasStream()) {
 | 
				
			||||||
            if (defaultQualification.layoutStream != memberQualifier.layoutStream)
 | 
					            if (defaultQualification.layoutStream != memberQualifier.layoutStream)
 | 
				
			||||||
                error(memberLoc, "member cannot contradict block", "stream", "");
 | 
					                error(memberLoc, "member cannot contradict block", "stream", "");
 | 
				
			||||||
@ -7399,6 +7400,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
 | 
				
			|||||||
            if (defaultQualification.layoutXfbBuffer != memberQualifier.layoutXfbBuffer)
 | 
					            if (defaultQualification.layoutXfbBuffer != memberQualifier.layoutXfbBuffer)
 | 
				
			||||||
                error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", "");
 | 
					                error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", "");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (memberQualifier.hasPacking())
 | 
					        if (memberQualifier.hasPacking())
 | 
				
			||||||
            error(memberLoc, "member of block cannot have a packing layout qualifier", typeList[member].type->getFieldName().c_str(), "");
 | 
					            error(memberLoc, "member of block cannot have a packing layout qualifier", typeList[member].type->getFieldName().c_str(), "");
 | 
				
			||||||
@ -7441,6 +7443,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    layoutMemberLocationArrayCheck(loc, memberWithLocation, arraySizes);
 | 
					    layoutMemberLocationArrayCheck(loc, memberWithLocation, arraySizes);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    // Ensure that the block has an XfbBuffer assigned. This is needed
 | 
					    // Ensure that the block has an XfbBuffer assigned. This is needed
 | 
				
			||||||
    // because if the block has a XfbOffset assigned, then it is
 | 
					    // because if the block has a XfbOffset assigned, then it is
 | 
				
			||||||
    // assumed that it has implicitly assigned the current global
 | 
					    // assumed that it has implicitly assigned the current global
 | 
				
			||||||
@ -7450,6 +7453,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
 | 
				
			|||||||
       if (!currentBlockQualifier.hasXfbBuffer() && currentBlockQualifier.hasXfbOffset())
 | 
					       if (!currentBlockQualifier.hasXfbBuffer() && currentBlockQualifier.hasXfbOffset())
 | 
				
			||||||
          currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer;
 | 
					          currentBlockQualifier.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Process the members
 | 
					    // Process the members
 | 
				
			||||||
    fixBlockLocations(loc, currentBlockQualifier, typeList, memberWithLocation, memberWithoutLocation);
 | 
					    fixBlockLocations(loc, currentBlockQualifier, typeList, memberWithLocation, memberWithoutLocation);
 | 
				
			||||||
@ -8006,6 +8010,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
 | 
				
			|||||||
        else
 | 
					        else
 | 
				
			||||||
            error(loc, "can only apply to 'in'", "point_mode", "");
 | 
					            error(loc, "can only apply to 'in'", "point_mode", "");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    for (int i = 0; i < 3; ++i) {
 | 
					    for (int i = 0; i < 3; ++i) {
 | 
				
			||||||
        if (publicType.shaderQualifiers.localSizeNotDefault[i]) {
 | 
					        if (publicType.shaderQualifiers.localSizeNotDefault[i]) {
 | 
				
			||||||
            if (publicType.qualifier.storage == EvqVaryingIn) {
 | 
					            if (publicType.qualifier.storage == EvqVaryingIn) {
 | 
				
			||||||
@ -8022,7 +8027,9 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
 | 
				
			|||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (intermediate.getLocalSize(i) > (unsigned int)max)
 | 
					                        if (intermediate.getLocalSize(i) > (unsigned int)max)
 | 
				
			||||||
                            error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", "");
 | 
					                            error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", "");
 | 
				
			||||||
                    } else if (language == EShLangMeshNV) {
 | 
					                    }
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
 | 
					                    else if (language == EShLangMeshNV) {
 | 
				
			||||||
                        switch (i) {
 | 
					                        switch (i) {
 | 
				
			||||||
                        case 0: max = resources.maxMeshWorkGroupSizeX_NV; break;
 | 
					                        case 0: max = resources.maxMeshWorkGroupSizeX_NV; break;
 | 
				
			||||||
                        case 1: max = resources.maxMeshWorkGroupSizeY_NV; break;
 | 
					                        case 1: max = resources.maxMeshWorkGroupSizeY_NV; break;
 | 
				
			||||||
@ -8040,7 +8047,9 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
 | 
				
			|||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if (intermediate.getLocalSize(i) > (unsigned int)max)
 | 
					                        if (intermediate.getLocalSize(i) > (unsigned int)max)
 | 
				
			||||||
                            error(loc, "too large; see gl_MaxTaskWorkGroupSizeNV", "local_size", "");
 | 
					                            error(loc, "too large; see gl_MaxTaskWorkGroupSizeNV", "local_size", "");
 | 
				
			||||||
                    } else {
 | 
					                    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					                    else {
 | 
				
			||||||
                        assert(0);
 | 
					                        assert(0);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -8065,6 +8074,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    if (publicType.shaderQualifiers.earlyFragmentTests) {
 | 
					    if (publicType.shaderQualifiers.earlyFragmentTests) {
 | 
				
			||||||
        if (publicType.qualifier.storage == EvqVaryingIn)
 | 
					        if (publicType.qualifier.storage == EvqVaryingIn)
 | 
				
			||||||
            intermediate.setEarlyFragmentTests();
 | 
					            intermediate.setEarlyFragmentTests();
 | 
				
			||||||
 | 
				
			|||||||
@ -343,6 +343,7 @@ void TScanContext::fillInKeywordMap()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    (*KeywordMap)["const"] =                   CONST;
 | 
					    (*KeywordMap)["const"] =                   CONST;
 | 
				
			||||||
    (*KeywordMap)["uniform"] =                 UNIFORM;
 | 
					    (*KeywordMap)["uniform"] =                 UNIFORM;
 | 
				
			||||||
 | 
					    (*KeywordMap)["buffer"] =                  BUFFER;
 | 
				
			||||||
    (*KeywordMap)["in"] =                      IN;
 | 
					    (*KeywordMap)["in"] =                      IN;
 | 
				
			||||||
    (*KeywordMap)["out"] =                     OUT;
 | 
					    (*KeywordMap)["out"] =                     OUT;
 | 
				
			||||||
    (*KeywordMap)["smooth"] =                  SMOOTH;
 | 
					    (*KeywordMap)["smooth"] =                  SMOOTH;
 | 
				
			||||||
@ -410,7 +411,6 @@ void TScanContext::fillInKeywordMap()
 | 
				
			|||||||
    (*KeywordMap)["attribute"] =               ATTRIBUTE;
 | 
					    (*KeywordMap)["attribute"] =               ATTRIBUTE;
 | 
				
			||||||
    (*KeywordMap)["varying"] =                 VARYING;
 | 
					    (*KeywordMap)["varying"] =                 VARYING;
 | 
				
			||||||
    (*KeywordMap)["noperspective"] =           NOPERSPECTIVE;
 | 
					    (*KeywordMap)["noperspective"] =           NOPERSPECTIVE;
 | 
				
			||||||
    (*KeywordMap)["buffer"] =                  BUFFER;
 | 
					 | 
				
			||||||
    (*KeywordMap)["coherent"] =                COHERENT;
 | 
					    (*KeywordMap)["coherent"] =                COHERENT;
 | 
				
			||||||
    (*KeywordMap)["devicecoherent"] =          DEVICECOHERENT;
 | 
					    (*KeywordMap)["devicecoherent"] =          DEVICECOHERENT;
 | 
				
			||||||
    (*KeywordMap)["queuefamilycoherent"] =     QUEUEFAMILYCOHERENT;
 | 
					    (*KeywordMap)["queuefamilycoherent"] =     QUEUEFAMILYCOHERENT;
 | 
				
			||||||
@ -564,10 +564,6 @@ void TScanContext::fillInKeywordMap()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    (*KeywordMap)["sampler2D"] =               SAMPLER2D;
 | 
					    (*KeywordMap)["sampler2D"] =               SAMPLER2D;
 | 
				
			||||||
    (*KeywordMap)["samplerCube"] =             SAMPLERCUBE;
 | 
					    (*KeywordMap)["samplerCube"] =             SAMPLERCUBE;
 | 
				
			||||||
    (*KeywordMap)["samplerCubeArray"] =        SAMPLERCUBEARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["samplerCubeArrayShadow"] =  SAMPLERCUBEARRAYSHADOW;
 | 
					 | 
				
			||||||
    (*KeywordMap)["isamplerCubeArray"] =       ISAMPLERCUBEARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["usamplerCubeArray"] =       USAMPLERCUBEARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["samplerCubeShadow"] =       SAMPLERCUBESHADOW;
 | 
					    (*KeywordMap)["samplerCubeShadow"] =       SAMPLERCUBESHADOW;
 | 
				
			||||||
    (*KeywordMap)["sampler2DArray"] =          SAMPLER2DARRAY;
 | 
					    (*KeywordMap)["sampler2DArray"] =          SAMPLER2DARRAY;
 | 
				
			||||||
    (*KeywordMap)["sampler2DArrayShadow"] =    SAMPLER2DARRAYSHADOW;
 | 
					    (*KeywordMap)["sampler2DArrayShadow"] =    SAMPLER2DARRAYSHADOW;
 | 
				
			||||||
@ -582,7 +578,30 @@ void TScanContext::fillInKeywordMap()
 | 
				
			|||||||
    (*KeywordMap)["sampler3D"] =               SAMPLER3D;
 | 
					    (*KeywordMap)["sampler3D"] =               SAMPLER3D;
 | 
				
			||||||
    (*KeywordMap)["sampler2DShadow"] =         SAMPLER2DSHADOW;
 | 
					    (*KeywordMap)["sampler2DShadow"] =         SAMPLER2DSHADOW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    (*KeywordMap)["texture2D"] =               TEXTURE2D;
 | 
				
			||||||
 | 
					    (*KeywordMap)["textureCube"] =             TEXTURECUBE;
 | 
				
			||||||
 | 
					    (*KeywordMap)["texture2DArray"] =          TEXTURE2DARRAY;
 | 
				
			||||||
 | 
					    (*KeywordMap)["itexture2D"] =              ITEXTURE2D;
 | 
				
			||||||
 | 
					    (*KeywordMap)["itexture3D"] =              ITEXTURE3D;
 | 
				
			||||||
 | 
					    (*KeywordMap)["itextureCube"] =            ITEXTURECUBE;
 | 
				
			||||||
 | 
					    (*KeywordMap)["itexture2DArray"] =         ITEXTURE2DARRAY;
 | 
				
			||||||
 | 
					    (*KeywordMap)["utexture2D"] =              UTEXTURE2D;
 | 
				
			||||||
 | 
					    (*KeywordMap)["utexture3D"] =              UTEXTURE3D;
 | 
				
			||||||
 | 
					    (*KeywordMap)["utextureCube"] =            UTEXTURECUBE;
 | 
				
			||||||
 | 
					    (*KeywordMap)["utexture2DArray"] =         UTEXTURE2DARRAY;
 | 
				
			||||||
 | 
					    (*KeywordMap)["texture3D"] =               TEXTURE3D;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    (*KeywordMap)["sampler"] =                 SAMPLER;
 | 
				
			||||||
 | 
					    (*KeywordMap)["samplerShadow"] =           SAMPLERSHADOW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
 | 
					    (*KeywordMap)["textureCubeArray"] =        TEXTURECUBEARRAY;
 | 
				
			||||||
 | 
					    (*KeywordMap)["itextureCubeArray"] =       ITEXTURECUBEARRAY;
 | 
				
			||||||
 | 
					    (*KeywordMap)["utextureCubeArray"] =       UTEXTURECUBEARRAY;
 | 
				
			||||||
 | 
					    (*KeywordMap)["samplerCubeArray"] =        SAMPLERCUBEARRAY;
 | 
				
			||||||
 | 
					    (*KeywordMap)["samplerCubeArrayShadow"] =  SAMPLERCUBEARRAYSHADOW;
 | 
				
			||||||
 | 
					    (*KeywordMap)["isamplerCubeArray"] =       ISAMPLERCUBEARRAY;
 | 
				
			||||||
 | 
					    (*KeywordMap)["usamplerCubeArray"] =       USAMPLERCUBEARRAY;
 | 
				
			||||||
    (*KeywordMap)["sampler1DArrayShadow"] =    SAMPLER1DARRAYSHADOW;
 | 
					    (*KeywordMap)["sampler1DArrayShadow"] =    SAMPLER1DARRAYSHADOW;
 | 
				
			||||||
    (*KeywordMap)["isampler1DArray"] =         ISAMPLER1DARRAY;
 | 
					    (*KeywordMap)["isampler1DArray"] =         ISAMPLER1DARRAY;
 | 
				
			||||||
    (*KeywordMap)["usampler1D"] =              USAMPLER1D;
 | 
					    (*KeywordMap)["usampler1D"] =              USAMPLER1D;
 | 
				
			||||||
@ -609,28 +628,11 @@ void TScanContext::fillInKeywordMap()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    (*KeywordMap)["__samplerExternal2DY2YEXT"] = SAMPLEREXTERNAL2DY2YEXT; // GL_EXT_YUV_target
 | 
					    (*KeywordMap)["__samplerExternal2DY2YEXT"] = SAMPLEREXTERNAL2DY2YEXT; // GL_EXT_YUV_target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (*KeywordMap)["sampler"] =                 SAMPLER;
 | 
					 | 
				
			||||||
    (*KeywordMap)["samplerShadow"] =           SAMPLERSHADOW;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    (*KeywordMap)["texture2D"] =               TEXTURE2D;
 | 
					 | 
				
			||||||
    (*KeywordMap)["textureCube"] =             TEXTURECUBE;
 | 
					 | 
				
			||||||
    (*KeywordMap)["textureCubeArray"] =        TEXTURECUBEARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["itextureCubeArray"] =       ITEXTURECUBEARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["utextureCubeArray"] =       UTEXTURECUBEARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["itexture1DArray"] =         ITEXTURE1DARRAY;
 | 
					    (*KeywordMap)["itexture1DArray"] =         ITEXTURE1DARRAY;
 | 
				
			||||||
    (*KeywordMap)["utexture1D"] =              UTEXTURE1D;
 | 
					    (*KeywordMap)["utexture1D"] =              UTEXTURE1D;
 | 
				
			||||||
    (*KeywordMap)["itexture1D"] =              ITEXTURE1D;
 | 
					    (*KeywordMap)["itexture1D"] =              ITEXTURE1D;
 | 
				
			||||||
    (*KeywordMap)["utexture1DArray"] =         UTEXTURE1DARRAY;
 | 
					    (*KeywordMap)["utexture1DArray"] =         UTEXTURE1DARRAY;
 | 
				
			||||||
    (*KeywordMap)["textureBuffer"] =           TEXTUREBUFFER;
 | 
					    (*KeywordMap)["textureBuffer"] =           TEXTUREBUFFER;
 | 
				
			||||||
    (*KeywordMap)["texture2DArray"] =          TEXTURE2DARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["itexture2D"] =              ITEXTURE2D;
 | 
					 | 
				
			||||||
    (*KeywordMap)["itexture3D"] =              ITEXTURE3D;
 | 
					 | 
				
			||||||
    (*KeywordMap)["itextureCube"] =            ITEXTURECUBE;
 | 
					 | 
				
			||||||
    (*KeywordMap)["itexture2DArray"] =         ITEXTURE2DARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["utexture2D"] =              UTEXTURE2D;
 | 
					 | 
				
			||||||
    (*KeywordMap)["utexture3D"] =              UTEXTURE3D;
 | 
					 | 
				
			||||||
    (*KeywordMap)["utextureCube"] =            UTEXTURECUBE;
 | 
					 | 
				
			||||||
    (*KeywordMap)["utexture2DArray"] =         UTEXTURE2DARRAY;
 | 
					 | 
				
			||||||
    (*KeywordMap)["itexture2DRect"] =          ITEXTURE2DRECT;
 | 
					    (*KeywordMap)["itexture2DRect"] =          ITEXTURE2DRECT;
 | 
				
			||||||
    (*KeywordMap)["utexture2DRect"] =          UTEXTURE2DRECT;
 | 
					    (*KeywordMap)["utexture2DRect"] =          UTEXTURE2DRECT;
 | 
				
			||||||
    (*KeywordMap)["itextureBuffer"] =          ITEXTUREBUFFER;
 | 
					    (*KeywordMap)["itextureBuffer"] =          ITEXTUREBUFFER;
 | 
				
			||||||
@ -642,7 +644,6 @@ void TScanContext::fillInKeywordMap()
 | 
				
			|||||||
    (*KeywordMap)["itexture2DMSArray"] =       ITEXTURE2DMSARRAY;
 | 
					    (*KeywordMap)["itexture2DMSArray"] =       ITEXTURE2DMSARRAY;
 | 
				
			||||||
    (*KeywordMap)["utexture2DMSArray"] =       UTEXTURE2DMSARRAY;
 | 
					    (*KeywordMap)["utexture2DMSArray"] =       UTEXTURE2DMSARRAY;
 | 
				
			||||||
    (*KeywordMap)["texture1D"] =               TEXTURE1D;
 | 
					    (*KeywordMap)["texture1D"] =               TEXTURE1D;
 | 
				
			||||||
    (*KeywordMap)["texture3D"] =               TEXTURE3D;
 | 
					 | 
				
			||||||
    (*KeywordMap)["texture2DRect"] =           TEXTURE2DRECT;
 | 
					    (*KeywordMap)["texture2DRect"] =           TEXTURE2DRECT;
 | 
				
			||||||
    (*KeywordMap)["texture1DArray"] =          TEXTURE1DARRAY;
 | 
					    (*KeywordMap)["texture1DArray"] =          TEXTURE1DARRAY;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -904,6 +905,13 @@ int TScanContext::tokenizeIdentifier()
 | 
				
			|||||||
    case CASE:
 | 
					    case CASE:
 | 
				
			||||||
        return keyword;
 | 
					        return keyword;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case BUFFER:
 | 
				
			||||||
 | 
					        afterBuffer = true;
 | 
				
			||||||
 | 
					        if ((parseContext.isEsProfile() && parseContext.version < 310) ||
 | 
				
			||||||
 | 
					            (!parseContext.isEsProfile() && parseContext.version < 430))
 | 
				
			||||||
 | 
					            return identifierOrType();
 | 
				
			||||||
 | 
					        return keyword;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case STRUCT:
 | 
					    case STRUCT:
 | 
				
			||||||
        afterStruct = true;
 | 
					        afterStruct = true;
 | 
				
			||||||
        return keyword;
 | 
					        return keyword;
 | 
				
			||||||
@ -997,12 +1005,6 @@ int TScanContext::tokenizeIdentifier()
 | 
				
			|||||||
        if (parseContext.isEsProfile() && parseContext.version >= 300)
 | 
					        if (parseContext.isEsProfile() && parseContext.version >= 300)
 | 
				
			||||||
            reservedWord();
 | 
					            reservedWord();
 | 
				
			||||||
        return keyword;
 | 
					        return keyword;
 | 
				
			||||||
    case BUFFER:
 | 
					 | 
				
			||||||
        afterBuffer = true;
 | 
					 | 
				
			||||||
        if ((parseContext.isEsProfile() && parseContext.version < 310) ||
 | 
					 | 
				
			||||||
            (!parseContext.isEsProfile() && parseContext.version < 430))
 | 
					 | 
				
			||||||
            return identifierOrType();
 | 
					 | 
				
			||||||
        return keyword;
 | 
					 | 
				
			||||||
    case PAYLOADNV:
 | 
					    case PAYLOADNV:
 | 
				
			||||||
    case PAYLOADINNV:
 | 
					    case PAYLOADINNV:
 | 
				
			||||||
    case HITATTRNV:
 | 
					    case HITATTRNV:
 | 
				
			||||||
@ -1057,13 +1059,12 @@ int TScanContext::tokenizeIdentifier()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    case SUBROUTINE:
 | 
					    case SUBROUTINE:
 | 
				
			||||||
        return es30ReservedFromGLSL(400);
 | 
					        return es30ReservedFromGLSL(400);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    case SHARED:
 | 
					    case SHARED:
 | 
				
			||||||
        if ((parseContext.isEsProfile() && parseContext.version < 300) ||
 | 
					        if ((parseContext.isEsProfile() && parseContext.version < 300) ||
 | 
				
			||||||
            (!parseContext.isEsProfile() && parseContext.version < 140))
 | 
					            (!parseContext.isEsProfile() && parseContext.version < 140))
 | 
				
			||||||
            return identifierOrType();
 | 
					            return identifierOrType();
 | 
				
			||||||
        return keyword;
 | 
					        return keyword;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    case LAYOUT:
 | 
					    case LAYOUT:
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        const int numLayoutExts = 2;
 | 
					        const int numLayoutExts = 2;
 | 
				
			||||||
@ -1321,7 +1322,6 @@ int TScanContext::tokenizeIdentifier()
 | 
				
			|||||||
            return keyword;
 | 
					            return keyword;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return identifierOrType();
 | 
					        return identifierOrType();
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case SAMPLERCUBEARRAY:
 | 
					    case SAMPLERCUBEARRAY:
 | 
				
			||||||
    case SAMPLERCUBEARRAYSHADOW:
 | 
					    case SAMPLERCUBEARRAYSHADOW:
 | 
				
			||||||
@ -1335,6 +1335,15 @@ int TScanContext::tokenizeIdentifier()
 | 
				
			|||||||
            reservedWord();
 | 
					            reservedWord();
 | 
				
			||||||
        return keyword;
 | 
					        return keyword;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case TEXTURECUBEARRAY:
 | 
				
			||||||
 | 
					    case ITEXTURECUBEARRAY:
 | 
				
			||||||
 | 
					    case UTEXTURECUBEARRAY:
 | 
				
			||||||
 | 
					        if (parseContext.spvVersion.vulkan > 0)
 | 
				
			||||||
 | 
					            return keyword;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            return identifierOrType();
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case UINT:
 | 
					    case UINT:
 | 
				
			||||||
    case UVEC2:
 | 
					    case UVEC2:
 | 
				
			||||||
    case UVEC3:
 | 
					    case UVEC3:
 | 
				
			||||||
@ -1369,6 +1378,25 @@ int TScanContext::tokenizeIdentifier()
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return keyword;
 | 
					        return keyword;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case TEXTURE2D:
 | 
				
			||||||
 | 
					    case TEXTURECUBE:
 | 
				
			||||||
 | 
					    case TEXTURE2DARRAY:
 | 
				
			||||||
 | 
					    case ITEXTURE2D:
 | 
				
			||||||
 | 
					    case ITEXTURE3D:
 | 
				
			||||||
 | 
					    case ITEXTURECUBE:
 | 
				
			||||||
 | 
					    case ITEXTURE2DARRAY:
 | 
				
			||||||
 | 
					    case UTEXTURE2D:
 | 
				
			||||||
 | 
					    case UTEXTURE3D:
 | 
				
			||||||
 | 
					    case UTEXTURECUBE:
 | 
				
			||||||
 | 
					    case UTEXTURE2DARRAY:
 | 
				
			||||||
 | 
					    case TEXTURE3D:
 | 
				
			||||||
 | 
					    case SAMPLER:
 | 
				
			||||||
 | 
					    case SAMPLERSHADOW:
 | 
				
			||||||
 | 
					        if (parseContext.spvVersion.vulkan > 0)
 | 
				
			||||||
 | 
					            return keyword;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            return identifierOrType();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    case ISAMPLER1D:
 | 
					    case ISAMPLER1D:
 | 
				
			||||||
    case ISAMPLER1DARRAY:
 | 
					    case ISAMPLER1DARRAY:
 | 
				
			||||||
@ -1458,25 +1486,11 @@ int TScanContext::tokenizeIdentifier()
 | 
				
			|||||||
            return keyword;
 | 
					            return keyword;
 | 
				
			||||||
        return identifierOrType();
 | 
					        return identifierOrType();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case TEXTURE2D:
 | 
					 | 
				
			||||||
    case TEXTURECUBE:
 | 
					 | 
				
			||||||
    case TEXTURECUBEARRAY:
 | 
					 | 
				
			||||||
    case ITEXTURECUBEARRAY:
 | 
					 | 
				
			||||||
    case UTEXTURECUBEARRAY:
 | 
					 | 
				
			||||||
    case ITEXTURE1DARRAY:
 | 
					    case ITEXTURE1DARRAY:
 | 
				
			||||||
    case UTEXTURE1D:
 | 
					    case UTEXTURE1D:
 | 
				
			||||||
    case ITEXTURE1D:
 | 
					    case ITEXTURE1D:
 | 
				
			||||||
    case UTEXTURE1DARRAY:
 | 
					    case UTEXTURE1DARRAY:
 | 
				
			||||||
    case TEXTUREBUFFER:
 | 
					    case TEXTUREBUFFER:
 | 
				
			||||||
    case TEXTURE2DARRAY:
 | 
					 | 
				
			||||||
    case ITEXTURE2D:
 | 
					 | 
				
			||||||
    case ITEXTURE3D:
 | 
					 | 
				
			||||||
    case ITEXTURECUBE:
 | 
					 | 
				
			||||||
    case ITEXTURE2DARRAY:
 | 
					 | 
				
			||||||
    case UTEXTURE2D:
 | 
					 | 
				
			||||||
    case UTEXTURE3D:
 | 
					 | 
				
			||||||
    case UTEXTURECUBE:
 | 
					 | 
				
			||||||
    case UTEXTURE2DARRAY:
 | 
					 | 
				
			||||||
    case ITEXTURE2DRECT:
 | 
					    case ITEXTURE2DRECT:
 | 
				
			||||||
    case UTEXTURE2DRECT:
 | 
					    case UTEXTURE2DRECT:
 | 
				
			||||||
    case ITEXTUREBUFFER:
 | 
					    case ITEXTUREBUFFER:
 | 
				
			||||||
@ -1488,11 +1502,8 @@ int TScanContext::tokenizeIdentifier()
 | 
				
			|||||||
    case ITEXTURE2DMSARRAY:
 | 
					    case ITEXTURE2DMSARRAY:
 | 
				
			||||||
    case UTEXTURE2DMSARRAY:
 | 
					    case UTEXTURE2DMSARRAY:
 | 
				
			||||||
    case TEXTURE1D:
 | 
					    case TEXTURE1D:
 | 
				
			||||||
    case TEXTURE3D:
 | 
					 | 
				
			||||||
    case TEXTURE2DRECT:
 | 
					    case TEXTURE2DRECT:
 | 
				
			||||||
    case TEXTURE1DARRAY:
 | 
					    case TEXTURE1DARRAY:
 | 
				
			||||||
    case SAMPLER:
 | 
					 | 
				
			||||||
    case SAMPLERSHADOW:
 | 
					 | 
				
			||||||
        if (parseContext.spvVersion.vulkan > 0)
 | 
					        if (parseContext.spvVersion.vulkan > 0)
 | 
				
			||||||
            return keyword;
 | 
					            return keyword;
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
 | 
				
			|||||||
@ -288,6 +288,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
 | 
				
			|||||||
                                EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
 | 
					                                EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
 | 
				
			||||||
                                TSymbolTable** symbolTables)
 | 
					                                TSymbolTable** symbolTables)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
 | 
					    profile = EEsProfile;
 | 
				
			||||||
 | 
					    version = 310;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
 | 
					    (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
 | 
				
			||||||
    InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source,
 | 
					    InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source,
 | 
				
			||||||
                          infoSink, *symbolTables[language]);
 | 
					                          infoSink, *symbolTables[language]);
 | 
				
			||||||
@ -304,6 +309,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable,  TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
 | 
					bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable,  TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
 | 
					    profile = EEsProfile;
 | 
				
			||||||
 | 
					    version = 310;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
 | 
					    std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (builtInParseables == nullptr)
 | 
					    if (builtInParseables == nullptr)
 | 
				
			||||||
@ -341,6 +351,7 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable,  TS
 | 
				
			|||||||
        (profile == EEsProfile && version >= 310))
 | 
					        (profile == EEsProfile && version >= 310))
 | 
				
			||||||
        InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source,
 | 
					        InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source,
 | 
				
			||||||
                                   infoSink, commonTable, symbolTables);
 | 
					                                   infoSink, commonTable, symbolTables);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // check for compute
 | 
					    // check for compute
 | 
				
			||||||
    if ((profile != EEsProfile && version >= 420) ||
 | 
					    if ((profile != EEsProfile && version >= 420) ||
 | 
				
			||||||
@ -375,7 +386,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable,  TS
 | 
				
			|||||||
        (profile == EEsProfile && version >= 320))
 | 
					        (profile == EEsProfile && version >= 320))
 | 
				
			||||||
        InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTaskNV, source,
 | 
					        InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTaskNV, source,
 | 
				
			||||||
                                   infoSink, commonTable, symbolTables);
 | 
					                                   infoSink, commonTable, symbolTables);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -871,6 +881,11 @@ bool ProcessDeferred(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
 | 
					    bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
 | 
				
			||||||
                                            versionNotFirst, defaultVersion, source, version, profile, spvVersion);
 | 
					                                            versionNotFirst, defaultVersion, source, version, profile, spvVersion);
 | 
				
			||||||
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
 | 
					    profile = EEsProfile;
 | 
				
			||||||
 | 
					    version = 310;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
 | 
					    bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    bool warnVersionNotFirst = false;
 | 
					    bool warnVersionNotFirst = false;
 | 
				
			||||||
 | 
				
			|||||||
@ -527,11 +527,11 @@ const char* StageName(EShLanguage stage)
 | 
				
			|||||||
    switch(stage) {
 | 
					    switch(stage) {
 | 
				
			||||||
    case EShLangVertex:         return "vertex";
 | 
					    case EShLangVertex:         return "vertex";
 | 
				
			||||||
    case EShLangFragment:       return "fragment";
 | 
					    case EShLangFragment:       return "fragment";
 | 
				
			||||||
 | 
					    case EShLangCompute:        return "compute";
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    case EShLangTessControl:    return "tessellation control";
 | 
					    case EShLangTessControl:    return "tessellation control";
 | 
				
			||||||
    case EShLangTessEvaluation: return "tessellation evaluation";
 | 
					    case EShLangTessEvaluation: return "tessellation evaluation";
 | 
				
			||||||
    case EShLangGeometry:       return "geometry";
 | 
					    case EShLangGeometry:       return "geometry";
 | 
				
			||||||
    case EShLangCompute:        return "compute";
 | 
					 | 
				
			||||||
    case EShLangRayGenNV:       return "ray-generation";
 | 
					    case EShLangRayGenNV:       return "ray-generation";
 | 
				
			||||||
    case EShLangIntersectNV:    return "intersection";
 | 
					    case EShLangIntersectNV:    return "intersection";
 | 
				
			||||||
    case EShLangAnyHitNV:       return "any-hit";
 | 
					    case EShLangAnyHitNV:       return "any-hit";
 | 
				
			||||||
 | 
				
			|||||||
@ -38,7 +38,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Do not edit the .y file, only edit the .m4 file.
 | 
					// Do not edit the .y file, only edit the .m4 file.
 | 
				
			||||||
// The .y bison file is not a source file, it is a derivitive of the .m4 file.
 | 
					// The .y bison file is not a source file, it is a derivative of the .m4 file.
 | 
				
			||||||
// The m4 file needs to be processed by m4 to generate the .y bison file.
 | 
					// The m4 file needs to be processed by m4 to generate the .y bison file.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Code sandwiched between a pair:
 | 
					// Code sandwiched between a pair:
 | 
				
			||||||
@ -49,7 +49,7 @@
 | 
				
			|||||||
//      ...
 | 
					//      ...
 | 
				
			||||||
//    GLSLANG_WEB_EXCLUDE_OFF
 | 
					//    GLSLANG_WEB_EXCLUDE_OFF
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Will be exluded from the grammar when m4 is executed as:
 | 
					// Will be excluded from the grammar when m4 is executed as:
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
//    m4 -P -DGLSLANG_WEB
 | 
					//    m4 -P -DGLSLANG_WEB
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
@ -166,8 +166,12 @@ extern int yylex(YYSTYPE*, TParseContext&);
 | 
				
			|||||||
%token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
 | 
					%token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
 | 
				
			||||||
%token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D
 | 
					%token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D
 | 
				
			||||||
%token <lex> USAMPLERCUBE USAMPLER2DARRAY
 | 
					%token <lex> USAMPLERCUBE USAMPLER2DARRAY
 | 
				
			||||||
%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
 | 
					
 | 
				
			||||||
%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
 | 
					// separate image/sampler
 | 
				
			||||||
 | 
					%token <lex> SAMPLER SAMPLERSHADOW
 | 
				
			||||||
 | 
					%token <lex>  TEXTURE2D  TEXTURE3D  TEXTURECUBE  TEXTURE2DARRAY
 | 
				
			||||||
 | 
					%token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
 | 
				
			||||||
 | 
					%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					GLSLANG_WEB_EXCLUDE_ON
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -203,6 +207,8 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
 | 
					%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// combined image/sampler
 | 
					// combined image/sampler
 | 
				
			||||||
 | 
					%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
 | 
				
			||||||
 | 
					%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
 | 
				
			||||||
%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
 | 
					%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
 | 
				
			||||||
%token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
 | 
					%token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
 | 
				
			||||||
%token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
 | 
					%token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
 | 
				
			||||||
@ -233,18 +239,12 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
%token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
 | 
					%token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
 | 
				
			||||||
%token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
 | 
					%token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// pure sampler
 | 
					 | 
				
			||||||
%token <lex> SAMPLER SAMPLERSHADOW
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// texture without sampler
 | 
					// texture without sampler
 | 
				
			||||||
%token <lex> TEXTURE1D TEXTURE2D TEXTURE3D TEXTURECUBE
 | 
					%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
 | 
				
			||||||
%token <lex> TEXTURE1DARRAY TEXTURE2DARRAY
 | 
					%token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D
 | 
				
			||||||
%token <lex> ITEXTURE1D ITEXTURE2D ITEXTURE3D ITEXTURECUBE
 | 
					%token <lex> TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY
 | 
				
			||||||
%token <lex> ITEXTURE1DARRAY ITEXTURE2DARRAY UTEXTURE1D UTEXTURE2D UTEXTURE3D
 | 
					 | 
				
			||||||
%token <lex> UTEXTURECUBE UTEXTURE1DARRAY UTEXTURE2DARRAY
 | 
					 | 
				
			||||||
%token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
 | 
					%token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
 | 
				
			||||||
%token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
 | 
					%token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
 | 
				
			||||||
%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
 | 
					 | 
				
			||||||
%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
 | 
					%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
 | 
				
			||||||
%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
 | 
					%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -277,7 +277,7 @@ GLSLANG_WEB_EXCLUDE_OFF
 | 
				
			|||||||
%token <lex> CENTROID IN OUT INOUT
 | 
					%token <lex> CENTROID IN OUT INOUT
 | 
				
			||||||
%token <lex> STRUCT VOID WHILE
 | 
					%token <lex> STRUCT VOID WHILE
 | 
				
			||||||
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
 | 
					%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
 | 
				
			||||||
%token <lex> UNIFORM SHARED
 | 
					%token <lex> UNIFORM SHARED BUFFER
 | 
				
			||||||
%token <lex> FLAT SMOOTH LAYOUT
 | 
					%token <lex> FLAT SMOOTH LAYOUT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					GLSLANG_WEB_EXCLUDE_ON
 | 
				
			||||||
@ -285,7 +285,7 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
%token <lex> INT64CONSTANT UINT64CONSTANT
 | 
					%token <lex> INT64CONSTANT UINT64CONSTANT
 | 
				
			||||||
%token <lex> SUBROUTINE DEMOTE
 | 
					%token <lex> SUBROUTINE DEMOTE
 | 
				
			||||||
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
 | 
					%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
 | 
				
			||||||
%token <lex> PATCH SAMPLE BUFFER NONUNIFORM
 | 
					%token <lex> PATCH SAMPLE NONUNIFORM
 | 
				
			||||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
 | 
					%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
 | 
				
			||||||
%token <lex> SUBGROUPCOHERENT NONPRIVATE
 | 
					%token <lex> SUBGROUPCOHERENT NONPRIVATE
 | 
				
			||||||
%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
 | 
					%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
 | 
				
			||||||
@ -1360,7 +1360,6 @@ storage_qualifier
 | 
				
			|||||||
        $$.init($1.loc);
 | 
					        $$.init($1.loc);
 | 
				
			||||||
        $$.qualifier.storage = EvqUniform;
 | 
					        $$.qualifier.storage = EvqUniform;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					 | 
				
			||||||
    | SHARED {
 | 
					    | SHARED {
 | 
				
			||||||
        parseContext.globalCheck($1.loc, "shared");
 | 
					        parseContext.globalCheck($1.loc, "shared");
 | 
				
			||||||
        parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
 | 
					        parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
 | 
				
			||||||
@ -1374,6 +1373,7 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
        $$.init($1.loc);
 | 
					        $$.init($1.loc);
 | 
				
			||||||
        $$.qualifier.storage = EvqBuffer;
 | 
					        $$.qualifier.storage = EvqBuffer;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					GLSLANG_WEB_EXCLUDE_ON
 | 
				
			||||||
    | ATTRIBUTE {
 | 
					    | ATTRIBUTE {
 | 
				
			||||||
        parseContext.requireStage($1.loc, EShLangVertex, "attribute");
 | 
					        parseContext.requireStage($1.loc, EShLangVertex, "attribute");
 | 
				
			||||||
        parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
 | 
					        parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
 | 
				
			||||||
@ -2354,6 +2354,16 @@ GLSLANG_WEB_EXCLUDE_OFF
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtFloat, EsdCube, false, true);
 | 
					        $$.sampler.set(EbtFloat, EsdCube, false, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    | SAMPLER2DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtFloat, Esd2D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | SAMPLER2DARRAYSHADOW {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtFloat, Esd2D, true, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					GLSLANG_WEB_EXCLUDE_ON
 | 
				
			||||||
    | SAMPLER1DSHADOW {
 | 
					    | SAMPLER1DSHADOW {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
@ -2370,17 +2380,6 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtFloat, Esd1D, true, true);
 | 
					        $$.sampler.set(EbtFloat, Esd1D, true, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_OFF
 | 
					 | 
				
			||||||
    | SAMPLER2DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtFloat, Esd2D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | SAMPLER2DARRAYSHADOW {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtFloat, Esd2D, true, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | SAMPLERCUBEARRAY {
 | 
					    | SAMPLERCUBEARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
@ -2391,7 +2390,6 @@ GLSLANG_WEB_EXCLUDE_OFF
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtFloat, EsdCube, true, true);
 | 
					        $$.sampler.set(EbtFloat, EsdCube, true, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					 | 
				
			||||||
    | F16SAMPLER1D {
 | 
					    | F16SAMPLER1D {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
@ -2491,30 +2489,11 @@ GLSLANG_WEB_EXCLUDE_OFF
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtInt, EsdCube);
 | 
					        $$.sampler.set(EbtInt, EsdCube);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					 | 
				
			||||||
    | ISAMPLER1DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtInt, Esd1D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_OFF
 | 
					 | 
				
			||||||
    | ISAMPLER2DARRAY {
 | 
					    | ISAMPLER2DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtInt, Esd2D, true);
 | 
					        $$.sampler.set(EbtInt, Esd2D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | ISAMPLERCUBEARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtInt, EsdCube, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					 | 
				
			||||||
    | USAMPLER1D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtUint, Esd1D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_OFF
 | 
					 | 
				
			||||||
    | USAMPLER2D {
 | 
					    | USAMPLER2D {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
@ -2531,21 +2510,121 @@ GLSLANG_WEB_EXCLUDE_OFF
 | 
				
			|||||||
        $$.sampler.set(EbtUint, EsdCube);
 | 
					        $$.sampler.set(EbtUint, EsdCube);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					GLSLANG_WEB_EXCLUDE_ON
 | 
				
			||||||
 | 
					    | ISAMPLER1DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtInt, Esd1D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ISAMPLERCUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtInt, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | USAMPLER1D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtUint, Esd1D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    | USAMPLER1DARRAY {
 | 
					    | USAMPLER1DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtUint, Esd1D, true);
 | 
					        $$.sampler.set(EbtUint, Esd1D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    | USAMPLERCUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtUint, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | TEXTURECUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtFloat, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURECUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURECUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_OFF
 | 
					GLSLANG_WEB_EXCLUDE_OFF
 | 
				
			||||||
    | USAMPLER2DARRAY {
 | 
					    | USAMPLER2DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtUint, Esd2D, true);
 | 
					        $$.sampler.set(EbtUint, Esd2D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | USAMPLERCUBEARRAY {
 | 
					    | TEXTURE2D {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtUint, EsdCube, true);
 | 
					        $$.sampler.setTexture(EbtFloat, Esd2D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | TEXTURE3D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtFloat, Esd3D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | TEXTURE2DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtFloat, Esd2D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | TEXTURECUBE {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtFloat, EsdCube);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURE2D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, Esd2D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURE3D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, Esd3D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURECUBE {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, EsdCube);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURE2DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, Esd2D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURE2D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, Esd2D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURE3D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, Esd3D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURECUBE {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, EsdCube);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURE2DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, Esd2D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | SAMPLER {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setPureSampler(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | SAMPLERSHADOW {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setPureSampler(true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
GLSLANG_WEB_EXCLUDE_ON
 | 
					GLSLANG_WEB_EXCLUDE_ON
 | 
				
			||||||
    | SAMPLER2DRECT {
 | 
					    | SAMPLER2DRECT {
 | 
				
			||||||
@ -2643,16 +2722,6 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtUint, Esd2D, true, false, true);
 | 
					        $$.sampler.set(EbtUint, Esd2D, true, false, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | SAMPLER {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setPureSampler(false);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | SAMPLERSHADOW {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setPureSampler(true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | TEXTURE1D {
 | 
					    | TEXTURE1D {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
@ -2664,33 +2733,18 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd1D);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd1D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURE2D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, Esd2D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURE2D {
 | 
					    | F16TEXTURE2D {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd2D);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd2D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURE3D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, Esd3D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURE3D {
 | 
					    | F16TEXTURE3D {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd3D);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd3D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURECUBE {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, EsdCube);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURECUBE {
 | 
					    | F16TEXTURECUBE {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
@ -2708,22 +2762,12 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd1D, true);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd1D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURE2DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, Esd2D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURE2DARRAY {
 | 
					    | F16TEXTURE2DARRAY {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd2D, true);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd2D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURECUBEARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, EsdCube, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURECUBEARRAY {
 | 
					    | F16TEXTURECUBEARRAY {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
@ -2735,71 +2779,21 @@ GLSLANG_WEB_EXCLUDE_ON
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd1D);
 | 
					        $$.sampler.setTexture(EbtInt, Esd1D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | ITEXTURE2D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd2D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | ITEXTURE3D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd3D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | ITEXTURECUBE {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, EsdCube);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | ITEXTURE1DARRAY {
 | 
					    | ITEXTURE1DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd1D, true);
 | 
					        $$.sampler.setTexture(EbtInt, Esd1D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | ITEXTURE2DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd2D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | ITEXTURECUBEARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, EsdCube, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURE1D {
 | 
					    | UTEXTURE1D {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd1D);
 | 
					        $$.sampler.setTexture(EbtUint, Esd1D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | UTEXTURE2D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd2D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURE3D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd3D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURECUBE {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, EsdCube);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURE1DARRAY {
 | 
					    | UTEXTURE1DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd1D, true);
 | 
					        $$.sampler.setTexture(EbtUint, Esd1D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | UTEXTURE2DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd2D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURECUBEARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, EsdCube, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | TEXTURE2DRECT {
 | 
					    | TEXTURE2DRECT {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
				
			|||||||
@ -38,7 +38,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Do not edit the .y file, only edit the .m4 file.
 | 
					// Do not edit the .y file, only edit the .m4 file.
 | 
				
			||||||
// The .y bison file is not a source file, it is a derivitive of the .m4 file.
 | 
					// The .y bison file is not a source file, it is a derivative of the .m4 file.
 | 
				
			||||||
// The m4 file needs to be processed by m4 to generate the .y bison file.
 | 
					// The m4 file needs to be processed by m4 to generate the .y bison file.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Code sandwiched between a pair:
 | 
					// Code sandwiched between a pair:
 | 
				
			||||||
@ -49,7 +49,7 @@
 | 
				
			|||||||
//      ...
 | 
					//      ...
 | 
				
			||||||
//    GLSLANG_WEB_EXCLUDE_OFF
 | 
					//    GLSLANG_WEB_EXCLUDE_OFF
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Will be exluded from the grammar when m4 is executed as:
 | 
					// Will be excluded from the grammar when m4 is executed as:
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
//    m4 -P -DGLSLANG_WEB
 | 
					//    m4 -P -DGLSLANG_WEB
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
@ -166,8 +166,12 @@ extern int yylex(YYSTYPE*, TParseContext&);
 | 
				
			|||||||
%token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
 | 
					%token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
 | 
				
			||||||
%token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D
 | 
					%token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D
 | 
				
			||||||
%token <lex> USAMPLERCUBE USAMPLER2DARRAY
 | 
					%token <lex> USAMPLERCUBE USAMPLER2DARRAY
 | 
				
			||||||
%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
 | 
					
 | 
				
			||||||
%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
 | 
					// separate image/sampler
 | 
				
			||||||
 | 
					%token <lex> SAMPLER SAMPLERSHADOW
 | 
				
			||||||
 | 
					%token <lex>  TEXTURE2D  TEXTURE3D  TEXTURECUBE  TEXTURE2DARRAY
 | 
				
			||||||
 | 
					%token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
 | 
				
			||||||
 | 
					%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -203,6 +207,8 @@ extern int yylex(YYSTYPE*, TParseContext&);
 | 
				
			|||||||
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
 | 
					%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// combined image/sampler
 | 
					// combined image/sampler
 | 
				
			||||||
 | 
					%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
 | 
				
			||||||
 | 
					%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
 | 
				
			||||||
%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
 | 
					%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
 | 
				
			||||||
%token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
 | 
					%token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
 | 
				
			||||||
%token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
 | 
					%token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
 | 
				
			||||||
@ -233,18 +239,12 @@ extern int yylex(YYSTYPE*, TParseContext&);
 | 
				
			|||||||
%token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
 | 
					%token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
 | 
				
			||||||
%token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
 | 
					%token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// pure sampler
 | 
					 | 
				
			||||||
%token <lex> SAMPLER SAMPLERSHADOW
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// texture without sampler
 | 
					// texture without sampler
 | 
				
			||||||
%token <lex> TEXTURE1D TEXTURE2D TEXTURE3D TEXTURECUBE
 | 
					%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
 | 
				
			||||||
%token <lex> TEXTURE1DARRAY TEXTURE2DARRAY
 | 
					%token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D
 | 
				
			||||||
%token <lex> ITEXTURE1D ITEXTURE2D ITEXTURE3D ITEXTURECUBE
 | 
					%token <lex> TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY
 | 
				
			||||||
%token <lex> ITEXTURE1DARRAY ITEXTURE2DARRAY UTEXTURE1D UTEXTURE2D UTEXTURE3D
 | 
					 | 
				
			||||||
%token <lex> UTEXTURECUBE UTEXTURE1DARRAY UTEXTURE2DARRAY
 | 
					 | 
				
			||||||
%token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
 | 
					%token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
 | 
				
			||||||
%token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
 | 
					%token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
 | 
				
			||||||
%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
 | 
					 | 
				
			||||||
%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
 | 
					%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
 | 
				
			||||||
%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
 | 
					%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -277,7 +277,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
 | 
				
			|||||||
%token <lex> CENTROID IN OUT INOUT
 | 
					%token <lex> CENTROID IN OUT INOUT
 | 
				
			||||||
%token <lex> STRUCT VOID WHILE
 | 
					%token <lex> STRUCT VOID WHILE
 | 
				
			||||||
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
 | 
					%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
 | 
				
			||||||
%token <lex> UNIFORM SHARED
 | 
					%token <lex> UNIFORM SHARED BUFFER
 | 
				
			||||||
%token <lex> FLAT SMOOTH LAYOUT
 | 
					%token <lex> FLAT SMOOTH LAYOUT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -285,7 +285,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
 | 
				
			|||||||
%token <lex> INT64CONSTANT UINT64CONSTANT
 | 
					%token <lex> INT64CONSTANT UINT64CONSTANT
 | 
				
			||||||
%token <lex> SUBROUTINE DEMOTE
 | 
					%token <lex> SUBROUTINE DEMOTE
 | 
				
			||||||
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
 | 
					%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
 | 
				
			||||||
%token <lex> PATCH SAMPLE BUFFER NONUNIFORM
 | 
					%token <lex> PATCH SAMPLE NONUNIFORM
 | 
				
			||||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
 | 
					%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
 | 
				
			||||||
%token <lex> SUBGROUPCOHERENT NONPRIVATE
 | 
					%token <lex> SUBGROUPCOHERENT NONPRIVATE
 | 
				
			||||||
%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
 | 
					%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
 | 
				
			||||||
@ -1360,7 +1360,6 @@ storage_qualifier
 | 
				
			|||||||
        $$.init($1.loc);
 | 
					        $$.init($1.loc);
 | 
				
			||||||
        $$.qualifier.storage = EvqUniform;
 | 
					        $$.qualifier.storage = EvqUniform;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    | SHARED {
 | 
					    | SHARED {
 | 
				
			||||||
        parseContext.globalCheck($1.loc, "shared");
 | 
					        parseContext.globalCheck($1.loc, "shared");
 | 
				
			||||||
        parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
 | 
					        parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
 | 
				
			||||||
@ -1374,6 +1373,7 @@ storage_qualifier
 | 
				
			|||||||
        $$.init($1.loc);
 | 
					        $$.init($1.loc);
 | 
				
			||||||
        $$.qualifier.storage = EvqBuffer;
 | 
					        $$.qualifier.storage = EvqBuffer;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    | ATTRIBUTE {
 | 
					    | ATTRIBUTE {
 | 
				
			||||||
        parseContext.requireStage($1.loc, EShLangVertex, "attribute");
 | 
					        parseContext.requireStage($1.loc, EShLangVertex, "attribute");
 | 
				
			||||||
        parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
 | 
					        parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
 | 
				
			||||||
@ -2354,6 +2354,16 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtFloat, EsdCube, false, true);
 | 
					        $$.sampler.set(EbtFloat, EsdCube, false, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    | SAMPLER2DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtFloat, Esd2D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | SAMPLER2DARRAYSHADOW {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtFloat, Esd2D, true, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    | SAMPLER1DSHADOW {
 | 
					    | SAMPLER1DSHADOW {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
@ -2370,17 +2380,6 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtFloat, Esd1D, true, true);
 | 
					        $$.sampler.set(EbtFloat, Esd1D, true, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    | SAMPLER2DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtFloat, Esd2D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | SAMPLER2DARRAYSHADOW {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtFloat, Esd2D, true, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | SAMPLERCUBEARRAY {
 | 
					    | SAMPLERCUBEARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
@ -2391,7 +2390,6 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtFloat, EsdCube, true, true);
 | 
					        $$.sampler.set(EbtFloat, EsdCube, true, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    | F16SAMPLER1D {
 | 
					    | F16SAMPLER1D {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
@ -2491,30 +2489,11 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtInt, EsdCube);
 | 
					        $$.sampler.set(EbtInt, EsdCube);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    | ISAMPLER1DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtInt, Esd1D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    | ISAMPLER2DARRAY {
 | 
					    | ISAMPLER2DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtInt, Esd2D, true);
 | 
					        $$.sampler.set(EbtInt, Esd2D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | ISAMPLERCUBEARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtInt, EsdCube, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    | USAMPLER1D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.set(EbtUint, Esd1D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    | USAMPLER2D {
 | 
					    | USAMPLER2D {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
@ -2531,21 +2510,121 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.sampler.set(EbtUint, EsdCube);
 | 
					        $$.sampler.set(EbtUint, EsdCube);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    | ISAMPLER1DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtInt, Esd1D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ISAMPLERCUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtInt, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | USAMPLER1D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtUint, Esd1D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    | USAMPLER1DARRAY {
 | 
					    | USAMPLER1DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtUint, Esd1D, true);
 | 
					        $$.sampler.set(EbtUint, Esd1D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    | USAMPLERCUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.set(EbtUint, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | TEXTURECUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtFloat, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURECUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURECUBEARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, EsdCube, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    | USAMPLER2DARRAY {
 | 
					    | USAMPLER2DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtUint, Esd2D, true);
 | 
					        $$.sampler.set(EbtUint, Esd2D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | USAMPLERCUBEARRAY {
 | 
					    | TEXTURE2D {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtUint, EsdCube, true);
 | 
					        $$.sampler.setTexture(EbtFloat, Esd2D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | TEXTURE3D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtFloat, Esd3D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | TEXTURE2DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtFloat, Esd2D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | TEXTURECUBE {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtFloat, EsdCube);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURE2D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, Esd2D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURE3D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, Esd3D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURECUBE {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, EsdCube);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | ITEXTURE2DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtInt, Esd2D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURE2D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, Esd2D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURE3D {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, Esd3D);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURECUBE {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, EsdCube);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | UTEXTURE2DARRAY {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setTexture(EbtUint, Esd2D, true);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | SAMPLER {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setPureSampler(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    | SAMPLERSHADOW {
 | 
				
			||||||
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
					        $$.sampler.setPureSampler(true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    | SAMPLER2DRECT {
 | 
					    | SAMPLER2DRECT {
 | 
				
			||||||
@ -2643,16 +2722,6 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.set(EbtUint, Esd2D, true, false, true);
 | 
					        $$.sampler.set(EbtUint, Esd2D, true, false, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | SAMPLER {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setPureSampler(false);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | SAMPLERSHADOW {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setPureSampler(true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | TEXTURE1D {
 | 
					    | TEXTURE1D {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
@ -2664,33 +2733,18 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd1D);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd1D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURE2D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, Esd2D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURE2D {
 | 
					    | F16TEXTURE2D {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd2D);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd2D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURE3D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, Esd3D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURE3D {
 | 
					    | F16TEXTURE3D {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd3D);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd3D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURECUBE {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, EsdCube);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURECUBE {
 | 
					    | F16TEXTURECUBE {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
@ -2708,22 +2762,12 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd1D, true);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd1D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURE2DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, Esd2D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURE2DARRAY {
 | 
					    | F16TEXTURE2DARRAY {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat16, Esd2D, true);
 | 
					        $$.sampler.setTexture(EbtFloat16, Esd2D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | TEXTURECUBEARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtFloat, EsdCube, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | F16TEXTURECUBEARRAY {
 | 
					    | F16TEXTURECUBEARRAY {
 | 
				
			||||||
        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
					        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
@ -2735,71 +2779,21 @@ type_specifier_nonarray
 | 
				
			|||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd1D);
 | 
					        $$.sampler.setTexture(EbtInt, Esd1D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | ITEXTURE2D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd2D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | ITEXTURE3D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd3D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | ITEXTURECUBE {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, EsdCube);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | ITEXTURE1DARRAY {
 | 
					    | ITEXTURE1DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd1D, true);
 | 
					        $$.sampler.setTexture(EbtInt, Esd1D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | ITEXTURE2DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, Esd2D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | ITEXTURECUBEARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtInt, EsdCube, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURE1D {
 | 
					    | UTEXTURE1D {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd1D);
 | 
					        $$.sampler.setTexture(EbtUint, Esd1D);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | UTEXTURE2D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd2D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURE3D {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd3D);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURECUBE {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, EsdCube);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURE1DARRAY {
 | 
					    | UTEXTURE1DARRAY {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd1D, true);
 | 
					        $$.sampler.setTexture(EbtUint, Esd1D, true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    | UTEXTURE2DARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, Esd2D, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | UTEXTURECUBEARRAY {
 | 
					 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					 | 
				
			||||||
        $$.sampler.setTexture(EbtUint, EsdCube, true);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    | TEXTURE2DRECT {
 | 
					    | TEXTURE2DRECT {
 | 
				
			||||||
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
					        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
 | 
				
			||||||
        $$.basicType = EbtSampler;
 | 
					        $$.basicType = EbtSampler;
 | 
				
			||||||
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -89,227 +89,227 @@ extern int yydebug;
 | 
				
			|||||||
    USAMPLER3D = 299,
 | 
					    USAMPLER3D = 299,
 | 
				
			||||||
    USAMPLERCUBE = 300,
 | 
					    USAMPLERCUBE = 300,
 | 
				
			||||||
    USAMPLER2DARRAY = 301,
 | 
					    USAMPLER2DARRAY = 301,
 | 
				
			||||||
    SAMPLERCUBEARRAY = 302,
 | 
					    SAMPLER = 302,
 | 
				
			||||||
    SAMPLERCUBEARRAYSHADOW = 303,
 | 
					    SAMPLERSHADOW = 303,
 | 
				
			||||||
    ISAMPLERCUBEARRAY = 304,
 | 
					    TEXTURE2D = 304,
 | 
				
			||||||
    USAMPLERCUBEARRAY = 305,
 | 
					    TEXTURE3D = 305,
 | 
				
			||||||
    ATTRIBUTE = 306,
 | 
					    TEXTURECUBE = 306,
 | 
				
			||||||
    VARYING = 307,
 | 
					    TEXTURE2DARRAY = 307,
 | 
				
			||||||
    FLOAT16_T = 308,
 | 
					    ITEXTURE2D = 308,
 | 
				
			||||||
    FLOAT32_T = 309,
 | 
					    ITEXTURE3D = 309,
 | 
				
			||||||
    DOUBLE = 310,
 | 
					    ITEXTURECUBE = 310,
 | 
				
			||||||
    FLOAT64_T = 311,
 | 
					    ITEXTURE2DARRAY = 311,
 | 
				
			||||||
    INT64_T = 312,
 | 
					    UTEXTURE2D = 312,
 | 
				
			||||||
    UINT64_T = 313,
 | 
					    UTEXTURE3D = 313,
 | 
				
			||||||
    INT32_T = 314,
 | 
					    UTEXTURECUBE = 314,
 | 
				
			||||||
    UINT32_T = 315,
 | 
					    UTEXTURE2DARRAY = 315,
 | 
				
			||||||
    INT16_T = 316,
 | 
					    ATTRIBUTE = 316,
 | 
				
			||||||
    UINT16_T = 317,
 | 
					    VARYING = 317,
 | 
				
			||||||
    INT8_T = 318,
 | 
					    FLOAT16_T = 318,
 | 
				
			||||||
    UINT8_T = 319,
 | 
					    FLOAT32_T = 319,
 | 
				
			||||||
    I64VEC2 = 320,
 | 
					    DOUBLE = 320,
 | 
				
			||||||
    I64VEC3 = 321,
 | 
					    FLOAT64_T = 321,
 | 
				
			||||||
    I64VEC4 = 322,
 | 
					    INT64_T = 322,
 | 
				
			||||||
    U64VEC2 = 323,
 | 
					    UINT64_T = 323,
 | 
				
			||||||
    U64VEC3 = 324,
 | 
					    INT32_T = 324,
 | 
				
			||||||
    U64VEC4 = 325,
 | 
					    UINT32_T = 325,
 | 
				
			||||||
    I32VEC2 = 326,
 | 
					    INT16_T = 326,
 | 
				
			||||||
    I32VEC3 = 327,
 | 
					    UINT16_T = 327,
 | 
				
			||||||
    I32VEC4 = 328,
 | 
					    INT8_T = 328,
 | 
				
			||||||
    U32VEC2 = 329,
 | 
					    UINT8_T = 329,
 | 
				
			||||||
    U32VEC3 = 330,
 | 
					    I64VEC2 = 330,
 | 
				
			||||||
    U32VEC4 = 331,
 | 
					    I64VEC3 = 331,
 | 
				
			||||||
    I16VEC2 = 332,
 | 
					    I64VEC4 = 332,
 | 
				
			||||||
    I16VEC3 = 333,
 | 
					    U64VEC2 = 333,
 | 
				
			||||||
    I16VEC4 = 334,
 | 
					    U64VEC3 = 334,
 | 
				
			||||||
    U16VEC2 = 335,
 | 
					    U64VEC4 = 335,
 | 
				
			||||||
    U16VEC3 = 336,
 | 
					    I32VEC2 = 336,
 | 
				
			||||||
    U16VEC4 = 337,
 | 
					    I32VEC3 = 337,
 | 
				
			||||||
    I8VEC2 = 338,
 | 
					    I32VEC4 = 338,
 | 
				
			||||||
    I8VEC3 = 339,
 | 
					    U32VEC2 = 339,
 | 
				
			||||||
    I8VEC4 = 340,
 | 
					    U32VEC3 = 340,
 | 
				
			||||||
    U8VEC2 = 341,
 | 
					    U32VEC4 = 341,
 | 
				
			||||||
    U8VEC3 = 342,
 | 
					    I16VEC2 = 342,
 | 
				
			||||||
    U8VEC4 = 343,
 | 
					    I16VEC3 = 343,
 | 
				
			||||||
    DVEC2 = 344,
 | 
					    I16VEC4 = 344,
 | 
				
			||||||
    DVEC3 = 345,
 | 
					    U16VEC2 = 345,
 | 
				
			||||||
    DVEC4 = 346,
 | 
					    U16VEC3 = 346,
 | 
				
			||||||
    DMAT2 = 347,
 | 
					    U16VEC4 = 347,
 | 
				
			||||||
    DMAT3 = 348,
 | 
					    I8VEC2 = 348,
 | 
				
			||||||
    DMAT4 = 349,
 | 
					    I8VEC3 = 349,
 | 
				
			||||||
    F16VEC2 = 350,
 | 
					    I8VEC4 = 350,
 | 
				
			||||||
    F16VEC3 = 351,
 | 
					    U8VEC2 = 351,
 | 
				
			||||||
    F16VEC4 = 352,
 | 
					    U8VEC3 = 352,
 | 
				
			||||||
    F16MAT2 = 353,
 | 
					    U8VEC4 = 353,
 | 
				
			||||||
    F16MAT3 = 354,
 | 
					    DVEC2 = 354,
 | 
				
			||||||
    F16MAT4 = 355,
 | 
					    DVEC3 = 355,
 | 
				
			||||||
    F32VEC2 = 356,
 | 
					    DVEC4 = 356,
 | 
				
			||||||
    F32VEC3 = 357,
 | 
					    DMAT2 = 357,
 | 
				
			||||||
    F32VEC4 = 358,
 | 
					    DMAT3 = 358,
 | 
				
			||||||
    F32MAT2 = 359,
 | 
					    DMAT4 = 359,
 | 
				
			||||||
    F32MAT3 = 360,
 | 
					    F16VEC2 = 360,
 | 
				
			||||||
    F32MAT4 = 361,
 | 
					    F16VEC3 = 361,
 | 
				
			||||||
    F64VEC2 = 362,
 | 
					    F16VEC4 = 362,
 | 
				
			||||||
    F64VEC3 = 363,
 | 
					    F16MAT2 = 363,
 | 
				
			||||||
    F64VEC4 = 364,
 | 
					    F16MAT3 = 364,
 | 
				
			||||||
    F64MAT2 = 365,
 | 
					    F16MAT4 = 365,
 | 
				
			||||||
    F64MAT3 = 366,
 | 
					    F32VEC2 = 366,
 | 
				
			||||||
    F64MAT4 = 367,
 | 
					    F32VEC3 = 367,
 | 
				
			||||||
    DMAT2X2 = 368,
 | 
					    F32VEC4 = 368,
 | 
				
			||||||
    DMAT2X3 = 369,
 | 
					    F32MAT2 = 369,
 | 
				
			||||||
    DMAT2X4 = 370,
 | 
					    F32MAT3 = 370,
 | 
				
			||||||
    DMAT3X2 = 371,
 | 
					    F32MAT4 = 371,
 | 
				
			||||||
    DMAT3X3 = 372,
 | 
					    F64VEC2 = 372,
 | 
				
			||||||
    DMAT3X4 = 373,
 | 
					    F64VEC3 = 373,
 | 
				
			||||||
    DMAT4X2 = 374,
 | 
					    F64VEC4 = 374,
 | 
				
			||||||
    DMAT4X3 = 375,
 | 
					    F64MAT2 = 375,
 | 
				
			||||||
    DMAT4X4 = 376,
 | 
					    F64MAT3 = 376,
 | 
				
			||||||
    F16MAT2X2 = 377,
 | 
					    F64MAT4 = 377,
 | 
				
			||||||
    F16MAT2X3 = 378,
 | 
					    DMAT2X2 = 378,
 | 
				
			||||||
    F16MAT2X4 = 379,
 | 
					    DMAT2X3 = 379,
 | 
				
			||||||
    F16MAT3X2 = 380,
 | 
					    DMAT2X4 = 380,
 | 
				
			||||||
    F16MAT3X3 = 381,
 | 
					    DMAT3X2 = 381,
 | 
				
			||||||
    F16MAT3X4 = 382,
 | 
					    DMAT3X3 = 382,
 | 
				
			||||||
    F16MAT4X2 = 383,
 | 
					    DMAT3X4 = 383,
 | 
				
			||||||
    F16MAT4X3 = 384,
 | 
					    DMAT4X2 = 384,
 | 
				
			||||||
    F16MAT4X4 = 385,
 | 
					    DMAT4X3 = 385,
 | 
				
			||||||
    F32MAT2X2 = 386,
 | 
					    DMAT4X4 = 386,
 | 
				
			||||||
    F32MAT2X3 = 387,
 | 
					    F16MAT2X2 = 387,
 | 
				
			||||||
    F32MAT2X4 = 388,
 | 
					    F16MAT2X3 = 388,
 | 
				
			||||||
    F32MAT3X2 = 389,
 | 
					    F16MAT2X4 = 389,
 | 
				
			||||||
    F32MAT3X3 = 390,
 | 
					    F16MAT3X2 = 390,
 | 
				
			||||||
    F32MAT3X4 = 391,
 | 
					    F16MAT3X3 = 391,
 | 
				
			||||||
    F32MAT4X2 = 392,
 | 
					    F16MAT3X4 = 392,
 | 
				
			||||||
    F32MAT4X3 = 393,
 | 
					    F16MAT4X2 = 393,
 | 
				
			||||||
    F32MAT4X4 = 394,
 | 
					    F16MAT4X3 = 394,
 | 
				
			||||||
    F64MAT2X2 = 395,
 | 
					    F16MAT4X4 = 395,
 | 
				
			||||||
    F64MAT2X3 = 396,
 | 
					    F32MAT2X2 = 396,
 | 
				
			||||||
    F64MAT2X4 = 397,
 | 
					    F32MAT2X3 = 397,
 | 
				
			||||||
    F64MAT3X2 = 398,
 | 
					    F32MAT2X4 = 398,
 | 
				
			||||||
    F64MAT3X3 = 399,
 | 
					    F32MAT3X2 = 399,
 | 
				
			||||||
    F64MAT3X4 = 400,
 | 
					    F32MAT3X3 = 400,
 | 
				
			||||||
    F64MAT4X2 = 401,
 | 
					    F32MAT3X4 = 401,
 | 
				
			||||||
    F64MAT4X3 = 402,
 | 
					    F32MAT4X2 = 402,
 | 
				
			||||||
    F64MAT4X4 = 403,
 | 
					    F32MAT4X3 = 403,
 | 
				
			||||||
    ATOMIC_UINT = 404,
 | 
					    F32MAT4X4 = 404,
 | 
				
			||||||
    ACCSTRUCTNV = 405,
 | 
					    F64MAT2X2 = 405,
 | 
				
			||||||
    FCOOPMATNV = 406,
 | 
					    F64MAT2X3 = 406,
 | 
				
			||||||
    ICOOPMATNV = 407,
 | 
					    F64MAT2X4 = 407,
 | 
				
			||||||
    UCOOPMATNV = 408,
 | 
					    F64MAT3X2 = 408,
 | 
				
			||||||
    SAMPLER1D = 409,
 | 
					    F64MAT3X3 = 409,
 | 
				
			||||||
    SAMPLER1DARRAY = 410,
 | 
					    F64MAT3X4 = 410,
 | 
				
			||||||
    SAMPLER1DARRAYSHADOW = 411,
 | 
					    F64MAT4X2 = 411,
 | 
				
			||||||
    ISAMPLER1D = 412,
 | 
					    F64MAT4X3 = 412,
 | 
				
			||||||
    SAMPLER1DSHADOW = 413,
 | 
					    F64MAT4X4 = 413,
 | 
				
			||||||
    SAMPLER2DRECT = 414,
 | 
					    ATOMIC_UINT = 414,
 | 
				
			||||||
    SAMPLER2DRECTSHADOW = 415,
 | 
					    ACCSTRUCTNV = 415,
 | 
				
			||||||
    ISAMPLER2DRECT = 416,
 | 
					    FCOOPMATNV = 416,
 | 
				
			||||||
    USAMPLER2DRECT = 417,
 | 
					    ICOOPMATNV = 417,
 | 
				
			||||||
    SAMPLERBUFFER = 418,
 | 
					    UCOOPMATNV = 418,
 | 
				
			||||||
    ISAMPLERBUFFER = 419,
 | 
					    SAMPLERCUBEARRAY = 419,
 | 
				
			||||||
    USAMPLERBUFFER = 420,
 | 
					    SAMPLERCUBEARRAYSHADOW = 420,
 | 
				
			||||||
    SAMPLER2DMS = 421,
 | 
					    ISAMPLERCUBEARRAY = 421,
 | 
				
			||||||
    ISAMPLER2DMS = 422,
 | 
					    USAMPLERCUBEARRAY = 422,
 | 
				
			||||||
    USAMPLER2DMS = 423,
 | 
					    SAMPLER1D = 423,
 | 
				
			||||||
    SAMPLER2DMSARRAY = 424,
 | 
					    SAMPLER1DARRAY = 424,
 | 
				
			||||||
    ISAMPLER2DMSARRAY = 425,
 | 
					    SAMPLER1DARRAYSHADOW = 425,
 | 
				
			||||||
    USAMPLER2DMSARRAY = 426,
 | 
					    ISAMPLER1D = 426,
 | 
				
			||||||
    SAMPLEREXTERNALOES = 427,
 | 
					    SAMPLER1DSHADOW = 427,
 | 
				
			||||||
    SAMPLEREXTERNAL2DY2YEXT = 428,
 | 
					    SAMPLER2DRECT = 428,
 | 
				
			||||||
    ISAMPLER1DARRAY = 429,
 | 
					    SAMPLER2DRECTSHADOW = 429,
 | 
				
			||||||
    USAMPLER1D = 430,
 | 
					    ISAMPLER2DRECT = 430,
 | 
				
			||||||
    USAMPLER1DARRAY = 431,
 | 
					    USAMPLER2DRECT = 431,
 | 
				
			||||||
    F16SAMPLER1D = 432,
 | 
					    SAMPLERBUFFER = 432,
 | 
				
			||||||
    F16SAMPLER2D = 433,
 | 
					    ISAMPLERBUFFER = 433,
 | 
				
			||||||
    F16SAMPLER3D = 434,
 | 
					    USAMPLERBUFFER = 434,
 | 
				
			||||||
    F16SAMPLER2DRECT = 435,
 | 
					    SAMPLER2DMS = 435,
 | 
				
			||||||
    F16SAMPLERCUBE = 436,
 | 
					    ISAMPLER2DMS = 436,
 | 
				
			||||||
    F16SAMPLER1DARRAY = 437,
 | 
					    USAMPLER2DMS = 437,
 | 
				
			||||||
    F16SAMPLER2DARRAY = 438,
 | 
					    SAMPLER2DMSARRAY = 438,
 | 
				
			||||||
    F16SAMPLERCUBEARRAY = 439,
 | 
					    ISAMPLER2DMSARRAY = 439,
 | 
				
			||||||
    F16SAMPLERBUFFER = 440,
 | 
					    USAMPLER2DMSARRAY = 440,
 | 
				
			||||||
    F16SAMPLER2DMS = 441,
 | 
					    SAMPLEREXTERNALOES = 441,
 | 
				
			||||||
    F16SAMPLER2DMSARRAY = 442,
 | 
					    SAMPLEREXTERNAL2DY2YEXT = 442,
 | 
				
			||||||
    F16SAMPLER1DSHADOW = 443,
 | 
					    ISAMPLER1DARRAY = 443,
 | 
				
			||||||
    F16SAMPLER2DSHADOW = 444,
 | 
					    USAMPLER1D = 444,
 | 
				
			||||||
    F16SAMPLER1DARRAYSHADOW = 445,
 | 
					    USAMPLER1DARRAY = 445,
 | 
				
			||||||
    F16SAMPLER2DARRAYSHADOW = 446,
 | 
					    F16SAMPLER1D = 446,
 | 
				
			||||||
    F16SAMPLER2DRECTSHADOW = 447,
 | 
					    F16SAMPLER2D = 447,
 | 
				
			||||||
    F16SAMPLERCUBESHADOW = 448,
 | 
					    F16SAMPLER3D = 448,
 | 
				
			||||||
    F16SAMPLERCUBEARRAYSHADOW = 449,
 | 
					    F16SAMPLER2DRECT = 449,
 | 
				
			||||||
    IMAGE1D = 450,
 | 
					    F16SAMPLERCUBE = 450,
 | 
				
			||||||
    IIMAGE1D = 451,
 | 
					    F16SAMPLER1DARRAY = 451,
 | 
				
			||||||
    UIMAGE1D = 452,
 | 
					    F16SAMPLER2DARRAY = 452,
 | 
				
			||||||
    IMAGE2D = 453,
 | 
					    F16SAMPLERCUBEARRAY = 453,
 | 
				
			||||||
    IIMAGE2D = 454,
 | 
					    F16SAMPLERBUFFER = 454,
 | 
				
			||||||
    UIMAGE2D = 455,
 | 
					    F16SAMPLER2DMS = 455,
 | 
				
			||||||
    IMAGE3D = 456,
 | 
					    F16SAMPLER2DMSARRAY = 456,
 | 
				
			||||||
    IIMAGE3D = 457,
 | 
					    F16SAMPLER1DSHADOW = 457,
 | 
				
			||||||
    UIMAGE3D = 458,
 | 
					    F16SAMPLER2DSHADOW = 458,
 | 
				
			||||||
    IMAGE2DRECT = 459,
 | 
					    F16SAMPLER1DARRAYSHADOW = 459,
 | 
				
			||||||
    IIMAGE2DRECT = 460,
 | 
					    F16SAMPLER2DARRAYSHADOW = 460,
 | 
				
			||||||
    UIMAGE2DRECT = 461,
 | 
					    F16SAMPLER2DRECTSHADOW = 461,
 | 
				
			||||||
    IMAGECUBE = 462,
 | 
					    F16SAMPLERCUBESHADOW = 462,
 | 
				
			||||||
    IIMAGECUBE = 463,
 | 
					    F16SAMPLERCUBEARRAYSHADOW = 463,
 | 
				
			||||||
    UIMAGECUBE = 464,
 | 
					    IMAGE1D = 464,
 | 
				
			||||||
    IMAGEBUFFER = 465,
 | 
					    IIMAGE1D = 465,
 | 
				
			||||||
    IIMAGEBUFFER = 466,
 | 
					    UIMAGE1D = 466,
 | 
				
			||||||
    UIMAGEBUFFER = 467,
 | 
					    IMAGE2D = 467,
 | 
				
			||||||
    IMAGE1DARRAY = 468,
 | 
					    IIMAGE2D = 468,
 | 
				
			||||||
    IIMAGE1DARRAY = 469,
 | 
					    UIMAGE2D = 469,
 | 
				
			||||||
    UIMAGE1DARRAY = 470,
 | 
					    IMAGE3D = 470,
 | 
				
			||||||
    IMAGE2DARRAY = 471,
 | 
					    IIMAGE3D = 471,
 | 
				
			||||||
    IIMAGE2DARRAY = 472,
 | 
					    UIMAGE3D = 472,
 | 
				
			||||||
    UIMAGE2DARRAY = 473,
 | 
					    IMAGE2DRECT = 473,
 | 
				
			||||||
    IMAGECUBEARRAY = 474,
 | 
					    IIMAGE2DRECT = 474,
 | 
				
			||||||
    IIMAGECUBEARRAY = 475,
 | 
					    UIMAGE2DRECT = 475,
 | 
				
			||||||
    UIMAGECUBEARRAY = 476,
 | 
					    IMAGECUBE = 476,
 | 
				
			||||||
    IMAGE2DMS = 477,
 | 
					    IIMAGECUBE = 477,
 | 
				
			||||||
    IIMAGE2DMS = 478,
 | 
					    UIMAGECUBE = 478,
 | 
				
			||||||
    UIMAGE2DMS = 479,
 | 
					    IMAGEBUFFER = 479,
 | 
				
			||||||
    IMAGE2DMSARRAY = 480,
 | 
					    IIMAGEBUFFER = 480,
 | 
				
			||||||
    IIMAGE2DMSARRAY = 481,
 | 
					    UIMAGEBUFFER = 481,
 | 
				
			||||||
    UIMAGE2DMSARRAY = 482,
 | 
					    IMAGE1DARRAY = 482,
 | 
				
			||||||
    F16IMAGE1D = 483,
 | 
					    IIMAGE1DARRAY = 483,
 | 
				
			||||||
    F16IMAGE2D = 484,
 | 
					    UIMAGE1DARRAY = 484,
 | 
				
			||||||
    F16IMAGE3D = 485,
 | 
					    IMAGE2DARRAY = 485,
 | 
				
			||||||
    F16IMAGE2DRECT = 486,
 | 
					    IIMAGE2DARRAY = 486,
 | 
				
			||||||
    F16IMAGECUBE = 487,
 | 
					    UIMAGE2DARRAY = 487,
 | 
				
			||||||
    F16IMAGE1DARRAY = 488,
 | 
					    IMAGECUBEARRAY = 488,
 | 
				
			||||||
    F16IMAGE2DARRAY = 489,
 | 
					    IIMAGECUBEARRAY = 489,
 | 
				
			||||||
    F16IMAGECUBEARRAY = 490,
 | 
					    UIMAGECUBEARRAY = 490,
 | 
				
			||||||
    F16IMAGEBUFFER = 491,
 | 
					    IMAGE2DMS = 491,
 | 
				
			||||||
    F16IMAGE2DMS = 492,
 | 
					    IIMAGE2DMS = 492,
 | 
				
			||||||
    F16IMAGE2DMSARRAY = 493,
 | 
					    UIMAGE2DMS = 493,
 | 
				
			||||||
    SAMPLER = 494,
 | 
					    IMAGE2DMSARRAY = 494,
 | 
				
			||||||
    SAMPLERSHADOW = 495,
 | 
					    IIMAGE2DMSARRAY = 495,
 | 
				
			||||||
    TEXTURE1D = 496,
 | 
					    UIMAGE2DMSARRAY = 496,
 | 
				
			||||||
    TEXTURE2D = 497,
 | 
					    F16IMAGE1D = 497,
 | 
				
			||||||
    TEXTURE3D = 498,
 | 
					    F16IMAGE2D = 498,
 | 
				
			||||||
    TEXTURECUBE = 499,
 | 
					    F16IMAGE3D = 499,
 | 
				
			||||||
    TEXTURE1DARRAY = 500,
 | 
					    F16IMAGE2DRECT = 500,
 | 
				
			||||||
    TEXTURE2DARRAY = 501,
 | 
					    F16IMAGECUBE = 501,
 | 
				
			||||||
    ITEXTURE1D = 502,
 | 
					    F16IMAGE1DARRAY = 502,
 | 
				
			||||||
    ITEXTURE2D = 503,
 | 
					    F16IMAGE2DARRAY = 503,
 | 
				
			||||||
    ITEXTURE3D = 504,
 | 
					    F16IMAGECUBEARRAY = 504,
 | 
				
			||||||
    ITEXTURECUBE = 505,
 | 
					    F16IMAGEBUFFER = 505,
 | 
				
			||||||
    ITEXTURE1DARRAY = 506,
 | 
					    F16IMAGE2DMS = 506,
 | 
				
			||||||
    ITEXTURE2DARRAY = 507,
 | 
					    F16IMAGE2DMSARRAY = 507,
 | 
				
			||||||
    UTEXTURE1D = 508,
 | 
					    TEXTURECUBEARRAY = 508,
 | 
				
			||||||
    UTEXTURE2D = 509,
 | 
					    ITEXTURECUBEARRAY = 509,
 | 
				
			||||||
    UTEXTURE3D = 510,
 | 
					    UTEXTURECUBEARRAY = 510,
 | 
				
			||||||
    UTEXTURECUBE = 511,
 | 
					    TEXTURE1D = 511,
 | 
				
			||||||
    UTEXTURE1DARRAY = 512,
 | 
					    ITEXTURE1D = 512,
 | 
				
			||||||
    UTEXTURE2DARRAY = 513,
 | 
					    UTEXTURE1D = 513,
 | 
				
			||||||
    TEXTURE2DRECT = 514,
 | 
					    TEXTURE1DARRAY = 514,
 | 
				
			||||||
    ITEXTURE2DRECT = 515,
 | 
					    ITEXTURE1DARRAY = 515,
 | 
				
			||||||
    UTEXTURE2DRECT = 516,
 | 
					    UTEXTURE1DARRAY = 516,
 | 
				
			||||||
    TEXTUREBUFFER = 517,
 | 
					    TEXTURE2DRECT = 517,
 | 
				
			||||||
    ITEXTUREBUFFER = 518,
 | 
					    ITEXTURE2DRECT = 518,
 | 
				
			||||||
    UTEXTUREBUFFER = 519,
 | 
					    UTEXTURE2DRECT = 519,
 | 
				
			||||||
    TEXTURECUBEARRAY = 520,
 | 
					    TEXTUREBUFFER = 520,
 | 
				
			||||||
    ITEXTURECUBEARRAY = 521,
 | 
					    ITEXTUREBUFFER = 521,
 | 
				
			||||||
    UTEXTURECUBEARRAY = 522,
 | 
					    UTEXTUREBUFFER = 522,
 | 
				
			||||||
    TEXTURE2DMS = 523,
 | 
					    TEXTURE2DMS = 523,
 | 
				
			||||||
    ITEXTURE2DMS = 524,
 | 
					    ITEXTURE2DMS = 524,
 | 
				
			||||||
    UTEXTURE2DMS = 525,
 | 
					    UTEXTURE2DMS = 525,
 | 
				
			||||||
@ -414,27 +414,27 @@ extern int yydebug;
 | 
				
			|||||||
    DEFAULT = 624,
 | 
					    DEFAULT = 624,
 | 
				
			||||||
    UNIFORM = 625,
 | 
					    UNIFORM = 625,
 | 
				
			||||||
    SHARED = 626,
 | 
					    SHARED = 626,
 | 
				
			||||||
    FLAT = 627,
 | 
					    BUFFER = 627,
 | 
				
			||||||
    SMOOTH = 628,
 | 
					    FLAT = 628,
 | 
				
			||||||
    LAYOUT = 629,
 | 
					    SMOOTH = 629,
 | 
				
			||||||
    DOUBLECONSTANT = 630,
 | 
					    LAYOUT = 630,
 | 
				
			||||||
    INT16CONSTANT = 631,
 | 
					    DOUBLECONSTANT = 631,
 | 
				
			||||||
    UINT16CONSTANT = 632,
 | 
					    INT16CONSTANT = 632,
 | 
				
			||||||
    FLOAT16CONSTANT = 633,
 | 
					    UINT16CONSTANT = 633,
 | 
				
			||||||
    INT32CONSTANT = 634,
 | 
					    FLOAT16CONSTANT = 634,
 | 
				
			||||||
    UINT32CONSTANT = 635,
 | 
					    INT32CONSTANT = 635,
 | 
				
			||||||
    INT64CONSTANT = 636,
 | 
					    UINT32CONSTANT = 636,
 | 
				
			||||||
    UINT64CONSTANT = 637,
 | 
					    INT64CONSTANT = 637,
 | 
				
			||||||
    SUBROUTINE = 638,
 | 
					    UINT64CONSTANT = 638,
 | 
				
			||||||
    DEMOTE = 639,
 | 
					    SUBROUTINE = 639,
 | 
				
			||||||
    PAYLOADNV = 640,
 | 
					    DEMOTE = 640,
 | 
				
			||||||
    PAYLOADINNV = 641,
 | 
					    PAYLOADNV = 641,
 | 
				
			||||||
    HITATTRNV = 642,
 | 
					    PAYLOADINNV = 642,
 | 
				
			||||||
    CALLDATANV = 643,
 | 
					    HITATTRNV = 643,
 | 
				
			||||||
    CALLDATAINNV = 644,
 | 
					    CALLDATANV = 644,
 | 
				
			||||||
    PATCH = 645,
 | 
					    CALLDATAINNV = 645,
 | 
				
			||||||
    SAMPLE = 646,
 | 
					    PATCH = 646,
 | 
				
			||||||
    BUFFER = 647,
 | 
					    SAMPLE = 647,
 | 
				
			||||||
    NONUNIFORM = 648,
 | 
					    NONUNIFORM = 648,
 | 
				
			||||||
    COHERENT = 649,
 | 
					    COHERENT = 649,
 | 
				
			||||||
    VOLATILE = 650,
 | 
					    VOLATILE = 650,
 | 
				
			||||||
 | 
				
			|||||||
@ -496,6 +496,7 @@ void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, bool crossStage)
 | 
					void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, bool crossStage)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    bool writeTypeComparison = false;
 | 
					    bool writeTypeComparison = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Types have to match
 | 
					    // Types have to match
 | 
				
			||||||
@ -546,7 +547,6 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
 | 
				
			|||||||
        writeTypeComparison = true;
 | 
					        writeTypeComparison = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
    // Memory...
 | 
					    // Memory...
 | 
				
			||||||
    if (symbol.getQualifier().coherent          != unitSymbol.getQualifier().coherent ||
 | 
					    if (symbol.getQualifier().coherent          != unitSymbol.getQualifier().coherent ||
 | 
				
			||||||
        symbol.getQualifier().devicecoherent    != unitSymbol.getQualifier().devicecoherent ||
 | 
					        symbol.getQualifier().devicecoherent    != unitSymbol.getQualifier().devicecoherent ||
 | 
				
			||||||
@ -561,7 +561,6 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
 | 
				
			|||||||
        error(infoSink, "Memory qualifiers must match:");
 | 
					        error(infoSink, "Memory qualifiers must match:");
 | 
				
			||||||
        writeTypeComparison = true;
 | 
					        writeTypeComparison = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Layouts...
 | 
					    // Layouts...
 | 
				
			||||||
    // TODO: 4.4 enhanced layouts: Generalize to include offset/align: current spec
 | 
					    // TODO: 4.4 enhanced layouts: Generalize to include offset/align: current spec
 | 
				
			||||||
@ -591,6 +590,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
 | 
				
			|||||||
    if (writeTypeComparison)
 | 
					    if (writeTypeComparison)
 | 
				
			||||||
        infoSink.info << "    " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus \"" <<
 | 
					        infoSink.info << "    " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus \"" <<
 | 
				
			||||||
                                                             unitSymbol.getType().getCompleteString() << "\"\n";
 | 
					                                                             unitSymbol.getType().getCompleteString() << "\"\n";
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
@ -1095,7 +1095,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // combine location and component ranges
 | 
					        // combine location and component ranges
 | 
				
			||||||
        TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.layoutIndex : 0);
 | 
					        TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.getIndex() : 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // check for collisions, except for vertex inputs on desktop targeting OpenGL
 | 
					        // check for collisions, except for vertex inputs on desktop targeting OpenGL
 | 
				
			||||||
        if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
 | 
					        if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
 | 
				
			||||||
 | 
				
			|||||||
@ -147,6 +147,7 @@ struct TOffsetRange {
 | 
				
			|||||||
    TRange offset;
 | 
					    TRange offset;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
// Things that need to be tracked per xfb buffer.
 | 
					// Things that need to be tracked per xfb buffer.
 | 
				
			||||||
struct TXfbBuffer {
 | 
					struct TXfbBuffer {
 | 
				
			||||||
    TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false),
 | 
					    TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false),
 | 
				
			||||||
@ -158,6 +159,7 @@ struct TXfbBuffer {
 | 
				
			|||||||
    bool contains32BitType;
 | 
					    bool contains32BitType;
 | 
				
			||||||
    bool contains16BitType;
 | 
					    bool contains16BitType;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Track a set of strings describing how the module was processed.
 | 
					// Track a set of strings describing how the module was processed.
 | 
				
			||||||
// Using the form:
 | 
					// Using the form:
 | 
				
			||||||
@ -267,7 +269,6 @@ public:
 | 
				
			|||||||
        uniformLocationBase(0)
 | 
					        uniformLocationBase(0)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					 | 
				
			||||||
        localSize[0] = 1;
 | 
					        localSize[0] = 1;
 | 
				
			||||||
        localSize[1] = 1;
 | 
					        localSize[1] = 1;
 | 
				
			||||||
        localSize[2] = 1;
 | 
					        localSize[2] = 1;
 | 
				
			||||||
@ -277,6 +278,7 @@ public:
 | 
				
			|||||||
        localSizeSpecId[0] = TQualifier::layoutNotSet;
 | 
					        localSizeSpecId[0] = TQualifier::layoutNotSet;
 | 
				
			||||||
        localSizeSpecId[1] = TQualifier::layoutNotSet;
 | 
					        localSizeSpecId[1] = TQualifier::layoutNotSet;
 | 
				
			||||||
        localSizeSpecId[2] = TQualifier::layoutNotSet;
 | 
					        localSizeSpecId[2] = TQualifier::layoutNotSet;
 | 
				
			||||||
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
        xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
 | 
					        xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
 | 
				
			||||||
        shiftBinding.fill(0);
 | 
					        shiftBinding.fill(0);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@ -465,7 +467,23 @@ public:
 | 
				
			|||||||
    bool usingStorageBuffer() const { return useStorageBuffer; }
 | 
					    bool usingStorageBuffer() const { return useStorageBuffer; }
 | 
				
			||||||
    void setDepthReplacing() { depthReplacing = true; }
 | 
					    void setDepthReplacing() { depthReplacing = true; }
 | 
				
			||||||
    bool isDepthReplacing() const { return depthReplacing; }
 | 
					    bool isDepthReplacing() const { return depthReplacing; }
 | 
				
			||||||
 | 
					    bool setLocalSize(int dim, int size)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (localSizeNotDefault[dim])
 | 
				
			||||||
 | 
					            return size == localSize[dim];
 | 
				
			||||||
 | 
					        localSizeNotDefault[dim] = true;
 | 
				
			||||||
 | 
					        localSize[dim] = size;
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    unsigned int getLocalSize(int dim) const { return localSize[dim]; }
 | 
				
			||||||
 | 
					    bool setLocalSizeSpecId(int dim, int id)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (localSizeSpecId[dim] != TQualifier::layoutNotSet)
 | 
				
			||||||
 | 
					            return id == localSizeSpecId[dim];
 | 
				
			||||||
 | 
					        localSizeSpecId[dim] = id;
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; }
 | 
				
			||||||
#ifdef GLSLANG_WEB
 | 
					#ifdef GLSLANG_WEB
 | 
				
			||||||
    void output(TInfoSink&, bool tree) { }
 | 
					    void output(TInfoSink&, bool tree) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -492,6 +510,7 @@ public:
 | 
				
			|||||||
    bool usingVariablePointers() const { return false; }
 | 
					    bool usingVariablePointers() const { return false; }
 | 
				
			||||||
    unsigned getXfbStride(int buffer) const { return 0; }
 | 
					    unsigned getXfbStride(int buffer) const { return 0; }
 | 
				
			||||||
    bool hasLayoutDerivativeModeNone() const { return false; }
 | 
					    bool hasLayoutDerivativeModeNone() const { return false; }
 | 
				
			||||||
 | 
					    ComputeDerivativeMode getLayoutDerivativeModeNone() const { return LayoutDerivativeNone; }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    void output(TInfoSink&, bool tree);
 | 
					    void output(TInfoSink&, bool tree);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -655,24 +674,6 @@ public:
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    TInterlockOrdering getInterlockOrdering() const { return interlockOrdering; }
 | 
					    TInterlockOrdering getInterlockOrdering() const { return interlockOrdering; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool setLocalSize(int dim, int size)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (localSizeNotDefault[dim])
 | 
					 | 
				
			||||||
            return size == localSize[dim];
 | 
					 | 
				
			||||||
        localSizeNotDefault[dim] = true;
 | 
					 | 
				
			||||||
        localSize[dim] = size;
 | 
					 | 
				
			||||||
        return true;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    unsigned int getLocalSize(int dim) const { return localSize[dim]; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    bool setLocalSizeSpecId(int dim, int id)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        if (localSizeSpecId[dim] != TQualifier::layoutNotSet)
 | 
					 | 
				
			||||||
            return id == localSizeSpecId[dim];
 | 
					 | 
				
			||||||
        localSizeSpecId[dim] = id;
 | 
					 | 
				
			||||||
        return true;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; }
 | 
					 | 
				
			||||||
    void setXfbMode() { xfbMode = true; }
 | 
					    void setXfbMode() { xfbMode = true; }
 | 
				
			||||||
    bool getXfbMode() const { return xfbMode; }
 | 
					    bool getXfbMode() const { return xfbMode; }
 | 
				
			||||||
    void setMultiStream() { multiStream = true; }
 | 
					    void setMultiStream() { multiStream = true; }
 | 
				
			||||||
@ -757,7 +758,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void setBinaryDoubleOutput() { binaryDoubleOutput = true; }
 | 
					    void setBinaryDoubleOutput() { binaryDoubleOutput = true; }
 | 
				
			||||||
    bool getBinaryDoubleOutput() { return binaryDoubleOutput; }
 | 
					    bool getBinaryDoubleOutput() { return binaryDoubleOutput; }
 | 
				
			||||||
#endif
 | 
					#endif // GLSLANG_WEB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef ENABLE_HLSL
 | 
					#ifdef ENABLE_HLSL
 | 
				
			||||||
    void setHlslFunctionality1() { hlslFunctionality1 = true; }
 | 
					    void setHlslFunctionality1() { hlslFunctionality1 = true; }
 | 
				
			||||||
@ -920,6 +921,9 @@ protected:
 | 
				
			|||||||
    bool useStorageBuffer;
 | 
					    bool useStorageBuffer;
 | 
				
			||||||
    bool nanMinMaxClamp;            // true if desiring min/max/clamp to favor non-NaN over NaN
 | 
					    bool nanMinMaxClamp;            // true if desiring min/max/clamp to favor non-NaN over NaN
 | 
				
			||||||
    bool depthReplacing;
 | 
					    bool depthReplacing;
 | 
				
			||||||
 | 
					    int localSize[3];
 | 
				
			||||||
 | 
					    bool localSizeNotDefault[3];
 | 
				
			||||||
 | 
					    int localSizeSpecId[3];
 | 
				
			||||||
#ifndef GLSLANG_WEB
 | 
					#ifndef GLSLANG_WEB
 | 
				
			||||||
    bool useVulkanMemoryModel;
 | 
					    bool useVulkanMemoryModel;
 | 
				
			||||||
    int invocations;
 | 
					    int invocations;
 | 
				
			||||||
@ -932,9 +936,6 @@ protected:
 | 
				
			|||||||
    TVertexOrder vertexOrder;
 | 
					    TVertexOrder vertexOrder;
 | 
				
			||||||
    TInterlockOrdering interlockOrdering;
 | 
					    TInterlockOrdering interlockOrdering;
 | 
				
			||||||
    bool pointMode;
 | 
					    bool pointMode;
 | 
				
			||||||
    int localSize[3];
 | 
					 | 
				
			||||||
    bool localSizeNotDefault[3];
 | 
					 | 
				
			||||||
    int localSizeSpecId[3];
 | 
					 | 
				
			||||||
    bool earlyFragmentTests;
 | 
					    bool earlyFragmentTests;
 | 
				
			||||||
    bool postDepthCoverage;
 | 
					    bool postDepthCoverage;
 | 
				
			||||||
    TLayoutDepth depthLayout;
 | 
					    TLayoutDepth depthLayout;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user