Skip to content

Commit

Permalink
Headers for revision 4 of SPIR-V 1.3, including SPV_KHR_vulkan_memory…
Browse files Browse the repository at this point in the history
…_model.
  • Loading branch information
johnkslang committed Sep 6, 2018
1 parent 2c51218 commit dcf23bd
Show file tree
Hide file tree
Showing 7 changed files with 229 additions and 10 deletions.
95 changes: 90 additions & 5 deletions include/spirv/unified1/spirv.core.grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4010,6 +4010,32 @@
"parameters" : [
{ "kind" : "IdRef" }
]
},
{
"enumerant" : "MakeTexelAvailableKHR",
"value" : "0x0100",
"capabilities" : [ "VulkanMemoryModelKHR" ],
"parameters" : [
{ "kind" : "IdScope" }
]
},
{
"enumerant" : "MakeTexelVisibleKHR",
"value" : "0x0200",
"capabilities" : [ "VulkanMemoryModelKHR" ],
"parameters" : [
{ "kind" : "IdScope" }
]
},
{
"enumerant" : "NonPrivateTexelKHR",
"value" : "0x0400",
"capabilities" : [ "VulkanMemoryModelKHR" ]
},
{
"enumerant" : "VolatileTexelKHR",
"value" : "0x0800",
"capabilities" : [ "VulkanMemoryModelKHR" ]
}
]
},
Expand Down Expand Up @@ -4176,6 +4202,21 @@
{
"enumerant" : "ImageMemory",
"value" : "0x0800"
},
{
"enumerant" : "OutputMemoryKHR",
"value" : "0x1000",
"capabilities" : [ "VulkanMemoryModelKHR" ]
},
{
"enumerant" : "MakeAvailableKHR",
"value" : "0x2000",
"capabilities" : [ "VulkanMemoryModelKHR" ]
},
{
"enumerant" : "MakeVisibleKHR",
"value" : "0x4000",
"capabilities" : [ "VulkanMemoryModelKHR" ]
}
]
},
Expand All @@ -4201,6 +4242,27 @@
{
"enumerant" : "Nontemporal",
"value" : "0x0004"
},
{
"enumerant" : "MakePointerAvailableKHR",
"value" : "0x0008",
"parameters" : [
{ "kind" : "IdScope" }
],
"capabilities" : [ "VulkanMemoryModelKHR" ]
},
{
"enumerant" : "MakePointerVisibleKHR",
"value" : "0x0010",
"parameters" : [
{ "kind" : "IdScope" }
],
"capabilities" : [ "VulkanMemoryModelKHR" ]
},
{
"enumerant" : "NonPrivatePointerKHR",
"value" : "0x0020",
"capabilities" : [ "VulkanMemoryModelKHR" ]
}
]
},
Expand Down Expand Up @@ -4328,6 +4390,11 @@
"enumerant" : "OpenCL",
"value" : 2,
"capabilities" : [ "Kernel" ]
},
{
"enumerant" : "VulkanKHR",
"value" : 3,
"capabilities" : [ "VulkanMemoryModelKHR" ]
}
]
},
Expand Down Expand Up @@ -4659,11 +4726,12 @@
{
"enumerant" : "1D",
"value" : 0,
"capabilities" : [ "Sampled1D" ]
"capabilities" : [ "Sampled1D", "Image1D" ]
},
{
"enumerant" : "2D",
"value" : 1
"value" : 1,
"capabilities" : [ "Shader", "Kernel", "ImageMSArray" ]
},
{
"enumerant" : "3D",
Expand All @@ -4672,17 +4740,17 @@
{
"enumerant" : "Cube",
"value" : 3,
"capabilities" : [ "Shader" ]
"capabilities" : [ "Shader", "ImageCubeArray" ]
},
{
"enumerant" : "Rect",
"value" : 4,
"capabilities" : [ "SampledRect" ]
"capabilities" : [ "SampledRect", "ImageRect" ]
},
{
"enumerant" : "Buffer",
"value" : 5,
"capabilities" : [ "SampledBuffer" ]
"capabilities" : [ "SampledBuffer", "ImageBuffer" ]
},
{
"enumerant" : "SubpassData",
Expand Down Expand Up @@ -6018,6 +6086,11 @@
{
"enumerant" : "Invocation",
"value" : 4
},
{
"enumerant" : "QueueFamilyKHR",
"value" : 5,
"capabilities" : [ "VulkanMemoryModelKHR" ]
}
]
},
Expand Down Expand Up @@ -6746,6 +6819,18 @@
"value" : 5297,
"extensions" : [ "SPV_NV_shader_subgroup_partitioned" ],
"version" : "None"
},
{
"enumerant" : "VulkanMemoryModelKHR",
"value" : 5345,
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
"version" : "None"
},
{
"enumerant" : "VulkanMemoryModelDeviceScopeKHR",
"value" : 5346,
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
"version" : "None"
}
]
},
Expand Down
24 changes: 24 additions & 0 deletions include/spirv/unified1/spirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ typedef enum SpvMemoryModel_ {
SpvMemoryModelSimple = 0,
SpvMemoryModelGLSL450 = 1,
SpvMemoryModelOpenCL = 2,
SpvMemoryModelVulkanKHR = 3,
SpvMemoryModelMax = 0x7fffffff,
} SpvMemoryModel;

Expand Down Expand Up @@ -279,6 +280,10 @@ typedef enum SpvImageOperandsShift_ {
SpvImageOperandsConstOffsetsShift = 5,
SpvImageOperandsSampleShift = 6,
SpvImageOperandsMinLodShift = 7,
SpvImageOperandsMakeTexelAvailableKHRShift = 8,
SpvImageOperandsMakeTexelVisibleKHRShift = 9,
SpvImageOperandsNonPrivateTexelKHRShift = 10,
SpvImageOperandsVolatileTexelKHRShift = 11,
SpvImageOperandsMax = 0x7fffffff,
} SpvImageOperandsShift;

Expand All @@ -292,6 +297,10 @@ typedef enum SpvImageOperandsMask_ {
SpvImageOperandsConstOffsetsMask = 0x00000020,
SpvImageOperandsSampleMask = 0x00000040,
SpvImageOperandsMinLodMask = 0x00000080,
SpvImageOperandsMakeTexelAvailableKHRMask = 0x00000100,
SpvImageOperandsMakeTexelVisibleKHRMask = 0x00000200,
SpvImageOperandsNonPrivateTexelKHRMask = 0x00000400,
SpvImageOperandsVolatileTexelKHRMask = 0x00000800,
} SpvImageOperandsMask;

typedef enum SpvFPFastMathModeShift_ {
Expand Down Expand Up @@ -532,6 +541,9 @@ typedef enum SpvMemorySemanticsShift_ {
SpvMemorySemanticsCrossWorkgroupMemoryShift = 9,
SpvMemorySemanticsAtomicCounterMemoryShift = 10,
SpvMemorySemanticsImageMemoryShift = 11,
SpvMemorySemanticsOutputMemoryKHRShift = 12,
SpvMemorySemanticsMakeAvailableKHRShift = 13,
SpvMemorySemanticsMakeVisibleKHRShift = 14,
SpvMemorySemanticsMax = 0x7fffffff,
} SpvMemorySemanticsShift;

Expand All @@ -547,12 +559,18 @@ typedef enum SpvMemorySemanticsMask_ {
SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400,
SpvMemorySemanticsImageMemoryMask = 0x00000800,
SpvMemorySemanticsOutputMemoryKHRMask = 0x00001000,
SpvMemorySemanticsMakeAvailableKHRMask = 0x00002000,
SpvMemorySemanticsMakeVisibleKHRMask = 0x00004000,
} SpvMemorySemanticsMask;

typedef enum SpvMemoryAccessShift_ {
SpvMemoryAccessVolatileShift = 0,
SpvMemoryAccessAlignedShift = 1,
SpvMemoryAccessNontemporalShift = 2,
SpvMemoryAccessMakePointerAvailableKHRShift = 3,
SpvMemoryAccessMakePointerVisibleKHRShift = 4,
SpvMemoryAccessNonPrivatePointerKHRShift = 5,
SpvMemoryAccessMax = 0x7fffffff,
} SpvMemoryAccessShift;

Expand All @@ -561,6 +579,9 @@ typedef enum SpvMemoryAccessMask_ {
SpvMemoryAccessVolatileMask = 0x00000001,
SpvMemoryAccessAlignedMask = 0x00000002,
SpvMemoryAccessNontemporalMask = 0x00000004,
SpvMemoryAccessMakePointerAvailableKHRMask = 0x00000008,
SpvMemoryAccessMakePointerVisibleKHRMask = 0x00000010,
SpvMemoryAccessNonPrivatePointerKHRMask = 0x00000020,
} SpvMemoryAccessMask;

typedef enum SpvScope_ {
Expand All @@ -569,6 +590,7 @@ typedef enum SpvScope_ {
SpvScopeWorkgroup = 2,
SpvScopeSubgroup = 3,
SpvScopeInvocation = 4,
SpvScopeQueueFamilyKHR = 5,
SpvScopeMax = 0x7fffffff,
} SpvScope;

Expand Down Expand Up @@ -712,6 +734,8 @@ typedef enum SpvCapability_ {
SpvCapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
SpvCapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
SpvCapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
SpvCapabilityVulkanMemoryModelKHR = 5345,
SpvCapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
SpvCapabilitySubgroupShuffleINTEL = 5568,
SpvCapabilitySubgroupBufferBlockIOINTEL = 5569,
SpvCapabilitySubgroupImageBlockIOINTEL = 5570,
Expand Down
24 changes: 24 additions & 0 deletions include/spirv/unified1/spirv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ enum MemoryModel {
MemoryModelSimple = 0,
MemoryModelGLSL450 = 1,
MemoryModelOpenCL = 2,
MemoryModelVulkanKHR = 3,
MemoryModelMax = 0x7fffffff,
};

Expand Down Expand Up @@ -275,6 +276,10 @@ enum ImageOperandsShift {
ImageOperandsConstOffsetsShift = 5,
ImageOperandsSampleShift = 6,
ImageOperandsMinLodShift = 7,
ImageOperandsMakeTexelAvailableKHRShift = 8,
ImageOperandsMakeTexelVisibleKHRShift = 9,
ImageOperandsNonPrivateTexelKHRShift = 10,
ImageOperandsVolatileTexelKHRShift = 11,
ImageOperandsMax = 0x7fffffff,
};

Expand All @@ -288,6 +293,10 @@ enum ImageOperandsMask {
ImageOperandsConstOffsetsMask = 0x00000020,
ImageOperandsSampleMask = 0x00000040,
ImageOperandsMinLodMask = 0x00000080,
ImageOperandsMakeTexelAvailableKHRMask = 0x00000100,
ImageOperandsMakeTexelVisibleKHRMask = 0x00000200,
ImageOperandsNonPrivateTexelKHRMask = 0x00000400,
ImageOperandsVolatileTexelKHRMask = 0x00000800,
};

enum FPFastMathModeShift {
Expand Down Expand Up @@ -528,6 +537,9 @@ enum MemorySemanticsShift {
MemorySemanticsCrossWorkgroupMemoryShift = 9,
MemorySemanticsAtomicCounterMemoryShift = 10,
MemorySemanticsImageMemoryShift = 11,
MemorySemanticsOutputMemoryKHRShift = 12,
MemorySemanticsMakeAvailableKHRShift = 13,
MemorySemanticsMakeVisibleKHRShift = 14,
MemorySemanticsMax = 0x7fffffff,
};

Expand All @@ -543,12 +555,18 @@ enum MemorySemanticsMask {
MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
MemorySemanticsImageMemoryMask = 0x00000800,
MemorySemanticsOutputMemoryKHRMask = 0x00001000,
MemorySemanticsMakeAvailableKHRMask = 0x00002000,
MemorySemanticsMakeVisibleKHRMask = 0x00004000,
};

enum MemoryAccessShift {
MemoryAccessVolatileShift = 0,
MemoryAccessAlignedShift = 1,
MemoryAccessNontemporalShift = 2,
MemoryAccessMakePointerAvailableKHRShift = 3,
MemoryAccessMakePointerVisibleKHRShift = 4,
MemoryAccessNonPrivatePointerKHRShift = 5,
MemoryAccessMax = 0x7fffffff,
};

Expand All @@ -557,6 +575,9 @@ enum MemoryAccessMask {
MemoryAccessVolatileMask = 0x00000001,
MemoryAccessAlignedMask = 0x00000002,
MemoryAccessNontemporalMask = 0x00000004,
MemoryAccessMakePointerAvailableKHRMask = 0x00000008,
MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
};

enum Scope {
Expand All @@ -565,6 +586,7 @@ enum Scope {
ScopeWorkgroup = 2,
ScopeSubgroup = 3,
ScopeInvocation = 4,
ScopeQueueFamilyKHR = 5,
ScopeMax = 0x7fffffff,
};

Expand Down Expand Up @@ -708,6 +730,8 @@ enum Capability {
CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
CapabilityVulkanMemoryModelKHR = 5345,
CapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
CapabilitySubgroupShuffleINTEL = 5568,
CapabilitySubgroupBufferBlockIOINTEL = 5569,
CapabilitySubgroupImageBlockIOINTEL = 5570,
Expand Down
Loading

2 comments on commit dcf23bd

@polyzen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are official releases of the headers revisions available? Perhaps Git tags can be used again? These are needed when packaging releases, otherwise one needs to point to this specific commit.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=spirv-headers#n10
https://github.com/gentoo/gentoo/blob/master/dev-util/spirv-headers/spirv-headers-1.3.4_pre20180917.ebuild#L11

@johnkslang
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a duplicated of #76. I think we can start tagging. Please put further discussion in an issue.

Please sign in to comment.