Browse Source

Add the GLSL_QCOM_tile_shading support

Wooyoung Kim 4 months ago
parent
commit
10ae0e16b9
40 changed files with 2181 additions and 61 deletions
  1. 3 0
      SPIRV/GLSL.ext.QCOM.h
  2. 70 28
      SPIRV/GlslangToSpv.cpp
  3. 10 0
      SPIRV/doc.cpp
  4. 14 0
      SPIRV/spirv.hpp11
  5. 1 1
      Test/baseResults/420.vert.out
  6. 1 1
      Test/baseResults/spv.ext.ShaderTileImage.wronglayout.frag.out
  7. 155 0
      Test/baseResults/spv.qcom.es.tileShading.0.comp.out
  8. 163 0
      Test/baseResults/spv.qcom.es.tileShading.0.frag.out
  9. 155 0
      Test/baseResults/spv.qcom.es.tileShading.1.comp.out
  10. 164 0
      Test/baseResults/spv.qcom.es.tileShading.1.frag.out
  11. 155 0
      Test/baseResults/spv.qcom.es.tileShading.2.comp.out
  12. 164 0
      Test/baseResults/spv.qcom.tileShading.0.comp.out
  13. 169 0
      Test/baseResults/spv.qcom.tileShading.0.frag.out
  14. 164 0
      Test/baseResults/spv.qcom.tileShading.1.comp.out
  15. 170 0
      Test/baseResults/spv.qcom.tileShading.1.frag.out
  16. 34 0
      Test/spv.qcom.es.tileShading.0.comp
  17. 41 0
      Test/spv.qcom.es.tileShading.0.frag
  18. 34 0
      Test/spv.qcom.es.tileShading.1.comp
  19. 43 0
      Test/spv.qcom.es.tileShading.1.frag
  20. 34 0
      Test/spv.qcom.es.tileShading.2.comp
  21. 38 0
      Test/spv.qcom.tileShading.0.comp
  22. 42 0
      Test/spv.qcom.tileShading.0.frag
  23. 39 0
      Test/spv.qcom.tileShading.1.comp
  24. 44 0
      Test/spv.qcom.tileShading.1.frag
  25. 5 0
      glslang/Include/BaseTypes.h
  26. 53 11
      glslang/Include/Types.h
  27. 53 11
      glslang/MachineIndependent/Initialize.cpp
  28. 82 3
      glslang/MachineIndependent/ParseHelper.cpp
  29. 1 0
      glslang/MachineIndependent/ShaderLang.cpp
  30. 11 0
      glslang/MachineIndependent/Versions.cpp
  31. 1 0
      glslang/MachineIndependent/Versions.h
  32. 9 0
      glslang/MachineIndependent/intermOut.cpp
  33. 1 0
      glslang/MachineIndependent/linkValidate.cpp
  34. 28 0
      glslang/MachineIndependent/localintermediate.h
  35. 1 0
      glslang/MachineIndependent/parseVersions.h
  36. 10 3
      glslang/MachineIndependent/reflection.cpp
  37. 7 1
      glslang/MachineIndependent/reflection.h
  38. 1 0
      glslang/Public/ShaderLang.h
  39. 9 0
      gtests/Spv.FromFile.cpp
  40. 2 2
      known_good.json

+ 3 - 0
SPIRV/GLSL.ext.QCOM.h

@@ -40,4 +40,7 @@ const char* const E_SPV_QCOM_image_processing = "SPV_QCOM_image_processing";
 //SPV_QCOM_image_processing2
 const char* const E_SPV_QCOM_image_processing2 = "SPV_QCOM_image_processing2";
 
+//SPV_QCOM_tile_shading
+const char* const E_SPV_QCOM_tile_shading = "SPV_QCOM_tile_shading";
+
 #endif  // #ifndef GLSLextQCOM_H

+ 70 - 28
SPIRV/GlslangToSpv.cpp

@@ -1147,6 +1147,17 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
         builder.addCapability(spv::Capability::CoreBuiltinsARM);
         return spv::BuiltIn::WarpMaxIDARM;
 
+    // QCOM builtins
+    case glslang::EbvTileOffsetQCOM:
+        builder.addExtension(spv::E_SPV_QCOM_tile_shading);
+        return spv::BuiltIn::TileOffsetQCOM;
+    case glslang::EbvTileDimensionQCOM:
+        builder.addExtension(spv::E_SPV_QCOM_tile_shading);
+        return spv::BuiltIn::TileDimensionQCOM;
+    case glslang::EbvTileApronSizeQCOM:
+        builder.addExtension(spv::E_SPV_QCOM_tile_shading);
+        return spv::BuiltIn::TileApronSizeQCOM;
+
     default:
         return spv::BuiltIn::Max;
     }
@@ -1328,6 +1339,12 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
         return spv::StorageClass::TileImageEXT;
     }
 
+    if (type.getQualifier().isTileAttachmentQCOM()) {
+        builder.addExtension(spv::E_SPV_QCOM_tile_shading);
+        builder.addCapability(spv::Capability::TileShadingQCOM);
+        return spv::StorageClass::TileAttachmentQCOM;
+    }
+
     if (glslangIntermediate->getSource() != glslang::EShSourceHlsl ||
             type.getQualifier().storage == glslang::EvqUniform) {
         if (type.isAtomic())
@@ -1741,6 +1758,12 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
             builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
         }
 
+        if (glslangIntermediate->getNonCoherentTileAttachmentReadQCOM()) {
+            builder.addCapability(spv::Capability::TileShadingQCOM);
+            builder.addExecutionMode(shaderEntry, spv::ExecutionMode::NonCoherentTileAttachmentReadQCOM);
+            builder.addExtension(spv::E_SPV_QCOM_tile_shading);
+        }
+
         if (glslangIntermediate->isDepthReplacing())
             builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DepthReplacing);
 
@@ -1822,9 +1845,19 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
             }
             builder.addExecutionModeId(shaderEntry, spv::ExecutionMode::LocalSizeId, dimConstId);
         } else {
-            builder.addExecutionMode(shaderEntry, spv::ExecutionMode::LocalSize, glslangIntermediate->getLocalSize(0),
-                                                                               glslangIntermediate->getLocalSize(1),
-                                                                               glslangIntermediate->getLocalSize(2));
+            if (glslangIntermediate->getTileShadingRateQCOM(0) >= 1 || glslangIntermediate->getTileShadingRateQCOM(1) >= 1 || glslangIntermediate->getTileShadingRateQCOM(2) >= 1) {
+                auto rate_x = glslangIntermediate->getTileShadingRateQCOM(0);
+                auto rate_y = glslangIntermediate->getTileShadingRateQCOM(1);
+                auto rate_z = glslangIntermediate->getTileShadingRateQCOM(2);
+                rate_x = ( rate_x == 0 ? 1 : rate_x );
+                rate_y = ( rate_y == 0 ? 1 : rate_y );
+                rate_z = ( rate_z == 0 ? 1 : rate_z );
+                builder.addExecutionMode(shaderEntry, spv::ExecutionMode::TileShadingRateQCOM, rate_x, rate_y, rate_z);
+            } else {
+                builder.addExecutionMode(shaderEntry, spv::ExecutionMode::LocalSize, glslangIntermediate->getLocalSize(0),
+                                                                                   glslangIntermediate->getLocalSize(1),
+                                                                                   glslangIntermediate->getLocalSize(2));
+            }
         }
         if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) {
             builder.addCapability(spv::Capability::ComputeDerivativeGroupQuadsNV);
@@ -1835,6 +1868,13 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
             builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupLinearNV);
             builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives);
         }
+
+        if (glslangIntermediate->getNonCoherentTileAttachmentReadQCOM()) {
+            builder.addCapability(spv::Capability::TileShadingQCOM);
+            builder.addExecutionMode(shaderEntry, spv::ExecutionMode::NonCoherentTileAttachmentReadQCOM);
+            builder.addExtension(spv::E_SPV_QCOM_tile_shading);
+        }
+
         break;
     }
     case EShLangTessEvaluation:
@@ -3518,7 +3558,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
         builder.addCapability(spv::Capability::RayQueryPositionFetchKHR);
         noReturnValue = true;
         break;
-
     case glslang::EOpImageSampleWeightedQCOM:
         builder.addCapability(spv::Capability::TextureSampleWeightedQCOM);
         builder.addExtension(spv::E_SPV_QCOM_image_processing);
@@ -3877,8 +3916,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
             lvalueCoherentFlags |= TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType());
         } else {
             builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename());
-             glslang::TOperator glslangOp = node->getOp();
-             if (arg == 1 &&
+            glslang::TOperator glslangOp = node->getOp();
+            if (arg == 1 &&
                 (glslangOp == glslang::EOpRayQueryGetIntersectionType ||
                  glslangOp == glslang::EOpRayQueryGetIntersectionT ||
                  glslangOp == glslang::EOpRayQueryGetIntersectionInstanceCustomIndex ||
@@ -3904,18 +3943,18 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
                     )) {
                 bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst();
                 operands.push_back(builder.makeIntConstant(cond ? 1 : 0));
-             } else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) ||
-                        (arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) ||
-                        (arg == 1  && glslangOp == glslang::EOpExecuteCallableKHR) ||
-                        (arg == 1  && glslangOp == glslang::EOpHitObjectExecuteShaderNV) ||
-                        (arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) ||
-                        (arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV)) {
-                 const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0;
-                 const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst();
-                 auto itNode = locationToSymbol[set].find(location);
-                 visitSymbol(itNode->second);
-                 spv::Id symId = getSymbolId(itNode->second);
-                 operands.push_back(symId);
+            } else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) ||
+                       (arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) ||
+                       (arg == 1  && glslangOp == glslang::EOpExecuteCallableKHR) ||
+                       (arg == 1  && glslangOp == glslang::EOpHitObjectExecuteShaderNV) ||
+                       (arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) ||
+                       (arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV)) {
+                const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0;
+                const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst();
+                auto itNode = locationToSymbol[set].find(location);
+                visitSymbol(itNode->second);
+                spv::Id symId = getSymbolId(itNode->second);
+                operands.push_back(symId);
             } else if ((arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitNV) ||
                        (arg == 13 && glslangOp == glslang::EOpHitObjectRecordHitMotionNV) ||
                        (arg == 11 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexNV) ||
@@ -3927,16 +3966,16 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
                  visitSymbol(itNode->second);
                  spv::Id symId = getSymbolId(itNode->second);
                  operands.push_back(symId);
-             } else if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvLiteral()) {
-                 // Will be translated to a literal value, make a placeholder here
-                 operands.push_back(spv::NoResult);
-             } else if (glslangOperands[arg]->getAsTyped()->getBasicType() == glslang::EbtFunction) {
-                 spv::Function* function = functionMap[glslangOperands[arg]->getAsSymbolNode()->getMangledName().c_str()];
-                 assert(function);
-                 operands.push_back(function->getId());
-             } else  {
-                operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType()));
-             }
+            } else if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvLiteral()) {
+                // Will be translated to a literal value, make a placeholder here
+                operands.push_back(spv::NoResult);
+            } else if (glslangOperands[arg]->getAsTyped()->getBasicType() == glslang::EbtFunction) {
+                spv::Function* function = functionMap[glslangOperands[arg]->getAsSymbolNode()->getMangledName().c_str()];
+                assert(function);
+                operands.push_back(function->getId());
+            } else  {
+               operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType()));
+            }
         }
     }
 
@@ -4808,6 +4847,9 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
             builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3);
             builder.addCapability(spv::Capability::StorageUniformBufferBlock16);
             break;
