vulkan: Update all components to Vulkan SDK 1.3.261.1

Updates to volk, vulkan headers, `vk_enum_string_helper.h`, VMA,
glslang, spirv-reflect.

VMA doesn't tag SDK releases specifically, and still hasn't had a tagged
release since 3.0.1, but the Vulkan SDK now seems to ship a recent master
commit, so we do the same.
This commit is contained in:
Rémi Verschelde
2023-09-01 11:11:12 +02:00
parent 549fcce5f8
commit 728dbeab69
125 changed files with 40349 additions and 21884 deletions

View File

@ -55,5 +55,6 @@ static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subg
static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric";
static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_AMD_shader_early_and_late_fragment_tests";
static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch";
static const char* const E_SPV_KHR_cooperative_matrix = "SPV_KHR_cooperative_matrix";
#endif // #ifndef GLSLextKHR_H

View File

@ -13,7 +13,7 @@
**
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

456
thirdparty/glslang/SPIRV/GlslangToSpv.cpp vendored Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -55,7 +55,7 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
SpvOptions* options = nullptr);
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger* logger, SpvOptions* options = nullptr);
void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName);
void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName);
bool OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName);
bool OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName);
}

View File

@ -32,8 +32,6 @@
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#ifndef GLSLANG_WEB
#include "Logger.h"
#include <algorithm>
@ -68,5 +66,3 @@ std::string SpvBuildLogger::getAllMessages() const {
}
} // end spv namespace
#endif

View File

