From 157de8e260e9362225c0ce9a6675d034968abe15 Mon Sep 17 00:00:00 2001
From: mjkrol <mjkrol@gmail.com>
Date: Wed, 29 Apr 2026 17:42:37 +0200
Subject: [PATCH 03/26] Add SPV_MESA_fragment_coverage_mask enumerants (#580)

Reserve BuiltIn FragmentCoverageMaskMESA (4096) and Capability
FragmentCoverageMESA (4097) for SPV_MESA_fragment_coverage_mask.
---
 include/spirv/unified1/spirv.bf                |  2 ++
 include/spirv/unified1/spirv.core.grammar.json | 13 +++++++++++++
 include/spirv/unified1/spirv.cs                |  2 ++
 include/spirv/unified1/spirv.h                 |  4 ++++
 include/spirv/unified1/spirv.hpp               |  4 ++++
 include/spirv/unified1/spirv.hpp11             |  4 ++++
 include/spirv/unified1/spirv.json              |  2 ++
 include/spirv/unified1/spirv.lua               |  2 ++
 include/spirv/unified1/spirv.py                |  2 ++
 include/spirv/unified1/spv.d                   |  2 ++
 10 files changed, 37 insertions(+)

diff --git a/include/spirv/unified1/spirv.bf b/include/spirv/unified1/spirv.bf
index 3d24085..efd329f 100644
--- a/include/spirv/unified1/spirv.bf
+++ b/include/spirv/unified1/spirv.bf
@@ -757,6 +757,7 @@ namespace Spv
             SubgroupLocalInvocationId = 41,
             VertexIndex = 42,
             InstanceIndex = 43,
+            FragmentCoverageMaskMESA = 4096,
             CoreIDARM = 4160,
             CoreCountARM = 4161,
             CoreMaxIDARM = 4162,
@@ -1169,6 +1170,7 @@ namespace Spv
             ShaderLayer = 69,
             ShaderViewportIndex = 70,
             UniformDecoration = 71,
+            FragmentCoverageMESA = 4097,
             CoreBuiltinsARM = 4165,
             TileImageColorReadAccessEXT = 4166,
             TileImageDepthReadAccessEXT = 4167,
diff --git a/include/spirv/unified1/spirv.core.grammar.json b/include/spirv/unified1/spirv.core.grammar.json
index 4fc0ec9..1a6a490 100644
--- a/include/spirv/unified1/spirv.core.grammar.json
+++ b/include/spirv/unified1/spirv.core.grammar.json
@@ -16170,6 +16170,12 @@
           "capabilities" : [ "Shader" ],
           "version": "1.0"
         },
+        {
+          "enumerant" : "FragmentCoverageMaskMESA",
+          "value" : 4096,
+          "capabilities" : [ "FragmentCoverageMESA" ],
+          "version" : "None"
+        },
         {
           "enumerant" : "CoreIDARM",
           "value" : 4160,
@@ -17309,6 +17315,13 @@
           "value" : 71,
           "version" : "1.6"
         },
+        {
+          "enumerant" : "FragmentCoverageMESA",
+          "value" : 4097,
+          "capabilities" : [ "Shader" ],
+          "extensions" : [ "SPV_MESA_fragment_coverage_mask" ],
+          "version" : "None"
+        },
         {
           "enumerant" : "CoreBuiltinsARM",
           "value" : 4165,
diff --git a/include/spirv/unified1/spirv.cs b/include/spirv/unified1/spirv.cs
index 35b9aff..248e593 100644
--- a/include/spirv/unified1/spirv.cs
+++ b/include/spirv/unified1/spirv.cs
@@ -756,6 +756,7 @@ namespace Spv
             SubgroupLocalInvocationId = 41,
             VertexIndex = 42,
             InstanceIndex = 43,
+            FragmentCoverageMaskMESA = 4096,
             CoreIDARM = 4160,
             CoreCountARM = 4161,
             CoreMaxIDARM = 4162,
@@ -1168,6 +1169,7 @@ namespace Spv
             ShaderLayer = 69,
             ShaderViewportIndex = 70,
             UniformDecoration = 71,
+            FragmentCoverageMESA = 4097,
             CoreBuiltinsARM = 4165,
             TileImageColorReadAccessEXT = 4166,
             TileImageDepthReadAccessEXT = 4167,
diff --git a/include/spirv/unified1/spirv.h b/include/spirv/unified1/spirv.h
index a9e4998..ea4fb66 100644
--- a/include/spirv/unified1/spirv.h
+++ b/include/spirv/unified1/spirv.h
@@ -743,6 +743,7 @@ typedef enum SpvBuiltIn_ {
     SpvBuiltInSubgroupLocalInvocationId = 41,
     SpvBuiltInVertexIndex = 42,
     SpvBuiltInInstanceIndex = 43,
+    SpvBuiltInFragmentCoverageMaskMESA = 4096,
     SpvBuiltInCoreIDARM = 4160,
     SpvBuiltInCoreCountARM = 4161,
     SpvBuiltInCoreMaxIDARM = 4162,
@@ -1139,6 +1140,7 @@ typedef enum SpvCapability_ {
     SpvCapabilityShaderLayer = 69,
     SpvCapabilityShaderViewportIndex = 70,
     SpvCapabilityUniformDecoration = 71,
+    SpvCapabilityFragmentCoverageMESA = 4097,
     SpvCapabilityCoreBuiltinsARM = 4165,
     SpvCapabilityTileImageColorReadAccessEXT = 4166,
     SpvCapabilityTileImageDepthReadAccessEXT = 4167,
@@ -4118,6 +4120,7 @@ inline const char* SpvBuiltInToString(SpvBuiltIn value) {
     case SpvBuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId";
     case SpvBuiltInVertexIndex: return "VertexIndex";
     case SpvBuiltInInstanceIndex: return "InstanceIndex";
+    case SpvBuiltInFragmentCoverageMaskMESA: return "FragmentCoverageMaskMESA";
     case SpvBuiltInCoreIDARM: return "CoreIDARM";
     case SpvBuiltInCoreCountARM: return "CoreCountARM";
     case SpvBuiltInCoreMaxIDARM: return "CoreMaxIDARM";
@@ -4316,6 +4319,7 @@ inline const char* SpvCapabilityToString(SpvCapability value) {
     case SpvCapabilityShaderLayer: return "ShaderLayer";
     case SpvCapabilityShaderViewportIndex: return "ShaderViewportIndex";
     case SpvCapabilityUniformDecoration: return "UniformDecoration";
+    case SpvCapabilityFragmentCoverageMESA: return "FragmentCoverageMESA";
     case SpvCapabilityCoreBuiltinsARM: return "CoreBuiltinsARM";
     case SpvCapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
     case SpvCapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp
index 6676d71..3a61c4d 100644
--- a/include/spirv/unified1/spirv.hpp
+++ b/include/spirv/unified1/spirv.hpp
@@ -739,6 +739,7 @@ enum BuiltIn {
     BuiltInSubgroupLocalInvocationId = 41,
     BuiltInVertexIndex = 42,
     BuiltInInstanceIndex = 43,
+    BuiltInFragmentCoverageMaskMESA = 4096,
     BuiltInCoreIDARM = 4160,
     BuiltInCoreCountARM = 4161,
     BuiltInCoreMaxIDARM = 4162,
@@ -1135,6 +1136,7 @@ enum Capability {
     CapabilityShaderLayer = 69,
     CapabilityShaderViewportIndex = 70,
     CapabilityUniformDecoration = 71,
+    CapabilityFragmentCoverageMESA = 4097,
     CapabilityCoreBuiltinsARM = 4165,
     CapabilityTileImageColorReadAccessEXT = 4166,
     CapabilityTileImageDepthReadAccessEXT = 4167,
@@ -4114,6 +4116,7 @@ inline const char* BuiltInToString(BuiltIn value) {
     case BuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId";
     case BuiltInVertexIndex: return "VertexIndex";
     case BuiltInInstanceIndex: return "InstanceIndex";
+    case BuiltInFragmentCoverageMaskMESA: return "FragmentCoverageMaskMESA";
     case BuiltInCoreIDARM: return "CoreIDARM";
     case BuiltInCoreCountARM: return "CoreCountARM";
     case BuiltInCoreMaxIDARM: return "CoreMaxIDARM";
@@ -4312,6 +4315,7 @@ inline const char* CapabilityToString(Capability value) {
     case CapabilityShaderLayer: return "ShaderLayer";
     case CapabilityShaderViewportIndex: return "ShaderViewportIndex";
     case CapabilityUniformDecoration: return "UniformDecoration";
+    case CapabilityFragmentCoverageMESA: return "FragmentCoverageMESA";
     case CapabilityCoreBuiltinsARM: return "CoreBuiltinsARM";
     case CapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
     case CapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11
index e08b65b..a3c8b1c 100644
--- a/include/spirv/unified1/spirv.hpp11
+++ b/include/spirv/unified1/spirv.hpp11
@@ -739,6 +739,7 @@ enum class BuiltIn : unsigned {
     SubgroupLocalInvocationId = 41,
     VertexIndex = 42,
     InstanceIndex = 43,
+    FragmentCoverageMaskMESA = 4096,
     CoreIDARM = 4160,
     CoreCountARM = 4161,
     CoreMaxIDARM = 4162,
@@ -1135,6 +1136,7 @@ enum class Capability : unsigned {
     ShaderLayer = 69,
     ShaderViewportIndex = 70,
     UniformDecoration = 71,
+    FragmentCoverageMESA = 4097,
     CoreBuiltinsARM = 4165,
     TileImageColorReadAccessEXT = 4166,
     TileImageDepthReadAccessEXT = 4167,
@@ -4114,6 +4116,7 @@ inline const char* BuiltInToString(BuiltIn value) {
     case BuiltIn::SubgroupLocalInvocationId: return "SubgroupLocalInvocationId";
     case BuiltIn::VertexIndex: return "VertexIndex";
     case BuiltIn::InstanceIndex: return "InstanceIndex";
+    case BuiltIn::FragmentCoverageMaskMESA: return "FragmentCoverageMaskMESA";
     case BuiltIn::CoreIDARM: return "CoreIDARM";
     case BuiltIn::CoreCountARM: return "CoreCountARM";
     case BuiltIn::CoreMaxIDARM: return "CoreMaxIDARM";
@@ -4312,6 +4315,7 @@ inline const char* CapabilityToString(Capability value) {
     case Capability::ShaderLayer: return "ShaderLayer";
     case Capability::ShaderViewportIndex: return "ShaderViewportIndex";
     case Capability::UniformDecoration: return "UniformDecoration";
+    case Capability::FragmentCoverageMESA: return "FragmentCoverageMESA";
     case Capability::CoreBuiltinsARM: return "CoreBuiltinsARM";
     case Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
     case Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
diff --git a/include/spirv/unified1/spirv.json b/include/spirv/unified1/spirv.json
index bd3f41b..88f2605 100644
--- a/include/spirv/unified1/spirv.json
+++ b/include/spirv/unified1/spirv.json
@@ -765,6 +765,7 @@
                     "SubgroupLocalInvocationId": 41,
                     "VertexIndex": 42,
                     "InstanceIndex": 43,
+                    "FragmentCoverageMaskMESA": 4096,
                     "CoreIDARM": 4160,
                     "CoreCountARM": 4161,
                     "CoreMaxIDARM": 4162,
@@ -1101,6 +1102,7 @@
                     "ShaderLayer": 69,
                     "ShaderViewportIndex": 70,
                     "UniformDecoration": 71,
+                    "FragmentCoverageMESA": 4097,
                     "CoreBuiltinsARM": 4165,
                     "TileImageColorReadAccessEXT": 4166,
                     "TileImageDepthReadAccessEXT": 4167,
diff --git a/include/spirv/unified1/spirv.lua b/include/spirv/unified1/spirv.lua
index 347e010..db1bfd5 100644
--- a/include/spirv/unified1/spirv.lua
+++ b/include/spirv/unified1/spirv.lua
@@ -730,6 +730,7 @@ spv = {
         SubgroupLocalInvocationId = 41,
         VertexIndex = 42,
         InstanceIndex = 43,
+        FragmentCoverageMaskMESA = 4096,
         CoreIDARM = 4160,
         CoreCountARM = 4161,
         CoreMaxIDARM = 4162,
@@ -1126,6 +1127,7 @@ spv = {
         ShaderLayer = 69,
         ShaderViewportIndex = 70,
         UniformDecoration = 71,
+        FragmentCoverageMESA = 4097,
         CoreBuiltinsARM = 4165,
         TileImageColorReadAccessEXT = 4166,
         TileImageDepthReadAccessEXT = 4167,
diff --git a/include/spirv/unified1/spirv.py b/include/spirv/unified1/spirv.py
index a5c118d..976e23b 100644
--- a/include/spirv/unified1/spirv.py
+++ b/include/spirv/unified1/spirv.py
@@ -711,6 +711,7 @@ spv = {
         'SubgroupLocalInvocationId' : 41,
         'VertexIndex' : 42,
         'InstanceIndex' : 43,
+        'FragmentCoverageMaskMESA' : 4096,
         'CoreIDARM' : 4160,
         'CoreCountARM' : 4161,
         'CoreMaxIDARM' : 4162,
@@ -1097,6 +1098,7 @@ spv = {
         'ShaderLayer' : 69,
         'ShaderViewportIndex' : 70,
         'UniformDecoration' : 71,
+        'FragmentCoverageMESA' : 4097,
         'CoreBuiltinsARM' : 4165,
         'TileImageColorReadAccessEXT' : 4166,
         'TileImageDepthReadAccessEXT' : 4167,
diff --git a/include/spirv/unified1/spv.d b/include/spirv/unified1/spv.d
index 781154a..a9093d6 100644
--- a/include/spirv/unified1/spv.d
+++ b/include/spirv/unified1/spv.d
@@ -759,6 +759,7 @@ enum BuiltIn : uint
     SubgroupLocalInvocationId = 41,
     VertexIndex = 42,
     InstanceIndex = 43,
+    FragmentCoverageMaskMESA = 4096,
     CoreIDARM = 4160,
     CoreCountARM = 4161,
     CoreMaxIDARM = 4162,
@@ -1171,6 +1172,7 @@ enum Capability : uint
     ShaderLayer = 69,
     ShaderViewportIndex = 70,
     UniformDecoration = 71,
+    FragmentCoverageMESA = 4097,
     CoreBuiltinsARM = 4165,
     TileImageColorReadAccessEXT = 4166,
     TileImageDepthReadAccessEXT = 4167,
-- 
2.54.0