+        case spv::StorageClass::TileAttachmentQCOM:
+            builder.addCapability(spv::Capability::TileShadingQCOM);
+            break;
         default:
             if (storageClass == spv::StorageClass::Workgroup &&
                 node->getType().getBasicType() == glslang::EbtBlock) {

+ 10 - 0
SPIRV/doc.cpp

@@ -194,6 +194,10 @@ const char* ExecutionModeString(int mode)
     case (int)ExecutionMode::SignedZeroInfNanPreserve:      return "SignedZeroInfNanPreserve";
     case (int)ExecutionMode::RoundingModeRTE:               return "RoundingModeRTE";
     case (int)ExecutionMode::RoundingModeRTZ:               return "RoundingModeRTZ";
+
+    case (int)ExecutionMode::NonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM";
+    case (int)ExecutionMode::TileShadingRateQCOM:               return "TileShadingRateQCOM";
+
     case (int)ExecutionMode::EarlyAndLateFragmentTestsAMD:  return "EarlyAndLateFragmentTestsAMD";
     case (int)ExecutionMode::StencilRefUnchangedFrontAMD:   return "StencilRefUnchangedFrontAMD";
     case (int)ExecutionMode::StencilRefLessFrontAMD:        return "StencilRefLessFrontAMD";
@@ -249,6 +253,7 @@ const char* StorageClassString(int StorageClass)
     case 11: return "Image";
     case 12: return "StorageBuffer";
 
+    case (int)StorageClass::TileAttachmentQCOM:       return "TileAttachmentQCOM";
     case (int)StorageClass::RayPayloadKHR:            return "RayPayloadKHR";
     case (int)StorageClass::HitAttributeKHR:          return "HitAttributeKHR";
     case (int)StorageClass::IncomingRayPayloadKHR:    return "IncomingRayPayloadKHR";
@@ -404,6 +409,10 @@ const char* BuiltInString(int builtIn)
     case 4444: return "ShadingRateKHR";
     case 5014: return "FragStencilRefEXT";
 
+    case (int)BuiltIn::TileOffsetQCOM:     return "TileOffsetQCOM";
+    case (int)BuiltIn::TileDimensionQCOM:  return "TileDimensionQCOM";
+    case (int)BuiltIn::TileApronSizeQCOM:  return "TileApronSizeQCOM";
+
     case 4992: return "BaryCoordNoPerspAMD";
     case 4993: return "BaryCoordNoPerspCentroidAMD";
     case 4994: return "BaryCoordNoPerspSampleAMD";
@@ -1099,6 +1108,7 @@ const char* CapabilityString(int info)
     case (int)Capability::TextureSampleWeightedQCOM:           return "TextureSampleWeightedQCOM";
     case (int)Capability::TextureBoxFilterQCOM:                return "TextureBoxFilterQCOM";
     case (int)Capability::TextureBlockMatchQCOM:               return "TextureBlockMatchQCOM";
+    case (int)Capability::TileShadingQCOM:                     return "TileShadingQCOM";
     case (int)Capability::TextureBlockMatch2QCOM:              return "TextureBlockMatch2QCOM";
 
     case (int)Capability::ReplicatedCompositesEXT:             return "CapabilityReplicatedCompositesEXT";

+ 14 - 0
SPIRV/spirv.hpp11

@@ -172,6 +172,8 @@ enum class ExecutionMode : unsigned {
     SignedZeroInfNanPreserve = 4461,
     RoundingModeRTE = 4462,
     RoundingModeRTZ = 4463,
+    NonCoherentTileAttachmentReadQCOM = 4489,
+    TileShadingRateQCOM = 4490,
     EarlyAndLateFragmentTestsAMD = 5017,
     StencilRefReplacingEXT = 5027,
     CoalescingAMDX = 5069,
@@ -241,6 +243,7 @@ enum class StorageClass : unsigned {
     Image = 11,
     StorageBuffer = 12,
     TileImageEXT = 4172,
+    TileAttachmentQCOM = 4491,
     NodePayloadAMDX = 5068,
     CallableDataKHR = 5328,
     CallableDataNV = 5328,
@@ -713,6 +716,9 @@ enum class BuiltIn : unsigned {
     DeviceIndex = 4438,
     ViewIndex = 4440,
     ShadingRateKHR = 4444,
+    TileOffsetQCOM = 4492,
+    TileDimensionQCOM = 4493,
+    TileApronSizeQCOM = 4494,
     BaryCoordNoPerspAMD = 4992,
     BaryCoordNoPerspCentroidAMD = 4993,
     BaryCoordNoPerspSampleAMD = 4994,
@@ -1099,6 +1105,7 @@ enum class Capability : unsigned {
     TextureSampleWeightedQCOM = 4484,
     TextureBoxFilterQCOM = 4485,
     TextureBlockMatchQCOM = 4486,
+    TileShadingQCOM = 4495,
     TextureBlockMatch2QCOM = 4498,
     Float16ImageAMD = 5008,
     ImageGatherBiasLodAMD = 5009,
@@ -3278,6 +3285,8 @@ inline const char* ExecutionModeToString(ExecutionMode value) {
     case ExecutionMode::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
     case ExecutionMode::RoundingModeRTE: return "RoundingModeRTE";
     case ExecutionMode::RoundingModeRTZ: return "RoundingModeRTZ";
+    case ExecutionMode::NonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM";
+    case ExecutionMode::TileShadingRateQCOM: return "TileShadingRateQCOM";
     case ExecutionMode::EarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD";
     case ExecutionMode::StencilRefReplacingEXT: return "StencilRefReplacingEXT";
     case ExecutionMode::CoalescingAMDX: return "CoalescingAMDX";
@@ -3344,6 +3353,7 @@ inline const char* StorageClassToString(StorageClass value) {
     case StorageClass::Image: return "Image";
     case StorageClass::StorageBuffer: return "StorageBuffer";
     case StorageClass::TileImageEXT: return "TileImageEXT";
+    case StorageClass::TileAttachmentQCOM: return "TileAttachmentQCOM";
     case StorageClass::NodePayloadAMDX: return "NodePayloadAMDX";
     case StorageClass::CallableDataKHR: return "CallableDataKHR";
     case StorageClass::IncomingCallableDataKHR: return "IncomingCallableDataKHR";
@@ -3745,6 +3755,9 @@ inline const char* BuiltInToString(BuiltIn value) {
     case BuiltIn::DeviceIndex: return "DeviceIndex";
     case BuiltIn::ViewIndex: return "ViewIndex";
     case BuiltIn::ShadingRateKHR: return "ShadingRateKHR";
+    case BuiltIn::TileOffsetQCOM: return "TileOffsetQCOM";
+    case BuiltIn::TileDimensionQCOM: return "TileDimensionQCOM";
+    case BuiltIn::TileApronSizeQCOM: return "TileApronSizeQCOM";
     case BuiltIn::BaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD";
     case BuiltIn::BaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD";
     case BuiltIn::BaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD";
@@ -3959,6 +3972,7 @@ inline const char* CapabilityToString(Capability value) {
     case Capability::TextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM";
     case Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM";
     case Capability::TextureBlockMatchQCOM: return "TextureBlockMatchQCOM";
+    case Capability::TileShadingQCOM: return "TileShadingQCOM";
     case Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM";
     case Capability::Float16ImageAMD: return "Float16ImageAMD";
     case Capability::ImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD";

+ 1 - 1
Test/baseResults/420.vert.out

@@ -23,7 +23,7 @@ ERROR: 0:63: 'xxy' : vector swizzle selection out of range
 ERROR: 0:66: 'binding' : cannot declare a default, include a type or full declaration 
 ERROR: 0:69: 'location/component/index' : cannot declare a default, use a full declaration 
 ERROR: 0:70: 'input block' : not supported in this stage: vertex
-ERROR: 0:70: 'binding' : requires uniform or buffer storage qualifier 
+ERROR: 0:70: 'binding' : requires uniform or buffer or tile image storage qualifier 
 ERROR: 0:71: 'binding' : binding is too large 
 ERROR: 0:74: 'binding' : sampler binding not less than gl_MaxCombinedTextureImageUnits 
 ERROR: 0:76: 'binding' : sampler binding not less than gl_MaxCombinedTextureImageUnits (using array)

+ 1 - 1
Test/baseResults/spv.ext.ShaderTileImage.wronglayout.frag.out

@@ -1,5 +1,5 @@
 spv.ext.ShaderTileImage.wronglayout.frag
-ERROR: 0:7: 'binding' : requires uniform or buffer storage qualifier 
+ERROR: 0:7: 'binding' : requires uniform or buffer or tile image storage qualifier 
 ERROR: 0:7: 'set' : cannot be used with tileImageEXT 
 ERROR: 0:7: 'tileImageEXT' : can only be used with an explicit location 
 ERROR: 0:7: 'input_attachment_index' : can only be used with a subpass 

+ 155 - 0
Test/baseResults/spv.qcom.es.tileShading.0.comp.out

@@ -0,0 +1,155 @@
+spv.qcom.es.tileShading.0.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 93
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main" 12 16 19
+                              ExecutionMode 4 LocalSize 16 16 1
+                              Source ESSL 310
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "uoffset"
+                              Name 12  "gl_GlobalInvocationID"
+                              Name 16  "gl_TileOffsetQCOM"
+                              Name 19  "gl_TileDimensionQCOM"
+                              Name 30  "offset"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 43  "colorC"
+                              Name 44  "input0"
+                              Name 49  "d"
+                              Name 50  "depth"
+                              Name 57  "s"
+                              Name 59  "outColor"
+                              Name 68  "outDepth"
+                              Name 72  "outStencil"
+                              Name 77  "color1"
+                              Name 85  "stencil"
+                              Decorate 12(gl_GlobalInvocationID) BuiltIn GlobalInvocationId
+                              Decorate 16(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 19(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 39(color0) NonWritable
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 44(input0) NonWritable
+                              Decorate 44(input0) Binding 0
+                              Decorate 44(input0) DescriptorSet 0
+                              Decorate 50(depth) NonWritable
+                              Decorate 50(depth) Binding 3
+                              Decorate 50(depth) DescriptorSet 0
+                              Decorate 77(color1) NonReadable
+                              Decorate 77(color1) Binding 2
+                              Decorate 77(color1) DescriptorSet 0
+                              Decorate 85(stencil) NonReadable
+                              Decorate 85(stencil) Binding 4
+                              Decorate 85(stencil) DescriptorSet 0
+                              Decorate 92 BuiltIn WorkgroupSize
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:             TypeVector 6(int) 3
+              11:             TypePointer Input 10(ivec3)
+12(gl_GlobalInvocationID):     11(ptr) Variable Input
+              15:             TypePointer Input 7(ivec2)
+16(gl_TileOffsetQCOM):     15(ptr) Variable Input
+19(gl_TileDimensionQCOM):     11(ptr) Variable Input
+              23:      6(int) Constant 1
+              24:    7(ivec2) ConstantComposite 23 23
+              27:             TypeInt 32 1
+              28:             TypeVector 27(int) 2
+              29:             TypePointer Function 28(ivec2)
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+      44(input0):     38(ptr) Variable TileAttachmentQCOM
+              48:             TypePointer Function 33(float)
+       50(depth):     38(ptr) Variable TileAttachmentQCOM
+              54:      6(int) Constant 0
+              56:             TypePointer Function 6(int)
+              58:      6(int) Constant 2
+              61:   33(float) Constant 1065353216
+              62:   34(fvec4) ConstantComposite 61 61 61 61
+              66:   33(float) Constant 1051260355
+              70:   33(float) Constant 1073741824
+              75:             TypeImage 27(int) 2D nonsampled format:Rgba32i
+              76:             TypePointer TileAttachmentQCOM 75
+      77(color1):     76(ptr) Variable TileAttachmentQCOM
+              81:             TypeVector 27(int) 4
+              83:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              84:             TypePointer TileAttachmentQCOM 83
+     85(stencil):     84(ptr) Variable TileAttachmentQCOM
+              89:             TypeVector 6(int) 4
+              91:      6(int) Constant 16
+              92:   10(ivec3) ConstantComposite 91 91 23
+         4(main):           2 Function None 3
+               5:             Label
+      9(uoffset):      8(ptr) Variable Function
+      30(offset):     29(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+      43(colorC):     35(ptr) Variable Function
+           49(d):     48(ptr) Variable Function
+           57(s):     56(ptr) Variable Function
+    59(outColor):     35(ptr) Variable Function
+    68(outDepth):     48(ptr) Variable Function
+  72(outStencil):     56(ptr) Variable Function
+              13:   10(ivec3) Load 12(gl_GlobalInvocationID)
+              14:    7(ivec2) VectorShuffle 13 13 0 1
+              17:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              18:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              20:   10(ivec3) Load 19(gl_TileDimensionQCOM)
+              21:    7(ivec2) VectorShuffle 20 20 0 1
+              22:    7(ivec2) IAdd 18 21
+              25:    7(ivec2) ISub 22 24
+              26:    7(ivec2) ExtInst 1(GLSL.std.450) 44(UClamp) 14 17 25
+                              Store 9(uoffset) 26
+              31:    7(ivec2) Load 9(uoffset)
+              32:   28(ivec2) Bitcast 31
+                              Store 30(offset) 32
+              40:          37 Load 39(color0)
+              41:   28(ivec2) Load 30(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              45:          37 Load 44(input0)
+              46:   28(ivec2) Load 30(offset)
+              47:   34(fvec4) ImageRead 45 46
+                              Store 43(colorC) 47
+              51:          37 Load 50(depth)
+              52:   28(ivec2) Load 30(offset)
+              53:   34(fvec4) ImageRead 51 52
+              55:   33(float) CompositeExtract 53 0
+                              Store 49(d) 55
+                              Store 57(s) 58
+              60:   34(fvec4) Load 36(colorA)
+              63:   34(fvec4) FAdd 60 62
+              64:   34(fvec4) Load 43(colorC)
+              65:   34(fvec4) FAdd 63 64
+              67:   34(fvec4) VectorTimesScalar 65 66
+                              Store 59(outColor) 67
+              69:   33(float) Load 49(d)
+              71:   33(float) FMul 69 70
+                              Store 68(outDepth) 71
+              73:      6(int) Load 57(s)
+              74:      6(int) IAdd 73 23
+                              Store 72(outStencil) 74
+              78:          75 Load 77(color1)
+              79:   28(ivec2) Load 30(offset)
+              80:   34(fvec4) Load 59(outColor)
+              82:   81(ivec4) ConvertFToS 80
+                              ImageWrite 78 79 82
+              86:          83 Load 85(stencil)
+              87:   28(ivec2) Load 30(offset)
+              88:      6(int) Load 72(outStencil)
+              90:   89(ivec4) CompositeConstruct 88 88 88 88
+                              ImageWrite 86 87 90
+                              Return
+                              FunctionEnd

+ 163 - 0
Test/baseResults/spv.qcom.es.tileShading.0.frag.out

@@ -0,0 +1,163 @@
+spv.qcom.es.tileShading.0.frag
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 100
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 22 26 93
+                              ExecutionMode 4 OriginUpperLeft
+                              Source ESSL 310
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "o2"
+                              Name 20  "offset"
+                              Name 22  "gl_TileOffsetQCOM"
+                              Name 26  "gl_TileDimensionQCOM"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 43  "colorB"
+                              Name 45  "colorC"
+                              Name 46  "input0"
+                              Name 51  "d"
+                              Name 52  "depth"
+                              Name 59  "s"
+                              Name 64  "outColor"
+                              Name 80  "color1"
+                              Name 86  "stencil"
+                              Name 93  "fragColor"
+                              Decorate 22(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 22(gl_TileOffsetQCOM) Flat
+                              Decorate 26(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 26(gl_TileDimensionQCOM) Flat
+                              Decorate 39(color0) NonWritable
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 46(input0) NonWritable
+                              Decorate 46(input0) Binding 0
+                              Decorate 46(input0) DescriptorSet 0
+                              Decorate 52(depth) NonWritable
+                              Decorate 52(depth) Binding 3
+                              Decorate 52(depth) DescriptorSet 0
+                              Decorate 80(color1) NonReadable
+                              Decorate 80(color1) Binding 2
+                              Decorate 80(color1) DescriptorSet 0
+                              Decorate 86(stencil) NonReadable
+                              Decorate 86(stencil) Binding 4
+                              Decorate 86(stencil) DescriptorSet 0
+                              Decorate 93(fragColor) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:      6(int) Constant 8
+              11:      6(int) Constant 4
+              12:    7(ivec2) ConstantComposite 10 11
+              14:      6(int) Constant 2
+              15:    7(ivec2) ConstantComposite 14 14
+              17:             TypeInt 32 1
+              18:             TypeVector 17(int) 2
+              19:             TypePointer Function 18(ivec2)
+              21:             TypePointer Input 7(ivec2)
+22(gl_TileOffsetQCOM):     21(ptr) Variable Input
+              24:             TypeVector 6(int) 3
+              25:             TypePointer Input 24(ivec3)
+26(gl_TileDimensionQCOM):     25(ptr) Variable Input
+              28:   24(ivec3) ConstantComposite 14 14 14
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+      46(input0):     38(ptr) Variable TileAttachmentQCOM
+              50:             TypePointer Function 33(float)
+       52(depth):     38(ptr) Variable TileAttachmentQCOM
+              56:      6(int) Constant 0
+              58:             TypePointer Function 6(int)
+              62:             TypeVector 17(int) 4
+              63:             TypePointer Function 62(ivec4)
+              78:             TypeImage 17(int) 2D nonsampled format:Rgba32i
+              79:             TypePointer TileAttachmentQCOM 78
+      80(color1):     79(ptr) Variable TileAttachmentQCOM
+              84:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              85:             TypePointer TileAttachmentQCOM 84
+     86(stencil):     85(ptr) Variable TileAttachmentQCOM
+              90:             TypeVector 6(int) 4
+              92:             TypePointer Output 34(fvec4)
+   93(fragColor):     92(ptr) Variable Output
+              96:   33(float) Constant 1065353216
+              97:   33(float) Constant 0
+              98:   34(fvec4) ConstantComposite 96 97 97 96
+         4(main):           2 Function None 3
+               5:             Label
+           9(o2):      8(ptr) Variable Function
+      20(offset):     19(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+      43(colorB):     35(ptr) Variable Function
+      45(colorC):     35(ptr) Variable Function
+           51(d):     50(ptr) Variable Function
+           59(s):     58(ptr) Variable Function
+    64(outColor):     63(ptr) Variable Function
+                              Store 9(o2) 12
+              13:    7(ivec2) Load 9(o2)
+              16:    7(ivec2) UDiv 13 15
+                              Store 9(o2) 16
+              23:    7(ivec2) Load 22(gl_TileOffsetQCOM)
+              27:   24(ivec3) Load 26(gl_TileDimensionQCOM)
+              29:   24(ivec3) UDiv 27 28
+              30:    7(ivec2) VectorShuffle 29 29 0 1
+              31:    7(ivec2) IAdd 23 30
+              32:   18(ivec2) Bitcast 31
+                              Store 20(offset) 32
+              40:          37 Load 39(color0)
+              41:   18(ivec2) Load 20(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              44:   34(fvec4) Load 36(colorA)
+                              Store 43(colorB) 44
+              47:          37 Load 46(input0)
+              48:   18(ivec2) Load 20(offset)
+              49:   34(fvec4) ImageRead 47 48
+                              Store 45(colorC) 49
+              53:          37 Load 52(depth)
+              54:   18(ivec2) Load 20(offset)
+              55:   34(fvec4) ImageRead 53 54
+              57:   33(float) CompositeExtract 55 0
+                              Store 51(d) 57
+              60:   33(float) Load 51(d)
+              61:      6(int) ConvertFToU 60
+                              Store 59(s) 61
+              65:   34(fvec4) Load 43(colorB)
+              66:   34(fvec4) Load 43(colorB)
+              67:   34(fvec4) FAdd 65 66
+              68:   34(fvec4) Load 45(colorC)
+              69:   34(fvec4) FAdd 67 68
+              70:   33(float) Load 51(d)
+              71:   34(fvec4) CompositeConstruct 70 70 70 70
+              72:   34(fvec4) FAdd 69 71
+              73:      6(int) Load 59(s)
+              74:   33(float) ConvertUToF 73
+              75:   34(fvec4) CompositeConstruct 74 74 74 74
+              76:   34(fvec4) FAdd 72 75
+              77:   62(ivec4) ConvertFToS 76
+                              Store 64(outColor) 77
+              81:          78 Load 80(color1)
+              82:   18(ivec2) Load 20(offset)
+              83:   62(ivec4) Load 64(outColor)
+                              ImageWrite 81 82 83
+              87:          84 Load 86(stencil)
+              88:   18(ivec2) Load 20(offset)
+              89:   62(ivec4) Load 64(outColor)
+              91:   90(ivec4) Bitcast 89
+                              ImageWrite 87 88 91
+              94:   62(ivec4) Load 64(outColor)
+              95:   34(fvec4) ConvertSToF 94
+              99:   34(fvec4) FAdd 95 98
+                              Store 93(fragColor) 99
+                              Return
+                              FunctionEnd

+ 155 - 0
Test/baseResults/spv.qcom.es.tileShading.1.comp.out

@@ -0,0 +1,155 @@
+spv.qcom.es.tileShading.1.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 93
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main" 12 16 19
+                              ExecutionMode 4 TileShadingRateQCOM 2 2 1
+                              Source ESSL 310
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "uoffset"
+                              Name 12  "gl_GlobalInvocationID"
+                              Name 16  "gl_TileOffsetQCOM"
+                              Name 19  "gl_TileDimensionQCOM"
+                              Name 30  "offset"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 43  "colorC"
+                              Name 44  "input0"
+                              Name 49  "d"
+                              Name 50  "depth"
+                              Name 57  "s"
+                              Name 59  "outColor"
+                              Name 68  "outDepth"
+                              Name 72  "outStencil"
+                              Name 77  "color1"
+                              Name 85  "stencil"
+                              Decorate 12(gl_GlobalInvocationID) BuiltIn GlobalInvocationId
+                              Decorate 16(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 19(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 39(color0) NonWritable
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 44(input0) NonWritable
+                              Decorate 44(input0) Binding 0
+                              Decorate 44(input0) DescriptorSet 0
+                              Decorate 50(depth) NonWritable
+                              Decorate 50(depth) Binding 3
+                              Decorate 50(depth) DescriptorSet 0
+                              Decorate 77(color1) NonReadable
+                              Decorate 77(color1) Binding 2
+                              Decorate 77(color1) DescriptorSet 0
+                              Decorate 85(stencil) NonReadable
+                              Decorate 85(stencil) Binding 4
+                              Decorate 85(stencil) DescriptorSet 0
+                              Decorate 92 BuiltIn WorkgroupSize
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:             TypeVector 6(int) 3
+              11:             TypePointer Input 10(ivec3)
+12(gl_GlobalInvocationID):     11(ptr) Variable Input
+              15:             TypePointer Input 7(ivec2)
+16(gl_TileOffsetQCOM):     15(ptr) Variable Input
+19(gl_TileDimensionQCOM):     11(ptr) Variable Input
+              23:      6(int) Constant 1
+              24:    7(ivec2) ConstantComposite 23 23
+              27:             TypeInt 32 1
+              28:             TypeVector 27(int) 2
+              29:             TypePointer Function 28(ivec2)
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+      44(input0):     38(ptr) Variable TileAttachmentQCOM
+              48:             TypePointer Function 33(float)
+       50(depth):     38(ptr) Variable TileAttachmentQCOM
+              54:      6(int) Constant 0
+              56:             TypePointer Function 6(int)
+              58:      6(int) Constant 2
+              61:   33(float) Constant 1065353216
+              62:   34(fvec4) ConstantComposite 61 61 61 61
+              66:   33(float) Constant 1051260355
+              70:   33(float) Constant 1073741824
+              75:             TypeImage 27(int) 2D nonsampled format:Rgba32i
+              76:             TypePointer TileAttachmentQCOM 75
+      77(color1):     76(ptr) Variable TileAttachmentQCOM
+              81:             TypeVector 27(int) 4
+              83:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              84:             TypePointer TileAttachmentQCOM 83
+     85(stencil):     84(ptr) Variable TileAttachmentQCOM
+              89:             TypeVector 6(int) 4
+              91:      6(int) Constant 16
+              92:   10(ivec3) ConstantComposite 91 91 23
+         4(main):           2 Function None 3
+               5:             Label
+      9(uoffset):      8(ptr) Variable Function
+      30(offset):     29(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+      43(colorC):     35(ptr) Variable Function
+           49(d):     48(ptr) Variable Function
+           57(s):     56(ptr) Variable Function
+    59(outColor):     35(ptr) Variable Function
+    68(outDepth):     48(ptr) Variable Function
+  72(outStencil):     56(ptr) Variable Function
+              13:   10(ivec3) Load 12(gl_GlobalInvocationID)
+              14:    7(ivec2) VectorShuffle 13 13 0 1
+              17:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              18:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              20:   10(ivec3) Load 19(gl_TileDimensionQCOM)
+              21:    7(ivec2) VectorShuffle 20 20 0 1
+              22:    7(ivec2) IAdd 18 21
+              25:    7(ivec2) ISub 22 24
+              26:    7(ivec2) ExtInst 1(GLSL.std.450) 44(UClamp) 14 17 25
+                              Store 9(uoffset) 26
+              31:    7(ivec2) Load 9(uoffset)
+              32:   28(ivec2) Bitcast 31
+                              Store 30(offset) 32
+              40:          37 Load 39(color0)
+              41:   28(ivec2) Load 30(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              45:          37 Load 44(input0)
+              46:   28(ivec2) Load 30(offset)
+              47:   34(fvec4) ImageRead 45 46
+                              Store 43(colorC) 47
+              51:          37 Load 50(depth)
+              52:   28(ivec2) Load 30(offset)
+              53:   34(fvec4) ImageRead 51 52
+              55:   33(float) CompositeExtract 53 0
+                              Store 49(d) 55
+                              Store 57(s) 58
+              60:   34(fvec4) Load 36(colorA)
+              63:   34(fvec4) FAdd 60 62
+              64:   34(fvec4) Load 43(colorC)
+              65:   34(fvec4) FAdd 63 64
+              67:   34(fvec4) VectorTimesScalar 65 66
+                              Store 59(outColor) 67
+              69:   33(float) Load 49(d)
+              71:   33(float) FMul 69 70
+                              Store 68(outDepth) 71
+              73:      6(int) Load 57(s)
+              74:      6(int) IAdd 73 23
+                              Store 72(outStencil) 74
+              78:          75 Load 77(color1)
+              79:   28(ivec2) Load 30(offset)
+              80:   34(fvec4) Load 59(outColor)
+              82:   81(ivec4) ConvertFToS 80
+                              ImageWrite 78 79 82
+              86:          83 Load 85(stencil)
+              87:   28(ivec2) Load 30(offset)
+              88:      6(int) Load 72(outStencil)
+              90:   89(ivec4) CompositeConstruct 88 88 88 88
+                              ImageWrite 86 87 90
+                              Return
+                              FunctionEnd

+ 164 - 0
Test/baseResults/spv.qcom.es.tileShading.1.frag.out

@@ -0,0 +1,164 @@
+spv.qcom.es.tileShading.1.frag
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 100
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 22 26 93
+                              ExecutionMode 4 OriginUpperLeft
+                              ExecutionMode 4 NonCoherentTileAttachmentReadQCOM
+                              Source ESSL 310
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "o2"
+                              Name 20  "offset"
+                              Name 22  "gl_TileOffsetQCOM"
+                              Name 26  "gl_TileDimensionQCOM"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 43  "colorB"
+                              Name 45  "colorC"
+                              Name 46  "input0"
+                              Name 51  "d"
+                              Name 52  "depth"
+                              Name 59  "s"
+                              Name 64  "outColor"
+                              Name 80  "color1"
+                              Name 86  "stencil"
+                              Name 93  "fragColor"
+                              Decorate 22(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 22(gl_TileOffsetQCOM) Flat
+                              Decorate 26(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 26(gl_TileDimensionQCOM) Flat
+                              Decorate 39(color0) NonWritable
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 46(input0) NonWritable
+                              Decorate 46(input0) Binding 0
+                              Decorate 46(input0) DescriptorSet 0
+                              Decorate 52(depth) NonWritable
+                              Decorate 52(depth) Binding 3
+                              Decorate 52(depth) DescriptorSet 0
+                              Decorate 80(color1) NonReadable
+                              Decorate 80(color1) Binding 2
+                              Decorate 80(color1) DescriptorSet 0
+                              Decorate 86(stencil) NonReadable
+                              Decorate 86(stencil) Binding 4
+                              Decorate 86(stencil) DescriptorSet 0
+                              Decorate 93(fragColor) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:      6(int) Constant 8
+              11:      6(int) Constant 4
+              12:    7(ivec2) ConstantComposite 10 11
+              14:      6(int) Constant 2
+              15:    7(ivec2) ConstantComposite 14 14
+              17:             TypeInt 32 1
+              18:             TypeVector 17(int) 2
+              19:             TypePointer Function 18(ivec2)
+              21:             TypePointer Input 7(ivec2)
+22(gl_TileOffsetQCOM):     21(ptr) Variable Input
+              24:             TypeVector 6(int) 3
+              25:             TypePointer Input 24(ivec3)
+26(gl_TileDimensionQCOM):     25(ptr) Variable Input
+              28:   24(ivec3) ConstantComposite 14 14 14
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+      46(input0):     38(ptr) Variable TileAttachmentQCOM
+              50:             TypePointer Function 33(float)
+       52(depth):     38(ptr) Variable TileAttachmentQCOM
+              56:      6(int) Constant 0
+              58:             TypePointer Function 6(int)
+              62:             TypeVector 17(int) 4
+              63:             TypePointer Function 62(ivec4)
+              78:             TypeImage 17(int) 2D nonsampled format:Rgba32i
+              79:             TypePointer TileAttachmentQCOM 78
+      80(color1):     79(ptr) Variable TileAttachmentQCOM
+              84:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              85:             TypePointer TileAttachmentQCOM 84
+     86(stencil):     85(ptr) Variable TileAttachmentQCOM
+              90:             TypeVector 6(int) 4
+              92:             TypePointer Output 34(fvec4)
+   93(fragColor):     92(ptr) Variable Output
+              96:   33(float) Constant 1065353216
+              97:   33(float) Constant 0
+              98:   34(fvec4) ConstantComposite 96 97 97 96
+         4(main):           2 Function None 3
+               5:             Label
+           9(o2):      8(ptr) Variable Function
+      20(offset):     19(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+      43(colorB):     35(ptr) Variable Function
+      45(colorC):     35(ptr) Variable Function
+           51(d):     50(ptr) Variable Function
+           59(s):     58(ptr) Variable Function
+    64(outColor):     63(ptr) Variable Function
+                              Store 9(o2) 12
+              13:    7(ivec2) Load 9(o2)
+              16:    7(ivec2) UDiv 13 15
+                              Store 9(o2) 16
+              23:    7(ivec2) Load 22(gl_TileOffsetQCOM)
+              27:   24(ivec3) Load 26(gl_TileDimensionQCOM)
+              29:   24(ivec3) UDiv 27 28
+              30:    7(ivec2) VectorShuffle 29 29 0 1
+              31:    7(ivec2) IAdd 23 30
+              32:   18(ivec2) Bitcast 31
+                              Store 20(offset) 32
+              40:          37 Load 39(color0)
+              41:   18(ivec2) Load 20(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              44:   34(fvec4) Load 36(colorA)
+                              Store 43(colorB) 44
+              47:          37 Load 46(input0)
+              48:   18(ivec2) Load 20(offset)
+              49:   34(fvec4) ImageRead 47 48
+                              Store 45(colorC) 49
+              53:          37 Load 52(depth)
+              54:   18(ivec2) Load 20(offset)
+              55:   34(fvec4) ImageRead 53 54
+              57:   33(float) CompositeExtract 55 0
+                              Store 51(d) 57
+              60:   33(float) Load 51(d)
+              61:      6(int) ConvertFToU 60
+                              Store 59(s) 61
+              65:   34(fvec4) Load 43(colorB)
+              66:   34(fvec4) Load 43(colorB)
+              67:   34(fvec4) FAdd 65 66
+              68:   34(fvec4) Load 45(colorC)
+              69:   34(fvec4) FAdd 67 68
+              70:   33(float) Load 51(d)
+              71:   34(fvec4) CompositeConstruct 70 70 70 70
+              72:   34(fvec4) FAdd 69 71
+              73:      6(int) Load 59(s)
+              74:   33(float) ConvertUToF 73
+              75:   34(fvec4) CompositeConstruct 74 74 74 74
+              76:   34(fvec4) FAdd 72 75
+              77:   62(ivec4) ConvertFToS 76
+                              Store 64(outColor) 77
+              81:          78 Load 80(color1)
+              82:   18(ivec2) Load 20(offset)
+              83:   62(ivec4) Load 64(outColor)
+                              ImageWrite 81 82 83
+              87:          84 Load 86(stencil)
+              88:   18(ivec2) Load 20(offset)
+              89:   62(ivec4) Load 64(outColor)
+              91:   90(ivec4) Bitcast 89
+                              ImageWrite 87 88 91
+              94:   62(ivec4) Load 64(outColor)
+              95:   34(fvec4) ConvertSToF 94
+              99:   34(fvec4) FAdd 95 98
+                              Store 93(fragColor) 99
+                              Return
+                              FunctionEnd

+ 155 - 0
Test/baseResults/spv.qcom.es.tileShading.2.comp.out

@@ -0,0 +1,155 @@
+spv.qcom.es.tileShading.2.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 93
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main" 12 16 19
+                              ExecutionMode 4 TileShadingRateQCOM 2 2 3
+                              Source ESSL 310
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "uoffset"
+                              Name 12  "gl_GlobalInvocationID"
+                              Name 16  "gl_TileOffsetQCOM"
+                              Name 19  "gl_TileDimensionQCOM"
+                              Name 30  "offset"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 43  "colorC"
+                              Name 44  "input0"
+                              Name 49  "d"
+                              Name 50  "depth"
+                              Name 57  "s"
+                              Name 59  "outColor"
+                              Name 68  "outDepth"
+                              Name 72  "outStencil"
+                              Name 77  "color1"
+                              Name 85  "stencil"
+                              Decorate 12(gl_GlobalInvocationID) BuiltIn GlobalInvocationId
+                              Decorate 16(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 19(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 39(color0) NonWritable
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 44(input0) NonWritable
+                              Decorate 44(input0) Binding 0
+                              Decorate 44(input0) DescriptorSet 0
+                              Decorate 50(depth) NonWritable
+                              Decorate 50(depth) Binding 3
+                              Decorate 50(depth) DescriptorSet 0
+                              Decorate 77(color1) NonReadable
+                              Decorate 77(color1) Binding 2
+                              Decorate 77(color1) DescriptorSet 0
+                              Decorate 85(stencil) NonReadable
+                              Decorate 85(stencil) Binding 4
+                              Decorate 85(stencil) DescriptorSet 0
+                              Decorate 92 BuiltIn WorkgroupSize
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:             TypeVector 6(int) 3
+              11:             TypePointer Input 10(ivec3)
+12(gl_GlobalInvocationID):     11(ptr) Variable Input
+              15:             TypePointer Input 7(ivec2)
+16(gl_TileOffsetQCOM):     15(ptr) Variable Input
+19(gl_TileDimensionQCOM):     11(ptr) Variable Input
+              23:      6(int) Constant 1
+              24:    7(ivec2) ConstantComposite 23 23
+              27:             TypeInt 32 1
+              28:             TypeVector 27(int) 2
+              29:             TypePointer Function 28(ivec2)
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+      44(input0):     38(ptr) Variable TileAttachmentQCOM
+              48:             TypePointer Function 33(float)
+       50(depth):     38(ptr) Variable TileAttachmentQCOM
+              54:      6(int) Constant 0
+              56:             TypePointer Function 6(int)
+              58:      6(int) Constant 2
+              61:   33(float) Constant 1065353216
+              62:   34(fvec4) ConstantComposite 61 61 61 61
+              66:   33(float) Constant 1051260355
+              70:   33(float) Constant 1073741824
+              75:             TypeImage 27(int) 2D nonsampled format:Rgba32i
+              76:             TypePointer TileAttachmentQCOM 75
+      77(color1):     76(ptr) Variable TileAttachmentQCOM
+              81:             TypeVector 27(int) 4
+              83:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              84:             TypePointer TileAttachmentQCOM 83
+     85(stencil):     84(ptr) Variable TileAttachmentQCOM
+              89:             TypeVector 6(int) 4
+              91:      6(int) Constant 16
+              92:   10(ivec3) ConstantComposite 91 91 23
+         4(main):           2 Function None 3
+               5:             Label
+      9(uoffset):      8(ptr) Variable Function
+      30(offset):     29(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+      43(colorC):     35(ptr) Variable Function
+           49(d):     48(ptr) Variable Function
+           57(s):     56(ptr) Variable Function
+    59(outColor):     35(ptr) Variable Function
+    68(outDepth):     48(ptr) Variable Function
+  72(outStencil):     56(ptr) Variable Function
+              13:   10(ivec3) Load 12(gl_GlobalInvocationID)
+              14:    7(ivec2) VectorShuffle 13 13 0 1
+              17:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              18:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              20:   10(ivec3) Load 19(gl_TileDimensionQCOM)
+              21:    7(ivec2) VectorShuffle 20 20 0 1
+              22:    7(ivec2) IAdd 18 21
+              25:    7(ivec2) ISub 22 24
+              26:    7(ivec2) ExtInst 1(GLSL.std.450) 44(UClamp) 14 17 25
+                              Store 9(uoffset) 26
+              31:    7(ivec2) Load 9(uoffset)
+              32:   28(ivec2) Bitcast 31
+                              Store 30(offset) 32
+              40:          37 Load 39(color0)
+              41:   28(ivec2) Load 30(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              45:          37 Load 44(input0)
+              46:   28(ivec2) Load 30(offset)
+              47:   34(fvec4) ImageRead 45 46
+                              Store 43(colorC) 47
+              51:          37 Load 50(depth)
+              52:   28(ivec2) Load 30(offset)
+              53:   34(fvec4) ImageRead 51 52
+              55:   33(float) CompositeExtract 53 0
+                              Store 49(d) 55
+                              Store 57(s) 58
+              60:   34(fvec4) Load 36(colorA)
+              63:   34(fvec4) FAdd 60 62
+              64:   34(fvec4) Load 43(colorC)
+              65:   34(fvec4) FAdd 63 64
+              67:   34(fvec4) VectorTimesScalar 65 66
+                              Store 59(outColor) 67
+              69:   33(float) Load 49(d)
+              71:   33(float) FMul 69 70
+                              Store 68(outDepth) 71
+              73:      6(int) Load 57(s)
+              74:      6(int) IAdd 73 23
+                              Store 72(outStencil) 74
+              78:          75 Load 77(color1)
+              79:   28(ivec2) Load 30(offset)
+              80:   34(fvec4) Load 59(outColor)
+              82:   81(ivec4) ConvertFToS 80
+                              ImageWrite 78 79 82
+              86:          83 Load 85(stencil)
+              87:   28(ivec2) Load 30(offset)
+              88:      6(int) Load 72(outStencil)
+              90:   89(ivec4) CompositeConstruct 88 88 88 88
+                              ImageWrite 86 87 90
+                              Return
+                              FunctionEnd

+ 164 - 0
Test/baseResults/spv.qcom.tileShading.0.comp.out

@@ -0,0 +1,164 @@
+spv.qcom.tileShading.0.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 104
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main" 12 16 19
+                              ExecutionMode 4 LocalSize 16 16 1
+                              Source GLSL 460
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "uoffset"
+                              Name 12  "gl_GlobalInvocationID"
+                              Name 16  "gl_TileOffsetQCOM"
+                              Name 19  "gl_TileDimensionQCOM"
+                              Name 30  "offset"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 45  "icolorB"
+                              Name 48  "color1"
+                              Name 52  "colorC"
+                              Name 53  "input0"
+                              Name 58  "d"
+                              Name 59  "depth"
+                              Name 66  "s"
+                              Name 69  "stencil"
+                              Name 75  "outColor"
+                              Name 84  "outDepth"
+                              Name 88  "outStencil"
+                              Decorate 12(gl_GlobalInvocationID) BuiltIn GlobalInvocationId
+                              Decorate 16(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 19(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 48(color1) Binding 2
+                              Decorate 48(color1) DescriptorSet 0
+                              Decorate 53(input0) Binding 0
+                              Decorate 53(input0) DescriptorSet 0
+                              Decorate 59(depth) Binding 3
+                              Decorate 59(depth) DescriptorSet 0
+                              Decorate 69(stencil) Binding 4
+                              Decorate 69(stencil) DescriptorSet 0
+                              Decorate 103 BuiltIn WorkgroupSize
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:             TypeVector 6(int) 3
+              11:             TypePointer Input 10(ivec3)
+12(gl_GlobalInvocationID):     11(ptr) Variable Input
+              15:             TypePointer Input 7(ivec2)
+16(gl_TileOffsetQCOM):     15(ptr) Variable Input
+19(gl_TileDimensionQCOM):     11(ptr) Variable Input
+              23:      6(int) Constant 1
+              24:    7(ivec2) ConstantComposite 23 23
+              27:             TypeInt 32 1
+              28:             TypeVector 27(int) 2
+              29:             TypePointer Function 28(ivec2)
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+              43:             TypeVector 27(int) 4
+              44:             TypePointer Function 43(ivec4)
+              46:             TypeImage 27(int) 2D nonsampled format:Rgba32i
+              47:             TypePointer TileAttachmentQCOM 46
+      48(color1):     47(ptr) Variable TileAttachmentQCOM
+      53(input0):     38(ptr) Variable TileAttachmentQCOM
+              57:             TypePointer Function 33(float)
+       59(depth):     38(ptr) Variable TileAttachmentQCOM
+              63:      6(int) Constant 0
+              65:             TypePointer Function 6(int)
+              67:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              68:             TypePointer TileAttachmentQCOM 67
+     69(stencil):     68(ptr) Variable TileAttachmentQCOM
+              72:             TypeVector 6(int) 4
+              82:   33(float) Constant 1051260355
+              86:   33(float) Constant 1073741824
+             102:      6(int) Constant 16
+             103:   10(ivec3) ConstantComposite 102 102 23
+         4(main):           2 Function None 3
+               5:             Label
+      9(uoffset):      8(ptr) Variable Function
+      30(offset):     29(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+     45(icolorB):     44(ptr) Variable Function
+      52(colorC):     35(ptr) Variable Function
+           58(d):     57(ptr) Variable Function
+           66(s):     65(ptr) Variable Function
+    75(outColor):     35(ptr) Variable Function
+    84(outDepth):     57(ptr) Variable Function
+  88(outStencil):     65(ptr) Variable Function
+              13:   10(ivec3) Load 12(gl_GlobalInvocationID)
+              14:    7(ivec2) VectorShuffle 13 13 0 1
+              17:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              18:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              20:   10(ivec3) Load 19(gl_TileDimensionQCOM)
+              21:    7(ivec2) VectorShuffle 20 20 0 1
+              22:    7(ivec2) IAdd 18 21
+              25:    7(ivec2) ISub 22 24
+              26:    7(ivec2) ExtInst 1(GLSL.std.450) 44(UClamp) 14 17 25
+                              Store 9(uoffset) 26
+              31:    7(ivec2) Load 9(uoffset)
+              32:   28(ivec2) Bitcast 31
+                              Store 30(offset) 32
+              40:          37 Load 39(color0)
+              41:   28(ivec2) Load 30(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              49:          46 Load 48(color1)
+              50:   28(ivec2) Load 30(offset)
+              51:   43(ivec4) ImageRead 49 50
+                              Store 45(icolorB) 51
+              54:          37 Load 53(input0)
+              55:   28(ivec2) Load 30(offset)
+              56:   34(fvec4) ImageRead 54 55
+                              Store 52(colorC) 56
+              60:          37 Load 59(depth)
+              61:   28(ivec2) Load 30(offset)
+              62:   34(fvec4) ImageRead 60 61
+              64:   33(float) CompositeExtract 62 0
+                              Store 58(d) 64
+              70:          67 Load 69(stencil)
+              71:   28(ivec2) Load 30(offset)
+              73:   72(ivec4) ImageRead 70 71
+              74:      6(int) CompositeExtract 73 0
+                              Store 66(s) 74
+              76:   34(fvec4) Load 36(colorA)
+              77:   43(ivec4) Load 45(icolorB)
+              78:   34(fvec4) ConvertSToF 77
+              79:   34(fvec4) FAdd 76 78
+              80:   34(fvec4) Load 52(colorC)
+              81:   34(fvec4) FAdd 79 80
+              83:   34(fvec4) VectorTimesScalar 81 82
+                              Store 75(outColor) 83
+              85:   33(float) Load 58(d)
+              87:   33(float) FMul 85 86
+                              Store 84(outDepth) 87
+              89:      6(int) Load 66(s)
+              90:      6(int) IAdd 89 23
+                              Store 88(outStencil) 90
+              91:          37 Load 39(color0)
+              92:   28(ivec2) Load 30(offset)
+              93:   34(fvec4) Load 75(outColor)
+                              ImageWrite 91 92 93
+              94:          37 Load 59(depth)
+              95:   28(ivec2) Load 30(offset)
+              96:   33(float) Load 84(outDepth)
+              97:   34(fvec4) CompositeConstruct 96 96 96 96
+                              ImageWrite 94 95 97
+              98:          67 Load 69(stencil)
+              99:   28(ivec2) Load 30(offset)
+             100:      6(int) Load 88(outStencil)
+             101:   72(ivec4) CompositeConstruct 100 100 100 100
+                              ImageWrite 98 99 101
+                              Return
+                              FunctionEnd

+ 169 - 0
Test/baseResults/spv.qcom.tileShading.0.frag.out

@@ -0,0 +1,169 @@
+spv.qcom.tileShading.0.frag
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 108
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 22 26 102
+                              ExecutionMode 4 OriginUpperLeft
+                              Source GLSL 460
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "o2"
+                              Name 20  "offset"
+                              Name 22  "gl_TileOffsetQCOM"
+                              Name 26  "gl_TileDimensionQCOM"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 45  "icolorB"
+                              Name 48  "color1"
+                              Name 52  "colorB"
+                              Name 55  "colorC"
+                              Name 56  "input0"
+                              Name 61  "d"
+                              Name 62  "depth"
+                              Name 69  "s"
+                              Name 72  "stencil"
+                              Name 78  "outColor"
+                              Name 102  "fragColor"
+                              Decorate 22(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 22(gl_TileOffsetQCOM) Flat
+                              Decorate 26(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 26(gl_TileDimensionQCOM) Flat
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 48(color1) Binding 2
+                              Decorate 48(color1) DescriptorSet 0
+                              Decorate 56(input0) Binding 0
+                              Decorate 56(input0) DescriptorSet 0
+                              Decorate 62(depth) Binding 3
+                              Decorate 62(depth) DescriptorSet 0
+                              Decorate 72(stencil) Binding 4
+                              Decorate 72(stencil) DescriptorSet 0
+                              Decorate 102(fragColor) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:      6(int) Constant 8
+              11:      6(int) Constant 4
+              12:    7(ivec2) ConstantComposite 10 11
+              14:      6(int) Constant 2
+              15:    7(ivec2) ConstantComposite 14 14
+              17:             TypeInt 32 1
+              18:             TypeVector 17(int) 2
+              19:             TypePointer Function 18(ivec2)
+              21:             TypePointer Input 7(ivec2)
+22(gl_TileOffsetQCOM):     21(ptr) Variable Input
+              24:             TypeVector 6(int) 3
+              25:             TypePointer Input 24(ivec3)
+26(gl_TileDimensionQCOM):     25(ptr) Variable Input
+              28:   24(ivec3) ConstantComposite 14 14 14
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+              43:             TypeVector 17(int) 4
+              44:             TypePointer Function 43(ivec4)
+              46:             TypeImage 17(int) 2D nonsampled format:Rgba32i
+              47:             TypePointer TileAttachmentQCOM 46
+      48(color1):     47(ptr) Variable TileAttachmentQCOM
+      56(input0):     38(ptr) Variable TileAttachmentQCOM
+              60:             TypePointer Function 33(float)
+       62(depth):     38(ptr) Variable TileAttachmentQCOM
+              66:      6(int) Constant 0
+              68:             TypePointer Function 6(int)
+              70:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              71:             TypePointer TileAttachmentQCOM 70
+     72(stencil):     71(ptr) Variable TileAttachmentQCOM
+              75:             TypeVector 6(int) 4
+             101:             TypePointer Output 34(fvec4)
+  102(fragColor):    101(ptr) Variable Output
+             104:   33(float) Constant 1065353216
+             105:   33(float) Constant 0
+             106:   34(fvec4) ConstantComposite 104 105 105 104
+         4(main):           2 Function None 3
+               5:             Label
+           9(o2):      8(ptr) Variable Function
+      20(offset):     19(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+     45(icolorB):     44(ptr) Variable Function
+      52(colorB):     35(ptr) Variable Function
+      55(colorC):     35(ptr) Variable Function
+           61(d):     60(ptr) Variable Function
+           69(s):     68(ptr) Variable Function
+    78(outColor):     35(ptr) Variable Function
+                              Store 9(o2) 12
+              13:    7(ivec2) Load 9(o2)
+              16:    7(ivec2) UDiv 13 15
+                              Store 9(o2) 16
+              23:    7(ivec2) Load 22(gl_TileOffsetQCOM)
+              27:   24(ivec3) Load 26(gl_TileDimensionQCOM)
+              29:   24(ivec3) UDiv 27 28
+              30:    7(ivec2) VectorShuffle 29 29 0 1
+              31:    7(ivec2) IAdd 23 30
+              32:   18(ivec2) Bitcast 31
+                              Store 20(offset) 32
+              40:          37 Load 39(color0)
+              41:   18(ivec2) Load 20(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              49:          46 Load 48(color1)
+              50:   18(ivec2) Load 20(offset)
+              51:   43(ivec4) ImageRead 49 50
+                              Store 45(icolorB) 51
+              53:   43(ivec4) Load 45(icolorB)
+              54:   34(fvec4) ConvertSToF 53
+                              Store 52(colorB) 54
+              57:          37 Load 56(input0)
+              58:   18(ivec2) Load 20(offset)
+              59:   34(fvec4) ImageRead 57 58
+                              Store 55(colorC) 59
+              63:          37 Load 62(depth)
+              64:   18(ivec2) Load 20(offset)
+              65:   34(fvec4) ImageRead 63 64
+              67:   33(float) CompositeExtract 65 0
+                              Store 61(d) 67
+              73:          70 Load 72(stencil)
+              74:   18(ivec2) Load 20(offset)
+              76:   75(ivec4) ImageRead 73 74
+              77:      6(int) CompositeExtract 76 0
+                              Store 69(s) 77
+              79:   34(fvec4) Load 52(colorB)
+              80:   34(fvec4) Load 52(colorB)
+              81:   34(fvec4) FAdd 79 80
+              82:   34(fvec4) Load 55(colorC)
+              83:   34(fvec4) FAdd 81 82
+              84:   33(float) Load 61(d)
+              85:   34(fvec4) CompositeConstruct 84 84 84 84
+              86:   34(fvec4) FAdd 83 85
+              87:      6(int) Load 69(s)
+              88:   33(float) ConvertUToF 87
+              89:   34(fvec4) CompositeConstruct 88 88 88 88
+              90:   34(fvec4) FAdd 86 89
+                              Store 78(outColor) 90
+              91:          37 Load 39(color0)
+              92:   18(ivec2) Load 20(offset)
+              93:   34(fvec4) Load 78(outColor)
+                              ImageWrite 91 92 93
+              94:          37 Load 62(depth)
+              95:   18(ivec2) Load 20(offset)
+              96:   34(fvec4) Load 78(outColor)
+                              ImageWrite 94 95 96
+              97:          70 Load 72(stencil)
+              98:   18(ivec2) Load 20(offset)
+              99:   34(fvec4) Load 78(outColor)
+             100:   75(ivec4) ConvertFToU 99
+                              ImageWrite 97 98 100
+             103:   34(fvec4) Load 78(outColor)
+             107:   34(fvec4) FAdd 103 106
+                              Store 102(fragColor) 107
+                              Return
+                              FunctionEnd

+ 164 - 0
Test/baseResults/spv.qcom.tileShading.1.comp.out

@@ -0,0 +1,164 @@
+spv.qcom.tileShading.1.comp
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 104
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main" 12 16 19
+                              ExecutionMode 4 TileShadingRateQCOM 2 2 3
+                              Source GLSL 460
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "uoffset"
+                              Name 12  "gl_GlobalInvocationID"
+                              Name 16  "gl_TileOffsetQCOM"
+                              Name 19  "gl_TileDimensionQCOM"
+                              Name 30  "offset"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 45  "icolorB"
+                              Name 48  "color1"
+                              Name 52  "colorC"
+                              Name 53  "input0"
+                              Name 58  "d"
+                              Name 59  "depth"
+                              Name 66  "s"
+                              Name 69  "stencil"
+                              Name 75  "outColor"
+                              Name 84  "outDepth"
+                              Name 88  "outStencil"
+                              Decorate 12(gl_GlobalInvocationID) BuiltIn GlobalInvocationId
+                              Decorate 16(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 19(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 48(color1) Binding 2
+                              Decorate 48(color1) DescriptorSet 0
+                              Decorate 53(input0) Binding 0
+                              Decorate 53(input0) DescriptorSet 0
+                              Decorate 59(depth) Binding 3
+                              Decorate 59(depth) DescriptorSet 0
+                              Decorate 69(stencil) Binding 4
+                              Decorate 69(stencil) DescriptorSet 0
+                              Decorate 103 BuiltIn WorkgroupSize
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:             TypeVector 6(int) 3
+              11:             TypePointer Input 10(ivec3)
+12(gl_GlobalInvocationID):     11(ptr) Variable Input
+              15:             TypePointer Input 7(ivec2)
+16(gl_TileOffsetQCOM):     15(ptr) Variable Input
+19(gl_TileDimensionQCOM):     11(ptr) Variable Input
+              23:      6(int) Constant 1
+              24:    7(ivec2) ConstantComposite 23 23
+              27:             TypeInt 32 1
+              28:             TypeVector 27(int) 2
+              29:             TypePointer Function 28(ivec2)
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+              43:             TypeVector 27(int) 4
+              44:             TypePointer Function 43(ivec4)
+              46:             TypeImage 27(int) 2D nonsampled format:Rgba32i
+              47:             TypePointer TileAttachmentQCOM 46
+      48(color1):     47(ptr) Variable TileAttachmentQCOM
+      53(input0):     38(ptr) Variable TileAttachmentQCOM
+              57:             TypePointer Function 33(float)
+       59(depth):     38(ptr) Variable TileAttachmentQCOM
+              63:      6(int) Constant 0
+              65:             TypePointer Function 6(int)
+              67:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              68:             TypePointer TileAttachmentQCOM 67
+     69(stencil):     68(ptr) Variable TileAttachmentQCOM
+              72:             TypeVector 6(int) 4
+              82:   33(float) Constant 1051260355
+              86:   33(float) Constant 1073741824
+             102:      6(int) Constant 16
+             103:   10(ivec3) ConstantComposite 102 102 23
+         4(main):           2 Function None 3
+               5:             Label
+      9(uoffset):      8(ptr) Variable Function
+      30(offset):     29(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+     45(icolorB):     44(ptr) Variable Function
+      52(colorC):     35(ptr) Variable Function
+           58(d):     57(ptr) Variable Function
+           66(s):     65(ptr) Variable Function
+    75(outColor):     35(ptr) Variable Function
+    84(outDepth):     57(ptr) Variable Function
+  88(outStencil):     65(ptr) Variable Function
+              13:   10(ivec3) Load 12(gl_GlobalInvocationID)
+              14:    7(ivec2) VectorShuffle 13 13 0 1
+              17:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              18:    7(ivec2) Load 16(gl_TileOffsetQCOM)
+              20:   10(ivec3) Load 19(gl_TileDimensionQCOM)
+              21:    7(ivec2) VectorShuffle 20 20 0 1
+              22:    7(ivec2) IAdd 18 21
+              25:    7(ivec2) ISub 22 24
+              26:    7(ivec2) ExtInst 1(GLSL.std.450) 44(UClamp) 14 17 25
+                              Store 9(uoffset) 26
+              31:    7(ivec2) Load 9(uoffset)
+              32:   28(ivec2) Bitcast 31
+                              Store 30(offset) 32
+              40:          37 Load 39(color0)
+              41:   28(ivec2) Load 30(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              49:          46 Load 48(color1)
+              50:   28(ivec2) Load 30(offset)
+              51:   43(ivec4) ImageRead 49 50
+                              Store 45(icolorB) 51
+              54:          37 Load 53(input0)
+              55:   28(ivec2) Load 30(offset)
+              56:   34(fvec4) ImageRead 54 55
+                              Store 52(colorC) 56
+              60:          37 Load 59(depth)
+              61:   28(ivec2) Load 30(offset)
+              62:   34(fvec4) ImageRead 60 61
+              64:   33(float) CompositeExtract 62 0
+                              Store 58(d) 64
+              70:          67 Load 69(stencil)
+              71:   28(ivec2) Load 30(offset)
+              73:   72(ivec4) ImageRead 70 71
+              74:      6(int) CompositeExtract 73 0
+                              Store 66(s) 74
+              76:   34(fvec4) Load 36(colorA)
+              77:   43(ivec4) Load 45(icolorB)
+              78:   34(fvec4) ConvertSToF 77
+              79:   34(fvec4) FAdd 76 78
+              80:   34(fvec4) Load 52(colorC)
+              81:   34(fvec4) FAdd 79 80
+              83:   34(fvec4) VectorTimesScalar 81 82
+                              Store 75(outColor) 83
+              85:   33(float) Load 58(d)
+              87:   33(float) FMul 85 86
+                              Store 84(outDepth) 87
+              89:      6(int) Load 66(s)
+              90:      6(int) IAdd 89 23
+                              Store 88(outStencil) 90
+              91:          37 Load 39(color0)
+              92:   28(ivec2) Load 30(offset)
+              93:   34(fvec4) Load 75(outColor)
+                              ImageWrite 91 92 93
+              94:          37 Load 59(depth)
+              95:   28(ivec2) Load 30(offset)
+              96:   33(float) Load 84(outDepth)
+              97:   34(fvec4) CompositeConstruct 96 96 96 96
+                              ImageWrite 94 95 97
+              98:          67 Load 69(stencil)
+              99:   28(ivec2) Load 30(offset)
+             100:      6(int) Load 88(outStencil)
+             101:   72(ivec4) CompositeConstruct 100 100 100 100
+                              ImageWrite 98 99 101
+                              Return
+                              FunctionEnd

+ 170 - 0
Test/baseResults/spv.qcom.tileShading.1.frag.out

@@ -0,0 +1,170 @@
+spv.qcom.tileShading.1.frag
+// Module Version 10000
+// Generated by (magic number): 8000b
+// Id's are bound by 108
+
+                              Capability Shader
+                              Capability TileShadingQCOM
+                              Extension  "SPV_QCOM_tile_shading"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 22 26 102
+                              ExecutionMode 4 OriginUpperLeft
+                              ExecutionMode 4 NonCoherentTileAttachmentReadQCOM
+                              Source GLSL 460
+                              SourceExtension  "GL_QCOM_tile_shading"
+                              Name 4  "main"
+                              Name 9  "o2"
+                              Name 20  "offset"
+                              Name 22  "gl_TileOffsetQCOM"
+                              Name 26  "gl_TileDimensionQCOM"
+                              Name 36  "colorA"
+                              Name 39  "color0"
+                              Name 45  "icolorB"
+                              Name 48  "color1"
+                              Name 52  "colorB"
+                              Name 55  "colorC"
+                              Name 56  "input0"
+                              Name 61  "d"
+                              Name 62  "depth"
+                              Name 69  "s"
+                              Name 72  "stencil"
+                              Name 78  "outColor"
+                              Name 102  "fragColor"
+                              Decorate 22(gl_TileOffsetQCOM) BuiltIn TileOffsetQCOM
+                              Decorate 22(gl_TileOffsetQCOM) Flat
+                              Decorate 26(gl_TileDimensionQCOM) BuiltIn TileDimensionQCOM
+                              Decorate 26(gl_TileDimensionQCOM) Flat
+                              Decorate 39(color0) Binding 1
+                              Decorate 39(color0) DescriptorSet 0
+                              Decorate 48(color1) Binding 2
+                              Decorate 48(color1) DescriptorSet 0
+                              Decorate 56(input0) Binding 0
+                              Decorate 56(input0) DescriptorSet 0
+                              Decorate 62(depth) Binding 3
+                              Decorate 62(depth) DescriptorSet 0
+                              Decorate 72(stencil) Binding 4
+                              Decorate 72(stencil) DescriptorSet 0
+                              Decorate 102(fragColor) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 2
+               8:             TypePointer Function 7(ivec2)
+              10:      6(int) Constant 8
+              11:      6(int) Constant 4
+              12:    7(ivec2) ConstantComposite 10 11
+              14:      6(int) Constant 2
+              15:    7(ivec2) ConstantComposite 14 14
+              17:             TypeInt 32 1
+              18:             TypeVector 17(int) 2
+              19:             TypePointer Function 18(ivec2)
+              21:             TypePointer Input 7(ivec2)
+22(gl_TileOffsetQCOM):     21(ptr) Variable Input
+              24:             TypeVector 6(int) 3
+              25:             TypePointer Input 24(ivec3)
+26(gl_TileDimensionQCOM):     25(ptr) Variable Input
+              28:   24(ivec3) ConstantComposite 14 14 14
+              33:             TypeFloat 32
+              34:             TypeVector 33(float) 4
+              35:             TypePointer Function 34(fvec4)
+              37:             TypeImage 33(float) 2D nonsampled format:Rgba32f
+              38:             TypePointer TileAttachmentQCOM 37
+      39(color0):     38(ptr) Variable TileAttachmentQCOM
+              43:             TypeVector 17(int) 4
+              44:             TypePointer Function 43(ivec4)
+              46:             TypeImage 17(int) 2D nonsampled format:Rgba32i
+              47:             TypePointer TileAttachmentQCOM 46
+      48(color1):     47(ptr) Variable TileAttachmentQCOM
+      56(input0):     38(ptr) Variable TileAttachmentQCOM
+              60:             TypePointer Function 33(float)
+       62(depth):     38(ptr) Variable TileAttachmentQCOM
+              66:      6(int) Constant 0
+              68:             TypePointer Function 6(int)
+              70:             TypeImage 6(int) 2D nonsampled format:Rgba32ui
+              71:             TypePointer TileAttachmentQCOM 70
+     72(stencil):     71(ptr) Variable TileAttachmentQCOM
+              75:             TypeVector 6(int) 4
+             101:             TypePointer Output 34(fvec4)
+  102(fragColor):    101(ptr) Variable Output
+             104:   33(float) Constant 1065353216
+             105:   33(float) Constant 0
+             106:   34(fvec4) ConstantComposite 104 105 105 104
+         4(main):           2 Function None 3
+               5:             Label
+           9(o2):      8(ptr) Variable Function
+      20(offset):     19(ptr) Variable Function
+      36(colorA):     35(ptr) Variable Function
+     45(icolorB):     44(ptr) Variable Function
+      52(colorB):     35(ptr) Variable Function
+      55(colorC):     35(ptr) Variable Function
+           61(d):     60(ptr) Variable Function
+           69(s):     68(ptr) Variable Function
+    78(outColor):     35(ptr) Variable Function
+                              Store 9(o2) 12
+              13:    7(ivec2) Load 9(o2)
+              16:    7(ivec2) UDiv 13 15
+                              Store 9(o2) 16
+              23:    7(ivec2) Load 22(gl_TileOffsetQCOM)
+              27:   24(ivec3) Load 26(gl_TileDimensionQCOM)
+              29:   24(ivec3) UDiv 27 28
+              30:    7(ivec2) VectorShuffle 29 29 0 1
+              31:    7(ivec2) IAdd 23 30
+              32:   18(ivec2) Bitcast 31
+                              Store 20(offset) 32
+              40:          37 Load 39(color0)
+              41:   18(ivec2) Load 20(offset)
+              42:   34(fvec4) ImageRead 40 41
+                              Store 36(colorA) 42
+              49:          46 Load 48(color1)
+              50:   18(ivec2) Load 20(offset)
+              51:   43(ivec4) ImageRead 49 50
+                              Store 45(icolorB) 51
+              53:   43(ivec4) Load 45(icolorB)
+              54:   34(fvec4) ConvertSToF 53
+                              Store 52(colorB) 54
+              57:          37 Load 56(input0)
+              58:   18(ivec2) Load 20(offset)
+              59:   34(fvec4) ImageRead 57 58
+                              Store 55(colorC) 59
+              63:          37 Load 62(depth)
+              64:   18(ivec2) Load 20(offset)
+              65:   34(fvec4) ImageRead 63 64
+              67:   33(float) CompositeExtract 65 0
+                              Store 61(d) 67
+              73:          70 Load 72(stencil)
+              74:   18(ivec2) Load 20(offset)
+              76:   75(ivec4) ImageRead 73 74
+              77:      6(int) CompositeExtract 76 0
+                              Store 69(s) 77
+              79:   34(fvec4) Load 52(colorB)
+              80:   34(fvec4) Load 52(colorB)
+              81:   34(fvec4) FAdd 79 80
+              82:   34(fvec4) Load 55(colorC)
+              83:   34(fvec4) FAdd 81 82
+              84:   33(float) Load 61(d)
+              85:   34(fvec4) CompositeConstruct 84 84 84 84
+              86:   34(fvec4) FAdd 83 85
+              87:      6(int) Load 69(s)
+              88:   33(float) ConvertUToF 87
+              89:   34(fvec4) CompositeConstruct 88 88 88 88
+              90:   34(fvec4) FAdd 86 89
+                              Store 78(outColor) 90
+              91:          37 Load 39(color0)
+              92:   18(ivec2) Load 20(offset)
+              93:   34(fvec4) Load 78(outColor)
+                              ImageWrite 91 92 93
+              94:          37 Load 62(depth)
+              95:   18(ivec2) Load 20(offset)
+              96:   34(fvec4) Load 78(outColor)
+                              ImageWrite 94 95 96
+              97:          70 Load 72(stencil)
+              98:   18(ivec2) Load 20(offset)
+              99:   34(fvec4) Load 78(outColor)
+             100:   75(ivec4) ConvertFToU 99
+                              ImageWrite 97 98 100
+             103:   34(fvec4) Load 78(outColor)
+             107:   34(fvec4) FAdd 103 106
+                              Store 102(fragColor) 107
+                              Return
+                              FunctionEnd

+ 34 - 0
Test/spv.qcom.es.tileShading.0.comp

@@ -0,0 +1,34 @@
+#version 310 es
+#extension GL_QCOM_tile_shading : enable 
+
+layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D input0;
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  color0; // attachment0
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform writeonly highp iimage2D color1; // attachment1
+
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform writeonly highp uimage2D stencil;
+
+void main ()
+{
+  uvec2 uoffset = clamp(gl_GlobalInvocationID.xy, gl_TileOffsetQCOM, gl_TileOffsetQCOM + gl_TileDimensionQCOM.xy - uvec2(1.1));
+  ivec2 offset = ivec2(uoffset);
+
+  // read from attachments 
+  vec4  colorA   = imageLoad( color0, offset );
+  vec4  colorC   = imageLoad( input0, offset );
+  float d        = imageLoad( depth, offset ).x;
+  uint  s        = uint(2);
+  
+  // compute output values
+  vec4 outColor   = ( colorA + vec4(1.0f) + colorC ) * 0.33f;
+  float outDepth  = d * 2.0f;
+  uint outStencil = s + uint(1);
+  
+  // write to attachments
+  imageStore( color1,  offset, ivec4(outColor) );
+  imageStore( stencil, offset, uvec4(outStencil) );
+}

+ 41 - 0
Test/spv.qcom.es.tileShading.0.frag

@@ -0,0 +1,41 @@
+#version 310 es
+#extension GL_QCOM_tile_shading : enable 
+
+precision highp int;
+precision highp float;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D input0;
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  color0;
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform writeonly highp iimage2D color1;
+
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform writeonly highp uimage2D stencil;
+
+layout (location=0) out vec4 fragColor; 
+
+void main() 
+{ 
+	// integer coordinates of the center of tile.
+    uvec2 o2     = uvec2(8, 4);
+          o2     = o2 / uvec2(2);
+    ivec2 offset = ivec2(gl_TileOffsetQCOM + (gl_TileDimensionQCOM/uvec3(2)).xy);
+
+  // read from attachments 
+  vec4  colorA   = imageLoad( color0, offset );
+  vec4  colorB   = vec4(colorA);
+  vec4  colorC   = imageLoad( input0, offset );
+  float d        = imageLoad( depth, offset ).x;
+  uint  s        = uint(d);
+	  
+    // compute output value
+    ivec4 outColor  = ivec4( colorB + colorB + colorC + vec4(d) + vec4(s) );
+  
+    // write to attachments
+    imageStore( color1,  offset, outColor );
+    imageStore( stencil, offset, uvec4(outColor) );
+  
+    // write to color attachment 0 via fragment output 
+    fragColor = vec4(outColor) + vec4(1.0, 0.0, 0.0, 1.0); 
+}

+ 34 - 0
Test/spv.qcom.es.tileShading.1.comp

@@ -0,0 +1,34 @@
+#version 310 es
+#extension GL_QCOM_tile_shading : enable 
+
+layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
+layout (shading_rate_xQCOM = 2, shading_rate_yQCOM = 2, shading_rate_zQCOM = 1) in;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D input0;
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  color0; // attachment0
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform writeonly highp iimage2D color1; // attachment1
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform writeonly highp uimage2D stencil;
+
+void main ()
+{
+    uvec2 uoffset = clamp(gl_GlobalInvocationID.xy, gl_TileOffsetQCOM, gl_TileOffsetQCOM + gl_TileDimensionQCOM.xy - uvec2(1.1));
+    ivec2 offset = ivec2(uoffset);
+
+    // read from attachments 
+    vec4  colorA   = imageLoad( color0, offset );
+    vec4  colorC   = imageLoad( input0, offset );
+    float d        = imageLoad( depth, offset ).x;
+    uint  s        = uint(2);
+  
+    // compute output values
+    vec4 outColor   = ( colorA + vec4(1.0f) + colorC ) * 0.33f;
+    float outDepth  = d * 2.0f;
+    uint outStencil = s + uint(1);
+  
+    // write to attachments
+    imageStore( color1,  offset, ivec4(outColor) );
+    imageStore( stencil, offset, uvec4(outStencil) );
+}

+ 43 - 0
Test/spv.qcom.es.tileShading.1.frag

@@ -0,0 +1,43 @@
+#version 310 es
+#extension GL_QCOM_tile_shading : enable 
+
+precision highp int;
+precision highp float;
+
+layout (non_coherent_attachment_readQCOM) in;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D input0;
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  color0;
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform writeonly highp iimage2D color1;
+
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform writeonly highp uimage2D stencil;
+
+layout (location=0) out vec4 fragColor; 
+
+void main() 
+{ 
+	// integer coordinates of the center of tile.
+    uvec2 o2     = uvec2(8, 4);
+          o2     = o2 / uvec2(2);
+    ivec2 offset = ivec2(gl_TileOffsetQCOM + (gl_TileDimensionQCOM/uvec3(2)).xy);
+
+  // read from attachments 
+  vec4  colorA   = imageLoad( color0, offset );
+  vec4  colorB   = vec4(colorA);
+  vec4  colorC   = imageLoad( input0, offset );
+  float d        = imageLoad( depth, offset ).x;
+  uint  s        = uint(d);
+	  
+    // compute output value
+    ivec4 outColor  = ivec4( colorB + colorB + colorC + vec4(d) + vec4(s) );
+  
+    // write to attachments
+    imageStore( color1,  offset, outColor );
+    imageStore( stencil, offset, uvec4(outColor) );
+  
+    // write to color attachment 0 via fragment output 
+    fragColor = vec4(outColor) + vec4(1.0, 0.0, 0.0, 1.0); 
+}

+ 34 - 0
Test/spv.qcom.es.tileShading.2.comp

@@ -0,0 +1,34 @@
+#version 310 es
+#extension GL_QCOM_tile_shading : enable 
+
+layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
+layout (shading_rate_xQCOM = 2, shading_rate_yQCOM = 2, shading_rate_zQCOM = 3) in;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D input0;
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  color0; // attachment0
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform writeonly highp iimage2D color1; // attachment1
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform readonly highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform writeonly highp uimage2D stencil;
+
+void main ()
+{
+    uvec2 uoffset = clamp(gl_GlobalInvocationID.xy, gl_TileOffsetQCOM, gl_TileOffsetQCOM + gl_TileDimensionQCOM.xy - uvec2(1.1));
+    ivec2 offset = ivec2(uoffset);
+
+    // read from attachments 
+    vec4  colorA   = imageLoad( color0, offset );
+    vec4  colorC   = imageLoad( input0, offset );
+    float d        = imageLoad( depth, offset ).x;
+    uint  s        = uint(2);
+  
+    // compute output values
+    vec4 outColor   = ( colorA + vec4(1.0f) + colorC ) * 0.33f;
+    float outDepth  = d * 2.0f;
+    uint outStencil = s + uint(1);
+  
+    // write to attachments
+    imageStore( color1,  offset, ivec4(outColor) );
+    imageStore( stencil, offset, uvec4(outStencil) );
+}

+ 38 - 0
Test/spv.qcom.tileShading.0.comp

@@ -0,0 +1,38 @@
+#version 460
+#extension GL_QCOM_tile_shading : enable 
+
+layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform highp image2D input0;
+
+// tile color attachments (new syntax)
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform highp image2D  color0; // attachment0
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform highp iimage2D color1; // attachment1
+
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform highp uimage2D stencil;
+
+void main ()
+{
+  uvec2 uoffset = clamp(gl_GlobalInvocationID.xy, gl_TileOffsetQCOM, gl_TileOffsetQCOM + gl_TileDimensionQCOM.xy - uvec2(1.1));
+  ivec2 offset = ivec2(uoffset);
+
+  // read from attachments 
+  vec4  colorA   = imageLoad( color0, offset );
+  ivec4 icolorB  = imageLoad( color1, offset );
+  vec4  colorC   = imageLoad( input0, offset );
+  float d        = imageLoad( depth, offset ).x;
+  uint  s        = imageLoad( stencil, offset ).x;
+  
+  // compute output values
+  vec4 outColor   = ( colorA + vec4(icolorB) + colorC ) * 0.33f;
+  float outDepth  = d * 2.0f;
+  uint outStencil = s + uint(1);
+  
+  // write to attachments
+  imageStore( color0,  offset, outColor );
+  imageStore( depth,   offset, vec4(outDepth) );
+  imageStore( stencil, offset, uvec4(outStencil) );
+}

+ 42 - 0
Test/spv.qcom.tileShading.0.frag

@@ -0,0 +1,42 @@
+#version 460
+#extension GL_QCOM_tile_shading : enable 
+
+precision highp int;
+precision highp float;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform highp image2D input0;
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform highp image2D  color0;
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform highp iimage2D color1;
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform highp uimage2D stencil;
+
+layout (location=0) out vec4 fragColor; 
+
+void main() 
+{ 
+    // integer coordinates of the center of tile.
+    uvec2 o2     = uvec2(8, 4);
+          o2     = o2 / uvec2(2);
+    ivec2 offset = ivec2(gl_TileOffsetQCOM + (gl_TileDimensionQCOM/uvec3(2)).xy);
+
+    // read from attachments 
+    vec4  colorA   = imageLoad( color0, offset );
+    ivec4 icolorB  = imageLoad( color1, offset );
+    vec4  colorB   = vec4(icolorB);
+    vec4  colorC   = imageLoad( input0, offset );
+    float d        = imageLoad( depth, offset ).x;
+    uint  s        = imageLoad( stencil, offset ).x;
+ 
+    // compute output value
+    vec4 outColor  = ( colorB + colorB + colorC + d + s );
+  
+    // write to attachments
+    imageStore( color0,  offset, outColor );
+    imageStore( depth,   offset, vec4(outColor) );
+    imageStore( stencil, offset, uvec4(outColor) );
+  
+    // write to color attachment 0 via fragment output 
+    fragColor = outColor + vec4(1.0, 0.0, 0.0, 1.0); 
+}

+ 39 - 0
Test/spv.qcom.tileShading.1.comp

@@ -0,0 +1,39 @@
+#version 460
+#extension GL_QCOM_tile_shading : enable 
+
+layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
+layout (shading_rate_xQCOM = 2, shading_rate_yQCOM = 2, shading_rate_zQCOM = 3) in;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform highp image2D input0;
+
+// tile color attachments (new syntax)
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform highp image2D  color0; // attachment0
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform highp iimage2D color1; // attachment1
+
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform highp uimage2D stencil;
+
+void main ()
+{
+  uvec2 uoffset = clamp(gl_GlobalInvocationID.xy, gl_TileOffsetQCOM, gl_TileOffsetQCOM + gl_TileDimensionQCOM.xy - uvec2(1.1));
+  ivec2 offset = ivec2(uoffset);
+
+  // read from attachments 
+  vec4  colorA   = imageLoad( color0, offset );
+  ivec4 icolorB  = imageLoad( color1, offset );
+  vec4  colorC   = imageLoad( input0, offset );
+  float d        = imageLoad( depth, offset ).x;
+  uint  s        = imageLoad( stencil, offset ).x;
+  
+  // compute output values
+  vec4 outColor   = ( colorA + vec4(icolorB) + colorC ) * 0.33f;
+  float outDepth  = d * 2.0f;
+  uint outStencil = s + uint(1);
+  
+  // write to attachments
+  imageStore( color0,  offset, outColor );
+  imageStore( depth,   offset, vec4(outDepth) );
+  imageStore( stencil, offset, uvec4(outStencil) );
+}

+ 44 - 0
Test/spv.qcom.tileShading.1.frag

@@ -0,0 +1,44 @@
+#version 460
+#extension GL_QCOM_tile_shading : enable 
+
+precision highp int;
+precision highp float;
+
+layout (non_coherent_attachment_readQCOM) in;
+
+layout (set=0, binding=0, tile_attachmentQCOM, rgba32f) uniform highp image2D input0;
+layout (set=0, binding=1, tile_attachmentQCOM, rgba32f) uniform highp image2D  color0;
+layout (set=0, binding=2, tile_attachmentQCOM, rgba32i) uniform highp iimage2D color1;
+
+// depth/stencil attachments
+layout (set=0, binding=3, tile_attachmentQCOM, rgba32f) uniform highp image2D  depth;
+layout (set=0, binding=4, tile_attachmentQCOM, rgba32ui) uniform highp uimage2D stencil;
+
+layout (location=0) out vec4 fragColor; 
+
+void main() 
+{ 
+    // integer coordinates of the center of tile.
+    uvec2 o2     = uvec2(8, 4);
+          o2     = o2 / uvec2(2);
+    ivec2 offset = ivec2(gl_TileOffsetQCOM + (gl_TileDimensionQCOM/uvec3(2)).xy);
+
+    // read from attachments 
+    vec4  colorA   = imageLoad( color0, offset );
+    ivec4 icolorB  = imageLoad( color1, offset );
+    vec4  colorB   = vec4(icolorB);
+    vec4  colorC   = imageLoad( input0, offset );
+    float d        = imageLoad( depth, offset ).x;
+    uint  s        = imageLoad( stencil, offset ).x;
+ 
+    // compute output value
+    vec4 outColor  = ( colorB + colorB + colorC + d + s );
+  
+    // write to attachments
+    imageStore( color0,  offset, outColor );
+    imageStore( depth,   offset, vec4(outColor) );
+    imageStore( stencil, offset, uvec4(outColor) );
+  
+    // write to color attachment 0 via fragment output 
+    fragColor = outColor + vec4(1.0, 0.0, 0.0, 1.0); 
+}

+ 5 - 0
glslang/Include/BaseTypes.h

@@ -344,6 +344,11 @@ enum TBuiltInVariable {
 
     EbvPositionFetch,
 
+    // SPV_QCOM_tile_shading
+    EbvTileOffsetQCOM,
+    EbvTileDimensionQCOM,
+    EbvTileApronSizeQCOM,
+
     EbvLast
 };
 

+ 53 - 11
glslang/Include/Types.h

@@ -85,6 +85,7 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
     bool      image : 1;  // image, combined should be false
     bool   combined : 1;  // true means texture is combined with a sampler, false means texture with no sampler
     bool    sampler : 1;  // true means a pure sampler, other fields should be clear()
+    bool   tileQCOM : 1;  // is tile shading attachment 
 
     unsigned int vectorSize : 3;  // vector return type size.
     // Some languages support structures as sample results.  Storing the whole structure in the
@@ -127,6 +128,8 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
     bool isShadow()      const { return shadow; }
     bool isArrayed()     const { return arrayed; }
 
+    bool isTileAttachmentQCOM() const { return tileQCOM; }
+
     void clear()
     {
         type = EbtVoid;
@@ -139,6 +142,7 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
         sampler = false;
         external = false;
         yuv = false;
+        tileQCOM = false;
 
 #ifdef ENABLE_HLSL
         clearReturnStruct();
@@ -220,7 +224,8 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
             isCombined() == right.isCombined() &&
          isPureSampler() == right.isPureSampler() &&
             isExternal() == right.isExternal() &&
-                 isYuv() == right.isYuv()
+                 isYuv() == right.isYuv() &&
+  isTileAttachmentQCOM() == right.isTileAttachmentQCOM()
 #ifdef ENABLE_HLSL
       && getVectorSize() == right.getVectorSize() &&
   getStructReturnIndex() == right.getStructReturnIndex()
@@ -260,6 +265,8 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
                 s.append("attachmentEXT");
             else if (isSubpass())
                 s.append("subpass");
+            else if (isTileAttachmentQCOM())
+                s.append("attachmentQCOM");
             else
                 s.append("image");
         } else if (isCombined()) {
@@ -850,6 +857,8 @@ public:
         layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd;
         layoutFormat = ElfNone;
 
+        layoutTileAttachmentQCOM = false;
+
         clearInterstageLayout();
 
         layoutSpecConstantId = layoutSpecConstantIdEnd;
@@ -951,6 +960,8 @@ public:
     bool layoutBindlessSampler;
     bool layoutBindlessImage;
 
+    bool layoutTileAttachmentQCOM;
+
     bool hasUniformLayout() const
     {
         return hasMatrix() ||
@@ -1069,6 +1080,10 @@ public:
     {
         return layoutBindlessImage;
     }
+    bool isTileAttachmentQCOM() const
+    {
+        return layoutTileAttachmentQCOM;
+    }
 
     // GL_EXT_spirv_intrinsics
     bool hasSpirvDecorate() const { return spirvDecorate != nullptr; }
@@ -1282,7 +1297,7 @@ public:
     }
 };
 
-// Qualifiers that don't need to be keep per object.  They have shader scope, not object scope.
+// Qualifiers that don't need to be kept per object.  They have shader scope, not object scope.
 // So, they will not be part of TType, TQualifier, etc.
 struct TShaderQualifiers {
     TLayoutGeometry geometry; // geometry/tessellation shader in/out primitives
@@ -1312,6 +1327,9 @@ struct TShaderQualifiers {
     bool layoutDerivativeGroupLinear;   // true if layout derivative_group_linearNV set
     int primitives;                     // mesh shader "max_primitives"DerivativeGroupLinear;   // true if layout derivative_group_linearNV set
     bool layoutPrimitiveCulling;        // true if layout primitive_culling set
+    bool layoutNonCoherentTileAttachmentReadQCOM; // fragment shaders -- per object
+    int  layoutTileShadingRateQCOM[3];  // compute shader
+    bool layoutTileShadingRateQCOMNotDefault[3];  // compute shader
     TLayoutDepth getDepth() const { return layoutDepth; }
     TLayoutStencil getStencil() const { return layoutStencil; }
 
@@ -1348,6 +1366,13 @@ struct TShaderQualifiers {
         layoutDerivativeGroupQuads  = false;
         layoutDerivativeGroupLinear = false;
         layoutPrimitiveCulling      = false;
+        layoutNonCoherentTileAttachmentReadQCOM = false;
+        layoutTileShadingRateQCOM[0] = 0;
+        layoutTileShadingRateQCOM[1] = 0;
+        layoutTileShadingRateQCOM[2] = 0;
+        layoutTileShadingRateQCOMNotDefault[0] = false;
+        layoutTileShadingRateQCOMNotDefault[1] = false;
+        layoutTileShadingRateQCOMNotDefault[2] = false;
         primitives                  = TQualifier::layoutNotSet;
         interlockOrdering = EioNone;
     }
@@ -1417,6 +1442,15 @@ struct TShaderQualifiers {
             interlockOrdering = src.interlockOrdering;
         if (src.layoutPrimitiveCulling)
             layoutPrimitiveCulling = src.layoutPrimitiveCulling;
+        if (src.layoutNonCoherentTileAttachmentReadQCOM)
+            layoutNonCoherentTileAttachmentReadQCOM = src.layoutNonCoherentTileAttachmentReadQCOM;
+        for (int i = 0; i < 3; ++i) {
+            if (src.layoutTileShadingRateQCOM[i] > 1)
+                layoutTileShadingRateQCOM[i] = src.layoutTileShadingRateQCOM[i];
+        }
+        for (int i = 0; i < 3; ++i) {
+            layoutTileShadingRateQCOMNotDefault[i] = src.layoutTileShadingRateQCOMNotDefault[i] || layoutTileShadingRateQCOMNotDefault[i];
+        }
     }
 };
 
@@ -1465,6 +1499,7 @@ public:
     bool coopmatNV  : 1;
     bool coopmatKHR : 1;
     bool coopvecNV  : 1;
+    bool tileAttachmentQCOM: 1;
     TArraySizes* arraySizes;
     const TType* userDef;
     TSourceLoc loc;
@@ -1494,6 +1529,7 @@ public:
         coopmatNV = false;
         coopmatKHR = false;
         coopvecNV = false;
+        tileAttachmentQCOM = false;
         spirvType = nullptr;
     }
 
@@ -1554,7 +1590,7 @@ public:
     explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0,
                    bool isVector = false) :
                             basicType(t), vectorSize(static_cast<uint32_t>(vs) & 0b1111), matrixCols(static_cast<uint32_t>(mc) & 0b1111), matrixRows(static_cast<uint32_t>(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-                            arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             {
                                 assert(vs >= 0);
@@ -1570,7 +1606,7 @@ public:
     TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
           bool isVector = false) :
                             basicType(t), vectorSize(static_cast<uint32_t>(vs) & 0b1111), matrixCols(static_cast<uint32_t>(mc) & 0b1111), matrixRows(static_cast<uint32_t>(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-                            arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             {
                                 assert(vs >= 0);
@@ -1588,7 +1624,7 @@ public:
     explicit TType(const TPublicType& p) :
                             basicType(p.basicType),
                             vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(p.coopvecNV),
-                            arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters),
+                            tileAttachmentQCOM(p.tileAttachmentQCOM), arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters),
                             spirvType(p.spirvType)
                             {
                                 if (basicType == EbtSampler)
@@ -1645,7 +1681,7 @@ public:
     // for construction of sampler types
     TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) :
         basicType(EbtSampler), vectorSize(1u), matrixCols(0u), matrixRows(0u), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-        arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
+        tileAttachmentQCOM(false), arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
         sampler(sampler), typeParameters(nullptr), spirvType(nullptr)
     {
         qualifier.clear();
@@ -1694,13 +1730,16 @@ public:
                                         coopmatKHRUseValid = false;
                                         coopvecNV = false;
                                         typeParameters = nullptr;
+                                    } else if (isTileAttachmentQCOM()) {
+                                        tileAttachmentQCOM = false;
+                                        typeParameters = nullptr;
                                     }
                                 }
                             }
     // for making structures, ...
     TType(TTypeList* userDef, const TString& n) :
                             basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-                            arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             {
                                 sampler.clear();
@@ -1710,7 +1749,7 @@ public:
     // For interface blocks
     TType(TTypeList* userDef, const TString& n, const TQualifier& q) :
                             basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
-                            qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             {
                                 sampler.clear();
@@ -1719,7 +1758,7 @@ public:
     // for block reference (first parameter must be EbtReference)
     explicit TType(TBasicType t, const TType &p, const TString& n) :
                             basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false),
-                            arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
+                            tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
                             spirvType(nullptr)
                             {
                                 assert(t == EbtReference);
@@ -1758,6 +1797,7 @@ public:
         coopmatKHRuse = copyOf.coopmatKHRuse;
         coopmatKHRUseValid = copyOf.coopmatKHRUseValid;
         coopvecNV = copyOf.isCoopVecNV();
+        tileAttachmentQCOM = copyOf.tileAttachmentQCOM;
     }
 
     // Make complete copy of the whole type graph rooted at 'copyOf'.
@@ -1876,7 +1916,7 @@ public:
     }
     virtual bool isOpaque() const { return basicType == EbtSampler
             || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
-            || basicType == EbtHitObjectNV; }
+            || basicType == EbtHitObjectNV || isTileAttachmentQCOM(); }
     virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
 
     virtual bool isAttachmentEXT() const { return basicType == EbtSampler && getSampler().isAttachmentEXT(); }
@@ -1894,6 +1934,7 @@ public:
     bool isCoopMatKHR() const { return coopmatKHR; }
     bool isCoopVecNV() const { return coopvecNV; }
     bool isCoopMatOrVec() const { return isCoopMat() || isCoopVecNV(); }
+    bool isTileAttachmentQCOM() const { return tileAttachmentQCOM; }
     bool isReference() const { return getBasicType() == EbtReference; }
     bool isSpirvType() const { return getBasicType() == EbtSpirvType; }
     int getCoopMatKHRuse() const { return static_cast<int>(coopmatKHRuse); }
@@ -2244,7 +2285,7 @@ public:
                 appendStr(" layoutSecondaryViewportRelativeOffset=");
                 appendInt(qualifier.layoutSecondaryViewportRelativeOffset);
               }
-              
+
               if (qualifier.layoutShaderRecord)
                 appendStr(" shaderRecordNV");
               if (qualifier.layoutFullQuads)
@@ -2967,6 +3008,7 @@ protected:
     uint32_t coopmatKHRuse    : 3;  // Accepts one of three values: 0, 1, 2 (gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator)
     bool coopmatKHRUseValid   : 1;  // True if coopmatKHRuse has been set
     bool coopvecNV       : 1;
+    bool tileAttachmentQCOM : 1;
     TQualifier qualifier;
 
     TArraySizes* arraySizes;    // nullptr unless an array; can be shared across types

+ 53 - 11
glslang/MachineIndependent/Initialize.cpp

@@ -5631,6 +5631,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
     }
 
+    // GL_QCOM_tile_shading
+    if ((profile == EEsProfile && version >= 310) ||
+        (profile != EEsProfile && version >= 460)) {
+        stageBuiltins[EShLangCompute].append(
+            "in highp uvec2 gl_TileOffsetQCOM;"     // GL_QCOM_tile_shading
+            "in highp uvec3 gl_TileDimensionQCOM;"  // GL_QCOM_tile_shading
+            "in highp uvec2 gl_TileApronSizeQCOM;"  // GL_QCOM_tile_shading
+            "\n");
+    }
+
     //============================================================================
     //
     // Define the interface to the mesh/task shader.
@@ -6471,6 +6481,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "flat in highp uint gl_ViewID_OVR;"     // GL_OVR_multiview, GL_OVR_multiview2
             "\n");
     }
+    
+    // GL_QCOM_tile_shading
+    if ((profile == EEsProfile && version >= 310) ||
+        (profile != EEsProfile && version >= 460)) {
+        stageBuiltins[EShLangFragment].append(
+            "flat in highp uvec2 gl_TileOffsetQCOM;"     // GL_QCOM_tile_shading
+            "flat in highp uvec3 gl_TileDimensionQCOM;"  // GL_QCOM_tile_shading
+            "flat in highp uvec2 gl_TileApronSizeQCOM;"  // GL_QCOM_tile_shading
+            "\n");
+    }
 
     // GL_ARB_shader_ballot
     if (profile != EEsProfile && version >= 450) {
@@ -8869,18 +8889,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable);
         }
 
-		if (language == EShLangGeometry || language == EShLangVertex) {
-			if ((profile == EEsProfile && version >= 310) ||
-				(profile != EEsProfile && version >= 450)) {
-				symbolTable.setVariableExtensions("gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate);
-				BuiltInVariable("gl_PrimitiveShadingRateEXT", EbvPrimitiveShadingRateKHR, symbolTable);
+        if (language == EShLangGeometry || language == EShLangVertex) {
+            if ((profile == EEsProfile && version >= 310) ||
+                (profile != EEsProfile && version >= 450)) {
+                symbolTable.setVariableExtensions("gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate);
+                BuiltInVariable("gl_PrimitiveShadingRateEXT", EbvPrimitiveShadingRateKHR, symbolTable);
 
-				symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
-				symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
-				symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
-				symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
-			}
-		}
+                symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
+                symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
+                symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
+                symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
+            }
+        }
         break;
 
     case EShLangFragment:
@@ -9518,6 +9538,17 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setFunctionExtensions("textureBlockMatchGatherSSDQCOM", 1, &E_GL_QCOM_image_processing2);
             symbolTable.setFunctionExtensions("textureBlockMatchGatherSADQCOM", 1, &E_GL_QCOM_image_processing2);
         }
+
+        if ((profile == EEsProfile && version >= 310) ||
+            (profile != EEsProfile && version >= 460)) {
+            BuiltInVariable("gl_TileOffsetQCOM",    EbvTileOffsetQCOM,      symbolTable);
+            BuiltInVariable("gl_TileDimensionQCOM", EbvTileDimensionQCOM,   symbolTable);
+            BuiltInVariable("gl_TileApronSizeQCOM", EbvTileApronSizeQCOM,   symbolTable);
+
+            symbolTable.setVariableExtensions("gl_TileOffsetQCOM",        1, &E_GL_QCOM_tile_shading);
+            symbolTable.setVariableExtensions("gl_TileDimensionQCOM",     1, &E_GL_QCOM_tile_shading);
+            symbolTable.setVariableExtensions("gl_TileApronSizeQCOM",     1, &E_GL_QCOM_tile_shading);
+        }
         break;
 
     case EShLangCompute:
@@ -9723,6 +9754,17 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setFunctionExtensions("uintBitsToBFloat16EXT", 1, &E_GL_EXT_bfloat16);
         }
 
+        // E_SPV_QCOM_tile_shading
+        if ((profile == EEsProfile && version >= 310) ||
+            (profile != EEsProfile && version >= 460)) {
+            BuiltInVariable("gl_TileOffsetQCOM",        EbvTileOffsetQCOM,      symbolTable);
+            BuiltInVariable("gl_TileDimensionQCOM",     EbvTileDimensionQCOM,   symbolTable);
+            BuiltInVariable("gl_TileApronSizeQCOM",     EbvTileApronSizeQCOM,   symbolTable);
+
+            symbolTable.setVariableExtensions("gl_TileOffsetQCOM",        1, &E_GL_QCOM_tile_shading);
+            symbolTable.setVariableExtensions("gl_TileDimensionQCOM",     1, &E_GL_QCOM_tile_shading);
+            symbolTable.setVariableExtensions("gl_TileApronSizeQCOM",     1, &E_GL_QCOM_tile_shading);
+        }
         break;
 
     case EShLangRayGen:

+ 82 - 3
glslang/MachineIndependent/ParseHelper.cpp

@@ -4163,10 +4163,16 @@ bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const
         error(loc, "sampler-constructor first argument must be a scalar *texture* type", token, "");
         return true;
     }
+
     // simulate the first argument's impact on the result type, so it can be compared with the encapsulated operator!=()
     TSampler texture = function.getType().getSampler();
     texture.setCombined(false);
     texture.shadow = false;
+    if (function[0].type->getSampler().isTileAttachmentQCOM()) {
+      //TSampler& texture = const_cast<TFunction&>(function).getWritableType().getSampler();
+      texture.image = true;
+      texture.tileQCOM = true;
+    }
     if (texture != function[0].type->getSampler()) {
         error(loc, "sampler-constructor first argument must be a *texture* type"
                    " matching the dimensionality and sampled type of the constructor", token, "");
@@ -4258,7 +4264,7 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const
             // if (! initializer)
             if (type.getSampler().isAttachmentEXT() && type.getQualifier().storage != EvqTileImageEXT)
                  error(loc, "can only be used in tileImageEXT variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
-             else if (type.getQualifier().storage != EvqTileImageEXT)
+            else if (type.getQualifier().storage != EvqTileImageEXT)
                  error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
         }
     }
@@ -6311,6 +6317,16 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
             publicType.qualifier.layoutFullQuads = true;
             return;
         }
+        if (id == "non_coherent_attachment_readqcom") {
+            requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM");
+            publicType.shaderQualifiers.layoutNonCoherentTileAttachmentReadQCOM = true;
+            return;
+        }
+        if (id == "tile_attachmentqcom") {
+            requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM");
+            publicType.qualifier.layoutTileAttachmentQCOM = true;
+            return;
+        }
     }
     if (language == EShLangVertex ||
         language == EShLangTessControl ||
@@ -6352,6 +6368,11 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
                 return;
             }
         }
+        if (id == "tile_attachmentqcom") {
+            requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM");
+            publicType.qualifier.layoutTileAttachmentQCOM = true;
+            return;
+        }
     }
 
     if (id == "primitive_culling") {
@@ -6721,6 +6742,38 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
                 }
             }
         }
+        if (id.compare(0, 18, "shading_rate_xqcom") == 0 ||
+            id.compare(0, 18, "shading_rate_yqcom") == 0 ||
+            id.compare(0, 18, "shading_rate_zqcom") == 0) {
+            requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM");
+            if (nonLiteral)
+                error(loc, "needs a literal integer", "shading_rate_*QCOM", "");
+            if (id.size() == 18 && value == 0) {
+                error(loc, "must be at least 1", id.c_str(), "");
+                return;
+            }
+            if (id == "shading_rate_xqcom") {
+                publicType.shaderQualifiers.layoutTileShadingRateQCOM[0] = value;
+                publicType.shaderQualifiers.layoutTileShadingRateQCOMNotDefault[0] = true;
+                if (! IsPow2(value))
+                    error(loc, "must be a power of 2", id.c_str(), "");
+                return;
+            }
+            if (id == "shading_rate_yqcom") {
+                publicType.shaderQualifiers.layoutTileShadingRateQCOM[1] = value;
+                publicType.shaderQualifiers.layoutTileShadingRateQCOMNotDefault[1] = true;
+                if (! IsPow2(value))
+                    error(loc, "must be a power of 2", id.c_str(), "");
+                return;
+            }
+            if (id == "shading_rate_zqcom") {
+                publicType.shaderQualifiers.layoutTileShadingRateQCOM[2] = value;
+                publicType.shaderQualifiers.layoutTileShadingRateQCOMNotDefault[2] = true;
+                if (value <= 0)
+                    error(loc, "must be a positive value", id.c_str(), "");
+                return;
+            }
+        }
         break;
 
     default:
@@ -6814,6 +6867,7 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie
             dst.pervertexEXT = true;
         if (src.layoutHitObjectShaderRecordNV)
             dst.layoutHitObjectShaderRecordNV = true;
+        dst.layoutTileAttachmentQCOM |= src.layoutTileAttachmentQCOM;
     }
 }
 
@@ -7258,8 +7312,8 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
     }
 
     if (qualifier.hasBinding()) {
-        if (! qualifier.isUniformOrBuffer() && !qualifier.isTaskMemory())
-            error(loc, "requires uniform or buffer storage qualifier", "binding", "");
+        if (! qualifier.isUniformOrBuffer() && !qualifier.isTaskMemory() && !qualifier.isTileAttachmentQCOM())
+            error(loc, "requires uniform or buffer or tile image storage qualifier", "binding", "");
     }
     if (qualifier.hasStream()) {
         if (!qualifier.isPipeOutput())
@@ -7364,6 +7418,15 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua
         error(loc, message, TQualifier::getInterlockOrderingString(shaderQualifiers.interlockOrdering), "");
     if (shaderQualifiers.layoutPrimitiveCulling)
         error(loc, "can only be applied as standalone", "primitive_culling", "");
+
+    if (shaderQualifiers.layoutNonCoherentTileAttachmentReadQCOM)
+        error(loc, message, "non_coherent_attachment_readQCOM", "");
+    if (shaderQualifiers.layoutTileShadingRateQCOM[0] >= 1)
+        error(loc, message, "shading_rate_xQCOM", "");
+    if (shaderQualifiers.layoutTileShadingRateQCOM[1] >= 1)
+        error(loc, message, "shading_rate_yQCOM", "");
+    if (shaderQualifiers.layoutTileShadingRateQCOM[2] >= 1)
+        error(loc, message, "shading_rate_zQCOM", "");
 }
 
 // Correct and/or advance an object's offset layout qualifier.
@@ -10353,6 +10416,12 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
         else
             error(loc, "can only apply to 'in'", "non_coherent_stencil_attachment_readEXT", "");
     }
+    if (publicType.shaderQualifiers.layoutNonCoherentTileAttachmentReadQCOM) {
+        if (publicType.qualifier.storage == EvqVaryingIn)
+            intermediate.setNonCoherentTileAttachmentReadQCOM();
+        else
+            error(loc, "can only apply to 'in'", "non_coherent_attachment_readQCOM", "");
+    }
     if (publicType.shaderQualifiers.hasBlendEquation()) {
         if (publicType.qualifier.storage != EvqVaryingOut)
             error(loc, "can only apply to 'out'", "blend equation", "");
@@ -10416,6 +10485,16 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
         return;
     }
 
+    for (int i = 0; i < 3; ++i) {
+        if (publicType.shaderQualifiers.layoutTileShadingRateQCOMNotDefault[i]) {
+            if (publicType.qualifier.storage == EvqVaryingIn) {
+                if (! intermediate.setTileShadingRateQCOM(i, publicType.shaderQualifiers.layoutTileShadingRateQCOM[i]))
+                    error(loc, "cannot change previously set size", (i==0?"shading_rate_xQCOM":(i==1?"shading_rate_yQCOM":"shading_rate_zQCOM")), "");
+            } else
+                error(loc, "can only apply to 'in'", (i==0?"shading_rate_xQCOM":(i==1?"shading_rate_yQCOM":"shading_rate_zQCOM")), "");
+        }
+    }
+
     const TQualifier& qualifier = publicType.qualifier;
 
     if (qualifier.isAuxiliary() ||

+ 1 - 0
glslang/MachineIndependent/ShaderLang.cpp

@@ -2200,6 +2200,7 @@ bool TProgram::buildReflection(int opts)
 }
 
 unsigned TProgram::getLocalSize(int dim) const                        { return reflection->getLocalSize(dim); }
+unsigned TProgram::getTileShadingRateQCOM(int dim) const              { return reflection->getTileShadingRateQCOM(dim); }
 int TProgram::getReflectionIndex(const char* name) const              { return reflection->getIndex(name); }
 int TProgram::getReflectionPipeIOIndex(const char* name, const bool inOrOut) const
                                                                       { return reflection->getPipeIOIndex(name, inOrOut); }

+ 11 - 0
glslang/MachineIndependent/Versions.cpp

@@ -323,6 +323,7 @@ void TParseVersions::initializeExtensionBehavior()
     // QCOM
     extensionBehavior[E_GL_QCOM_image_processing]                    = EBhDisable;
     extensionBehavior[E_GL_QCOM_image_processing2]                   = EBhDisable;
+    extensionBehavior[E_GL_QCOM_tile_shading]                        = EBhDisable;
 
     // AEP
     extensionBehavior[E_GL_ANDROID_extension_pack_es31a]             = EBhDisable;
@@ -460,6 +461,7 @@ void TParseVersions::getPreamble(std::string& preamble)
 
             "#define GL_QCOM_image_processing 1\n"
             "#define GL_QCOM_image_processing2 1\n"
+            "#define GL_QCOM_tile_shading 1\n"
             ;
 
             if (version >= 300) {
@@ -590,6 +592,7 @@ void TParseVersions::getPreamble(std::string& preamble)
 
             "#define GL_QCOM_image_processing 1\n"
             "#define GL_QCOM_image_processing2 1\n"
+            "#define GL_QCOM_tile_shading 1\n"
 
             "#define GL_EXT_shader_explicit_arithmetic_types 1\n"
             "#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n"
@@ -1452,6 +1455,14 @@ void TParseVersions::coopvecCheck(const TSourceLoc& loc, const char* op, bool bu
     }
 }
 
+void TParseVersions::intattachmentCheck(const TSourceLoc& loc, const char* op, bool builtIn)
+{
+    if (!builtIn) {
+        const char* const extensions[] = {E_GL_QCOM_tile_shading};
+        requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
+    }
+}
+
 // Call for any operation removed because SPIR-V is in use.
 void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
 {

+ 1 - 0
glslang/MachineIndependent/Versions.h

@@ -302,6 +302,7 @@ const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]);
 
 const char* const E_GL_QCOM_image_processing                    = "GL_QCOM_image_processing";
 const char* const E_GL_QCOM_image_processing2                   = "GL_QCOM_image_processing2";
+const char* const E_GL_QCOM_tile_shading                        = "GL_QCOM_tile_shading";
 
 // AEP
 const char* const E_GL_ANDROID_extension_pack_es31a             = "GL_ANDROID_extension_pack_es31a";

+ 9 - 0
glslang/MachineIndependent/intermOut.cpp

@@ -1447,6 +1447,8 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
             infoSink.debug << "using non_coherent_depth_attachment_readEXT\n";
         if (nonCoherentStencilAttachmentReadEXT)
             infoSink.debug << "using non_coherent_stencil_attachment_readEXT\n";
+        if (nonCoherentTileAttachmentReadQCOM)
+            infoSink.debug << "using non_coherent_attachment_readQCOM\n";
         if (depthLayout != EldNone)
             infoSink.debug << "using " << TQualifier::getLayoutDepthString(depthLayout) << "\n";
         if (blendEquations != 0) {
@@ -1481,6 +1483,13 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
                     localSizeSpecId[2] << ")\n";
             }
         }
+        if (nonCoherentTileAttachmentReadQCOM)
+            infoSink.debug << "using non_coherent_attachment_readQCOM\n";
+        if (isTileShadingRateQCOMSet()) {
+            infoSink.debug << "shading_rateQCOM = (" << tileShadingRateQCOM[0] << ", "
+                                                     << tileShadingRateQCOM[1] << ", "
+                                                     << tileShadingRateQCOM[2] << ")\n";
+        }
         break;
 
     default:

+ 1 - 0
glslang/MachineIndependent/linkValidate.cpp

@@ -600,6 +600,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
     MERGE_TRUE(nonCoherentColorAttachmentReadEXT);
     MERGE_TRUE(nonCoherentDepthAttachmentReadEXT);
     MERGE_TRUE(nonCoherentStencilAttachmentReadEXT);
+    MERGE_TRUE(nonCoherentTileAttachmentReadQCOM);
 
     if (depthLayout == EldNone)
         depthLayout = unit.depthLayout;

+ 28 - 0
glslang/MachineIndependent/localintermediate.h

@@ -343,6 +343,7 @@ public:
         numTaskNVBlocks(0),
         layoutPrimitiveCulling(false),
         numTaskEXTPayloads(0),
+        nonCoherentTileAttachmentReadQCOM(false),
         autoMapBindings(false),
         autoMapLocations(false),
         flattenUniformArrays(false),
@@ -371,6 +372,12 @@ public:
         localSizeSpecId[1] = TQualifier::layoutNotSet;
         localSizeSpecId[2] = TQualifier::layoutNotSet;
         xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
+        tileShadingRateQCOM[0] = 0;
+        tileShadingRateQCOM[1] = 0;
+        tileShadingRateQCOM[2] = 0;
+        tileShadingRateQCOMNotDefault[0] = false;
+        tileShadingRateQCOMNotDefault[1] = false;
+        tileShadingRateQCOMNotDefault[2] = false;
         shiftBinding.fill(0);
     }
 
@@ -651,6 +658,21 @@ public:
 
     bool isEsProfile() const { return profile == EEsProfile; }
 
+    bool setTileShadingRateQCOM(int dim, int size)
+    {
+        if (tileShadingRateQCOMNotDefault[dim])
+            return size == tileShadingRateQCOM[dim];
+        tileShadingRateQCOMNotDefault[dim] = true;
+        tileShadingRateQCOM[dim] = size;
+        return true;
+    }
+    unsigned int getTileShadingRateQCOM(int dim) const { return tileShadingRateQCOM[dim]; }
+    bool isTileShadingRateQCOMSet() const
+    {
+        // Return true if any component has been set (i.e. any component is not default).
+        return tileShadingRateQCOMNotDefault[0] || tileShadingRateQCOMNotDefault[1] || tileShadingRateQCOMNotDefault[2];
+    }
+
     void setShiftBinding(TResourceType res, unsigned int shift)
     {
         shiftBinding[res] = shift;
@@ -896,6 +918,8 @@ public:
     bool getNonCoherentDepthAttachmentReadEXT() const { return nonCoherentDepthAttachmentReadEXT; }
     void setNonCoherentStencilAttachmentReadEXT() { nonCoherentStencilAttachmentReadEXT = true; }
     bool getNonCoherentStencilAttachmentReadEXT() const { return nonCoherentStencilAttachmentReadEXT; }
+    void setNonCoherentTileAttachmentReadQCOM() { nonCoherentTileAttachmentReadQCOM = true; }
+    bool getNonCoherentTileAttachmentReadQCOM() const { return nonCoherentTileAttachmentReadQCOM; }
     void setPostDepthCoverage() { postDepthCoverage = true; }
     bool getPostDepthCoverage() const { return postDepthCoverage; }
     void setEarlyFragmentTests() { earlyFragmentTests = true; }
@@ -1242,6 +1266,10 @@ protected:
     bool layoutPrimitiveCulling;
     int numTaskEXTPayloads;
 
+    bool nonCoherentTileAttachmentReadQCOM;
+    int  tileShadingRateQCOM[3];
+    bool tileShadingRateQCOMNotDefault[3];
+
     // Base shift values
     std::array<unsigned int, EResCount> shiftBinding;
 

+ 1 - 0
glslang/MachineIndependent/parseVersions.h

@@ -124,6 +124,7 @@ public:
     virtual void coopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false);
     virtual void tensorLayoutViewCheck(const TSourceLoc&, const char* op, bool builtIn = false);
     virtual void coopvecCheck(const TSourceLoc&, const char* op, bool builtIn = false);
+    virtual void intattachmentCheck(const TSourceLoc&, const char *op, bool builtIn = false);
     bool relaxedErrors()    const { return (messages & EShMsgRelaxedErrors) != 0; }
     bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
     bool isForwardCompatible() const { return forwardCompatible; }

+ 10 - 3
glslang/MachineIndependent/reflection.cpp

@@ -1138,8 +1138,10 @@ void TReflection::buildAttributeReflection(EShLanguage stage, const TIntermediat
 {
     if (stage == EShLangCompute) {
         // Remember thread dimensions
-        for (int dim=0; dim<3; ++dim)
+        for (int dim=0; dim<3; ++dim) {
             localSize[dim] = intermediate.getLocalSize(dim);
+            tileShadingRateQCOM[dim] = intermediate.getTileShadingRateQCOM(dim);
+        }
     }
 }
 
@@ -1270,9 +1272,8 @@ void TReflection::dump()
         indexToPipeOutput[i].dump();
     printf("\n");
 
+    static const char* axis[] = { "X", "Y", "Z" };
     if (getLocalSize(0) > 1) {
-        static const char* axis[] = { "X", "Y", "Z" };
-
         for (int dim=0; dim<3; ++dim)
             if (getLocalSize(dim) > 1)
                 printf("Local size %s: %u\n", axis[dim], getLocalSize(dim));
@@ -1280,6 +1281,12 @@ void TReflection::dump()
         printf("\n");
     }
 
+    if (getTileShadingRateQCOM(0) > 1 || getTileShadingRateQCOM(1) > 1) {
+        for (int dim=0; dim<3; ++dim)
+            printf("Tile shading rate QCOM %s: %u\n", axis[dim], getTileShadingRateQCOM(dim));
+        printf("\n");
+    }
+
     // printf("Live names\n");
     // for (TNameToIndex::const_iterator it = nameToIndex.begin(); it != nameToIndex.end(); ++it)
     //    printf("%s: %d\n", it->first.c_str(), it->second);

+ 7 - 1
glslang/MachineIndependent/reflection.h

@@ -58,8 +58,10 @@ public:
     TReflection(EShReflectionOptions opts, EShLanguage first, EShLanguage last)
         : options(opts), firstStage(first), lastStage(last), badReflection(TObjectReflection::badReflection())
     { 
-        for (int dim=0; dim<3; ++dim)
+        for (int dim=0; dim<3; ++dim) {
             localSize[dim] = 0;
+            tileShadingRateQCOM[dim] = 0;
+        }
     }
 
     virtual ~TReflection() {}
@@ -168,6 +170,9 @@ public:
     // Thread local size
     unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; }
 
+    // Tile shading rate QCOM
+    unsigned getTileShadingRateQCOM(int dim) const { return dim <= 2 ? tileShadingRateQCOM[dim] : 0; }
+
     void dump();
 
 protected:
@@ -213,6 +218,7 @@ protected:
     TIndices atomicCounterUniformIndices;
 
     unsigned int localSize[3];
+    unsigned int tileShadingRateQCOM[3];
 };
 
 } // end namespace glslang

+ 1 - 0
glslang/Public/ShaderLang.h

@@ -895,6 +895,7 @@ public:
     // call first, to do liveness analysis, index mapping, etc.; returns false on failure
     GLSLANG_EXPORT bool buildReflection(int opts = EShReflectionDefault);
     GLSLANG_EXPORT unsigned getLocalSize(int dim) const;                  // return dim'th local size
+    GLSLANG_EXPORT unsigned getTileShadingRateQCOM(int dim) const;        // return dim'th tile shading rate QCOM
     GLSLANG_EXPORT int getReflectionIndex(const char *name) const;
     GLSLANG_EXPORT int getReflectionPipeIOIndex(const char* name, const bool inOrOut) const;
     GLSLANG_EXPORT int getNumUniformVariables() const;

+ 9 - 0
gtests/Spv.FromFile.cpp

@@ -896,6 +896,15 @@ INSTANTIATE_TEST_SUITE_P(
         "spv.tpipBlockMatchGatherSSD.frag",
         "spv.tpipBlockMatchWindowSAD.frag",
         "spv.tpipBlockMatchWindowSSD.frag",
+        "spv.qcom.tileShading.0.comp",
+        "spv.qcom.tileShading.1.comp",
+        "spv.qcom.es.tileShading.0.comp",
+        "spv.qcom.es.tileShading.1.comp",
+        "spv.qcom.es.tileShading.2.comp",
+        "spv.qcom.tileShading.0.frag",
+        "spv.qcom.tileShading.1.frag",
+        "spv.qcom.es.tileShading.0.frag",
+        "spv.qcom.es.tileShading.1.frag",
     })),
     FileNameAsCustomTestSuffix
 );

+ 2 - 2
known_good.json

@@ -5,14 +5,14 @@
       "site" : "github",
       "subrepo" : "KhronosGroup/SPIRV-Tools",
       "subdir" : "External/spirv-tools",
-      "commit": "a62abcb402009b9ca5975e6167c09f237f630e0e"
+      "commit": "01021466b5e71deaac9054f56082566c782bfd51"
     },
     {
       "name" : "spirv-tools/external/spirv-headers",
       "site" : "github",
       "subrepo" : "KhronosGroup/SPIRV-Headers",
       "subdir" : "External/spirv-tools/external/spirv-headers",
-      "commit" : "aa6cef192b8e693916eb713e7a9ccadf06062ceb"
+      "commit" : "c9aad99f9276817f18f72a4696239237c83cb775"
     },
     {
       "name": "googletest",