@ -46,14 +46,6 @@ class SpvBuildLogger {
public:
SpvBuildLogger() {}
#ifdef GLSLANG_WEB
void tbdFunctionality(const std::string& f) { }
void missingFunctionality(const std::string& f) { }
void warning(const std::string& w) { }
void error(const std::string& e) { errors.push_back(e); }
std::string getAllMessages() { return ""; }
#else
// Registers a TBD functionality.
void tbdFunctionality(const std::string& f);
// Registers a missing functionality.
@ -67,7 +59,6 @@ public:
// Returns all messages accumulated in the order of:
// TBD functionalities, missing functionalities, warnings, errors.
std::string getAllMessages() const;
#endif
private:
SpvBuildLogger(const SpvBuildLogger&);

View File

@ -1,5 +1,5 @@
// Copyright (c) 2020 The Khronos Group Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
@ -7,15 +7,15 @@
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/
//
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@ -23,7 +23,7 @@
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
//
//
#ifndef SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_
#define SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_

View File

@ -1,19 +1,19 @@
// Copyright (c) 2018 The Khronos Group Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Materials, and to permit persons to whom the
// Materials are furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Materials.
//
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

View File

@ -680,6 +680,7 @@ namespace spv {
case spv::OperandKernelEnqueueFlags:
case spv::OperandKernelProfilingInfo:
case spv::OperandCapability:
case spv::OperandCooperativeMatrixOperands:
++word;
break;

View File

@ -46,10 +46,7 @@
#include <algorithm>
#include "SpvBuilder.h"
#ifndef GLSLANG_WEB
#include "hex_float.h"
#endif
#ifndef _WIN32
#include <cstdio>
@ -283,11 +280,6 @@ Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardP
Id Builder::makeIntegerType(int width, bool hasSign)
{
#ifdef GLSLANG_WEB
assert(width == 32);
width = 32;
#endif
// try to find it
Instruction* type;
for (int t = 0; t < (int)groupedTypes[OpTypeInt].size(); ++t) {
@ -329,11 +321,6 @@ Id Builder::makeIntegerType(int width, bool hasSign)
Id Builder::makeFloatType(int width)
{
#ifdef GLSLANG_WEB
assert(width == 32);
width = 32;
#endif
// try to find it
Instruction* type;
for (int t = 0; t < (int)groupedTypes[OpTypeFloat].size(); ++t) {
@ -481,15 +468,41 @@ Id Builder::makeMatrixType(Id component, int cols, int rows)
return type->getResultId();
}
Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols)
Id Builder::makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use)
{
// try to find it
Instruction* type;
for (int t = 0; t < (int)groupedTypes[OpTypeCooperativeMatrixKHR].size(); ++t) {
type = groupedTypes[OpTypeCooperativeMatrixKHR][t];
if (type->getIdOperand(0) == component &&
type->getIdOperand(1) == scope &&
type->getIdOperand(2) == rows &&
type->getIdOperand(3) == cols &&
type->getIdOperand(4) == use)
return type->getResultId();
}
// not found, make it
type = new Instruction(getUniqueId(), NoType, OpTypeCooperativeMatrixKHR);
type->addIdOperand(component);
type->addIdOperand(scope);
type->addIdOperand(rows);
type->addIdOperand(cols);
type->addIdOperand(use);
groupedTypes[OpTypeCooperativeMatrixKHR].push_back(type);
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
return type->getResultId();
}
Id Builder::makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols)
{
// try to find it
Instruction* type;
for (int t = 0; t < (int)groupedTypes[OpTypeCooperativeMatrixNV].size(); ++t) {
type = groupedTypes[OpTypeCooperativeMatrixNV][t];
if (type->getIdOperand(0) == component &&
type->getIdOperand(1) == scope &&
type->getIdOperand(2) == rows &&
if (type->getIdOperand(0) == component && type->getIdOperand(1) == scope && type->getIdOperand(2) == rows &&
type->getIdOperand(3) == cols)
return type->getResultId();
}
@ -507,6 +520,17 @@ Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols)
return type->getResultId();
}
Id Builder::makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType)
{
Instruction* instr = module.getInstruction(otherType);
if (instr->getOpCode() == OpTypeCooperativeMatrixNV) {
return makeCooperativeMatrixTypeNV(component, instr->getIdOperand(1), instr->getIdOperand(2), instr->getIdOperand(3));
} else {
assert(instr->getOpCode() == OpTypeCooperativeMatrixKHR);
return makeCooperativeMatrixTypeKHR(component, instr->getIdOperand(1), instr->getIdOperand(2), instr->getIdOperand(3), instr->getIdOperand(4));
}
}
Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands)
{
// try to find it
@ -696,7 +720,6 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
#ifndef GLSLANG_WEB
// deal with capabilities
switch (dim) {
case DimBuffer:
@ -742,7 +765,6 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
addCapability(CapabilityImageMSArray);
}
}
#endif
if (emitNonSemanticShaderDebugInfo)
{
@ -934,7 +956,7 @@ Id Builder::makeArrayDebugType(Id const baseType, Id const componentCount)
Id Builder::makeVectorDebugType(Id const baseType, int const componentCount)
{
return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfo100DebugTypeVector);;
return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfo100DebugTypeVector);
}
Id Builder::makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor)
@ -1159,7 +1181,6 @@ Id Builder::makeDebugDeclare(Id const debugLocalVariable, Id const localVariable
return inst->getResultId();
}
#ifndef GLSLANG_WEB
Id Builder::makeAccelerationStructureType()
{
Instruction *type;
@ -1204,7 +1225,6 @@ Id Builder::makeHitObjectNVType()
return type->getResultId();
}
#endif
Id Builder::getDerefTypeId(Id resultId) const
{
@ -1254,6 +1274,7 @@ int Builder::getNumTypeConstituents(Id typeId) const
}
case OpTypeStruct:
return instr->getNumOperands();
case OpTypeCooperativeMatrixKHR:
case OpTypeCooperativeMatrixNV:
// has only one constituent when used with OpCompositeConstruct.
return 1;
@ -1303,6 +1324,7 @@ Id Builder::getContainedTypeId(Id typeId, int member) const
case OpTypeMatrix:
case OpTypeArray:
case OpTypeRuntimeArray:
case OpTypeCooperativeMatrixKHR:
case OpTypeCooperativeMatrixNV:
return instr->getIdOperand(0);
case OpTypePointer:
@ -1373,7 +1395,7 @@ bool Builder::containsType(Id typeId, spv::Op typeOp, unsigned int width) const
}
// return true if the type is a pointer to PhysicalStorageBufferEXT or an
// array of such pointers. These require restrict/aliased decorations.
// contains such a pointer. These require restrict/aliased decorations.
bool Builder::containsPhysicalStorageBufferOrArray(Id typeId) const
{
const Instruction& instr = *module.getInstruction(typeId);
@ -1385,6 +1407,12 @@ bool Builder::containsPhysicalStorageBufferOrArray(Id typeId) const
return getTypeStorageClass(typeId) == StorageClassPhysicalStorageBufferEXT;
case OpTypeArray:
return containsPhysicalStorageBufferOrArray(getContainedTypeId(typeId));
case OpTypeStruct:
for (int m = 0; m < instr.getNumOperands(); ++m) {
if (containsPhysicalStorageBufferOrArray(instr.getIdOperand(m)))
return true;
}
return false;
default:
return false;
}
@ -1598,10 +1626,6 @@ Id Builder::makeFloatConstant(float f, bool specConstant)
Id Builder::makeDoubleConstant(double d, bool specConstant)
{
#ifdef GLSLANG_WEB
assert(0);
return NoResult;
#else
Op opcode = specConstant ? OpSpecConstant : OpConstant;
Id typeId = makeFloatType(64);
union { double db; unsigned long long ull; } u;
@ -1626,15 +1650,10 @@ Id Builder::makeDoubleConstant(double d, bool specConstant)
module.mapInstruction(c);
return c->getResultId();
#endif
}
Id Builder::makeFloat16Constant(float f16, bool specConstant)
{
#ifdef GLSLANG_WEB
assert(0);
return NoResult;
#else
Op opcode = specConstant ? OpSpecConstant : OpConstant;
Id typeId = makeFloatType(16);
@ -1659,17 +1678,11 @@ Id Builder::makeFloat16Constant(float f16, bool specConstant)
module.mapInstruction(c);
return c->getResultId();
#endif
}
Id Builder::makeFpConstant(Id type, double d, bool specConstant)
{
#ifdef GLSLANG_WEB
const int width = 32;
assert(width == getScalarTypeWidth(type));
#else
const int width = getScalarTypeWidth(type);
#endif
assert(isFloatType(type));
@ -1763,6 +1776,7 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector<Id>& members, boo
case OpTypeVector:
case OpTypeArray:
case OpTypeMatrix:
case OpTypeCooperativeMatrixKHR:
case OpTypeCooperativeMatrixNV:
if (! specConstant) {
Id existing = findCompositeConstant(typeClass, typeId, members);
@ -2103,7 +2117,8 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const
return function;
}
Id Builder::makeDebugFunction(Function* function, Id nameId, Id funcTypeId) {
Id Builder::makeDebugFunction([[maybe_unused]] Function* function, Id nameId, Id funcTypeId)
{
assert(function != nullptr);
assert(nameId != 0);
assert(funcTypeId != 0);
@ -2398,7 +2413,24 @@ Id Builder::createArrayLength(Id base, unsigned int member)
return length->getResultId();
}
Id Builder::createCooperativeMatrixLength(Id type)
Id Builder::createCooperativeMatrixLengthKHR(Id type)
{
spv::Id intType = makeUintType(32);
// Generate code for spec constants if in spec constant operation
// generation mode.
if (generatingOpCodeForSpecConst) {
return createSpecConstantOp(OpCooperativeMatrixLengthKHR, intType, std::vector<Id>(1, type), std::vector<Id>());
}
Instruction* length = new Instruction(getUniqueId(), intType, OpCooperativeMatrixLengthKHR);
length->addIdOperand(type);
buildPoint->addInstruction(std::unique_ptr<Instruction>(length));
return length->getResultId();
}
Id Builder::createCooperativeMatrixLengthNV(Id type)
{
spv::Id intType = makeUintType(32);
@ -2782,12 +2814,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
if (parameters.component != NoResult)
texArgs.push_back(parameters.component);
#ifndef GLSLANG_WEB
if (parameters.granularity != NoResult)
texArgs.push_back(parameters.granularity);
if (parameters.coarse != NoResult)
texArgs.push_back(parameters.coarse);
#endif
//
// Set up the optional arguments
@ -2828,7 +2858,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask);
texArgs.push_back(parameters.offsets);
}
#ifndef GLSLANG_WEB
if (parameters.sample) {
mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask);
texArgs.push_back(parameters.sample);
@ -2846,7 +2875,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
if (parameters.volatil) {
mask = mask | ImageOperandsVolatileTexelKHRMask;
}
#endif
mask = mask | signExtensionMask;
// insert the operand for the mask, if any bits were set.
if (mask != ImageOperandsMaskNone)
@ -2861,7 +2889,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
opCode = OpImageSparseFetch;
else
opCode = OpImageFetch;
#ifndef GLSLANG_WEB
} else if (parameters.granularity && parameters.coarse) {
opCode = OpImageSampleFootprintNV;
} else if (gather) {
@ -2875,7 +2902,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
opCode = OpImageSparseGather;
else
opCode = OpImageGather;
#endif
} else if (explicitLod) {
if (parameters.Dref) {
if (proj)
@ -3238,12 +3264,7 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
int numRows = getTypeNumRows(resultTypeId);
Instruction* instr = module.getInstruction(componentTypeId);
#ifdef GLSLANG_WEB
const unsigned bitCount = 32;
assert(bitCount == instr->getImmediateOperand(0));
#else
const unsigned bitCount = instr->getImmediateOperand(0);
#endif
// Optimize matrix constructed from a bigger matrix
if (isMatrix(sources[0]) && getNumColumns(sources[0]) >= numCols && getNumRows(sources[0]) >= numRows) {
@ -4064,4 +4085,4 @@ void Builder::dumpModuleProcesses(std::vector<unsigned int>& out) const
}
}
}; // end spv namespace
} // end spv namespace

View File

@ -103,7 +103,7 @@ public:
stringIds[file_c_str] = strId;
return strId;
}
spv::Id getSourceFile() const
spv::Id getSourceFile() const
{
return sourceFileStringId;
}
@ -203,7 +203,9 @@ public:
Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format);
Id makeSamplerType();
Id makeSampledImageType(Id imageType);
Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols);
Id makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use);
Id makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols);
Id makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType);
Id makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands);
// SPIR-V NonSemantic Shader DebugInfo Instructions
@ -283,11 +285,10 @@ public:
bool isMatrixType(Id typeId) const { return getTypeClass(typeId) == OpTypeMatrix; }
bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; }
bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; }
#ifdef GLSLANG_WEB
bool isCooperativeMatrixType(Id typeId)const { return false; }
#else
bool isCooperativeMatrixType(Id typeId)const { return getTypeClass(typeId) == OpTypeCooperativeMatrixNV; }
#endif
bool isCooperativeMatrixType(Id typeId)const
{
return getTypeClass(typeId) == OpTypeCooperativeMatrixKHR || getTypeClass(typeId) == OpTypeCooperativeMatrixNV;
}
bool isAggregateType(Id typeId) const
{ return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; }
@ -464,8 +465,10 @@ public:
// Create an OpArrayLength instruction
Id createArrayLength(Id base, unsigned int member);
// Create an OpCooperativeMatrixLengthKHR instruction
Id createCooperativeMatrixLengthKHR(Id type);
// Create an OpCooperativeMatrixLengthNV instruction
Id createCooperativeMatrixLength(Id type);
Id createCooperativeMatrixLengthNV(Id type);
// Create an OpCompositeExtract instruction
Id createCompositeExtract(Id composite, Id typeId, unsigned index);
@ -700,11 +703,6 @@ public:
// Accumulate whether anything in the chain of structures has coherent decorations.
struct CoherentFlags {
CoherentFlags() { clear(); }
#ifdef GLSLANG_WEB
void clear() { }
bool isVolatile() const { return false; }
CoherentFlags operator |=(const CoherentFlags &other) { return *this; }
#else
bool isVolatile() const { return volatil; }
bool isNonUniform() const { return nonUniform; }
bool anyCoherent() const {
@ -749,7 +747,6 @@ public:
nonUniform |= other.nonUniform;
return *this;
}
#endif
};
CoherentFlags coherentFlags;
};
@ -835,14 +832,12 @@ public:
// Prune unreachable blocks in the CFG and remove unneeded decorations.
void postProcessCFG();
#ifndef GLSLANG_WEB
// Add capabilities, extensions based on instructions in the module.
void postProcessFeatures();
// Hook to visit each instruction in a block in a function
void postProcess(Instruction&);
// Hook to visit each non-32-bit sized float/int operation in a block.
void postProcessType(const Instruction&, spv::Id typeId);
#endif
void dump(std::vector<unsigned int>&) const;

View File

@ -57,7 +57,6 @@ namespace spv {
namespace spv {
#ifndef GLSLANG_WEB
// Hook to visit each operand type and result type of an instruction.
// Will be called multiple times for one instruction, once for each typed
// operand and the result.
@ -334,7 +333,6 @@ void Builder::postProcess(Instruction& inst)
}
}
}
#endif
// comment in header
void Builder::postProcessCFG()
@ -395,7 +393,6 @@ void Builder::postProcessCFG()
decorations.end());
}
#ifndef GLSLANG_WEB
// comment in header
void Builder::postProcessFeatures() {
// Add per-instruction capabilities, extensions, etc.,
@ -483,14 +480,11 @@ void Builder::postProcessFeatures() {
}
}
}
#endif
// comment in header
void Builder::postProcess() {
postProcessCFG();
#ifndef GLSLANG_WEB
postProcessFeatures();
#endif
}
}; // end spv namespace

View File

@ -515,7 +515,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
} else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 ||
strcmp(spv::E_SPV_NV_geometry_shader_passthrough, name) == 0 ||
strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 ||
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 ||
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 ||
strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 ||
strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) {
extInstSet = GLSLextNVInst;

3143
thirdparty/glslang/SPIRV/doc.cpp vendored Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -156,6 +156,7 @@ enum OperandClass {
OperandKernelEnqueueFlags,
OperandKernelProfilingInfo,
OperandCapability,
OperandCooperativeMatrixOperands,
OperandOpcode,
@ -197,7 +198,7 @@ public:
// Parameterize a set of enumerants that form an enum
class EnumDefinition : public EnumParameters {
public:
EnumDefinition() :
EnumDefinition() :
ceiling(0), bitmask(false), getName(nullptr), enumParams(nullptr), operandParams(nullptr) { }
void set(int ceil, const char* (*name)(int), EnumParameters* ep, bool mask = false)
{

View File

@ -1,19 +1,19 @@
// Copyright (c) 2014-2020 The Khronos Group Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Materials, and to permit persons to whom the
// Materials are furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Materials.
//
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@ -27,7 +27,7 @@
// Enumeration tokens for SPIR-V, in various styles:
// C, C++, C++11, JSON, Lua, Python, C#, D, Beef
//
//
// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
@ -38,7 +38,7 @@
// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
// e.g.: Spv.Specification.SourceLanguage.GLSL
//
//
// Some tokens act like mask values, which can be OR'd together,
// while others are mutually exclusive. The mask-like ones have
// "Mask" in their name, and a parallel enum that has the shift
@ -1144,6 +1144,7 @@ enum Capability {
CapabilityDotProduct = 6019,
CapabilityDotProductKHR = 6019,
CapabilityRayCullMaskKHR = 6020,
CapabilityCooperativeMatrixKHR = 6022,
CapabilityBitInstructions = 6025,
CapabilityGroupNonUniformRotateKHR = 6026,
CapabilityAtomicFloat32AddEXT = 6033,
@ -1261,6 +1262,37 @@ enum PackedVectorFormat {
PackedVectorFormatMax = 0x7fffffff,
};
enum CooperativeMatrixOperandsShift {
CooperativeMatrixOperandsMatrixASignedComponentsShift = 0,
CooperativeMatrixOperandsMatrixBSignedComponentsShift = 1,
CooperativeMatrixOperandsMatrixCSignedComponentsShift = 2,
CooperativeMatrixOperandsMatrixResultSignedComponentsShift = 3,
CooperativeMatrixOperandsSaturatingAccumulationShift = 4,
CooperativeMatrixOperandsMax = 0x7fffffff,
};
enum CooperativeMatrixOperandsMask {
CooperativeMatrixOperandsMaskNone = 0,
CooperativeMatrixOperandsMatrixASignedComponentsMask = 0x00000001,
CooperativeMatrixOperandsMatrixBSignedComponentsMask = 0x00000002,
CooperativeMatrixOperandsMatrixCSignedComponentsMask = 0x00000004,
CooperativeMatrixOperandsMatrixResultSignedComponentsMask = 0x00000008,
CooperativeMatrixOperandsSaturatingAccumulationMask = 0x00000010,
};
enum CooperativeMatrixLayout {
CooperativeMatrixLayoutCooperativeMatrixRowMajorKHR = 0,
CooperativeMatrixLayoutCooperativeMatrixColumnMajorKHR = 1,
CooperativeMatrixLayoutMax = 0x7fffffff,
};
enum CooperativeMatrixUse {
CooperativeMatrixUseMatrixAKHR = 0,
CooperativeMatrixUseMatrixBKHR = 1,
CooperativeMatrixUseMatrixAccumulatorKHR = 2,
CooperativeMatrixUseMax = 0x7fffffff,
};
enum Op {
OpNop = 0,
OpUndef = 1,
@ -1634,6 +1666,11 @@ enum Op {
OpUDotAccSatKHR = 4454,
OpSUDotAccSat = 4455,
OpSUDotAccSatKHR = 4455,
OpTypeCooperativeMatrixKHR = 4456,
OpCooperativeMatrixLoadKHR = 4457,
OpCooperativeMatrixStoreKHR = 4458,
OpCooperativeMatrixMulAddKHR = 4459,
OpCooperativeMatrixLengthKHR = 4460,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
@ -2346,6 +2383,11 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break;
case OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break;
case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break;
case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break;
case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break;
case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@ -2722,6 +2764,10 @@ inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShad
inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); }
inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); }
inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); }
inline CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); }
inline CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); }
inline CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); }
inline CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); }
} // end namespace spv

View File

@ -97,6 +97,8 @@ public:
explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
virtual ~Instruction() {}
void addIdOperand(Id id) {
// ids can't be 0
assert(id);
operands.push_back(id);
idOperand.push_back(true);
}
@ -386,7 +388,7 @@ public:
if (lineInstruction != nullptr) {
lineInstruction->dump(out);
}
// OpFunction
functionInstruction.dump(out);