GL_ARM_shader_core_builtins support
Add support for GL_ARM_shader_core_builtins and SPV_ARM_core_builtins, including initial tests
This commit is contained in:
parent
a7603c132d
commit
0464ff4515
18 changed files with 335 additions and 0 deletions
|
|
@ -62,6 +62,7 @@ set(HEADERS
|
|||
disassemble.h
|
||||
GLSL.ext.AMD.h
|
||||
GLSL.ext.NV.h
|
||||
GLSL.ext.ARM.h
|
||||
NonSemanticDebugPrintf.h
|
||||
NonSemanticShaderDebugInfo100.h)
|
||||
|
||||
|
|
|
|||
35
SPIRV/GLSL.ext.ARM.h
Normal file
35
SPIRV/GLSL.ext.ARM.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
** Copyright (c) 2022 ARM Limited
|
||||
**
|
||||
** 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/
|
||||
**
|
||||
** 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
|
||||
** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 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 GLSLextARM_H
|
||||
#define GLSLextARM_H
|
||||
|
||||
static const int GLSLextARMVersion = 100;
|
||||
static const int GLSLextARMRevision = 1;
|
||||
|
||||
static const char * const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins";
|
||||
|
||||
#endif // #ifndef GLSLextARM_H
|
||||
|
|
@ -49,6 +49,7 @@ namespace spv {
|
|||
#include "GLSL.ext.EXT.h"
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#include "GLSL.ext.NV.h"
|
||||
#include "GLSL.ext.ARM.h"
|
||||
#include "NonSemanticDebugPrintf.h"
|
||||
}
|
||||
|
||||
|
|
@ -1106,6 +1107,28 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
|||
builder.addExtension(spv::E_SPV_NV_shader_sm_builtins);
|
||||
builder.addCapability(spv::CapabilityShaderSMBuiltinsNV);
|
||||
return spv::BuiltInSMIDNV;
|
||||
|
||||
// ARM builtins
|
||||
case glslang::EbvCoreCountARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInCoreCountARM;
|
||||
case glslang::EbvCoreIDARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInCoreIDARM;
|
||||
case glslang::EbvCoreMaxIDARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInCoreMaxIDARM;
|
||||
case glslang::EbvWarpIDARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInWarpIDARM;
|
||||
case glslang::EbvWarpMaxIDARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInWarpMaxIDARM;
|
||||
#endif
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ namespace spv {
|
|||
#include "GLSL.ext.EXT.h"
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#include "GLSL.ext.NV.h"
|
||||
#include "GLSL.ext.ARM.h"
|
||||
}
|
||||
|
||||
namespace spv {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ namespace spv {
|
|||
#include "GLSL.std.450.h"
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#include "GLSL.ext.NV.h"
|
||||
#include "GLSL.ext.ARM.h"
|
||||
}
|
||||
}
|
||||
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ namespace spv {
|
|||
#include "GLSL.ext.EXT.h"
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#include "GLSL.ext.NV.h"
|
||||
#include "GLSL.ext.ARM.h"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -439,6 +440,11 @@ const char* BuiltInString(int builtIn)
|
|||
case BuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT";
|
||||
case BuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT";
|
||||
case BuiltInCullPrimitiveEXT: return "CullPrimitiveEXT";
|
||||
case BuiltInCoreCountARM: return "CoreCountARM";
|
||||
case BuiltInCoreIDARM: return "CoreIDARM";
|
||||
case BuiltInCoreMaxIDARM: return "CoreMaxIDARM";
|
||||
case BuiltInWarpIDARM: return "WarpIDARM";
|
||||
case BuiltInWarpMaxIDARM: return "BuiltInWarpMaxIDARM";
|
||||
|
||||
default: return "Bad";
|
||||
}
|
||||
|
|
@ -998,6 +1004,7 @@ const char* CapabilityString(int info)
|
|||
case CapabilityWorkgroupMemoryExplicitLayoutKHR: return "CapabilityWorkgroupMemoryExplicitLayoutKHR";
|
||||
case CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR";
|
||||
case CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR";
|
||||
case CapabilityCoreBuiltinsARM: return "CoreBuiltinsARM";
|
||||
|
||||
default: return "Bad";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -607,6 +607,11 @@ enum BuiltIn {
|
|||
BuiltInSubgroupLocalInvocationId = 41,
|
||||
BuiltInVertexIndex = 42,
|
||||
BuiltInInstanceIndex = 43,
|
||||
BuiltInCoreCountARM = 4161,
|
||||
BuiltInCoreIDARM = 4160,
|
||||
BuiltInCoreMaxIDARM = 4162,
|
||||
BuiltInWarpIDARM = 4163,
|
||||
BuiltInWarpMaxIDARM = 4164,
|
||||
BuiltInSubgroupEqMask = 4416,
|
||||
BuiltInSubgroupEqMaskKHR = 4416,
|
||||
BuiltInSubgroupGeMask = 4417,
|
||||
|
|
@ -946,6 +951,7 @@ enum Capability {
|
|||
CapabilityShaderLayer = 69,
|
||||
CapabilityShaderViewportIndex = 70,
|
||||
CapabilityUniformDecoration = 71,
|
||||
CapabilityCoreBuiltinsARM = 4165,
|
||||
CapabilityFragmentShadingRateKHR = 4422,
|
||||
CapabilitySubgroupBallotKHR = 4423,
|
||||
CapabilityDrawParameters = 4427,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue