From e225eb0bec7f20656255041f6ea147584114cbc1 Mon Sep 17 00:00:00 2001 From: Pankaj Mistry Date: Tue, 5 Oct 2021 17:16:39 -0700 Subject: [PATCH] Define a new Image operand bit mask for non constant offsets For details refer to https://gitlab.khronos.org/spirv/SPIR-V/-/issues/639 As part of the commit following changes have been introduced: 1. Added a separate section in spirv xml to reserve vendor specific bit masks. 2. Added a new image operand bit mask to support non constant offsets in textureGatherOffsets as defined in GL_NV_gpu_shader5 --- include/spirv/spir-v.xml | 20 ++++++++++++++++++++ include/spirv/unified1/spirv.core.grammar.json | 7 +++++++ include/spirv/unified1/spirv.cs | 2 ++ include/spirv/unified1/spirv.h | 2 ++ include/spirv/unified1/spirv.hpp | 2 ++ include/spirv/unified1/spirv.hpp11 | 2 ++ include/spirv/unified1/spirv.json | 3 ++- include/spirv/unified1/spirv.lua | 2 ++ include/spirv/unified1/spirv.py | 2 ++ include/spirv/unified1/spv.d | 2 ++ 10 files changed, 43 insertions(+), 1 deletion(-) diff --git a/include/spirv/spir-v.xml b/include/spirv/spir-v.xml index 525c97d..8d7d93a 100644 --- a/include/spirv/spir-v.xml +++ b/include/spirv/spir-v.xml @@ -251,4 +251,24 @@ + + + + + + + + + diff --git a/include/spirv/unified1/spirv.core.grammar.json b/include/spirv/unified1/spirv.core.grammar.json index 9154496..53aaf35 100644 --- a/include/spirv/unified1/spirv.core.grammar.json +++ b/include/spirv/unified1/spirv.core.grammar.json @@ -8475,6 +8475,13 @@ "enumerant" : "ZeroExtend", "value" : "0x2000", "version" : "1.4" + }, + { + "enumerant" : "Offsets", + "value" : "0x10000", + "parameters" : [ + { "kind" : "IdRef" } + ] } ] }, diff --git a/include/spirv/unified1/spirv.cs b/include/spirv/unified1/spirv.cs index b2ca3f0..5927a37 100644 --- a/include/spirv/unified1/spirv.cs +++ b/include/spirv/unified1/spirv.cs @@ -349,6 +349,7 @@ namespace Spv VolatileTexelKHR = 11, SignExtend = 12, ZeroExtend = 13, + Offsets = 16, } public enum ImageOperandsMask @@ -372,6 +373,7 @@ namespace Spv VolatileTexelKHR = 0x00000800, SignExtend = 0x00001000, ZeroExtend = 0x00002000, + Offsets = 0x00010000, } public enum FPFastMathModeShift diff --git a/include/spirv/unified1/spirv.h b/include/spirv/unified1/spirv.h index 1443963..bb6c68d 100644 --- a/include/spirv/unified1/spirv.h +++ b/include/spirv/unified1/spirv.h @@ -357,6 +357,7 @@ typedef enum SpvImageOperandsShift_ { SpvImageOperandsVolatileTexelKHRShift = 11, SpvImageOperandsSignExtendShift = 12, SpvImageOperandsZeroExtendShift = 13, + SpvImageOperandsOffsetsShift = 16, SpvImageOperandsMax = 0x7fffffff, } SpvImageOperandsShift; @@ -380,6 +381,7 @@ typedef enum SpvImageOperandsMask_ { SpvImageOperandsVolatileTexelKHRMask = 0x00000800, SpvImageOperandsSignExtendMask = 0x00001000, SpvImageOperandsZeroExtendMask = 0x00002000, + SpvImageOperandsOffsetsMask = 0x00010000, } SpvImageOperandsMask; typedef enum SpvFPFastMathModeShift_ { diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp index 5180457..6c8d35d 100644 --- a/include/spirv/unified1/spirv.hpp +++ b/include/spirv/unified1/spirv.hpp @@ -353,6 +353,7 @@ enum ImageOperandsShift { ImageOperandsVolatileTexelKHRShift = 11, ImageOperandsSignExtendShift = 12, ImageOperandsZeroExtendShift = 13, + ImageOperandsOffsetsShift = 16, ImageOperandsMax = 0x7fffffff, }; @@ -376,6 +377,7 @@ enum ImageOperandsMask { ImageOperandsVolatileTexelKHRMask = 0x00000800, ImageOperandsSignExtendMask = 0x00001000, ImageOperandsZeroExtendMask = 0x00002000, + ImageOperandsOffsetsMask = 0x00010000, }; enum FPFastMathModeShift { diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11 index 51e9024..4ba5d25 100644 --- a/include/spirv/unified1/spirv.hpp11 +++ b/include/spirv/unified1/spirv.hpp11 @@ -353,6 +353,7 @@ enum class ImageOperandsShift : unsigned { VolatileTexelKHR = 11, SignExtend = 12, ZeroExtend = 13, + Offsets = 16, Max = 0x7fffffff, }; @@ -376,6 +377,7 @@ enum class ImageOperandsMask : unsigned { VolatileTexelKHR = 0x00000800, SignExtend = 0x00001000, ZeroExtend = 0x00002000, + Offsets = 0x00010000, }; enum class FPFastMathModeShift : unsigned { diff --git a/include/spirv/unified1/spirv.json b/include/spirv/unified1/spirv.json index 017b842..39fdc77 100644 --- a/include/spirv/unified1/spirv.json +++ b/include/spirv/unified1/spirv.json @@ -395,7 +395,8 @@ "VolatileTexel": 11, "VolatileTexelKHR": 11, "SignExtend": 12, - "ZeroExtend": 13 + "ZeroExtend": 13, + "Offsets": 16 } }, { diff --git a/include/spirv/unified1/spirv.lua b/include/spirv/unified1/spirv.lua index 46665d8..d425d95 100644 --- a/include/spirv/unified1/spirv.lua +++ b/include/spirv/unified1/spirv.lua @@ -332,6 +332,7 @@ spv = { VolatileTexelKHR = 11, SignExtend = 12, ZeroExtend = 13, + Offsets = 16, }, ImageOperandsMask = { @@ -354,6 +355,7 @@ spv = { VolatileTexelKHR = 0x00000800, SignExtend = 0x00001000, ZeroExtend = 0x00002000, + Offsets = 0x00010000, }, FPFastMathModeShift = { diff --git a/include/spirv/unified1/spirv.py b/include/spirv/unified1/spirv.py index a780191..be0afdc 100644 --- a/include/spirv/unified1/spirv.py +++ b/include/spirv/unified1/spirv.py @@ -332,6 +332,7 @@ spv = { 'VolatileTexelKHR' : 11, 'SignExtend' : 12, 'ZeroExtend' : 13, + 'Offsets' : 16, }, 'ImageOperandsMask' : { @@ -354,6 +355,7 @@ spv = { 'VolatileTexelKHR' : 0x00000800, 'SignExtend' : 0x00001000, 'ZeroExtend' : 0x00002000, + 'Offsets' : 0x00010000, }, 'FPFastMathModeShift' : { diff --git a/include/spirv/unified1/spv.d b/include/spirv/unified1/spv.d index b85517a..ad07fb3 100644 --- a/include/spirv/unified1/spv.d +++ b/include/spirv/unified1/spv.d @@ -352,6 +352,7 @@ enum ImageOperandsShift : uint VolatileTexelKHR = 11, SignExtend = 12, ZeroExtend = 13, + Offsets = 16, } enum ImageOperandsMask : uint @@ -375,6 +376,7 @@ enum ImageOperandsMask : uint VolatileTexelKHR = 0x00000800, SignExtend = 0x00001000, ZeroExtend = 0x00002000, + Offsets = 0x00010000, } enum FPFastMathModeShift : uint -- 2.7.4