Merge pull request #36932 from akien-mga/vulkan-sdk-1.2.131.2
Update Vulkan SDK to 1.2.131.2 and matching glslang version
This commit is contained in:
commit
18dae8409c
23
thirdparty/README.md
vendored
23
thirdparty/README.md
vendored
@ -162,11 +162,21 @@ the GLES version Godot targets.
|
|||||||
## glslang
|
## glslang
|
||||||
|
|
||||||
- Upstream: https://github.com/KhronosGroup/glslang
|
- Upstream: https://github.com/KhronosGroup/glslang
|
||||||
- Version: rev.3226
|
- Version: git (4fc7a33910fb8e40b970d160e1b38ab3f67fe0f3, 2020)
|
||||||
- License: glslang
|
- License: glslang
|
||||||
|
|
||||||
Important: File `glslang/glslang/Include/Common.h` has
|
Version should be kept in sync with the one of the used Vulkan SDK (see `vulkan`
|
||||||
Godot-made change marked with `// -- GODOT --` comments.
|
section). Check Vulkan-ValidationLayers at the matching SDK tag for the known
|
||||||
|
good glslang commit: https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/scripts/known_good.json
|
||||||
|
|
||||||
|
Files extracted from upstream source:
|
||||||
|
|
||||||
|
- `glslang`, `OGLCompilersDLL`, `SPIRV`
|
||||||
|
- `LICENSE.txt`
|
||||||
|
- Unnecessary files like `CMakeLists.txt`, `revision.template` and
|
||||||
|
`updateGrammar` removed.
|
||||||
|
|
||||||
|
Patches in the `patches` directory should be re-applied after updates.
|
||||||
|
|
||||||
|
|
||||||
## jpeg-compressor
|
## jpeg-compressor
|
||||||
@ -539,7 +549,7 @@ folder.
|
|||||||
## vulkan
|
## vulkan
|
||||||
|
|
||||||
- Upstream: https://github.com/KhronosGroup/Vulkan-Loader
|
- Upstream: https://github.com/KhronosGroup/Vulkan-Loader
|
||||||
- Version: 1.1.127
|
- Version: sdk-1.2.131.2
|
||||||
- License: Apache 2.0
|
- License: Apache 2.0
|
||||||
|
|
||||||
Unless there is a specific reason to package a more recent version, please stick
|
Unless there is a specific reason to package a more recent version, please stick
|
||||||
@ -555,10 +565,11 @@ Files extracted from upstream source:
|
|||||||
`loader/` folder
|
`loader/` folder
|
||||||
- `LICENSE.txt`
|
- `LICENSE.txt`
|
||||||
|
|
||||||
`vk_enum_string_helper.h` is taken from the match `Vulkan-ValidationLayers` SDK
|
`vk_enum_string_helper.h` is taken from the matching `Vulkan-ValidationLayers`
|
||||||
release: https://github.com/KhronosGroup/Vulkan-Loader/tree/master/loader/generated
|
SDK release: https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/layers/generated/vk_enum_string_helper.h
|
||||||
|
|
||||||
`vk_mem_alloc.h` is taken from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
|
`vk_mem_alloc.h` is taken from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
|
||||||
|
Version: 2.3.0
|
||||||
|
|
||||||
|
|
||||||
## wslay
|
## wslay
|
||||||
|
1
thirdparty/glslang/SPIRV/GLSL.ext.EXT.h
vendored
1
thirdparty/glslang/SPIRV/GLSL.ext.EXT.h
vendored
@ -34,5 +34,6 @@ static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shade
|
|||||||
static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer";
|
static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer";
|
||||||
static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered";
|
static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered";
|
||||||
static const char* const E_SPV_EXT_fragment_invocation_density = "SPV_EXT_fragment_invocation_density";
|
static const char* const E_SPV_EXT_fragment_invocation_density = "SPV_EXT_fragment_invocation_density";
|
||||||
|
static const char* const E_SPV_EXT_demote_to_helper_invocation = "SPV_EXT_demote_to_helper_invocation";
|
||||||
|
|
||||||
#endif // #ifndef GLSLextEXT_H
|
#endif // #ifndef GLSLextEXT_H
|
||||||
|
3
thirdparty/glslang/SPIRV/GLSL.ext.KHR.h
vendored
3
thirdparty/glslang/SPIRV/GLSL.ext.KHR.h
vendored
@ -41,5 +41,8 @@ static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_stora
|
|||||||
static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage";
|
static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage";
|
||||||
static const char* const E_SPV_KHR_vulkan_memory_model = "SPV_KHR_vulkan_memory_model";
|
static const char* const E_SPV_KHR_vulkan_memory_model = "SPV_KHR_vulkan_memory_model";
|
||||||
static const char* const E_SPV_EXT_physical_storage_buffer = "SPV_EXT_physical_storage_buffer";
|
static const char* const E_SPV_EXT_physical_storage_buffer = "SPV_EXT_physical_storage_buffer";
|
||||||
|
static const char* const E_SPV_KHR_physical_storage_buffer = "SPV_KHR_physical_storage_buffer";
|
||||||
|
static const char* const E_SPV_EXT_fragment_shader_interlock = "SPV_EXT_fragment_shader_interlock";
|
||||||
|
static const char* const E_SPV_KHR_shader_clock = "SPV_KHR_shader_clock";
|
||||||
|
|
||||||
#endif // #ifndef GLSLextKHR_H
|
#endif // #ifndef GLSLextKHR_H
|
||||||
|
3
thirdparty/glslang/SPIRV/GLSL.ext.NV.h
vendored
3
thirdparty/glslang/SPIRV/GLSL.ext.NV.h
vendored
@ -75,4 +75,7 @@ const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate";
|
|||||||
//SPV_NV_cooperative_matrix
|
//SPV_NV_cooperative_matrix
|
||||||
const char* const E_SPV_NV_cooperative_matrix = "SPV_NV_cooperative_matrix";
|
const char* const E_SPV_NV_cooperative_matrix = "SPV_NV_cooperative_matrix";
|
||||||
|
|
||||||
|
//SPV_NV_shader_sm_builtins
|
||||||
|
const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins";
|
||||||
|
|
||||||
#endif // #ifndef GLSLextNV_H
|
#endif // #ifndef GLSLextNV_H
|
||||||
|
1655
thirdparty/glslang/SPIRV/GlslangToSpv.cpp
vendored
Normal file → Executable file
1655
thirdparty/glslang/SPIRV/GlslangToSpv.cpp
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
2
thirdparty/glslang/SPIRV/GlslangToSpv.h
vendored
Normal file → Executable file
2
thirdparty/glslang/SPIRV/GlslangToSpv.h
vendored
Normal file → Executable file
@ -40,7 +40,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "SpvTools.h"
|
#include "SpvTools.h"
|
||||||
#include "../glslang/Include/intermediate.h"
|
#include "glslang/Include/intermediate.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
42
thirdparty/glslang/SPIRV/InReadableOrder.cpp
vendored
42
thirdparty/glslang/SPIRV/InReadableOrder.cpp
vendored
@ -61,17 +61,22 @@ namespace {
|
|||||||
// Use by calling visit() on the root block.
|
// Use by calling visit() on the root block.
|
||||||
class ReadableOrderTraverser {
|
class ReadableOrderTraverser {
|
||||||
public:
|
public:
|
||||||
explicit ReadableOrderTraverser(std::function<void(Block*)> callback) : callback_(callback) {}
|
ReadableOrderTraverser(std::function<void(Block*, spv::ReachReason, Block*)> callback)
|
||||||
|
: callback_(callback) {}
|
||||||
// Visits the block if it hasn't been visited already and isn't currently
|
// Visits the block if it hasn't been visited already and isn't currently
|
||||||
// being delayed. Invokes callback(block), then descends into its
|
// being delayed. Invokes callback(block, why, header), then descends into its
|
||||||
// successors. Delays merge-block and continue-block processing until all
|
// successors. Delays merge-block and continue-block processing until all
|
||||||
// the branches have been completed.
|
// the branches have been completed. If |block| is an unreachable merge block or
|
||||||
void visit(Block* block)
|
// an unreachable continue target, then |header| is the corresponding header block.
|
||||||
|
void visit(Block* block, spv::ReachReason why, Block* header)
|
||||||
{
|
{
|
||||||
assert(block);
|
assert(block);
|
||||||
|
if (why == spv::ReachViaControlFlow) {
|
||||||
|
reachableViaControlFlow_.insert(block);
|
||||||
|
}
|
||||||
if (visited_.count(block) || delayed_.count(block))
|
if (visited_.count(block) || delayed_.count(block))
|
||||||
return;
|
return;
|
||||||
callback_(block);
|
callback_(block, why, header);
|
||||||
visited_.insert(block);
|
visited_.insert(block);
|
||||||
Block* mergeBlock = nullptr;
|
Block* mergeBlock = nullptr;
|
||||||
Block* continueBlock = nullptr;
|
Block* continueBlock = nullptr;
|
||||||
@ -87,27 +92,40 @@ public:
|
|||||||
delayed_.insert(continueBlock);
|
delayed_.insert(continueBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto successors = block->getSuccessors();
|
if (why == spv::ReachViaControlFlow) {
|
||||||
|
const auto& successors = block->getSuccessors();
|
||||||
for (auto it = successors.cbegin(); it != successors.cend(); ++it)
|
for (auto it = successors.cbegin(); it != successors.cend(); ++it)
|
||||||
visit(*it);
|
visit(*it, why, nullptr);
|
||||||
|
}
|
||||||
if (continueBlock) {
|
if (continueBlock) {
|
||||||
|
const spv::ReachReason continueWhy =
|
||||||
|
(reachableViaControlFlow_.count(continueBlock) > 0)
|
||||||
|
? spv::ReachViaControlFlow
|
||||||
|
: spv::ReachDeadContinue;
|
||||||
delayed_.erase(continueBlock);
|
delayed_.erase(continueBlock);
|
||||||
visit(continueBlock);
|
visit(continueBlock, continueWhy, block);
|
||||||
}
|
}
|
||||||
if (mergeBlock) {
|
if (mergeBlock) {
|
||||||
|
const spv::ReachReason mergeWhy =
|
||||||
|
(reachableViaControlFlow_.count(mergeBlock) > 0)
|
||||||
|
? spv::ReachViaControlFlow
|
||||||
|
: spv::ReachDeadMerge;
|
||||||
delayed_.erase(mergeBlock);
|
delayed_.erase(mergeBlock);
|
||||||
visit(mergeBlock);
|
visit(mergeBlock, mergeWhy, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::function<void(Block*)> callback_;
|
std::function<void(Block*, spv::ReachReason, Block*)> callback_;
|
||||||
// Whether a block has already been visited or is being delayed.
|
// Whether a block has already been visited or is being delayed.
|
||||||
std::unordered_set<Block *> visited_, delayed_;
|
std::unordered_set<Block *> visited_, delayed_;
|
||||||
|
|
||||||
|
// The set of blocks that actually are reached via control flow.
|
||||||
|
std::unordered_set<Block *> reachableViaControlFlow_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void spv::inReadableOrder(Block* root, std::function<void(Block*)> callback)
|
void spv::inReadableOrder(Block* root, std::function<void(Block*, spv::ReachReason, Block*)> callback)
|
||||||
{
|
{
|
||||||
ReadableOrderTraverser(callback).visit(root);
|
ReadableOrderTraverser(callback).visit(root, spv::ReachViaControlFlow, nullptr);
|
||||||
}
|
}
|
||||||
|
4
thirdparty/glslang/SPIRV/Logger.cpp
vendored
4
thirdparty/glslang/SPIRV/Logger.cpp
vendored
@ -32,6 +32,8 @@
|
|||||||
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
// POSSIBILITY OF SUCH DAMAGE.
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -66,3 +68,5 @@ std::string SpvBuildLogger::getAllMessages() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // end spv namespace
|
} // end spv namespace
|
||||||
|
|
||||||
|
#endif
|
9
thirdparty/glslang/SPIRV/Logger.h
vendored
9
thirdparty/glslang/SPIRV/Logger.h
vendored
@ -46,6 +46,14 @@ class SpvBuildLogger {
|
|||||||
public:
|
public:
|
||||||
SpvBuildLogger() {}
|
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.
|
// Registers a TBD functionality.
|
||||||
void tbdFunctionality(const std::string& f);
|
void tbdFunctionality(const std::string& f);
|
||||||
// Registers a missing functionality.
|
// Registers a missing functionality.
|
||||||
@ -59,6 +67,7 @@ public:
|
|||||||
// Returns all messages accumulated in the order of:
|
// Returns all messages accumulated in the order of:
|
||||||
// TBD functionalities, missing functionalities, warnings, errors.
|
// TBD functionalities, missing functionalities, warnings, errors.
|
||||||
std::string getAllMessages() const;
|
std::string getAllMessages() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SpvBuildLogger(const SpvBuildLogger&);
|
SpvBuildLogger(const SpvBuildLogger&);
|
||||||
|
2
thirdparty/glslang/SPIRV/SPVRemapper.h
vendored
2
thirdparty/glslang/SPIRV/SPVRemapper.h
vendored
@ -195,7 +195,7 @@ private:
|
|||||||
// Header access & set methods
|
// Header access & set methods
|
||||||
spirword_t magic() const { return spv[0]; } // return magic number
|
spirword_t magic() const { return spv[0]; } // return magic number
|
||||||
spirword_t bound() const { return spv[3]; } // return Id bound from header
|
spirword_t bound() const { return spv[3]; } // return Id bound from header
|
||||||
spirword_t bound(spirword_t b) { return spv[3] = b; };
|
spirword_t bound(spirword_t b) { return spv[3] = b; }
|
||||||
spirword_t genmagic() const { return spv[2]; } // generator magic
|
spirword_t genmagic() const { return spv[2]; } // generator magic
|
||||||
spirword_t genmagic(spirword_t m) { return spv[2] = m; }
|
spirword_t genmagic(spirword_t m) { return spv[2] = m; }
|
||||||
spirword_t schemaNum() const { return spv[4]; } // schema number from header
|
spirword_t schemaNum() const { return spv[4]; } // schema number from header
|
||||||
|
56
thirdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
56
thirdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
@ -46,7 +46,9 @@
|
|||||||
|
|
||||||
#include "SpvBuilder.h"
|
#include "SpvBuilder.h"
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
#include "hex_float.h"
|
#include "hex_float.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@ -230,6 +232,11 @@ Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardP
|
|||||||
|
|
||||||
Id Builder::makeIntegerType(int width, bool hasSign)
|
Id Builder::makeIntegerType(int width, bool hasSign)
|
||||||
{
|
{
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
assert(width == 32);
|
||||||
|
width = 32;
|
||||||
|
#endif
|
||||||
|
|
||||||
// try to find it
|
// try to find it
|
||||||
Instruction* type;
|
Instruction* type;
|
||||||
for (int t = 0; t < (int)groupedTypes[OpTypeInt].size(); ++t) {
|
for (int t = 0; t < (int)groupedTypes[OpTypeInt].size(); ++t) {
|
||||||
@ -265,6 +272,11 @@ Id Builder::makeIntegerType(int width, bool hasSign)
|
|||||||
|
|
||||||
Id Builder::makeFloatType(int width)
|
Id Builder::makeFloatType(int width)
|
||||||
{
|
{
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
assert(width == 32);
|
||||||
|
width = 32;
|
||||||
|
#endif
|
||||||
|
|
||||||
// try to find it
|
// try to find it
|
||||||
Instruction* type;
|
Instruction* type;
|
||||||
for (int t = 0; t < (int)groupedTypes[OpTypeFloat].size(); ++t) {
|
for (int t = 0; t < (int)groupedTypes[OpTypeFloat].size(); ++t) {
|
||||||
@ -516,6 +528,7 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
|
|||||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||||
module.mapInstruction(type);
|
module.mapInstruction(type);
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// deal with capabilities
|
// deal with capabilities
|
||||||
switch (dim) {
|
switch (dim) {
|
||||||
case DimBuffer:
|
case DimBuffer:
|
||||||
@ -561,6 +574,7 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
|
|||||||
addCapability(CapabilityImageMSArray);
|
addCapability(CapabilityImageMSArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return type->getResultId();
|
return type->getResultId();
|
||||||
}
|
}
|
||||||
@ -586,7 +600,7 @@ Id Builder::makeSampledImageType(Id imageType)
|
|||||||
return type->getResultId();
|
return type->getResultId();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
#ifndef GLSLANG_WEB
|
||||||
Id Builder::makeAccelerationStructureNVType()
|
Id Builder::makeAccelerationStructureNVType()
|
||||||
{
|
{
|
||||||
Instruction *type;
|
Instruction *type;
|
||||||
@ -602,6 +616,7 @@ Id Builder::makeAccelerationStructureNVType()
|
|||||||
return type->getResultId();
|
return type->getResultId();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Id Builder::getDerefTypeId(Id resultId) const
|
Id Builder::getDerefTypeId(Id resultId) const
|
||||||
{
|
{
|
||||||
Id typeId = getTypeId(resultId);
|
Id typeId = getTypeId(resultId);
|
||||||
@ -939,6 +954,10 @@ Id Builder::makeFloatConstant(float f, bool specConstant)
|
|||||||
|
|
||||||
Id Builder::makeDoubleConstant(double d, bool specConstant)
|
Id Builder::makeDoubleConstant(double d, bool specConstant)
|
||||||
{
|
{
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
assert(0);
|
||||||
|
return NoResult;
|
||||||
|
#else
|
||||||
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
||||||
Id typeId = makeFloatType(64);
|
Id typeId = makeFloatType(64);
|
||||||
union { double db; unsigned long long ull; } u;
|
union { double db; unsigned long long ull; } u;
|
||||||
@ -963,10 +982,15 @@ Id Builder::makeDoubleConstant(double d, bool specConstant)
|
|||||||
module.mapInstruction(c);
|
module.mapInstruction(c);
|
||||||
|
|
||||||
return c->getResultId();
|
return c->getResultId();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Id Builder::makeFloat16Constant(float f16, bool specConstant)
|
Id Builder::makeFloat16Constant(float f16, bool specConstant)
|
||||||
{
|
{
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
assert(0);
|
||||||
|
return NoResult;
|
||||||
|
#else
|
||||||
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
||||||
Id typeId = makeFloatType(16);
|
Id typeId = makeFloatType(16);
|
||||||
|
|
||||||
@ -991,13 +1015,21 @@ Id Builder::makeFloat16Constant(float f16, bool specConstant)
|
|||||||
module.mapInstruction(c);
|
module.mapInstruction(c);
|
||||||
|
|
||||||
return c->getResultId();
|
return c->getResultId();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Id Builder::makeFpConstant(Id type, double d, bool specConstant)
|
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));
|
assert(isFloatType(type));
|
||||||
|
|
||||||
switch (getScalarTypeWidth(type)) {
|
switch (width) {
|
||||||
case 16:
|
case 16:
|
||||||
return makeFloat16Constant((float)d, specConstant);
|
return makeFloat16Constant((float)d, specConstant);
|
||||||
case 32:
|
case 32:
|
||||||
@ -1825,7 +1857,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
|||||||
if (parameters.component != NoResult)
|
if (parameters.component != NoResult)
|
||||||
texArgs[numArgs++] = parameters.component;
|
texArgs[numArgs++] = parameters.component;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
#ifndef GLSLANG_WEB
|
||||||
if (parameters.granularity != NoResult)
|
if (parameters.granularity != NoResult)
|
||||||
texArgs[numArgs++] = parameters.granularity;
|
texArgs[numArgs++] = parameters.granularity;
|
||||||
if (parameters.coarse != NoResult)
|
if (parameters.coarse != NoResult)
|
||||||
@ -1872,6 +1904,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
|||||||
mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask);
|
mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask);
|
||||||
texArgs[numArgs++] = parameters.offsets;
|
texArgs[numArgs++] = parameters.offsets;
|
||||||
}
|
}
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (parameters.sample) {
|
if (parameters.sample) {
|
||||||
mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask);
|
mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask);
|
||||||
texArgs[numArgs++] = parameters.sample;
|
texArgs[numArgs++] = parameters.sample;
|
||||||
@ -1889,6 +1922,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
|||||||
if (parameters.volatil) {
|
if (parameters.volatil) {
|
||||||
mask = mask | ImageOperandsVolatileTexelKHRMask;
|
mask = mask | ImageOperandsVolatileTexelKHRMask;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
mask = mask | signExtensionMask;
|
mask = mask | signExtensionMask;
|
||||||
if (mask == ImageOperandsMaskNone)
|
if (mask == ImageOperandsMaskNone)
|
||||||
--numArgs; // undo speculative reservation for the mask argument
|
--numArgs; // undo speculative reservation for the mask argument
|
||||||
@ -1904,10 +1938,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
|||||||
opCode = OpImageSparseFetch;
|
opCode = OpImageSparseFetch;
|
||||||
else
|
else
|
||||||
opCode = OpImageFetch;
|
opCode = OpImageFetch;
|
||||||
#ifdef NV_EXTENSIONS
|
#ifndef GLSLANG_WEB
|
||||||
} else if (parameters.granularity && parameters.coarse) {
|
} else if (parameters.granularity && parameters.coarse) {
|
||||||
opCode = OpImageSampleFootprintNV;
|
opCode = OpImageSampleFootprintNV;
|
||||||
#endif
|
|
||||||
} else if (gather) {
|
} else if (gather) {
|
||||||
if (parameters.Dref)
|
if (parameters.Dref)
|
||||||
if (sparse)
|
if (sparse)
|
||||||
@ -1919,6 +1952,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
|||||||
opCode = OpImageSparseGather;
|
opCode = OpImageSparseGather;
|
||||||
else
|
else
|
||||||
opCode = OpImageGather;
|
opCode = OpImageGather;
|
||||||
|
#endif
|
||||||
} else if (explicitLod) {
|
} else if (explicitLod) {
|
||||||
if (parameters.Dref) {
|
if (parameters.Dref) {
|
||||||
if (proj)
|
if (proj)
|
||||||
@ -2067,11 +2101,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OpImageQueryLod:
|
case OpImageQueryLod:
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
resultType = makeVectorType(getScalarTypeId(getTypeId(parameters.coords)), 2);
|
resultType = makeVectorType(getScalarTypeId(getTypeId(parameters.coords)), 2);
|
||||||
#else
|
|
||||||
resultType = makeVectorType(makeFloatType(32), 2);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case OpImageQueryLevels:
|
case OpImageQueryLevels:
|
||||||
case OpImageQuerySamples:
|
case OpImageQuerySamples:
|
||||||
@ -2089,6 +2119,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
|
|||||||
if (parameters.lod)
|
if (parameters.lod)
|
||||||
query->addIdOperand(parameters.lod);
|
query->addIdOperand(parameters.lod);
|
||||||
buildPoint->addInstruction(std::unique_ptr<Instruction>(query));
|
buildPoint->addInstruction(std::unique_ptr<Instruction>(query));
|
||||||
|
addCapability(CapabilityImageQuery);
|
||||||
|
|
||||||
return query->getResultId();
|
return query->getResultId();
|
||||||
}
|
}
|
||||||
@ -2282,7 +2313,12 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
|
|||||||
int numRows = getTypeNumRows(resultTypeId);
|
int numRows = getTypeNumRows(resultTypeId);
|
||||||
|
|
||||||
Instruction* instr = module.getInstruction(componentTypeId);
|
Instruction* instr = module.getInstruction(componentTypeId);
|
||||||
unsigned bitCount = instr->getImmediateOperand(0);
|
#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
|
// Optimize matrix constructed from a bigger matrix
|
||||||
if (isMatrix(sources[0]) && getNumColumns(sources[0]) >= numCols && getNumRows(sources[0]) >= numRows) {
|
if (isMatrix(sources[0]) && getNumColumns(sources[0]) >= numCols && getNumRows(sources[0]) >= numRows) {
|
||||||
|
38
thirdparty/glslang/SPIRV/SpvBuilder.h
vendored
38
thirdparty/glslang/SPIRV/SpvBuilder.h
vendored
@ -67,6 +67,7 @@ typedef enum {
|
|||||||
Spv_1_2 = (1 << 16) | (2 << 8),
|
Spv_1_2 = (1 << 16) | (2 << 8),
|
||||||
Spv_1_3 = (1 << 16) | (3 << 8),
|
Spv_1_3 = (1 << 16) | (3 << 8),
|
||||||
Spv_1_4 = (1 << 16) | (4 << 8),
|
Spv_1_4 = (1 << 16) | (4 << 8),
|
||||||
|
Spv_1_5 = (1 << 16) | (5 << 8),
|
||||||
} SpvVersion;
|
} SpvVersion;
|
||||||
|
|
||||||
class Builder {
|
class Builder {
|
||||||
@ -105,6 +106,20 @@ public:
|
|||||||
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
|
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
|
||||||
void setEmitOpLines() { emitOpLines = true; }
|
void setEmitOpLines() { emitOpLines = true; }
|
||||||
void addExtension(const char* ext) { extensions.insert(ext); }
|
void addExtension(const char* ext) { extensions.insert(ext); }
|
||||||
|
void removeExtension(const char* ext)
|
||||||
|
{
|
||||||
|
extensions.erase(ext);
|
||||||
|
}
|
||||||
|
void addIncorporatedExtension(const char* ext, SpvVersion incorporatedVersion)
|
||||||
|
{
|
||||||
|
if (getSpvVersion() < static_cast<unsigned>(incorporatedVersion))
|
||||||
|
addExtension(ext);
|
||||||
|
}
|
||||||
|
void promoteIncorporatedExtension(const char* baseExt, const char* promoExt, SpvVersion incorporatedVersion)
|
||||||
|
{
|
||||||
|
removeExtension(baseExt);
|
||||||
|
addIncorporatedExtension(promoExt, incorporatedVersion);
|
||||||
|
}
|
||||||
void addInclude(const std::string& name, const std::string& text)
|
void addInclude(const std::string& name, const std::string& text)
|
||||||
{
|
{
|
||||||
spv::Id incId = getStringId(name);
|
spv::Id incId = getStringId(name);
|
||||||
@ -201,7 +216,11 @@ public:
|
|||||||
bool isMatrixType(Id typeId) const { return getTypeClass(typeId) == OpTypeMatrix; }
|
bool isMatrixType(Id typeId) const { return getTypeClass(typeId) == OpTypeMatrix; }
|
||||||
bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; }
|
bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; }
|
||||||
bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; }
|
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; }
|
bool isCooperativeMatrixType(Id typeId)const { return getTypeClass(typeId) == OpTypeCooperativeMatrixNV; }
|
||||||
|
#endif
|
||||||
bool isAggregateType(Id typeId) const { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
|
bool isAggregateType(Id typeId) const { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
|
||||||
bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; }
|
bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; }
|
||||||
bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; }
|
bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; }
|
||||||
@ -557,6 +576,14 @@ public:
|
|||||||
|
|
||||||
// Accumulate whether anything in the chain of structures has coherent decorations.
|
// Accumulate whether anything in the chain of structures has coherent decorations.
|
||||||
struct CoherentFlags {
|
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; }
|
||||||
|
|
||||||
unsigned coherent : 1;
|
unsigned coherent : 1;
|
||||||
unsigned devicecoherent : 1;
|
unsigned devicecoherent : 1;
|
||||||
unsigned queuefamilycoherent : 1;
|
unsigned queuefamilycoherent : 1;
|
||||||
@ -577,7 +604,6 @@ public:
|
|||||||
isImage = 0;
|
isImage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CoherentFlags() { clear(); }
|
|
||||||
CoherentFlags operator |=(const CoherentFlags &other) {
|
CoherentFlags operator |=(const CoherentFlags &other) {
|
||||||
coherent |= other.coherent;
|
coherent |= other.coherent;
|
||||||
devicecoherent |= other.devicecoherent;
|
devicecoherent |= other.devicecoherent;
|
||||||
@ -589,6 +615,7 @@ public:
|
|||||||
isImage |= other.isImage;
|
isImage |= other.isImage;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
CoherentFlags coherentFlags;
|
CoherentFlags coherentFlags;
|
||||||
};
|
};
|
||||||
@ -660,12 +687,17 @@ public:
|
|||||||
// based on the resulting SPIR-V.
|
// based on the resulting SPIR-V.
|
||||||
void postProcess();
|
void postProcess();
|
||||||
|
|
||||||
|
// 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
|
// Hook to visit each instruction in a block in a function
|
||||||
void postProcess(Instruction&);
|
void postProcess(Instruction&);
|
||||||
// Hook to visit each instruction in a reachable block in a function.
|
|
||||||
void postProcessReachable(const Instruction&);
|
|
||||||
// Hook to visit each non-32-bit sized float/int operation in a block.
|
// Hook to visit each non-32-bit sized float/int operation in a block.
|
||||||
void postProcessType(const Instruction&, spv::Id typeId);
|
void postProcessType(const Instruction&, spv::Id typeId);
|
||||||
|
#endif
|
||||||
|
|
||||||
void dump(std::vector<unsigned int>&) const;
|
void dump(std::vector<unsigned int>&) const;
|
||||||
|
|
||||||
|
78
thirdparty/glslang/SPIRV/SpvPostProcess.cpp
vendored
78
thirdparty/glslang/SPIRV/SpvPostProcess.cpp
vendored
@ -39,6 +39,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -51,16 +52,13 @@ namespace spv {
|
|||||||
#include "GLSL.std.450.h"
|
#include "GLSL.std.450.h"
|
||||||
#include "GLSL.ext.KHR.h"
|
#include "GLSL.ext.KHR.h"
|
||||||
#include "GLSL.ext.EXT.h"
|
#include "GLSL.ext.EXT.h"
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
#include "GLSL.ext.AMD.h"
|
#include "GLSL.ext.AMD.h"
|
||||||
#endif
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
#include "GLSL.ext.NV.h"
|
#include "GLSL.ext.NV.h"
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace spv {
|
namespace spv {
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// Hook to visit each operand type and result type of an instruction.
|
// Hook to visit each operand type and result type of an instruction.
|
||||||
// Will be called multiple times for one instruction, once for each typed
|
// Will be called multiple times for one instruction, once for each typed
|
||||||
// operand and the result.
|
// operand and the result.
|
||||||
@ -160,7 +158,6 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OpExtInst:
|
case OpExtInst:
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
switch (inst.getImmediateOperand(1)) {
|
switch (inst.getImmediateOperand(1)) {
|
||||||
case GLSLstd450Frexp:
|
case GLSLstd450Frexp:
|
||||||
case GLSLstd450FrexpStruct:
|
case GLSLstd450FrexpStruct:
|
||||||
@ -176,7 +173,6 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (basicTypeOp == OpTypeFloat && width == 16)
|
if (basicTypeOp == OpTypeFloat && width == 16)
|
||||||
@ -222,12 +218,10 @@ void Builder::postProcess(Instruction& inst)
|
|||||||
addCapability(CapabilityImageQuery);
|
addCapability(CapabilityImageQuery);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case OpGroupNonUniformPartitionNV:
|
case OpGroupNonUniformPartitionNV:
|
||||||
addExtension(E_SPV_NV_shader_subgroup_partitioned);
|
addExtension(E_SPV_NV_shader_subgroup_partitioned);
|
||||||
addCapability(CapabilityGroupNonUniformPartitionedNV);
|
addCapability(CapabilityGroupNonUniformPartitionedNV);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case OpLoad:
|
case OpLoad:
|
||||||
case OpStore:
|
case OpStore:
|
||||||
@ -326,17 +320,16 @@ void Builder::postProcess(Instruction& inst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// Called for each instruction in a reachable block.
|
|
||||||
void Builder::postProcessReachable(const Instruction&)
|
|
||||||
{
|
|
||||||
// did have code here, but questionable to do so without deleting the instructions
|
|
||||||
}
|
|
||||||
|
|
||||||
// comment in header
|
// comment in header
|
||||||
void Builder::postProcess()
|
void Builder::postProcessCFG()
|
||||||
{
|
{
|
||||||
|
// reachableBlocks is the set of blockss reached via control flow, or which are
|
||||||
|
// unreachable continue targert or unreachable merge.
|
||||||
std::unordered_set<const Block*> reachableBlocks;
|
std::unordered_set<const Block*> reachableBlocks;
|
||||||
|
std::unordered_map<Block*, Block*> headerForUnreachableContinue;
|
||||||
|
std::unordered_set<Block*> unreachableMerges;
|
||||||
std::unordered_set<Id> unreachableDefinitions;
|
std::unordered_set<Id> unreachableDefinitions;
|
||||||
// Collect IDs defined in unreachable blocks. For each function, label the
|
// Collect IDs defined in unreachable blocks. For each function, label the
|
||||||
// reachable blocks first. Then for each unreachable block, collect the
|
// reachable blocks first. Then for each unreachable block, collect the
|
||||||
@ -344,16 +337,41 @@ void Builder::postProcess()
|
|||||||
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
|
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
|
||||||
Function* f = *fi;
|
Function* f = *fi;
|
||||||
Block* entry = f->getEntryBlock();
|
Block* entry = f->getEntryBlock();
|
||||||
inReadableOrder(entry, [&reachableBlocks](const Block* b) { reachableBlocks.insert(b); });
|
inReadableOrder(entry,
|
||||||
|
[&reachableBlocks, &unreachableMerges, &headerForUnreachableContinue]
|
||||||
|
(Block* b, ReachReason why, Block* header) {
|
||||||
|
reachableBlocks.insert(b);
|
||||||
|
if (why == ReachDeadContinue) headerForUnreachableContinue[b] = header;
|
||||||
|
if (why == ReachDeadMerge) unreachableMerges.insert(b);
|
||||||
|
});
|
||||||
for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) {
|
for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) {
|
||||||
Block* b = *bi;
|
Block* b = *bi;
|
||||||
if (reachableBlocks.count(b) == 0) {
|
if (unreachableMerges.count(b) != 0 || headerForUnreachableContinue.count(b) != 0) {
|
||||||
for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++)
|
auto ii = b->getInstructions().cbegin();
|
||||||
|
++ii; // Keep potential decorations on the label.
|
||||||
|
for (; ii != b->getInstructions().cend(); ++ii)
|
||||||
|
unreachableDefinitions.insert(ii->get()->getResultId());
|
||||||
|
} else if (reachableBlocks.count(b) == 0) {
|
||||||
|
// The normal case for unreachable code. All definitions are considered dead.
|
||||||
|
for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ++ii)
|
||||||
unreachableDefinitions.insert(ii->get()->getResultId());
|
unreachableDefinitions.insert(ii->get()->getResultId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Modify unreachable merge blocks and unreachable continue targets.
|
||||||
|
// Delete their contents.
|
||||||
|
for (auto mergeIter = unreachableMerges.begin(); mergeIter != unreachableMerges.end(); ++mergeIter) {
|
||||||
|
(*mergeIter)->rewriteAsCanonicalUnreachableMerge();
|
||||||
|
}
|
||||||
|
for (auto continueIter = headerForUnreachableContinue.begin();
|
||||||
|
continueIter != headerForUnreachableContinue.end();
|
||||||
|
++continueIter) {
|
||||||
|
Block* continue_target = continueIter->first;
|
||||||
|
Block* header = continueIter->second;
|
||||||
|
continue_target->rewriteAsCanonicalUnreachableContinue(header);
|
||||||
|
}
|
||||||
|
|
||||||
// Remove unneeded decorations, for unreachable instructions
|
// Remove unneeded decorations, for unreachable instructions
|
||||||
decorations.erase(std::remove_if(decorations.begin(), decorations.end(),
|
decorations.erase(std::remove_if(decorations.begin(), decorations.end(),
|
||||||
[&unreachableDefinitions](std::unique_ptr<Instruction>& I) -> bool {
|
[&unreachableDefinitions](std::unique_ptr<Instruction>& I) -> bool {
|
||||||
@ -361,7 +379,11 @@ void Builder::postProcess()
|
|||||||
return unreachableDefinitions.count(decoration_id) != 0;
|
return unreachableDefinitions.count(decoration_id) != 0;
|
||||||
}),
|
}),
|
||||||
decorations.end());
|
decorations.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
// comment in header
|
||||||
|
void Builder::postProcessFeatures() {
|
||||||
// Add per-instruction capabilities, extensions, etc.,
|
// Add per-instruction capabilities, extensions, etc.,
|
||||||
|
|
||||||
// Look for any 8/16 bit type in physical storage buffer class, and set the
|
// Look for any 8/16 bit type in physical storage buffer class, and set the
|
||||||
@ -371,24 +393,17 @@ void Builder::postProcess()
|
|||||||
Instruction* type = groupedTypes[OpTypePointer][t];
|
Instruction* type = groupedTypes[OpTypePointer][t];
|
||||||
if (type->getImmediateOperand(0) == (unsigned)StorageClassPhysicalStorageBufferEXT) {
|
if (type->getImmediateOperand(0) == (unsigned)StorageClassPhysicalStorageBufferEXT) {
|
||||||
if (containsType(type->getIdOperand(1), OpTypeInt, 8)) {
|
if (containsType(type->getIdOperand(1), OpTypeInt, 8)) {
|
||||||
addExtension(spv::E_SPV_KHR_8bit_storage);
|
addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5);
|
||||||
addCapability(spv::CapabilityStorageBuffer8BitAccess);
|
addCapability(spv::CapabilityStorageBuffer8BitAccess);
|
||||||
}
|
}
|
||||||
if (containsType(type->getIdOperand(1), OpTypeInt, 16) ||
|
if (containsType(type->getIdOperand(1), OpTypeInt, 16) ||
|
||||||
containsType(type->getIdOperand(1), OpTypeFloat, 16)) {
|
containsType(type->getIdOperand(1), OpTypeFloat, 16)) {
|
||||||
addExtension(spv::E_SPV_KHR_16bit_storage);
|
addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3);
|
||||||
addCapability(spv::CapabilityStorageBuffer16BitAccess);
|
addCapability(spv::CapabilityStorageBuffer16BitAccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// process all reachable instructions...
|
|
||||||
for (auto bi = reachableBlocks.cbegin(); bi != reachableBlocks.cend(); ++bi) {
|
|
||||||
const Block* block = *bi;
|
|
||||||
const auto function = [this](const std::unique_ptr<Instruction>& inst) { postProcessReachable(*inst.get()); };
|
|
||||||
std::for_each(block->getInstructions().begin(), block->getInstructions().end(), function);
|
|
||||||
}
|
|
||||||
|
|
||||||
// process all block-contained instructions
|
// process all block-contained instructions
|
||||||
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
|
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
|
||||||
Function* f = *fi;
|
Function* f = *fi;
|
||||||
@ -422,5 +437,14 @@ void Builder::postProcess()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// comment in header
|
||||||
|
void Builder::postProcess() {
|
||||||
|
postProcessCFG();
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
postProcessFeatures();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
}; // end spv namespace
|
}; // end spv namespace
|
||||||
|
8
thirdparty/glslang/SPIRV/SpvTools.cpp
vendored
8
thirdparty/glslang/SPIRV/SpvTools.cpp
vendored
@ -67,6 +67,8 @@ spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLog
|
|||||||
logger->missingFunctionality("Target version for SPIRV-Tools validator");
|
logger->missingFunctionality("Target version for SPIRV-Tools validator");
|
||||||
return spv_target_env::SPV_ENV_VULKAN_1_1;
|
return spv_target_env::SPV_ENV_VULKAN_1_1;
|
||||||
}
|
}
|
||||||
|
case glslang::EShTargetVulkan_1_2:
|
||||||
|
return spv_target_env::SPV_ENV_VULKAN_1_2;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -103,7 +105,7 @@ void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& s
|
|||||||
|
|
||||||
// Apply the SPIRV-Tools validator to generated SPIR-V.
|
// Apply the SPIRV-Tools validator to generated SPIR-V.
|
||||||
void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
||||||
spv::SpvBuildLogger* logger)
|
spv::SpvBuildLogger* logger, bool prelegalization)
|
||||||
{
|
{
|
||||||
// validate
|
// validate
|
||||||
spv_context context = spvContextCreate(MapToSpirvToolsEnv(intermediate.getSpv(), logger));
|
spv_context context = spvContextCreate(MapToSpirvToolsEnv(intermediate.getSpv(), logger));
|
||||||
@ -111,6 +113,7 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<
|
|||||||
spv_diagnostic diagnostic = nullptr;
|
spv_diagnostic diagnostic = nullptr;
|
||||||
spv_validator_options options = spvValidatorOptionsCreate();
|
spv_validator_options options = spvValidatorOptionsCreate();
|
||||||
spvValidatorOptionsSetRelaxBlockLayout(options, intermediate.usingHlslOffsets());
|
spvValidatorOptionsSetRelaxBlockLayout(options, intermediate.usingHlslOffsets());
|
||||||
|
spvValidatorOptionsSetBeforeHlslLegalization(options, prelegalization);
|
||||||
spvValidateWithOptions(context, options, &binary, &diagnostic);
|
spvValidateWithOptions(context, options, &binary, &diagnostic);
|
||||||
|
|
||||||
// report
|
// report
|
||||||
@ -172,6 +175,7 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
|
|||||||
if (options->generateDebugInfo) {
|
if (options->generateDebugInfo) {
|
||||||
optimizer.RegisterPass(spvtools::CreatePropagateLineInfoPass());
|
optimizer.RegisterPass(spvtools::CreatePropagateLineInfoPass());
|
||||||
}
|
}
|
||||||
|
optimizer.RegisterPass(spvtools::CreateWrapOpKillPass());
|
||||||
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
|
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
|
||||||
optimizer.RegisterPass(spvtools::CreateMergeReturnPass());
|
optimizer.RegisterPass(spvtools::CreateMergeReturnPass());
|
||||||
optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass());
|
optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass());
|
||||||
@ -195,8 +199,6 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
|
|||||||
optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
|
optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
|
||||||
if (options->optimizeSize) {
|
if (options->optimizeSize) {
|
||||||
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
|
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
|
||||||
// TODO(greg-lunarg): Add this when AMD driver issues are resolved
|
|
||||||
// optimizer.RegisterPass(CreateCommonUniformElimPass());
|
|
||||||
}
|
}
|
||||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
||||||
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
|
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
|
||||||
|
8
thirdparty/glslang/SPIRV/SpvTools.h
vendored
8
thirdparty/glslang/SPIRV/SpvTools.h
vendored
@ -41,10 +41,12 @@
|
|||||||
#ifndef GLSLANG_SPV_TOOLS_H
|
#ifndef GLSLANG_SPV_TOOLS_H
|
||||||
#define GLSLANG_SPV_TOOLS_H
|
#define GLSLANG_SPV_TOOLS_H
|
||||||
|
|
||||||
|
#ifdef ENABLE_OPT
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../glslang/MachineIndependent/localintermediate.h"
|
#include "glslang/MachineIndependent/localintermediate.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
|
||||||
namespace glslang {
|
namespace glslang {
|
||||||
@ -59,14 +61,14 @@ struct SpvOptions {
|
|||||||
bool validate;
|
bool validate;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ENABLE_OPT
|
#ifdef ENABLE_OPT
|
||||||
|
|
||||||
// Use the SPIRV-Tools disassembler to print SPIR-V.
|
// Use the SPIRV-Tools disassembler to print SPIR-V.
|
||||||
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv);
|
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv);
|
||||||
|
|
||||||
// Apply the SPIRV-Tools validator to generated SPIR-V.
|
// Apply the SPIRV-Tools validator to generated SPIR-V.
|
||||||
void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
||||||
spv::SpvBuildLogger*);
|
spv::SpvBuildLogger*, bool prelegalization);
|
||||||
|
|
||||||
// Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of
|
// Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of
|
||||||
// legalizing HLSL SPIR-V.
|
// legalizing HLSL SPIR-V.
|
||||||
|
41
thirdparty/glslang/SPIRV/disassemble.cpp
vendored
41
thirdparty/glslang/SPIRV/disassemble.cpp
vendored
@ -52,26 +52,16 @@ namespace spv {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
// Include C-based headers that don't have a namespace
|
// Include C-based headers that don't have a namespace
|
||||||
#include "GLSL.std.450.h"
|
#include "GLSL.std.450.h"
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
#include "GLSL.ext.AMD.h"
|
#include "GLSL.ext.AMD.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
#include "GLSL.ext.NV.h"
|
#include "GLSL.ext.NV.h"
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
|
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
|
||||||
|
|
||||||
namespace spv {
|
namespace spv {
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
static const char* GLSLextAMDGetDebugNames(const char*, unsigned);
|
static const char* GLSLextAMDGetDebugNames(const char*, unsigned);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
static const char* GLSLextNVGetDebugNames(const char*, unsigned);
|
static const char* GLSLextNVGetDebugNames(const char*, unsigned);
|
||||||
#endif
|
|
||||||
|
|
||||||
static void Kill(std::ostream& out, const char* message)
|
static void Kill(std::ostream& out, const char* message)
|
||||||
{
|
{
|
||||||
@ -82,15 +72,8 @@ static void Kill(std::ostream& out, const char* message)
|
|||||||
// used to identify the extended instruction library imported when printing
|
// used to identify the extended instruction library imported when printing
|
||||||
enum ExtInstSet {
|
enum ExtInstSet {
|
||||||
GLSL450Inst,
|
GLSL450Inst,
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
GLSLextAMDInst,
|
GLSLextAMDInst,
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
GLSLextNVInst,
|
GLSLextNVInst,
|
||||||
#endif
|
|
||||||
|
|
||||||
OpenCLExtInst,
|
OpenCLExtInst,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -499,14 +482,11 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
|||||||
const char* name = idDescriptor[stream[word - 2]].c_str();
|
const char* name = idDescriptor[stream[word - 2]].c_str();
|
||||||
if (0 == memcmp("OpenCL", name, 6)) {
|
if (0 == memcmp("OpenCL", name, 6)) {
|
||||||
extInstSet = OpenCLExtInst;
|
extInstSet = OpenCLExtInst;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 ||
|
} else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 ||
|
||||||
strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 ||
|
strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 ||
|
||||||
strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 ||
|
strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 ||
|
||||||
strcmp(spv::E_SPV_AMD_gcn_shader, name) == 0) {
|
strcmp(spv::E_SPV_AMD_gcn_shader, name) == 0) {
|
||||||
extInstSet = GLSLextAMDInst;
|
extInstSet = GLSLextAMDInst;
|
||||||
#endif
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
} else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 ||
|
} 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_geometry_shader_passthrough, name) == 0 ||
|
||||||
strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 ||
|
strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 ||
|
||||||
@ -514,22 +494,17 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
|||||||
strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 ||
|
strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 ||
|
||||||
strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) {
|
strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) {
|
||||||
extInstSet = GLSLextNVInst;
|
extInstSet = GLSLextNVInst;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
unsigned entrypoint = stream[word - 1];
|
unsigned entrypoint = stream[word - 1];
|
||||||
if (extInstSet == GLSL450Inst) {
|
if (extInstSet == GLSL450Inst) {
|
||||||
if (entrypoint < GLSLstd450Count) {
|
if (entrypoint < GLSLstd450Count) {
|
||||||
out << "(" << GlslStd450DebugNames[entrypoint] << ")";
|
out << "(" << GlslStd450DebugNames[entrypoint] << ")";
|
||||||
}
|
}
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if (extInstSet == GLSLextAMDInst) {
|
} else if (extInstSet == GLSLextAMDInst) {
|
||||||
out << "(" << GLSLextAMDGetDebugNames(name, entrypoint) << ")";
|
out << "(" << GLSLextAMDGetDebugNames(name, entrypoint) << ")";
|
||||||
#endif
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
}
|
}
|
||||||
else if (extInstSet == GLSLextNVInst) {
|
else if (extInstSet == GLSLextNVInst) {
|
||||||
out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")";
|
out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")";
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -648,9 +623,11 @@ static void GLSLstd450GetDebugNames(const char** names)
|
|||||||
names[GLSLstd450InterpolateAtCentroid] = "InterpolateAtCentroid";
|
names[GLSLstd450InterpolateAtCentroid] = "InterpolateAtCentroid";
|
||||||
names[GLSLstd450InterpolateAtSample] = "InterpolateAtSample";
|
names[GLSLstd450InterpolateAtSample] = "InterpolateAtSample";
|
||||||
names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset";
|
names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset";
|
||||||
|
names[GLSLstd450NMin] = "NMin";
|
||||||
|
names[GLSLstd450NMax] = "NMax";
|
||||||
|
names[GLSLstd450NClamp] = "NClamp";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint)
|
static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint)
|
||||||
{
|
{
|
||||||
if (strcmp(name, spv::E_SPV_AMD_shader_ballot) == 0) {
|
if (strcmp(name, spv::E_SPV_AMD_shader_ballot) == 0) {
|
||||||
@ -692,18 +669,17 @@ static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint
|
|||||||
|
|
||||||
return "Bad";
|
return "Bad";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
|
static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
|
||||||
{
|
{
|
||||||
if (strcmp(name, spv::E_SPV_NV_sample_mask_override_coverage) == 0 ||
|
if (strcmp(name, spv::E_SPV_NV_sample_mask_override_coverage) == 0 ||
|
||||||
strcmp(name, spv::E_SPV_NV_geometry_shader_passthrough) == 0 ||
|
strcmp(name, spv::E_SPV_NV_geometry_shader_passthrough) == 0 ||
|
||||||
strcmp(name, spv::E_ARB_shader_viewport_layer_array) == 0 ||
|
strcmp(name, spv::E_ARB_shader_viewport_layer_array) == 0 ||
|
||||||
strcmp(name, spv::E_SPV_NV_viewport_array2) == 0 ||
|
strcmp(name, spv::E_SPV_NV_viewport_array2) == 0 ||
|
||||||
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 ||
|
strcmp(name, spv::E_SPV_NVX_multiview_per_view_attributes) == 0 ||
|
||||||
strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 ||
|
strcmp(name, spv::E_SPV_NV_fragment_shader_barycentric) == 0 ||
|
||||||
strcmp(name, spv::E_SPV_NV_mesh_shader) == 0) {
|
strcmp(name, spv::E_SPV_NV_mesh_shader) == 0 ||
|
||||||
|
strcmp(name, spv::E_SPV_NV_shader_image_footprint) == 0) {
|
||||||
switch (entrypoint) {
|
switch (entrypoint) {
|
||||||
// NV builtins
|
// NV builtins
|
||||||
case BuiltInViewportMaskNV: return "ViewportMaskNV";
|
case BuiltInViewportMaskNV: return "ViewportMaskNV";
|
||||||
@ -729,6 +705,8 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
|
|||||||
case CapabilityPerViewAttributesNV: return "PerViewAttributesNV";
|
case CapabilityPerViewAttributesNV: return "PerViewAttributesNV";
|
||||||
case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
|
case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
|
||||||
case CapabilityMeshShadingNV: return "MeshShadingNV";
|
case CapabilityMeshShadingNV: return "MeshShadingNV";
|
||||||
|
case CapabilityImageFootprintNV: return "ImageFootprintNV";
|
||||||
|
case CapabilitySampleMaskOverrideCoverageNV:return "SampleMaskOverrideCoverageNV";
|
||||||
|
|
||||||
// NV Decorations
|
// NV Decorations
|
||||||
case DecorationOverrideCoverageNV: return "OverrideCoverageNV";
|
case DecorationOverrideCoverageNV: return "OverrideCoverageNV";
|
||||||
@ -745,7 +723,6 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
|
|||||||
}
|
}
|
||||||
return "Bad";
|
return "Bad";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
|
void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
|
||||||
{
|
{
|
||||||
|
117
thirdparty/glslang/SPIRV/doc.cpp
vendored
117
thirdparty/glslang/SPIRV/doc.cpp
vendored
@ -50,12 +50,8 @@ namespace spv {
|
|||||||
// Include C-based headers that don't have a namespace
|
// Include C-based headers that don't have a namespace
|
||||||
#include "GLSL.ext.KHR.h"
|
#include "GLSL.ext.KHR.h"
|
||||||
#include "GLSL.ext.EXT.h"
|
#include "GLSL.ext.EXT.h"
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
#include "GLSL.ext.AMD.h"
|
#include "GLSL.ext.AMD.h"
|
||||||
#endif
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
#include "GLSL.ext.NV.h"
|
#include "GLSL.ext.NV.h"
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,22 +94,17 @@ const char* ExecutionModelString(int model)
|
|||||||
case 4: return "Fragment";
|
case 4: return "Fragment";
|
||||||
case 5: return "GLCompute";
|
case 5: return "GLCompute";
|
||||||
case 6: return "Kernel";
|
case 6: return "Kernel";
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case ExecutionModelTaskNV: return "TaskNV";
|
case ExecutionModelTaskNV: return "TaskNV";
|
||||||
case ExecutionModelMeshNV: return "MeshNV";
|
case ExecutionModelMeshNV: return "MeshNV";
|
||||||
#endif
|
|
||||||
|
|
||||||
default: return "Bad";
|
default: return "Bad";
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case ExecutionModelRayGenerationNV: return "RayGenerationNV";
|
case ExecutionModelRayGenerationNV: return "RayGenerationNV";
|
||||||
case ExecutionModelIntersectionNV: return "IntersectionNV";
|
case ExecutionModelIntersectionNV: return "IntersectionNV";
|
||||||
case ExecutionModelAnyHitNV: return "AnyHitNV";
|
case ExecutionModelAnyHitNV: return "AnyHitNV";
|
||||||
case ExecutionModelClosestHitNV: return "ClosestHitNV";
|
case ExecutionModelClosestHitNV: return "ClosestHitNV";
|
||||||
case ExecutionModelMissNV: return "MissNV";
|
case ExecutionModelMissNV: return "MissNV";
|
||||||
case ExecutionModelCallableNV: return "CallableNV";
|
case ExecutionModelCallableNV: return "CallableNV";
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,13 +174,18 @@ const char* ExecutionModeString(int mode)
|
|||||||
|
|
||||||
case 4446: return "PostDepthCoverage";
|
case 4446: return "PostDepthCoverage";
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case ExecutionModeOutputLinesNV: return "OutputLinesNV";
|
case ExecutionModeOutputLinesNV: return "OutputLinesNV";
|
||||||
case ExecutionModeOutputPrimitivesNV: return "OutputPrimitivesNV";
|
case ExecutionModeOutputPrimitivesNV: return "OutputPrimitivesNV";
|
||||||
case ExecutionModeOutputTrianglesNV: return "OutputTrianglesNV";
|
case ExecutionModeOutputTrianglesNV: return "OutputTrianglesNV";
|
||||||
case ExecutionModeDerivativeGroupQuadsNV: return "DerivativeGroupQuadsNV";
|
case ExecutionModeDerivativeGroupQuadsNV: return "DerivativeGroupQuadsNV";
|
||||||
case ExecutionModeDerivativeGroupLinearNV: return "DerivativeGroupLinearNV";
|
case ExecutionModeDerivativeGroupLinearNV: return "DerivativeGroupLinearNV";
|
||||||
#endif
|
|
||||||
|
case ExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT";
|
||||||
|
case ExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT";
|
||||||
|
case ExecutionModeSampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT";
|
||||||
|
case ExecutionModeSampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT";
|
||||||
|
case ExecutionModeShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT";
|
||||||
|
case ExecutionModeShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT";
|
||||||
|
|
||||||
case ExecutionModeCeiling:
|
case ExecutionModeCeiling:
|
||||||
default: return "Bad";
|
default: return "Bad";
|
||||||
@ -213,14 +209,12 @@ const char* StorageClassString(int StorageClass)
|
|||||||
case 11: return "Image";
|
case 11: return "Image";
|
||||||
case 12: return "StorageBuffer";
|
case 12: return "StorageBuffer";
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case StorageClassRayPayloadNV: return "RayPayloadNV";
|
case StorageClassRayPayloadNV: return "RayPayloadNV";
|
||||||
case StorageClassHitAttributeNV: return "HitAttributeNV";
|
case StorageClassHitAttributeNV: return "HitAttributeNV";
|
||||||
case StorageClassIncomingRayPayloadNV: return "IncomingRayPayloadNV";
|
case StorageClassIncomingRayPayloadNV: return "IncomingRayPayloadNV";
|
||||||
case StorageClassShaderRecordBufferNV: return "ShaderRecordBufferNV";
|
case StorageClassShaderRecordBufferNV: return "ShaderRecordBufferNV";
|
||||||
case StorageClassCallableDataNV: return "CallableDataNV";
|
case StorageClassCallableDataNV: return "CallableDataNV";
|
||||||
case StorageClassIncomingCallableDataNV: return "IncomingCallableDataNV";
|
case StorageClassIncomingCallableDataNV: return "IncomingCallableDataNV";
|
||||||
#endif
|
|
||||||
|
|
||||||
case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT";
|
case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT";
|
||||||
|
|
||||||
@ -282,10 +276,7 @@ const char* DecorationString(int decoration)
|
|||||||
case DecorationCeiling:
|
case DecorationCeiling:
|
||||||
default: return "Bad";
|
default: return "Bad";
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case DecorationExplicitInterpAMD: return "ExplicitInterpAMD";
|
case DecorationExplicitInterpAMD: return "ExplicitInterpAMD";
|
||||||
#endif
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case DecorationOverrideCoverageNV: return "OverrideCoverageNV";
|
case DecorationOverrideCoverageNV: return "OverrideCoverageNV";
|
||||||
case DecorationPassthroughNV: return "PassthroughNV";
|
case DecorationPassthroughNV: return "PassthroughNV";
|
||||||
case DecorationViewportRelativeNV: return "ViewportRelativeNV";
|
case DecorationViewportRelativeNV: return "ViewportRelativeNV";
|
||||||
@ -294,7 +285,6 @@ const char* DecorationString(int decoration)
|
|||||||
case DecorationPerViewNV: return "PerViewNV";
|
case DecorationPerViewNV: return "PerViewNV";
|
||||||
case DecorationPerTaskNV: return "PerTaskNV";
|
case DecorationPerTaskNV: return "PerTaskNV";
|
||||||
case DecorationPerVertexNV: return "PerVertexNV";
|
case DecorationPerVertexNV: return "PerVertexNV";
|
||||||
#endif
|
|
||||||
|
|
||||||
case DecorationNonUniformEXT: return "DecorationNonUniformEXT";
|
case DecorationNonUniformEXT: return "DecorationNonUniformEXT";
|
||||||
case DecorationHlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE";
|
case DecorationHlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE";
|
||||||
@ -364,7 +354,6 @@ const char* BuiltInString(int builtIn)
|
|||||||
case 4426: return "DrawIndex";
|
case 4426: return "DrawIndex";
|
||||||
case 5014: return "FragStencilRefEXT";
|
case 5014: return "FragStencilRefEXT";
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case 4992: return "BaryCoordNoPerspAMD";
|
case 4992: return "BaryCoordNoPerspAMD";
|
||||||
case 4993: return "BaryCoordNoPerspCentroidAMD";
|
case 4993: return "BaryCoordNoPerspCentroidAMD";
|
||||||
case 4994: return "BaryCoordNoPerspSampleAMD";
|
case 4994: return "BaryCoordNoPerspSampleAMD";
|
||||||
@ -372,9 +361,6 @@ const char* BuiltInString(int builtIn)
|
|||||||
case 4996: return "BaryCoordSmoothCentroidAMD";
|
case 4996: return "BaryCoordSmoothCentroidAMD";
|
||||||
case 4997: return "BaryCoordSmoothSampleAMD";
|
case 4997: return "BaryCoordSmoothSampleAMD";
|
||||||
case 4998: return "BaryCoordPullModelAMD";
|
case 4998: return "BaryCoordPullModelAMD";
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case BuiltInLaunchIdNV: return "LaunchIdNV";
|
case BuiltInLaunchIdNV: return "LaunchIdNV";
|
||||||
case BuiltInLaunchSizeNV: return "LaunchSizeNV";
|
case BuiltInLaunchSizeNV: return "LaunchSizeNV";
|
||||||
case BuiltInWorldRayOriginNV: return "WorldRayOriginNV";
|
case BuiltInWorldRayOriginNV: return "WorldRayOriginNV";
|
||||||
@ -398,15 +384,12 @@ const char* BuiltInString(int builtIn)
|
|||||||
// case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV"; // superseded by BuiltInFragInvocationCountEXT
|
// case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV"; // superseded by BuiltInFragInvocationCountEXT
|
||||||
case BuiltInBaryCoordNV: return "BaryCoordNV";
|
case BuiltInBaryCoordNV: return "BaryCoordNV";
|
||||||
case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
|
case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
|
||||||
#endif
|
|
||||||
|
|
||||||
case BuiltInFragSizeEXT: return "FragSizeEXT";
|
case BuiltInFragSizeEXT: return "FragSizeEXT";
|
||||||
case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT";
|
case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT";
|
||||||
|
|
||||||
case 5264: return "FullyCoveredEXT";
|
case 5264: return "FullyCoveredEXT";
|
||||||
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case BuiltInTaskCountNV: return "TaskCountNV";
|
case BuiltInTaskCountNV: return "TaskCountNV";
|
||||||
case BuiltInPrimitiveCountNV: return "PrimitiveCountNV";
|
case BuiltInPrimitiveCountNV: return "PrimitiveCountNV";
|
||||||
case BuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV";
|
case BuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV";
|
||||||
@ -415,7 +398,10 @@ const char* BuiltInString(int builtIn)
|
|||||||
case BuiltInLayerPerViewNV: return "LayerPerViewNV";
|
case BuiltInLayerPerViewNV: return "LayerPerViewNV";
|
||||||
case BuiltInMeshViewCountNV: return "MeshViewCountNV";
|
case BuiltInMeshViewCountNV: return "MeshViewCountNV";
|
||||||
case BuiltInMeshViewIndicesNV: return "MeshViewIndicesNV";
|
case BuiltInMeshViewIndicesNV: return "MeshViewIndicesNV";
|
||||||
#endif
|
case BuiltInWarpsPerSMNV: return "WarpsPerSMNV";
|
||||||
|
case BuiltInSMCountNV: return "SMCountNV";
|
||||||
|
case BuiltInWarpIDNV: return "WarpIDNV";
|
||||||
|
case BuiltInSMIDNV: return "SMIDNV";
|
||||||
|
|
||||||
default: return "Bad";
|
default: return "Bad";
|
||||||
}
|
}
|
||||||
@ -770,11 +756,9 @@ const char* GroupOperationString(int gop)
|
|||||||
case GroupOperationInclusiveScan: return "InclusiveScan";
|
case GroupOperationInclusiveScan: return "InclusiveScan";
|
||||||
case GroupOperationExclusiveScan: return "ExclusiveScan";
|
case GroupOperationExclusiveScan: return "ExclusiveScan";
|
||||||
case GroupOperationClusteredReduce: return "ClusteredReduce";
|
case GroupOperationClusteredReduce: return "ClusteredReduce";
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case GroupOperationPartitionedReduceNV: return "PartitionedReduceNV";
|
case GroupOperationPartitionedReduceNV: return "PartitionedReduceNV";
|
||||||
case GroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV";
|
case GroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV";
|
||||||
case GroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV";
|
case GroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV";
|
||||||
#endif
|
|
||||||
|
|
||||||
default: return "Bad";
|
default: return "Bad";
|
||||||
}
|
}
|
||||||
@ -882,26 +866,23 @@ const char* CapabilityString(int info)
|
|||||||
case CapabilityStoragePushConstant16: return "StoragePushConstant16";
|
case CapabilityStoragePushConstant16: return "StoragePushConstant16";
|
||||||
case CapabilityStorageInputOutput16: return "StorageInputOutput16";
|
case CapabilityStorageInputOutput16: return "StorageInputOutput16";
|
||||||
|
|
||||||
case CapabilityStorageBuffer8BitAccess: return "CapabilityStorageBuffer8BitAccess";
|
case CapabilityStorageBuffer8BitAccess: return "StorageBuffer8BitAccess";
|
||||||
case CapabilityUniformAndStorageBuffer8BitAccess: return "CapabilityUniformAndStorageBuffer8BitAccess";
|
case CapabilityUniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess";
|
||||||
case CapabilityStoragePushConstant8: return "CapabilityStoragePushConstant8";
|
case CapabilityStoragePushConstant8: return "StoragePushConstant8";
|
||||||
|
|
||||||
case CapabilityDeviceGroup: return "DeviceGroup";
|
case CapabilityDeviceGroup: return "DeviceGroup";
|
||||||
case CapabilityMultiView: return "MultiView";
|
case CapabilityMultiView: return "MultiView";
|
||||||
|
|
||||||
case CapabilityStencilExportEXT: return "StencilExportEXT";
|
case CapabilityStencilExportEXT: return "StencilExportEXT";
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case CapabilityFloat16ImageAMD: return "Float16ImageAMD";
|
case CapabilityFloat16ImageAMD: return "Float16ImageAMD";
|
||||||
case CapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD";
|
case CapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD";
|
||||||
case CapabilityFragmentMaskAMD: return "FragmentMaskAMD";
|
case CapabilityFragmentMaskAMD: return "FragmentMaskAMD";
|
||||||
case CapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD";
|
case CapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD";
|
||||||
#endif
|
|
||||||
|
|
||||||
case CapabilityAtomicStorageOps: return "AtomicStorageOps";
|
case CapabilityAtomicStorageOps: return "AtomicStorageOps";
|
||||||
|
|
||||||
case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage";
|
case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage";
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV";
|
case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV";
|
||||||
case CapabilityShaderViewportIndexLayerNV: return "ShaderViewportIndexLayerNV";
|
case CapabilityShaderViewportIndexLayerNV: return "ShaderViewportIndexLayerNV";
|
||||||
case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV";
|
case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV";
|
||||||
@ -913,33 +894,44 @@ const char* CapabilityString(int info)
|
|||||||
case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV";
|
case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV";
|
||||||
case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
|
case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
|
||||||
case CapabilityMeshShadingNV: return "MeshShadingNV";
|
case CapabilityMeshShadingNV: return "MeshShadingNV";
|
||||||
// case CapabilityShadingRateNV: return "ShadingRateNV"; // superseded by CapabilityFragmentDensityEXT
|
case CapabilityImageFootprintNV: return "ImageFootprintNV";
|
||||||
#endif
|
// case CapabilityShadingRateNV: return "ShadingRateNV"; // superseded by FragmentDensityEXT
|
||||||
|
case CapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV";
|
||||||
case CapabilityFragmentDensityEXT: return "FragmentDensityEXT";
|
case CapabilityFragmentDensityEXT: return "FragmentDensityEXT";
|
||||||
|
|
||||||
case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT";
|
case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT";
|
||||||
|
|
||||||
case CapabilityShaderNonUniformEXT: return "CapabilityShaderNonUniformEXT";
|
case CapabilityShaderNonUniformEXT: return "ShaderNonUniformEXT";
|
||||||
case CapabilityRuntimeDescriptorArrayEXT: return "CapabilityRuntimeDescriptorArrayEXT";
|
case CapabilityRuntimeDescriptorArrayEXT: return "RuntimeDescriptorArrayEXT";
|
||||||
case CapabilityInputAttachmentArrayDynamicIndexingEXT: return "CapabilityInputAttachmentArrayDynamicIndexingEXT";
|
case CapabilityInputAttachmentArrayDynamicIndexingEXT: return "InputAttachmentArrayDynamicIndexingEXT";
|
||||||
case CapabilityUniformTexelBufferArrayDynamicIndexingEXT: return "CapabilityUniformTexelBufferArrayDynamicIndexingEXT";
|
case CapabilityUniformTexelBufferArrayDynamicIndexingEXT: return "UniformTexelBufferArrayDynamicIndexingEXT";
|
||||||
case CapabilityStorageTexelBufferArrayDynamicIndexingEXT: return "CapabilityStorageTexelBufferArrayDynamicIndexingEXT";
|
case CapabilityStorageTexelBufferArrayDynamicIndexingEXT: return "StorageTexelBufferArrayDynamicIndexingEXT";
|
||||||
case CapabilityUniformBufferArrayNonUniformIndexingEXT: return "CapabilityUniformBufferArrayNonUniformIndexingEXT";
|
case CapabilityUniformBufferArrayNonUniformIndexingEXT: return "UniformBufferArrayNonUniformIndexingEXT";
|
||||||
case CapabilitySampledImageArrayNonUniformIndexingEXT: return "CapabilitySampledImageArrayNonUniformIndexingEXT";
|
case CapabilitySampledImageArrayNonUniformIndexingEXT: return "SampledImageArrayNonUniformIndexingEXT";
|
||||||
case CapabilityStorageBufferArrayNonUniformIndexingEXT: return "CapabilityStorageBufferArrayNonUniformIndexingEXT";
|
case CapabilityStorageBufferArrayNonUniformIndexingEXT: return "StorageBufferArrayNonUniformIndexingEXT";
|
||||||
case CapabilityStorageImageArrayNonUniformIndexingEXT: return "CapabilityStorageImageArrayNonUniformIndexingEXT";
|
case CapabilityStorageImageArrayNonUniformIndexingEXT: return "StorageImageArrayNonUniformIndexingEXT";
|
||||||
case CapabilityInputAttachmentArrayNonUniformIndexingEXT: return "CapabilityInputAttachmentArrayNonUniformIndexingEXT";
|
case CapabilityInputAttachmentArrayNonUniformIndexingEXT: return "InputAttachmentArrayNonUniformIndexingEXT";
|
||||||
case CapabilityUniformTexelBufferArrayNonUniformIndexingEXT: return "CapabilityUniformTexelBufferArrayNonUniformIndexingEXT";
|
case CapabilityUniformTexelBufferArrayNonUniformIndexingEXT: return "UniformTexelBufferArrayNonUniformIndexingEXT";
|
||||||
case CapabilityStorageTexelBufferArrayNonUniformIndexingEXT: return "CapabilityStorageTexelBufferArrayNonUniformIndexingEXT";
|
case CapabilityStorageTexelBufferArrayNonUniformIndexingEXT: return "StorageTexelBufferArrayNonUniformIndexingEXT";
|
||||||
|
|
||||||
case CapabilityVulkanMemoryModelKHR: return "CapabilityVulkanMemoryModelKHR";
|
case CapabilityVulkanMemoryModelKHR: return "VulkanMemoryModelKHR";
|
||||||
case CapabilityVulkanMemoryModelDeviceScopeKHR: return "CapabilityVulkanMemoryModelDeviceScopeKHR";
|
case CapabilityVulkanMemoryModelDeviceScopeKHR: return "VulkanMemoryModelDeviceScopeKHR";
|
||||||
|
|
||||||
case CapabilityPhysicalStorageBufferAddressesEXT: return "CapabilityPhysicalStorageBufferAddressesEXT";
|
case CapabilityPhysicalStorageBufferAddressesEXT: return "PhysicalStorageBufferAddressesEXT";
|
||||||
|
|
||||||
case CapabilityVariablePointers: return "CapabilityVariablePointers";
|
case CapabilityVariablePointers: return "VariablePointers";
|
||||||
|
|
||||||
case CapabilityCooperativeMatrixNV: return "CapabilityCooperativeMatrixNV";
|
case CapabilityCooperativeMatrixNV: return "CooperativeMatrixNV";
|
||||||
|
case CapabilityShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV";
|
||||||
|
|
||||||
|
case CapabilityFragmentShaderSampleInterlockEXT: return "CapabilityFragmentShaderSampleInterlockEXT";
|
||||||
|
case CapabilityFragmentShaderPixelInterlockEXT: return "CapabilityFragmentShaderPixelInterlockEXT";
|
||||||
|
case CapabilityFragmentShaderShadingRateInterlockEXT: return "CapabilityFragmentShaderShadingRateInterlockEXT";
|
||||||
|
|
||||||
|
case CapabilityDemoteToHelperInvocationEXT: return "DemoteToHelperInvocationEXT";
|
||||||
|
case CapabilityShaderClockKHR: return "ShaderClockKHR";
|
||||||
|
|
||||||
|
case CapabilityIntegerFunctions2INTEL: return "CapabilityIntegerFunctions2INTEL";
|
||||||
|
|
||||||
default: return "Bad";
|
default: return "Bad";
|
||||||
}
|
}
|
||||||
@ -1316,7 +1308,6 @@ const char* OpcodeString(int op)
|
|||||||
case 4430: return "OpSubgroupAllEqualKHR";
|
case 4430: return "OpSubgroupAllEqualKHR";
|
||||||
case 4432: return "OpSubgroupReadInvocationKHR";
|
case 4432: return "OpSubgroupReadInvocationKHR";
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case 5000: return "OpGroupIAddNonUniformAMD";
|
case 5000: return "OpGroupIAddNonUniformAMD";
|
||||||
case 5001: return "OpGroupFAddNonUniformAMD";
|
case 5001: return "OpGroupFAddNonUniformAMD";
|
||||||
case 5002: return "OpGroupFMinNonUniformAMD";
|
case 5002: return "OpGroupFMinNonUniformAMD";
|
||||||
@ -1328,12 +1319,12 @@ const char* OpcodeString(int op)
|
|||||||
|
|
||||||
case 5011: return "OpFragmentMaskFetchAMD";
|
case 5011: return "OpFragmentMaskFetchAMD";
|
||||||
case 5012: return "OpFragmentFetchAMD";
|
case 5012: return "OpFragmentFetchAMD";
|
||||||
#endif
|
|
||||||
|
case OpReadClockKHR: return "OpReadClockKHR";
|
||||||
|
|
||||||
case OpDecorateStringGOOGLE: return "OpDecorateStringGOOGLE";
|
case OpDecorateStringGOOGLE: return "OpDecorateStringGOOGLE";
|
||||||
case OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE";
|
case OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE";
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV";
|
case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV";
|
||||||
case OpReportIntersectionNV: return "OpReportIntersectionNV";
|
case OpReportIntersectionNV: return "OpReportIntersectionNV";
|
||||||
case OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV";
|
case OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV";
|
||||||
@ -1343,13 +1334,17 @@ const char* OpcodeString(int op)
|
|||||||
case OpExecuteCallableNV: return "OpExecuteCallableNV";
|
case OpExecuteCallableNV: return "OpExecuteCallableNV";
|
||||||
case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV";
|
case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV";
|
||||||
case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV";
|
case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV";
|
||||||
#endif
|
|
||||||
|
|
||||||
case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV";
|
case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV";
|
||||||
case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV";
|
case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV";
|
||||||
case OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV";
|
case OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV";
|
||||||
case OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV";
|
case OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV";
|
||||||
case OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV";
|
case OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV";
|
||||||
|
case OpDemoteToHelperInvocationEXT: return "OpDemoteToHelperInvocationEXT";
|
||||||
|
case OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT";
|
||||||
|
|
||||||
|
case OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT";
|
||||||
|
case OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "Bad";
|
return "Bad";
|
||||||
@ -1464,6 +1459,8 @@ void Parameterize()
|
|||||||
InstructionDesc[OpModuleProcessed].setResultAndType(false, false);
|
InstructionDesc[OpModuleProcessed].setResultAndType(false, false);
|
||||||
InstructionDesc[OpTypeCooperativeMatrixNV].setResultAndType(true, false);
|
InstructionDesc[OpTypeCooperativeMatrixNV].setResultAndType(true, false);
|
||||||
InstructionDesc[OpCooperativeMatrixStoreNV].setResultAndType(false, false);
|
InstructionDesc[OpCooperativeMatrixStoreNV].setResultAndType(false, false);
|
||||||
|
InstructionDesc[OpBeginInvocationInterlockEXT].setResultAndType(false, false);
|
||||||
|
InstructionDesc[OpEndInvocationInterlockEXT].setResultAndType(false, false);
|
||||||
|
|
||||||
// Specific additional context-dependent operands
|
// Specific additional context-dependent operands
|
||||||
|
|
||||||
@ -2656,7 +2653,6 @@ void Parameterize()
|
|||||||
|
|
||||||
InstructionDesc[OpModuleProcessed].operands.push(OperandLiteralString, "'process'");
|
InstructionDesc[OpModuleProcessed].operands.push(OperandLiteralString, "'process'");
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'");
|
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'");
|
||||||
@ -2695,9 +2691,7 @@ void Parameterize()
|
|||||||
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Image'");
|
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Image'");
|
||||||
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Coordinate'");
|
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Coordinate'");
|
||||||
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Fragment Index'");
|
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Fragment Index'");
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X");
|
InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X");
|
||||||
|
|
||||||
InstructionDesc[OpTypeAccelerationStructureNV].setResultAndType(true, false);
|
InstructionDesc[OpTypeAccelerationStructureNV].setResultAndType(true, false);
|
||||||
@ -2735,7 +2729,6 @@ void Parameterize()
|
|||||||
|
|
||||||
InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Index Offset'");
|
InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Index Offset'");
|
||||||
InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Packed Indices'");
|
InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Packed Indices'");
|
||||||
#endif
|
|
||||||
|
|
||||||
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Component Type'");
|
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Component Type'");
|
||||||
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Scope'");
|
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Scope'");
|
||||||
@ -2762,6 +2755,10 @@ void Parameterize()
|
|||||||
InstructionDesc[OpCooperativeMatrixMulAddNV].operands.push(OperandId, "'C'");
|
InstructionDesc[OpCooperativeMatrixMulAddNV].operands.push(OperandId, "'C'");
|
||||||
|
|
||||||
InstructionDesc[OpCooperativeMatrixLengthNV].operands.push(OperandId, "'Type'");
|
InstructionDesc[OpCooperativeMatrixLengthNV].operands.push(OperandId, "'Type'");
|
||||||
|
|
||||||
|
InstructionDesc[OpDemoteToHelperInvocationEXT].setResultAndType(false, false);
|
||||||
|
|
||||||
|
InstructionDesc[OpReadClockKHR].operands.push(OperandScope, "'Scope'");
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end spv namespace
|
}; // end spv namespace
|
||||||
|
104
thirdparty/glslang/SPIRV/spirv.hpp
vendored
104
thirdparty/glslang/SPIRV/spirv.hpp
vendored
@ -91,6 +91,7 @@ enum AddressingModel {
|
|||||||
AddressingModelLogical = 0,
|
AddressingModelLogical = 0,
|
||||||
AddressingModelPhysical32 = 1,
|
AddressingModelPhysical32 = 1,
|
||||||
AddressingModelPhysical64 = 2,
|
AddressingModelPhysical64 = 2,
|
||||||
|
AddressingModelPhysicalStorageBuffer64 = 5348,
|
||||||
AddressingModelPhysicalStorageBuffer64EXT = 5348,
|
AddressingModelPhysicalStorageBuffer64EXT = 5348,
|
||||||
AddressingModelMax = 0x7fffffff,
|
AddressingModelMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
@ -99,6 +100,7 @@ enum MemoryModel {
|
|||||||
MemoryModelSimple = 0,
|
MemoryModelSimple = 0,
|
||||||
MemoryModelGLSL450 = 1,
|
MemoryModelGLSL450 = 1,
|
||||||
MemoryModelOpenCL = 2,
|
MemoryModelOpenCL = 2,
|
||||||
|
MemoryModelVulkan = 3,
|
||||||
MemoryModelVulkanKHR = 3,
|
MemoryModelVulkanKHR = 3,
|
||||||
MemoryModelMax = 0x7fffffff,
|
MemoryModelMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
@ -154,6 +156,12 @@ enum ExecutionMode {
|
|||||||
ExecutionModeDerivativeGroupQuadsNV = 5289,
|
ExecutionModeDerivativeGroupQuadsNV = 5289,
|
||||||
ExecutionModeDerivativeGroupLinearNV = 5290,
|
ExecutionModeDerivativeGroupLinearNV = 5290,
|
||||||
ExecutionModeOutputTrianglesNV = 5298,
|
ExecutionModeOutputTrianglesNV = 5298,
|
||||||
|
ExecutionModePixelInterlockOrderedEXT = 5366,
|
||||||
|
ExecutionModePixelInterlockUnorderedEXT = 5367,
|
||||||
|
ExecutionModeSampleInterlockOrderedEXT = 5368,
|
||||||
|
ExecutionModeSampleInterlockUnorderedEXT = 5369,
|
||||||
|
ExecutionModeShadingRateInterlockOrderedEXT = 5370,
|
||||||
|
ExecutionModeShadingRateInterlockUnorderedEXT = 5371,
|
||||||
ExecutionModeMax = 0x7fffffff,
|
ExecutionModeMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -177,6 +185,7 @@ enum StorageClass {
|
|||||||
StorageClassHitAttributeNV = 5339,
|
StorageClassHitAttributeNV = 5339,
|
||||||
StorageClassIncomingRayPayloadNV = 5342,
|
StorageClassIncomingRayPayloadNV = 5342,
|
||||||
StorageClassShaderRecordBufferNV = 5343,
|
StorageClassShaderRecordBufferNV = 5343,
|
||||||
|
StorageClassPhysicalStorageBuffer = 5349,
|
||||||
StorageClassPhysicalStorageBufferEXT = 5349,
|
StorageClassPhysicalStorageBufferEXT = 5349,
|
||||||
StorageClassMax = 0x7fffffff,
|
StorageClassMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
@ -305,9 +314,13 @@ enum ImageOperandsShift {
|
|||||||
ImageOperandsConstOffsetsShift = 5,
|
ImageOperandsConstOffsetsShift = 5,
|
||||||
ImageOperandsSampleShift = 6,
|
ImageOperandsSampleShift = 6,
|
||||||
ImageOperandsMinLodShift = 7,
|
ImageOperandsMinLodShift = 7,
|
||||||
|
ImageOperandsMakeTexelAvailableShift = 8,
|
||||||
ImageOperandsMakeTexelAvailableKHRShift = 8,
|
ImageOperandsMakeTexelAvailableKHRShift = 8,
|
||||||
|
ImageOperandsMakeTexelVisibleShift = 9,
|
||||||
ImageOperandsMakeTexelVisibleKHRShift = 9,
|
ImageOperandsMakeTexelVisibleKHRShift = 9,
|
||||||
|
ImageOperandsNonPrivateTexelShift = 10,
|
||||||
ImageOperandsNonPrivateTexelKHRShift = 10,
|
ImageOperandsNonPrivateTexelKHRShift = 10,
|
||||||
|
ImageOperandsVolatileTexelShift = 11,
|
||||||
ImageOperandsVolatileTexelKHRShift = 11,
|
ImageOperandsVolatileTexelKHRShift = 11,
|
||||||
ImageOperandsSignExtendShift = 12,
|
ImageOperandsSignExtendShift = 12,
|
||||||
ImageOperandsZeroExtendShift = 13,
|
ImageOperandsZeroExtendShift = 13,
|
||||||
@ -324,9 +337,13 @@ enum ImageOperandsMask {
|
|||||||
ImageOperandsConstOffsetsMask = 0x00000020,
|
ImageOperandsConstOffsetsMask = 0x00000020,
|
||||||
ImageOperandsSampleMask = 0x00000040,
|
ImageOperandsSampleMask = 0x00000040,
|
||||||
ImageOperandsMinLodMask = 0x00000080,
|
ImageOperandsMinLodMask = 0x00000080,
|
||||||
|
ImageOperandsMakeTexelAvailableMask = 0x00000100,
|
||||||
ImageOperandsMakeTexelAvailableKHRMask = 0x00000100,
|
ImageOperandsMakeTexelAvailableKHRMask = 0x00000100,
|
||||||
|
ImageOperandsMakeTexelVisibleMask = 0x00000200,
|
||||||
ImageOperandsMakeTexelVisibleKHRMask = 0x00000200,
|
ImageOperandsMakeTexelVisibleKHRMask = 0x00000200,
|
||||||
|
ImageOperandsNonPrivateTexelMask = 0x00000400,
|
||||||
ImageOperandsNonPrivateTexelKHRMask = 0x00000400,
|
ImageOperandsNonPrivateTexelKHRMask = 0x00000400,
|
||||||
|
ImageOperandsVolatileTexelMask = 0x00000800,
|
||||||
ImageOperandsVolatileTexelKHRMask = 0x00000800,
|
ImageOperandsVolatileTexelKHRMask = 0x00000800,
|
||||||
ImageOperandsSignExtendMask = 0x00001000,
|
ImageOperandsSignExtendMask = 0x00001000,
|
||||||
ImageOperandsZeroExtendMask = 0x00002000,
|
ImageOperandsZeroExtendMask = 0x00002000,
|
||||||
@ -442,13 +459,17 @@ enum Decoration {
|
|||||||
DecorationPerViewNV = 5272,
|
DecorationPerViewNV = 5272,
|
||||||
DecorationPerTaskNV = 5273,
|
DecorationPerTaskNV = 5273,
|
||||||
DecorationPerVertexNV = 5285,
|
DecorationPerVertexNV = 5285,
|
||||||
|
DecorationNonUniform = 5300,
|
||||||
DecorationNonUniformEXT = 5300,
|
DecorationNonUniformEXT = 5300,
|
||||||
|
DecorationRestrictPointer = 5355,
|
||||||
DecorationRestrictPointerEXT = 5355,
|
DecorationRestrictPointerEXT = 5355,
|
||||||
|
DecorationAliasedPointer = 5356,
|
||||||
DecorationAliasedPointerEXT = 5356,
|
DecorationAliasedPointerEXT = 5356,
|
||||||
DecorationCounterBuffer = 5634,
|
DecorationCounterBuffer = 5634,
|
||||||
DecorationHlslCounterBufferGOOGLE = 5634,
|
DecorationHlslCounterBufferGOOGLE = 5634,
|
||||||
DecorationHlslSemanticGOOGLE = 5635,
|
DecorationHlslSemanticGOOGLE = 5635,
|
||||||
DecorationUserSemantic = 5635,
|
DecorationUserSemantic = 5635,
|
||||||
|
DecorationUserTypeGOOGLE = 5636,
|
||||||
DecorationMax = 0x7fffffff,
|
DecorationMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -551,6 +572,10 @@ enum BuiltIn {
|
|||||||
BuiltInHitTNV = 5332,
|
BuiltInHitTNV = 5332,
|
||||||
BuiltInHitKindNV = 5333,
|
BuiltInHitKindNV = 5333,
|
||||||
BuiltInIncomingRayFlagsNV = 5351,
|
BuiltInIncomingRayFlagsNV = 5351,
|
||||||
|
BuiltInWarpsPerSMNV = 5374,
|
||||||
|
BuiltInSMCountNV = 5375,
|
||||||
|
BuiltInWarpIDNV = 5376,
|
||||||
|
BuiltInSMIDNV = 5377,
|
||||||
BuiltInMax = 0x7fffffff,
|
BuiltInMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -619,9 +644,13 @@ enum MemorySemanticsShift {
|
|||||||
MemorySemanticsCrossWorkgroupMemoryShift = 9,
|
MemorySemanticsCrossWorkgroupMemoryShift = 9,
|
||||||
MemorySemanticsAtomicCounterMemoryShift = 10,
|
MemorySemanticsAtomicCounterMemoryShift = 10,
|
||||||
MemorySemanticsImageMemoryShift = 11,
|
MemorySemanticsImageMemoryShift = 11,
|
||||||
|
MemorySemanticsOutputMemoryShift = 12,
|
||||||
MemorySemanticsOutputMemoryKHRShift = 12,
|
MemorySemanticsOutputMemoryKHRShift = 12,
|
||||||
|
MemorySemanticsMakeAvailableShift = 13,
|
||||||
MemorySemanticsMakeAvailableKHRShift = 13,
|
MemorySemanticsMakeAvailableKHRShift = 13,
|
||||||
|
MemorySemanticsMakeVisibleShift = 14,
|
||||||
MemorySemanticsMakeVisibleKHRShift = 14,
|
MemorySemanticsMakeVisibleKHRShift = 14,
|
||||||
|
MemorySemanticsVolatileShift = 15,
|
||||||
MemorySemanticsMax = 0x7fffffff,
|
MemorySemanticsMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -637,17 +666,24 @@ enum MemorySemanticsMask {
|
|||||||
MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
|
MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
|
||||||
MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
|
MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
|
||||||
MemorySemanticsImageMemoryMask = 0x00000800,
|
MemorySemanticsImageMemoryMask = 0x00000800,
|
||||||
|
MemorySemanticsOutputMemoryMask = 0x00001000,
|
||||||
MemorySemanticsOutputMemoryKHRMask = 0x00001000,
|
MemorySemanticsOutputMemoryKHRMask = 0x00001000,
|
||||||
|
MemorySemanticsMakeAvailableMask = 0x00002000,
|
||||||
MemorySemanticsMakeAvailableKHRMask = 0x00002000,
|
MemorySemanticsMakeAvailableKHRMask = 0x00002000,
|
||||||
|
MemorySemanticsMakeVisibleMask = 0x00004000,
|
||||||
MemorySemanticsMakeVisibleKHRMask = 0x00004000,
|
MemorySemanticsMakeVisibleKHRMask = 0x00004000,
|
||||||
|
MemorySemanticsVolatileMask = 0x00008000,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MemoryAccessShift {
|
enum MemoryAccessShift {
|
||||||
MemoryAccessVolatileShift = 0,
|
MemoryAccessVolatileShift = 0,
|
||||||
MemoryAccessAlignedShift = 1,
|
MemoryAccessAlignedShift = 1,
|
||||||
MemoryAccessNontemporalShift = 2,
|
MemoryAccessNontemporalShift = 2,
|
||||||
|
MemoryAccessMakePointerAvailableShift = 3,
|
||||||
MemoryAccessMakePointerAvailableKHRShift = 3,
|
MemoryAccessMakePointerAvailableKHRShift = 3,
|
||||||
|
MemoryAccessMakePointerVisibleShift = 4,
|
||||||
MemoryAccessMakePointerVisibleKHRShift = 4,
|
MemoryAccessMakePointerVisibleKHRShift = 4,
|
||||||
|
MemoryAccessNonPrivatePointerShift = 5,
|
||||||
MemoryAccessNonPrivatePointerKHRShift = 5,
|
MemoryAccessNonPrivatePointerKHRShift = 5,
|
||||||
MemoryAccessMax = 0x7fffffff,
|
MemoryAccessMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
@ -657,8 +693,11 @@ enum MemoryAccessMask {
|
|||||||
MemoryAccessVolatileMask = 0x00000001,
|
MemoryAccessVolatileMask = 0x00000001,
|
||||||
MemoryAccessAlignedMask = 0x00000002,
|
MemoryAccessAlignedMask = 0x00000002,
|
||||||
MemoryAccessNontemporalMask = 0x00000004,
|
MemoryAccessNontemporalMask = 0x00000004,
|
||||||
|
MemoryAccessMakePointerAvailableMask = 0x00000008,
|
||||||
MemoryAccessMakePointerAvailableKHRMask = 0x00000008,
|
MemoryAccessMakePointerAvailableKHRMask = 0x00000008,
|
||||||
|
MemoryAccessMakePointerVisibleMask = 0x00000010,
|
||||||
MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
|
MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
|
||||||
|
MemoryAccessNonPrivatePointerMask = 0x00000020,
|
||||||
MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
|
MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -668,6 +707,7 @@ enum Scope {
|
|||||||
ScopeWorkgroup = 2,
|
ScopeWorkgroup = 2,
|
||||||
ScopeSubgroup = 3,
|
ScopeSubgroup = 3,
|
||||||
ScopeInvocation = 4,
|
ScopeInvocation = 4,
|
||||||
|
ScopeQueueFamily = 5,
|
||||||
ScopeQueueFamilyKHR = 5,
|
ScopeQueueFamilyKHR = 5,
|
||||||
ScopeMax = 0x7fffffff,
|
ScopeMax = 0x7fffffff,
|
||||||
};
|
};
|
||||||
@ -768,6 +808,8 @@ enum Capability {
|
|||||||
CapabilityGroupNonUniformShuffleRelative = 66,
|
CapabilityGroupNonUniformShuffleRelative = 66,
|
||||||
CapabilityGroupNonUniformClustered = 67,
|
CapabilityGroupNonUniformClustered = 67,
|
||||||
CapabilityGroupNonUniformQuad = 68,
|
CapabilityGroupNonUniformQuad = 68,
|
||||||
|
CapabilityShaderLayer = 69,
|
||||||
|
CapabilityShaderViewportIndex = 70,
|
||||||
CapabilitySubgroupBallotKHR = 4423,
|
CapabilitySubgroupBallotKHR = 4423,
|
||||||
CapabilityDrawParameters = 4427,
|
CapabilityDrawParameters = 4427,
|
||||||
CapabilitySubgroupVoteKHR = 4431,
|
CapabilitySubgroupVoteKHR = 4431,
|
||||||
@ -796,6 +838,7 @@ enum Capability {
|
|||||||
CapabilityFragmentMaskAMD = 5010,
|
CapabilityFragmentMaskAMD = 5010,
|
||||||
CapabilityStencilExportEXT = 5013,
|
CapabilityStencilExportEXT = 5013,
|
||||||
CapabilityImageReadWriteLodAMD = 5015,
|
CapabilityImageReadWriteLodAMD = 5015,
|
||||||
|
CapabilityShaderClockKHR = 5055,
|
||||||
CapabilitySampleMaskOverrideCoverageNV = 5249,
|
CapabilitySampleMaskOverrideCoverageNV = 5249,
|
||||||
CapabilityGeometryShaderPassthroughNV = 5251,
|
CapabilityGeometryShaderPassthroughNV = 5251,
|
||||||
CapabilityShaderViewportIndexLayerEXT = 5254,
|
CapabilityShaderViewportIndexLayerEXT = 5254,
|
||||||
@ -811,28 +854,49 @@ enum Capability {
|
|||||||
CapabilityFragmentDensityEXT = 5291,
|
CapabilityFragmentDensityEXT = 5291,
|
||||||
CapabilityShadingRateNV = 5291,
|
CapabilityShadingRateNV = 5291,
|
||||||
CapabilityGroupNonUniformPartitionedNV = 5297,
|
CapabilityGroupNonUniformPartitionedNV = 5297,
|
||||||
|
CapabilityShaderNonUniform = 5301,
|
||||||
CapabilityShaderNonUniformEXT = 5301,
|
CapabilityShaderNonUniformEXT = 5301,
|
||||||
|
CapabilityRuntimeDescriptorArray = 5302,
|
||||||
CapabilityRuntimeDescriptorArrayEXT = 5302,
|
CapabilityRuntimeDescriptorArrayEXT = 5302,
|
||||||
|
CapabilityInputAttachmentArrayDynamicIndexing = 5303,
|
||||||
CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303,
|
CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303,
|
||||||
|
CapabilityUniformTexelBufferArrayDynamicIndexing = 5304,
|
||||||
CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304,
|
CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304,
|
||||||
|
CapabilityStorageTexelBufferArrayDynamicIndexing = 5305,
|
||||||
CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305,
|
CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305,
|
||||||
|
CapabilityUniformBufferArrayNonUniformIndexing = 5306,
|
||||||
CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306,
|
CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306,
|
||||||
|
CapabilitySampledImageArrayNonUniformIndexing = 5307,
|
||||||
CapabilitySampledImageArrayNonUniformIndexingEXT = 5307,
|
CapabilitySampledImageArrayNonUniformIndexingEXT = 5307,
|
||||||
|
CapabilityStorageBufferArrayNonUniformIndexing = 5308,
|
||||||
CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308,
|
CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308,
|
||||||
|
CapabilityStorageImageArrayNonUniformIndexing = 5309,
|
||||||
CapabilityStorageImageArrayNonUniformIndexingEXT = 5309,
|
CapabilityStorageImageArrayNonUniformIndexingEXT = 5309,
|
||||||
|
CapabilityInputAttachmentArrayNonUniformIndexing = 5310,
|
||||||
CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
|
CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
|
||||||
|
CapabilityUniformTexelBufferArrayNonUniformIndexing = 5311,
|
||||||
CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
|
CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
|
||||||
|
CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
|
||||||
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
|
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
|
||||||
CapabilityRayTracingNV = 5340,
|
CapabilityRayTracingNV = 5340,
|
||||||
|
CapabilityVulkanMemoryModel = 5345,
|
||||||
CapabilityVulkanMemoryModelKHR = 5345,
|
CapabilityVulkanMemoryModelKHR = 5345,
|
||||||
|
CapabilityVulkanMemoryModelDeviceScope = 5346,
|
||||||
CapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
|
CapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
|
||||||
|
CapabilityPhysicalStorageBufferAddresses = 5347,
|
||||||
CapabilityPhysicalStorageBufferAddressesEXT = 5347,
|
CapabilityPhysicalStorageBufferAddressesEXT = 5347,
|
||||||
CapabilityComputeDerivativeGroupLinearNV = 5350,
|
CapabilityComputeDerivativeGroupLinearNV = 5350,
|
||||||
CapabilityCooperativeMatrixNV = 5357,
|
CapabilityCooperativeMatrixNV = 5357,
|
||||||
|
CapabilityFragmentShaderSampleInterlockEXT = 5363,
|
||||||
|
CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
|
||||||
|
CapabilityShaderSMBuiltinsNV = 5373,
|
||||||
|
CapabilityFragmentShaderPixelInterlockEXT = 5378,
|
||||||
|
CapabilityDemoteToHelperInvocationEXT = 5379,
|
||||||
CapabilitySubgroupShuffleINTEL = 5568,
|
CapabilitySubgroupShuffleINTEL = 5568,
|
||||||
CapabilitySubgroupBufferBlockIOINTEL = 5569,
|
CapabilitySubgroupBufferBlockIOINTEL = 5569,
|
||||||
CapabilitySubgroupImageBlockIOINTEL = 5570,
|
CapabilitySubgroupImageBlockIOINTEL = 5570,
|
||||||
CapabilitySubgroupImageMediaBlockIOINTEL = 5579,
|
CapabilitySubgroupImageMediaBlockIOINTEL = 5579,
|
||||||
|
CapabilityIntegerFunctions2INTEL = 5584,
|
||||||
CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
|
CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
|
||||||
CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
|
CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
|
||||||
CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
|
CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
|
||||||
@ -1200,6 +1264,7 @@ enum Op {
|
|||||||
OpGroupSMaxNonUniformAMD = 5007,
|
OpGroupSMaxNonUniformAMD = 5007,
|
||||||
OpFragmentMaskFetchAMD = 5011,
|
OpFragmentMaskFetchAMD = 5011,
|
||||||
OpFragmentFetchAMD = 5012,
|
OpFragmentFetchAMD = 5012,
|
||||||
|
OpReadClockKHR = 5056,
|
||||||
OpImageSampleFootprintNV = 5283,
|
OpImageSampleFootprintNV = 5283,
|
||||||
OpGroupNonUniformPartitionNV = 5296,
|
OpGroupNonUniformPartitionNV = 5296,
|
||||||
OpWritePackedPrimitiveIndices4x8NV = 5299,
|
OpWritePackedPrimitiveIndices4x8NV = 5299,
|
||||||
@ -1214,6 +1279,10 @@ enum Op {
|
|||||||
OpCooperativeMatrixStoreNV = 5360,
|
OpCooperativeMatrixStoreNV = 5360,
|
||||||
OpCooperativeMatrixMulAddNV = 5361,
|
OpCooperativeMatrixMulAddNV = 5361,
|
||||||
OpCooperativeMatrixLengthNV = 5362,
|
OpCooperativeMatrixLengthNV = 5362,
|
||||||
|
OpBeginInvocationInterlockEXT = 5364,
|
||||||
|
OpEndInvocationInterlockEXT = 5365,
|
||||||
|
OpDemoteToHelperInvocationEXT = 5380,
|
||||||
|
OpIsHelperInvocationEXT = 5381,
|
||||||
OpSubgroupShuffleINTEL = 5571,
|
OpSubgroupShuffleINTEL = 5571,
|
||||||
OpSubgroupShuffleDownINTEL = 5572,
|
OpSubgroupShuffleDownINTEL = 5572,
|
||||||
OpSubgroupShuffleUpINTEL = 5573,
|
OpSubgroupShuffleUpINTEL = 5573,
|
||||||
@ -1224,6 +1293,20 @@ enum Op {
|
|||||||
OpSubgroupImageBlockWriteINTEL = 5578,
|
OpSubgroupImageBlockWriteINTEL = 5578,
|
||||||
OpSubgroupImageMediaBlockReadINTEL = 5580,
|
OpSubgroupImageMediaBlockReadINTEL = 5580,
|
||||||
OpSubgroupImageMediaBlockWriteINTEL = 5581,
|
OpSubgroupImageMediaBlockWriteINTEL = 5581,
|
||||||
|
OpUCountLeadingZerosINTEL = 5585,
|
||||||
|
OpUCountTrailingZerosINTEL = 5586,
|
||||||
|
OpAbsISubINTEL = 5587,
|
||||||
|
OpAbsUSubINTEL = 5588,
|
||||||
|
OpIAddSatINTEL = 5589,
|
||||||
|
OpUAddSatINTEL = 5590,
|
||||||
|
OpIAverageINTEL = 5591,
|
||||||
|
OpUAverageINTEL = 5592,
|
||||||
|
OpIAverageRoundedINTEL = 5593,
|
||||||
|
OpUAverageRoundedINTEL = 5594,
|
||||||
|
OpISubSatINTEL = 5595,
|
||||||
|
OpUSubSatINTEL = 5596,
|
||||||
|
OpIMul32x16INTEL = 5597,
|
||||||
|
OpUMul32x16INTEL = 5598,
|
||||||
OpDecorateString = 5632,
|
OpDecorateString = 5632,
|
||||||
OpDecorateStringGOOGLE = 5632,
|
OpDecorateStringGOOGLE = 5632,
|
||||||
OpMemberDecorateString = 5633,
|
OpMemberDecorateString = 5633,
|
||||||
@ -1714,6 +1797,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
|||||||
case OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
|
case OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
|
case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
|
case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
|
case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
|
case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
|
case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
|
||||||
@ -1728,6 +1812,10 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
|||||||
case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
|
case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
|
||||||
case OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break;
|
case OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
|
case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
|
||||||
|
case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
|
||||||
|
case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
|
||||||
|
case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
|
case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
|
case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
|
case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
@ -1738,10 +1826,22 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
|||||||
case OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
|
case OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
|
||||||
case OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
|
case OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
|
case OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
|
||||||
|
case OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpIAverageINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpUAverageINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpISubSatINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
|
case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpDecorateString: *hasResult = false; *hasResultType = false; break;
|
case OpDecorateString: *hasResult = false; *hasResultType = false; break;
|
||||||
case OpDecorateStringGOOGLE: *hasResult = false; *hasResultType = false; break;
|
|
||||||
case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
|
case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
|
||||||
case OpMemberDecorateStringGOOGLE: *hasResult = false; *hasResultType = false; break;
|
|
||||||
case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
|
case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
|
||||||
case OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break;
|
case OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break;
|
||||||
case OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break;
|
case OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break;
|
||||||
|
53
thirdparty/glslang/SPIRV/spvIR.h
vendored
Normal file → Executable file
53
thirdparty/glslang/SPIRV/spvIR.h
vendored
Normal file → Executable file
@ -226,6 +226,36 @@ public:
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change this block into a canonical dead merge block. Delete instructions
|
||||||
|
// as necessary. A canonical dead merge block has only an OpLabel and an
|
||||||
|
// OpUnreachable.
|
||||||
|
void rewriteAsCanonicalUnreachableMerge() {
|
||||||
|
assert(localVariables.empty());
|
||||||
|
// Delete all instructions except for the label.
|
||||||
|
assert(instructions.size() > 0);
|
||||||
|
instructions.resize(1);
|
||||||
|
successors.clear();
|
||||||
|
Instruction* unreachable = new Instruction(OpUnreachable);
|
||||||
|
addInstruction(std::unique_ptr<Instruction>(unreachable));
|
||||||
|
}
|
||||||
|
// Change this block into a canonical dead continue target branching to the
|
||||||
|
// given header ID. Delete instructions as necessary. A canonical dead continue
|
||||||
|
// target has only an OpLabel and an unconditional branch back to the corresponding
|
||||||
|
// header.
|
||||||
|
void rewriteAsCanonicalUnreachableContinue(Block* header) {
|
||||||
|
assert(localVariables.empty());
|
||||||
|
// Delete all instructions except for the label.
|
||||||
|
assert(instructions.size() > 0);
|
||||||
|
instructions.resize(1);
|
||||||
|
successors.clear();
|
||||||
|
// Add OpBranch back to the header.
|
||||||
|
assert(header != nullptr);
|
||||||
|
Instruction* branch = new Instruction(OpBranch);
|
||||||
|
branch->addIdOperand(header->getId());
|
||||||
|
addInstruction(std::unique_ptr<Instruction>(branch));
|
||||||
|
successors.push_back(header);
|
||||||
|
}
|
||||||
|
|
||||||
bool isTerminated() const
|
bool isTerminated() const
|
||||||
{
|
{
|
||||||
switch (instructions.back()->getOpCode()) {
|
switch (instructions.back()->getOpCode()) {
|
||||||
@ -235,6 +265,7 @@ public:
|
|||||||
case OpKill:
|
case OpKill:
|
||||||
case OpReturn:
|
case OpReturn:
|
||||||
case OpReturnValue:
|
case OpReturnValue:
|
||||||
|
case OpUnreachable:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -268,10 +299,24 @@ protected:
|
|||||||
bool unreachable;
|
bool unreachable;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The different reasons for reaching a block in the inReadableOrder traversal.
|
||||||
|
enum ReachReason {
|
||||||
|
// Reachable from the entry block via transfers of control, i.e. branches.
|
||||||
|
ReachViaControlFlow = 0,
|
||||||
|
// A continue target that is not reachable via control flow.
|
||||||
|
ReachDeadContinue,
|
||||||
|
// A merge block that is not reachable via control flow.
|
||||||
|
ReachDeadMerge
|
||||||
|
};
|
||||||
|
|
||||||
// Traverses the control-flow graph rooted at root in an order suited for
|
// Traverses the control-flow graph rooted at root in an order suited for
|
||||||
// readable code generation. Invokes callback at every node in the traversal
|
// readable code generation. Invokes callback at every node in the traversal
|
||||||
// order.
|
// order. The callback arguments are:
|
||||||
void inReadableOrder(Block* root, std::function<void(Block*)> callback);
|
// - the block,
|
||||||
|
// - the reason we reached the block,
|
||||||
|
// - if the reason was that block is an unreachable continue or unreachable merge block
|
||||||
|
// then the last parameter is the corresponding header block.
|
||||||
|
void inReadableOrder(Block* root, std::function<void(Block*, ReachReason, Block* header)> callback);
|
||||||
|
|
||||||
//
|
//
|
||||||
// SPIR-V IR Function.
|
// SPIR-V IR Function.
|
||||||
@ -321,7 +366,7 @@ public:
|
|||||||
parameterInstructions[p]->dump(out);
|
parameterInstructions[p]->dump(out);
|
||||||
|
|
||||||
// Blocks
|
// Blocks
|
||||||
inReadableOrder(blocks[0], [&out](const Block* b) { b->dump(out); });
|
inReadableOrder(blocks[0], [&out](const Block* b, ReachReason, Block*) { b->dump(out); });
|
||||||
Instruction end(0, 0, OpFunctionEnd);
|
Instruction end(0, 0, OpFunctionEnd);
|
||||||
end.dump(out);
|
end.dump(out);
|
||||||
}
|
}
|
||||||
@ -436,6 +481,6 @@ __inline void Block::addInstruction(std::unique_ptr<Instruction> inst)
|
|||||||
parent.getParent().mapInstruction(raw_instruction);
|
parent.getParent().mapInstruction(raw_instruction);
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end spv namespace
|
} // end spv namespace
|
||||||
|
|
||||||
#endif // spvIR_H
|
#endif // spvIR_H
|
||||||
|
66
thirdparty/glslang/glslang/Include/BaseTypes.h
vendored
66
thirdparty/glslang/glslang/Include/BaseTypes.h
vendored
@ -61,11 +61,7 @@ enum TBasicType {
|
|||||||
EbtSampler,
|
EbtSampler,
|
||||||
EbtStruct,
|
EbtStruct,
|
||||||
EbtBlock,
|
EbtBlock,
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
EbtAccStructNV,
|
EbtAccStructNV,
|
||||||
#endif
|
|
||||||
|
|
||||||
EbtReference,
|
EbtReference,
|
||||||
|
|
||||||
// HLSL types that live only temporarily.
|
// HLSL types that live only temporarily.
|
||||||
@ -94,13 +90,11 @@ enum TStorageQualifier {
|
|||||||
EvqBuffer, // read/write, shared with app
|
EvqBuffer, // read/write, shared with app
|
||||||
EvqShared, // compute shader's read/write 'shared' qualifier
|
EvqShared, // compute shader's read/write 'shared' qualifier
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
EvqPayloadNV,
|
EvqPayloadNV,
|
||||||
EvqPayloadInNV,
|
EvqPayloadInNV,
|
||||||
EvqHitAttrNV,
|
EvqHitAttrNV,
|
||||||
EvqCallableDataNV,
|
EvqCallableDataNV,
|
||||||
EvqCallableDataInNV,
|
EvqCallableDataInNV,
|
||||||
#endif
|
|
||||||
|
|
||||||
// parameters
|
// parameters
|
||||||
EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter
|
EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter
|
||||||
@ -221,7 +215,6 @@ enum TBuiltInVariable {
|
|||||||
EbvSampleMask,
|
EbvSampleMask,
|
||||||
EbvHelperInvocation,
|
EbvHelperInvocation,
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
EbvBaryCoordNoPersp,
|
EbvBaryCoordNoPersp,
|
||||||
EbvBaryCoordNoPerspCentroid,
|
EbvBaryCoordNoPerspCentroid,
|
||||||
EbvBaryCoordNoPerspSample,
|
EbvBaryCoordNoPerspSample,
|
||||||
@ -229,7 +222,6 @@ enum TBuiltInVariable {
|
|||||||
EbvBaryCoordSmoothCentroid,
|
EbvBaryCoordSmoothCentroid,
|
||||||
EbvBaryCoordSmoothSample,
|
EbvBaryCoordSmoothSample,
|
||||||
EbvBaryCoordPullModel,
|
EbvBaryCoordPullModel,
|
||||||
#endif
|
|
||||||
|
|
||||||
EbvViewIndex,
|
EbvViewIndex,
|
||||||
EbvDeviceIndex,
|
EbvDeviceIndex,
|
||||||
@ -237,7 +229,6 @@ enum TBuiltInVariable {
|
|||||||
EbvFragSizeEXT,
|
EbvFragSizeEXT,
|
||||||
EbvFragInvocationCountEXT,
|
EbvFragInvocationCountEXT,
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
EbvViewportMaskNV,
|
EbvViewportMaskNV,
|
||||||
EbvSecondaryPositionNV,
|
EbvSecondaryPositionNV,
|
||||||
EbvSecondaryViewportMaskNV,
|
EbvSecondaryViewportMaskNV,
|
||||||
@ -261,8 +252,10 @@ enum TBuiltInVariable {
|
|||||||
EbvObjectToWorldNV,
|
EbvObjectToWorldNV,
|
||||||
EbvWorldToObjectNV,
|
EbvWorldToObjectNV,
|
||||||
EbvIncomingRayFlagsNV,
|
EbvIncomingRayFlagsNV,
|
||||||
|
// barycentrics
|
||||||
EbvBaryCoordNV,
|
EbvBaryCoordNV,
|
||||||
EbvBaryCoordNoPerspNV,
|
EbvBaryCoordNoPerspNV,
|
||||||
|
// mesh shaders
|
||||||
EbvTaskCountNV,
|
EbvTaskCountNV,
|
||||||
EbvPrimitiveCountNV,
|
EbvPrimitiveCountNV,
|
||||||
EbvPrimitiveIndicesNV,
|
EbvPrimitiveIndicesNV,
|
||||||
@ -271,7 +264,12 @@ enum TBuiltInVariable {
|
|||||||
EbvLayerPerViewNV,
|
EbvLayerPerViewNV,
|
||||||
EbvMeshViewCountNV,
|
EbvMeshViewCountNV,
|
||||||
EbvMeshViewIndicesNV,
|
EbvMeshViewIndicesNV,
|
||||||
#endif
|
|
||||||
|
// sm builtins
|
||||||
|
EbvWarpsPerSM,
|
||||||
|
EbvSMCount,
|
||||||
|
EbvWarpID,
|
||||||
|
EbvSMID,
|
||||||
|
|
||||||
// HLSL built-ins that live only temporarily, until they get remapped
|
// HLSL built-ins that live only temporarily, until they get remapped
|
||||||
// to one of the above.
|
// to one of the above.
|
||||||
@ -291,6 +289,19 @@ enum TBuiltInVariable {
|
|||||||
EbvLast
|
EbvLast
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// In this enum, order matters; users can assume higher precision is a bigger value
|
||||||
|
// and EpqNone is 0.
|
||||||
|
enum TPrecisionQualifier {
|
||||||
|
EpqNone = 0,
|
||||||
|
EpqLow,
|
||||||
|
EpqMedium,
|
||||||
|
EpqHigh
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
__inline const char* GetStorageQualifierString(TStorageQualifier q) { return ""; }
|
||||||
|
__inline const char* GetPrecisionQualifierString(TPrecisionQualifier p) { return ""; }
|
||||||
|
#else
|
||||||
// These will show up in error messages
|
// These will show up in error messages
|
||||||
__inline const char* GetStorageQualifierString(TStorageQualifier q)
|
__inline const char* GetStorageQualifierString(TStorageQualifier q)
|
||||||
{
|
{
|
||||||
@ -317,13 +328,11 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q)
|
|||||||
case EvqPointCoord: return "gl_PointCoord"; break;
|
case EvqPointCoord: return "gl_PointCoord"; break;
|
||||||
case EvqFragColor: return "fragColor"; break;
|
case EvqFragColor: return "fragColor"; break;
|
||||||
case EvqFragDepth: return "gl_FragDepth"; break;
|
case EvqFragDepth: return "gl_FragDepth"; break;
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EvqPayloadNV: return "rayPayloadNV"; break;
|
case EvqPayloadNV: return "rayPayloadNV"; break;
|
||||||
case EvqPayloadInNV: return "rayPayloadInNV"; break;
|
case EvqPayloadInNV: return "rayPayloadInNV"; break;
|
||||||
case EvqHitAttrNV: return "hitAttributeNV"; break;
|
case EvqHitAttrNV: return "hitAttributeNV"; break;
|
||||||
case EvqCallableDataNV: return "callableDataNV"; break;
|
case EvqCallableDataNV: return "callableDataNV"; break;
|
||||||
case EvqCallableDataInNV: return "callableDataInNV"; break;
|
case EvqCallableDataInNV: return "callableDataInNV"; break;
|
||||||
#endif
|
|
||||||
default: return "unknown qualifier";
|
default: return "unknown qualifier";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -338,6 +347,8 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
|||||||
case EbvLocalInvocationId: return "LocalInvocationID";
|
case EbvLocalInvocationId: return "LocalInvocationID";
|
||||||
case EbvGlobalInvocationId: return "GlobalInvocationID";
|
case EbvGlobalInvocationId: return "GlobalInvocationID";
|
||||||
case EbvLocalInvocationIndex: return "LocalInvocationIndex";
|
case EbvLocalInvocationIndex: return "LocalInvocationIndex";
|
||||||
|
case EbvNumSubgroups: return "NumSubgroups";
|
||||||
|
case EbvSubgroupID: return "SubgroupID";
|
||||||
case EbvSubGroupSize: return "SubGroupSize";
|
case EbvSubGroupSize: return "SubGroupSize";
|
||||||
case EbvSubGroupInvocation: return "SubGroupInvocation";
|
case EbvSubGroupInvocation: return "SubGroupInvocation";
|
||||||
case EbvSubGroupEqMask: return "SubGroupEqMask";
|
case EbvSubGroupEqMask: return "SubGroupEqMask";
|
||||||
@ -345,6 +356,13 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
|||||||
case EbvSubGroupGtMask: return "SubGroupGtMask";
|
case EbvSubGroupGtMask: return "SubGroupGtMask";
|
||||||
case EbvSubGroupLeMask: return "SubGroupLeMask";
|
case EbvSubGroupLeMask: return "SubGroupLeMask";
|
||||||
case EbvSubGroupLtMask: return "SubGroupLtMask";
|
case EbvSubGroupLtMask: return "SubGroupLtMask";
|
||||||
|
case EbvSubgroupSize2: return "SubgroupSize";
|
||||||
|
case EbvSubgroupInvocation2: return "SubgroupInvocationID";
|
||||||
|
case EbvSubgroupEqMask2: return "SubgroupEqMask";
|
||||||
|
case EbvSubgroupGeMask2: return "SubgroupGeMask";
|
||||||
|
case EbvSubgroupGtMask2: return "SubgroupGtMask";
|
||||||
|
case EbvSubgroupLeMask2: return "SubgroupLeMask";
|
||||||
|
case EbvSubgroupLtMask2: return "SubgroupLtMask";
|
||||||
case EbvVertexId: return "VertexId";
|
case EbvVertexId: return "VertexId";
|
||||||
case EbvInstanceId: return "InstanceId";
|
case EbvInstanceId: return "InstanceId";
|
||||||
case EbvVertexIndex: return "VertexIndex";
|
case EbvVertexIndex: return "VertexIndex";
|
||||||
@ -396,7 +414,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
|||||||
case EbvSampleMask: return "SampleMaskIn";
|
case EbvSampleMask: return "SampleMaskIn";
|
||||||
case EbvHelperInvocation: return "HelperInvocation";
|
case EbvHelperInvocation: return "HelperInvocation";
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EbvBaryCoordNoPersp: return "BaryCoordNoPersp";
|
case EbvBaryCoordNoPersp: return "BaryCoordNoPersp";
|
||||||
case EbvBaryCoordNoPerspCentroid: return "BaryCoordNoPerspCentroid";
|
case EbvBaryCoordNoPerspCentroid: return "BaryCoordNoPerspCentroid";
|
||||||
case EbvBaryCoordNoPerspSample: return "BaryCoordNoPerspSample";
|
case EbvBaryCoordNoPerspSample: return "BaryCoordNoPerspSample";
|
||||||
@ -404,7 +421,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
|||||||
case EbvBaryCoordSmoothCentroid: return "BaryCoordSmoothCentroid";
|
case EbvBaryCoordSmoothCentroid: return "BaryCoordSmoothCentroid";
|
||||||
case EbvBaryCoordSmoothSample: return "BaryCoordSmoothSample";
|
case EbvBaryCoordSmoothSample: return "BaryCoordSmoothSample";
|
||||||
case EbvBaryCoordPullModel: return "BaryCoordPullModel";
|
case EbvBaryCoordPullModel: return "BaryCoordPullModel";
|
||||||
#endif
|
|
||||||
|
|
||||||
case EbvViewIndex: return "ViewIndex";
|
case EbvViewIndex: return "ViewIndex";
|
||||||
case EbvDeviceIndex: return "DeviceIndex";
|
case EbvDeviceIndex: return "DeviceIndex";
|
||||||
@ -412,7 +428,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
|||||||
case EbvFragSizeEXT: return "FragSizeEXT";
|
case EbvFragSizeEXT: return "FragSizeEXT";
|
||||||
case EbvFragInvocationCountEXT: return "FragInvocationCountEXT";
|
case EbvFragInvocationCountEXT: return "FragInvocationCountEXT";
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EbvViewportMaskNV: return "ViewportMaskNV";
|
case EbvViewportMaskNV: return "ViewportMaskNV";
|
||||||
case EbvSecondaryPositionNV: return "SecondaryPositionNV";
|
case EbvSecondaryPositionNV: return "SecondaryPositionNV";
|
||||||
case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
|
case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
|
||||||
@ -438,6 +453,7 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
|||||||
|
|
||||||
case EbvBaryCoordNV: return "BaryCoordNV";
|
case EbvBaryCoordNV: return "BaryCoordNV";
|
||||||
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
|
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
|
||||||
|
|
||||||
case EbvTaskCountNV: return "TaskCountNV";
|
case EbvTaskCountNV: return "TaskCountNV";
|
||||||
case EbvPrimitiveCountNV: return "PrimitiveCountNV";
|
case EbvPrimitiveCountNV: return "PrimitiveCountNV";
|
||||||
case EbvPrimitiveIndicesNV: return "PrimitiveIndicesNV";
|
case EbvPrimitiveIndicesNV: return "PrimitiveIndicesNV";
|
||||||
@ -446,20 +462,16 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
|||||||
case EbvLayerPerViewNV: return "LayerPerViewNV";
|
case EbvLayerPerViewNV: return "LayerPerViewNV";
|
||||||
case EbvMeshViewCountNV: return "MeshViewCountNV";
|
case EbvMeshViewCountNV: return "MeshViewCountNV";
|
||||||
case EbvMeshViewIndicesNV: return "MeshViewIndicesNV";
|
case EbvMeshViewIndicesNV: return "MeshViewIndicesNV";
|
||||||
#endif
|
|
||||||
|
case EbvWarpsPerSM: return "WarpsPerSMNV";
|
||||||
|
case EbvSMCount: return "SMCountNV";
|
||||||
|
case EbvWarpID: return "WarpIDNV";
|
||||||
|
case EbvSMID: return "SMIDNV";
|
||||||
|
|
||||||
default: return "unknown built-in variable";
|
default: return "unknown built-in variable";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// In this enum, order matters; users can assume higher precision is a bigger value
|
|
||||||
// and EpqNone is 0.
|
|
||||||
enum TPrecisionQualifier {
|
|
||||||
EpqNone = 0,
|
|
||||||
EpqLow,
|
|
||||||
EpqMedium,
|
|
||||||
EpqHigh
|
|
||||||
};
|
|
||||||
|
|
||||||
__inline const char* GetPrecisionQualifierString(TPrecisionQualifier p)
|
__inline const char* GetPrecisionQualifierString(TPrecisionQualifier p)
|
||||||
{
|
{
|
||||||
switch (p) {
|
switch (p) {
|
||||||
@ -470,6 +482,7 @@ __inline const char* GetPrecisionQualifierString(TPrecisionQualifier p)
|
|||||||
default: return "unknown precision qualifier";
|
default: return "unknown precision qualifier";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
__inline bool isTypeSignedInt(TBasicType type)
|
__inline bool isTypeSignedInt(TBasicType type)
|
||||||
{
|
{
|
||||||
@ -514,7 +527,8 @@ __inline bool isTypeFloat(TBasicType type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline int getTypeRank(TBasicType type) {
|
__inline int getTypeRank(TBasicType type)
|
||||||
|
{
|
||||||
int res = -1;
|
int res = -1;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
|
226
thirdparty/glslang/glslang/Include/ConstantUnion.h
vendored
226
thirdparty/glslang/glslang/Include/ConstantUnion.h
vendored
@ -213,6 +213,28 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt:
|
||||||
|
if (constant.iConst == iConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case EbtUint:
|
||||||
|
if (constant.uConst == uConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case EbtBool:
|
||||||
|
if (constant.bConst == bConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case EbtDouble:
|
||||||
|
if (constant.dConst == dConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt16:
|
case EbtInt16:
|
||||||
if (constant.i16Const == i16Const)
|
if (constant.i16Const == i16Const)
|
||||||
return true;
|
return true;
|
||||||
@ -232,16 +254,6 @@ public:
|
|||||||
if (constant.u8Const == u8Const)
|
if (constant.u8Const == u8Const)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
break;
|
|
||||||
case EbtInt:
|
|
||||||
if (constant.iConst == iConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case EbtUint:
|
|
||||||
if (constant.uConst == uConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
if (constant.i64Const == i64Const)
|
if (constant.i64Const == i64Const)
|
||||||
@ -253,16 +265,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case EbtDouble:
|
#endif
|
||||||
if (constant.dConst == dConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case EbtBool:
|
|
||||||
if (constant.bConst == bConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
assert(false && "Default missing");
|
assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
@ -329,6 +332,22 @@ public:
|
|||||||
{
|
{
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt:
|
||||||
|
if (iConst > constant.iConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
case EbtUint:
|
||||||
|
if (uConst > constant.uConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
case EbtDouble:
|
||||||
|
if (dConst > constant.dConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
if (i8Const > constant.i8Const)
|
if (i8Const > constant.i8Const)
|
||||||
return true;
|
return true;
|
||||||
@ -348,16 +367,6 @@ public:
|
|||||||
if (u16Const > constant.u16Const)
|
if (u16Const > constant.u16Const)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
|
||||||
case EbtInt:
|
|
||||||
if (iConst > constant.iConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
case EbtUint:
|
|
||||||
if (uConst > constant.uConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
if (i64Const > constant.i64Const)
|
if (i64Const > constant.i64Const)
|
||||||
@ -369,11 +378,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
case EbtDouble:
|
#endif
|
||||||
if (dConst > constant.dConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
default:
|
default:
|
||||||
assert(false && "Default missing");
|
assert(false && "Default missing");
|
||||||
return false;
|
return false;
|
||||||
@ -384,6 +389,7 @@ public:
|
|||||||
{
|
{
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
if (i8Const < constant.i8Const)
|
if (i8Const < constant.i8Const)
|
||||||
return true;
|
return true;
|
||||||
@ -402,17 +408,6 @@ public:
|
|||||||
case EbtUint16:
|
case EbtUint16:
|
||||||
if (u16Const < constant.u16Const)
|
if (u16Const < constant.u16Const)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
|
||||||
case EbtInt:
|
|
||||||
if (iConst < constant.iConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
case EbtUint:
|
|
||||||
if (uConst < constant.uConst)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
if (i64Const < constant.i64Const)
|
if (i64Const < constant.i64Const)
|
||||||
@ -424,10 +419,21 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
if (dConst < constant.dConst)
|
if (dConst < constant.dConst)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
case EbtInt:
|
||||||
|
if (iConst < constant.iConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
case EbtUint:
|
||||||
|
if (uConst < constant.uConst)
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
assert(false && "Default missing");
|
assert(false && "Default missing");
|
||||||
@ -440,15 +446,17 @@ public:
|
|||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst + constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst + constant.uConst); break;
|
||||||
|
case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const + constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const + constant.i8Const); break;
|
||||||
case EbtInt16: returnValue.setI16Const(i16Const + constant.i16Const); break;
|
case EbtInt16: returnValue.setI16Const(i16Const + constant.i16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(iConst + constant.iConst); break;
|
|
||||||
case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break;
|
case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break;
|
||||||
case EbtUint8: returnValue.setU8Const(u8Const + constant.u8Const); break;
|
case EbtUint8: returnValue.setU8Const(u8Const + constant.u8Const); break;
|
||||||
case EbtUint16: returnValue.setU16Const(u16Const + constant.u16Const); break;
|
case EbtUint16: returnValue.setU16Const(u16Const + constant.u16Const); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst + constant.uConst); break;
|
|
||||||
case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break;
|
case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break;
|
||||||
case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,15 +468,17 @@ public:
|
|||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst - constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst - constant.uConst); break;
|
||||||
|
case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const - constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const - constant.i8Const); break;
|
||||||
case EbtInt16: returnValue.setI16Const(i16Const - constant.i16Const); break;
|
case EbtInt16: returnValue.setI16Const(i16Const - constant.i16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(iConst - constant.iConst); break;
|
|
||||||
case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break;
|
case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break;
|
||||||
case EbtUint8: returnValue.setU8Const(u8Const - constant.u8Const); break;
|
case EbtUint8: returnValue.setU8Const(u8Const - constant.u8Const); break;
|
||||||
case EbtUint16: returnValue.setU16Const(u16Const - constant.u16Const); break;
|
case EbtUint16: returnValue.setU16Const(u16Const - constant.u16Const); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst - constant.uConst); break;
|
|
||||||
case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break;
|
case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break;
|
||||||
case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,15 +490,17 @@ public:
|
|||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst * constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst * constant.uConst); break;
|
||||||
|
case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const * constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const * constant.i8Const); break;
|
||||||
case EbtInt16: returnValue.setI16Const(i16Const * constant.i16Const); break;
|
case EbtInt16: returnValue.setI16Const(i16Const * constant.i16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(iConst * constant.iConst); break;
|
|
||||||
case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break;
|
case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break;
|
||||||
case EbtUint8: returnValue.setU8Const(u8Const * constant.u8Const); break;
|
case EbtUint8: returnValue.setU8Const(u8Const * constant.u8Const); break;
|
||||||
case EbtUint16: returnValue.setU16Const(u16Const * constant.u16Const); break;
|
case EbtUint16: returnValue.setU16Const(u16Const * constant.u16Const); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst * constant.uConst); break;
|
|
||||||
case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break;
|
case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break;
|
||||||
case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,14 +512,16 @@ public:
|
|||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst % constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst % constant.uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const % constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const % constant.i8Const); break;
|
||||||
case EbtInt16: returnValue.setI8Const(i8Const % constant.i16Const); break;
|
case EbtInt16: returnValue.setI8Const(i8Const % constant.i16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(iConst % constant.iConst); break;
|
|
||||||
case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break;
|
case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break;
|
||||||
case EbtUint8: returnValue.setU8Const(u8Const % constant.u8Const); break;
|
case EbtUint8: returnValue.setU8Const(u8Const % constant.u8Const); break;
|
||||||
case EbtUint16: returnValue.setU16Const(u16Const % constant.u16Const); break;
|
case EbtUint16: returnValue.setU16Const(u16Const % constant.u16Const); break;
|
||||||
case EbtUint: returnValue.setUConst(uConst % constant.uConst); break;
|
|
||||||
case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break;
|
case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,6 +532,7 @@ public:
|
|||||||
{
|
{
|
||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const >> constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const >> constant.i8Const); break;
|
||||||
@ -570,32 +585,38 @@ public:
|
|||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setIConst(iConst >> constant.i8Const); break;
|
case EbtInt8: returnValue.setIConst(iConst >> constant.i8Const); break;
|
||||||
case EbtUint8: returnValue.setIConst(iConst >> constant.u8Const); break;
|
case EbtUint8: returnValue.setIConst(iConst >> constant.u8Const); break;
|
||||||
case EbtInt16: returnValue.setIConst(iConst >> constant.i16Const); break;
|
case EbtInt16: returnValue.setIConst(iConst >> constant.i16Const); break;
|
||||||
case EbtUint16: returnValue.setIConst(iConst >> constant.u16Const); break;
|
case EbtUint16: returnValue.setIConst(iConst >> constant.u16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
|
|
||||||
case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break;
|
|
||||||
case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break;
|
case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break;
|
||||||
case EbtUint64: returnValue.setIConst(iConst >> constant.u64Const); break;
|
case EbtUint64: returnValue.setIConst(iConst >> constant.u64Const); break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
|
case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setUConst(uConst >> constant.i8Const); break;
|
case EbtInt8: returnValue.setUConst(uConst >> constant.i8Const); break;
|
||||||
case EbtUint8: returnValue.setUConst(uConst >> constant.u8Const); break;
|
case EbtUint8: returnValue.setUConst(uConst >> constant.u8Const); break;
|
||||||
case EbtInt16: returnValue.setUConst(uConst >> constant.i16Const); break;
|
case EbtInt16: returnValue.setUConst(uConst >> constant.i16Const); break;
|
||||||
case EbtUint16: returnValue.setUConst(uConst >> constant.u16Const); break;
|
case EbtUint16: returnValue.setUConst(uConst >> constant.u16Const); break;
|
||||||
case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break;
|
|
||||||
case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break;
|
|
||||||
case EbtInt64: returnValue.setUConst(uConst >> constant.i64Const); break;
|
case EbtInt64: returnValue.setUConst(uConst >> constant.i64Const); break;
|
||||||
case EbtUint64: returnValue.setUConst(uConst >> constant.u64Const); break;
|
case EbtUint64: returnValue.setUConst(uConst >> constant.u64Const); break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
case EbtInt8: returnValue.setI64Const(i64Const >> constant.i8Const); break;
|
case EbtInt8: returnValue.setI64Const(i64Const >> constant.i8Const); break;
|
||||||
@ -622,6 +643,7 @@ public:
|
|||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -632,6 +654,7 @@ public:
|
|||||||
{
|
{
|
||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const << constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const << constant.i8Const); break;
|
||||||
@ -684,32 +707,6 @@ public:
|
|||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EbtInt:
|
|
||||||
switch (constant.type) {
|
|
||||||
case EbtInt8: returnValue.setIConst(iConst << constant.i8Const); break;
|
|
||||||
case EbtUint8: returnValue.setIConst(iConst << constant.u8Const); break;
|
|
||||||
case EbtInt16: returnValue.setIConst(iConst << constant.i16Const); break;
|
|
||||||
case EbtUint16: returnValue.setIConst(iConst << constant.u16Const); break;
|
|
||||||
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
|
|
||||||
case EbtUint: returnValue.setIConst(iConst << constant.uConst); break;
|
|
||||||
case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break;
|
|
||||||
case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break;
|
|
||||||
default: assert(false && "Default missing");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EbtUint:
|
|
||||||
switch (constant.type) {
|
|
||||||
case EbtInt8: returnValue.setUConst(uConst << constant.i8Const); break;
|
|
||||||
case EbtUint8: returnValue.setUConst(uConst << constant.u8Const); break;
|
|
||||||
case EbtInt16: returnValue.setUConst(uConst << constant.i16Const); break;
|
|
||||||
case EbtUint16: returnValue.setUConst(uConst << constant.u16Const); break;
|
|
||||||
case EbtInt: returnValue.setUConst(uConst << constant.iConst); break;
|
|
||||||
case EbtUint: returnValue.setUConst(uConst << constant.uConst); break;
|
|
||||||
case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break;
|
|
||||||
case EbtUint64: returnValue.setUConst(uConst << constant.u64Const); break;
|
|
||||||
default: assert(false && "Default missing");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
switch (constant.type) {
|
switch (constant.type) {
|
||||||
case EbtInt8: returnValue.setI64Const(i64Const << constant.i8Const); break;
|
case EbtInt8: returnValue.setI64Const(i64Const << constant.i8Const); break;
|
||||||
@ -736,6 +733,37 @@ public:
|
|||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
case EbtInt:
|
||||||
|
switch (constant.type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setIConst(iConst << constant.uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
case EbtInt8: returnValue.setIConst(iConst << constant.i8Const); break;
|
||||||
|
case EbtUint8: returnValue.setIConst(iConst << constant.u8Const); break;
|
||||||
|
case EbtInt16: returnValue.setIConst(iConst << constant.i16Const); break;
|
||||||
|
case EbtUint16: returnValue.setIConst(iConst << constant.u16Const); break;
|
||||||
|
case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break;
|
||||||
|
#endif
|
||||||
|
default: assert(false && "Default missing");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EbtUint:
|
||||||
|
switch (constant.type) {
|
||||||
|
case EbtInt: returnValue.setUConst(uConst << constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst << constant.uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
case EbtInt8: returnValue.setUConst(uConst << constant.i8Const); break;
|
||||||
|
case EbtUint8: returnValue.setUConst(uConst << constant.u8Const); break;
|
||||||
|
case EbtInt16: returnValue.setUConst(uConst << constant.i16Const); break;
|
||||||
|
case EbtUint16: returnValue.setUConst(uConst << constant.u16Const); break;
|
||||||
|
case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break;
|
||||||
|
case EbtUint64: returnValue.setUConst(uConst << constant.u64Const); break;
|
||||||
|
#endif
|
||||||
|
default: assert(false && "Default missing");
|
||||||
|
}
|
||||||
|
break;
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,14 +775,16 @@ public:
|
|||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst & constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst & constant.uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const & constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const & constant.i8Const); break;
|
||||||
case EbtUint8: returnValue.setU8Const(u8Const & constant.u8Const); break;
|
case EbtUint8: returnValue.setU8Const(u8Const & constant.u8Const); break;
|
||||||
case EbtInt16: returnValue.setI16Const(i16Const & constant.i16Const); break;
|
case EbtInt16: returnValue.setI16Const(i16Const & constant.i16Const); break;
|
||||||
case EbtUint16: returnValue.setU16Const(u16Const & constant.u16Const); break;
|
case EbtUint16: returnValue.setU16Const(u16Const & constant.u16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(iConst & constant.iConst); break;
|
|
||||||
case EbtUint: returnValue.setUConst(uConst & constant.uConst); break;
|
|
||||||
case EbtInt64: returnValue.setI64Const(i64Const & constant.i64Const); break;
|
case EbtInt64: returnValue.setI64Const(i64Const & constant.i64Const); break;
|
||||||
case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break;
|
case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,14 +796,16 @@ public:
|
|||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst | constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst | constant.uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const | constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const | constant.i8Const); break;
|
||||||
case EbtUint8: returnValue.setU8Const(u8Const | constant.u8Const); break;
|
case EbtUint8: returnValue.setU8Const(u8Const | constant.u8Const); break;
|
||||||
case EbtInt16: returnValue.setI16Const(i16Const | constant.i16Const); break;
|
case EbtInt16: returnValue.setI16Const(i16Const | constant.i16Const); break;
|
||||||
case EbtUint16: returnValue.setU16Const(u16Const | constant.u16Const); break;
|
case EbtUint16: returnValue.setU16Const(u16Const | constant.u16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(iConst | constant.iConst); break;
|
|
||||||
case EbtUint: returnValue.setUConst(uConst | constant.uConst); break;
|
|
||||||
case EbtInt64: returnValue.setI64Const(i64Const | constant.i64Const); break;
|
case EbtInt64: returnValue.setI64Const(i64Const | constant.i64Const); break;
|
||||||
case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break;
|
case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -785,14 +817,16 @@ public:
|
|||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
assert(type == constant.type);
|
assert(type == constant.type);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setI8Const(i8Const ^ constant.i8Const); break;
|
case EbtInt8: returnValue.setI8Const(i8Const ^ constant.i8Const); break;
|
||||||
case EbtUint8: returnValue.setU8Const(u8Const ^ constant.u8Const); break;
|
case EbtUint8: returnValue.setU8Const(u8Const ^ constant.u8Const); break;
|
||||||
case EbtInt16: returnValue.setI16Const(i16Const ^ constant.i16Const); break;
|
case EbtInt16: returnValue.setI16Const(i16Const ^ constant.i16Const); break;
|
||||||
case EbtUint16: returnValue.setU16Const(u16Const ^ constant.u16Const); break;
|
case EbtUint16: returnValue.setU16Const(u16Const ^ constant.u16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break;
|
|
||||||
case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break;
|
|
||||||
case EbtInt64: returnValue.setI64Const(i64Const ^ constant.i64Const); break;
|
case EbtInt64: returnValue.setI64Const(i64Const ^ constant.i64Const); break;
|
||||||
case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break;
|
case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,14 +837,16 @@ public:
|
|||||||
{
|
{
|
||||||
TConstUnion returnValue;
|
TConstUnion returnValue;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case EbtInt: returnValue.setIConst(~iConst); break;
|
||||||
|
case EbtUint: returnValue.setUConst(~uConst); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: returnValue.setI8Const(~i8Const); break;
|
case EbtInt8: returnValue.setI8Const(~i8Const); break;
|
||||||
case EbtUint8: returnValue.setU8Const(~u8Const); break;
|
case EbtUint8: returnValue.setU8Const(~u8Const); break;
|
||||||
case EbtInt16: returnValue.setI16Const(~i16Const); break;
|
case EbtInt16: returnValue.setI16Const(~i16Const); break;
|
||||||
case EbtUint16: returnValue.setU16Const(~u16Const); break;
|
case EbtUint16: returnValue.setU16Const(~u16Const); break;
|
||||||
case EbtInt: returnValue.setIConst(~iConst); break;
|
|
||||||
case EbtUint: returnValue.setUConst(~uConst); break;
|
|
||||||
case EbtInt64: returnValue.setI64Const(~i64Const); break;
|
case EbtInt64: returnValue.setI64Const(~i64Const); break;
|
||||||
case EbtUint64: returnValue.setU64Const(~u64Const); break;
|
case EbtUint64: returnValue.setU64Const(~u64Const); break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +304,6 @@ public:
|
|||||||
size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
|
size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
|
||||||
size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
|
size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
|
||||||
|
|
||||||
void setAllocator(TPoolAllocator* a) { allocator = *a; }
|
|
||||||
TPoolAllocator& getAllocator() const { return allocator; }
|
TPoolAllocator& getAllocator() const { return allocator; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
547
thirdparty/glslang/glslang/Include/Types.h
vendored
547
thirdparty/glslang/glslang/Include/Types.h
vendored
File diff suppressed because it is too large
Load Diff
127
thirdparty/glslang/glslang/Include/intermediate.h
vendored
127
thirdparty/glslang/glslang/Include/intermediate.h
vendored
@ -275,6 +275,10 @@ enum TOperator {
|
|||||||
EOpConvUint64ToPtr,
|
EOpConvUint64ToPtr,
|
||||||
EOpConvPtrToUint64,
|
EOpConvPtrToUint64,
|
||||||
|
|
||||||
|
// uvec2 <-> pointer
|
||||||
|
EOpConvUvec2ToPtr,
|
||||||
|
EOpConvPtrToUvec2,
|
||||||
|
|
||||||
//
|
//
|
||||||
// binary operations
|
// binary operations
|
||||||
//
|
//
|
||||||
@ -422,11 +426,9 @@ enum TOperator {
|
|||||||
EOpReflect,
|
EOpReflect,
|
||||||
EOpRefract,
|
EOpRefract,
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
EOpMin3,
|
EOpMin3,
|
||||||
EOpMax3,
|
EOpMax3,
|
||||||
EOpMid3,
|
EOpMid3,
|
||||||
#endif
|
|
||||||
|
|
||||||
EOpDPdx, // Fragment only
|
EOpDPdx, // Fragment only
|
||||||
EOpDPdy, // Fragment only
|
EOpDPdy, // Fragment only
|
||||||
@ -441,10 +443,7 @@ enum TOperator {
|
|||||||
EOpInterpolateAtCentroid, // Fragment only
|
EOpInterpolateAtCentroid, // Fragment only
|
||||||
EOpInterpolateAtSample, // Fragment only
|
EOpInterpolateAtSample, // Fragment only
|
||||||
EOpInterpolateAtOffset, // Fragment only
|
EOpInterpolateAtOffset, // Fragment only
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
EOpInterpolateAtVertex,
|
EOpInterpolateAtVertex,
|
||||||
#endif
|
|
||||||
|
|
||||||
EOpMatrixTimesMatrix,
|
EOpMatrixTimesMatrix,
|
||||||
EOpOuterProduct,
|
EOpOuterProduct,
|
||||||
@ -534,7 +533,6 @@ enum TOperator {
|
|||||||
EOpSubgroupQuadSwapVertical,
|
EOpSubgroupQuadSwapVertical,
|
||||||
EOpSubgroupQuadSwapDiagonal,
|
EOpSubgroupQuadSwapDiagonal,
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
EOpSubgroupPartition,
|
EOpSubgroupPartition,
|
||||||
EOpSubgroupPartitionedAdd,
|
EOpSubgroupPartitionedAdd,
|
||||||
EOpSubgroupPartitionedMul,
|
EOpSubgroupPartitionedMul,
|
||||||
@ -557,11 +555,9 @@ enum TOperator {
|
|||||||
EOpSubgroupPartitionedExclusiveAnd,
|
EOpSubgroupPartitionedExclusiveAnd,
|
||||||
EOpSubgroupPartitionedExclusiveOr,
|
EOpSubgroupPartitionedExclusiveOr,
|
||||||
EOpSubgroupPartitionedExclusiveXor,
|
EOpSubgroupPartitionedExclusiveXor,
|
||||||
#endif
|
|
||||||
|
|
||||||
EOpSubgroupGuardStop,
|
EOpSubgroupGuardStop,
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
EOpMinInvocations,
|
EOpMinInvocations,
|
||||||
EOpMaxInvocations,
|
EOpMaxInvocations,
|
||||||
EOpAddInvocations,
|
EOpAddInvocations,
|
||||||
@ -588,7 +584,6 @@ enum TOperator {
|
|||||||
EOpCubeFaceIndex,
|
EOpCubeFaceIndex,
|
||||||
EOpCubeFaceCoord,
|
EOpCubeFaceCoord,
|
||||||
EOpTime,
|
EOpTime,
|
||||||
#endif
|
|
||||||
|
|
||||||
EOpAtomicAdd,
|
EOpAtomicAdd,
|
||||||
EOpAtomicMin,
|
EOpAtomicMin,
|
||||||
@ -621,6 +616,11 @@ enum TOperator {
|
|||||||
EOpCooperativeMatrixStore,
|
EOpCooperativeMatrixStore,
|
||||||
EOpCooperativeMatrixMulAdd,
|
EOpCooperativeMatrixMulAdd,
|
||||||
|
|
||||||
|
EOpBeginInvocationInterlock, // Fragment only
|
||||||
|
EOpEndInvocationInterlock, // Fragment only
|
||||||
|
|
||||||
|
EOpIsHelperInvocation,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Branch
|
// Branch
|
||||||
//
|
//
|
||||||
@ -631,6 +631,7 @@ enum TOperator {
|
|||||||
EOpContinue,
|
EOpContinue,
|
||||||
EOpCase,
|
EOpCase,
|
||||||
EOpDefault,
|
EOpDefault,
|
||||||
|
EOpDemote, // Fragment only
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -648,9 +649,21 @@ enum TOperator {
|
|||||||
EOpConstructBool,
|
EOpConstructBool,
|
||||||
EOpConstructFloat,
|
EOpConstructFloat,
|
||||||
EOpConstructDouble,
|
EOpConstructDouble,
|
||||||
|
// Keep vector and matrix constructors in a consistent relative order for
|
||||||
|
// TParseContext::constructBuiltIn, which converts between 8/16/32 bit
|
||||||
|
// vector constructors
|
||||||
EOpConstructVec2,
|
EOpConstructVec2,
|
||||||
EOpConstructVec3,
|
EOpConstructVec3,
|
||||||
EOpConstructVec4,
|
EOpConstructVec4,
|
||||||
|
EOpConstructMat2x2,
|
||||||
|
EOpConstructMat2x3,
|
||||||
|
EOpConstructMat2x4,
|
||||||
|
EOpConstructMat3x2,
|
||||||
|
EOpConstructMat3x3,
|
||||||
|
EOpConstructMat3x4,
|
||||||
|
EOpConstructMat4x2,
|
||||||
|
EOpConstructMat4x3,
|
||||||
|
EOpConstructMat4x4,
|
||||||
EOpConstructDVec2,
|
EOpConstructDVec2,
|
||||||
EOpConstructDVec3,
|
EOpConstructDVec3,
|
||||||
EOpConstructDVec4,
|
EOpConstructDVec4,
|
||||||
@ -681,15 +694,6 @@ enum TOperator {
|
|||||||
EOpConstructU64Vec2,
|
EOpConstructU64Vec2,
|
||||||
EOpConstructU64Vec3,
|
EOpConstructU64Vec3,
|
||||||
EOpConstructU64Vec4,
|
EOpConstructU64Vec4,
|
||||||
EOpConstructMat2x2,
|
|
||||||
EOpConstructMat2x3,
|
|
||||||
EOpConstructMat2x4,
|
|
||||||
EOpConstructMat3x2,
|
|
||||||
EOpConstructMat3x3,
|
|
||||||
EOpConstructMat3x4,
|
|
||||||
EOpConstructMat4x2,
|
|
||||||
EOpConstructMat4x3,
|
|
||||||
EOpConstructMat4x4,
|
|
||||||
EOpConstructDMat2x2,
|
EOpConstructDMat2x2,
|
||||||
EOpConstructDMat2x3,
|
EOpConstructDMat2x3,
|
||||||
EOpConstructDMat2x4,
|
EOpConstructDMat2x4,
|
||||||
@ -786,10 +790,8 @@ enum TOperator {
|
|||||||
EOpImageQuerySamples,
|
EOpImageQuerySamples,
|
||||||
EOpImageLoad,
|
EOpImageLoad,
|
||||||
EOpImageStore,
|
EOpImageStore,
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
EOpImageLoadLod,
|
EOpImageLoadLod,
|
||||||
EOpImageStoreLod,
|
EOpImageStoreLod,
|
||||||
#endif
|
|
||||||
EOpImageAtomicAdd,
|
EOpImageAtomicAdd,
|
||||||
EOpImageAtomicMin,
|
EOpImageAtomicMin,
|
||||||
EOpImageAtomicMax,
|
EOpImageAtomicMax,
|
||||||
@ -804,9 +806,7 @@ enum TOperator {
|
|||||||
EOpSubpassLoad,
|
EOpSubpassLoad,
|
||||||
EOpSubpassLoadMS,
|
EOpSubpassLoadMS,
|
||||||
EOpSparseImageLoad,
|
EOpSparseImageLoad,
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
EOpSparseImageLoadLod,
|
EOpSparseImageLoadLod,
|
||||||
#endif
|
|
||||||
|
|
||||||
EOpImageGuardEnd,
|
EOpImageGuardEnd,
|
||||||
|
|
||||||
@ -844,13 +844,11 @@ enum TOperator {
|
|||||||
EOpTextureOffsetClamp,
|
EOpTextureOffsetClamp,
|
||||||
EOpTextureGradClamp,
|
EOpTextureGradClamp,
|
||||||
EOpTextureGradOffsetClamp,
|
EOpTextureGradOffsetClamp,
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
EOpTextureGatherLod,
|
EOpTextureGatherLod,
|
||||||
EOpTextureGatherLodOffset,
|
EOpTextureGatherLodOffset,
|
||||||
EOpTextureGatherLodOffsets,
|
EOpTextureGatherLodOffsets,
|
||||||
EOpFragmentMaskFetch,
|
EOpFragmentMaskFetch,
|
||||||
EOpFragmentFetch,
|
EOpFragmentFetch,
|
||||||
#endif
|
|
||||||
|
|
||||||
EOpSparseTextureGuardBegin,
|
EOpSparseTextureGuardBegin,
|
||||||
|
|
||||||
@ -870,15 +868,12 @@ enum TOperator {
|
|||||||
EOpSparseTextureOffsetClamp,
|
EOpSparseTextureOffsetClamp,
|
||||||
EOpSparseTextureGradClamp,
|
EOpSparseTextureGradClamp,
|
||||||
EOpSparseTextureGradOffsetClamp,
|
EOpSparseTextureGradOffsetClamp,
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
EOpSparseTextureGatherLod,
|
EOpSparseTextureGatherLod,
|
||||||
EOpSparseTextureGatherLodOffset,
|
EOpSparseTextureGatherLodOffset,
|
||||||
EOpSparseTextureGatherLodOffsets,
|
EOpSparseTextureGatherLodOffsets,
|
||||||
#endif
|
|
||||||
|
|
||||||
EOpSparseTextureGuardEnd,
|
EOpSparseTextureGuardEnd,
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
EOpImageFootprintGuardBegin,
|
EOpImageFootprintGuardBegin,
|
||||||
EOpImageSampleFootprintNV,
|
EOpImageSampleFootprintNV,
|
||||||
EOpImageSampleFootprintClampNV,
|
EOpImageSampleFootprintClampNV,
|
||||||
@ -886,7 +881,6 @@ enum TOperator {
|
|||||||
EOpImageSampleFootprintGradNV,
|
EOpImageSampleFootprintGradNV,
|
||||||
EOpImageSampleFootprintGradClampNV,
|
EOpImageSampleFootprintGradClampNV,
|
||||||
EOpImageFootprintGuardEnd,
|
EOpImageFootprintGuardEnd,
|
||||||
#endif
|
|
||||||
EOpSamplingGuardEnd,
|
EOpSamplingGuardEnd,
|
||||||
EOpTextureGuardEnd,
|
EOpTextureGuardEnd,
|
||||||
|
|
||||||
@ -905,14 +899,21 @@ enum TOperator {
|
|||||||
EOpFindLSB,
|
EOpFindLSB,
|
||||||
EOpFindMSB,
|
EOpFindMSB,
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
EOpCountLeadingZeros,
|
||||||
|
EOpCountTrailingZeros,
|
||||||
|
EOpAbsDifference,
|
||||||
|
EOpAddSaturate,
|
||||||
|
EOpSubSaturate,
|
||||||
|
EOpAverage,
|
||||||
|
EOpAverageRounded,
|
||||||
|
EOpMul32x16,
|
||||||
|
|
||||||
EOpTraceNV,
|
EOpTraceNV,
|
||||||
EOpReportIntersectionNV,
|
EOpReportIntersectionNV,
|
||||||
EOpIgnoreIntersectionNV,
|
EOpIgnoreIntersectionNV,
|
||||||
EOpTerminateRayNV,
|
EOpTerminateRayNV,
|
||||||
EOpExecuteCallableNV,
|
EOpExecuteCallableNV,
|
||||||
EOpWritePackedPrimitiveIndices4x8NV,
|
EOpWritePackedPrimitiveIndices4x8NV,
|
||||||
#endif
|
|
||||||
//
|
//
|
||||||
// HLSL operations
|
// HLSL operations
|
||||||
//
|
//
|
||||||
@ -996,6 +997,10 @@ enum TOperator {
|
|||||||
EOpWaveGetLaneIndex, // Will decompose to gl_SubgroupInvocationID.
|
EOpWaveGetLaneIndex, // Will decompose to gl_SubgroupInvocationID.
|
||||||
EOpWaveActiveCountBits, // Will decompose to subgroupBallotBitCount(subgroupBallot()).
|
EOpWaveActiveCountBits, // Will decompose to subgroupBallotBitCount(subgroupBallot()).
|
||||||
EOpWavePrefixCountBits, // Will decompose to subgroupBallotInclusiveBitCount(subgroupBallot()).
|
EOpWavePrefixCountBits, // Will decompose to subgroupBallotInclusiveBitCount(subgroupBallot()).
|
||||||
|
|
||||||
|
// Shader Clock Ops
|
||||||
|
EOpReadClockSubgroupKHR,
|
||||||
|
EOpReadClockDeviceKHR,
|
||||||
};
|
};
|
||||||
|
|
||||||
class TIntermTraverser;
|
class TIntermTraverser;
|
||||||
@ -1097,6 +1102,8 @@ public:
|
|||||||
virtual bool isStruct() const { return type.isStruct(); }
|
virtual bool isStruct() const { return type.isStruct(); }
|
||||||
virtual bool isFloatingDomain() const { return type.isFloatingDomain(); }
|
virtual bool isFloatingDomain() const { return type.isFloatingDomain(); }
|
||||||
virtual bool isIntegerDomain() const { return type.isIntegerDomain(); }
|
virtual bool isIntegerDomain() const { return type.isIntegerDomain(); }
|
||||||
|
bool isAtomic() const { return type.isAtomic(); }
|
||||||
|
bool isReference() const { return type.isReference(); }
|
||||||
TString getCompleteString() const { return type.getCompleteString(); }
|
TString getCompleteString() const { return type.getCompleteString(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -1191,6 +1198,7 @@ public:
|
|||||||
virtual void traverse(TIntermTraverser*);
|
virtual void traverse(TIntermTraverser*);
|
||||||
TOperator getFlowOp() const { return flowOp; }
|
TOperator getFlowOp() const { return flowOp; }
|
||||||
TIntermTyped* getExpression() const { return expression; }
|
TIntermTyped* getExpression() const { return expression; }
|
||||||
|
void setExpression(TIntermTyped* pExpression) { expression = pExpression; }
|
||||||
protected:
|
protected:
|
||||||
TOperator flowOp;
|
TOperator flowOp;
|
||||||
TIntermTyped* expression;
|
TIntermTyped* expression;
|
||||||
@ -1224,7 +1232,7 @@ public:
|
|||||||
// it is essential to use "symbol = sym" to assign to symbol
|
// it is essential to use "symbol = sym" to assign to symbol
|
||||||
TIntermSymbol(int i, const TString& n, const TType& t)
|
TIntermSymbol(int i, const TString& n, const TType& t)
|
||||||
: TIntermTyped(t), id(i),
|
: TIntermTyped(t), id(i),
|
||||||
#ifdef ENABLE_HLSL
|
#ifndef GLSLANG_WEB
|
||||||
flattenSubset(-1),
|
flattenSubset(-1),
|
||||||
#endif
|
#endif
|
||||||
constSubtree(nullptr)
|
constSubtree(nullptr)
|
||||||
@ -1239,7 +1247,7 @@ public:
|
|||||||
const TConstUnionArray& getConstArray() const { return constArray; }
|
const TConstUnionArray& getConstArray() const { return constArray; }
|
||||||
void setConstSubtree(TIntermTyped* subtree) { constSubtree = subtree; }
|
void setConstSubtree(TIntermTyped* subtree) { constSubtree = subtree; }
|
||||||
TIntermTyped* getConstSubtree() const { return constSubtree; }
|
TIntermTyped* getConstSubtree() const { return constSubtree; }
|
||||||
#ifdef ENABLE_HLSL
|
#ifndef GLSLANG_WEB
|
||||||
void setFlattenSubset(int subset) { flattenSubset = subset; }
|
void setFlattenSubset(int subset) { flattenSubset = subset; }
|
||||||
int getFlattenSubset() const { return flattenSubset; } // -1 means full object
|
int getFlattenSubset() const { return flattenSubset; } // -1 means full object
|
||||||
#endif
|
#endif
|
||||||
@ -1250,7 +1258,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int id; // the unique id of the symbol this node represents
|
int id; // the unique id of the symbol this node represents
|
||||||
#ifdef ENABLE_HLSL
|
#ifndef GLSLANG_WEB
|
||||||
int flattenSubset; // how deeply the flattened object rooted at id has been dereferenced
|
int flattenSubset; // how deeply the flattened object rooted at id has been dereferenced
|
||||||
#endif
|
#endif
|
||||||
TString name; // the name of the symbol this node represents
|
TString name; // the name of the symbol this node represents
|
||||||
@ -1290,9 +1298,7 @@ struct TCrackedTextureOp {
|
|||||||
bool grad;
|
bool grad;
|
||||||
bool subpass;
|
bool subpass;
|
||||||
bool lodClamp;
|
bool lodClamp;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
bool fragMask;
|
bool fragMask;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1308,12 +1314,19 @@ public:
|
|||||||
bool isConstructor() const;
|
bool isConstructor() const;
|
||||||
bool isTexture() const { return op > EOpTextureGuardBegin && op < EOpTextureGuardEnd; }
|
bool isTexture() const { return op > EOpTextureGuardBegin && op < EOpTextureGuardEnd; }
|
||||||
bool isSampling() const { return op > EOpSamplingGuardBegin && op < EOpSamplingGuardEnd; }
|
bool isSampling() const { return op > EOpSamplingGuardBegin && op < EOpSamplingGuardEnd; }
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
bool isImage() const { return false; }
|
||||||
|
bool isSparseTexture() const { return false; }
|
||||||
|
bool isImageFootprint() const { return false; }
|
||||||
|
bool isSparseImage() const { return false; }
|
||||||
|
bool isSubgroup() const { return false; }
|
||||||
|
#else
|
||||||
bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; }
|
bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; }
|
||||||
bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; }
|
bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; }
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
|
bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
|
||||||
#endif
|
|
||||||
bool isSparseImage() const { return op == EOpSparseImageLoad; }
|
bool isSparseImage() const { return op == EOpSparseImageLoad; }
|
||||||
|
bool isSubgroup() const { return op > EOpSubgroupGuardStart && op < EOpSubgroupGuardStop; }
|
||||||
|
#endif
|
||||||
|
|
||||||
void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
|
void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
|
||||||
TPrecisionQualifier getOperationPrecision() const { return operationPrecision != EpqNone ?
|
TPrecisionQualifier getOperationPrecision() const { return operationPrecision != EpqNone ?
|
||||||
@ -1343,9 +1356,7 @@ public:
|
|||||||
cracked.grad = false;
|
cracked.grad = false;
|
||||||
cracked.subpass = false;
|
cracked.subpass = false;
|
||||||
cracked.lodClamp = false;
|
cracked.lodClamp = false;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
cracked.fragMask = false;
|
cracked.fragMask = false;
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case EOpImageQuerySize:
|
case EOpImageQuerySize:
|
||||||
@ -1360,10 +1371,6 @@ public:
|
|||||||
case EOpTexture:
|
case EOpTexture:
|
||||||
case EOpSparseTexture:
|
case EOpSparseTexture:
|
||||||
break;
|
break;
|
||||||
case EOpTextureClamp:
|
|
||||||
case EOpSparseTextureClamp:
|
|
||||||
cracked.lodClamp = true;
|
|
||||||
break;
|
|
||||||
case EOpTextureProj:
|
case EOpTextureProj:
|
||||||
cracked.proj = true;
|
cracked.proj = true;
|
||||||
break;
|
break;
|
||||||
@ -1375,22 +1382,17 @@ public:
|
|||||||
case EOpSparseTextureOffset:
|
case EOpSparseTextureOffset:
|
||||||
cracked.offset = true;
|
cracked.offset = true;
|
||||||
break;
|
break;
|
||||||
case EOpTextureOffsetClamp:
|
|
||||||
case EOpSparseTextureOffsetClamp:
|
|
||||||
cracked.offset = true;
|
|
||||||
cracked.lodClamp = true;
|
|
||||||
break;
|
|
||||||
case EOpTextureFetch:
|
case EOpTextureFetch:
|
||||||
case EOpSparseTextureFetch:
|
case EOpSparseTextureFetch:
|
||||||
cracked.fetch = true;
|
cracked.fetch = true;
|
||||||
if (sampler.dim == Esd1D || (sampler.dim == Esd2D && ! sampler.ms) || sampler.dim == Esd3D)
|
if (sampler.is1D() || (sampler.dim == Esd2D && ! sampler.isMultiSample()) || sampler.dim == Esd3D)
|
||||||
cracked.lod = true;
|
cracked.lod = true;
|
||||||
break;
|
break;
|
||||||
case EOpTextureFetchOffset:
|
case EOpTextureFetchOffset:
|
||||||
case EOpSparseTextureFetchOffset:
|
case EOpSparseTextureFetchOffset:
|
||||||
cracked.fetch = true;
|
cracked.fetch = true;
|
||||||
cracked.offset = true;
|
cracked.offset = true;
|
||||||
if (sampler.dim == Esd1D || (sampler.dim == Esd2D && ! sampler.ms) || sampler.dim == Esd3D)
|
if (sampler.is1D() || (sampler.dim == Esd2D && ! sampler.isMultiSample()) || sampler.dim == Esd3D)
|
||||||
cracked.lod = true;
|
cracked.lod = true;
|
||||||
break;
|
break;
|
||||||
case EOpTextureProjOffset:
|
case EOpTextureProjOffset:
|
||||||
@ -1415,11 +1417,6 @@ public:
|
|||||||
case EOpSparseTextureGrad:
|
case EOpSparseTextureGrad:
|
||||||
cracked.grad = true;
|
cracked.grad = true;
|
||||||
break;
|
break;
|
||||||
case EOpTextureGradClamp:
|
|
||||||
case EOpSparseTextureGradClamp:
|
|
||||||
cracked.grad = true;
|
|
||||||
cracked.lodClamp = true;
|
|
||||||
break;
|
|
||||||
case EOpTextureGradOffset:
|
case EOpTextureGradOffset:
|
||||||
case EOpSparseTextureGradOffset:
|
case EOpSparseTextureGradOffset:
|
||||||
cracked.grad = true;
|
cracked.grad = true;
|
||||||
@ -1434,6 +1431,21 @@ public:
|
|||||||
cracked.offset = true;
|
cracked.offset = true;
|
||||||
cracked.proj = true;
|
cracked.proj = true;
|
||||||
break;
|
break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
case EOpTextureClamp:
|
||||||
|
case EOpSparseTextureClamp:
|
||||||
|
cracked.lodClamp = true;
|
||||||
|
break;
|
||||||
|
case EOpTextureOffsetClamp:
|
||||||
|
case EOpSparseTextureOffsetClamp:
|
||||||
|
cracked.offset = true;
|
||||||
|
cracked.lodClamp = true;
|
||||||
|
break;
|
||||||
|
case EOpTextureGradClamp:
|
||||||
|
case EOpSparseTextureGradClamp:
|
||||||
|
cracked.grad = true;
|
||||||
|
cracked.lodClamp = true;
|
||||||
|
break;
|
||||||
case EOpTextureGradOffsetClamp:
|
case EOpTextureGradOffsetClamp:
|
||||||
case EOpSparseTextureGradOffsetClamp:
|
case EOpSparseTextureGradOffsetClamp:
|
||||||
cracked.grad = true;
|
cracked.grad = true;
|
||||||
@ -1454,7 +1466,6 @@ public:
|
|||||||
cracked.gather = true;
|
cracked.gather = true;
|
||||||
cracked.offsets = true;
|
cracked.offsets = true;
|
||||||
break;
|
break;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EOpTextureGatherLod:
|
case EOpTextureGatherLod:
|
||||||
case EOpSparseTextureGatherLod:
|
case EOpSparseTextureGatherLod:
|
||||||
cracked.gather = true;
|
cracked.gather = true;
|
||||||
@ -1485,8 +1496,6 @@ public:
|
|||||||
cracked.subpass = sampler.dim == EsdSubpass;
|
cracked.subpass = sampler.dim == EsdSubpass;
|
||||||
cracked.fragMask = true;
|
cracked.fragMask = true;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EOpImageSampleFootprintNV:
|
case EOpImageSampleFootprintNV:
|
||||||
break;
|
break;
|
||||||
case EOpImageSampleFootprintClampNV:
|
case EOpImageSampleFootprintClampNV:
|
||||||
@ -1502,11 +1511,11 @@ public:
|
|||||||
cracked.lodClamp = true;
|
cracked.lodClamp = true;
|
||||||
cracked.grad = true;
|
cracked.grad = true;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case EOpSubpassLoad:
|
case EOpSubpassLoad:
|
||||||
case EOpSubpassLoadMS:
|
case EOpSubpassLoadMS:
|
||||||
cracked.subpass = true;
|
cracked.subpass = true;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// This header is generated by the make-revision script.
|
// This header is generated by the make-revision script.
|
||||||
|
|
||||||
#define GLSLANG_PATCH_LEVEL 3226
|
#define GLSLANG_PATCH_LEVEL 3559
|
||||||
|
@ -189,6 +189,24 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||||||
else
|
else
|
||||||
newConstArray[i].setDConst((double)NAN);
|
newConstArray[i].setDConst((double)NAN);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EbtInt:
|
||||||
|
if (rightUnionArray[i] == 0)
|
||||||
|
newConstArray[i].setIConst(0x7FFFFFFF);
|
||||||
|
else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)-0x80000000ll)
|
||||||
|
newConstArray[i].setIConst((int)-0x80000000ll);
|
||||||
|
else
|
||||||
|
newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EbtUint:
|
||||||
|
if (rightUnionArray[i] == 0u)
|
||||||
|
newConstArray[i].setUConst(0xFFFFFFFFu);
|
||||||
|
else
|
||||||
|
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
||||||
|
break;
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
if (rightUnionArray[i] == (signed char)0)
|
if (rightUnionArray[i] == (signed char)0)
|
||||||
newConstArray[i].setI8Const((signed char)0x7F);
|
newConstArray[i].setI8Const((signed char)0x7F);
|
||||||
@ -221,22 +239,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||||||
newConstArray[i].setU16Const(leftUnionArray[i].getU16Const() / rightUnionArray[i].getU16Const());
|
newConstArray[i].setU16Const(leftUnionArray[i].getU16Const() / rightUnionArray[i].getU16Const());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EbtInt:
|
|
||||||
if (rightUnionArray[i] == 0)
|
|
||||||
newConstArray[i].setIConst(0x7FFFFFFF);
|
|
||||||
else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)-0x80000000ll)
|
|
||||||
newConstArray[i].setIConst((int)-0x80000000ll);
|
|
||||||
else
|
|
||||||
newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EbtUint:
|
|
||||||
if (rightUnionArray[i] == 0u)
|
|
||||||
newConstArray[i].setUConst(0xFFFFFFFFu);
|
|
||||||
else
|
|
||||||
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
if (rightUnionArray[i] == 0ll)
|
if (rightUnionArray[i] == 0ll)
|
||||||
newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll);
|
newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll);
|
||||||
@ -254,6 +256,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -292,13 +295,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
|||||||
newConstArray[i].setIConst(0);
|
newConstArray[i].setIConst(0);
|
||||||
break;
|
break;
|
||||||
} else goto modulo_default;
|
} else goto modulo_default;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) {
|
if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) {
|
||||||
newConstArray[i].setI64Const(0);
|
newConstArray[i].setI64Const(0);
|
||||||
break;
|
break;
|
||||||
} else goto modulo_default;
|
} else goto modulo_default;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EbtInt16:
|
case EbtInt16:
|
||||||
if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == SHRT_MIN) {
|
if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == SHRT_MIN) {
|
||||||
newConstArray[i].setIConst(0);
|
newConstArray[i].setIConst(0);
|
||||||
@ -415,8 +417,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
|
|
||||||
case EOpEmitStreamVertex:
|
case EOpEmitStreamVertex:
|
||||||
case EOpEndStreamPrimitive:
|
case EOpEndStreamPrimitive:
|
||||||
// These don't actually fold
|
// These don't fold
|
||||||
return 0;
|
return nullptr;
|
||||||
|
|
||||||
case EOpPackSnorm2x16:
|
case EOpPackSnorm2x16:
|
||||||
case EOpPackUnorm2x16:
|
case EOpPackUnorm2x16:
|
||||||
@ -491,8 +493,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out
|
|
||||||
|
|
||||||
case EOpPackSnorm2x16:
|
case EOpPackSnorm2x16:
|
||||||
case EOpPackUnorm2x16:
|
case EOpPackUnorm2x16:
|
||||||
case EOpPackHalf2x16:
|
case EOpPackHalf2x16:
|
||||||
@ -510,7 +510,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EOpDeterminant:
|
case EOpDeterminant:
|
||||||
case EOpMatrixInverse:
|
case EOpMatrixInverse:
|
||||||
case EOpTranspose:
|
case EOpTranspose:
|
||||||
return 0;
|
return nullptr;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(componentWise);
|
assert(componentWise);
|
||||||
@ -529,16 +529,18 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
case EbtFloat16:
|
case EbtFloat16:
|
||||||
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
|
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
|
||||||
|
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
|
||||||
|
case EbtUint: newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst()))); break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8: newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break;
|
case EbtInt8: newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break;
|
||||||
case EbtUint8: newConstArray[i].setU8Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU8Const()))); break;
|
case EbtUint8: newConstArray[i].setU8Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU8Const()))); break;
|
||||||
case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break;
|
case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break;
|
||||||
case EbtUint16:newConstArray[i].setU16Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU16Const()))); break;
|
case EbtUint16:newConstArray[i].setU16Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU16Const()))); break;
|
||||||
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
|
|
||||||
case EbtUint: newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst()))); break;
|
|
||||||
case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break;
|
case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break;
|
||||||
case EbtUint64: newConstArray[i].setU64Const(static_cast<unsigned long long>(-static_cast<long long>(unionArray[i].getU64Const()))); break;
|
case EbtUint64: newConstArray[i].setU64Const(static_cast<unsigned long long>(-static_cast<long long>(unionArray[i].getU64Const()))); break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EOpLogicalNot:
|
case EOpLogicalNot:
|
||||||
@ -546,7 +548,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
switch (getType().getBasicType()) {
|
switch (getType().getBasicType()) {
|
||||||
case EbtBool: newConstArray[i].setBConst(!unionArray[i].getBConst()); break;
|
case EbtBool: newConstArray[i].setBConst(!unionArray[i].getBConst()); break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EOpBitwiseNot:
|
case EOpBitwiseNot:
|
||||||
@ -671,6 +673,48 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case EOpConvIntToBool:
|
||||||
|
newConstArray[i].setBConst(unionArray[i].getIConst() != 0); break;
|
||||||
|
case EOpConvUintToBool:
|
||||||
|
newConstArray[i].setBConst(unionArray[i].getUConst() != 0); break;
|
||||||
|
case EOpConvBoolToInt:
|
||||||
|
newConstArray[i].setIConst(unionArray[i].getBConst()); break;
|
||||||
|
case EOpConvBoolToUint:
|
||||||
|
newConstArray[i].setUConst(unionArray[i].getBConst()); break;
|
||||||
|
case EOpConvIntToUint:
|
||||||
|
newConstArray[i].setUConst(unionArray[i].getIConst()); break;
|
||||||
|
case EOpConvUintToInt:
|
||||||
|
newConstArray[i].setIConst(unionArray[i].getUConst()); break;
|
||||||
|
|
||||||
|
case EOpConvFloatToBool:
|
||||||
|
case EOpConvDoubleToBool:
|
||||||
|
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
||||||
|
|
||||||
|
case EOpConvBoolToFloat:
|
||||||
|
case EOpConvBoolToDouble:
|
||||||
|
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
||||||
|
|
||||||
|
case EOpConvIntToFloat:
|
||||||
|
case EOpConvIntToDouble:
|
||||||
|
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
||||||
|
|
||||||
|
case EOpConvUintToFloat:
|
||||||
|
case EOpConvUintToDouble:
|
||||||
|
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
||||||
|
|
||||||
|
case EOpConvDoubleToFloat:
|
||||||
|
case EOpConvFloatToDouble:
|
||||||
|
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||||
|
|
||||||
|
case EOpConvFloatToUint:
|
||||||
|
case EOpConvDoubleToUint:
|
||||||
|
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
||||||
|
|
||||||
|
case EOpConvFloatToInt:
|
||||||
|
case EOpConvDoubleToInt:
|
||||||
|
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EOpConvInt8ToBool:
|
case EOpConvInt8ToBool:
|
||||||
newConstArray[i].setBConst(unionArray[i].getI8Const() != 0); break;
|
newConstArray[i].setBConst(unionArray[i].getI8Const() != 0); break;
|
||||||
case EOpConvUint8ToBool:
|
case EOpConvUint8ToBool:
|
||||||
@ -679,20 +723,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
newConstArray[i].setBConst(unionArray[i].getI16Const() != 0); break;
|
newConstArray[i].setBConst(unionArray[i].getI16Const() != 0); break;
|
||||||
case EOpConvUint16ToBool:
|
case EOpConvUint16ToBool:
|
||||||
newConstArray[i].setBConst(unionArray[i].getU16Const() != 0); break;
|
newConstArray[i].setBConst(unionArray[i].getU16Const() != 0); break;
|
||||||
case EOpConvIntToBool:
|
|
||||||
newConstArray[i].setBConst(unionArray[i].getIConst() != 0); break;
|
|
||||||
case EOpConvUintToBool:
|
|
||||||
newConstArray[i].setBConst(unionArray[i].getUConst() != 0); break;
|
|
||||||
case EOpConvInt64ToBool:
|
case EOpConvInt64ToBool:
|
||||||
newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break;
|
newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break;
|
||||||
case EOpConvUint64ToBool:
|
case EOpConvUint64ToBool:
|
||||||
newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break;
|
newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break;
|
||||||
case EOpConvFloat16ToBool:
|
case EOpConvFloat16ToBool:
|
||||||
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
||||||
case EOpConvFloatToBool:
|
|
||||||
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
|
||||||
case EOpConvDoubleToBool:
|
|
||||||
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
|
||||||
|
|
||||||
case EOpConvBoolToInt8:
|
case EOpConvBoolToInt8:
|
||||||
newConstArray[i].setI8Const(unionArray[i].getBConst()); break;
|
newConstArray[i].setI8Const(unionArray[i].getBConst()); break;
|
||||||
@ -702,20 +738,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
newConstArray[i].setI16Const(unionArray[i].getBConst()); break;
|
newConstArray[i].setI16Const(unionArray[i].getBConst()); break;
|
||||||
case EOpConvBoolToUint16:
|
case EOpConvBoolToUint16:
|
||||||
newConstArray[i].setU16Const(unionArray[i].getBConst()); break;
|
newConstArray[i].setU16Const(unionArray[i].getBConst()); break;
|
||||||
case EOpConvBoolToInt:
|
|
||||||
newConstArray[i].setIConst(unionArray[i].getBConst()); break;
|
|
||||||
case EOpConvBoolToUint:
|
|
||||||
newConstArray[i].setUConst(unionArray[i].getBConst()); break;
|
|
||||||
case EOpConvBoolToInt64:
|
case EOpConvBoolToInt64:
|
||||||
newConstArray[i].setI64Const(unionArray[i].getBConst()); break;
|
newConstArray[i].setI64Const(unionArray[i].getBConst()); break;
|
||||||
case EOpConvBoolToUint64:
|
case EOpConvBoolToUint64:
|
||||||
newConstArray[i].setU64Const(unionArray[i].getBConst()); break;
|
newConstArray[i].setU64Const(unionArray[i].getBConst()); break;
|
||||||
case EOpConvBoolToFloat16:
|
case EOpConvBoolToFloat16:
|
||||||
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
||||||
case EOpConvBoolToFloat:
|
|
||||||
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
|
||||||
case EOpConvBoolToDouble:
|
|
||||||
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
|
||||||
|
|
||||||
case EOpConvInt8ToInt16:
|
case EOpConvInt8ToInt16:
|
||||||
newConstArray[i].setI16Const(unionArray[i].getI8Const()); break;
|
newConstArray[i].setI16Const(unionArray[i].getI8Const()); break;
|
||||||
@ -810,8 +838,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
newConstArray[i].setU8Const((unsigned char)unionArray[i].getIConst()); break;
|
newConstArray[i].setU8Const((unsigned char)unionArray[i].getIConst()); break;
|
||||||
case EOpConvIntToUint16:
|
case EOpConvIntToUint16:
|
||||||
newConstArray[i].setU16Const((unsigned char)unionArray[i].getIConst()); break;
|
newConstArray[i].setU16Const((unsigned char)unionArray[i].getIConst()); break;
|
||||||
case EOpConvIntToUint:
|
|
||||||
newConstArray[i].setUConst(unionArray[i].getIConst()); break;
|
|
||||||
case EOpConvIntToUint64:
|
case EOpConvIntToUint64:
|
||||||
newConstArray[i].setU64Const(unionArray[i].getIConst()); break;
|
newConstArray[i].setU64Const(unionArray[i].getIConst()); break;
|
||||||
|
|
||||||
@ -819,8 +845,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
newConstArray[i].setI8Const((signed char)unionArray[i].getUConst()); break;
|
newConstArray[i].setI8Const((signed char)unionArray[i].getUConst()); break;
|
||||||
case EOpConvUintToInt16:
|
case EOpConvUintToInt16:
|
||||||
newConstArray[i].setI16Const((signed short)unionArray[i].getUConst()); break;
|
newConstArray[i].setI16Const((signed short)unionArray[i].getUConst()); break;
|
||||||
case EOpConvUintToInt:
|
|
||||||
newConstArray[i].setIConst(unionArray[i].getUConst()); break;
|
|
||||||
case EOpConvUintToInt64:
|
case EOpConvUintToInt64:
|
||||||
newConstArray[i].setI64Const(unionArray[i].getUConst()); break;
|
newConstArray[i].setI64Const(unionArray[i].getUConst()); break;
|
||||||
case EOpConvUintToUint8:
|
case EOpConvUintToUint8:
|
||||||
@ -831,16 +855,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
newConstArray[i].setU64Const(unionArray[i].getUConst()); break;
|
newConstArray[i].setU64Const(unionArray[i].getUConst()); break;
|
||||||
case EOpConvIntToFloat16:
|
case EOpConvIntToFloat16:
|
||||||
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
||||||
case EOpConvIntToFloat:
|
|
||||||
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
|
||||||
case EOpConvIntToDouble:
|
|
||||||
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
|
||||||
case EOpConvUintToFloat16:
|
case EOpConvUintToFloat16:
|
||||||
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
||||||
case EOpConvUintToFloat:
|
|
||||||
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
|
||||||
case EOpConvUintToDouble:
|
|
||||||
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
|
||||||
case EOpConvInt64ToInt8:
|
case EOpConvInt64ToInt8:
|
||||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getI64Const())); break;
|
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getI64Const())); break;
|
||||||
case EOpConvInt64ToInt16:
|
case EOpConvInt64ToInt16:
|
||||||
@ -905,48 +921,35 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvFloatToInt16:
|
case EOpConvFloatToInt16:
|
||||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvFloatToInt:
|
|
||||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
|
||||||
case EOpConvFloatToInt64:
|
case EOpConvFloatToInt64:
|
||||||
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvFloatToUint8:
|
case EOpConvFloatToUint8:
|
||||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvFloatToUint16:
|
case EOpConvFloatToUint16:
|
||||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvFloatToUint:
|
|
||||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
|
||||||
case EOpConvFloatToUint64:
|
case EOpConvFloatToUint64:
|
||||||
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvFloatToFloat16:
|
case EOpConvFloatToFloat16:
|
||||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||||
case EOpConvFloatToDouble:
|
|
||||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
|
||||||
case EOpConvDoubleToInt8:
|
case EOpConvDoubleToInt8:
|
||||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvDoubleToInt16:
|
case EOpConvDoubleToInt16:
|
||||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvDoubleToInt:
|
|
||||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
|
||||||
case EOpConvDoubleToInt64:
|
case EOpConvDoubleToInt64:
|
||||||
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvDoubleToUint8:
|
case EOpConvDoubleToUint8:
|
||||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvDoubleToUint16:
|
case EOpConvDoubleToUint16:
|
||||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvDoubleToUint:
|
|
||||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
|
||||||
case EOpConvDoubleToUint64:
|
case EOpConvDoubleToUint64:
|
||||||
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
||||||
case EOpConvDoubleToFloat16:
|
case EOpConvDoubleToFloat16:
|
||||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||||
case EOpConvDoubleToFloat:
|
|
||||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
|
||||||
case EOpConvPtrToUint64:
|
case EOpConvPtrToUint64:
|
||||||
case EOpConvUint64ToPtr:
|
case EOpConvUint64ToPtr:
|
||||||
case EOpConstructReference:
|
case EOpConstructReference:
|
||||||
newConstArray[i].setU64Const(unionArray[i].getU64Const()); break;
|
newConstArray[i].setU64Const(unionArray[i].getU64Const()); break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out
|
// TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out
|
||||||
|
|
||||||
@ -970,7 +973,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EOpInt16BitsToFloat16:
|
case EOpInt16BitsToFloat16:
|
||||||
case EOpUint16BitsToFloat16:
|
case EOpUint16BitsToFloat16:
|
||||||
default:
|
default:
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1078,6 +1081,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||||
break;
|
break;
|
||||||
|
case EbtInt:
|
||||||
|
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||||
|
break;
|
||||||
|
case EbtUint:
|
||||||
|
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||||
|
break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
|
newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
|
||||||
break;
|
break;
|
||||||
@ -1090,18 +1100,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
case EbtUint16:
|
case EbtUint16:
|
||||||
newConstArray[comp].setU16Const(std::min(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()));
|
newConstArray[comp].setU16Const(std::min(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()));
|
||||||
break;
|
break;
|
||||||
case EbtInt:
|
|
||||||
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
|
||||||
break;
|
|
||||||
case EbtUint:
|
|
||||||
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
|
||||||
break;
|
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
||||||
break;
|
break;
|
||||||
case EbtUint64:
|
case EbtUint64:
|
||||||
newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1112,6 +1117,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
case EbtDouble:
|
case EbtDouble:
|
||||||
newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||||
break;
|
break;
|
||||||
|
case EbtInt:
|
||||||
|
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||||
|
break;
|
||||||
|
case EbtUint:
|
||||||
|
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||||
|
break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
|
newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
|
||||||
break;
|
break;
|
||||||
@ -1124,18 +1136,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
case EbtUint16:
|
case EbtUint16:
|
||||||
newConstArray[comp].setU16Const(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()));
|
newConstArray[comp].setU16Const(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()));
|
||||||
break;
|
break;
|
||||||
case EbtInt:
|
|
||||||
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
|
||||||
break;
|
|
||||||
case EbtUint:
|
|
||||||
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
|
||||||
break;
|
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
||||||
break;
|
break;
|
||||||
case EbtUint64:
|
case EbtUint64:
|
||||||
newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1147,6 +1154,11 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()),
|
newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()),
|
||||||
childConstUnions[2][arg2comp].getDConst()));
|
childConstUnions[2][arg2comp].getDConst()));
|
||||||
break;
|
break;
|
||||||
|
case EbtUint:
|
||||||
|
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
|
||||||
|
childConstUnions[2][arg2comp].getUConst()));
|
||||||
|
break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EbtInt8:
|
case EbtInt8:
|
||||||
newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()),
|
newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()),
|
||||||
childConstUnions[2][arg2comp].getI8Const()));
|
childConstUnions[2][arg2comp].getI8Const()));
|
||||||
@ -1167,10 +1179,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()),
|
newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()),
|
||||||
childConstUnions[2][arg2comp].getIConst()));
|
childConstUnions[2][arg2comp].getIConst()));
|
||||||
break;
|
break;
|
||||||
case EbtUint:
|
|
||||||
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
|
|
||||||
childConstUnions[2][arg2comp].getUConst()));
|
|
||||||
break;
|
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()),
|
newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()),
|
||||||
childConstUnions[2][arg2comp].getI64Const()));
|
childConstUnions[2][arg2comp].getI64Const()));
|
||||||
@ -1179,6 +1187,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()),
|
newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()),
|
||||||
childConstUnions[2][arg2comp].getU64Const()));
|
childConstUnions[2][arg2comp].getU64Const()));
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default: assert(false && "Default missing");
|
default: assert(false && "Default missing");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1201,12 +1210,17 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
|||||||
newConstArray[comp].setBConst(childConstUnions[0][arg0comp] != childConstUnions[1][arg1comp]);
|
newConstArray[comp].setBConst(childConstUnions[0][arg0comp] != childConstUnions[1][arg1comp]);
|
||||||
break;
|
break;
|
||||||
case EOpMix:
|
case EOpMix:
|
||||||
if (children[2]->getAsTyped()->getBasicType() == EbtBool)
|
if (!children[0]->getAsTyped()->isFloatingDomain())
|
||||||
newConstArray[comp].setDConst(childConstUnions[2][arg2comp].getBConst() ? childConstUnions[1][arg1comp].getDConst() :
|
return aggrNode;
|
||||||
childConstUnions[0][arg0comp].getDConst());
|
if (children[2]->getAsTyped()->getBasicType() == EbtBool) {
|
||||||
else
|
newConstArray[comp].setDConst(childConstUnions[2][arg2comp].getBConst()
|
||||||
newConstArray[comp].setDConst(childConstUnions[0][arg0comp].getDConst() * (1.0 - childConstUnions[2][arg2comp].getDConst()) +
|
? childConstUnions[1][arg1comp].getDConst()
|
||||||
|
: childConstUnions[0][arg0comp].getDConst());
|
||||||
|
} else {
|
||||||
|
newConstArray[comp].setDConst(
|
||||||
|
childConstUnions[0][arg0comp].getDConst() * (1.0 - childConstUnions[2][arg2comp].getDConst()) +
|
||||||
childConstUnions[1][arg1comp].getDConst() * childConstUnions[2][arg2comp].getDConst());
|
childConstUnions[1][arg1comp].getDConst() * childConstUnions[2][arg2comp].getDConst());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case EOpStep:
|
case EOpStep:
|
||||||
newConstArray[comp].setDConst(childConstUnions[1][arg1comp].getDConst() < childConstUnions[0][arg0comp].getDConst() ? 0.0 : 1.0);
|
newConstArray[comp].setDConst(childConstUnions[1][arg1comp].getDConst() < childConstUnions[0][arg0comp].getDConst() ? 0.0 : 1.0);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -91,6 +91,8 @@ public:
|
|||||||
void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources);
|
void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void addTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion);
|
||||||
|
void relateTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage, TSymbolTable&);
|
||||||
void add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion);
|
void add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion);
|
||||||
void addSubpassSampling(TSampler, const TString& typeName, int version, EProfile profile);
|
void addSubpassSampling(TSampler, const TString& typeName, int version, EProfile profile);
|
||||||
void addQueryFunctions(TSampler, const TString& typeName, int version, EProfile profile);
|
void addQueryFunctions(TSampler, const TString& typeName, int version, EProfile profile);
|
||||||
|
1160
thirdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
vendored
Normal file → Executable file
1160
thirdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
vendored
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
@ -67,6 +67,8 @@ void TParseContextBase::outputMessage(const TSourceLoc& loc, const char* szReaso
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(GLSLANG_WEB) || defined(GLSLANG_WEB_DEVEL)
|
||||||
|
|
||||||
void C_DECL TParseContextBase::error(const TSourceLoc& loc, const char* szReason, const char* szToken,
|
void C_DECL TParseContextBase::error(const TSourceLoc& loc, const char* szReason, const char* szToken,
|
||||||
const char* szExtraInfoFormat, ...)
|
const char* szExtraInfoFormat, ...)
|
||||||
{
|
{
|
||||||
@ -113,6 +115,8 @@ void C_DECL TParseContextBase::ppWarn(const TSourceLoc& loc, const char* szReaso
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Both test and if necessary, spit out an error, to see if the node is really
|
// Both test and if necessary, spit out an error, to see if the node is really
|
||||||
// an l-value that can be operated on this way.
|
// an l-value that can be operated on this way.
|
||||||
@ -149,15 +153,13 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
|||||||
case EvqConst: message = "can't modify a const"; break;
|
case EvqConst: message = "can't modify a const"; break;
|
||||||
case EvqConstReadOnly: message = "can't modify a const"; break;
|
case EvqConstReadOnly: message = "can't modify a const"; break;
|
||||||
case EvqUniform: message = "can't modify a uniform"; break;
|
case EvqUniform: message = "can't modify a uniform"; break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EvqBuffer:
|
case EvqBuffer:
|
||||||
if (node->getQualifier().readonly)
|
if (node->getQualifier().isReadOnly())
|
||||||
message = "can't modify a readonly buffer";
|
message = "can't modify a readonly buffer";
|
||||||
#ifdef NV_EXTENSIONS
|
if (node->getQualifier().isShaderRecordNV())
|
||||||
if (node->getQualifier().layoutShaderRecordNV)
|
|
||||||
message = "can't modify a shaderrecordnv qualified buffer";
|
message = "can't modify a shaderrecordnv qualified buffer";
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EvqHitAttrNV:
|
case EvqHitAttrNV:
|
||||||
if (language != EShLangIntersectNV)
|
if (language != EShLangIntersectNV)
|
||||||
message = "cannot modify hitAttributeNV in this stage";
|
message = "cannot modify hitAttributeNV in this stage";
|
||||||
@ -172,13 +174,13 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
|||||||
case EbtSampler:
|
case EbtSampler:
|
||||||
message = "can't modify a sampler";
|
message = "can't modify a sampler";
|
||||||
break;
|
break;
|
||||||
case EbtAtomicUint:
|
|
||||||
message = "can't modify an atomic_uint";
|
|
||||||
break;
|
|
||||||
case EbtVoid:
|
case EbtVoid:
|
||||||
message = "can't modify void";
|
message = "can't modify void";
|
||||||
break;
|
break;
|
||||||
#ifdef NV_EXTENSIONS
|
#ifndef GLSLANG_WEB
|
||||||
|
case EbtAtomicUint:
|
||||||
|
message = "can't modify an atomic_uint";
|
||||||
|
break;
|
||||||
case EbtAccStructNV:
|
case EbtAccStructNV:
|
||||||
message = "can't modify accelerationStructureNV";
|
message = "can't modify accelerationStructureNV";
|
||||||
break;
|
break;
|
||||||
@ -234,7 +236,7 @@ void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TIntermSymbol* symNode = node->getAsSymbolNode();
|
TIntermSymbol* symNode = node->getAsSymbolNode();
|
||||||
if (symNode && symNode->getQualifier().writeonly)
|
if (symNode && symNode->getQualifier().isWriteOnly())
|
||||||
error(loc, "can't read from writeonly object: ", op, symNode->getName().c_str());
|
error(loc, "can't read from writeonly object: ", op, symNode->getName().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,11 +256,17 @@ void TParseContextBase::trackLinkage(TSymbol& symbol)
|
|||||||
// Give an error if not.
|
// Give an error if not.
|
||||||
void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int& index)
|
void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int& index)
|
||||||
{
|
{
|
||||||
|
const auto sizeIsSpecializationExpression = [&type]() {
|
||||||
|
return type.containsSpecializationSize() &&
|
||||||
|
type.getArraySizes()->getOuterNode() != nullptr &&
|
||||||
|
type.getArraySizes()->getOuterNode()->getAsSymbolNode() == nullptr; };
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
error(loc, "", "[", "index out of range '%d'", index);
|
error(loc, "", "[", "index out of range '%d'", index);
|
||||||
index = 0;
|
index = 0;
|
||||||
} else if (type.isArray()) {
|
} else if (type.isArray()) {
|
||||||
if (type.isSizedArray() && index >= type.getOuterArraySize()) {
|
if (type.isSizedArray() && !sizeIsSpecializationExpression() &&
|
||||||
|
index >= type.getOuterArraySize()) {
|
||||||
error(loc, "", "[", "array index out of range '%d'", index);
|
error(loc, "", "[", "array index out of range '%d'", index);
|
||||||
index = type.getOuterArraySize() - 1;
|
index = type.getOuterArraySize() - 1;
|
||||||
}
|
}
|
||||||
@ -568,6 +576,7 @@ void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TStrin
|
|||||||
selector.push_back(0);
|
selector.push_back(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
//
|
//
|
||||||
// Make the passed-in variable information become a member of the
|
// Make the passed-in variable information become a member of the
|
||||||
// global uniform block. If this doesn't exist yet, make it.
|
// global uniform block. If this doesn't exist yet, make it.
|
||||||
@ -612,6 +621,7 @@ void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& mem
|
|||||||
|
|
||||||
++firstNewMember;
|
++firstNewMember;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void TParseContextBase::finish()
|
void TParseContextBase::finish()
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -85,6 +85,7 @@ public:
|
|||||||
statementNestingLevel(0), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
|
statementNestingLevel(0), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
|
||||||
postEntryPointReturn(false),
|
postEntryPointReturn(false),
|
||||||
contextPragma(true, false),
|
contextPragma(true, false),
|
||||||
|
beginInvocationInterlockCount(0), endInvocationInterlockCount(0),
|
||||||
parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr),
|
parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr),
|
||||||
limits(resources.limits),
|
limits(resources.limits),
|
||||||
globalUniformBlock(nullptr),
|
globalUniformBlock(nullptr),
|
||||||
@ -96,6 +97,7 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~TParseContextBase() { }
|
virtual ~TParseContextBase() { }
|
||||||
|
|
||||||
|
#if !defined(GLSLANG_WEB) || defined(GLSLANG_WEB_DEVEL)
|
||||||
virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
const char* szExtraInfoFormat, ...);
|
const char* szExtraInfoFormat, ...);
|
||||||
virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
@ -104,6 +106,7 @@ public:
|
|||||||
const char* szExtraInfoFormat, ...);
|
const char* szExtraInfoFormat, ...);
|
||||||
virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
const char* szExtraInfoFormat, ...);
|
const char* szExtraInfoFormat, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual void setLimits(const TBuiltInResource&) = 0;
|
virtual void setLimits(const TBuiltInResource&) = 0;
|
||||||
|
|
||||||
@ -149,8 +152,10 @@ public:
|
|||||||
extensionCallback(line, extension, behavior);
|
extensionCallback(line, extension, behavior);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
// Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
|
// Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
|
||||||
virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr);
|
virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Potentially rename shader entry point function
|
// Potentially rename shader entry point function
|
||||||
void renameShaderFunction(TString*& name) const
|
void renameShaderFunction(TString*& name) const
|
||||||
@ -182,6 +187,8 @@ public:
|
|||||||
// the statementNestingLevel the current switch statement is at, which must match the level of its case statements
|
// the statementNestingLevel the current switch statement is at, which must match the level of its case statements
|
||||||
TList<int> switchLevel;
|
TList<int> switchLevel;
|
||||||
struct TPragma contextPragma;
|
struct TPragma contextPragma;
|
||||||
|
int beginInvocationInterlockCount;
|
||||||
|
int endInvocationInterlockCount;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TParseContextBase(TParseContextBase&);
|
TParseContextBase(TParseContextBase&);
|
||||||
@ -276,7 +283,7 @@ public:
|
|||||||
const TString* entryPoint = nullptr);
|
const TString* entryPoint = nullptr);
|
||||||
virtual ~TParseContext();
|
virtual ~TParseContext();
|
||||||
|
|
||||||
bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); };
|
bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); }
|
||||||
void setPrecisionDefaults();
|
void setPrecisionDefaults();
|
||||||
|
|
||||||
void setLimits(const TBuiltInResource&) override;
|
void setLimits(const TBuiltInResource&) override;
|
||||||
@ -294,10 +301,12 @@ public:
|
|||||||
TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
||||||
void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
void makeEditable(TSymbol*&) override;
|
void makeEditable(TSymbol*&) override;
|
||||||
|
void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier);
|
||||||
|
#endif
|
||||||
bool isIoResizeArray(const TType&) const;
|
bool isIoResizeArray(const TType&) const;
|
||||||
void fixIoArraySize(const TSourceLoc&, TType&);
|
void fixIoArraySize(const TSourceLoc&, TType&);
|
||||||
void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier);
|
|
||||||
void handleIoResizeArrayAccess(const TSourceLoc&, TIntermTyped* base);
|
void handleIoResizeArrayAccess(const TSourceLoc&, TIntermTyped* base);
|
||||||
void checkIoArraysConsistency(const TSourceLoc&, bool tailOnly = false);
|
void checkIoArraysConsistency(const TSourceLoc&, bool tailOnly = false);
|
||||||
int getIoArrayImplicitSize(const TQualifier&, TString* featureString = nullptr) const;
|
int getIoArrayImplicitSize(const TQualifier&, TString* featureString = nullptr) const;
|
||||||
@ -401,6 +410,7 @@ public:
|
|||||||
TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&);
|
TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&);
|
||||||
TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
|
TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
|
||||||
TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
|
TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
|
||||||
|
void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to);
|
||||||
void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
|
void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
|
||||||
void blockStageIoCheck(const TSourceLoc&, const TQualifier&);
|
void blockStageIoCheck(const TSourceLoc&, const TQualifier&);
|
||||||
void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName);
|
void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName);
|
||||||
@ -414,6 +424,7 @@ public:
|
|||||||
void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
|
void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
|
||||||
TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body);
|
TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body);
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
TAttributeType attributeFromName(const TString& name) const;
|
TAttributeType attributeFromName(const TString& name) const;
|
||||||
TAttributes* makeAttributes(const TString& identifier) const;
|
TAttributes* makeAttributes(const TString& identifier) const;
|
||||||
TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const;
|
TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const;
|
||||||
@ -422,11 +433,11 @@ public:
|
|||||||
// Determine selection control from attributes
|
// Determine selection control from attributes
|
||||||
void handleSelectionAttributes(const TAttributes& attributes, TIntermNode*);
|
void handleSelectionAttributes(const TAttributes& attributes, TIntermNode*);
|
||||||
void handleSwitchAttributes(const TAttributes& attributes, TIntermNode*);
|
void handleSwitchAttributes(const TAttributes& attributes, TIntermNode*);
|
||||||
|
|
||||||
// Determine loop control from attributes
|
// Determine loop control from attributes
|
||||||
void handleLoopAttributes(const TAttributes& attributes, TIntermNode*);
|
void handleLoopAttributes(const TAttributes& attributes, TIntermNode*);
|
||||||
|
#endif
|
||||||
|
|
||||||
void resizeMeshViewDimension(const TSourceLoc&, TType&);
|
void checkAndResizeMeshViewDim(const TSourceLoc&, TType&, bool isBlockMember);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type);
|
void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type);
|
||||||
@ -438,7 +449,9 @@ protected:
|
|||||||
bool isRuntimeLength(const TIntermTyped&) const;
|
bool isRuntimeLength(const TIntermTyped&) const;
|
||||||
TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable);
|
TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable);
|
||||||
TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer);
|
TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer);
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
void finish() override;
|
void finish() override;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//
|
//
|
||||||
@ -464,10 +477,11 @@ protected:
|
|||||||
TQualifier globalUniformDefaults;
|
TQualifier globalUniformDefaults;
|
||||||
TQualifier globalInputDefaults;
|
TQualifier globalInputDefaults;
|
||||||
TQualifier globalOutputDefaults;
|
TQualifier globalOutputDefaults;
|
||||||
int* atomicUintOffsets; // to become an array of the right size to hold an offset per binding point
|
|
||||||
TString currentCaller; // name of last function body entered (not valid when at global scope)
|
TString currentCaller; // name of last function body entered (not valid when at global scope)
|
||||||
TIdSetType inductiveLoopIds;
|
#ifndef GLSLANG_WEB
|
||||||
|
int* atomicUintOffsets; // to become an array of the right size to hold an offset per binding point
|
||||||
bool anyIndexLimits;
|
bool anyIndexLimits;
|
||||||
|
TIdSetType inductiveLoopIds;
|
||||||
TVector<TIntermTyped*> needsIndexLimitationChecking;
|
TVector<TIntermTyped*> needsIndexLimitationChecking;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -503,6 +517,7 @@ protected:
|
|||||||
// array-sizing declarations
|
// array-sizing declarations
|
||||||
//
|
//
|
||||||
TVector<TSymbol*> ioArraySymbolResizeList;
|
TVector<TSymbol*> ioArraySymbolResizeList;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -288,6 +288,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
|
|||||||
EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
|
EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
|
||||||
TSymbolTable** symbolTables)
|
TSymbolTable** symbolTables)
|
||||||
{
|
{
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
profile = EEsProfile;
|
||||||
|
version = 310;
|
||||||
|
#endif
|
||||||
|
|
||||||
(*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
|
(*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
|
||||||
InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source,
|
InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source,
|
||||||
infoSink, *symbolTables[language]);
|
infoSink, *symbolTables[language]);
|
||||||
@ -304,6 +309,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
|
|||||||
//
|
//
|
||||||
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
|
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
|
||||||
{
|
{
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
profile = EEsProfile;
|
||||||
|
version = 310;
|
||||||
|
#endif
|
||||||
|
|
||||||
std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
|
std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
|
||||||
|
|
||||||
if (builtInParseables == nullptr)
|
if (builtInParseables == nullptr)
|
||||||
@ -326,6 +336,7 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
|||||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangFragment, source,
|
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangFragment, source,
|
||||||
infoSink, commonTable, symbolTables);
|
infoSink, commonTable, symbolTables);
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// check for tessellation
|
// check for tessellation
|
||||||
if ((profile != EEsProfile && version >= 150) ||
|
if ((profile != EEsProfile && version >= 150) ||
|
||||||
(profile == EEsProfile && version >= 310)) {
|
(profile == EEsProfile && version >= 310)) {
|
||||||
@ -340,6 +351,7 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
|||||||
(profile == EEsProfile && version >= 310))
|
(profile == EEsProfile && version >= 310))
|
||||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source,
|
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangGeometry, source,
|
||||||
infoSink, commonTable, symbolTables);
|
infoSink, commonTable, symbolTables);
|
||||||
|
#endif
|
||||||
|
|
||||||
// check for compute
|
// check for compute
|
||||||
if ((profile != EEsProfile && version >= 420) ||
|
if ((profile != EEsProfile && version >= 420) ||
|
||||||
@ -347,7 +359,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
|||||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCompute, source,
|
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCompute, source,
|
||||||
infoSink, commonTable, symbolTables);
|
infoSink, commonTable, symbolTables);
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
// check for ray tracing stages
|
// check for ray tracing stages
|
||||||
if (profile != EEsProfile && version >= 450) {
|
if (profile != EEsProfile && version >= 450) {
|
||||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGenNV, source,
|
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGenNV, source,
|
||||||
@ -375,9 +386,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
|||||||
(profile == EEsProfile && version >= 320))
|
(profile == EEsProfile && version >= 320))
|
||||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTaskNV, source,
|
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTaskNV, source,
|
||||||
infoSink, commonTable, symbolTables);
|
infoSink, commonTable, symbolTables);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -479,11 +487,13 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp
|
|||||||
// Function to Print all builtins
|
// Function to Print all builtins
|
||||||
void DumpBuiltinSymbolTable(TInfoSink& infoSink, const TSymbolTable& symbolTable)
|
void DumpBuiltinSymbolTable(TInfoSink& infoSink, const TSymbolTable& symbolTable)
|
||||||
{
|
{
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
infoSink.debug << "BuiltinSymbolTable {\n";
|
infoSink.debug << "BuiltinSymbolTable {\n";
|
||||||
|
|
||||||
symbolTable.dump(infoSink, true);
|
symbolTable.dump(infoSink, true);
|
||||||
|
|
||||||
infoSink.debug << "}\n";
|
infoSink.debug << "}\n";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return true if the shader was correctly specified for version/profile/stage.
|
// Return true if the shader was correctly specified for version/profile/stage.
|
||||||
@ -581,6 +591,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// Correct for stage type...
|
// Correct for stage type...
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case EShLangGeometry:
|
case EShLangGeometry:
|
||||||
@ -612,7 +623,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
|||||||
version = profile == EEsProfile ? 310 : 420;
|
version = profile == EEsProfile ? 310 : 420;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EShLangRayGenNV:
|
case EShLangRayGenNV:
|
||||||
case EShLangIntersectNV:
|
case EShLangIntersectNV:
|
||||||
case EShLangAnyHitNV:
|
case EShLangAnyHitNV:
|
||||||
@ -633,7 +643,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
|||||||
infoSink.info.message(EPrefixError, "#version: mesh/task shaders require es profile with version 320 or above, or non-es profile with version 450 or above");
|
infoSink.info.message(EPrefixError, "#version: mesh/task shaders require es profile with version 320 or above, or non-es profile with version 450 or above");
|
||||||
version = profile == EEsProfile ? 320 : 450;
|
version = profile == EEsProfile ? 320 : 450;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -647,14 +656,9 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
|||||||
if (spvVersion.spv != 0) {
|
if (spvVersion.spv != 0) {
|
||||||
switch (profile) {
|
switch (profile) {
|
||||||
case EEsProfile:
|
case EEsProfile:
|
||||||
if (spvVersion.vulkan > 0 && version < 310) {
|
if (version < 310) {
|
||||||
correct = false;
|
correct = false;
|
||||||
infoSink.info.message(EPrefixError, "#version: ES shaders for Vulkan SPIR-V require version 310 or higher");
|
infoSink.info.message(EPrefixError, "#version: ES shaders for SPIR-V require version 310 or higher");
|
||||||
version = 310;
|
|
||||||
}
|
|
||||||
if (spvVersion.openGl >= 100) {
|
|
||||||
correct = false;
|
|
||||||
infoSink.info.message(EPrefixError, "#version: ES shaders for OpenGL SPIR-V are not supported");
|
|
||||||
version = 310;
|
version = 310;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -675,6 +679,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return correct;
|
return correct;
|
||||||
}
|
}
|
||||||
@ -833,13 +838,17 @@ bool ProcessDeferred(
|
|||||||
|
|
||||||
// Get all the stages, languages, clients, and other environment
|
// Get all the stages, languages, clients, and other environment
|
||||||
// stuff sorted out.
|
// stuff sorted out.
|
||||||
EShSource source = (messages & EShMsgReadHlsl) != 0 ? EShSourceHlsl : EShSourceGlsl;
|
EShSource sourceGuess = (messages & EShMsgReadHlsl) != 0 ? EShSourceHlsl : EShSourceGlsl;
|
||||||
SpvVersion spvVersion;
|
SpvVersion spvVersion;
|
||||||
EShLanguage stage = compiler->getLanguage();
|
EShLanguage stage = compiler->getLanguage();
|
||||||
TranslateEnvironment(environment, messages, source, stage, spvVersion);
|
TranslateEnvironment(environment, messages, sourceGuess, stage, spvVersion);
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
|
EShSource source = sourceGuess;
|
||||||
if (environment != nullptr && environment->target.hlslFunctionality1)
|
if (environment != nullptr && environment->target.hlslFunctionality1)
|
||||||
intermediate.setHlslFunctionality1();
|
intermediate.setHlslFunctionality1();
|
||||||
|
#else
|
||||||
|
const EShSource source = EShSourceGlsl;
|
||||||
|
#endif
|
||||||
// First, without using the preprocessor or parser, find the #version, so we know what
|
// First, without using the preprocessor or parser, find the #version, so we know what
|
||||||
// symbol tables, processing rules, etc. to set up. This does not need the extra strings
|
// symbol tables, processing rules, etc. to set up. This does not need the extra strings
|
||||||
// outlined above, just the user shader, after the system and user preambles.
|
// outlined above, just the user shader, after the system and user preambles.
|
||||||
@ -852,6 +861,7 @@ bool ProcessDeferred(
|
|||||||
: userInput.scanVersion(version, profile, versionNotFirstToken);
|
: userInput.scanVersion(version, profile, versionNotFirstToken);
|
||||||
bool versionNotFound = version == 0;
|
bool versionNotFound = version == 0;
|
||||||
if (forceDefaultVersionAndProfile && source == EShSourceGlsl) {
|
if (forceDefaultVersionAndProfile && source == EShSourceGlsl) {
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound &&
|
if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound &&
|
||||||
(version != defaultVersion || profile != defaultProfile)) {
|
(version != defaultVersion || profile != defaultProfile)) {
|
||||||
compiler->infoSink.info << "Warning, (version, profile) forced to be ("
|
compiler->infoSink.info << "Warning, (version, profile) forced to be ("
|
||||||
@ -859,7 +869,7 @@ bool ProcessDeferred(
|
|||||||
<< "), while in source code it is ("
|
<< "), while in source code it is ("
|
||||||
<< version << ", " << ProfileName(profile) << ")\n";
|
<< version << ", " << ProfileName(profile) << ")\n";
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (versionNotFound) {
|
if (versionNotFound) {
|
||||||
versionNotFirstToken = false;
|
versionNotFirstToken = false;
|
||||||
versionNotFirst = false;
|
versionNotFirst = false;
|
||||||
@ -871,7 +881,13 @@ bool ProcessDeferred(
|
|||||||
|
|
||||||
bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
|
bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
|
||||||
versionNotFirst, defaultVersion, source, version, profile, spvVersion);
|
versionNotFirst, defaultVersion, source, version, profile, spvVersion);
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
profile = EEsProfile;
|
||||||
|
version = 310;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
|
bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
bool warnVersionNotFirst = false;
|
bool warnVersionNotFirst = false;
|
||||||
if (! versionWillBeError && versionNotFirstToken) {
|
if (! versionWillBeError && versionNotFirstToken) {
|
||||||
if (messages & EShMsgRelaxedErrors)
|
if (messages & EShMsgRelaxedErrors)
|
||||||
@ -879,6 +895,7 @@ bool ProcessDeferred(
|
|||||||
else
|
else
|
||||||
versionWillBeError = true;
|
versionWillBeError = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
intermediate.setSource(source);
|
intermediate.setSource(source);
|
||||||
intermediate.setVersion(version);
|
intermediate.setVersion(version);
|
||||||
@ -887,8 +904,10 @@ bool ProcessDeferred(
|
|||||||
RecordProcesses(intermediate, messages, sourceEntryPointName);
|
RecordProcesses(intermediate, messages, sourceEntryPointName);
|
||||||
if (spvVersion.vulkan > 0)
|
if (spvVersion.vulkan > 0)
|
||||||
intermediate.setOriginUpperLeft();
|
intermediate.setOriginUpperLeft();
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl)
|
if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl)
|
||||||
intermediate.setHlslOffsets();
|
intermediate.setHlslOffsets();
|
||||||
|
#endif
|
||||||
if (messages & EShMsgDebugInfo) {
|
if (messages & EShMsgDebugInfo) {
|
||||||
intermediate.setSourceFile(names[numPre]);
|
intermediate.setSourceFile(names[numPre]);
|
||||||
for (int s = 0; s < numStrings; ++s) {
|
for (int s = 0; s < numStrings; ++s) {
|
||||||
@ -938,11 +957,13 @@ bool ProcessDeferred(
|
|||||||
parseContext->setLimits(*resources);
|
parseContext->setLimits(*resources);
|
||||||
if (! goodVersion)
|
if (! goodVersion)
|
||||||
parseContext->addError();
|
parseContext->addError();
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (warnVersionNotFirst) {
|
if (warnVersionNotFirst) {
|
||||||
TSourceLoc loc;
|
TSourceLoc loc;
|
||||||
loc.init();
|
loc.init();
|
||||||
parseContext->warn(loc, "Illegal to have non-comment, non-whitespace tokens before #version", "#version", "");
|
parseContext->warn(loc, "Illegal to have non-comment, non-whitespace tokens before #version", "#version", "");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
parseContext->initializeExtensionBehavior();
|
parseContext->initializeExtensionBehavior();
|
||||||
|
|
||||||
@ -973,6 +994,8 @@ bool ProcessDeferred(
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
// Responsible for keeping track of the most recent source string and line in
|
// Responsible for keeping track of the most recent source string and line in
|
||||||
// the preprocessor and outputting newlines appropriately if the source string
|
// the preprocessor and outputting newlines appropriately if the source string
|
||||||
// or line changes.
|
// or line changes.
|
||||||
@ -1169,6 +1192,8 @@ struct DoPreprocessing {
|
|||||||
std::string* outputString;
|
std::string* outputString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// DoFullParse is a valid ProcessingConext template argument for fully
|
// DoFullParse is a valid ProcessingConext template argument for fully
|
||||||
// parsing the shader. It populates the "intermediate" with the AST.
|
// parsing the shader. It populates the "intermediate" with the AST.
|
||||||
struct DoFullParse{
|
struct DoFullParse{
|
||||||
@ -1199,6 +1224,7 @@ struct DoFullParse{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// Take a single compilation unit, and run the preprocessor on it.
|
// Take a single compilation unit, and run the preprocessor on it.
|
||||||
// Return: True if there were no issues found in preprocessing,
|
// Return: True if there were no issues found in preprocessing,
|
||||||
// False if during preprocessing any unknown version, pragmas or
|
// False if during preprocessing any unknown version, pragmas or
|
||||||
@ -1231,6 +1257,7 @@ bool PreprocessDeferred(
|
|||||||
forwardCompatible, messages, intermediate, parser,
|
forwardCompatible, messages, intermediate, parser,
|
||||||
false, includer);
|
false, includer);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// do a partial compile on the given strings for a single compilation unit
|
// do a partial compile on the given strings for a single compilation unit
|
||||||
@ -1749,6 +1776,11 @@ void TShader::addProcesses(const std::vector<std::string>& p)
|
|||||||
intermediate->addProcesses(p);
|
intermediate->addProcesses(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); }
|
||||||
|
void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); }
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
// Set binding base for given resource type
|
// Set binding base for given resource type
|
||||||
void TShader::setShiftBinding(TResourceType res, unsigned int base) {
|
void TShader::setShiftBinding(TResourceType res, unsigned int base) {
|
||||||
intermediate->setShiftBinding(res, base);
|
intermediate->setShiftBinding(res, base);
|
||||||
@ -1776,7 +1808,7 @@ void TShader::setShiftSsboBinding(unsigned int base) { setShiftBinding(EResSs
|
|||||||
// Enables binding automapping using TIoMapper
|
// Enables binding automapping using TIoMapper
|
||||||
void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); }
|
void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); }
|
||||||
// Enables position.Y output negation in vertex shader
|
// Enables position.Y output negation in vertex shader
|
||||||
void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); }
|
|
||||||
// Fragile: currently within one stage: simple auto-assignment of location
|
// Fragile: currently within one stage: simple auto-assignment of location
|
||||||
void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); }
|
void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); }
|
||||||
void TShader::addUniformLocationOverride(const char* name, int loc)
|
void TShader::addUniformLocationOverride(const char* name, int loc)
|
||||||
@ -1787,12 +1819,16 @@ void TShader::setUniformLocationBase(int base)
|
|||||||
{
|
{
|
||||||
intermediate->setUniformLocationBase(base);
|
intermediate->setUniformLocationBase(base);
|
||||||
}
|
}
|
||||||
// See comment above TDefaultHlslIoMapper in iomapper.cpp:
|
|
||||||
void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); }
|
|
||||||
void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); }
|
|
||||||
void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
|
void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
|
||||||
void TShader::setResourceSetBinding(const std::vector<std::string>& base) { intermediate->setResourceSetBinding(base); }
|
void TShader::setResourceSetBinding(const std::vector<std::string>& base) { intermediate->setResourceSetBinding(base); }
|
||||||
void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); }
|
void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
|
// See comment above TDefaultHlslIoMapper in iomapper.cpp:
|
||||||
|
void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); }
|
||||||
|
void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); }
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Turn the shader strings into a parse tree in the TIntermediate.
|
// Turn the shader strings into a parse tree in the TIntermediate.
|
||||||
@ -1816,6 +1852,7 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion
|
|||||||
&environment);
|
&environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// Fill in a string with the result of preprocessing ShaderStrings
|
// Fill in a string with the result of preprocessing ShaderStrings
|
||||||
// Returns true if all extensions, pragmas and version strings were valid.
|
// Returns true if all extensions, pragmas and version strings were valid.
|
||||||
//
|
//
|
||||||
@ -1840,6 +1877,7 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources,
|
|||||||
defaultProfile, forceDefaultVersionAndProfile,
|
defaultProfile, forceDefaultVersionAndProfile,
|
||||||
forwardCompatible, message, includer, *intermediate, output_string);
|
forwardCompatible, message, includer, *intermediate, output_string);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const char* TShader::getInfoLog()
|
const char* TShader::getInfoLog()
|
||||||
{
|
{
|
||||||
@ -1851,7 +1889,11 @@ const char* TShader::getInfoDebugLog()
|
|||||||
return infoSink->debug.c_str();
|
return infoSink->debug.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false)
|
TProgram::TProgram() :
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
reflection(0),
|
||||||
|
#endif
|
||||||
|
linked(false)
|
||||||
{
|
{
|
||||||
pool = new TPoolAllocator;
|
pool = new TPoolAllocator;
|
||||||
infoSink = new TInfoSink;
|
infoSink = new TInfoSink;
|
||||||
@ -1863,9 +1905,10 @@ TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false)
|
|||||||
|
|
||||||
TProgram::~TProgram()
|
TProgram::~TProgram()
|
||||||
{
|
{
|
||||||
delete ioMapper;
|
|
||||||
delete infoSink;
|
delete infoSink;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
delete reflection;
|
delete reflection;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int s = 0; s < EShLangCount; ++s)
|
for (int s = 0; s < EShLangCount; ++s)
|
||||||
if (newedIntermediate[s])
|
if (newedIntermediate[s])
|
||||||
@ -1910,6 +1953,7 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
|||||||
if (stages[stage].size() == 0)
|
if (stages[stage].size() == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
int numEsShaders = 0, numNonEsShaders = 0;
|
int numEsShaders = 0, numNonEsShaders = 0;
|
||||||
for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) {
|
for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) {
|
||||||
if ((*it)->intermediate->getProfile() == EEsProfile) {
|
if ((*it)->intermediate->getProfile() == EEsProfile) {
|
||||||
@ -1958,7 +2002,9 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
|||||||
for (it = stages[stage].begin(); it != stages[stage].end(); ++it)
|
for (it = stages[stage].begin(); it != stages[stage].end(); ++it)
|
||||||
intermediate[stage]->merge(*infoSink, *(*it)->intermediate);
|
intermediate[stage]->merge(*infoSink, *(*it)->intermediate);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
intermediate[stage] = stages[stage].front()->intermediate;
|
||||||
|
#endif
|
||||||
intermediate[stage]->finalCheck(*infoSink, (messages & EShMsgKeepUncalled) != 0);
|
intermediate[stage]->finalCheck(*infoSink, (messages & EShMsgKeepUncalled) != 0);
|
||||||
|
|
||||||
if (messages & EShMsgAST)
|
if (messages & EShMsgAST)
|
||||||
@ -1977,13 +2023,15 @@ const char* TProgram::getInfoDebugLog()
|
|||||||
return infoSink->debug.c_str();
|
return infoSink->debug.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
//
|
//
|
||||||
// Reflection implementation.
|
// Reflection implementation.
|
||||||
//
|
//
|
||||||
|
|
||||||
bool TProgram::buildReflection(int opts)
|
bool TProgram::buildReflection(int opts)
|
||||||
{
|
{
|
||||||
if (! linked || reflection)
|
if (! linked || reflection != nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int firstStage = EShLangVertex, lastStage = EShLangFragment;
|
int firstStage = EShLangVertex, lastStage = EShLangFragment;
|
||||||
@ -2015,6 +2063,8 @@ bool TProgram::buildReflection(int opts)
|
|||||||
|
|
||||||
unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); }
|
unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); }
|
||||||
int TProgram::getReflectionIndex(const char* name) const { return reflection->getIndex(name); }
|
int TProgram::getReflectionIndex(const char* name) const { return reflection->getIndex(name); }
|
||||||
|
int TProgram::getReflectionPipeIOIndex(const char* name, const bool inOrOut) const
|
||||||
|
{ return reflection->getPipeIOIndex(name, inOrOut); }
|
||||||
|
|
||||||
int TProgram::getNumUniformVariables() const { return reflection->getNumUniforms(); }
|
int TProgram::getNumUniformVariables() const { return reflection->getNumUniforms(); }
|
||||||
const TObjectReflection& TProgram::getUniform(int index) const { return reflection->getUniform(index); }
|
const TObjectReflection& TProgram::getUniform(int index) const { return reflection->getUniform(index); }
|
||||||
@ -2030,27 +2080,31 @@ int TProgram::getNumBufferBlocks() const { return r
|
|||||||
const TObjectReflection& TProgram::getBufferBlock(int index) const { return reflection->getStorageBufferBlock(index); }
|
const TObjectReflection& TProgram::getBufferBlock(int index) const { return reflection->getStorageBufferBlock(index); }
|
||||||
int TProgram::getNumAtomicCounters() const { return reflection->getNumAtomicCounters(); }
|
int TProgram::getNumAtomicCounters() const { return reflection->getNumAtomicCounters(); }
|
||||||
const TObjectReflection& TProgram::getAtomicCounter(int index) const { return reflection->getAtomicCounter(index); }
|
const TObjectReflection& TProgram::getAtomicCounter(int index) const { return reflection->getAtomicCounter(index); }
|
||||||
|
void TProgram::dumpReflection() { if (reflection != nullptr) reflection->dump(); }
|
||||||
void TProgram::dumpReflection() { reflection->dump(); }
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// I/O mapping implementation.
|
// I/O mapping implementation.
|
||||||
//
|
//
|
||||||
bool TProgram::mapIO(TIoMapResolver* resolver)
|
bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper)
|
||||||
{
|
{
|
||||||
if (! linked || ioMapper)
|
if (! linked)
|
||||||
return false;
|
return false;
|
||||||
|
TIoMapper* ioMapper = nullptr;
|
||||||
ioMapper = new TIoMapper;
|
TIoMapper defaultIOMapper;
|
||||||
|
if (pIoMapper == nullptr)
|
||||||
|
ioMapper = &defaultIOMapper;
|
||||||
|
else
|
||||||
|
ioMapper = pIoMapper;
|
||||||
for (int s = 0; s < EShLangCount; ++s) {
|
for (int s = 0; s < EShLangCount; ++s) {
|
||||||
if (intermediate[s]) {
|
if (intermediate[s]) {
|
||||||
if (! ioMapper->addStage((EShLanguage)s, *intermediate[s], *infoSink, resolver))
|
if (! ioMapper->addStage((EShLanguage)s, *intermediate[s], *infoSink, pResolver))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return ioMapper->doMap(pResolver, *infoSink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
@ -61,63 +61,66 @@ void TType::buildMangledName(TString& mangledName) const
|
|||||||
|
|
||||||
switch (basicType) {
|
switch (basicType) {
|
||||||
case EbtFloat: mangledName += 'f'; break;
|
case EbtFloat: mangledName += 'f'; break;
|
||||||
case EbtDouble: mangledName += 'd'; break;
|
|
||||||
case EbtFloat16: mangledName += "f16"; break;
|
|
||||||
case EbtInt: mangledName += 'i'; break;
|
case EbtInt: mangledName += 'i'; break;
|
||||||
case EbtUint: mangledName += 'u'; break;
|
case EbtUint: mangledName += 'u'; break;
|
||||||
|
case EbtBool: mangledName += 'b'; break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
case EbtDouble: mangledName += 'd'; break;
|
||||||
|
case EbtFloat16: mangledName += "f16"; break;
|
||||||
case EbtInt8: mangledName += "i8"; break;
|
case EbtInt8: mangledName += "i8"; break;
|
||||||
case EbtUint8: mangledName += "u8"; break;
|
case EbtUint8: mangledName += "u8"; break;
|
||||||
case EbtInt16: mangledName += "i16"; break;
|
case EbtInt16: mangledName += "i16"; break;
|
||||||
case EbtUint16: mangledName += "u16"; break;
|
case EbtUint16: mangledName += "u16"; break;
|
||||||
case EbtInt64: mangledName += "i64"; break;
|
case EbtInt64: mangledName += "i64"; break;
|
||||||
case EbtUint64: mangledName += "u64"; break;
|
case EbtUint64: mangledName += "u64"; break;
|
||||||
case EbtBool: mangledName += 'b'; break;
|
|
||||||
case EbtAtomicUint: mangledName += "au"; break;
|
case EbtAtomicUint: mangledName += "au"; break;
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EbtAccStructNV: mangledName += "asnv"; break;
|
case EbtAccStructNV: mangledName += "asnv"; break;
|
||||||
#endif
|
#endif
|
||||||
case EbtSampler:
|
case EbtSampler:
|
||||||
switch (sampler.type) {
|
switch (sampler.type) {
|
||||||
#ifdef AMD_EXTENSIONS
|
#ifndef GLSLANG_WEB
|
||||||
case EbtFloat16: mangledName += "f16"; break;
|
case EbtFloat16: mangledName += "f16"; break;
|
||||||
#endif
|
#endif
|
||||||
case EbtInt: mangledName += "i"; break;
|
case EbtInt: mangledName += "i"; break;
|
||||||
case EbtUint: mangledName += "u"; break;
|
case EbtUint: mangledName += "u"; break;
|
||||||
default: break; // some compilers want this
|
default: break; // some compilers want this
|
||||||
}
|
}
|
||||||
if (sampler.image)
|
if (sampler.isImageClass())
|
||||||
mangledName += "I"; // a normal image
|
mangledName += "I"; // a normal image or subpass
|
||||||
else if (sampler.sampler)
|
else if (sampler.isPureSampler())
|
||||||
mangledName += "p"; // a "pure" sampler
|
mangledName += "p"; // a "pure" sampler
|
||||||
else if (!sampler.combined)
|
else if (!sampler.isCombined())
|
||||||
mangledName += "t"; // a "pure" texture
|
mangledName += "t"; // a "pure" texture
|
||||||
else
|
else
|
||||||
mangledName += "s"; // traditional combined sampler
|
mangledName += "s"; // traditional combined sampler
|
||||||
if (sampler.arrayed)
|
if (sampler.isArrayed())
|
||||||
mangledName += "A";
|
mangledName += "A";
|
||||||
if (sampler.shadow)
|
if (sampler.isShadow())
|
||||||
mangledName += "S";
|
mangledName += "S";
|
||||||
if (sampler.external)
|
if (sampler.isExternal())
|
||||||
mangledName += "E";
|
mangledName += "E";
|
||||||
if (sampler.yuv)
|
if (sampler.isYuv())
|
||||||
mangledName += "Y";
|
mangledName += "Y";
|
||||||
switch (sampler.dim) {
|
switch (sampler.dim) {
|
||||||
case Esd1D: mangledName += "1"; break;
|
|
||||||
case Esd2D: mangledName += "2"; break;
|
case Esd2D: mangledName += "2"; break;
|
||||||
case Esd3D: mangledName += "3"; break;
|
case Esd3D: mangledName += "3"; break;
|
||||||
case EsdCube: mangledName += "C"; break;
|
case EsdCube: mangledName += "C"; break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
case Esd1D: mangledName += "1"; break;
|
||||||
case EsdRect: mangledName += "R2"; break;
|
case EsdRect: mangledName += "R2"; break;
|
||||||
case EsdBuffer: mangledName += "B"; break;
|
case EsdBuffer: mangledName += "B"; break;
|
||||||
case EsdSubpass: mangledName += "P"; break;
|
case EsdSubpass: mangledName += "P"; break;
|
||||||
|
#endif
|
||||||
default: break; // some compilers want this
|
default: break; // some compilers want this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
if (sampler.hasReturnStruct()) {
|
if (sampler.hasReturnStruct()) {
|
||||||
// Name mangle for sampler return struct uses struct table index.
|
// Name mangle for sampler return struct uses struct table index.
|
||||||
mangledName += "-tx-struct";
|
mangledName += "-tx-struct";
|
||||||
|
|
||||||
char text[16]; // plenty enough space for the small integers.
|
char text[16]; // plenty enough space for the small integers.
|
||||||
snprintf(text, sizeof(text), "%d-", sampler.structReturnIndex);
|
snprintf(text, sizeof(text), "%d-", sampler.getStructReturnIndex());
|
||||||
mangledName += text;
|
mangledName += text;
|
||||||
} else {
|
} else {
|
||||||
switch (sampler.getVectorSize()) {
|
switch (sampler.getVectorSize()) {
|
||||||
@ -127,8 +130,9 @@ void TType::buildMangledName(TString& mangledName) const
|
|||||||
case 4: break; // default to prior name mangle behavior
|
case 4: break; // default to prior name mangle behavior
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sampler.ms)
|
if (sampler.isMultiSample())
|
||||||
mangledName += "M";
|
mangledName += "M";
|
||||||
break;
|
break;
|
||||||
case EbtStruct:
|
case EbtStruct:
|
||||||
@ -172,6 +176,8 @@ void TType::buildMangledName(TString& mangledName) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
//
|
//
|
||||||
// Dump functions.
|
// Dump functions.
|
||||||
//
|
//
|
||||||
@ -229,7 +235,7 @@ void TFunction::dump(TInfoSink& infoSink, bool complete) const
|
|||||||
infoSink.debug << "\n";
|
infoSink.debug << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void TAnonMember::dump(TInfoSink& TInfoSink, bool complete) const
|
void TAnonMember::dump(TInfoSink& TInfoSink, bool) const
|
||||||
{
|
{
|
||||||
TInfoSink.debug << "anonymous member " << getMemberNumber() << " of " << getAnonContainer().getName().c_str()
|
TInfoSink.debug << "anonymous member " << getMemberNumber() << " of " << getAnonContainer().getName().c_str()
|
||||||
<< "\n";
|
<< "\n";
|
||||||
@ -250,6 +256,8 @@ void TSymbolTable::dump(TInfoSink& infoSink, bool complete) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Functions have buried pointers to delete.
|
// Functions have buried pointers to delete.
|
||||||
//
|
//
|
||||||
|
@ -116,8 +116,11 @@ public:
|
|||||||
}
|
}
|
||||||
virtual int getNumExtensions() const { return extensions == nullptr ? 0 : (int)extensions->size(); }
|
virtual int getNumExtensions() const { return extensions == nullptr ? 0 : (int)extensions->size(); }
|
||||||
virtual const char** getExtensions() const { return extensions->data(); }
|
virtual const char** getExtensions() const { return extensions->data(); }
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const = 0;
|
virtual void dump(TInfoSink& infoSink, bool complete = false) const = 0;
|
||||||
void dumpExtensions(TInfoSink& infoSink) const;
|
void dumpExtensions(TInfoSink& infoSink) const;
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual bool isReadOnly() const { return ! writable; }
|
virtual bool isReadOnly() const { return ! writable; }
|
||||||
virtual void makeReadOnly() { writable = false; }
|
virtual void makeReadOnly() { writable = false; }
|
||||||
@ -193,7 +196,9 @@ public:
|
|||||||
}
|
}
|
||||||
virtual const char** getMemberExtensions(int member) const { return (*memberExtensions)[member].data(); }
|
virtual const char** getMemberExtensions(int member) const { return (*memberExtensions)[member].data(); }
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const;
|
virtual void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit TVariable(const TVariable&);
|
explicit TVariable(const TVariable&);
|
||||||
@ -314,7 +319,9 @@ public:
|
|||||||
virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; }
|
virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; }
|
||||||
virtual const TParameter& operator[](int i) const { return parameters[i]; }
|
virtual const TParameter& operator[](int i) const { return parameters[i]; }
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
|
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit TFunction(const TFunction&);
|
explicit TFunction(const TFunction&);
|
||||||
@ -374,7 +381,9 @@ public:
|
|||||||
virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); }
|
virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); }
|
||||||
|
|
||||||
virtual int getAnonId() const { return anonId; }
|
virtual int getAnonId() const { return anonId; }
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
|
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit TAnonMember(const TAnonMember&);
|
explicit TAnonMember(const TAnonMember&);
|
||||||
@ -542,7 +551,9 @@ public:
|
|||||||
|
|
||||||
void relateToOperator(const char* name, TOperator op);
|
void relateToOperator(const char* name, TOperator op);
|
||||||
void setFunctionExtensions(const char* name, int num, const char* const extensions[]);
|
void setFunctionExtensions(const char* name, int num, const char* const extensions[]);
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
void dump(TInfoSink& infoSink, bool complete = false) const;
|
void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||||
|
#endif
|
||||||
TSymbolTableLevel* clone() const;
|
TSymbolTableLevel* clone() const;
|
||||||
void readOnly();
|
void readOnly();
|
||||||
|
|
||||||
@ -843,7 +854,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int getMaxSymbolId() { return uniqueId; }
|
int getMaxSymbolId() { return uniqueId; }
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
void dump(TInfoSink& infoSink, bool complete = false) const;
|
void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||||
|
#endif
|
||||||
void copyTable(const TSymbolTable& copyOf);
|
void copyTable(const TSymbolTable& copyOf);
|
||||||
|
|
||||||
void setPreviousDefaultPrecisions(TPrecisionQualifier *p) { table[currentLevel()]->setPreviousDefaultPrecisions(p); }
|
void setPreviousDefaultPrecisions(TPrecisionQualifier *p) { table[currentLevel()]->setPreviousDefaultPrecisions(p); }
|
||||||
|
@ -145,6 +145,8 @@
|
|||||||
|
|
||||||
namespace glslang {
|
namespace glslang {
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize all extensions, almost always to 'disable', as once their features
|
// Initialize all extensions, almost always to 'disable', as once their features
|
||||||
// are incorporated into a core version, their features are supported through allowing that
|
// are incorporated into a core version, their features are supported through allowing that
|
||||||
@ -170,8 +172,10 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_ARB_tessellation_shader] = EBhDisable;
|
extensionBehavior[E_GL_ARB_tessellation_shader] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_enhanced_layouts] = EBhDisable;
|
extensionBehavior[E_GL_ARB_enhanced_layouts] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_texture_cube_map_array] = EBhDisable;
|
extensionBehavior[E_GL_ARB_texture_cube_map_array] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_ARB_texture_multisample] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_shader_texture_lod] = EBhDisable;
|
extensionBehavior[E_GL_ARB_shader_texture_lod] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_explicit_attrib_location] = EBhDisable;
|
extensionBehavior[E_GL_ARB_explicit_attrib_location] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_ARB_explicit_uniform_location] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_shader_image_load_store] = EBhDisable;
|
extensionBehavior[E_GL_ARB_shader_image_load_store] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_shader_atomic_counters] = EBhDisable;
|
extensionBehavior[E_GL_ARB_shader_atomic_counters] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_shader_draw_parameters] = EBhDisable;
|
extensionBehavior[E_GL_ARB_shader_draw_parameters] = EBhDisable;
|
||||||
@ -180,6 +184,7 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable;
|
extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable;
|
extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_gpu_shader_int64] = EBhDisable;
|
extensionBehavior[E_GL_ARB_gpu_shader_int64] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_ARB_gpu_shader_fp64] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_shader_ballot] = EBhDisable;
|
extensionBehavior[E_GL_ARB_shader_ballot] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable;
|
extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable;
|
extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable;
|
||||||
@ -187,6 +192,10 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
// extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members
|
// extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members
|
||||||
extensionBehavior[E_GL_ARB_post_depth_coverage] = EBhDisable;
|
extensionBehavior[E_GL_ARB_post_depth_coverage] = EBhDisable;
|
||||||
extensionBehavior[E_GL_ARB_shader_viewport_layer_array] = EBhDisable;
|
extensionBehavior[E_GL_ARB_shader_viewport_layer_array] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_ARB_fragment_shader_interlock] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_ARB_shader_clock] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_ARB_uniform_buffer_object] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_ARB_sample_shading] = EBhDisable;
|
||||||
|
|
||||||
extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable;
|
extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable;
|
||||||
extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable;
|
extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable;
|
||||||
@ -210,6 +219,8 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_EXT_fragment_invocation_density] = EBhDisable;
|
extensionBehavior[E_GL_EXT_fragment_invocation_density] = EBhDisable;
|
||||||
extensionBehavior[E_GL_EXT_buffer_reference] = EBhDisable;
|
extensionBehavior[E_GL_EXT_buffer_reference] = EBhDisable;
|
||||||
extensionBehavior[E_GL_EXT_buffer_reference2] = EBhDisable;
|
extensionBehavior[E_GL_EXT_buffer_reference2] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_EXT_buffer_reference_uvec2] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_EXT_demote_to_helper_invocation] = EBhDisable;
|
||||||
|
|
||||||
extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable;
|
extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable;
|
||||||
extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable;
|
extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable;
|
||||||
@ -218,7 +229,6 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable;
|
extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable;
|
||||||
extensionBehavior[E_GL_GOOGLE_include_directive] = EBhDisable;
|
extensionBehavior[E_GL_GOOGLE_include_directive] = EBhDisable;
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
extensionBehavior[E_GL_AMD_shader_ballot] = EBhDisable;
|
extensionBehavior[E_GL_AMD_shader_ballot] = EBhDisable;
|
||||||
extensionBehavior[E_GL_AMD_shader_trinary_minmax] = EBhDisable;
|
extensionBehavior[E_GL_AMD_shader_trinary_minmax] = EBhDisable;
|
||||||
extensionBehavior[E_GL_AMD_shader_explicit_vertex_parameter] = EBhDisable;
|
extensionBehavior[E_GL_AMD_shader_explicit_vertex_parameter] = EBhDisable;
|
||||||
@ -229,9 +239,9 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable;
|
extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable;
|
||||||
extensionBehavior[E_GL_AMD_shader_fragment_mask] = EBhDisable;
|
extensionBehavior[E_GL_AMD_shader_fragment_mask] = EBhDisable;
|
||||||
extensionBehavior[E_GL_AMD_gpu_shader_half_float_fetch] = EBhDisable;
|
extensionBehavior[E_GL_AMD_gpu_shader_half_float_fetch] = EBhDisable;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
extensionBehavior[E_GL_INTEL_shader_integer_functions2] = EBhDisable;
|
||||||
|
|
||||||
extensionBehavior[E_GL_NV_sample_mask_override_coverage] = EBhDisable;
|
extensionBehavior[E_GL_NV_sample_mask_override_coverage] = EBhDisable;
|
||||||
extensionBehavior[E_SPV_NV_geometry_shader_passthrough] = EBhDisable;
|
extensionBehavior[E_SPV_NV_geometry_shader_passthrough] = EBhDisable;
|
||||||
extensionBehavior[E_GL_NV_viewport_array2] = EBhDisable;
|
extensionBehavior[E_GL_NV_viewport_array2] = EBhDisable;
|
||||||
@ -247,9 +257,10 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable;
|
extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable;
|
||||||
extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable;
|
extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable;
|
||||||
extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable;
|
extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable;
|
||||||
#endif
|
|
||||||
|
|
||||||
extensionBehavior[E_GL_NV_cooperative_matrix] = EBhDisable;
|
extensionBehavior[E_GL_NV_cooperative_matrix] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_NV_shader_sm_builtins] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_NV_integer_cooperative_matrix] = EBhDisable;
|
||||||
|
|
||||||
// AEP
|
// AEP
|
||||||
extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable;
|
extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable;
|
||||||
@ -282,6 +293,7 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
// EXT extensions
|
// EXT extensions
|
||||||
extensionBehavior[E_GL_EXT_device_group] = EBhDisable;
|
extensionBehavior[E_GL_EXT_device_group] = EBhDisable;
|
||||||
extensionBehavior[E_GL_EXT_multiview] = EBhDisable;
|
extensionBehavior[E_GL_EXT_multiview] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_EXT_shader_realtime_clock] = EBhDisable;
|
||||||
|
|
||||||
// OVR extensions
|
// OVR extensions
|
||||||
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
|
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
|
||||||
@ -296,16 +308,26 @@ void TParseVersions::initializeExtensionBehavior()
|
|||||||
extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float16] = EBhDisable;
|
extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float16] = EBhDisable;
|
||||||
extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float32] = EBhDisable;
|
extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float32] = EBhDisable;
|
||||||
extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float64] = EBhDisable;
|
extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float64] = EBhDisable;
|
||||||
|
|
||||||
|
// subgroup extended types
|
||||||
|
extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_int8] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_int16] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_int64] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_float16] = EBhDisable;
|
||||||
}
|
}
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
|
|
||||||
// Get code that is not part of a shared symbol table, is specific to this shader,
|
// Get code that is not part of a shared symbol table, is specific to this shader,
|
||||||
// or needed by the preprocessor (which does not use a shared symbol table).
|
// or needed by the preprocessor (which does not use a shared symbol table).
|
||||||
void TParseVersions::getPreamble(std::string& preamble)
|
void TParseVersions::getPreamble(std::string& preamble)
|
||||||
{
|
{
|
||||||
if (profile == EEsProfile) {
|
if (isEsProfile()) {
|
||||||
preamble =
|
preamble =
|
||||||
"#define GL_ES 1\n"
|
"#define GL_ES 1\n"
|
||||||
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"
|
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
;
|
||||||
|
#else
|
||||||
"#define GL_OES_texture_3D 1\n"
|
"#define GL_OES_texture_3D 1\n"
|
||||||
"#define GL_OES_standard_derivatives 1\n"
|
"#define GL_OES_standard_derivatives 1\n"
|
||||||
"#define GL_EXT_frag_depth 1\n"
|
"#define GL_EXT_frag_depth 1\n"
|
||||||
@ -317,7 +339,6 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
|
|
||||||
// AEP
|
// AEP
|
||||||
"#define GL_ANDROID_extension_pack_es31a 1\n"
|
"#define GL_ANDROID_extension_pack_es31a 1\n"
|
||||||
"#define GL_KHR_blend_equation_advanced 1\n"
|
|
||||||
"#define GL_OES_sample_variables 1\n"
|
"#define GL_OES_sample_variables 1\n"
|
||||||
"#define GL_OES_shader_image_atomic 1\n"
|
"#define GL_OES_shader_image_atomic 1\n"
|
||||||
"#define GL_OES_shader_multisample_interpolation 1\n"
|
"#define GL_OES_shader_multisample_interpolation 1\n"
|
||||||
@ -345,11 +366,9 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
|
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
|
||||||
;
|
;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
if (isEsProfile() && version >= 300) {
|
||||||
if (profile == EEsProfile && version >= 300) {
|
|
||||||
preamble += "#define GL_NV_shader_noperspective_interpolation 1\n";
|
preamble += "#define GL_NV_shader_noperspective_interpolation 1\n";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
preamble =
|
preamble =
|
||||||
@ -363,8 +382,10 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_ARB_tessellation_shader 1\n"
|
"#define GL_ARB_tessellation_shader 1\n"
|
||||||
"#define GL_ARB_enhanced_layouts 1\n"
|
"#define GL_ARB_enhanced_layouts 1\n"
|
||||||
"#define GL_ARB_texture_cube_map_array 1\n"
|
"#define GL_ARB_texture_cube_map_array 1\n"
|
||||||
|
"#define GL_ARB_texture_multisample 1\n"
|
||||||
"#define GL_ARB_shader_texture_lod 1\n"
|
"#define GL_ARB_shader_texture_lod 1\n"
|
||||||
"#define GL_ARB_explicit_attrib_location 1\n"
|
"#define GL_ARB_explicit_attrib_location 1\n"
|
||||||
|
"#define GL_ARB_explicit_uniform_location 1\n"
|
||||||
"#define GL_ARB_shader_image_load_store 1\n"
|
"#define GL_ARB_shader_image_load_store 1\n"
|
||||||
"#define GL_ARB_shader_atomic_counters 1\n"
|
"#define GL_ARB_shader_atomic_counters 1\n"
|
||||||
"#define GL_ARB_shader_draw_parameters 1\n"
|
"#define GL_ARB_shader_draw_parameters 1\n"
|
||||||
@ -373,12 +394,16 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_ARB_shader_texture_image_samples 1\n"
|
"#define GL_ARB_shader_texture_image_samples 1\n"
|
||||||
"#define GL_ARB_viewport_array 1\n"
|
"#define GL_ARB_viewport_array 1\n"
|
||||||
"#define GL_ARB_gpu_shader_int64 1\n"
|
"#define GL_ARB_gpu_shader_int64 1\n"
|
||||||
|
"#define GL_ARB_gpu_shader_fp64 1\n"
|
||||||
"#define GL_ARB_shader_ballot 1\n"
|
"#define GL_ARB_shader_ballot 1\n"
|
||||||
"#define GL_ARB_sparse_texture2 1\n"
|
"#define GL_ARB_sparse_texture2 1\n"
|
||||||
"#define GL_ARB_sparse_texture_clamp 1\n"
|
"#define GL_ARB_sparse_texture_clamp 1\n"
|
||||||
"#define GL_ARB_shader_stencil_export 1\n"
|
"#define GL_ARB_shader_stencil_export 1\n"
|
||||||
|
"#define GL_ARB_sample_shading 1\n"
|
||||||
// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members
|
// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members
|
||||||
"#define GL_ARB_post_depth_coverage 1\n"
|
"#define GL_ARB_post_depth_coverage 1\n"
|
||||||
|
"#define GL_ARB_fragment_shader_interlock 1\n"
|
||||||
|
"#define GL_ARB_uniform_buffer_object 1\n"
|
||||||
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
|
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
|
||||||
"#define GL_EXT_shader_image_load_formatted 1\n"
|
"#define GL_EXT_shader_image_load_formatted 1\n"
|
||||||
"#define GL_EXT_post_depth_coverage 1\n"
|
"#define GL_EXT_post_depth_coverage 1\n"
|
||||||
@ -391,6 +416,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_EXT_fragment_invocation_density 1\n"
|
"#define GL_EXT_fragment_invocation_density 1\n"
|
||||||
"#define GL_EXT_buffer_reference 1\n"
|
"#define GL_EXT_buffer_reference 1\n"
|
||||||
"#define GL_EXT_buffer_reference2 1\n"
|
"#define GL_EXT_buffer_reference2 1\n"
|
||||||
|
"#define GL_EXT_buffer_reference_uvec2 1\n"
|
||||||
|
"#define GL_EXT_demote_to_helper_invocation 1\n"
|
||||||
|
|
||||||
// GL_KHR_shader_subgroup
|
// GL_KHR_shader_subgroup
|
||||||
"#define GL_KHR_shader_subgroup_basic 1\n"
|
"#define GL_KHR_shader_subgroup_basic 1\n"
|
||||||
@ -403,8 +430,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_KHR_shader_subgroup_quad 1\n"
|
"#define GL_KHR_shader_subgroup_quad 1\n"
|
||||||
|
|
||||||
"#define E_GL_EXT_shader_atomic_int64 1\n"
|
"#define E_GL_EXT_shader_atomic_int64 1\n"
|
||||||
|
"#define E_GL_EXT_shader_realtime_clock 1\n"
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
"#define GL_AMD_shader_ballot 1\n"
|
"#define GL_AMD_shader_ballot 1\n"
|
||||||
"#define GL_AMD_shader_trinary_minmax 1\n"
|
"#define GL_AMD_shader_trinary_minmax 1\n"
|
||||||
"#define GL_AMD_shader_explicit_vertex_parameter 1\n"
|
"#define GL_AMD_shader_explicit_vertex_parameter 1\n"
|
||||||
@ -415,9 +442,9 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_AMD_shader_image_load_store_lod 1\n"
|
"#define GL_AMD_shader_image_load_store_lod 1\n"
|
||||||
"#define GL_AMD_shader_fragment_mask 1\n"
|
"#define GL_AMD_shader_fragment_mask 1\n"
|
||||||
"#define GL_AMD_gpu_shader_half_float_fetch 1\n"
|
"#define GL_AMD_gpu_shader_half_float_fetch 1\n"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
"#define GL_INTEL_shader_integer_functions2 1\n"
|
||||||
|
|
||||||
"#define GL_NV_sample_mask_override_coverage 1\n"
|
"#define GL_NV_sample_mask_override_coverage 1\n"
|
||||||
"#define GL_NV_geometry_shader_passthrough 1\n"
|
"#define GL_NV_geometry_shader_passthrough 1\n"
|
||||||
"#define GL_NV_viewport_array2 1\n"
|
"#define GL_NV_viewport_array2 1\n"
|
||||||
@ -430,8 +457,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_NV_compute_shader_derivatives 1\n"
|
"#define GL_NV_compute_shader_derivatives 1\n"
|
||||||
"#define GL_NV_shader_texture_footprint 1\n"
|
"#define GL_NV_shader_texture_footprint 1\n"
|
||||||
"#define GL_NV_mesh_shader 1\n"
|
"#define GL_NV_mesh_shader 1\n"
|
||||||
#endif
|
|
||||||
"#define GL_NV_cooperative_matrix 1\n"
|
"#define GL_NV_cooperative_matrix 1\n"
|
||||||
|
"#define GL_NV_integer_cooperative_matrix 1\n"
|
||||||
|
|
||||||
"#define GL_EXT_shader_explicit_arithmetic_types 1\n"
|
"#define GL_EXT_shader_explicit_arithmetic_types 1\n"
|
||||||
"#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n"
|
"#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n"
|
||||||
@ -441,6 +468,11 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_EXT_shader_explicit_arithmetic_types_float16 1\n"
|
"#define GL_EXT_shader_explicit_arithmetic_types_float16 1\n"
|
||||||
"#define GL_EXT_shader_explicit_arithmetic_types_float32 1\n"
|
"#define GL_EXT_shader_explicit_arithmetic_types_float32 1\n"
|
||||||
"#define GL_EXT_shader_explicit_arithmetic_types_float64 1\n"
|
"#define GL_EXT_shader_explicit_arithmetic_types_float64 1\n"
|
||||||
|
|
||||||
|
"#define GL_EXT_shader_subgroup_extended_types_int8 1\n"
|
||||||
|
"#define GL_EXT_shader_subgroup_extended_types_int16 1\n"
|
||||||
|
"#define GL_EXT_shader_subgroup_extended_types_int64 1\n"
|
||||||
|
"#define GL_EXT_shader_subgroup_extended_types_float16 1\n"
|
||||||
;
|
;
|
||||||
|
|
||||||
if (version >= 150) {
|
if (version >= 150) {
|
||||||
@ -450,13 +482,16 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
if (profile == ECompatibilityProfile)
|
if (profile == ECompatibilityProfile)
|
||||||
preamble += "#define GL_compatibility_profile 1\n";
|
preamble += "#define GL_compatibility_profile 1\n";
|
||||||
}
|
}
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((profile != EEsProfile && version >= 140) ||
|
#ifndef GLSLANG_WEB
|
||||||
(profile == EEsProfile && version >= 310)) {
|
if ((!isEsProfile() && version >= 140) ||
|
||||||
|
(isEsProfile() && version >= 310)) {
|
||||||
preamble +=
|
preamble +=
|
||||||
"#define GL_EXT_device_group 1\n"
|
"#define GL_EXT_device_group 1\n"
|
||||||
"#define GL_EXT_multiview 1\n"
|
"#define GL_EXT_multiview 1\n"
|
||||||
|
"#define GL_NV_shader_sm_builtins 1\n"
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,7 +506,9 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
preamble +=
|
preamble +=
|
||||||
"#define GL_GOOGLE_cpp_style_line_directive 1\n"
|
"#define GL_GOOGLE_cpp_style_line_directive 1\n"
|
||||||
"#define GL_GOOGLE_include_directive 1\n"
|
"#define GL_GOOGLE_include_directive 1\n"
|
||||||
|
"#define GL_KHR_blend_equation_advanced 1\n"
|
||||||
;
|
;
|
||||||
|
#endif
|
||||||
|
|
||||||
// #define VULKAN XXXX
|
// #define VULKAN XXXX
|
||||||
const int numberBufSize = 12;
|
const int numberBufSize = 12;
|
||||||
@ -482,6 +519,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
preamble += numberBuf;
|
preamble += numberBuf;
|
||||||
preamble += "\n";
|
preamble += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// #define GL_SPIRV XXXX
|
// #define GL_SPIRV XXXX
|
||||||
if (spvVersion.openGl > 0) {
|
if (spvVersion.openGl > 0) {
|
||||||
preamble += "#define GL_SPIRV ";
|
preamble += "#define GL_SPIRV ";
|
||||||
@ -489,22 +528,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
preamble += numberBuf;
|
preamble += numberBuf;
|
||||||
preamble += "\n";
|
preamble += "\n";
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// When to use requireProfile():
|
|
||||||
//
|
|
||||||
// Use if only some profiles support a feature. However, if within a profile the feature
|
|
||||||
// is version or extension specific, follow this call with calls to profileRequires().
|
|
||||||
//
|
|
||||||
// Operation: If the current profile is not one of the profileMask,
|
|
||||||
// give an error message.
|
|
||||||
//
|
|
||||||
void TParseVersions::requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc)
|
|
||||||
{
|
|
||||||
if (! (profile & profileMask))
|
|
||||||
error(loc, "not supported with this profile:", featureDesc, ProfileName(profile));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -514,12 +538,12 @@ const char* StageName(EShLanguage stage)
|
|||||||
{
|
{
|
||||||
switch(stage) {
|
switch(stage) {
|
||||||
case EShLangVertex: return "vertex";
|
case EShLangVertex: return "vertex";
|
||||||
|
case EShLangFragment: return "fragment";
|
||||||
|
case EShLangCompute: return "compute";
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case EShLangTessControl: return "tessellation control";
|
case EShLangTessControl: return "tessellation control";
|
||||||
case EShLangTessEvaluation: return "tessellation evaluation";
|
case EShLangTessEvaluation: return "tessellation evaluation";
|
||||||
case EShLangGeometry: return "geometry";
|
case EShLangGeometry: return "geometry";
|
||||||
case EShLangFragment: return "fragment";
|
|
||||||
case EShLangCompute: return "compute";
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EShLangRayGenNV: return "ray-generation";
|
case EShLangRayGenNV: return "ray-generation";
|
||||||
case EShLangIntersectNV: return "intersection";
|
case EShLangIntersectNV: return "intersection";
|
||||||
case EShLangAnyHitNV: return "any-hit";
|
case EShLangAnyHitNV: return "any-hit";
|
||||||
@ -533,53 +557,6 @@ const char* StageName(EShLanguage stage)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// When to use profileRequires():
|
|
||||||
//
|
|
||||||
// If a set of profiles have the same requirements for what version or extensions
|
|
||||||
// are needed to support a feature.
|
|
||||||
//
|
|
||||||
// It must be called for each profile that needs protection. Use requireProfile() first
|
|
||||||
// to reduce that set of profiles.
|
|
||||||
//
|
|
||||||
// Operation: Will issue warnings/errors based on the current profile, version, and extension
|
|
||||||
// behaviors. It only checks extensions when the current profile is one of the profileMask.
|
|
||||||
//
|
|
||||||
// A minVersion of 0 means no version of the profileMask support this in core,
|
|
||||||
// the extension must be present.
|
|
||||||
//
|
|
||||||
|
|
||||||
// entry point that takes multiple extensions
|
|
||||||
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions, const char* const extensions[], const char* featureDesc)
|
|
||||||
{
|
|
||||||
if (profile & profileMask) {
|
|
||||||
bool okay = false;
|
|
||||||
if (minVersion > 0 && version >= minVersion)
|
|
||||||
okay = true;
|
|
||||||
for (int i = 0; i < numExtensions; ++i) {
|
|
||||||
switch (getExtensionBehavior(extensions[i])) {
|
|
||||||
case EBhWarn:
|
|
||||||
infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc);
|
|
||||||
// fall through
|
|
||||||
case EBhRequire:
|
|
||||||
case EBhEnable:
|
|
||||||
okay = true;
|
|
||||||
break;
|
|
||||||
default: break; // some compilers want this
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! okay)
|
|
||||||
error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// entry point for the above that takes a single extension
|
|
||||||
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension, const char* featureDesc)
|
|
||||||
{
|
|
||||||
profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// When to use requireStage()
|
// When to use requireStage()
|
||||||
//
|
//
|
||||||
@ -600,6 +577,75 @@ void TParseVersions::requireStage(const TSourceLoc& loc, EShLanguage stage, cons
|
|||||||
requireStage(loc, static_cast<EShLanguageMask>(1 << stage), featureDesc);
|
requireStage(loc, static_cast<EShLanguageMask>(1 << stage), featureDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
//
|
||||||
|
// When to use requireProfile():
|
||||||
|
//
|
||||||
|
// Use if only some profiles support a feature. However, if within a profile the feature
|
||||||
|
// is version or extension specific, follow this call with calls to profileRequires().
|
||||||
|
//
|
||||||
|
// Operation: If the current profile is not one of the profileMask,
|
||||||
|
// give an error message.
|
||||||
|
//
|
||||||
|
void TParseVersions::requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc)
|
||||||
|
{
|
||||||
|
if (! (profile & profileMask))
|
||||||
|
error(loc, "not supported with this profile:", featureDesc, ProfileName(profile));
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// When to use profileRequires():
|
||||||
|
//
|
||||||
|
// If a set of profiles have the same requirements for what version or extensions
|
||||||
|
// are needed to support a feature.
|
||||||
|
//
|
||||||
|
// It must be called for each profile that needs protection. Use requireProfile() first
|
||||||
|
// to reduce that set of profiles.
|
||||||
|
//
|
||||||
|
// Operation: Will issue warnings/errors based on the current profile, version, and extension
|
||||||
|
// behaviors. It only checks extensions when the current profile is one of the profileMask.
|
||||||
|
//
|
||||||
|
// A minVersion of 0 means no version of the profileMask support this in core,
|
||||||
|
// the extension must be present.
|
||||||
|
//
|
||||||
|
|
||||||
|
// entry point that takes multiple extensions
|
||||||
|
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions,
|
||||||
|
const char* const extensions[], const char* featureDesc)
|
||||||
|
{
|
||||||
|
if (profile & profileMask) {
|
||||||
|
bool okay = minVersion > 0 && version >= minVersion;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
for (int i = 0; i < numExtensions; ++i) {
|
||||||
|
switch (getExtensionBehavior(extensions[i])) {
|
||||||
|
case EBhWarn:
|
||||||
|
infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc);
|
||||||
|
// fall through
|
||||||
|
case EBhRequire:
|
||||||
|
case EBhEnable:
|
||||||
|
okay = true;
|
||||||
|
break;
|
||||||
|
default: break; // some compilers want this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (! okay)
|
||||||
|
error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// entry point for the above that takes a single extension
|
||||||
|
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension,
|
||||||
|
const char* featureDesc)
|
||||||
|
{
|
||||||
|
profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TParseVersions::unimplemented(const TSourceLoc& loc, const char* featureDesc)
|
||||||
|
{
|
||||||
|
error(loc, "feature not yet implemented", featureDesc, "");
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Within a set of profiles, see if a feature is deprecated and give an error or warning based on whether
|
// Within a set of profiles, see if a feature is deprecated and give an error or warning based on whether
|
||||||
// a future compatibility context is being use.
|
// a future compatibility context is being use.
|
||||||
@ -633,11 +679,6 @@ void TParseVersions::requireNotRemoved(const TSourceLoc& loc, int profileMask, i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TParseVersions::unimplemented(const TSourceLoc& loc, const char* featureDesc)
|
|
||||||
{
|
|
||||||
error(loc, "feature not yet implemented", featureDesc, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns true if at least one of the extensions in the extensions parameter is requested. Otherwise, returns false.
|
// Returns true if at least one of the extensions in the extensions parameter is requested. Otherwise, returns false.
|
||||||
// Warns appropriately if the requested behavior of an extension is "warn".
|
// Warns appropriately if the requested behavior of an extension is "warn".
|
||||||
bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc)
|
bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc)
|
||||||
@ -806,12 +847,22 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co
|
|||||||
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
||||||
else if (strcmp(extension, "GL_KHR_shader_subgroup_quad") == 0)
|
else if (strcmp(extension, "GL_KHR_shader_subgroup_quad") == 0)
|
||||||
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
else if (strcmp(extension, "GL_NV_shader_subgroup_partitioned") == 0)
|
else if (strcmp(extension, "GL_NV_shader_subgroup_partitioned") == 0)
|
||||||
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
||||||
#endif
|
else if (strcmp(extension, "GL_EXT_buffer_reference2") == 0 ||
|
||||||
else if (strcmp(extension, "GL_EXT_buffer_reference2") == 0)
|
strcmp(extension, "GL_EXT_buffer_reference_uvec2") == 0)
|
||||||
updateExtensionBehavior(line, "GL_EXT_buffer_reference", behaviorString);
|
updateExtensionBehavior(line, "GL_EXT_buffer_reference", behaviorString);
|
||||||
|
else if (strcmp(extension, "GL_NV_integer_cooperative_matrix") == 0)
|
||||||
|
updateExtensionBehavior(line, "GL_NV_cooperative_matrix", behaviorString);
|
||||||
|
// subgroup extended types to explicit types
|
||||||
|
else if (strcmp(extension, "GL_EXT_shader_subgroup_extended_types_int8") == 0)
|
||||||
|
updateExtensionBehavior(line, "GL_EXT_shader_explicit_arithmetic_types_int8", behaviorString);
|
||||||
|
else if (strcmp(extension, "GL_EXT_shader_subgroup_extended_types_int16") == 0)
|
||||||
|
updateExtensionBehavior(line, "GL_EXT_shader_explicit_arithmetic_types_int16", behaviorString);
|
||||||
|
else if (strcmp(extension, "GL_EXT_shader_subgroup_extended_types_int64") == 0)
|
||||||
|
updateExtensionBehavior(line, "GL_EXT_shader_explicit_arithmetic_types_int64", behaviorString);
|
||||||
|
else if (strcmp(extension, "GL_EXT_shader_subgroup_extended_types_float16") == 0)
|
||||||
|
updateExtensionBehavior(line, "GL_EXT_shader_explicit_arithmetic_types_float16", behaviorString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior)
|
void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior)
|
||||||
@ -857,7 +908,6 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe
|
|||||||
// Check if extension is used with correct shader stage.
|
// Check if extension is used with correct shader stage.
|
||||||
void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * const extension)
|
void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * const extension)
|
||||||
{
|
{
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
// GL_NV_mesh_shader extension is only allowed in task/mesh shaders
|
// GL_NV_mesh_shader extension is only allowed in task/mesh shaders
|
||||||
if (strcmp(extension, "GL_NV_mesh_shader") == 0) {
|
if (strcmp(extension, "GL_NV_mesh_shader") == 0) {
|
||||||
requireStage(loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask | EShLangFragmentMask),
|
requireStage(loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask | EShLangFragmentMask),
|
||||||
@ -865,7 +915,6 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con
|
|||||||
profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_NV_mesh_shader");
|
profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_NV_mesh_shader");
|
||||||
profileRequires(loc, EEsProfile, 320, 0, "#extension GL_NV_mesh_shader");
|
profileRequires(loc, EEsProfile, 320, 0, "#extension GL_NV_mesh_shader");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call for any operation needing full GLSL integer data-type support.
|
// Call for any operation needing full GLSL integer data-type support.
|
||||||
@ -878,8 +927,8 @@ void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op)
|
|||||||
// Call for any operation needing GLSL double data-type support.
|
// Call for any operation needing GLSL double data-type support.
|
||||||
void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op)
|
void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op)
|
||||||
{
|
{
|
||||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
//requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op);
|
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader_fp64, op);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call for any operation needing GLSL float16 data-type support.
|
// Call for any operation needing GLSL float16 data-type support.
|
||||||
@ -887,9 +936,7 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu
|
|||||||
{
|
{
|
||||||
if (!builtIn) {
|
if (!builtIn) {
|
||||||
const char* const extensions[] = {
|
const char* const extensions[] = {
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_half_float,
|
E_GL_AMD_gpu_shader_half_float,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||||
@ -899,9 +946,7 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu
|
|||||||
bool TParseVersions::float16Arithmetic()
|
bool TParseVersions::float16Arithmetic()
|
||||||
{
|
{
|
||||||
const char* const extensions[] = {
|
const char* const extensions[] = {
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_half_float,
|
E_GL_AMD_gpu_shader_half_float,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||||
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
||||||
@ -910,9 +955,7 @@ bool TParseVersions::float16Arithmetic()
|
|||||||
bool TParseVersions::int16Arithmetic()
|
bool TParseVersions::int16Arithmetic()
|
||||||
{
|
{
|
||||||
const char* const extensions[] = {
|
const char* const extensions[] = {
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_int16,
|
E_GL_AMD_gpu_shader_int16,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||||
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
||||||
@ -934,9 +977,7 @@ void TParseVersions::requireFloat16Arithmetic(const TSourceLoc& loc, const char*
|
|||||||
combined += featureDesc;
|
combined += featureDesc;
|
||||||
|
|
||||||
const char* const extensions[] = {
|
const char* const extensions[] = {
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_half_float,
|
E_GL_AMD_gpu_shader_half_float,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
||||||
@ -950,9 +991,7 @@ void TParseVersions::requireInt16Arithmetic(const TSourceLoc& loc, const char* o
|
|||||||
combined += featureDesc;
|
combined += featureDesc;
|
||||||
|
|
||||||
const char* const extensions[] = {
|
const char* const extensions[] = {
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_int16,
|
E_GL_AMD_gpu_shader_int16,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
||||||
@ -975,9 +1014,7 @@ void TParseVersions::float16ScalarVectorCheck(const TSourceLoc& loc, const char*
|
|||||||
{
|
{
|
||||||
if (!builtIn) {
|
if (!builtIn) {
|
||||||
const char* const extensions[] = {
|
const char* const extensions[] = {
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_half_float,
|
E_GL_AMD_gpu_shader_half_float,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_16bit_storage,
|
E_GL_EXT_shader_16bit_storage,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||||
@ -1017,7 +1054,6 @@ void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
// Call for any operation needing GLSL float16 opaque-type support
|
// Call for any operation needing GLSL float16 opaque-type support
|
||||||
void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||||
{
|
{
|
||||||
@ -1027,16 +1063,13 @@ void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, b
|
|||||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op);
|
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Call for any operation needing GLSL explicit int16 data-type support.
|
// Call for any operation needing GLSL explicit int16 data-type support.
|
||||||
void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, bool builtIn)
|
void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||||
{
|
{
|
||||||
if (! builtIn) {
|
if (! builtIn) {
|
||||||
const char* const extensions[] = {
|
const char* const extensions[] = {
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_int16,
|
E_GL_AMD_gpu_shader_int16,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||||
@ -1047,9 +1080,7 @@ void TParseVersions::int16ScalarVectorCheck(const TSourceLoc& loc, const char* o
|
|||||||
{
|
{
|
||||||
if (! builtIn) {
|
if (! builtIn) {
|
||||||
const char* const extensions[] = {
|
const char* const extensions[] = {
|
||||||
#if AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_int16,
|
E_GL_AMD_gpu_shader_int16,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_16bit_storage,
|
E_GL_EXT_shader_16bit_storage,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||||
@ -1099,6 +1130,14 @@ void TParseVersions::fcoopmatCheck(const TSourceLoc& loc, const char* op, bool b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TParseVersions::intcoopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||||
|
{
|
||||||
|
if (!builtIn) {
|
||||||
|
const char* const extensions[] = {E_GL_NV_integer_cooperative_matrix};
|
||||||
|
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
// Call for any operation removed because SPIR-V is in use.
|
// Call for any operation removed because SPIR-V is in use.
|
||||||
void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
|
void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
|
||||||
{
|
{
|
||||||
@ -1116,15 +1155,19 @@ void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op)
|
|||||||
// Call for any operation that requires Vulkan.
|
// Call for any operation that requires Vulkan.
|
||||||
void TParseVersions::requireVulkan(const TSourceLoc& loc, const char* op)
|
void TParseVersions::requireVulkan(const TSourceLoc& loc, const char* op)
|
||||||
{
|
{
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (spvVersion.vulkan == 0)
|
if (spvVersion.vulkan == 0)
|
||||||
error(loc, "only allowed when using GLSL for Vulkan", op, "");
|
error(loc, "only allowed when using GLSL for Vulkan", op, "");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call for any operation that requires SPIR-V.
|
// Call for any operation that requires SPIR-V.
|
||||||
void TParseVersions::requireSpv(const TSourceLoc& loc, const char* op)
|
void TParseVersions::requireSpv(const TSourceLoc& loc, const char* op)
|
||||||
{
|
{
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (spvVersion.spv == 0)
|
if (spvVersion.spv == 0)
|
||||||
error(loc, "only allowed when generating SPIR-V", op, "");
|
error(loc, "only allowed when generating SPIR-V", op, "");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
@ -124,8 +124,10 @@ const char* const E_GL_ARB_compute_shader = "GL_ARB_compute_shader
|
|||||||
const char* const E_GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader";
|
const char* const E_GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader";
|
||||||
const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts";
|
const char* const E_GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts";
|
||||||
const char* const E_GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array";
|
const char* const E_GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array";
|
||||||
|
const char* const E_GL_ARB_texture_multisample = "GL_ARB_texture_multisample";
|
||||||
const char* const E_GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod";
|
const char* const E_GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod";
|
||||||
const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location";
|
const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location";
|
||||||
|
const char* const E_GL_ARB_explicit_uniform_location = "GL_ARB_explicit_uniform_location";
|
||||||
const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store";
|
const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store";
|
||||||
const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters";
|
const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters";
|
||||||
const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters";
|
const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters";
|
||||||
@ -134,6 +136,7 @@ const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_con
|
|||||||
const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples";
|
const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples";
|
||||||
const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array";
|
const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array";
|
||||||
const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int64";
|
const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int64";
|
||||||
|
const char* const E_GL_ARB_gpu_shader_fp64 = "GL_ARB_gpu_shader_fp64";
|
||||||
const char* const E_GL_ARB_shader_ballot = "GL_ARB_shader_ballot";
|
const char* const E_GL_ARB_shader_ballot = "GL_ARB_shader_ballot";
|
||||||
const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2";
|
const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2";
|
||||||
const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp";
|
const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp";
|
||||||
@ -141,6 +144,10 @@ const char* const E_GL_ARB_shader_stencil_export = "GL_ARB_shader_stencil
|
|||||||
// const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members
|
// const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members
|
||||||
const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage";
|
const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage";
|
||||||
const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array";
|
const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array";
|
||||||
|
const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shader_interlock";
|
||||||
|
const char* const E_GL_ARB_shader_clock = "GL_ARB_shader_clock";
|
||||||
|
const char* const E_GL_ARB_uniform_buffer_object = "GL_ARB_uniform_buffer_object";
|
||||||
|
const char* const E_GL_ARB_sample_shading = "GL_ARB_sample_shading";
|
||||||
|
|
||||||
const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic";
|
const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic";
|
||||||
const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote";
|
const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote";
|
||||||
@ -172,6 +179,9 @@ const char* const E_GL_EXT_scalar_block_layout = "GL_EXT_scalar_blo
|
|||||||
const char* const E_GL_EXT_fragment_invocation_density = "GL_EXT_fragment_invocation_density";
|
const char* const E_GL_EXT_fragment_invocation_density = "GL_EXT_fragment_invocation_density";
|
||||||
const char* const E_GL_EXT_buffer_reference = "GL_EXT_buffer_reference";
|
const char* const E_GL_EXT_buffer_reference = "GL_EXT_buffer_reference";
|
||||||
const char* const E_GL_EXT_buffer_reference2 = "GL_EXT_buffer_reference2";
|
const char* const E_GL_EXT_buffer_reference2 = "GL_EXT_buffer_reference2";
|
||||||
|
const char* const E_GL_EXT_buffer_reference_uvec2 = "GL_EXT_buffer_reference_uvec2";
|
||||||
|
const char* const E_GL_EXT_demote_to_helper_invocation = "GL_EXT_demote_to_helper_invocation";
|
||||||
|
const char* const E_GL_EXT_shader_realtime_clock = "GL_EXT_shader_realtime_clock";
|
||||||
|
|
||||||
// Arrays of extensions for the above viewportEXTs duplications
|
// Arrays of extensions for the above viewportEXTs duplications
|
||||||
|
|
||||||
@ -189,7 +199,6 @@ const int Num_OVR_multiview_EXTs = sizeof(OVR_multiview_EXTs) / sizeof(OVR_multi
|
|||||||
const char* const E_GL_GOOGLE_cpp_style_line_directive = "GL_GOOGLE_cpp_style_line_directive";
|
const char* const E_GL_GOOGLE_cpp_style_line_directive = "GL_GOOGLE_cpp_style_line_directive";
|
||||||
const char* const E_GL_GOOGLE_include_directive = "GL_GOOGLE_include_directive";
|
const char* const E_GL_GOOGLE_include_directive = "GL_GOOGLE_include_directive";
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
const char* const E_GL_AMD_shader_ballot = "GL_AMD_shader_ballot";
|
const char* const E_GL_AMD_shader_ballot = "GL_AMD_shader_ballot";
|
||||||
const char* const E_GL_AMD_shader_trinary_minmax = "GL_AMD_shader_trinary_minmax";
|
const char* const E_GL_AMD_shader_trinary_minmax = "GL_AMD_shader_trinary_minmax";
|
||||||
const char* const E_GL_AMD_shader_explicit_vertex_parameter = "GL_AMD_shader_explicit_vertex_parameter";
|
const char* const E_GL_AMD_shader_explicit_vertex_parameter = "GL_AMD_shader_explicit_vertex_parameter";
|
||||||
@ -200,9 +209,8 @@ const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_sh
|
|||||||
const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod";
|
const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod";
|
||||||
const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask";
|
const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask";
|
||||||
const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch";
|
const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch";
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
const char* const E_GL_INTEL_shader_integer_functions2 = "GL_INTEL_shader_integer_functions2";
|
||||||
|
|
||||||
const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage";
|
const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage";
|
||||||
const char* const E_SPV_NV_geometry_shader_passthrough = "GL_NV_geometry_shader_passthrough";
|
const char* const E_SPV_NV_geometry_shader_passthrough = "GL_NV_geometry_shader_passthrough";
|
||||||
@ -224,9 +232,10 @@ const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_sh
|
|||||||
|
|
||||||
const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 };
|
const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 };
|
||||||
const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]);
|
const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]);
|
||||||
#endif
|
|
||||||
|
|
||||||
const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix";
|
const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix";
|
||||||
|
const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins";
|
||||||
|
const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix";
|
||||||
|
|
||||||
// AEP
|
// AEP
|
||||||
const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a";
|
const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a";
|
||||||
@ -256,7 +265,7 @@ const char* const E_GL_OES_tessellation_point_size = "GL_OES_tessel
|
|||||||
const char* const E_GL_OES_texture_buffer = "GL_OES_texture_buffer";
|
const char* const E_GL_OES_texture_buffer = "GL_OES_texture_buffer";
|
||||||
const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array";
|
const char* const E_GL_OES_texture_cube_map_array = "GL_OES_texture_cube_map_array";
|
||||||
|
|
||||||
// KHX
|
// EXT
|
||||||
const char* const E_GL_EXT_shader_explicit_arithmetic_types = "GL_EXT_shader_explicit_arithmetic_types";
|
const char* const E_GL_EXT_shader_explicit_arithmetic_types = "GL_EXT_shader_explicit_arithmetic_types";
|
||||||
const char* const E_GL_EXT_shader_explicit_arithmetic_types_int8 = "GL_EXT_shader_explicit_arithmetic_types_int8";
|
const char* const E_GL_EXT_shader_explicit_arithmetic_types_int8 = "GL_EXT_shader_explicit_arithmetic_types_int8";
|
||||||
const char* const E_GL_EXT_shader_explicit_arithmetic_types_int16 = "GL_EXT_shader_explicit_arithmetic_types_int16";
|
const char* const E_GL_EXT_shader_explicit_arithmetic_types_int16 = "GL_EXT_shader_explicit_arithmetic_types_int16";
|
||||||
@ -266,6 +275,11 @@ const char* const E_GL_EXT_shader_explicit_arithmetic_types_float16 = "GL_EXT_s
|
|||||||
const char* const E_GL_EXT_shader_explicit_arithmetic_types_float32 = "GL_EXT_shader_explicit_arithmetic_types_float32";
|
const char* const E_GL_EXT_shader_explicit_arithmetic_types_float32 = "GL_EXT_shader_explicit_arithmetic_types_float32";
|
||||||
const char* const E_GL_EXT_shader_explicit_arithmetic_types_float64 = "GL_EXT_shader_explicit_arithmetic_types_float64";
|
const char* const E_GL_EXT_shader_explicit_arithmetic_types_float64 = "GL_EXT_shader_explicit_arithmetic_types_float64";
|
||||||
|
|
||||||
|
const char* const E_GL_EXT_shader_subgroup_extended_types_int8 = "GL_EXT_shader_subgroup_extended_types_int8";
|
||||||
|
const char* const E_GL_EXT_shader_subgroup_extended_types_int16 = "GL_EXT_shader_subgroup_extended_types_int16";
|
||||||
|
const char* const E_GL_EXT_shader_subgroup_extended_types_int64 = "GL_EXT_shader_subgroup_extended_types_int64";
|
||||||
|
const char* const E_GL_EXT_shader_subgroup_extended_types_float16 = "GL_EXT_shader_subgroup_extended_types_float16";
|
||||||
|
|
||||||
// Arrays of extensions for the above AEP duplications
|
// Arrays of extensions for the above AEP duplications
|
||||||
|
|
||||||
const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader };
|
const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader };
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
// POSSIBILITY OF SUCH DAMAGE.
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
#include "attribute.h"
|
#include "attribute.h"
|
||||||
#include "../Include/intermediate.h"
|
#include "../Include/intermediate.h"
|
||||||
#include "ParseHelper.h"
|
#include "ParseHelper.h"
|
||||||
@ -339,5 +341,6 @@ void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
|
@ -76,7 +76,49 @@ namespace glslang {
|
|||||||
EatMaxIterations,
|
EatMaxIterations,
|
||||||
EatIterationMultiple,
|
EatIterationMultiple,
|
||||||
EatPeelCount,
|
EatPeelCount,
|
||||||
EatPartialCount
|
EatPartialCount,
|
||||||
|
EatFormatRgba32f,
|
||||||
|
EatFormatRgba16f,
|
||||||
|
EatFormatR32f,
|
||||||
|
EatFormatRgba8,
|
||||||
|
EatFormatRgba8Snorm,
|
||||||
|
EatFormatRg32f,
|
||||||
|
EatFormatRg16f,
|
||||||
|
EatFormatR11fG11fB10f,
|
||||||
|
EatFormatR16f,
|
||||||
|
EatFormatRgba16,
|
||||||
|
EatFormatRgb10A2,
|
||||||
|
EatFormatRg16,
|
||||||
|
EatFormatRg8,
|
||||||
|
EatFormatR16,
|
||||||
|
EatFormatR8,
|
||||||
|
EatFormatRgba16Snorm,
|
||||||
|
EatFormatRg16Snorm,
|
||||||
|
EatFormatRg8Snorm,
|
||||||
|
EatFormatR16Snorm,
|
||||||
|
EatFormatR8Snorm,
|
||||||
|
EatFormatRgba32i,
|
||||||
|
EatFormatRgba16i,
|
||||||
|
EatFormatRgba8i,
|
||||||
|
EatFormatR32i,
|
||||||
|
EatFormatRg32i,
|
||||||
|
EatFormatRg16i,
|
||||||
|
EatFormatRg8i,
|
||||||
|
EatFormatR16i,
|
||||||
|
EatFormatR8i,
|
||||||
|
EatFormatRgba32ui,
|
||||||
|
EatFormatRgba16ui,
|
||||||
|
EatFormatRgba8ui,
|
||||||
|
EatFormatR32ui,
|
||||||
|
EatFormatRgb10a2ui,
|
||||||
|
EatFormatRg32ui,
|
||||||
|
EatFormatRg16ui,
|
||||||
|
EatFormatRg8ui,
|
||||||
|
EatFormatR16ui,
|
||||||
|
EatFormatR8ui,
|
||||||
|
EatFormatUnknown,
|
||||||
|
EatNonWritable,
|
||||||
|
EatNonReadable
|
||||||
};
|
};
|
||||||
|
|
||||||
class TIntermAggregate;
|
class TIntermAggregate;
|
||||||
|
@ -78,7 +78,6 @@
|
|||||||
#define GL_DOUBLE_MAT4x2 0x8F4D
|
#define GL_DOUBLE_MAT4x2 0x8F4D
|
||||||
#define GL_DOUBLE_MAT4x3 0x8F4E
|
#define GL_DOUBLE_MAT4x3 0x8F4E
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
// Those constants are borrowed from extension NV_gpu_shader5
|
// Those constants are borrowed from extension NV_gpu_shader5
|
||||||
#define GL_FLOAT16_NV 0x8FF8
|
#define GL_FLOAT16_NV 0x8FF8
|
||||||
#define GL_FLOAT16_VEC2_NV 0x8FF9
|
#define GL_FLOAT16_VEC2_NV 0x8FF9
|
||||||
@ -94,7 +93,6 @@
|
|||||||
#define GL_FLOAT16_MAT3x4_AMD 0x91CB
|
#define GL_FLOAT16_MAT3x4_AMD 0x91CB
|
||||||
#define GL_FLOAT16_MAT4x2_AMD 0x91CC
|
#define GL_FLOAT16_MAT4x2_AMD 0x91CC
|
||||||
#define GL_FLOAT16_MAT4x3_AMD 0x91CD
|
#define GL_FLOAT16_MAT4x3_AMD 0x91CD
|
||||||
#endif
|
|
||||||
|
|
||||||
#define GL_SAMPLER_1D 0x8B5D
|
#define GL_SAMPLER_1D 0x8B5D
|
||||||
#define GL_SAMPLER_2D 0x8B5E
|
#define GL_SAMPLER_2D 0x8B5E
|
||||||
@ -117,7 +115,6 @@
|
|||||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
|
#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
|
||||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
|
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
#define GL_FLOAT16_SAMPLER_1D_AMD 0x91CE
|
#define GL_FLOAT16_SAMPLER_1D_AMD 0x91CE
|
||||||
#define GL_FLOAT16_SAMPLER_2D_AMD 0x91CF
|
#define GL_FLOAT16_SAMPLER_2D_AMD 0x91CF
|
||||||
#define GL_FLOAT16_SAMPLER_3D_AMD 0x91D0
|
#define GL_FLOAT16_SAMPLER_3D_AMD 0x91D0
|
||||||
@ -149,7 +146,6 @@
|
|||||||
#define GL_FLOAT16_IMAGE_BUFFER_AMD 0x91E8
|
#define GL_FLOAT16_IMAGE_BUFFER_AMD 0x91E8
|
||||||
#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD 0x91E9
|
#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD 0x91E9
|
||||||
#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD 0x91EA
|
#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD 0x91EA
|
||||||
#endif
|
|
||||||
|
|
||||||
#define GL_INT_SAMPLER_1D 0x8DC9
|
#define GL_INT_SAMPLER_1D 0x8DC9
|
||||||
#define GL_INT_SAMPLER_2D 0x8DCA
|
#define GL_INT_SAMPLER_2D 0x8DCA
|
||||||
|
1005
thirdparty/glslang/glslang/MachineIndependent/glslang.y
vendored
1005
thirdparty/glslang/glslang/MachineIndependent/glslang.y
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -45,271 +45,271 @@ extern int yydebug;
|
|||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
enum yytokentype
|
enum yytokentype
|
||||||
{
|
{
|
||||||
ATTRIBUTE = 258,
|
CONST = 258,
|
||||||
VARYING = 259,
|
BOOL = 259,
|
||||||
FLOAT16_T = 260,
|
INT = 260,
|
||||||
FLOAT = 261,
|
UINT = 261,
|
||||||
FLOAT32_T = 262,
|
FLOAT = 262,
|
||||||
DOUBLE = 263,
|
BVEC2 = 263,
|
||||||
FLOAT64_T = 264,
|
BVEC3 = 264,
|
||||||
CONST = 265,
|
BVEC4 = 265,
|
||||||
BOOL = 266,
|
IVEC2 = 266,
|
||||||
INT = 267,
|
IVEC3 = 267,
|
||||||
UINT = 268,
|
IVEC4 = 268,
|
||||||
INT64_T = 269,
|
UVEC2 = 269,
|
||||||
UINT64_T = 270,
|
UVEC3 = 270,
|
||||||
INT32_T = 271,
|
UVEC4 = 271,
|
||||||
UINT32_T = 272,
|
VEC2 = 272,
|
||||||
INT16_T = 273,
|
VEC3 = 273,
|
||||||
UINT16_T = 274,
|
VEC4 = 274,
|
||||||
INT8_T = 275,
|
MAT2 = 275,
|
||||||
UINT8_T = 276,
|
MAT3 = 276,
|
||||||
BREAK = 277,
|
MAT4 = 277,
|
||||||
CONTINUE = 278,
|
MAT2X2 = 278,
|
||||||
DO = 279,
|
MAT2X3 = 279,
|
||||||
ELSE = 280,
|
MAT2X4 = 280,
|
||||||
FOR = 281,
|
MAT3X2 = 281,
|
||||||
IF = 282,
|
MAT3X3 = 282,
|
||||||
DISCARD = 283,
|
MAT3X4 = 283,
|
||||||
RETURN = 284,
|
MAT4X2 = 284,
|
||||||
SWITCH = 285,
|
MAT4X3 = 285,
|
||||||
CASE = 286,
|
MAT4X4 = 286,
|
||||||
DEFAULT = 287,
|
SAMPLER2D = 287,
|
||||||
SUBROUTINE = 288,
|
SAMPLER3D = 288,
|
||||||
BVEC2 = 289,
|
SAMPLERCUBE = 289,
|
||||||
BVEC3 = 290,
|
SAMPLER2DSHADOW = 290,
|
||||||
BVEC4 = 291,
|
SAMPLERCUBESHADOW = 291,
|
||||||
IVEC2 = 292,
|
SAMPLER2DARRAY = 292,
|
||||||
IVEC3 = 293,
|
SAMPLER2DARRAYSHADOW = 293,
|
||||||
IVEC4 = 294,
|
ISAMPLER2D = 294,
|
||||||
UVEC2 = 295,
|
ISAMPLER3D = 295,
|
||||||
UVEC3 = 296,
|
ISAMPLERCUBE = 296,
|
||||||
UVEC4 = 297,
|
ISAMPLER2DARRAY = 297,
|
||||||
I64VEC2 = 298,
|
USAMPLER2D = 298,
|
||||||
I64VEC3 = 299,
|
USAMPLER3D = 299,
|
||||||
I64VEC4 = 300,
|
USAMPLERCUBE = 300,
|
||||||
U64VEC2 = 301,
|
USAMPLER2DARRAY = 301,
|
||||||
U64VEC3 = 302,
|
SAMPLER = 302,
|
||||||
U64VEC4 = 303,
|
SAMPLERSHADOW = 303,
|
||||||
I32VEC2 = 304,
|
TEXTURE2D = 304,
|
||||||
I32VEC3 = 305,
|
TEXTURE3D = 305,
|
||||||
I32VEC4 = 306,
|
TEXTURECUBE = 306,
|
||||||
U32VEC2 = 307,
|
TEXTURE2DARRAY = 307,
|
||||||
U32VEC3 = 308,
|
ITEXTURE2D = 308,
|
||||||
U32VEC4 = 309,
|
ITEXTURE3D = 309,
|
||||||
I16VEC2 = 310,
|
ITEXTURECUBE = 310,
|
||||||
I16VEC3 = 311,
|
ITEXTURE2DARRAY = 311,
|
||||||
I16VEC4 = 312,
|
UTEXTURE2D = 312,
|
||||||
U16VEC2 = 313,
|
UTEXTURE3D = 313,
|
||||||
U16VEC3 = 314,
|
UTEXTURECUBE = 314,
|
||||||
U16VEC4 = 315,
|
UTEXTURE2DARRAY = 315,
|
||||||
I8VEC2 = 316,
|
ATTRIBUTE = 316,
|
||||||
I8VEC3 = 317,
|
VARYING = 317,
|
||||||
I8VEC4 = 318,
|
FLOAT16_T = 318,
|
||||||
U8VEC2 = 319,
|
FLOAT32_T = 319,
|
||||||
U8VEC3 = 320,
|
DOUBLE = 320,
|
||||||
U8VEC4 = 321,
|
FLOAT64_T = 321,
|
||||||
VEC2 = 322,
|
INT64_T = 322,
|
||||||
VEC3 = 323,
|
UINT64_T = 323,
|
||||||
VEC4 = 324,
|
INT32_T = 324,
|
||||||
MAT2 = 325,
|
UINT32_T = 325,
|
||||||
MAT3 = 326,
|
INT16_T = 326,
|
||||||
MAT4 = 327,
|
UINT16_T = 327,
|
||||||
CENTROID = 328,
|
INT8_T = 328,
|
||||||
IN = 329,
|
UINT8_T = 329,
|
||||||
OUT = 330,
|
I64VEC2 = 330,
|
||||||
INOUT = 331,
|
I64VEC3 = 331,
|
||||||
UNIFORM = 332,
|
I64VEC4 = 332,
|
||||||
PATCH = 333,
|
U64VEC2 = 333,
|
||||||
SAMPLE = 334,
|
U64VEC3 = 334,
|
||||||
BUFFER = 335,
|
U64VEC4 = 335,
|
||||||
SHARED = 336,
|
I32VEC2 = 336,
|
||||||
NONUNIFORM = 337,
|
I32VEC3 = 337,
|
||||||
PAYLOADNV = 338,
|
I32VEC4 = 338,
|
||||||
PAYLOADINNV = 339,
|
U32VEC2 = 339,
|
||||||
HITATTRNV = 340,
|
U32VEC3 = 340,
|
||||||
CALLDATANV = 341,
|
U32VEC4 = 341,
|
||||||
CALLDATAINNV = 342,
|
I16VEC2 = 342,
|
||||||
COHERENT = 343,
|
I16VEC3 = 343,
|
||||||
VOLATILE = 344,
|
I16VEC4 = 344,
|
||||||
RESTRICT = 345,
|
U16VEC2 = 345,
|
||||||
READONLY = 346,
|
U16VEC3 = 346,
|
||||||
WRITEONLY = 347,
|
U16VEC4 = 347,
|
||||||
DEVICECOHERENT = 348,
|
I8VEC2 = 348,
|
||||||
QUEUEFAMILYCOHERENT = 349,
|
I8VEC3 = 349,
|
||||||
WORKGROUPCOHERENT = 350,
|
I8VEC4 = 350,
|
||||||
SUBGROUPCOHERENT = 351,
|
U8VEC2 = 351,
|
||||||
NONPRIVATE = 352,
|
U8VEC3 = 352,
|
||||||
DVEC2 = 353,
|
U8VEC4 = 353,
|
||||||
DVEC3 = 354,
|
DVEC2 = 354,
|
||||||
DVEC4 = 355,
|
DVEC3 = 355,
|
||||||
DMAT2 = 356,
|
DVEC4 = 356,
|
||||||
DMAT3 = 357,
|
DMAT2 = 357,
|
||||||
DMAT4 = 358,
|
DMAT3 = 358,
|
||||||
F16VEC2 = 359,
|
DMAT4 = 359,
|
||||||
F16VEC3 = 360,
|
F16VEC2 = 360,
|
||||||
F16VEC4 = 361,
|
F16VEC3 = 361,
|
||||||
F16MAT2 = 362,
|
F16VEC4 = 362,
|
||||||
F16MAT3 = 363,
|
F16MAT2 = 363,
|
||||||
F16MAT4 = 364,
|
F16MAT3 = 364,
|
||||||
F32VEC2 = 365,
|
F16MAT4 = 365,
|
||||||
F32VEC3 = 366,
|
F32VEC2 = 366,
|
||||||
F32VEC4 = 367,
|
F32VEC3 = 367,
|
||||||
F32MAT2 = 368,
|
F32VEC4 = 368,
|
||||||
F32MAT3 = 369,
|
F32MAT2 = 369,
|
||||||
F32MAT4 = 370,
|
F32MAT3 = 370,
|
||||||
F64VEC2 = 371,
|
F32MAT4 = 371,
|
||||||
F64VEC3 = 372,
|
F64VEC2 = 372,
|
||||||
F64VEC4 = 373,
|
F64VEC3 = 373,
|
||||||
F64MAT2 = 374,
|
F64VEC4 = 374,
|
||||||
F64MAT3 = 375,
|
F64MAT2 = 375,
|
||||||
F64MAT4 = 376,
|
F64MAT3 = 376,
|
||||||
NOPERSPECTIVE = 377,
|
F64MAT4 = 377,
|
||||||
FLAT = 378,
|
DMAT2X2 = 378,
|
||||||
SMOOTH = 379,
|
DMAT2X3 = 379,
|
||||||
LAYOUT = 380,
|
DMAT2X4 = 380,
|
||||||
EXPLICITINTERPAMD = 381,
|
DMAT3X2 = 381,
|
||||||
PERVERTEXNV = 382,
|
DMAT3X3 = 382,
|
||||||
PERPRIMITIVENV = 383,
|
DMAT3X4 = 383,
|
||||||
PERVIEWNV = 384,
|
DMAT4X2 = 384,
|
||||||
PERTASKNV = 385,
|
DMAT4X3 = 385,
|
||||||
MAT2X2 = 386,
|
DMAT4X4 = 386,
|
||||||
MAT2X3 = 387,
|
F16MAT2X2 = 387,
|
||||||
MAT2X4 = 388,
|
F16MAT2X3 = 388,
|
||||||
MAT3X2 = 389,
|
F16MAT2X4 = 389,
|
||||||
MAT3X3 = 390,
|
F16MAT3X2 = 390,
|
||||||
MAT3X4 = 391,
|
F16MAT3X3 = 391,
|
||||||
MAT4X2 = 392,
|
F16MAT3X4 = 392,
|
||||||
MAT4X3 = 393,
|
F16MAT4X2 = 393,
|
||||||
MAT4X4 = 394,
|
F16MAT4X3 = 394,
|
||||||
DMAT2X2 = 395,
|
F16MAT4X4 = 395,
|
||||||
DMAT2X3 = 396,
|
F32MAT2X2 = 396,
|
||||||
DMAT2X4 = 397,
|
F32MAT2X3 = 397,
|
||||||
DMAT3X2 = 398,
|
F32MAT2X4 = 398,
|
||||||
DMAT3X3 = 399,
|
F32MAT3X2 = 399,
|
||||||
DMAT3X4 = 400,
|
F32MAT3X3 = 400,
|
||||||
DMAT4X2 = 401,
|
F32MAT3X4 = 401,
|
||||||
DMAT4X3 = 402,
|
F32MAT4X2 = 402,
|
||||||
DMAT4X4 = 403,
|
F32MAT4X3 = 403,
|
||||||
F16MAT2X2 = 404,
|
F32MAT4X4 = 404,
|
||||||
F16MAT2X3 = 405,
|
F64MAT2X2 = 405,
|
||||||
F16MAT2X4 = 406,
|
F64MAT2X3 = 406,
|
||||||
F16MAT3X2 = 407,
|
F64MAT2X4 = 407,
|
||||||
F16MAT3X3 = 408,
|
F64MAT3X2 = 408,
|
||||||
F16MAT3X4 = 409,
|
F64MAT3X3 = 409,
|
||||||
F16MAT4X2 = 410,
|
F64MAT3X4 = 410,
|
||||||
F16MAT4X3 = 411,
|
F64MAT4X2 = 411,
|
||||||
F16MAT4X4 = 412,
|
F64MAT4X3 = 412,
|
||||||
F32MAT2X2 = 413,
|
F64MAT4X4 = 413,
|
||||||
F32MAT2X3 = 414,
|
ATOMIC_UINT = 414,
|
||||||
F32MAT2X4 = 415,
|
ACCSTRUCTNV = 415,
|
||||||
F32MAT3X2 = 416,
|
FCOOPMATNV = 416,
|
||||||
F32MAT3X3 = 417,
|
ICOOPMATNV = 417,
|
||||||
F32MAT3X4 = 418,
|
UCOOPMATNV = 418,
|
||||||
F32MAT4X2 = 419,
|
SAMPLERCUBEARRAY = 419,
|
||||||
F32MAT4X3 = 420,
|
SAMPLERCUBEARRAYSHADOW = 420,
|
||||||
F32MAT4X4 = 421,
|
ISAMPLERCUBEARRAY = 421,
|
||||||
F64MAT2X2 = 422,
|
USAMPLERCUBEARRAY = 422,
|
||||||
F64MAT2X3 = 423,
|
SAMPLER1D = 423,
|
||||||
F64MAT2X4 = 424,
|
SAMPLER1DARRAY = 424,
|
||||||
F64MAT3X2 = 425,
|
SAMPLER1DARRAYSHADOW = 425,
|
||||||
F64MAT3X3 = 426,
|
ISAMPLER1D = 426,
|
||||||
F64MAT3X4 = 427,
|
SAMPLER1DSHADOW = 427,
|
||||||
F64MAT4X2 = 428,
|
SAMPLER2DRECT = 428,
|
||||||
F64MAT4X3 = 429,
|
SAMPLER2DRECTSHADOW = 429,
|
||||||
F64MAT4X4 = 430,
|
ISAMPLER2DRECT = 430,
|
||||||
ATOMIC_UINT = 431,
|
USAMPLER2DRECT = 431,
|
||||||
ACCSTRUCTNV = 432,
|
SAMPLERBUFFER = 432,
|
||||||
FCOOPMATNV = 433,
|
ISAMPLERBUFFER = 433,
|
||||||
SAMPLER1D = 434,
|
USAMPLERBUFFER = 434,
|
||||||
SAMPLER2D = 435,
|
SAMPLER2DMS = 435,
|
||||||
SAMPLER3D = 436,
|
ISAMPLER2DMS = 436,
|
||||||
SAMPLERCUBE = 437,
|
USAMPLER2DMS = 437,
|
||||||
SAMPLER1DSHADOW = 438,
|
SAMPLER2DMSARRAY = 438,
|
||||||
SAMPLER2DSHADOW = 439,
|
ISAMPLER2DMSARRAY = 439,
|
||||||
SAMPLERCUBESHADOW = 440,
|
USAMPLER2DMSARRAY = 440,
|
||||||
SAMPLER1DARRAY = 441,
|
SAMPLEREXTERNALOES = 441,
|
||||||
SAMPLER2DARRAY = 442,
|
SAMPLEREXTERNAL2DY2YEXT = 442,
|
||||||
SAMPLER1DARRAYSHADOW = 443,
|
ISAMPLER1DARRAY = 443,
|
||||||
SAMPLER2DARRAYSHADOW = 444,
|
USAMPLER1D = 444,
|
||||||
ISAMPLER1D = 445,
|
USAMPLER1DARRAY = 445,
|
||||||
ISAMPLER2D = 446,
|
F16SAMPLER1D = 446,
|
||||||
ISAMPLER3D = 447,
|
F16SAMPLER2D = 447,
|
||||||
ISAMPLERCUBE = 448,
|
F16SAMPLER3D = 448,
|
||||||
ISAMPLER1DARRAY = 449,
|
F16SAMPLER2DRECT = 449,
|
||||||
ISAMPLER2DARRAY = 450,
|
F16SAMPLERCUBE = 450,
|
||||||
USAMPLER1D = 451,
|
F16SAMPLER1DARRAY = 451,
|
||||||
USAMPLER2D = 452,
|
F16SAMPLER2DARRAY = 452,
|
||||||
USAMPLER3D = 453,
|
F16SAMPLERCUBEARRAY = 453,
|
||||||
USAMPLERCUBE = 454,
|
F16SAMPLERBUFFER = 454,
|
||||||
USAMPLER1DARRAY = 455,
|
F16SAMPLER2DMS = 455,
|
||||||
USAMPLER2DARRAY = 456,
|
F16SAMPLER2DMSARRAY = 456,
|
||||||
SAMPLER2DRECT = 457,
|
F16SAMPLER1DSHADOW = 457,
|
||||||
SAMPLER2DRECTSHADOW = 458,
|
F16SAMPLER2DSHADOW = 458,
|
||||||
ISAMPLER2DRECT = 459,
|
F16SAMPLER1DARRAYSHADOW = 459,
|
||||||
USAMPLER2DRECT = 460,
|
F16SAMPLER2DARRAYSHADOW = 460,
|
||||||
SAMPLERBUFFER = 461,
|
F16SAMPLER2DRECTSHADOW = 461,
|
||||||
ISAMPLERBUFFER = 462,
|
F16SAMPLERCUBESHADOW = 462,
|
||||||
USAMPLERBUFFER = 463,
|
F16SAMPLERCUBEARRAYSHADOW = 463,
|
||||||
SAMPLERCUBEARRAY = 464,
|
IMAGE1D = 464,
|
||||||
SAMPLERCUBEARRAYSHADOW = 465,
|
IIMAGE1D = 465,
|
||||||
ISAMPLERCUBEARRAY = 466,
|
UIMAGE1D = 466,
|
||||||
USAMPLERCUBEARRAY = 467,
|
IMAGE2D = 467,
|
||||||
SAMPLER2DMS = 468,
|
IIMAGE2D = 468,
|
||||||
ISAMPLER2DMS = 469,
|
UIMAGE2D = 469,
|
||||||
USAMPLER2DMS = 470,
|
IMAGE3D = 470,
|
||||||
SAMPLER2DMSARRAY = 471,
|
IIMAGE3D = 471,
|
||||||
ISAMPLER2DMSARRAY = 472,
|
UIMAGE3D = 472,
|
||||||
USAMPLER2DMSARRAY = 473,
|
IMAGE2DRECT = 473,
|
||||||
SAMPLEREXTERNALOES = 474,
|
IIMAGE2DRECT = 474,
|
||||||
SAMPLEREXTERNAL2DY2YEXT = 475,
|
UIMAGE2DRECT = 475,
|
||||||
F16SAMPLER1D = 476,
|
IMAGECUBE = 476,
|
||||||
F16SAMPLER2D = 477,
|
IIMAGECUBE = 477,
|
||||||
F16SAMPLER3D = 478,
|
UIMAGECUBE = 478,
|
||||||
F16SAMPLER2DRECT = 479,
|
IMAGEBUFFER = 479,
|
||||||
F16SAMPLERCUBE = 480,
|
IIMAGEBUFFER = 480,
|
||||||
F16SAMPLER1DARRAY = 481,
|
UIMAGEBUFFER = 481,
|
||||||
F16SAMPLER2DARRAY = 482,
|
IMAGE1DARRAY = 482,
|
||||||
F16SAMPLERCUBEARRAY = 483,
|
IIMAGE1DARRAY = 483,
|
||||||
F16SAMPLERBUFFER = 484,
|
UIMAGE1DARRAY = 484,
|
||||||
F16SAMPLER2DMS = 485,
|
IMAGE2DARRAY = 485,
|
||||||
F16SAMPLER2DMSARRAY = 486,
|
IIMAGE2DARRAY = 486,
|
||||||
F16SAMPLER1DSHADOW = 487,
|
UIMAGE2DARRAY = 487,
|
||||||
F16SAMPLER2DSHADOW = 488,
|
IMAGECUBEARRAY = 488,
|
||||||
F16SAMPLER1DARRAYSHADOW = 489,
|
IIMAGECUBEARRAY = 489,
|
||||||
F16SAMPLER2DARRAYSHADOW = 490,
|
UIMAGECUBEARRAY = 490,
|
||||||
F16SAMPLER2DRECTSHADOW = 491,
|
IMAGE2DMS = 491,
|
||||||
F16SAMPLERCUBESHADOW = 492,
|
IIMAGE2DMS = 492,
|
||||||
F16SAMPLERCUBEARRAYSHADOW = 493,
|
UIMAGE2DMS = 493,
|
||||||
SAMPLER = 494,
|
IMAGE2DMSARRAY = 494,
|
||||||
SAMPLERSHADOW = 495,
|
IIMAGE2DMSARRAY = 495,
|
||||||
TEXTURE1D = 496,
|
UIMAGE2DMSARRAY = 496,
|
||||||
TEXTURE2D = 497,
|
F16IMAGE1D = 497,
|
||||||
TEXTURE3D = 498,
|
F16IMAGE2D = 498,
|
||||||
TEXTURECUBE = 499,
|
F16IMAGE3D = 499,
|
||||||
TEXTURE1DARRAY = 500,
|
F16IMAGE2DRECT = 500,
|
||||||
TEXTURE2DARRAY = 501,
|
F16IMAGECUBE = 501,
|
||||||
ITEXTURE1D = 502,
|
F16IMAGE1DARRAY = 502,
|
||||||
ITEXTURE2D = 503,
|
F16IMAGE2DARRAY = 503,
|
||||||
ITEXTURE3D = 504,
|
F16IMAGECUBEARRAY = 504,
|
||||||
ITEXTURECUBE = 505,
|
F16IMAGEBUFFER = 505,
|
||||||
ITEXTURE1DARRAY = 506,
|
F16IMAGE2DMS = 506,
|
||||||
ITEXTURE2DARRAY = 507,
|
F16IMAGE2DMSARRAY = 507,
|
||||||
UTEXTURE1D = 508,
|
TEXTURECUBEARRAY = 508,
|
||||||
UTEXTURE2D = 509,
|
ITEXTURECUBEARRAY = 509,
|
||||||
UTEXTURE3D = 510,
|
UTEXTURECUBEARRAY = 510,
|
||||||
UTEXTURECUBE = 511,
|
TEXTURE1D = 511,
|
||||||
UTEXTURE1DARRAY = 512,
|
ITEXTURE1D = 512,
|
||||||
UTEXTURE2DARRAY = 513,
|
UTEXTURE1D = 513,
|
||||||
TEXTURE2DRECT = 514,
|
TEXTURE1DARRAY = 514,
|
||||||
ITEXTURE2DRECT = 515,
|
ITEXTURE1DARRAY = 515,
|
||||||
UTEXTURE2DRECT = 516,
|
UTEXTURE1DARRAY = 516,
|
||||||
TEXTUREBUFFER = 517,
|
TEXTURE2DRECT = 517,
|
||||||
ITEXTUREBUFFER = 518,
|
ITEXTURE2DRECT = 518,
|
||||||
UTEXTUREBUFFER = 519,
|
UTEXTURE2DRECT = 519,
|
||||||
TEXTURECUBEARRAY = 520,
|
TEXTUREBUFFER = 520,
|
||||||
ITEXTURECUBEARRAY = 521,
|
ITEXTUREBUFFER = 521,
|
||||||
UTEXTURECUBEARRAY = 522,
|
UTEXTUREBUFFER = 522,
|
||||||
TEXTURE2DMS = 523,
|
TEXTURE2DMS = 523,
|
||||||
ITEXTURE2DMS = 524,
|
ITEXTURE2DMS = 524,
|
||||||
UTEXTURE2DMS = 525,
|
UTEXTURE2DMS = 525,
|
||||||
@ -335,121 +335,124 @@ extern int yydebug;
|
|||||||
USUBPASSINPUTMS = 545,
|
USUBPASSINPUTMS = 545,
|
||||||
F16SUBPASSINPUT = 546,
|
F16SUBPASSINPUT = 546,
|
||||||
F16SUBPASSINPUTMS = 547,
|
F16SUBPASSINPUTMS = 547,
|
||||||
IMAGE1D = 548,
|
LEFT_OP = 548,
|
||||||
IIMAGE1D = 549,
|
RIGHT_OP = 549,
|
||||||
UIMAGE1D = 550,
|
INC_OP = 550,
|
||||||
IMAGE2D = 551,
|
DEC_OP = 551,
|
||||||
IIMAGE2D = 552,
|
LE_OP = 552,
|
||||||
UIMAGE2D = 553,
|
GE_OP = 553,
|
||||||
IMAGE3D = 554,
|
EQ_OP = 554,
|
||||||
IIMAGE3D = 555,
|
NE_OP = 555,
|
||||||
UIMAGE3D = 556,
|
AND_OP = 556,
|
||||||
IMAGE2DRECT = 557,
|
OR_OP = 557,
|
||||||
IIMAGE2DRECT = 558,
|
XOR_OP = 558,
|
||||||
UIMAGE2DRECT = 559,
|
MUL_ASSIGN = 559,
|
||||||
IMAGECUBE = 560,
|
DIV_ASSIGN = 560,
|
||||||
IIMAGECUBE = 561,
|
ADD_ASSIGN = 561,
|
||||||
UIMAGECUBE = 562,
|
MOD_ASSIGN = 562,
|
||||||
IMAGEBUFFER = 563,
|
LEFT_ASSIGN = 563,
|
||||||
IIMAGEBUFFER = 564,
|
RIGHT_ASSIGN = 564,
|
||||||
UIMAGEBUFFER = 565,
|
AND_ASSIGN = 565,
|
||||||
IMAGE1DARRAY = 566,
|
XOR_ASSIGN = 566,
|
||||||
IIMAGE1DARRAY = 567,
|
OR_ASSIGN = 567,
|
||||||
UIMAGE1DARRAY = 568,
|
SUB_ASSIGN = 568,
|
||||||
IMAGE2DARRAY = 569,
|
LEFT_PAREN = 569,
|
||||||
IIMAGE2DARRAY = 570,
|
RIGHT_PAREN = 570,
|
||||||
UIMAGE2DARRAY = 571,
|
LEFT_BRACKET = 571,
|
||||||
IMAGECUBEARRAY = 572,
|
RIGHT_BRACKET = 572,
|
||||||
IIMAGECUBEARRAY = 573,
|
LEFT_BRACE = 573,
|
||||||
UIMAGECUBEARRAY = 574,
|
RIGHT_BRACE = 574,
|
||||||
IMAGE2DMS = 575,
|
DOT = 575,
|
||||||
IIMAGE2DMS = 576,
|
COMMA = 576,
|
||||||
UIMAGE2DMS = 577,
|
COLON = 577,
|
||||||
IMAGE2DMSARRAY = 578,
|
EQUAL = 578,
|
||||||
IIMAGE2DMSARRAY = 579,
|
SEMICOLON = 579,
|
||||||
UIMAGE2DMSARRAY = 580,
|
BANG = 580,
|
||||||
F16IMAGE1D = 581,
|
DASH = 581,
|
||||||
F16IMAGE2D = 582,
|
TILDE = 582,
|
||||||
F16IMAGE3D = 583,
|
PLUS = 583,
|
||||||
F16IMAGE2DRECT = 584,
|
STAR = 584,
|
||||||
F16IMAGECUBE = 585,
|
SLASH = 585,
|
||||||
F16IMAGE1DARRAY = 586,
|
PERCENT = 586,
|
||||||
F16IMAGE2DARRAY = 587,
|
LEFT_ANGLE = 587,
|
||||||
F16IMAGECUBEARRAY = 588,
|
RIGHT_ANGLE = 588,
|
||||||
F16IMAGEBUFFER = 589,
|
VERTICAL_BAR = 589,
|
||||||
F16IMAGE2DMS = 590,
|
CARET = 590,
|
||||||
F16IMAGE2DMSARRAY = 591,
|
AMPERSAND = 591,
|
||||||
STRUCT = 592,
|
QUESTION = 592,
|
||||||
VOID = 593,
|
INVARIANT = 593,
|
||||||
WHILE = 594,
|
HIGH_PRECISION = 594,
|
||||||
IDENTIFIER = 595,
|
MEDIUM_PRECISION = 595,
|
||||||
TYPE_NAME = 596,
|
LOW_PRECISION = 596,
|
||||||
FLOATCONSTANT = 597,
|
PRECISION = 597,
|
||||||
DOUBLECONSTANT = 598,
|
PACKED = 598,
|
||||||
INT16CONSTANT = 599,
|
RESOURCE = 599,
|
||||||
UINT16CONSTANT = 600,
|
SUPERP = 600,
|
||||||
INT32CONSTANT = 601,
|
FLOATCONSTANT = 601,
|
||||||
UINT32CONSTANT = 602,
|
INTCONSTANT = 602,
|
||||||
INTCONSTANT = 603,
|
UINTCONSTANT = 603,
|
||||||
UINTCONSTANT = 604,
|
BOOLCONSTANT = 604,
|
||||||
INT64CONSTANT = 605,
|
IDENTIFIER = 605,
|
||||||
UINT64CONSTANT = 606,
|
TYPE_NAME = 606,
|
||||||
BOOLCONSTANT = 607,
|
CENTROID = 607,
|
||||||
FLOAT16CONSTANT = 608,
|
IN = 608,
|
||||||
LEFT_OP = 609,
|
OUT = 609,
|
||||||
RIGHT_OP = 610,
|
INOUT = 610,
|
||||||
INC_OP = 611,
|
STRUCT = 611,
|
||||||
DEC_OP = 612,
|
VOID = 612,
|
||||||
LE_OP = 613,
|
WHILE = 613,
|
||||||
GE_OP = 614,
|
BREAK = 614,
|
||||||
EQ_OP = 615,
|
CONTINUE = 615,
|
||||||
NE_OP = 616,
|
DO = 616,
|
||||||
AND_OP = 617,
|
ELSE = 617,
|
||||||
OR_OP = 618,
|
FOR = 618,
|
||||||
XOR_OP = 619,
|
IF = 619,
|
||||||
MUL_ASSIGN = 620,
|
DISCARD = 620,
|
||||||
DIV_ASSIGN = 621,
|
RETURN = 621,
|
||||||
ADD_ASSIGN = 622,
|
SWITCH = 622,
|
||||||
MOD_ASSIGN = 623,
|
CASE = 623,
|
||||||
LEFT_ASSIGN = 624,
|
DEFAULT = 624,
|
||||||
RIGHT_ASSIGN = 625,
|
UNIFORM = 625,
|
||||||
AND_ASSIGN = 626,
|
SHARED = 626,
|
||||||
XOR_ASSIGN = 627,
|
BUFFER = 627,
|
||||||
OR_ASSIGN = 628,
|
FLAT = 628,
|
||||||
SUB_ASSIGN = 629,
|
SMOOTH = 629,
|
||||||
LEFT_PAREN = 630,
|
LAYOUT = 630,
|
||||||
RIGHT_PAREN = 631,
|
DOUBLECONSTANT = 631,
|
||||||
LEFT_BRACKET = 632,
|
INT16CONSTANT = 632,
|
||||||
RIGHT_BRACKET = 633,
|
UINT16CONSTANT = 633,
|
||||||
LEFT_BRACE = 634,
|
FLOAT16CONSTANT = 634,
|
||||||
RIGHT_BRACE = 635,
|
INT32CONSTANT = 635,
|
||||||
DOT = 636,
|
UINT32CONSTANT = 636,
|
||||||
COMMA = 637,
|
INT64CONSTANT = 637,
|
||||||
COLON = 638,
|
UINT64CONSTANT = 638,
|
||||||
EQUAL = 639,
|
SUBROUTINE = 639,
|
||||||
SEMICOLON = 640,
|
DEMOTE = 640,
|
||||||
BANG = 641,
|
PAYLOADNV = 641,
|
||||||
DASH = 642,
|
PAYLOADINNV = 642,
|
||||||
TILDE = 643,
|
HITATTRNV = 643,
|
||||||
PLUS = 644,
|
CALLDATANV = 644,
|
||||||
STAR = 645,
|
CALLDATAINNV = 645,
|
||||||
SLASH = 646,
|
PATCH = 646,
|
||||||
PERCENT = 647,
|
SAMPLE = 647,
|
||||||
LEFT_ANGLE = 648,
|
NONUNIFORM = 648,
|
||||||
RIGHT_ANGLE = 649,
|
COHERENT = 649,
|
||||||
VERTICAL_BAR = 650,
|
VOLATILE = 650,
|
||||||
CARET = 651,
|
RESTRICT = 651,
|
||||||
AMPERSAND = 652,
|
READONLY = 652,
|
||||||
QUESTION = 653,
|
WRITEONLY = 653,
|
||||||
INVARIANT = 654,
|
DEVICECOHERENT = 654,
|
||||||
PRECISE = 655,
|
QUEUEFAMILYCOHERENT = 655,
|
||||||
HIGH_PRECISION = 656,
|
WORKGROUPCOHERENT = 656,
|
||||||
MEDIUM_PRECISION = 657,
|
SUBGROUPCOHERENT = 657,
|
||||||
LOW_PRECISION = 658,
|
NONPRIVATE = 658,
|
||||||
PRECISION = 659,
|
NOPERSPECTIVE = 659,
|
||||||
PACKED = 660,
|
EXPLICITINTERPAMD = 660,
|
||||||
RESOURCE = 661,
|
PERVERTEXNV = 661,
|
||||||
SUPERP = 662
|
PERPRIMITIVENV = 662,
|
||||||
|
PERVIEWNV = 663,
|
||||||
|
PERTASKNV = 664,
|
||||||
|
PRECISE = 665
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -458,7 +461,7 @@ extern int yydebug;
|
|||||||
|
|
||||||
union YYSTYPE
|
union YYSTYPE
|
||||||
{
|
{
|
||||||
#line 71 "MachineIndependent/glslang.y" /* yacc.c:1909 */
|
#line 96 "MachineIndependent/glslang.y" /* yacc.c:1909 */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
glslang::TSourceLoc loc;
|
glslang::TSourceLoc loc;
|
||||||
@ -494,7 +497,7 @@ union YYSTYPE
|
|||||||
glslang::TArraySizes* typeParameters;
|
glslang::TArraySizes* typeParameters;
|
||||||
} interm;
|
} interm;
|
||||||
|
|
||||||
#line 498 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
|
#line 501 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef union YYSTYPE YYSTYPE;
|
typedef union YYSTYPE YYSTYPE;
|
||||||
|
@ -35,6 +35,8 @@
|
|||||||
// POSSIBILITY OF SUCH DAMAGE.
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
#include "localintermediate.h"
|
#include "localintermediate.h"
|
||||||
#include "../Include/InfoSink.h"
|
#include "../Include/InfoSink.h"
|
||||||
|
|
||||||
@ -174,7 +176,7 @@ bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node)
|
|||||||
case EOpIndexIndirect: out.debug << "indirect index"; break;
|
case EOpIndexIndirect: out.debug << "indirect index"; break;
|
||||||
case EOpIndexDirectStruct:
|
case EOpIndexDirectStruct:
|
||||||
{
|
{
|
||||||
bool reference = node->getLeft()->getType().getBasicType() == EbtReference;
|
bool reference = node->getLeft()->getType().isReference();
|
||||||
const TTypeList *members = reference ? node->getLeft()->getType().getReferentType()->getStruct() : node->getLeft()->getType().getStruct();
|
const TTypeList *members = reference ? node->getLeft()->getType().getReferentType()->getStruct() : node->getLeft()->getType().getStruct();
|
||||||
out.debug << (*members)[node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()].type->getFieldName();
|
out.debug << (*members)[node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()].type->getFieldName();
|
||||||
out.debug << ": direct index for structure"; break;
|
out.debug << ": direct index for structure"; break;
|
||||||
@ -211,6 +213,13 @@ bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node)
|
|||||||
case EOpLogicalXor: out.debug << "logical-xor"; break;
|
case EOpLogicalXor: out.debug << "logical-xor"; break;
|
||||||
case EOpLogicalAnd: out.debug << "logical-and"; break;
|
case EOpLogicalAnd: out.debug << "logical-and"; break;
|
||||||
|
|
||||||
|
case EOpAbsDifference: out.debug << "absoluteDifference"; break;
|
||||||
|
case EOpAddSaturate: out.debug << "addSaturate"; break;
|
||||||
|
case EOpSubSaturate: out.debug << "subtractSaturate"; break;
|
||||||
|
case EOpAverage: out.debug << "average"; break;
|
||||||
|
case EOpAverageRounded: out.debug << "averageRounded"; break;
|
||||||
|
case EOpMul32x16: out.debug << "multiply32x16"; break;
|
||||||
|
|
||||||
default: out.debug << "<unknown op>";
|
default: out.debug << "<unknown op>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -555,6 +564,9 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpFindLSB: out.debug << "findLSB"; break;
|
case EOpFindLSB: out.debug << "findLSB"; break;
|
||||||
case EOpFindMSB: out.debug << "findMSB"; break;
|
case EOpFindMSB: out.debug << "findMSB"; break;
|
||||||
|
|
||||||
|
case EOpCountLeadingZeros: out.debug << "countLeadingZeros"; break;
|
||||||
|
case EOpCountTrailingZeros: out.debug << "countTrailingZeros"; break;
|
||||||
|
|
||||||
case EOpNoise: out.debug << "noise"; break;
|
case EOpNoise: out.debug << "noise"; break;
|
||||||
|
|
||||||
case EOpBallot: out.debug << "ballot"; break;
|
case EOpBallot: out.debug << "ballot"; break;
|
||||||
@ -615,7 +627,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break;
|
case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break;
|
||||||
case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break;
|
case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break;
|
case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break;
|
||||||
case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break;
|
case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break;
|
||||||
case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break;
|
case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break;
|
||||||
@ -638,7 +649,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break;
|
case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break;
|
||||||
case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break;
|
case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break;
|
||||||
case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break;
|
case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case EOpClip: out.debug << "clip"; break;
|
case EOpClip: out.debug << "clip"; break;
|
||||||
case EOpIsFinite: out.debug << "isfinite"; break;
|
case EOpIsFinite: out.debug << "isfinite"; break;
|
||||||
@ -648,7 +658,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
|
|
||||||
case EOpSparseTexelsResident: out.debug << "sparseTexelsResident"; break;
|
case EOpSparseTexelsResident: out.debug << "sparseTexelsResident"; break;
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EOpMinInvocations: out.debug << "minInvocations"; break;
|
case EOpMinInvocations: out.debug << "minInvocations"; break;
|
||||||
case EOpMaxInvocations: out.debug << "maxInvocations"; break;
|
case EOpMaxInvocations: out.debug << "maxInvocations"; break;
|
||||||
case EOpAddInvocations: out.debug << "addInvocations"; break;
|
case EOpAddInvocations: out.debug << "addInvocations"; break;
|
||||||
@ -677,7 +686,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
|
|
||||||
case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break;
|
case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break;
|
||||||
case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break;
|
case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
|
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
|
||||||
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
||||||
@ -863,7 +871,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
|
|
||||||
case EOpReadInvocation: out.debug << "readInvocation"; break;
|
case EOpReadInvocation: out.debug << "readInvocation"; break;
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EOpSwizzleInvocations: out.debug << "swizzleInvocations"; break;
|
case EOpSwizzleInvocations: out.debug << "swizzleInvocations"; break;
|
||||||
case EOpSwizzleInvocationsMasked: out.debug << "swizzleInvocationsMasked"; break;
|
case EOpSwizzleInvocationsMasked: out.debug << "swizzleInvocationsMasked"; break;
|
||||||
case EOpWriteInvocation: out.debug << "writeInvocation"; break;
|
case EOpWriteInvocation: out.debug << "writeInvocation"; break;
|
||||||
@ -871,9 +878,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
case EOpMin3: out.debug << "min3"; break;
|
case EOpMin3: out.debug << "min3"; break;
|
||||||
case EOpMax3: out.debug << "max3"; break;
|
case EOpMax3: out.debug << "max3"; break;
|
||||||
case EOpMid3: out.debug << "mid3"; break;
|
case EOpMid3: out.debug << "mid3"; break;
|
||||||
|
|
||||||
case EOpTime: out.debug << "time"; break;
|
case EOpTime: out.debug << "time"; break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case EOpAtomicAdd: out.debug << "AtomicAdd"; break;
|
case EOpAtomicAdd: out.debug << "AtomicAdd"; break;
|
||||||
case EOpAtomicMin: out.debug << "AtomicMin"; break;
|
case EOpAtomicMin: out.debug << "AtomicMin"; break;
|
||||||
@ -910,10 +915,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
case EOpImageAtomicCompSwap: out.debug << "imageAtomicCompSwap"; break;
|
case EOpImageAtomicCompSwap: out.debug << "imageAtomicCompSwap"; break;
|
||||||
case EOpImageAtomicLoad: out.debug << "imageAtomicLoad"; break;
|
case EOpImageAtomicLoad: out.debug << "imageAtomicLoad"; break;
|
||||||
case EOpImageAtomicStore: out.debug << "imageAtomicStore"; break;
|
case EOpImageAtomicStore: out.debug << "imageAtomicStore"; break;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EOpImageLoadLod: out.debug << "imageLoadLod"; break;
|
case EOpImageLoadLod: out.debug << "imageLoadLod"; break;
|
||||||
case EOpImageStoreLod: out.debug << "imageStoreLod"; break;
|
case EOpImageStoreLod: out.debug << "imageStoreLod"; break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case EOpTextureQuerySize: out.debug << "textureSize"; break;
|
case EOpTextureQuerySize: out.debug << "textureSize"; break;
|
||||||
case EOpTextureQueryLod: out.debug << "textureQueryLod"; break;
|
case EOpTextureQueryLod: out.debug << "textureQueryLod"; break;
|
||||||
@ -940,11 +943,9 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
case EOpTextureOffsetClamp: out.debug << "textureOffsetClamp"; break;
|
case EOpTextureOffsetClamp: out.debug << "textureOffsetClamp"; break;
|
||||||
case EOpTextureGradClamp: out.debug << "textureGradClamp"; break;
|
case EOpTextureGradClamp: out.debug << "textureGradClamp"; break;
|
||||||
case EOpTextureGradOffsetClamp: out.debug << "textureGradOffsetClamp"; break;
|
case EOpTextureGradOffsetClamp: out.debug << "textureGradOffsetClamp"; break;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EOpTextureGatherLod: out.debug << "textureGatherLod"; break;
|
case EOpTextureGatherLod: out.debug << "textureGatherLod"; break;
|
||||||
case EOpTextureGatherLodOffset: out.debug << "textureGatherLodOffset"; break;
|
case EOpTextureGatherLodOffset: out.debug << "textureGatherLodOffset"; break;
|
||||||
case EOpTextureGatherLodOffsets: out.debug << "textureGatherLodOffsets"; break;
|
case EOpTextureGatherLodOffsets: out.debug << "textureGatherLodOffsets"; break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case EOpSparseTexture: out.debug << "sparseTexture"; break;
|
case EOpSparseTexture: out.debug << "sparseTexture"; break;
|
||||||
case EOpSparseTextureOffset: out.debug << "sparseTextureOffset"; break;
|
case EOpSparseTextureOffset: out.debug << "sparseTextureOffset"; break;
|
||||||
@ -962,19 +963,15 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
case EOpSparseTextureOffsetClamp: out.debug << "sparseTextureOffsetClamp"; break;
|
case EOpSparseTextureOffsetClamp: out.debug << "sparseTextureOffsetClamp"; break;
|
||||||
case EOpSparseTextureGradClamp: out.debug << "sparseTextureGradClamp"; break;
|
case EOpSparseTextureGradClamp: out.debug << "sparseTextureGradClamp"; break;
|
||||||
case EOpSparseTextureGradOffsetClamp: out.debug << "sparseTextureGradOffsetClam"; break;
|
case EOpSparseTextureGradOffsetClamp: out.debug << "sparseTextureGradOffsetClam"; break;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EOpSparseTextureGatherLod: out.debug << "sparseTextureGatherLod"; break;
|
case EOpSparseTextureGatherLod: out.debug << "sparseTextureGatherLod"; break;
|
||||||
case EOpSparseTextureGatherLodOffset: out.debug << "sparseTextureGatherLodOffset"; break;
|
case EOpSparseTextureGatherLodOffset: out.debug << "sparseTextureGatherLodOffset"; break;
|
||||||
case EOpSparseTextureGatherLodOffsets: out.debug << "sparseTextureGatherLodOffsets"; break;
|
case EOpSparseTextureGatherLodOffsets: out.debug << "sparseTextureGatherLodOffsets"; break;
|
||||||
case EOpSparseImageLoadLod: out.debug << "sparseImageLoadLod"; break;
|
case EOpSparseImageLoadLod: out.debug << "sparseImageLoadLod"; break;
|
||||||
#endif
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EOpImageSampleFootprintNV: out.debug << "imageSampleFootprintNV"; break;
|
case EOpImageSampleFootprintNV: out.debug << "imageSampleFootprintNV"; break;
|
||||||
case EOpImageSampleFootprintClampNV: out.debug << "imageSampleFootprintClampNV"; break;
|
case EOpImageSampleFootprintClampNV: out.debug << "imageSampleFootprintClampNV"; break;
|
||||||
case EOpImageSampleFootprintLodNV: out.debug << "imageSampleFootprintLodNV"; break;
|
case EOpImageSampleFootprintLodNV: out.debug << "imageSampleFootprintLodNV"; break;
|
||||||
case EOpImageSampleFootprintGradNV: out.debug << "imageSampleFootprintGradNV"; break;
|
case EOpImageSampleFootprintGradNV: out.debug << "imageSampleFootprintGradNV"; break;
|
||||||
case EOpImageSampleFootprintGradClampNV: out.debug << "mageSampleFootprintGradClampNV"; break;
|
case EOpImageSampleFootprintGradClampNV: out.debug << "mageSampleFootprintGradClampNV"; break;
|
||||||
#endif
|
|
||||||
case EOpAddCarry: out.debug << "addCarry"; break;
|
case EOpAddCarry: out.debug << "addCarry"; break;
|
||||||
case EOpSubBorrow: out.debug << "subBorrow"; break;
|
case EOpSubBorrow: out.debug << "subBorrow"; break;
|
||||||
case EOpUMulExtended: out.debug << "uMulExtended"; break;
|
case EOpUMulExtended: out.debug << "uMulExtended"; break;
|
||||||
@ -988,9 +985,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
|
|
||||||
case EOpInterpolateAtSample: out.debug << "interpolateAtSample"; break;
|
case EOpInterpolateAtSample: out.debug << "interpolateAtSample"; break;
|
||||||
case EOpInterpolateAtOffset: out.debug << "interpolateAtOffset"; break;
|
case EOpInterpolateAtOffset: out.debug << "interpolateAtOffset"; break;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EOpInterpolateAtVertex: out.debug << "interpolateAtVertex"; break;
|
case EOpInterpolateAtVertex: out.debug << "interpolateAtVertex"; break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case EOpSinCos: out.debug << "sincos"; break;
|
case EOpSinCos: out.debug << "sincos"; break;
|
||||||
case EOpGenMul: out.debug << "mul"; break;
|
case EOpGenMul: out.debug << "mul"; break;
|
||||||
@ -1057,22 +1052,45 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
|||||||
case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break;
|
case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break;
|
||||||
case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break;
|
case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break;
|
||||||
|
|
||||||
|
case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break;
|
||||||
|
case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break;
|
||||||
|
case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break;
|
||||||
|
case EOpSubgroupPartitionedMin: out.debug << "subgroupPartitionedMinNV"; break;
|
||||||
|
case EOpSubgroupPartitionedMax: out.debug << "subgroupPartitionedMaxNV"; break;
|
||||||
|
case EOpSubgroupPartitionedAnd: out.debug << "subgroupPartitionedAndNV"; break;
|
||||||
|
case EOpSubgroupPartitionedOr: out.debug << "subgroupPartitionedOrNV"; break;
|
||||||
|
case EOpSubgroupPartitionedXor: out.debug << "subgroupPartitionedXorNV"; break;
|
||||||
|
case EOpSubgroupPartitionedInclusiveAdd: out.debug << "subgroupPartitionedInclusiveAddNV"; break;
|
||||||
|
case EOpSubgroupPartitionedInclusiveMul: out.debug << "subgroupPartitionedInclusiveMulNV"; break;
|
||||||
|
case EOpSubgroupPartitionedInclusiveMin: out.debug << "subgroupPartitionedInclusiveMinNV"; break;
|
||||||
|
case EOpSubgroupPartitionedInclusiveMax: out.debug << "subgroupPartitionedInclusiveMaxNV"; break;
|
||||||
|
case EOpSubgroupPartitionedInclusiveAnd: out.debug << "subgroupPartitionedInclusiveAndNV"; break;
|
||||||
|
case EOpSubgroupPartitionedInclusiveOr: out.debug << "subgroupPartitionedInclusiveOrNV"; break;
|
||||||
|
case EOpSubgroupPartitionedInclusiveXor: out.debug << "subgroupPartitionedInclusiveXorNV"; break;
|
||||||
|
case EOpSubgroupPartitionedExclusiveAdd: out.debug << "subgroupPartitionedExclusiveAddNV"; break;
|
||||||
|
case EOpSubgroupPartitionedExclusiveMul: out.debug << "subgroupPartitionedExclusiveMulNV"; break;
|
||||||
|
case EOpSubgroupPartitionedExclusiveMin: out.debug << "subgroupPartitionedExclusiveMinNV"; break;
|
||||||
|
case EOpSubgroupPartitionedExclusiveMax: out.debug << "subgroupPartitionedExclusiveMaxNV"; break;
|
||||||
|
case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break;
|
||||||
|
case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break;
|
||||||
|
case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break;
|
||||||
|
|
||||||
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
|
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
|
||||||
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EOpTraceNV: out.debug << "traceNV"; break;
|
case EOpTraceNV: out.debug << "traceNV"; break;
|
||||||
case EOpReportIntersectionNV: out.debug << "reportIntersectionNV"; break;
|
case EOpReportIntersectionNV: out.debug << "reportIntersectionNV"; break;
|
||||||
case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNV"; break;
|
case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNV"; break;
|
||||||
case EOpTerminateRayNV: out.debug << "terminateRayNV"; break;
|
case EOpTerminateRayNV: out.debug << "terminateRayNV"; break;
|
||||||
case EOpExecuteCallableNV: out.debug << "executeCallableNV"; break;
|
case EOpExecuteCallableNV: out.debug << "executeCallableNV"; break;
|
||||||
case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break;
|
case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix"; break;
|
case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix"; break;
|
||||||
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break;
|
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break;
|
||||||
case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices"; break;
|
case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices"; break;
|
||||||
|
|
||||||
|
case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
|
||||||
|
|
||||||
default: out.debug.message(EPrefixError, "Bad aggregation op");
|
default: out.debug.message(EPrefixError, "Bad aggregation op");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1367,6 +1385,7 @@ bool TOutputTraverser::visitBranch(TVisit /* visit*/, TIntermBranch* node)
|
|||||||
case EOpContinue: out.debug << "Branch: Continue"; break;
|
case EOpContinue: out.debug << "Branch: Continue"; break;
|
||||||
case EOpReturn: out.debug << "Branch: Return"; break;
|
case EOpReturn: out.debug << "Branch: Return"; break;
|
||||||
case EOpCase: out.debug << "case: "; break;
|
case EOpCase: out.debug << "case: "; break;
|
||||||
|
case EOpDemote: out.debug << "Demote"; break;
|
||||||
case EOpDefault: out.debug << "default: "; break;
|
case EOpDefault: out.debug << "default: "; break;
|
||||||
default: out.debug << "Branch: Unknown Branch"; break;
|
default: out.debug << "Branch: Unknown Branch"; break;
|
||||||
}
|
}
|
||||||
@ -1477,18 +1496,17 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
|
|||||||
}
|
}
|
||||||
infoSink.debug << "\n";
|
infoSink.debug << "\n";
|
||||||
}
|
}
|
||||||
|
if (interlockOrdering != EioNone)
|
||||||
|
infoSink.debug << "interlock ordering = " << TQualifier::getInterlockOrderingString(interlockOrdering) << "\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EShLangMeshNV:
|
case EShLangMeshNV:
|
||||||
infoSink.debug << "max_vertices = " << vertices << "\n";
|
infoSink.debug << "max_vertices = " << vertices << "\n";
|
||||||
infoSink.debug << "max_primitives = " << primitives << "\n";
|
infoSink.debug << "max_primitives = " << primitives << "\n";
|
||||||
infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n";
|
infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n";
|
||||||
// Fall through
|
// Fall through
|
||||||
|
|
||||||
case EShLangTaskNV:
|
case EShLangTaskNV:
|
||||||
// Fall through
|
// Fall through
|
||||||
#endif
|
|
||||||
case EShLangCompute:
|
case EShLangCompute:
|
||||||
infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n";
|
infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n";
|
||||||
{
|
{
|
||||||
@ -1517,3 +1535,5 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
|
||||||
|
#endif // not GLSLANG_WEB
|
File diff suppressed because it is too large
Load Diff
@ -33,11 +33,15 @@
|
|||||||
// POSSIBILITY OF SUCH DAMAGE.
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
#ifndef _IOMAPPER_INCLUDED
|
#ifndef _IOMAPPER_INCLUDED
|
||||||
#define _IOMAPPER_INCLUDED
|
#define _IOMAPPER_INCLUDED
|
||||||
|
|
||||||
#include "../Public/ShaderLang.h"
|
#include <cstdint>
|
||||||
|
#include "LiveTraverser.h"
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <unordered_set>
|
||||||
//
|
//
|
||||||
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
|
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
|
||||||
//
|
//
|
||||||
@ -47,17 +51,249 @@ class TInfoSink;
|
|||||||
namespace glslang {
|
namespace glslang {
|
||||||
|
|
||||||
class TIntermediate;
|
class TIntermediate;
|
||||||
|
struct TVarEntryInfo {
|
||||||
|
int id;
|
||||||
|
TIntermSymbol* symbol;
|
||||||
|
bool live;
|
||||||
|
int newBinding;
|
||||||
|
int newSet;
|
||||||
|
int newLocation;
|
||||||
|
int newComponent;
|
||||||
|
int newIndex;
|
||||||
|
EShLanguage stage;
|
||||||
|
struct TOrderById {
|
||||||
|
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { return l.id < r.id; }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TOrderByPriority {
|
||||||
|
// ordering:
|
||||||
|
// 1) has both binding and set
|
||||||
|
// 2) has binding but no set
|
||||||
|
// 3) has no binding but set
|
||||||
|
// 4) has no binding and no set
|
||||||
|
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) {
|
||||||
|
const TQualifier& lq = l.symbol->getQualifier();
|
||||||
|
const TQualifier& rq = r.symbol->getQualifier();
|
||||||
|
|
||||||
|
// simple rules:
|
||||||
|
// has binding gives 2 points
|
||||||
|
// has set gives 1 point
|
||||||
|
// who has the most points is more important.
|
||||||
|
int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0);
|
||||||
|
int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0);
|
||||||
|
|
||||||
|
if (lPoints == rPoints)
|
||||||
|
return l.id < r.id;
|
||||||
|
return lPoints > rPoints;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Base class for shared TIoMapResolver services, used by several derivations.
|
||||||
|
struct TDefaultIoResolverBase : public glslang::TIoMapResolver {
|
||||||
|
public:
|
||||||
|
TDefaultIoResolverBase(const TIntermediate& intermediate);
|
||||||
|
typedef std::vector<int> TSlotSet;
|
||||||
|
typedef std::unordered_map<int, TSlotSet> TSlotSetMap;
|
||||||
|
|
||||||
|
// grow the reflection stage by stage
|
||||||
|
void notifyBinding(EShLanguage, TVarEntryInfo& /*ent*/) override {}
|
||||||
|
void notifyInOut(EShLanguage, TVarEntryInfo& /*ent*/) override {}
|
||||||
|
void beginNotifications(EShLanguage) override {}
|
||||||
|
void endNotifications(EShLanguage) override {}
|
||||||
|
void beginResolve(EShLanguage) override {}
|
||||||
|
void endResolve(EShLanguage) override {}
|
||||||
|
void beginCollect(EShLanguage) override {}
|
||||||
|
void endCollect(EShLanguage) override {}
|
||||||
|
void reserverResourceSlot(TVarEntryInfo& /*ent*/, TInfoSink& /*infoSink*/) override {}
|
||||||
|
void reserverStorageSlot(TVarEntryInfo& /*ent*/, TInfoSink& /*infoSink*/) override {}
|
||||||
|
int getBaseBinding(TResourceType res, unsigned int set) const;
|
||||||
|
const std::vector<std::string>& getResourceSetBinding() const;
|
||||||
|
virtual TResourceType getResourceType(const glslang::TType& type) = 0;
|
||||||
|
bool doAutoBindingMapping() const;
|
||||||
|
bool doAutoLocationMapping() const;
|
||||||
|
TSlotSet::iterator findSlot(int set, int slot);
|
||||||
|
bool checkEmpty(int set, int slot);
|
||||||
|
bool validateInOut(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; }
|
||||||
|
int reserveSlot(int set, int slot, int size = 1);
|
||||||
|
int getFreeSlot(int set, int base, int size = 1);
|
||||||
|
int resolveSet(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||||
|
int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||||
|
int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override;
|
||||||
|
int resolveInOutComponent(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||||
|
int resolveInOutIndex(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||||
|
void addStage(EShLanguage stage) override {
|
||||||
|
if (stage < EShLangCount)
|
||||||
|
stageMask[stage] = true;
|
||||||
|
}
|
||||||
|
uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage);
|
||||||
|
|
||||||
|
TSlotSetMap slots;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
TDefaultIoResolverBase(TDefaultIoResolverBase&);
|
||||||
|
TDefaultIoResolverBase& operator=(TDefaultIoResolverBase&);
|
||||||
|
const TIntermediate& intermediate;
|
||||||
|
int nextUniformLocation;
|
||||||
|
int nextInputLocation;
|
||||||
|
int nextOutputLocation;
|
||||||
|
bool stageMask[EShLangCount + 1];
|
||||||
|
// Return descriptor set specific base if there is one, and the generic base otherwise.
|
||||||
|
int selectBaseBinding(int base, int descriptorSetBase) const {
|
||||||
|
return descriptorSetBase != -1 ? descriptorSetBase : base;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int getLayoutSet(const glslang::TType& type) {
|
||||||
|
if (type.getQualifier().hasSet())
|
||||||
|
return type.getQualifier().layoutSet;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isSamplerType(const glslang::TType& type) {
|
||||||
|
return type.getBasicType() == glslang::EbtSampler && type.getSampler().isPureSampler();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isTextureType(const glslang::TType& type) {
|
||||||
|
return (type.getBasicType() == glslang::EbtSampler &&
|
||||||
|
(type.getSampler().isTexture() || type.getSampler().isSubpass()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isUboType(const glslang::TType& type) {
|
||||||
|
return type.getQualifier().storage == EvqUniform;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isImageType(const glslang::TType& type) {
|
||||||
|
return type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isSsboType(const glslang::TType& type) {
|
||||||
|
return type.getQualifier().storage == EvqBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return true if this is a SRV (shader resource view) type:
|
||||||
|
static bool isSrvType(const glslang::TType& type) {
|
||||||
|
return isTextureType(type) || type.getQualifier().storage == EvqBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return true if this is a UAV (unordered access view) type:
|
||||||
|
static bool isUavType(const glslang::TType& type) {
|
||||||
|
if (type.getQualifier().isReadOnly())
|
||||||
|
return false;
|
||||||
|
return (type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage()) ||
|
||||||
|
(type.getQualifier().storage == EvqBuffer);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defaulf I/O resolver for OpenGL
|
||||||
|
struct TDefaultGlslIoResolver : public TDefaultIoResolverBase {
|
||||||
|
public:
|
||||||
|
typedef std::map<TString, int> TVarSlotMap; // <resourceName, location/binding>
|
||||||
|
typedef std::map<int, TVarSlotMap> TSlotMap; // <resourceKey, TVarSlotMap>
|
||||||
|
TDefaultGlslIoResolver(const TIntermediate& intermediate);
|
||||||
|
bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; }
|
||||||
|
TResourceType getResourceType(const glslang::TType& type) override;
|
||||||
|
int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override;
|
||||||
|
int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||||
|
int resolveBinding(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||||
|
void beginResolve(EShLanguage /*stage*/) override;
|
||||||
|
void endResolve(EShLanguage stage) override;
|
||||||
|
void beginCollect(EShLanguage) override;
|
||||||
|
void endCollect(EShLanguage) override;
|
||||||
|
void reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) override;
|
||||||
|
void reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) override;
|
||||||
|
// in/out symbol and uniform symbol are stored in the same resourceSlotMap, the storage key is used to identify each type of symbol.
|
||||||
|
// We use stage and storage qualifier to construct a storage key. it can help us identify the same storage resource used in different stage.
|
||||||
|
// if a resource is a program resource and we don't need know it usage stage, we can use same stage to build storage key.
|
||||||
|
// Note: both stage and type must less then 0xffff.
|
||||||
|
int buildStorageKey(EShLanguage stage, TStorageQualifier type) {
|
||||||
|
assert(static_cast<uint32_t>(stage) <= 0x0000ffff && static_cast<uint32_t>(type) <= 0x0000ffff);
|
||||||
|
return (stage << 16) | type;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Use for mark pre stage, to get more interface symbol information.
|
||||||
|
EShLanguage preStage;
|
||||||
|
// Use for mark current shader stage for resolver
|
||||||
|
EShLanguage currentStage;
|
||||||
|
// Slot map for storage resource(location of uniform and interface symbol) It's a program share slot
|
||||||
|
TSlotMap resourceSlotMap;
|
||||||
|
// Slot map for other resource(image, ubo, ssbo), It's a program share slot.
|
||||||
|
TSlotMap storageSlotMap;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::map<TString, TVarEntryInfo> TVarLiveMap;
|
||||||
|
|
||||||
|
// override function "operator=", if a vector<const _Kty, _Ty> being sort,
|
||||||
|
// when use vc++, the sort function will call :
|
||||||
|
// pair& operator=(const pair<_Other1, _Other2>& _Right)
|
||||||
|
// {
|
||||||
|
// first = _Right.first;
|
||||||
|
// second = _Right.second;
|
||||||
|
// return (*this);
|
||||||
|
// }
|
||||||
|
// that will make a const type handing on left.
|
||||||
|
// override this function can avoid a compiler error.
|
||||||
|
// In the future, if the vc++ compiler can handle such a situation,
|
||||||
|
// this part of the code will be removed.
|
||||||
|
struct TVarLivePair : std::pair<const TString, TVarEntryInfo> {
|
||||||
|
TVarLivePair(std::pair<const TString, TVarEntryInfo>& _Right) : pair(_Right.first, _Right.second) {}
|
||||||
|
TVarLivePair& operator=(const TVarLivePair& _Right) {
|
||||||
|
const_cast<TString&>(first) = _Right.first;
|
||||||
|
second = _Right.second;
|
||||||
|
return (*this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
typedef std::vector<TVarLivePair> TVarLiveVector;
|
||||||
|
|
||||||
// I/O mapper
|
// I/O mapper
|
||||||
class TIoMapper {
|
class TIoMapper {
|
||||||
public:
|
public:
|
||||||
TIoMapper() {}
|
TIoMapper() {}
|
||||||
virtual ~TIoMapper() {}
|
virtual ~TIoMapper() {}
|
||||||
|
|
||||||
// grow the reflection stage by stage
|
// grow the reflection stage by stage
|
||||||
bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*);
|
bool virtual addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*);
|
||||||
|
bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; }
|
||||||
|
};
|
||||||
|
|
||||||
|
// I/O mapper for OpenGL
|
||||||
|
class TGlslIoMapper : public TIoMapper {
|
||||||
|
public:
|
||||||
|
TGlslIoMapper() {
|
||||||
|
memset(inVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
||||||
|
memset(outVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
||||||
|
memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
||||||
|
memset(intermediates, 0, sizeof(TIntermediate*) * (EShLangCount + 1));
|
||||||
|
}
|
||||||
|
virtual ~TGlslIoMapper() {
|
||||||
|
for (size_t stage = 0; stage < EShLangCount; stage++) {
|
||||||
|
if (inVarMaps[stage] != nullptr) {
|
||||||
|
delete inVarMaps[stage];
|
||||||
|
inVarMaps[stage] = nullptr;
|
||||||
|
}
|
||||||
|
if (outVarMaps[stage] != nullptr) {
|
||||||
|
delete outVarMaps[stage];
|
||||||
|
outVarMaps[stage] = nullptr;
|
||||||
|
}
|
||||||
|
if (uniformVarMap[stage] != nullptr) {
|
||||||
|
delete uniformVarMap[stage];
|
||||||
|
uniformVarMap[stage] = nullptr;
|
||||||
|
}
|
||||||
|
if (intermediates[stage] != nullptr)
|
||||||
|
intermediates[stage] = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// grow the reflection stage by stage
|
||||||
|
bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*) override;
|
||||||
|
bool doMap(TIoMapResolver*, TInfoSink&) override;
|
||||||
|
TVarLiveMap *inVarMaps[EShLangCount], *outVarMaps[EShLangCount],
|
||||||
|
*uniformVarMap[EShLangCount];
|
||||||
|
TIntermediate* intermediates[EShLangCount];
|
||||||
|
bool hadError = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
|
||||||
#endif // _IOMAPPER_INCLUDED
|
#endif // _IOMAPPER_INCLUDED
|
||||||
|
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
|
@ -187,12 +187,14 @@ bool TIndexTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
|
|||||||
//
|
//
|
||||||
void TParseContext::constantIndexExpressionCheck(TIntermNode* index)
|
void TParseContext::constantIndexExpressionCheck(TIntermNode* index)
|
||||||
{
|
{
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
TIndexTraverser it(inductiveLoopIds);
|
TIndexTraverser it(inductiveLoopIds);
|
||||||
|
|
||||||
index->traverse(&it);
|
index->traverse(&it);
|
||||||
|
|
||||||
if (it.bad)
|
if (it.bad)
|
||||||
error(it.badLoc, "Non-constant-index-expression", "limitations", "");
|
error(it.badLoc, "Non-constant-index-expression", "limitations", "");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
@ -56,8 +56,10 @@ namespace glslang {
|
|||||||
//
|
//
|
||||||
void TIntermediate::error(TInfoSink& infoSink, const char* message)
|
void TIntermediate::error(TInfoSink& infoSink, const char* message)
|
||||||
{
|
{
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
infoSink.info.prefix(EPrefixError);
|
infoSink.info.prefix(EPrefixError);
|
||||||
infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
|
infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
++numErrors;
|
++numErrors;
|
||||||
}
|
}
|
||||||
@ -65,8 +67,10 @@ void TIntermediate::error(TInfoSink& infoSink, const char* message)
|
|||||||
// Link-time warning.
|
// Link-time warning.
|
||||||
void TIntermediate::warn(TInfoSink& infoSink, const char* message)
|
void TIntermediate::warn(TInfoSink& infoSink, const char* message)
|
||||||
{
|
{
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
infoSink.info.prefix(EPrefixWarning);
|
infoSink.info.prefix(EPrefixWarning);
|
||||||
infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
|
infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 4.4 offset/align: "Two blocks linked together in the same program with the same block
|
// TODO: 4.4 offset/align: "Two blocks linked together in the same program with the same block
|
||||||
@ -78,9 +82,11 @@ void TIntermediate::warn(TInfoSink& infoSink, const char* message)
|
|||||||
//
|
//
|
||||||
void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
|
void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
|
||||||
{
|
{
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
mergeCallGraphs(infoSink, unit);
|
mergeCallGraphs(infoSink, unit);
|
||||||
mergeModes(infoSink, unit);
|
mergeModes(infoSink, unit);
|
||||||
mergeTrees(infoSink, unit);
|
mergeTrees(infoSink, unit);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit)
|
void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit)
|
||||||
@ -98,6 +104,8 @@ void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end());
|
callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
#define MERGE_MAX(member) member = std::max(member, unit.member)
|
#define MERGE_MAX(member) member = std::max(member, unit.member)
|
||||||
#define MERGE_TRUE(member) if (unit.member) member = unit.member;
|
#define MERGE_TRUE(member) if (unit.member) member = unit.member;
|
||||||
|
|
||||||
@ -106,9 +114,9 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
if (language != unit.language)
|
if (language != unit.language)
|
||||||
error(infoSink, "stages must match when linking into a single stage");
|
error(infoSink, "stages must match when linking into a single stage");
|
||||||
|
|
||||||
if (source == EShSourceNone)
|
if (getSource() == EShSourceNone)
|
||||||
source = unit.source;
|
setSource(unit.getSource());
|
||||||
if (source != unit.source)
|
if (getSource() != unit.getSource())
|
||||||
error(infoSink, "can't link compilation units from different source languages");
|
error(infoSink, "can't link compilation units from different source languages");
|
||||||
|
|
||||||
if (treeRoot == nullptr) {
|
if (treeRoot == nullptr) {
|
||||||
@ -116,7 +124,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
version = unit.version;
|
version = unit.version;
|
||||||
requestedExtensions = unit.requestedExtensions;
|
requestedExtensions = unit.requestedExtensions;
|
||||||
} else {
|
} else {
|
||||||
if ((profile == EEsProfile) != (unit.profile == EEsProfile))
|
if ((isEsProfile()) != (unit.isEsProfile()))
|
||||||
error(infoSink, "Cannot cross link ES and desktop profiles");
|
error(infoSink, "Cannot cross link ES and desktop profiles");
|
||||||
else if (unit.profile == ECompatibilityProfile)
|
else if (unit.profile == ECompatibilityProfile)
|
||||||
profile = ECompatibilityProfile;
|
profile = ECompatibilityProfile;
|
||||||
@ -142,18 +150,13 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
if (vertices == TQualifier::layoutNotSet)
|
if (vertices == TQualifier::layoutNotSet)
|
||||||
vertices = unit.vertices;
|
vertices = unit.vertices;
|
||||||
else if (vertices != unit.vertices) {
|
else if (vertices != unit.vertices) {
|
||||||
if (language == EShLangGeometry
|
if (language == EShLangGeometry || language == EShLangMeshNV)
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
|| language == EShLangMeshNV
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
error(infoSink, "Contradictory layout max_vertices values");
|
error(infoSink, "Contradictory layout max_vertices values");
|
||||||
else if (language == EShLangTessControl)
|
else if (language == EShLangTessControl)
|
||||||
error(infoSink, "Contradictory layout vertices values");
|
error(infoSink, "Contradictory layout vertices values");
|
||||||
else
|
else
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
if (primitives == TQualifier::layoutNotSet)
|
if (primitives == TQualifier::layoutNotSet)
|
||||||
primitives = unit.primitives;
|
primitives = unit.primitives;
|
||||||
else if (primitives != unit.primitives) {
|
else if (primitives != unit.primitives) {
|
||||||
@ -162,7 +165,6 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
else
|
else
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (inputPrimitive == ElgNone)
|
if (inputPrimitive == ElgNone)
|
||||||
inputPrimitive = unit.inputPrimitive;
|
inputPrimitive = unit.inputPrimitive;
|
||||||
@ -190,12 +192,14 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
MERGE_TRUE(pointMode);
|
MERGE_TRUE(pointMode);
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
if (localSize[i] > 1)
|
if (!localSizeNotDefault[i] && unit.localSizeNotDefault[i]) {
|
||||||
localSize[i] = unit.localSize[i];
|
localSize[i] = unit.localSize[i];
|
||||||
|
localSizeNotDefault[i] = true;
|
||||||
|
}
|
||||||
else if (localSize[i] != unit.localSize[i])
|
else if (localSize[i] != unit.localSize[i])
|
||||||
error(infoSink, "Contradictory local size");
|
error(infoSink, "Contradictory local size");
|
||||||
|
|
||||||
if (localSizeSpecId[i] != TQualifier::layoutNotSet)
|
if (localSizeSpecId[i] == TQualifier::layoutNotSet)
|
||||||
localSizeSpecId[i] = unit.localSizeSpecId[i];
|
localSizeSpecId[i] = unit.localSizeSpecId[i];
|
||||||
else if (localSizeSpecId[i] != unit.localSizeSpecId[i])
|
else if (localSizeSpecId[i] != unit.localSizeSpecId[i])
|
||||||
error(infoSink, "Contradictory local size specialization ids");
|
error(infoSink, "Contradictory local size specialization ids");
|
||||||
@ -224,21 +228,16 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
xfbBuffers[b].implicitStride = std::max(xfbBuffers[b].implicitStride, unit.xfbBuffers[b].implicitStride);
|
xfbBuffers[b].implicitStride = std::max(xfbBuffers[b].implicitStride, unit.xfbBuffers[b].implicitStride);
|
||||||
if (unit.xfbBuffers[b].contains64BitType)
|
if (unit.xfbBuffers[b].contains64BitType)
|
||||||
xfbBuffers[b].contains64BitType = true;
|
xfbBuffers[b].contains64BitType = true;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
if (unit.xfbBuffers[b].contains32BitType)
|
if (unit.xfbBuffers[b].contains32BitType)
|
||||||
xfbBuffers[b].contains32BitType = true;
|
xfbBuffers[b].contains32BitType = true;
|
||||||
if (unit.xfbBuffers[b].contains16BitType)
|
if (unit.xfbBuffers[b].contains16BitType)
|
||||||
xfbBuffers[b].contains16BitType = true;
|
xfbBuffers[b].contains16BitType = true;
|
||||||
#endif
|
|
||||||
// TODO: 4.4 link: enhanced layouts: compare ranges
|
// TODO: 4.4 link: enhanced layouts: compare ranges
|
||||||
}
|
}
|
||||||
|
|
||||||
MERGE_TRUE(multiStream);
|
MERGE_TRUE(multiStream);
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
MERGE_TRUE(layoutOverrideCoverage);
|
MERGE_TRUE(layoutOverrideCoverage);
|
||||||
MERGE_TRUE(geoPassthroughEXT);
|
MERGE_TRUE(geoPassthroughEXT);
|
||||||
#endif
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < unit.shiftBinding.size(); ++i) {
|
for (unsigned int i = 0; i < unit.shiftBinding.size(); ++i) {
|
||||||
if (unit.shiftBinding[i] > 0)
|
if (unit.shiftBinding[i] > 0)
|
||||||
@ -287,13 +286,8 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Getting this far means we have two existing trees to merge...
|
// Getting this far means we have two existing trees to merge...
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
numShaderRecordNVBlocks += unit.numShaderRecordNVBlocks;
|
numShaderRecordNVBlocks += unit.numShaderRecordNVBlocks;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
numTaskNVBlocks += unit.numTaskNVBlocks;
|
numTaskNVBlocks += unit.numTaskNVBlocks;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Get the top-level globals of each unit
|
// Get the top-level globals of each unit
|
||||||
TIntermSequence& globals = treeRoot->getAsAggregate()->getSequence();
|
TIntermSequence& globals = treeRoot->getAsAggregate()->getSequence();
|
||||||
@ -315,6 +309,8 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit)
|
|||||||
ioAccessed.insert(unit.ioAccessed.begin(), unit.ioAccessed.end());
|
ioAccessed.insert(unit.ioAccessed.begin(), unit.ioAccessed.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// Traverser that seeds an ID map with all built-ins, and tracks the
|
// Traverser that seeds an ID map with all built-ins, and tracks the
|
||||||
// maximum ID used.
|
// maximum ID used.
|
||||||
// (It would be nice to put this in a function, but that causes warnings
|
// (It would be nice to put this in a function, but that causes warnings
|
||||||
@ -502,6 +498,7 @@ void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
|
|||||||
//
|
//
|
||||||
void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, bool crossStage)
|
void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, bool crossStage)
|
||||||
{
|
{
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
bool writeTypeComparison = false;
|
bool writeTypeComparison = false;
|
||||||
|
|
||||||
// Types have to match
|
// Types have to match
|
||||||
@ -536,7 +533,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Precise...
|
// Precise...
|
||||||
if (! crossStage && symbol.getQualifier().noContraction != unitSymbol.getQualifier().noContraction) {
|
if (! crossStage && symbol.getQualifier().isNoContraction() != unitSymbol.getQualifier().isNoContraction()) {
|
||||||
error(infoSink, "Presence of precise qualifier must match:");
|
error(infoSink, "Presence of precise qualifier must match:");
|
||||||
writeTypeComparison = true;
|
writeTypeComparison = true;
|
||||||
}
|
}
|
||||||
@ -545,9 +542,9 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
|
|||||||
if (symbol.getQualifier().centroid != unitSymbol.getQualifier().centroid ||
|
if (symbol.getQualifier().centroid != unitSymbol.getQualifier().centroid ||
|
||||||
symbol.getQualifier().smooth != unitSymbol.getQualifier().smooth ||
|
symbol.getQualifier().smooth != unitSymbol.getQualifier().smooth ||
|
||||||
symbol.getQualifier().flat != unitSymbol.getQualifier().flat ||
|
symbol.getQualifier().flat != unitSymbol.getQualifier().flat ||
|
||||||
symbol.getQualifier().sample != unitSymbol.getQualifier().sample ||
|
symbol.getQualifier().isSample()!= unitSymbol.getQualifier().isSample() ||
|
||||||
symbol.getQualifier().patch != unitSymbol.getQualifier().patch ||
|
symbol.getQualifier().isPatch() != unitSymbol.getQualifier().isPatch() ||
|
||||||
symbol.getQualifier().nopersp != unitSymbol.getQualifier().nopersp) {
|
symbol.getQualifier().isNonPerspective() != unitSymbol.getQualifier().isNonPerspective()) {
|
||||||
error(infoSink, "Interpolation and auxiliary storage qualifiers must match:");
|
error(infoSink, "Interpolation and auxiliary storage qualifiers must match:");
|
||||||
writeTypeComparison = true;
|
writeTypeComparison = true;
|
||||||
}
|
}
|
||||||
@ -595,6 +592,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
|
|||||||
if (writeTypeComparison)
|
if (writeTypeComparison)
|
||||||
infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus \"" <<
|
infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus \"" <<
|
||||||
unitSymbol.getType().getCompleteString() << "\"\n";
|
unitSymbol.getType().getCompleteString() << "\"\n";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -609,15 +607,12 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (numEntryPoints < 1) {
|
if (numEntryPoints < 1) {
|
||||||
if (source == EShSourceGlsl)
|
if (getSource() == EShSourceGlsl)
|
||||||
error(infoSink, "Missing entry point: Each stage requires one entry point");
|
error(infoSink, "Missing entry point: Each stage requires one entry point");
|
||||||
else
|
else
|
||||||
warn(infoSink, "Entry point not found");
|
warn(infoSink, "Entry point not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numPushConstants > 1)
|
|
||||||
error(infoSink, "Only one push_constant block is allowed per stage");
|
|
||||||
|
|
||||||
// recursion and missing body checking
|
// recursion and missing body checking
|
||||||
checkCallGraphCycles(infoSink);
|
checkCallGraphCycles(infoSink);
|
||||||
checkCallGraphBodies(infoSink, keepUncalled);
|
checkCallGraphBodies(infoSink, keepUncalled);
|
||||||
@ -625,6 +620,10 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
// overlap/alias/missing I/O, etc.
|
// overlap/alias/missing I/O, etc.
|
||||||
inOutLocationCheck(infoSink);
|
inOutLocationCheck(infoSink);
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
if (getNumPushConstants() > 1)
|
||||||
|
error(infoSink, "Only one push_constant block is allowed per stage");
|
||||||
|
|
||||||
// invocations
|
// invocations
|
||||||
if (invocations == TQualifier::layoutNotSet)
|
if (invocations == TQualifier::layoutNotSet)
|
||||||
invocations = 1;
|
invocations = 1;
|
||||||
@ -642,12 +641,10 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
for (size_t b = 0; b < xfbBuffers.size(); ++b) {
|
for (size_t b = 0; b < xfbBuffers.size(); ++b) {
|
||||||
if (xfbBuffers[b].contains64BitType)
|
if (xfbBuffers[b].contains64BitType)
|
||||||
RoundToPow2(xfbBuffers[b].implicitStride, 8);
|
RoundToPow2(xfbBuffers[b].implicitStride, 8);
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
else if (xfbBuffers[b].contains32BitType)
|
else if (xfbBuffers[b].contains32BitType)
|
||||||
RoundToPow2(xfbBuffers[b].implicitStride, 4);
|
RoundToPow2(xfbBuffers[b].implicitStride, 4);
|
||||||
else if (xfbBuffers[b].contains16BitType)
|
else if (xfbBuffers[b].contains16BitType)
|
||||||
RoundToPow2(xfbBuffers[b].implicitStride, 2);
|
RoundToPow2(xfbBuffers[b].implicitStride, 2);
|
||||||
#endif
|
|
||||||
|
|
||||||
// "It is a compile-time or link-time error to have
|
// "It is a compile-time or link-time error to have
|
||||||
// any xfb_offset that overflows xfb_stride, whether stated on declarations before or after the xfb_stride, or
|
// any xfb_offset that overflows xfb_stride, whether stated on declarations before or after the xfb_stride, or
|
||||||
@ -668,16 +665,11 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
error(infoSink, "xfb_stride must be multiple of 8 for buffer holding a double or 64-bit integer:");
|
error(infoSink, "xfb_stride must be multiple of 8 for buffer holding a double or 64-bit integer:");
|
||||||
infoSink.info.prefix(EPrefixError);
|
infoSink.info.prefix(EPrefixError);
|
||||||
infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n";
|
infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n";
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if (xfbBuffers[b].contains32BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 4)) {
|
} else if (xfbBuffers[b].contains32BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 4)) {
|
||||||
#else
|
|
||||||
} else if (! IsMultipleOfPow2(xfbBuffers[b].stride, 4)) {
|
|
||||||
#endif
|
|
||||||
error(infoSink, "xfb_stride must be multiple of 4:");
|
error(infoSink, "xfb_stride must be multiple of 4:");
|
||||||
infoSink.info.prefix(EPrefixError);
|
infoSink.info.prefix(EPrefixError);
|
||||||
infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n";
|
infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n";
|
||||||
}
|
}
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
// "If the buffer is capturing any
|
// "If the buffer is capturing any
|
||||||
// outputs with half-precision or 16-bit integer components, the stride must be a multiple of 2"
|
// outputs with half-precision or 16-bit integer components, the stride must be a multiple of 2"
|
||||||
else if (xfbBuffers[b].contains16BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 2)) {
|
else if (xfbBuffers[b].contains16BitType && ! IsMultipleOfPow2(xfbBuffers[b].stride, 2)) {
|
||||||
@ -686,7 +678,6 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n";
|
infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
// "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the
|
// "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the
|
||||||
// implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents."
|
// implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents."
|
||||||
if (xfbBuffers[b].stride > (unsigned int)(4 * resources.maxTransformFeedbackInterleavedComponents)) {
|
if (xfbBuffers[b].stride > (unsigned int)(4 * resources.maxTransformFeedbackInterleavedComponents)) {
|
||||||
@ -704,7 +695,7 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
error(infoSink, "At least one shader must specify an output layout(vertices=...)");
|
error(infoSink, "At least one shader must specify an output layout(vertices=...)");
|
||||||
break;
|
break;
|
||||||
case EShLangTessEvaluation:
|
case EShLangTessEvaluation:
|
||||||
if (source == EShSourceGlsl) {
|
if (getSource() == EShSourceGlsl) {
|
||||||
if (inputPrimitive == ElgNone)
|
if (inputPrimitive == ElgNone)
|
||||||
error(infoSink, "At least one shader must specify an input layout primitive");
|
error(infoSink, "At least one shader must specify an input layout primitive");
|
||||||
if (vertexSpacing == EvsNone)
|
if (vertexSpacing == EvsNone)
|
||||||
@ -730,8 +721,6 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
break;
|
break;
|
||||||
case EShLangCompute:
|
case EShLangCompute:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
case EShLangRayGenNV:
|
case EShLangRayGenNV:
|
||||||
case EShLangIntersectNV:
|
case EShLangIntersectNV:
|
||||||
case EShLangAnyHitNV:
|
case EShLangAnyHitNV:
|
||||||
@ -764,8 +753,6 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
if (numTaskNVBlocks > 1)
|
if (numTaskNVBlocks > 1)
|
||||||
error(infoSink, "Only one taskNV interface block is allowed per shader");
|
error(infoSink, "Only one taskNV interface block is allowed per shader");
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error(infoSink, "Unknown Stage.");
|
error(infoSink, "Unknown Stage.");
|
||||||
break;
|
break;
|
||||||
@ -787,6 +774,7 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
|||||||
} finalLinkTraverser;
|
} finalLinkTraverser;
|
||||||
|
|
||||||
treeRoot->traverse(&finalLinkTraverser);
|
treeRoot->traverse(&finalLinkTraverser);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -973,7 +961,7 @@ void TIntermediate::inOutLocationCheck(TInfoSink& infoSink)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (profile == EEsProfile) {
|
if (isEsProfile()) {
|
||||||
if (numFragOut > 1 && fragOutWithNoLocation)
|
if (numFragOut > 1 && fragOutWithNoLocation)
|
||||||
error(infoSink, "when more than one fragment shader output, all must have location qualifiers");
|
error(infoSink, "when more than one fragment shader output, all must have location qualifiers");
|
||||||
}
|
}
|
||||||
@ -1066,6 +1054,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||||||
// So, for the case of dvec3, we need two independent ioRanges.
|
// So, for the case of dvec3, we need two independent ioRanges.
|
||||||
|
|
||||||
int collision = -1; // no collision
|
int collision = -1; // no collision
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&
|
if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&
|
||||||
(qualifier.isPipeInput() || qualifier.isPipeOutput())) {
|
(qualifier.isPipeInput() || qualifier.isPipeOutput())) {
|
||||||
// Dealing with dvec3 in/out split across two locations.
|
// Dealing with dvec3 in/out split across two locations.
|
||||||
@ -1092,7 +1081,9 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||||||
if (collision < 0)
|
if (collision < 0)
|
||||||
usedIo[set].push_back(range2);
|
usedIo[set].push_back(range2);
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
// Not a dvec3 in/out split across two locations, generic path.
|
// Not a dvec3 in/out split across two locations, generic path.
|
||||||
// Need a single IO-range block.
|
// Need a single IO-range block.
|
||||||
|
|
||||||
@ -1106,10 +1097,10 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||||||
}
|
}
|
||||||
|
|
||||||
// combine location and component ranges
|
// combine location and component ranges
|
||||||
TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.layoutIndex : 0);
|
TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.getIndex() : 0);
|
||||||
|
|
||||||
// check for collisions, except for vertex inputs on desktop targeting OpenGL
|
// check for collisions, except for vertex inputs on desktop targeting OpenGL
|
||||||
if (! (profile != EEsProfile && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
|
if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
|
||||||
collision = checkLocationRange(set, range, type, typeCollision);
|
collision = checkLocationRange(set, range, type, typeCollision);
|
||||||
|
|
||||||
if (collision < 0)
|
if (collision < 0)
|
||||||
@ -1187,14 +1178,10 @@ int TIntermediate::computeTypeLocationSize(const TType& type, EShLanguage stage)
|
|||||||
// TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness
|
// TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness
|
||||||
// TODO: are there valid cases of having an unsized array with a location? If so, running this code too early.
|
// TODO: are there valid cases of having an unsized array with a location? If so, running this code too early.
|
||||||
TType elementType(type, 0);
|
TType elementType(type, 0);
|
||||||
if (type.isSizedArray()
|
if (type.isSizedArray() && !type.getQualifier().isPerView())
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
&& !type.getQualifier().isPerView()
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
return type.getOuterArraySize() * computeTypeLocationSize(elementType, stage);
|
return type.getOuterArraySize() * computeTypeLocationSize(elementType, stage);
|
||||||
else {
|
else {
|
||||||
#ifdef NV_EXTENSIONS
|
#ifndef GLSLANG_WEB
|
||||||
// unset perViewNV attributes for arrayed per-view outputs: "perviewNV vec4 v[MAX_VIEWS][3];"
|
// unset perViewNV attributes for arrayed per-view outputs: "perviewNV vec4 v[MAX_VIEWS][3];"
|
||||||
elementType.getQualifier().perViewNV = false;
|
elementType.getQualifier().perViewNV = false;
|
||||||
#endif
|
#endif
|
||||||
@ -1273,6 +1260,8 @@ int TIntermediate::computeTypeUniformLocationSize(const TType& type)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
// Accumulate xfb buffer ranges and check for collisions as the accumulation is done.
|
// Accumulate xfb buffer ranges and check for collisions as the accumulation is done.
|
||||||
//
|
//
|
||||||
// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
|
// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
|
||||||
@ -1285,11 +1274,7 @@ int TIntermediate::addXfbBufferOffset(const TType& type)
|
|||||||
TXfbBuffer& buffer = xfbBuffers[qualifier.layoutXfbBuffer];
|
TXfbBuffer& buffer = xfbBuffers[qualifier.layoutXfbBuffer];
|
||||||
|
|
||||||
// compute the range
|
// compute the range
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
unsigned int size = computeTypeXfbSize(type, buffer.contains64BitType, buffer.contains32BitType, buffer.contains16BitType);
|
unsigned int size = computeTypeXfbSize(type, buffer.contains64BitType, buffer.contains32BitType, buffer.contains16BitType);
|
||||||
#else
|
|
||||||
unsigned int size = computeTypeXfbSize(type, buffer.contains64BitType);
|
|
||||||
#endif
|
|
||||||
buffer.implicitStride = std::max(buffer.implicitStride, qualifier.layoutXfbOffset + size);
|
buffer.implicitStride = std::max(buffer.implicitStride, qualifier.layoutXfbOffset + size);
|
||||||
TRange range(qualifier.layoutXfbOffset, qualifier.layoutXfbOffset + size - 1);
|
TRange range(qualifier.layoutXfbOffset, qualifier.layoutXfbOffset + size - 1);
|
||||||
|
|
||||||
@ -1309,15 +1294,10 @@ int TIntermediate::addXfbBufferOffset(const TType& type)
|
|||||||
// Recursively figure out how many bytes of xfb buffer are used by the given type.
|
// Recursively figure out how many bytes of xfb buffer are used by the given type.
|
||||||
// Return the size of type, in bytes.
|
// Return the size of type, in bytes.
|
||||||
// Sets contains64BitType to true if the type contains a 64-bit data type.
|
// Sets contains64BitType to true if the type contains a 64-bit data type.
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
// Sets contains32BitType to true if the type contains a 32-bit data type.
|
// Sets contains32BitType to true if the type contains a 32-bit data type.
|
||||||
// Sets contains16BitType to true if the type contains a 16-bit data type.
|
// Sets contains16BitType to true if the type contains a 16-bit data type.
|
||||||
// N.B. Caller must set contains64BitType, contains32BitType, and contains16BitType to false before calling.
|
// N.B. Caller must set contains64BitType, contains32BitType, and contains16BitType to false before calling.
|
||||||
unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains64BitType, bool& contains32BitType, bool& contains16BitType) const
|
unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains64BitType, bool& contains32BitType, bool& contains16BitType) const
|
||||||
#else
|
|
||||||
// N.B. Caller must set contains64BitType to false before calling.
|
|
||||||
unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains64BitType) const
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
// "...if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8,
|
// "...if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8,
|
||||||
// and the space taken in the buffer will be a multiple of 8.
|
// and the space taken in the buffer will be a multiple of 8.
|
||||||
@ -1330,44 +1310,32 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
|
|||||||
// TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness
|
// TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness
|
||||||
assert(type.isSizedArray());
|
assert(type.isSizedArray());
|
||||||
TType elementType(type, 0);
|
TType elementType(type, 0);
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
return type.getOuterArraySize() * computeTypeXfbSize(elementType, contains64BitType, contains16BitType, contains16BitType);
|
return type.getOuterArraySize() * computeTypeXfbSize(elementType, contains64BitType, contains16BitType, contains16BitType);
|
||||||
#else
|
|
||||||
return type.getOuterArraySize() * computeTypeXfbSize(elementType, contains64BitType);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.isStruct()) {
|
if (type.isStruct()) {
|
||||||
unsigned int size = 0;
|
unsigned int size = 0;
|
||||||
bool structContains64BitType = false;
|
bool structContains64BitType = false;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
bool structContains32BitType = false;
|
bool structContains32BitType = false;
|
||||||
bool structContains16BitType = false;
|
bool structContains16BitType = false;
|
||||||
#endif
|
|
||||||
for (int member = 0; member < (int)type.getStruct()->size(); ++member) {
|
for (int member = 0; member < (int)type.getStruct()->size(); ++member) {
|
||||||
TType memberType(type, member);
|
TType memberType(type, member);
|
||||||
// "... if applied to
|
// "... if applied to
|
||||||
// an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8,
|
// an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8,
|
||||||
// and the space taken in the buffer will be a multiple of 8."
|
// and the space taken in the buffer will be a multiple of 8."
|
||||||
bool memberContains64BitType = false;
|
bool memberContains64BitType = false;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
bool memberContains32BitType = false;
|
bool memberContains32BitType = false;
|
||||||
bool memberContains16BitType = false;
|
bool memberContains16BitType = false;
|
||||||
int memberSize = computeTypeXfbSize(memberType, memberContains64BitType, memberContains32BitType, memberContains16BitType);
|
int memberSize = computeTypeXfbSize(memberType, memberContains64BitType, memberContains32BitType, memberContains16BitType);
|
||||||
#else
|
|
||||||
int memberSize = computeTypeXfbSize(memberType, memberContains64BitType);
|
|
||||||
#endif
|
|
||||||
if (memberContains64BitType) {
|
if (memberContains64BitType) {
|
||||||
structContains64BitType = true;
|
structContains64BitType = true;
|
||||||
RoundToPow2(size, 8);
|
RoundToPow2(size, 8);
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if (memberContains32BitType) {
|
} else if (memberContains32BitType) {
|
||||||
structContains32BitType = true;
|
structContains32BitType = true;
|
||||||
RoundToPow2(size, 4);
|
RoundToPow2(size, 4);
|
||||||
} else if (memberContains16BitType) {
|
} else if (memberContains16BitType) {
|
||||||
structContains16BitType = true;
|
structContains16BitType = true;
|
||||||
RoundToPow2(size, 2);
|
RoundToPow2(size, 2);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
size += memberSize;
|
size += memberSize;
|
||||||
}
|
}
|
||||||
@ -1375,14 +1343,12 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
|
|||||||
if (structContains64BitType) {
|
if (structContains64BitType) {
|
||||||
contains64BitType = true;
|
contains64BitType = true;
|
||||||
RoundToPow2(size, 8);
|
RoundToPow2(size, 8);
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if (structContains32BitType) {
|
} else if (structContains32BitType) {
|
||||||
contains32BitType = true;
|
contains32BitType = true;
|
||||||
RoundToPow2(size, 4);
|
RoundToPow2(size, 4);
|
||||||
} else if (structContains16BitType) {
|
} else if (structContains16BitType) {
|
||||||
contains16BitType = true;
|
contains16BitType = true;
|
||||||
RoundToPow2(size, 2);
|
RoundToPow2(size, 2);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
@ -1402,7 +1368,6 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
|
|||||||
if (type.getBasicType() == EbtDouble || type.getBasicType() == EbtInt64 || type.getBasicType() == EbtUint64) {
|
if (type.getBasicType() == EbtDouble || type.getBasicType() == EbtInt64 || type.getBasicType() == EbtUint64) {
|
||||||
contains64BitType = true;
|
contains64BitType = true;
|
||||||
return 8 * numComponents;
|
return 8 * numComponents;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if (type.getBasicType() == EbtFloat16 || type.getBasicType() == EbtInt16 || type.getBasicType() == EbtUint16) {
|
} else if (type.getBasicType() == EbtFloat16 || type.getBasicType() == EbtInt16 || type.getBasicType() == EbtUint16) {
|
||||||
contains16BitType = true;
|
contains16BitType = true;
|
||||||
return 2 * numComponents;
|
return 2 * numComponents;
|
||||||
@ -1412,12 +1377,10 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
|
|||||||
contains32BitType = true;
|
contains32BitType = true;
|
||||||
return 4 * numComponents;
|
return 4 * numComponents;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
} else
|
|
||||||
return 4 * numComponents;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
const int baseAlignmentVec4Std140 = 16;
|
const int baseAlignmentVec4Std140 = 16;
|
||||||
|
|
||||||
// Return the size and alignment of a component of the given type.
|
// Return the size and alignment of a component of the given type.
|
||||||
@ -1425,6 +1388,10 @@ const int baseAlignmentVec4Std140 = 16;
|
|||||||
// Return value is the alignment..
|
// Return value is the alignment..
|
||||||
int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
||||||
{
|
{
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
size = 4; return 4;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (type.getBasicType()) {
|
switch (type.getBasicType()) {
|
||||||
case EbtInt64:
|
case EbtInt64:
|
||||||
case EbtUint64:
|
case EbtUint64:
|
||||||
@ -1741,7 +1708,7 @@ int TIntermediate::getBlockSize(const TType& blockType)
|
|||||||
|
|
||||||
int TIntermediate::computeBufferReferenceTypeSize(const TType& type)
|
int TIntermediate::computeBufferReferenceTypeSize(const TType& type)
|
||||||
{
|
{
|
||||||
assert(type.getBasicType() == EbtReference);
|
assert(type.isReference());
|
||||||
int size = getBlockSize(*type.getReferentType());
|
int size = getBlockSize(*type.getReferentType());
|
||||||
|
|
||||||
int align = type.getBufferReferenceAlignment();
|
int align = type.getBufferReferenceAlignment();
|
||||||
|
@ -147,23 +147,19 @@ struct TOffsetRange {
|
|||||||
TRange offset;
|
TRange offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// Things that need to be tracked per xfb buffer.
|
// Things that need to be tracked per xfb buffer.
|
||||||
struct TXfbBuffer {
|
struct TXfbBuffer {
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false),
|
TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false),
|
||||||
contains32BitType(false), contains16BitType(false) { }
|
contains32BitType(false), contains16BitType(false) { }
|
||||||
#else
|
|
||||||
TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false) { }
|
|
||||||
#endif
|
|
||||||
std::vector<TRange> ranges; // byte offsets that have already been assigned
|
std::vector<TRange> ranges; // byte offsets that have already been assigned
|
||||||
unsigned int stride;
|
unsigned int stride;
|
||||||
unsigned int implicitStride;
|
unsigned int implicitStride;
|
||||||
bool contains64BitType;
|
bool contains64BitType;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
bool contains32BitType;
|
bool contains32BitType;
|
||||||
bool contains16BitType;
|
bool contains16BitType;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
// Track a set of strings describing how the module was processed.
|
// Track a set of strings describing how the module was processed.
|
||||||
// Using the form:
|
// Using the form:
|
||||||
@ -217,7 +213,6 @@ class TSymbolTable;
|
|||||||
class TSymbol;
|
class TSymbol;
|
||||||
class TVariable;
|
class TVariable;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
//
|
//
|
||||||
// Texture and Sampler transformation mode.
|
// Texture and Sampler transformation mode.
|
||||||
//
|
//
|
||||||
@ -226,7 +221,6 @@ enum ComputeDerivativeMode {
|
|||||||
LayoutDerivativeGroupQuads, // derivative_group_quadsNV
|
LayoutDerivativeGroupQuads, // derivative_group_quadsNV
|
||||||
LayoutDerivativeGroupLinear, // derivative_group_linearNV
|
LayoutDerivativeGroupLinear, // derivative_group_linearNV
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set of helper functions to help parse and build the tree.
|
// Set of helper functions to help parse and build the tree.
|
||||||
@ -234,32 +228,36 @@ enum ComputeDerivativeMode {
|
|||||||
class TIntermediate {
|
class TIntermediate {
|
||||||
public:
|
public:
|
||||||
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) :
|
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) :
|
||||||
implicitThisName("@this"), implicitCounterName("@count"),
|
language(l),
|
||||||
language(l), source(EShSourceNone), profile(p), version(v), treeRoot(0),
|
profile(p), version(v), treeRoot(0),
|
||||||
numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
|
numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
|
||||||
|
invertY(false),
|
||||||
|
useStorageBuffer(false),
|
||||||
|
nanMinMaxClamp(false),
|
||||||
|
depthReplacing(false)
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
,
|
||||||
|
implicitThisName("@this"), implicitCounterName("@count"),
|
||||||
|
source(EShSourceNone),
|
||||||
|
useVulkanMemoryModel(false),
|
||||||
invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet),
|
invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet),
|
||||||
inputPrimitive(ElgNone), outputPrimitive(ElgNone),
|
inputPrimitive(ElgNone), outputPrimitive(ElgNone),
|
||||||
pixelCenterInteger(false), originUpperLeft(false),
|
pixelCenterInteger(false), originUpperLeft(false),
|
||||||
vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false),
|
vertexSpacing(EvsNone), vertexOrder(EvoNone), interlockOrdering(EioNone), pointMode(false), earlyFragmentTests(false),
|
||||||
postDepthCoverage(false), depthLayout(EldNone), depthReplacing(false),
|
postDepthCoverage(false), depthLayout(EldNone),
|
||||||
hlslFunctionality1(false),
|
hlslFunctionality1(false),
|
||||||
blendEquations(0), xfbMode(false), multiStream(false),
|
blendEquations(0), xfbMode(false), multiStream(false),
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
layoutOverrideCoverage(false),
|
layoutOverrideCoverage(false),
|
||||||
geoPassthroughEXT(false),
|
geoPassthroughEXT(false),
|
||||||
numShaderRecordNVBlocks(0),
|
numShaderRecordNVBlocks(0),
|
||||||
computeDerivativeMode(LayoutDerivativeNone),
|
computeDerivativeMode(LayoutDerivativeNone),
|
||||||
primitives(TQualifier::layoutNotSet),
|
primitives(TQualifier::layoutNotSet),
|
||||||
numTaskNVBlocks(0),
|
numTaskNVBlocks(0),
|
||||||
#endif
|
|
||||||
autoMapBindings(false),
|
autoMapBindings(false),
|
||||||
autoMapLocations(false),
|
autoMapLocations(false),
|
||||||
invertY(false),
|
|
||||||
flattenUniformArrays(false),
|
flattenUniformArrays(false),
|
||||||
useUnknownFormat(false),
|
useUnknownFormat(false),
|
||||||
hlslOffsets(false),
|
hlslOffsets(false),
|
||||||
useStorageBuffer(false),
|
|
||||||
useVulkanMemoryModel(false),
|
|
||||||
hlslIoMapping(false),
|
hlslIoMapping(false),
|
||||||
useVariablePointers(false),
|
useVariablePointers(false),
|
||||||
textureSamplerTransformMode(EShTexSampTransKeep),
|
textureSamplerTransformMode(EShTexSampTransKeep),
|
||||||
@ -267,160 +265,22 @@ public:
|
|||||||
binaryDoubleOutput(false),
|
binaryDoubleOutput(false),
|
||||||
usePhysicalStorageBuffer(false),
|
usePhysicalStorageBuffer(false),
|
||||||
uniformLocationBase(0)
|
uniformLocationBase(0)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
localSize[0] = 1;
|
localSize[0] = 1;
|
||||||
localSize[1] = 1;
|
localSize[1] = 1;
|
||||||
localSize[2] = 1;
|
localSize[2] = 1;
|
||||||
|
localSizeNotDefault[0] = false;
|
||||||
|
localSizeNotDefault[1] = false;
|
||||||
|
localSizeNotDefault[2] = false;
|
||||||
localSizeSpecId[0] = TQualifier::layoutNotSet;
|
localSizeSpecId[0] = TQualifier::layoutNotSet;
|
||||||
localSizeSpecId[1] = TQualifier::layoutNotSet;
|
localSizeSpecId[1] = TQualifier::layoutNotSet;
|
||||||
localSizeSpecId[2] = TQualifier::layoutNotSet;
|
localSizeSpecId[2] = TQualifier::layoutNotSet;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
|
xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
|
||||||
|
|
||||||
shiftBinding.fill(0);
|
shiftBinding.fill(0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void setLimits(const TBuiltInResource& r) { resources = r; }
|
|
||||||
|
|
||||||
bool postProcess(TIntermNode*, EShLanguage);
|
|
||||||
void output(TInfoSink&, bool tree);
|
|
||||||
void removeTree();
|
|
||||||
|
|
||||||
void setSource(EShSource s) { source = s; }
|
|
||||||
EShSource getSource() const { return source; }
|
|
||||||
void setEntryPointName(const char* ep)
|
|
||||||
{
|
|
||||||
entryPointName = ep;
|
|
||||||
processes.addProcess("entry-point");
|
|
||||||
processes.addArgument(entryPointName);
|
|
||||||
}
|
|
||||||
void setEntryPointMangledName(const char* ep) { entryPointMangledName = ep; }
|
|
||||||
const std::string& getEntryPointName() const { return entryPointName; }
|
|
||||||
const std::string& getEntryPointMangledName() const { return entryPointMangledName; }
|
|
||||||
|
|
||||||
void setShiftBinding(TResourceType res, unsigned int shift)
|
|
||||||
{
|
|
||||||
shiftBinding[res] = shift;
|
|
||||||
|
|
||||||
const char* name = getResourceName(res);
|
|
||||||
if (name != nullptr)
|
|
||||||
processes.addIfNonZero(name, shift);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int getShiftBinding(TResourceType res) const { return shiftBinding[res]; }
|
|
||||||
|
|
||||||
void setShiftBindingForSet(TResourceType res, unsigned int shift, unsigned int set)
|
|
||||||
{
|
|
||||||
if (shift == 0) // ignore if there's no shift: it's a no-op.
|
|
||||||
return;
|
|
||||||
|
|
||||||
shiftBindingForSet[res][set] = shift;
|
|
||||||
|
|
||||||
const char* name = getResourceName(res);
|
|
||||||
if (name != nullptr) {
|
|
||||||
processes.addProcess(name);
|
|
||||||
processes.addArgument(shift);
|
|
||||||
processes.addArgument(set);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int getShiftBindingForSet(TResourceType res, unsigned int set) const
|
|
||||||
{
|
|
||||||
const auto shift = shiftBindingForSet[res].find(set);
|
|
||||||
return shift == shiftBindingForSet[res].end() ? -1 : shift->second;
|
|
||||||
}
|
|
||||||
bool hasShiftBindingForSet(TResourceType res) const { return !shiftBindingForSet[res].empty(); }
|
|
||||||
|
|
||||||
void setResourceSetBinding(const std::vector<std::string>& shift)
|
|
||||||
{
|
|
||||||
resourceSetBinding = shift;
|
|
||||||
if (shift.size() > 0) {
|
|
||||||
processes.addProcess("resource-set-binding");
|
|
||||||
for (int s = 0; s < (int)shift.size(); ++s)
|
|
||||||
processes.addArgument(shift[s]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const std::vector<std::string>& getResourceSetBinding() const { return resourceSetBinding; }
|
|
||||||
void setAutoMapBindings(bool map)
|
|
||||||
{
|
|
||||||
autoMapBindings = map;
|
|
||||||
if (autoMapBindings)
|
|
||||||
processes.addProcess("auto-map-bindings");
|
|
||||||
}
|
|
||||||
bool getAutoMapBindings() const { return autoMapBindings; }
|
|
||||||
void setAutoMapLocations(bool map)
|
|
||||||
{
|
|
||||||
autoMapLocations = map;
|
|
||||||
if (autoMapLocations)
|
|
||||||
processes.addProcess("auto-map-locations");
|
|
||||||
}
|
|
||||||
bool getAutoMapLocations() const { return autoMapLocations; }
|
|
||||||
void setInvertY(bool invert)
|
|
||||||
{
|
|
||||||
invertY = invert;
|
|
||||||
if (invertY)
|
|
||||||
processes.addProcess("invert-y");
|
|
||||||
}
|
|
||||||
bool getInvertY() const { return invertY; }
|
|
||||||
|
|
||||||
void setFlattenUniformArrays(bool flatten)
|
|
||||||
{
|
|
||||||
flattenUniformArrays = flatten;
|
|
||||||
if (flattenUniformArrays)
|
|
||||||
processes.addProcess("flatten-uniform-arrays");
|
|
||||||
}
|
|
||||||
bool getFlattenUniformArrays() const { return flattenUniformArrays; }
|
|
||||||
void setNoStorageFormat(bool b)
|
|
||||||
{
|
|
||||||
useUnknownFormat = b;
|
|
||||||
if (useUnknownFormat)
|
|
||||||
processes.addProcess("no-storage-format");
|
|
||||||
}
|
|
||||||
bool getNoStorageFormat() const { return useUnknownFormat; }
|
|
||||||
void setHlslOffsets()
|
|
||||||
{
|
|
||||||
hlslOffsets = true;
|
|
||||||
if (hlslOffsets)
|
|
||||||
processes.addProcess("hlsl-offsets");
|
|
||||||
}
|
|
||||||
bool usingHlslOffsets() const { return hlslOffsets; }
|
|
||||||
void setUseStorageBuffer()
|
|
||||||
{
|
|
||||||
useStorageBuffer = true;
|
|
||||||
processes.addProcess("use-storage-buffer");
|
|
||||||
}
|
|
||||||
bool usingStorageBuffer() const { return useStorageBuffer; }
|
|
||||||
void setHlslIoMapping(bool b)
|
|
||||||
{
|
|
||||||
hlslIoMapping = b;
|
|
||||||
if (hlslIoMapping)
|
|
||||||
processes.addProcess("hlsl-iomap");
|
|
||||||
}
|
|
||||||
bool usingHlslIoMapping() { return hlslIoMapping; }
|
|
||||||
void setUseVulkanMemoryModel()
|
|
||||||
{
|
|
||||||
useVulkanMemoryModel = true;
|
|
||||||
processes.addProcess("use-vulkan-memory-model");
|
|
||||||
}
|
|
||||||
bool usingVulkanMemoryModel() const { return useVulkanMemoryModel; }
|
|
||||||
void setUsePhysicalStorageBuffer()
|
|
||||||
{
|
|
||||||
usePhysicalStorageBuffer = true;
|
|
||||||
}
|
|
||||||
bool usingPhysicalStorageBuffer() const { return usePhysicalStorageBuffer; }
|
|
||||||
void setUseVariablePointers()
|
|
||||||
{
|
|
||||||
useVariablePointers = true;
|
|
||||||
processes.addProcess("use-variable-pointers");
|
|
||||||
}
|
|
||||||
bool usingVariablePointers() const { return useVariablePointers; }
|
|
||||||
|
|
||||||
template<class T> T addCounterBufferName(const T& name) const { return name + implicitCounterName; }
|
|
||||||
bool hasCounterBufferName(const TString& name) const {
|
|
||||||
size_t len = strlen(implicitCounterName);
|
|
||||||
return name.size() > len &&
|
|
||||||
name.compare(name.size() - len, len, implicitCounterName) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; }
|
|
||||||
|
|
||||||
void setVersion(int v) { version = v; }
|
void setVersion(int v) { version = v; }
|
||||||
int getVersion() const { return version; }
|
int getVersion() const { return version; }
|
||||||
@ -451,6 +311,12 @@ public:
|
|||||||
case EShTargetSpv_1_3:
|
case EShTargetSpv_1_3:
|
||||||
processes.addProcess("target-env spirv1.3");
|
processes.addProcess("target-env spirv1.3");
|
||||||
break;
|
break;
|
||||||
|
case EShTargetSpv_1_4:
|
||||||
|
processes.addProcess("target-env spirv1.4");
|
||||||
|
break;
|
||||||
|
case EShTargetSpv_1_5:
|
||||||
|
processes.addProcess("target-env spirv1.5");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
processes.addProcess("target-env spirvUnknown");
|
processes.addProcess("target-env spirvUnknown");
|
||||||
break;
|
break;
|
||||||
@ -466,6 +332,9 @@ public:
|
|||||||
case EShTargetVulkan_1_1:
|
case EShTargetVulkan_1_1:
|
||||||
processes.addProcess("target-env vulkan1.1");
|
processes.addProcess("target-env vulkan1.1");
|
||||||
break;
|
break;
|
||||||
|
case EShTargetVulkan_1_2:
|
||||||
|
processes.addProcess("target-env vulkan1.2");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
processes.addProcess("target-env vulkanUnknown");
|
processes.addProcess("target-env vulkanUnknown");
|
||||||
break;
|
break;
|
||||||
@ -484,9 +353,35 @@ public:
|
|||||||
int getNumEntryPoints() const { return numEntryPoints; }
|
int getNumEntryPoints() const { return numEntryPoints; }
|
||||||
int getNumErrors() const { return numErrors; }
|
int getNumErrors() const { return numErrors; }
|
||||||
void addPushConstantCount() { ++numPushConstants; }
|
void addPushConstantCount() { ++numPushConstants; }
|
||||||
#ifdef NV_EXTENSIONS
|
void setLimits(const TBuiltInResource& r) { resources = r; }
|
||||||
void addShaderRecordNVCount() { ++numShaderRecordNVBlocks; }
|
|
||||||
void addTaskNVCount() { ++numTaskNVBlocks; }
|
bool postProcess(TIntermNode*, EShLanguage);
|
||||||
|
void removeTree();
|
||||||
|
|
||||||
|
void setEntryPointName(const char* ep)
|
||||||
|
{
|
||||||
|
entryPointName = ep;
|
||||||
|
processes.addProcess("entry-point");
|
||||||
|
processes.addArgument(entryPointName);
|
||||||
|
}
|
||||||
|
void setEntryPointMangledName(const char* ep) { entryPointMangledName = ep; }
|
||||||
|
const std::string& getEntryPointName() const { return entryPointName; }
|
||||||
|
const std::string& getEntryPointMangledName() const { return entryPointMangledName; }
|
||||||
|
|
||||||
|
void setInvertY(bool invert)
|
||||||
|
{
|
||||||
|
invertY = invert;
|
||||||
|
if (invertY)
|
||||||
|
processes.addProcess("invert-y");
|
||||||
|
}
|
||||||
|
bool getInvertY() const { return invertY; }
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
|
void setSource(EShSource s) { source = s; }
|
||||||
|
EShSource getSource() const { return source; }
|
||||||
|
#else
|
||||||
|
void setSource(EShSource s) { assert(s == EShSourceGlsl); }
|
||||||
|
EShSource getSource() const { return EShSourceGlsl; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool isRecursive() const { return recursive; }
|
bool isRecursive() const { return recursive; }
|
||||||
@ -565,6 +460,169 @@ public:
|
|||||||
void addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguage, TSymbolTable&);
|
void addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguage, TSymbolTable&);
|
||||||
void addSymbolLinkageNode(TIntermAggregate*& linkage, const TSymbol&);
|
void addSymbolLinkageNode(TIntermAggregate*& linkage, const TSymbol&);
|
||||||
|
|
||||||
|
void setUseStorageBuffer()
|
||||||
|
{
|
||||||
|
useStorageBuffer = true;
|
||||||
|
processes.addProcess("use-storage-buffer");
|
||||||
|
}
|
||||||
|
bool usingStorageBuffer() const { return useStorageBuffer; }
|
||||||
|
void setDepthReplacing() { depthReplacing = true; }
|
||||||
|
bool isDepthReplacing() const { return depthReplacing; }
|
||||||
|
bool setLocalSize(int dim, int size)
|
||||||
|
{
|
||||||
|
if (localSizeNotDefault[dim])
|
||||||
|
return size == localSize[dim];
|
||||||
|
localSizeNotDefault[dim] = true;
|
||||||
|
localSize[dim] = size;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
unsigned int getLocalSize(int dim) const { return localSize[dim]; }
|
||||||
|
bool setLocalSizeSpecId(int dim, int id)
|
||||||
|
{
|
||||||
|
if (localSizeSpecId[dim] != TQualifier::layoutNotSet)
|
||||||
|
return id == localSizeSpecId[dim];
|
||||||
|
localSizeSpecId[dim] = id;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; }
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
void output(TInfoSink&, bool tree) { }
|
||||||
|
|
||||||
|
bool isEsProfile() const { return false; }
|
||||||
|
bool getXfbMode() const { return false; }
|
||||||
|
bool isMultiStream() const { return false; }
|
||||||
|
TLayoutGeometry getOutputPrimitive() const { return ElgNone; }
|
||||||
|
bool getPostDepthCoverage() const { return false; }
|
||||||
|
bool getEarlyFragmentTests() const { return false; }
|
||||||
|
TLayoutDepth getDepth() const { return EldNone; }
|
||||||
|
bool getPixelCenterInteger() const { return false; }
|
||||||
|
void setOriginUpperLeft() { }
|
||||||
|
bool getOriginUpperLeft() const { return true; }
|
||||||
|
TInterlockOrdering getInterlockOrdering() const { return EioNone; }
|
||||||
|
|
||||||
|
bool getAutoMapBindings() const { return false; }
|
||||||
|
bool getAutoMapLocations() const { return false; }
|
||||||
|
int getNumPushConstants() const { return 0; }
|
||||||
|
void addShaderRecordNVCount() { }
|
||||||
|
void addTaskNVCount() { }
|
||||||
|
void setUseVulkanMemoryModel() { }
|
||||||
|
bool usingVulkanMemoryModel() const { return false; }
|
||||||
|
bool usingPhysicalStorageBuffer() const { return false; }
|
||||||
|
bool usingVariablePointers() const { return false; }
|
||||||
|
unsigned getXfbStride(int buffer) const { return 0; }
|
||||||
|
bool hasLayoutDerivativeModeNone() const { return false; }
|
||||||
|
ComputeDerivativeMode getLayoutDerivativeModeNone() const { return LayoutDerivativeNone; }
|
||||||
|
#else
|
||||||
|
void output(TInfoSink&, bool tree);
|
||||||
|
|
||||||
|
bool isEsProfile() const { return profile == EEsProfile; }
|
||||||
|
|
||||||
|
void setShiftBinding(TResourceType res, unsigned int shift)
|
||||||
|
{
|
||||||
|
shiftBinding[res] = shift;
|
||||||
|
|
||||||
|
const char* name = getResourceName(res);
|
||||||
|
if (name != nullptr)
|
||||||
|
processes.addIfNonZero(name, shift);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int getShiftBinding(TResourceType res) const { return shiftBinding[res]; }
|
||||||
|
|
||||||
|
void setShiftBindingForSet(TResourceType res, unsigned int shift, unsigned int set)
|
||||||
|
{
|
||||||
|
if (shift == 0) // ignore if there's no shift: it's a no-op.
|
||||||
|
return;
|
||||||
|
|
||||||
|
shiftBindingForSet[res][set] = shift;
|
||||||
|
|
||||||
|
const char* name = getResourceName(res);
|
||||||
|
if (name != nullptr) {
|
||||||
|
processes.addProcess(name);
|
||||||
|
processes.addArgument(shift);
|
||||||
|
processes.addArgument(set);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int getShiftBindingForSet(TResourceType res, unsigned int set) const
|
||||||
|
{
|
||||||
|
const auto shift = shiftBindingForSet[res].find(set);
|
||||||
|
return shift == shiftBindingForSet[res].end() ? -1 : shift->second;
|
||||||
|
}
|
||||||
|
bool hasShiftBindingForSet(TResourceType res) const { return !shiftBindingForSet[res].empty(); }
|
||||||
|
|
||||||
|
void setResourceSetBinding(const std::vector<std::string>& shift)
|
||||||
|
{
|
||||||
|
resourceSetBinding = shift;
|
||||||
|
if (shift.size() > 0) {
|
||||||
|
processes.addProcess("resource-set-binding");
|
||||||
|
for (int s = 0; s < (int)shift.size(); ++s)
|
||||||
|
processes.addArgument(shift[s]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const std::vector<std::string>& getResourceSetBinding() const { return resourceSetBinding; }
|
||||||
|
void setAutoMapBindings(bool map)
|
||||||
|
{
|
||||||
|
autoMapBindings = map;
|
||||||
|
if (autoMapBindings)
|
||||||
|
processes.addProcess("auto-map-bindings");
|
||||||
|
}
|
||||||
|
bool getAutoMapBindings() const { return autoMapBindings; }
|
||||||
|
void setAutoMapLocations(bool map)
|
||||||
|
{
|
||||||
|
autoMapLocations = map;
|
||||||
|
if (autoMapLocations)
|
||||||
|
processes.addProcess("auto-map-locations");
|
||||||
|
}
|
||||||
|
bool getAutoMapLocations() const { return autoMapLocations; }
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
|
void setFlattenUniformArrays(bool flatten)
|
||||||
|
{
|
||||||
|
flattenUniformArrays = flatten;
|
||||||
|
if (flattenUniformArrays)
|
||||||
|
processes.addProcess("flatten-uniform-arrays");
|
||||||
|
}
|
||||||
|
bool getFlattenUniformArrays() const { return flattenUniformArrays; }
|
||||||
|
#endif
|
||||||
|
void setNoStorageFormat(bool b)
|
||||||
|
{
|
||||||
|
useUnknownFormat = b;
|
||||||
|
if (useUnknownFormat)
|
||||||
|
processes.addProcess("no-storage-format");
|
||||||
|
}
|
||||||
|
bool getNoStorageFormat() const { return useUnknownFormat; }
|
||||||
|
void setUseVulkanMemoryModel()
|
||||||
|
{
|
||||||
|
useVulkanMemoryModel = true;
|
||||||
|
processes.addProcess("use-vulkan-memory-model");
|
||||||
|
}
|
||||||
|
bool usingVulkanMemoryModel() const { return useVulkanMemoryModel; }
|
||||||
|
void setUsePhysicalStorageBuffer()
|
||||||
|
{
|
||||||
|
usePhysicalStorageBuffer = true;
|
||||||
|
}
|
||||||
|
bool usingPhysicalStorageBuffer() const { return usePhysicalStorageBuffer; }
|
||||||
|
void setUseVariablePointers()
|
||||||
|
{
|
||||||
|
useVariablePointers = true;
|
||||||
|
processes.addProcess("use-variable-pointers");
|
||||||
|
}
|
||||||
|
bool usingVariablePointers() const { return useVariablePointers; }
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
|
template<class T> T addCounterBufferName(const T& name) const { return name + implicitCounterName; }
|
||||||
|
bool hasCounterBufferName(const TString& name) const {
|
||||||
|
size_t len = strlen(implicitCounterName);
|
||||||
|
return name.size() > len &&
|
||||||
|
name.compare(name.size() - len, len, implicitCounterName) == 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; }
|
||||||
|
int getNumPushConstants() const { return numPushConstants; }
|
||||||
|
void addShaderRecordNVCount() { ++numShaderRecordNVBlocks; }
|
||||||
|
void addTaskNVCount() { ++numTaskNVBlocks; }
|
||||||
|
|
||||||
bool setInvocations(int i)
|
bool setInvocations(int i)
|
||||||
{
|
{
|
||||||
if (invocations != TQualifier::layoutNotSet)
|
if (invocations != TQualifier::layoutNotSet)
|
||||||
@ -608,23 +666,14 @@ public:
|
|||||||
void setPointMode() { pointMode = true; }
|
void setPointMode() { pointMode = true; }
|
||||||
bool getPointMode() const { return pointMode; }
|
bool getPointMode() const { return pointMode; }
|
||||||
|
|
||||||
bool setLocalSize(int dim, int size)
|
bool setInterlockOrdering(TInterlockOrdering o)
|
||||||
{
|
{
|
||||||
if (localSize[dim] > 1)
|
if (interlockOrdering != EioNone)
|
||||||
return size == localSize[dim];
|
return interlockOrdering == o;
|
||||||
localSize[dim] = size;
|
interlockOrdering = o;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
unsigned int getLocalSize(int dim) const { return localSize[dim]; }
|
TInterlockOrdering getInterlockOrdering() const { return interlockOrdering; }
|
||||||
|
|
||||||
bool setLocalSizeSpecId(int dim, int id)
|
|
||||||
{
|
|
||||||
if (localSizeSpecId[dim] != TQualifier::layoutNotSet)
|
|
||||||
return id == localSizeSpecId[dim];
|
|
||||||
localSizeSpecId[dim] = id;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; }
|
|
||||||
|
|
||||||
void setXfbMode() { xfbMode = true; }
|
void setXfbMode() { xfbMode = true; }
|
||||||
bool getXfbMode() const { return xfbMode; }
|
bool getXfbMode() const { return xfbMode; }
|
||||||
@ -638,14 +687,10 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
TLayoutGeometry getOutputPrimitive() const { return outputPrimitive; }
|
TLayoutGeometry getOutputPrimitive() const { return outputPrimitive; }
|
||||||
void setOriginUpperLeft() { originUpperLeft = true; }
|
|
||||||
bool getOriginUpperLeft() const { return originUpperLeft; }
|
|
||||||
void setPixelCenterInteger() { pixelCenterInteger = true; }
|
|
||||||
bool getPixelCenterInteger() const { return pixelCenterInteger; }
|
|
||||||
void setEarlyFragmentTests() { earlyFragmentTests = true; }
|
|
||||||
bool getEarlyFragmentTests() const { return earlyFragmentTests; }
|
|
||||||
void setPostDepthCoverage() { postDepthCoverage = true; }
|
void setPostDepthCoverage() { postDepthCoverage = true; }
|
||||||
bool getPostDepthCoverage() const { return postDepthCoverage; }
|
bool getPostDepthCoverage() const { return postDepthCoverage; }
|
||||||
|
void setEarlyFragmentTests() { earlyFragmentTests = true; }
|
||||||
|
bool getEarlyFragmentTests() const { return earlyFragmentTests; }
|
||||||
bool setDepth(TLayoutDepth d)
|
bool setDepth(TLayoutDepth d)
|
||||||
{
|
{
|
||||||
if (depthLayout != EldNone)
|
if (depthLayout != EldNone)
|
||||||
@ -654,29 +699,12 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
TLayoutDepth getDepth() const { return depthLayout; }
|
TLayoutDepth getDepth() const { return depthLayout; }
|
||||||
void setDepthReplacing() { depthReplacing = true; }
|
void setOriginUpperLeft() { originUpperLeft = true; }
|
||||||
bool isDepthReplacing() const { return depthReplacing; }
|
bool getOriginUpperLeft() const { return originUpperLeft; }
|
||||||
|
void setPixelCenterInteger() { pixelCenterInteger = true; }
|
||||||
void setHlslFunctionality1() { hlslFunctionality1 = true; }
|
bool getPixelCenterInteger() const { return pixelCenterInteger; }
|
||||||
bool getHlslFunctionality1() const { return hlslFunctionality1; }
|
|
||||||
|
|
||||||
void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); }
|
void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); }
|
||||||
unsigned int getBlendEquations() const { return blendEquations; }
|
unsigned int getBlendEquations() const { return blendEquations; }
|
||||||
|
|
||||||
void addToCallGraph(TInfoSink&, const TString& caller, const TString& callee);
|
|
||||||
void merge(TInfoSink&, TIntermediate&);
|
|
||||||
void finalCheck(TInfoSink&, bool keepUncalled);
|
|
||||||
|
|
||||||
void addIoAccessed(const TString& name) { ioAccessed.insert(name); }
|
|
||||||
bool inIoAccessed(const TString& name) const { return ioAccessed.find(name) != ioAccessed.end(); }
|
|
||||||
|
|
||||||
int addUsedLocation(const TQualifier&, const TType&, bool& typeCollision);
|
|
||||||
int checkLocationRange(int set, const TIoRange& range, const TType&, bool& typeCollision);
|
|
||||||
int addUsedOffsets(int binding, int offset, int numOffsets);
|
|
||||||
bool addUsedConstantId(int id);
|
|
||||||
static int computeTypeLocationSize(const TType&, EShLanguage);
|
|
||||||
static int computeTypeUniformLocationSize(const TType&);
|
|
||||||
|
|
||||||
bool setXfbBufferStride(int buffer, unsigned stride)
|
bool setXfbBufferStride(int buffer, unsigned stride)
|
||||||
{
|
{
|
||||||
if (xfbBuffers[buffer].stride != TQualifier::layoutXfbStrideEnd)
|
if (xfbBuffers[buffer].stride != TQualifier::layoutXfbStrideEnd)
|
||||||
@ -686,28 +714,14 @@ public:
|
|||||||
}
|
}
|
||||||
unsigned getXfbStride(int buffer) const { return xfbBuffers[buffer].stride; }
|
unsigned getXfbStride(int buffer) const { return xfbBuffers[buffer].stride; }
|
||||||
int addXfbBufferOffset(const TType&);
|
int addXfbBufferOffset(const TType&);
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
unsigned int computeTypeXfbSize(const TType&, bool& contains64BitType, bool& contains32BitType, bool& contains16BitType) const;
|
unsigned int computeTypeXfbSize(const TType&, bool& contains64BitType, bool& contains32BitType, bool& contains16BitType) const;
|
||||||
#else
|
|
||||||
unsigned int computeTypeXfbSize(const TType&, bool& contains64BitType) const;
|
unsigned int computeTypeXfbSize(const TType&, bool& contains64BitType) const;
|
||||||
#endif
|
|
||||||
static int getBaseAlignmentScalar(const TType&, int& size);
|
|
||||||
static int getBaseAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor);
|
|
||||||
static int getScalarAlignment(const TType&, int& size, int& stride, bool rowMajor);
|
|
||||||
static int getMemberAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor);
|
|
||||||
static bool improperStraddle(const TType& type, int size, int offset);
|
|
||||||
static void updateOffset(const TType& parentType, const TType& memberType, int& offset, int& memberSize);
|
|
||||||
static int getOffset(const TType& type, int index);
|
|
||||||
static int getBlockSize(const TType& blockType);
|
|
||||||
static int computeBufferReferenceTypeSize(const TType&);
|
|
||||||
bool promote(TIntermOperator*);
|
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
void setLayoutOverrideCoverage() { layoutOverrideCoverage = true; }
|
void setLayoutOverrideCoverage() { layoutOverrideCoverage = true; }
|
||||||
bool getLayoutOverrideCoverage() const { return layoutOverrideCoverage; }
|
bool getLayoutOverrideCoverage() const { return layoutOverrideCoverage; }
|
||||||
void setGeoPassthroughEXT() { geoPassthroughEXT = true; }
|
void setGeoPassthroughEXT() { geoPassthroughEXT = true; }
|
||||||
bool getGeoPassthroughEXT() const { return geoPassthroughEXT; }
|
bool getGeoPassthroughEXT() const { return geoPassthroughEXT; }
|
||||||
void setLayoutDerivativeMode(ComputeDerivativeMode mode) { computeDerivativeMode = mode; }
|
void setLayoutDerivativeMode(ComputeDerivativeMode mode) { computeDerivativeMode = mode; }
|
||||||
|
bool hasLayoutDerivativeModeNone() const { return computeDerivativeMode != LayoutDerivativeNone; }
|
||||||
ComputeDerivativeMode getLayoutDerivativeModeNone() const { return computeDerivativeMode; }
|
ComputeDerivativeMode getLayoutDerivativeModeNone() const { return computeDerivativeMode; }
|
||||||
bool setPrimitives(int m)
|
bool setPrimitives(int m)
|
||||||
{
|
{
|
||||||
@ -717,28 +731,10 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int getPrimitives() const { return primitives; }
|
int getPrimitives() const { return primitives; }
|
||||||
#endif
|
|
||||||
|
|
||||||
const char* addSemanticName(const TString& name)
|
const char* addSemanticName(const TString& name)
|
||||||
{
|
{
|
||||||
return semanticNameSet.insert(name).first->c_str();
|
return semanticNameSet.insert(name).first->c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; }
|
|
||||||
const std::string& getSourceFile() const { return sourceFile; }
|
|
||||||
void addSourceText(const char* text, size_t len) { sourceText.append(text, len); }
|
|
||||||
const std::string& getSourceText() const { return sourceText; }
|
|
||||||
const std::map<std::string, std::string>& getIncludeText() const { return includeText; }
|
|
||||||
void addIncludeText(const char* name, const char* text, size_t len) { includeText[name].assign(text,len); }
|
|
||||||
void addProcesses(const std::vector<std::string>& p)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < (int)p.size(); ++i)
|
|
||||||
processes.addProcess(p[i]);
|
|
||||||
}
|
|
||||||
void addProcess(const std::string& process) { processes.addProcess(process); }
|
|
||||||
void addProcessArgument(const std::string& arg) { processes.addArgument(arg); }
|
|
||||||
const std::vector<std::string>& getProcesses() const { return processes.getProcesses(); }
|
|
||||||
|
|
||||||
void addUniformLocationOverride(const char* nameStr, int location)
|
void addUniformLocationOverride(const char* nameStr, int location)
|
||||||
{
|
{
|
||||||
std::string name = nameStr;
|
std::string name = nameStr;
|
||||||
@ -763,9 +759,98 @@ public:
|
|||||||
|
|
||||||
void setBinaryDoubleOutput() { binaryDoubleOutput = true; }
|
void setBinaryDoubleOutput() { binaryDoubleOutput = true; }
|
||||||
bool getBinaryDoubleOutput() { return binaryDoubleOutput; }
|
bool getBinaryDoubleOutput() { return binaryDoubleOutput; }
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
|
|
||||||
const char* const implicitThisName;
|
#ifdef ENABLE_HLSL
|
||||||
const char* const implicitCounterName;
|
void setHlslFunctionality1() { hlslFunctionality1 = true; }
|
||||||
|
bool getHlslFunctionality1() const { return hlslFunctionality1; }
|
||||||
|
void setHlslOffsets()
|
||||||
|
{
|
||||||
|
hlslOffsets = true;
|
||||||
|
if (hlslOffsets)
|
||||||
|
processes.addProcess("hlsl-offsets");
|
||||||
|
}
|
||||||
|
bool usingHlslOffsets() const { return hlslOffsets; }
|
||||||
|
void setHlslIoMapping(bool b)
|
||||||
|
{
|
||||||
|
hlslIoMapping = b;
|
||||||
|
if (hlslIoMapping)
|
||||||
|
processes.addProcess("hlsl-iomap");
|
||||||
|
}
|
||||||
|
bool usingHlslIoMapping() { return hlslIoMapping; }
|
||||||
|
#else
|
||||||
|
bool getHlslFunctionality1() const { return false; }
|
||||||
|
bool usingHlslOffsets() const { return false; }
|
||||||
|
bool usingHlslIoMapping() { return false; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void addToCallGraph(TInfoSink&, const TString& caller, const TString& callee);
|
||||||
|
void merge(TInfoSink&, TIntermediate&);
|
||||||
|
void finalCheck(TInfoSink&, bool keepUncalled);
|
||||||
|
|
||||||
|
bool buildConvertOp(TBasicType dst, TBasicType src, TOperator& convertOp) const;
|
||||||
|
TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const;
|
||||||
|
|
||||||
|
void addIoAccessed(const TString& name) { ioAccessed.insert(name); }
|
||||||
|
bool inIoAccessed(const TString& name) const { return ioAccessed.find(name) != ioAccessed.end(); }
|
||||||
|
|
||||||
|
int addUsedLocation(const TQualifier&, const TType&, bool& typeCollision);
|
||||||
|
int checkLocationRange(int set, const TIoRange& range, const TType&, bool& typeCollision);
|
||||||
|
int addUsedOffsets(int binding, int offset, int numOffsets);
|
||||||
|
bool addUsedConstantId(int id);
|
||||||
|
static int computeTypeLocationSize(const TType&, EShLanguage);
|
||||||
|
static int computeTypeUniformLocationSize(const TType&);
|
||||||
|
|
||||||
|
static int getBaseAlignmentScalar(const TType&, int& size);
|
||||||
|
static int getBaseAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor);
|
||||||
|
static int getScalarAlignment(const TType&, int& size, int& stride, bool rowMajor);
|
||||||
|
static int getMemberAlignment(const TType&, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor);
|
||||||
|
static bool improperStraddle(const TType& type, int size, int offset);
|
||||||
|
static void updateOffset(const TType& parentType, const TType& memberType, int& offset, int& memberSize);
|
||||||
|
static int getOffset(const TType& type, int index);
|
||||||
|
static int getBlockSize(const TType& blockType);
|
||||||
|
static int computeBufferReferenceTypeSize(const TType&);
|
||||||
|
bool promote(TIntermOperator*);
|
||||||
|
void setNanMinMaxClamp(bool setting) { nanMinMaxClamp = setting; }
|
||||||
|
bool getNanMinMaxClamp() const { return nanMinMaxClamp; }
|
||||||
|
|
||||||
|
void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; }
|
||||||
|
const std::string& getSourceFile() const { return sourceFile; }
|
||||||
|
void addSourceText(const char* text, size_t len) { sourceText.append(text, len); }
|
||||||
|
const std::string& getSourceText() const { return sourceText; }
|
||||||
|
const std::map<std::string, std::string>& getIncludeText() const { return includeText; }
|
||||||
|
void addIncludeText(const char* name, const char* text, size_t len) { includeText[name].assign(text,len); }
|
||||||
|
void addProcesses(const std::vector<std::string>& p)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < (int)p.size(); ++i)
|
||||||
|
processes.addProcess(p[i]);
|
||||||
|
}
|
||||||
|
void addProcess(const std::string& process) { processes.addProcess(process); }
|
||||||
|
void addProcessArgument(const std::string& arg) { processes.addArgument(arg); }
|
||||||
|
const std::vector<std::string>& getProcesses() const { return processes.getProcesses(); }
|
||||||
|
|
||||||
|
// Certain explicit conversions are allowed conditionally
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
bool getArithemeticInt8Enabled() const { return false; }
|
||||||
|
bool getArithemeticInt16Enabled() const { return false; }
|
||||||
|
bool getArithemeticFloat16Enabled() const { return false; }
|
||||||
|
#else
|
||||||
|
bool getArithemeticInt8Enabled() const {
|
||||||
|
return extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||||
|
extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int8);
|
||||||
|
}
|
||||||
|
bool getArithemeticInt16Enabled() const {
|
||||||
|
return extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||||
|
extensionRequested(E_GL_AMD_gpu_shader_int16) ||
|
||||||
|
extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int16);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool getArithemeticFloat16Enabled() const {
|
||||||
|
return extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||||
|
extensionRequested(E_GL_AMD_gpu_shader_half_float) ||
|
||||||
|
extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_float16);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&);
|
TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&);
|
||||||
@ -796,13 +881,21 @@ protected:
|
|||||||
bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&);
|
bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&);
|
||||||
void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root);
|
void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root);
|
||||||
bool isConversionAllowed(TOperator op, TIntermTyped* node) const;
|
bool isConversionAllowed(TOperator op, TIntermTyped* node) const;
|
||||||
TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const;
|
|
||||||
std::tuple<TBasicType, TBasicType> getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const;
|
std::tuple<TBasicType, TBasicType> getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const;
|
||||||
|
|
||||||
|
// JohnK: I think this function should go away.
|
||||||
|
// This data structure is just a log to pass on to back ends.
|
||||||
|
// Versioning and extensions are handled in Version.cpp, with a rich
|
||||||
|
// set of functions for querying stages, versions, extension enable/disabled, etc.
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
bool extensionRequested(const char *extension) const { return false; }
|
||||||
|
#else
|
||||||
bool extensionRequested(const char *extension) const {return requestedExtensions.find(extension) != requestedExtensions.end();}
|
bool extensionRequested(const char *extension) const {return requestedExtensions.find(extension) != requestedExtensions.end();}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char* getResourceName(TResourceType);
|
static const char* getResourceName(TResourceType);
|
||||||
|
|
||||||
const EShLanguage language; // stage, known at construction time
|
const EShLanguage language; // stage, known at construction time
|
||||||
EShSource source; // source language, known a bit later
|
|
||||||
std::string entryPointName;
|
std::string entryPointName;
|
||||||
std::string entryPointMangledName;
|
std::string entryPointMangledName;
|
||||||
typedef std::list<TCall> TGraph;
|
typedef std::list<TCall> TGraph;
|
||||||
@ -818,6 +911,20 @@ protected:
|
|||||||
int numErrors;
|
int numErrors;
|
||||||
int numPushConstants;
|
int numPushConstants;
|
||||||
bool recursive;
|
bool recursive;
|
||||||
|
bool invertY;
|
||||||
|
bool useStorageBuffer;
|
||||||
|
bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN
|
||||||
|
bool depthReplacing;
|
||||||
|
int localSize[3];
|
||||||
|
bool localSizeNotDefault[3];
|
||||||
|
int localSizeSpecId[3];
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
public:
|
||||||
|
const char* const implicitThisName;
|
||||||
|
const char* const implicitCounterName;
|
||||||
|
protected:
|
||||||
|
EShSource source; // source language, known a bit later
|
||||||
|
bool useVulkanMemoryModel;
|
||||||
int invocations;
|
int invocations;
|
||||||
int vertices;
|
int vertices;
|
||||||
TLayoutGeometry inputPrimitive;
|
TLayoutGeometry inputPrimitive;
|
||||||
@ -826,27 +933,22 @@ protected:
|
|||||||
bool originUpperLeft;
|
bool originUpperLeft;
|
||||||
TVertexSpacing vertexSpacing;
|
TVertexSpacing vertexSpacing;
|
||||||
TVertexOrder vertexOrder;
|
TVertexOrder vertexOrder;
|
||||||
|
TInterlockOrdering interlockOrdering;
|
||||||
bool pointMode;
|
bool pointMode;
|
||||||
int localSize[3];
|
|
||||||
int localSizeSpecId[3];
|
|
||||||
bool earlyFragmentTests;
|
bool earlyFragmentTests;
|
||||||
bool postDepthCoverage;
|
bool postDepthCoverage;
|
||||||
TLayoutDepth depthLayout;
|
TLayoutDepth depthLayout;
|
||||||
bool depthReplacing;
|
|
||||||
bool hlslFunctionality1;
|
bool hlslFunctionality1;
|
||||||
int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift
|
int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift
|
||||||
bool xfbMode;
|
bool xfbMode;
|
||||||
std::vector<TXfbBuffer> xfbBuffers; // all the data we need to track per xfb buffer
|
std::vector<TXfbBuffer> xfbBuffers; // all the data we need to track per xfb buffer
|
||||||
bool multiStream;
|
bool multiStream;
|
||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
|
||||||
bool layoutOverrideCoverage;
|
bool layoutOverrideCoverage;
|
||||||
bool geoPassthroughEXT;
|
bool geoPassthroughEXT;
|
||||||
int numShaderRecordNVBlocks;
|
int numShaderRecordNVBlocks;
|
||||||
ComputeDerivativeMode computeDerivativeMode;
|
ComputeDerivativeMode computeDerivativeMode;
|
||||||
int primitives;
|
int primitives;
|
||||||
int numTaskNVBlocks;
|
int numTaskNVBlocks;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Base shift values
|
// Base shift values
|
||||||
std::array<unsigned int, EResCount> shiftBinding;
|
std::array<unsigned int, EResCount> shiftBinding;
|
||||||
@ -857,23 +959,29 @@ protected:
|
|||||||
std::vector<std::string> resourceSetBinding;
|
std::vector<std::string> resourceSetBinding;
|
||||||
bool autoMapBindings;
|
bool autoMapBindings;
|
||||||
bool autoMapLocations;
|
bool autoMapLocations;
|
||||||
bool invertY;
|
|
||||||
bool flattenUniformArrays;
|
bool flattenUniformArrays;
|
||||||
bool useUnknownFormat;
|
bool useUnknownFormat;
|
||||||
bool hlslOffsets;
|
bool hlslOffsets;
|
||||||
bool useStorageBuffer;
|
|
||||||
bool useVulkanMemoryModel;
|
|
||||||
bool hlslIoMapping;
|
bool hlslIoMapping;
|
||||||
bool useVariablePointers;
|
bool useVariablePointers;
|
||||||
|
|
||||||
std::set<TString> ioAccessed; // set of names of statically read/written I/O that might need extra checking
|
|
||||||
std::vector<TIoRange> usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers
|
|
||||||
std::vector<TOffsetRange> usedAtomics; // sets of bindings used by atomic counters
|
|
||||||
std::unordered_set<int> usedConstantId; // specialization constant ids used
|
|
||||||
std::set<TString> semanticNameSet;
|
std::set<TString> semanticNameSet;
|
||||||
|
|
||||||
EShTextureSamplerTransformMode textureSamplerTransformMode;
|
EShTextureSamplerTransformMode textureSamplerTransformMode;
|
||||||
|
|
||||||
|
bool needToLegalize;
|
||||||
|
bool binaryDoubleOutput;
|
||||||
|
bool usePhysicalStorageBuffer;
|
||||||
|
|
||||||
|
std::unordered_map<std::string, int> uniformLocationOverrides;
|
||||||
|
int uniformLocationBase;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
std::unordered_set<int> usedConstantId; // specialization constant ids used
|
||||||
|
std::vector<TOffsetRange> usedAtomics; // sets of bindings used by atomic counters
|
||||||
|
std::vector<TIoRange> usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers
|
||||||
|
// set of names of statically read/written I/O that might need extra checking
|
||||||
|
std::set<TString> ioAccessed;
|
||||||
// source code of shader, useful as part of debug information
|
// source code of shader, useful as part of debug information
|
||||||
std::string sourceFile;
|
std::string sourceFile;
|
||||||
std::string sourceText;
|
std::string sourceText;
|
||||||
@ -884,13 +992,6 @@ protected:
|
|||||||
// for OpModuleProcessed, or equivalent
|
// for OpModuleProcessed, or equivalent
|
||||||
TProcesses processes;
|
TProcesses processes;
|
||||||
|
|
||||||
bool needToLegalize;
|
|
||||||
bool binaryDoubleOutput;
|
|
||||||
bool usePhysicalStorageBuffer;
|
|
||||||
|
|
||||||
std::unordered_map<std::string, int> uniformLocationOverrides;
|
|
||||||
int uniformLocationBase;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void operator=(TIntermediate&); // prevent assignments
|
void operator=(TIntermediate&); // prevent assignments
|
||||||
};
|
};
|
||||||
|
@ -57,26 +57,91 @@ public:
|
|||||||
TParseVersions(TIntermediate& interm, int version, EProfile profile,
|
TParseVersions(TIntermediate& interm, int version, EProfile profile,
|
||||||
const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink,
|
const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink,
|
||||||
bool forwardCompatible, EShMessages messages)
|
bool forwardCompatible, EShMessages messages)
|
||||||
: infoSink(infoSink), version(version), profile(profile), language(language),
|
:
|
||||||
spvVersion(spvVersion), forwardCompatible(forwardCompatible),
|
#ifndef GLSLANG_WEB
|
||||||
|
forwardCompatible(forwardCompatible),
|
||||||
|
profile(profile),
|
||||||
|
#endif
|
||||||
|
infoSink(infoSink), version(version),
|
||||||
|
language(language),
|
||||||
|
spvVersion(spvVersion),
|
||||||
intermediate(interm), messages(messages), numErrors(0), currentScanner(0) { }
|
intermediate(interm), messages(messages), numErrors(0), currentScanner(0) { }
|
||||||
virtual ~TParseVersions() { }
|
virtual ~TParseVersions() { }
|
||||||
|
void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc);
|
||||||
|
void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc);
|
||||||
|
#ifdef GLSLANG_WEB
|
||||||
|
const EProfile profile = EEsProfile;
|
||||||
|
bool isEsProfile() const { return true; }
|
||||||
|
void requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc)
|
||||||
|
{
|
||||||
|
if (! (EEsProfile & profileMask))
|
||||||
|
error(loc, "not supported with this profile:", featureDesc, ProfileName(profile));
|
||||||
|
}
|
||||||
|
void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions,
|
||||||
|
const char* const extensions[], const char* featureDesc)
|
||||||
|
{
|
||||||
|
if ((EEsProfile & profileMask) && (minVersion == 0 || version < minVersion))
|
||||||
|
error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
|
||||||
|
}
|
||||||
|
void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension,
|
||||||
|
const char* featureDesc)
|
||||||
|
{
|
||||||
|
profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc);
|
||||||
|
}
|
||||||
|
void initializeExtensionBehavior() { }
|
||||||
|
void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc) { }
|
||||||
|
void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc) { }
|
||||||
|
void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[],
|
||||||
|
const char* featureDesc) { }
|
||||||
|
void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[],
|
||||||
|
const char* featureDesc) { }
|
||||||
|
TExtensionBehavior getExtensionBehavior(const char*) { return EBhMissing; }
|
||||||
|
bool extensionTurnedOn(const char* const extension) { return false; }
|
||||||
|
bool extensionsTurnedOn(int numExtensions, const char* const extensions[]) { return false; }
|
||||||
|
void updateExtensionBehavior(int line, const char* const extension, const char* behavior) { }
|
||||||
|
void updateExtensionBehavior(const char* const extension, TExtensionBehavior) { }
|
||||||
|
void checkExtensionStage(const TSourceLoc&, const char* const extension) { }
|
||||||
|
void fullIntegerCheck(const TSourceLoc&, const char* op) { }
|
||||||
|
void doubleCheck(const TSourceLoc&, const char* op) { }
|
||||||
|
bool float16Arithmetic() { return false; }
|
||||||
|
void requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
|
||||||
|
bool int16Arithmetic() { return false; }
|
||||||
|
void requireInt16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
|
||||||
|
bool int8Arithmetic() { return false; }
|
||||||
|
void requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
|
||||||
|
void int64Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
|
||||||
|
void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
|
||||||
|
void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
|
||||||
|
bool relaxedErrors() const { return false; }
|
||||||
|
bool suppressWarnings() const { return true; }
|
||||||
|
bool isForwardCompatible() const { return false; }
|
||||||
|
#else
|
||||||
|
bool forwardCompatible; // true if errors are to be given for use of deprecated features
|
||||||
|
EProfile profile; // the declared profile in the shader (core by default)
|
||||||
|
bool isEsProfile() const { return profile == EEsProfile; }
|
||||||
|
void requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc);
|
||||||
|
void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions,
|
||||||
|
const char* const extensions[], const char* featureDesc);
|
||||||
|
void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension,
|
||||||
|
const char* featureDesc);
|
||||||
virtual void initializeExtensionBehavior();
|
virtual void initializeExtensionBehavior();
|
||||||
virtual void requireProfile(const TSourceLoc&, int queryProfiles, const char* featureDesc);
|
|
||||||
virtual void profileRequires(const TSourceLoc&, int queryProfiles, int minVersion, int numExtensions, const char* const extensions[], const char* featureDesc);
|
|
||||||
virtual void profileRequires(const TSourceLoc&, int queryProfiles, int minVersion, const char* const extension, const char* featureDesc);
|
|
||||||
virtual void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc);
|
|
||||||
virtual void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc);
|
|
||||||
virtual void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc);
|
virtual void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc);
|
||||||
virtual void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc);
|
virtual void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc);
|
||||||
virtual void unimplemented(const TSourceLoc&, const char* featureDesc);
|
virtual void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[],
|
||||||
virtual void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc);
|
const char* featureDesc);
|
||||||
virtual void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc);
|
virtual void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[],
|
||||||
|
const char* featureDesc);
|
||||||
virtual TExtensionBehavior getExtensionBehavior(const char*);
|
virtual TExtensionBehavior getExtensionBehavior(const char*);
|
||||||
virtual bool extensionTurnedOn(const char* const extension);
|
virtual bool extensionTurnedOn(const char* const extension);
|
||||||
virtual bool extensionsTurnedOn(int numExtensions, const char* const extensions[]);
|
virtual bool extensionsTurnedOn(int numExtensions, const char* const extensions[]);
|
||||||
virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior);
|
virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior);
|
||||||
|
virtual void updateExtensionBehavior(const char* const extension, TExtensionBehavior);
|
||||||
|
virtual bool checkExtensionsRequested(const TSourceLoc&, int numExtensions, const char* const extensions[],
|
||||||
|
const char* featureDesc);
|
||||||
|
virtual void checkExtensionStage(const TSourceLoc&, const char* const extension);
|
||||||
virtual void fullIntegerCheck(const TSourceLoc&, const char* op);
|
virtual void fullIntegerCheck(const TSourceLoc&, const char* op);
|
||||||
|
|
||||||
|
virtual void unimplemented(const TSourceLoc&, const char* featureDesc);
|
||||||
virtual void doubleCheck(const TSourceLoc&, const char* op);
|
virtual void doubleCheck(const TSourceLoc&, const char* op);
|
||||||
virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void float16Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
virtual void float16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void float16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
@ -88,24 +153,35 @@ public:
|
|||||||
virtual void int8ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void int8ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
virtual bool int8Arithmetic();
|
virtual bool int8Arithmetic();
|
||||||
virtual void requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc);
|
virtual void requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc);
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
virtual void float16OpaqueCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void float16OpaqueCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
#endif
|
|
||||||
virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
virtual void explicitInt8Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void explicitInt8Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
virtual void explicitInt16Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void explicitInt16Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
virtual void explicitInt32Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void explicitInt32Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
virtual void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
virtual void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
virtual void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
|
virtual void fcoopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||||
|
virtual void intcoopmatCheck(const TSourceLoc&, const char *op, bool builtIn = false);
|
||||||
|
bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; }
|
||||||
|
bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
|
||||||
|
bool isForwardCompatible() const { return forwardCompatible; }
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
virtual void spvRemoved(const TSourceLoc&, const char* op);
|
virtual void spvRemoved(const TSourceLoc&, const char* op);
|
||||||
virtual void vulkanRemoved(const TSourceLoc&, const char* op);
|
virtual void vulkanRemoved(const TSourceLoc&, const char* op);
|
||||||
virtual void requireVulkan(const TSourceLoc&, const char* op);
|
virtual void requireVulkan(const TSourceLoc&, const char* op);
|
||||||
virtual void requireSpv(const TSourceLoc&, const char* op);
|
virtual void requireSpv(const TSourceLoc&, const char* op);
|
||||||
virtual bool checkExtensionsRequested(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc);
|
|
||||||
virtual void updateExtensionBehavior(const char* const extension, TExtensionBehavior);
|
|
||||||
virtual void checkExtensionStage(const TSourceLoc&, const char* const extension);
|
|
||||||
virtual void fcoopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(GLSLANG_WEB) && !defined(GLSLANG_WEB_DEVEL)
|
||||||
|
void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
|
const char* szExtraInfoFormat, ...) { addError(); }
|
||||||
|
void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
|
const char* szExtraInfoFormat, ...) { }
|
||||||
|
void C_DECL ppError(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
|
const char* szExtraInfoFormat, ...) { addError(); }
|
||||||
|
void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
|
const char* szExtraInfoFormat, ...) { }
|
||||||
|
#else
|
||||||
virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
const char* szExtraInfoFormat, ...) = 0;
|
const char* szExtraInfoFormat, ...) = 0;
|
||||||
virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
@ -114,6 +190,7 @@ public:
|
|||||||
const char* szExtraInfoFormat, ...) = 0;
|
const char* szExtraInfoFormat, ...) = 0;
|
||||||
virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||||
const char* szExtraInfoFormat, ...) = 0;
|
const char* szExtraInfoFormat, ...) = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
void addError() { ++numErrors; }
|
void addError() { ++numErrors; }
|
||||||
int getNumErrors() const { return numErrors; }
|
int getNumErrors() const { return numErrors; }
|
||||||
@ -127,20 +204,20 @@ public:
|
|||||||
void setCurrentString(int string) { currentScanner->setString(string); }
|
void setCurrentString(int string) { currentScanner->setString(string); }
|
||||||
|
|
||||||
void getPreamble(std::string&);
|
void getPreamble(std::string&);
|
||||||
bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; }
|
#ifdef ENABLE_HLSL
|
||||||
bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
|
|
||||||
bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; }
|
bool isReadingHLSL() const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; }
|
||||||
bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; }
|
bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; }
|
||||||
bool hlslDX9Compatible() const { return (messages & EShMsgHlslDX9Compatible) != 0; }
|
bool hlslDX9Compatible() const { return (messages & EShMsgHlslDX9Compatible) != 0; }
|
||||||
|
#else
|
||||||
|
bool isReadingHLSL() const { return false; }
|
||||||
|
#endif
|
||||||
|
|
||||||
TInfoSink& infoSink;
|
TInfoSink& infoSink;
|
||||||
|
|
||||||
// compilation mode
|
// compilation mode
|
||||||
int version; // version, updated by #version in the shader
|
int version; // version, updated by #version in the shader
|
||||||
EProfile profile; // the declared profile in the shader (core by default)
|
|
||||||
EShLanguage language; // really the stage
|
EShLanguage language; // really the stage
|
||||||
SpvVersion spvVersion;
|
SpvVersion spvVersion;
|
||||||
bool forwardCompatible; // true if errors are to be given for use of deprecated features
|
|
||||||
TIntermediate& intermediate; // helper for making and hooking up pieces of the parse tree
|
TIntermediate& intermediate; // helper for making and hooking up pieces of the parse tree
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
17
thirdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
vendored
Normal file → Executable file
17
thirdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
vendored
Normal file → Executable file
@ -545,7 +545,7 @@ int TPpContext::evalToToken(int token, bool shortCircuit, int& res, bool& err, T
|
|||||||
case MacroExpandStarted:
|
case MacroExpandStarted:
|
||||||
break;
|
break;
|
||||||
case MacroExpandUndef:
|
case MacroExpandUndef:
|
||||||
if (! shortCircuit && parseContext.profile == EEsProfile) {
|
if (! shortCircuit && parseContext.isEsProfile()) {
|
||||||
const char* message = "undefined macro in expression not allowed in es profile";
|
const char* message = "undefined macro in expression not allowed in es profile";
|
||||||
if (parseContext.relaxedErrors())
|
if (parseContext.relaxedErrors())
|
||||||
parseContext.ppWarn(ppToken->loc, message, "preprocessor evaluation", ppToken->name);
|
parseContext.ppWarn(ppToken->loc, message, "preprocessor evaluation", ppToken->name);
|
||||||
@ -722,6 +722,7 @@ int TPpContext::CPPline(TPpToken* ppToken)
|
|||||||
parseContext.setCurrentLine(lineRes);
|
parseContext.setCurrentLine(lineRes);
|
||||||
|
|
||||||
if (token != '\n') {
|
if (token != '\n') {
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (token == PpAtomConstString) {
|
if (token == PpAtomConstString) {
|
||||||
parseContext.ppRequireExtensions(directiveLoc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based #line");
|
parseContext.ppRequireExtensions(directiveLoc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based #line");
|
||||||
// We need to save a copy of the string instead of pointing
|
// We need to save a copy of the string instead of pointing
|
||||||
@ -731,7 +732,9 @@ int TPpContext::CPPline(TPpToken* ppToken)
|
|||||||
parseContext.setCurrentSourceName(sourceName);
|
parseContext.setCurrentSourceName(sourceName);
|
||||||
hasFile = true;
|
hasFile = true;
|
||||||
token = scanToken(ppToken);
|
token = scanToken(ppToken);
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
token = eval(token, MIN_PRECEDENCE, false, fileRes, fileErr, ppToken);
|
token = eval(token, MIN_PRECEDENCE, false, fileRes, fileErr, ppToken);
|
||||||
if (! fileErr) {
|
if (! fileErr) {
|
||||||
parseContext.setCurrentString(fileRes);
|
parseContext.setCurrentString(fileRes);
|
||||||
@ -792,10 +795,8 @@ int TPpContext::CPPpragma(TPpToken* ppToken)
|
|||||||
case PpAtomConstUint:
|
case PpAtomConstUint:
|
||||||
case PpAtomConstInt64:
|
case PpAtomConstInt64:
|
||||||
case PpAtomConstUint64:
|
case PpAtomConstUint64:
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case PpAtomConstInt16:
|
case PpAtomConstInt16:
|
||||||
case PpAtomConstUint16:
|
case PpAtomConstUint16:
|
||||||
#endif
|
|
||||||
case PpAtomConstFloat:
|
case PpAtomConstFloat:
|
||||||
case PpAtomConstDouble:
|
case PpAtomConstDouble:
|
||||||
case PpAtomConstFloat16:
|
case PpAtomConstFloat16:
|
||||||
@ -954,18 +955,20 @@ int TPpContext::readCPPline(TPpToken* ppToken)
|
|||||||
case PpAtomIfndef:
|
case PpAtomIfndef:
|
||||||
token = CPPifdef(0, ppToken);
|
token = CPPifdef(0, ppToken);
|
||||||
break;
|
break;
|
||||||
|
case PpAtomLine:
|
||||||
|
token = CPPline(ppToken);
|
||||||
|
break;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
case PpAtomInclude:
|
case PpAtomInclude:
|
||||||
if(!parseContext.isReadingHLSL()) {
|
if(!parseContext.isReadingHLSL()) {
|
||||||
parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include");
|
parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include");
|
||||||
}
|
}
|
||||||
token = CPPinclude(ppToken);
|
token = CPPinclude(ppToken);
|
||||||
break;
|
break;
|
||||||
case PpAtomLine:
|
|
||||||
token = CPPline(ppToken);
|
|
||||||
break;
|
|
||||||
case PpAtomPragma:
|
case PpAtomPragma:
|
||||||
token = CPPpragma(ppToken);
|
token = CPPpragma(ppToken);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case PpAtomUndef:
|
case PpAtomUndef:
|
||||||
token = CPPundef(ppToken);
|
token = CPPundef(ppToken);
|
||||||
break;
|
break;
|
||||||
|
0
thirdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp
vendored
Normal file → Executable file
0
thirdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp
vendored
Normal file → Executable file
23
thirdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
vendored
Normal file → Executable file
23
thirdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
vendored
Normal file → Executable file
@ -142,6 +142,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
ch = getChar();
|
ch = getChar();
|
||||||
int firstDecimal = len;
|
int firstDecimal = len;
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
// 1.#INF or -1.#INF
|
// 1.#INF or -1.#INF
|
||||||
if (ch == '#' && (ifdepth > 0 || parseContext.intermediate.getSource() == EShSourceHlsl)) {
|
if (ch == '#' && (ifdepth > 0 || parseContext.intermediate.getSource() == EShSourceHlsl)) {
|
||||||
if ((len < 2) ||
|
if ((len < 2) ||
|
||||||
@ -169,6 +170,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Consume leading-zero digits after the decimal point
|
// Consume leading-zero digits after the decimal point
|
||||||
while (ch == '0') {
|
while (ch == '0') {
|
||||||
@ -257,6 +259,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
// Suffix:
|
// Suffix:
|
||||||
bool isDouble = false;
|
bool isDouble = false;
|
||||||
bool isFloat16 = false;
|
bool isFloat16 = false;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (ch == 'l' || ch == 'L') {
|
if (ch == 'l' || ch == 'L') {
|
||||||
if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl)
|
if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl)
|
||||||
parseContext.doubleCheck(ppToken->loc, "double floating-point suffix");
|
parseContext.doubleCheck(ppToken->loc, "double floating-point suffix");
|
||||||
@ -295,11 +298,15 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
|||||||
saveName(ch);
|
saveName(ch);
|
||||||
isFloat16 = true;
|
isFloat16 = true;
|
||||||
}
|
}
|
||||||
} else if (ch == 'f' || ch == 'F') {
|
} else
|
||||||
|
#endif
|
||||||
|
if (ch == 'f' || ch == 'F') {
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
if (ifdepth == 0)
|
if (ifdepth == 0)
|
||||||
parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix");
|
parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix");
|
||||||
if (ifdepth == 0 && !parseContext.relaxedErrors())
|
if (ifdepth == 0 && !parseContext.relaxedErrors())
|
||||||
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix");
|
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix");
|
||||||
|
#endif
|
||||||
if (ifdepth == 0 && !hasDecimalOrExponent)
|
if (ifdepth == 0 && !hasDecimalOrExponent)
|
||||||
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
||||||
saveName(ch);
|
saveName(ch);
|
||||||
@ -468,9 +475,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
static const int Num_Int64_Extensions = sizeof(Int64_Extensions) / sizeof(Int64_Extensions[0]);
|
static const int Num_Int64_Extensions = sizeof(Int64_Extensions) / sizeof(Int64_Extensions[0]);
|
||||||
|
|
||||||
static const char* const Int16_Extensions[] = {
|
static const char* const Int16_Extensions[] = {
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
E_GL_AMD_gpu_shader_int16,
|
E_GL_AMD_gpu_shader_int16,
|
||||||
#endif
|
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||||
E_GL_EXT_shader_explicit_arithmetic_types_int16 };
|
E_GL_EXT_shader_explicit_arithmetic_types_int16 };
|
||||||
static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]);
|
static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]);
|
||||||
@ -579,6 +584,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isUnsigned = true;
|
isUnsigned = true;
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
int nextCh = getch();
|
int nextCh = getch();
|
||||||
if (nextCh == 'l' || nextCh == 'L') {
|
if (nextCh == 'l' || nextCh == 'L') {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
@ -587,7 +593,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
nextCh = getch();
|
nextCh = getch();
|
||||||
if ((nextCh == 's' || nextCh == 'S') &&
|
if ((nextCh == 's' || nextCh == 'S') &&
|
||||||
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
||||||
@ -596,12 +601,10 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
isInt16 = true;
|
isInt16 = true;
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
#endif
|
|
||||||
} else if (ch == 'l' || ch == 'L') {
|
} else if (ch == 'l' || ch == 'L') {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isInt64 = true;
|
isInt64 = true;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if ((ch == 's' || ch == 'S') &&
|
} else if ((ch == 's' || ch == 'S') &&
|
||||||
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
@ -689,6 +692,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isUnsigned = true;
|
isUnsigned = true;
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
int nextCh = getch();
|
int nextCh = getch();
|
||||||
if (nextCh == 'l' || nextCh == 'L') {
|
if (nextCh == 'l' || nextCh == 'L') {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
@ -697,7 +701,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
nextCh = getch();
|
nextCh = getch();
|
||||||
if ((nextCh == 's' || nextCh == 'S') &&
|
if ((nextCh == 's' || nextCh == 'S') &&
|
||||||
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
||||||
@ -706,12 +709,10 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
isInt16 = true;
|
isInt16 = true;
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
#endif
|
|
||||||
} else if (ch == 'l' || ch == 'L') {
|
} else if (ch == 'l' || ch == 'L') {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isInt64 = true;
|
isInt64 = true;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if ((ch == 's' || ch == 'S') &&
|
} else if ((ch == 's' || ch == 'S') &&
|
||||||
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
@ -780,6 +781,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isUnsigned = true;
|
isUnsigned = true;
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
int nextCh = getch();
|
int nextCh = getch();
|
||||||
if (nextCh == 'l' || nextCh == 'L') {
|
if (nextCh == 'l' || nextCh == 'L') {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
@ -788,7 +790,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
|
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
nextCh = getch();
|
nextCh = getch();
|
||||||
if ((nextCh == 's' || nextCh == 'S') &&
|
if ((nextCh == 's' || nextCh == 'S') &&
|
||||||
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
||||||
@ -797,12 +798,10 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
isInt16 = true;
|
isInt16 = true;
|
||||||
} else
|
} else
|
||||||
ungetch();
|
ungetch();
|
||||||
#endif
|
|
||||||
} else if (ch == 'l' || ch == 'L') {
|
} else if (ch == 'l' || ch == 'L') {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
ppToken->name[len++] = (char)ch;
|
ppToken->name[len++] = (char)ch;
|
||||||
isInt64 = true;
|
isInt64 = true;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
} else if ((ch == 's' || ch == 'S') &&
|
} else if ((ch == 's' || ch == 'S') &&
|
||||||
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
|
||||||
if (len < MaxTokenLength)
|
if (len < MaxTokenLength)
|
||||||
|
2
thirdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
vendored
Normal file → Executable file
2
thirdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
vendored
Normal file → Executable file
@ -116,6 +116,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
|||||||
int atom = stream[currentPos++].get(*ppToken);
|
int atom = stream[currentPos++].get(*ppToken);
|
||||||
ppToken->loc = parseContext.getCurrentLoc();
|
ppToken->loc = parseContext.getCurrentLoc();
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
// Check for ##, unless the current # is the last character
|
// Check for ##, unless the current # is the last character
|
||||||
if (atom == '#') {
|
if (atom == '#') {
|
||||||
if (peekToken('#')) {
|
if (peekToken('#')) {
|
||||||
@ -125,6 +126,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
|||||||
atom = PpAtomPaste;
|
atom = PpAtomPaste;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return atom;
|
return atom;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
// propagate the 'noContraction' qualifier.
|
// propagate the 'noContraction' qualifier.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
#include "propagateNoContraction.h"
|
#include "propagateNoContraction.h"
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -79,7 +81,7 @@ typedef std::unordered_set<glslang::TIntermBranch*> ReturnBranchNodeSet;
|
|||||||
// the node has 'noContraction' qualifier, otherwise false.
|
// the node has 'noContraction' qualifier, otherwise false.
|
||||||
bool isPreciseObjectNode(glslang::TIntermTyped* node)
|
bool isPreciseObjectNode(glslang::TIntermTyped* node)
|
||||||
{
|
{
|
||||||
return node->getType().getQualifier().noContraction;
|
return node->getType().getQualifier().isNoContraction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the opcode is a dereferencing one.
|
// Returns true if the opcode is a dereferencing one.
|
||||||
@ -864,3 +866,5 @@ void PropagateNoContraction(const glslang::TIntermediate& intermediate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // GLSLANG_WEB
|
@ -33,6 +33,8 @@
|
|||||||
// POSSIBILITY OF SUCH DAMAGE.
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
#include "../Include/Common.h"
|
#include "../Include/Common.h"
|
||||||
#include "reflection.h"
|
#include "reflection.h"
|
||||||
#include "LiveTraverser.h"
|
#include "LiveTraverser.h"
|
||||||
@ -110,6 +112,10 @@ public:
|
|||||||
TReflection::TMapIndexToReflection &ioItems =
|
TReflection::TMapIndexToReflection &ioItems =
|
||||||
input ? reflection.indexToPipeInput : reflection.indexToPipeOutput;
|
input ? reflection.indexToPipeInput : reflection.indexToPipeOutput;
|
||||||
|
|
||||||
|
|
||||||
|
TReflection::TNameToIndex &ioMapper =
|
||||||
|
input ? reflection.pipeInNameToIndex : reflection.pipeOutNameToIndex;
|
||||||
|
|
||||||
if (reflection.options & EShReflectionUnwrapIOBlocks) {
|
if (reflection.options & EShReflectionUnwrapIOBlocks) {
|
||||||
bool anonymous = IsAnonymous(name);
|
bool anonymous = IsAnonymous(name);
|
||||||
|
|
||||||
@ -127,12 +133,13 @@ public:
|
|||||||
blowUpIOAggregate(input, baseName, type);
|
blowUpIOAggregate(input, baseName, type);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str());
|
TReflection::TNameToIndex::const_iterator it = ioMapper.find(name.c_str());
|
||||||
if (it == reflection.nameToIndex.end()) {
|
if (it == ioMapper.end()) {
|
||||||
reflection.nameToIndex[name.c_str()] = (int)ioItems.size();
|
// seperate pipe i/o params from uniforms and blocks
|
||||||
|
// in is only for input in first stage as out is only for last stage. check traverse in call stack.
|
||||||
|
ioMapper[name.c_str()] = static_cast<int>(ioItems.size());
|
||||||
ioItems.push_back(
|
ioItems.push_back(
|
||||||
TObjectReflection(name.c_str(), type, 0, mapToGlType(type), mapToGlArraySize(type), 0));
|
TObjectReflection(name.c_str(), type, 0, mapToGlType(type), mapToGlArraySize(type), 0));
|
||||||
|
|
||||||
EShLanguageMask& stages = ioItems.back().stages;
|
EShLanguageMask& stages = ioItems.back().stages;
|
||||||
stages = static_cast<EShLanguageMask>(stages | 1 << intermediate.getStage());
|
stages = static_cast<EShLanguageMask>(stages | 1 << intermediate.getStage());
|
||||||
} else {
|
} else {
|
||||||
@ -396,7 +403,7 @@ public:
|
|||||||
topLevelArrayStride = variables.back().arrayStride;
|
topLevelArrayStride = variables.back().arrayStride;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((reflection.options & EShReflectionSeparateBuffers) && terminalType->getBasicType() == EbtAtomicUint)
|
if ((reflection.options & EShReflectionSeparateBuffers) && terminalType->isAtomic())
|
||||||
reflection.atomicCounterUniformIndices.push_back(uniformIndex);
|
reflection.atomicCounterUniformIndices.push_back(uniformIndex);
|
||||||
|
|
||||||
variables.back().topLevelArrayStride = topLevelArrayStride;
|
variables.back().topLevelArrayStride = topLevelArrayStride;
|
||||||
@ -554,15 +561,18 @@ public:
|
|||||||
bool blockParent = (base->getType().getBasicType() == EbtBlock && base->getQualifier().storage == EvqBuffer);
|
bool blockParent = (base->getType().getBasicType() == EbtBlock && base->getQualifier().storage == EvqBuffer);
|
||||||
|
|
||||||
if (strictArraySuffix && blockParent) {
|
if (strictArraySuffix && blockParent) {
|
||||||
const TTypeList& typeList = *base->getType().getStruct();
|
TType structDerefType(base->getType(), 0);
|
||||||
|
|
||||||
|
const TType &structType = base->getType().isArray() ? structDerefType : base->getType();
|
||||||
|
const TTypeList& typeList = *structType.getStruct();
|
||||||
|
|
||||||
TVector<int> memberOffsets;
|
TVector<int> memberOffsets;
|
||||||
|
|
||||||
memberOffsets.resize(typeList.size());
|
memberOffsets.resize(typeList.size());
|
||||||
getOffsets(base->getType(), memberOffsets);
|
getOffsets(structType, memberOffsets);
|
||||||
|
|
||||||
for (int i = 0; i < (int)typeList.size(); ++i) {
|
for (int i = 0; i < (int)typeList.size(); ++i) {
|
||||||
TType derefType(base->getType(), i);
|
TType derefType(structType, i);
|
||||||
TString name = baseName;
|
TString name = baseName;
|
||||||
if (name.size() > 0)
|
if (name.size() > 0)
|
||||||
name.append(".");
|
name.append(".");
|
||||||
@ -573,7 +583,7 @@ public:
|
|||||||
if (derefType.isArray() && derefType.isStruct()) {
|
if (derefType.isArray() && derefType.isStruct()) {
|
||||||
name.append("[0]");
|
name.append("[0]");
|
||||||
blowUpActiveAggregate(TType(derefType, 0), name, derefs, derefs.end(), memberOffsets[i],
|
blowUpActiveAggregate(TType(derefType, 0), name, derefs, derefs.end(), memberOffsets[i],
|
||||||
blockIndex, 0, getArrayStride(base->getType(), derefType),
|
blockIndex, 0, getArrayStride(structType, derefType),
|
||||||
base->getQualifier().storage, false);
|
base->getQualifier().storage, false);
|
||||||
} else {
|
} else {
|
||||||
blowUpActiveAggregate(derefType, name, derefs, derefs.end(), memberOffsets[i], blockIndex,
|
blowUpActiveAggregate(derefType, name, derefs, derefs.end(), memberOffsets[i], blockIndex,
|
||||||
@ -701,7 +711,6 @@ public:
|
|||||||
case EsdBuffer:
|
case EsdBuffer:
|
||||||
return GL_SAMPLER_BUFFER;
|
return GL_SAMPLER_BUFFER;
|
||||||
}
|
}
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EbtFloat16:
|
case EbtFloat16:
|
||||||
switch ((int)sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
@ -730,7 +739,6 @@ public:
|
|||||||
case EsdBuffer:
|
case EsdBuffer:
|
||||||
return GL_FLOAT16_SAMPLER_BUFFER_AMD;
|
return GL_FLOAT16_SAMPLER_BUFFER_AMD;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
switch ((int)sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
@ -793,7 +801,6 @@ public:
|
|||||||
case EsdBuffer:
|
case EsdBuffer:
|
||||||
return GL_IMAGE_BUFFER;
|
return GL_IMAGE_BUFFER;
|
||||||
}
|
}
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EbtFloat16:
|
case EbtFloat16:
|
||||||
switch ((int)sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
@ -812,7 +819,6 @@ public:
|
|||||||
case EsdBuffer:
|
case EsdBuffer:
|
||||||
return GL_FLOAT16_IMAGE_BUFFER_AMD;
|
return GL_FLOAT16_IMAGE_BUFFER_AMD;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
switch ((int)sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
@ -878,9 +884,7 @@ public:
|
|||||||
switch (type.getBasicType()) {
|
switch (type.getBasicType()) {
|
||||||
case EbtFloat: return GL_FLOAT_VEC2 + offset;
|
case EbtFloat: return GL_FLOAT_VEC2 + offset;
|
||||||
case EbtDouble: return GL_DOUBLE_VEC2 + offset;
|
case EbtDouble: return GL_DOUBLE_VEC2 + offset;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EbtFloat16: return GL_FLOAT16_VEC2_NV + offset;
|
case EbtFloat16: return GL_FLOAT16_VEC2_NV + offset;
|
||||||
#endif
|
|
||||||
case EbtInt: return GL_INT_VEC2 + offset;
|
case EbtInt: return GL_INT_VEC2 + offset;
|
||||||
case EbtUint: return GL_UNSIGNED_INT_VEC2 + offset;
|
case EbtUint: return GL_UNSIGNED_INT_VEC2 + offset;
|
||||||
case EbtInt64: return GL_INT64_ARB + offset;
|
case EbtInt64: return GL_INT64_ARB + offset;
|
||||||
@ -940,7 +944,6 @@ public:
|
|||||||
default: return 0;
|
default: return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EbtFloat16:
|
case EbtFloat16:
|
||||||
switch (type.getMatrixCols()) {
|
switch (type.getMatrixCols()) {
|
||||||
case 2:
|
case 2:
|
||||||
@ -965,7 +968,6 @@ public:
|
|||||||
default: return 0;
|
default: return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -974,9 +976,7 @@ public:
|
|||||||
switch (type.getBasicType()) {
|
switch (type.getBasicType()) {
|
||||||
case EbtFloat: return GL_FLOAT;
|
case EbtFloat: return GL_FLOAT;
|
||||||
case EbtDouble: return GL_DOUBLE;
|
case EbtDouble: return GL_DOUBLE;
|
||||||
#ifdef AMD_EXTENSIONS
|
|
||||||
case EbtFloat16: return GL_FLOAT16_NV;
|
case EbtFloat16: return GL_FLOAT16_NV;
|
||||||
#endif
|
|
||||||
case EbtInt: return GL_INT;
|
case EbtInt: return GL_INT;
|
||||||
case EbtUint: return GL_UNSIGNED_INT;
|
case EbtUint: return GL_UNSIGNED_INT;
|
||||||
case EbtInt64: return GL_INT64_ARB;
|
case EbtInt64: return GL_INT64_ARB;
|
||||||
@ -1093,6 +1093,7 @@ void TReflection::buildAttributeReflection(EShLanguage stage, const TIntermediat
|
|||||||
// build counter block index associations for buffers
|
// build counter block index associations for buffers
|
||||||
void TReflection::buildCounterIndices(const TIntermediate& intermediate)
|
void TReflection::buildCounterIndices(const TIntermediate& intermediate)
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
// search for ones that have counters
|
// search for ones that have counters
|
||||||
for (int i = 0; i < int(indexToUniformBlock.size()); ++i) {
|
for (int i = 0; i < int(indexToUniformBlock.size()); ++i) {
|
||||||
const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name).c_str());
|
const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name).c_str());
|
||||||
@ -1101,6 +1102,7 @@ void TReflection::buildCounterIndices(const TIntermediate& intermediate)
|
|||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
indexToUniformBlock[i].counterIndex = index;
|
indexToUniformBlock[i].counterIndex = index;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// build Shader Stages mask for all uniforms
|
// build Shader Stages mask for all uniforms
|
||||||
@ -1198,3 +1200,5 @@ void TReflection::dump()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
|
@ -33,6 +33,8 @@
|
|||||||
// POSSIBILITY OF SUCH DAMAGE.
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
#ifndef _REFLECTION_INCLUDED
|
#ifndef _REFLECTION_INCLUDED
|
||||||
#define _REFLECTION_INCLUDED
|
#define _REFLECTION_INCLUDED
|
||||||
|
|
||||||
@ -150,6 +152,20 @@ public:
|
|||||||
// see getIndex(const char*)
|
// see getIndex(const char*)
|
||||||
int getIndex(const TString& name) const { return getIndex(name.c_str()); }
|
int getIndex(const TString& name) const { return getIndex(name.c_str()); }
|
||||||
|
|
||||||
|
|
||||||
|
// for mapping any name to its index (only pipe input/output names)
|
||||||
|
int getPipeIOIndex(const char* name, const bool inOrOut) const
|
||||||
|
{
|
||||||
|
TNameToIndex::const_iterator it = inOrOut ? pipeInNameToIndex.find(name) : pipeOutNameToIndex.find(name);
|
||||||
|
if (it == (inOrOut ? pipeInNameToIndex.end() : pipeOutNameToIndex.end()))
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
// see gePipeIOIndex(const char*, const bool)
|
||||||
|
int getPipeIOIndex(const TString& name, const bool inOrOut) const { return getPipeIOIndex(name.c_str(), inOrOut); }
|
||||||
|
|
||||||
// Thread local size
|
// Thread local size
|
||||||
unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; }
|
unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; }
|
||||||
|
|
||||||
@ -187,6 +203,8 @@ protected:
|
|||||||
|
|
||||||
TObjectReflection badReflection; // return for queries of -1 or generally out of range; has expected descriptions with in it for this
|
TObjectReflection badReflection; // return for queries of -1 or generally out of range; has expected descriptions with in it for this
|
||||||
TNameToIndex nameToIndex; // maps names to indexes; can hold all types of data: uniform/buffer and which function names have been processed
|
TNameToIndex nameToIndex; // maps names to indexes; can hold all types of data: uniform/buffer and which function names have been processed
|
||||||
|
TNameToIndex pipeInNameToIndex; // maps pipe in names to indexes, this is a fix to seperate pipe I/O from uniforms and buffers.
|
||||||
|
TNameToIndex pipeOutNameToIndex; // maps pipe out names to indexes, this is a fix to seperate pipe I/O from uniforms and buffers.
|
||||||
TMapIndexToReflection indexToUniform;
|
TMapIndexToReflection indexToUniform;
|
||||||
TMapIndexToReflection indexToUniformBlock;
|
TMapIndexToReflection indexToUniformBlock;
|
||||||
TMapIndexToReflection indexToBufferVariable;
|
TMapIndexToReflection indexToBufferVariable;
|
||||||
@ -201,3 +219,5 @@ protected:
|
|||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
|
||||||
#endif // _REFLECTION_INCLUDED
|
#endif // _REFLECTION_INCLUDED
|
||||||
|
|
||||||
|
#endif // GLSLANG_WEB
|
26
thirdparty/glslang/glslang/OSDependent/Web/glslang.after.js
vendored
Normal file
26
thirdparty/glslang/glslang/OSDependent/Web/glslang.after.js
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
export default (() => {
|
||||||
|
const initialize = () => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
Module({
|
||||||
|
locateFile() {
|
||||||
|
const i = import.meta.url.lastIndexOf('/')
|
||||||
|
return import.meta.url.substring(0, i) + '/glslang.wasm';
|
||||||
|
},
|
||||||
|
onRuntimeInitialized() {
|
||||||
|
resolve({
|
||||||
|
compileGLSLZeroCopy: this.compileGLSLZeroCopy,
|
||||||
|
compileGLSL: this.compileGLSL,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
let instance;
|
||||||
|
return () => {
|
||||||
|
if (!instance) {
|
||||||
|
instance = initialize();
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
};
|
||||||
|
})();
|
269
thirdparty/glslang/glslang/OSDependent/Web/glslang.js.cpp
vendored
Normal file
269
thirdparty/glslang/glslang/OSDependent/Web/glslang.js.cpp
vendored
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
//
|
||||||
|
// Copyright (C) 2019 Google, Inc.
|
||||||
|
//
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions
|
||||||
|
// are met:
|
||||||
|
//
|
||||||
|
// Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following
|
||||||
|
// disclaimer in the documentation and/or other materials provided
|
||||||
|
// with the distribution.
|
||||||
|
//
|
||||||
|
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived
|
||||||
|
// from this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdint>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
#include <emscripten.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "../../../SPIRV/GlslangToSpv.h"
|
||||||
|
#include "../../../glslang/Public/ShaderLang.h"
|
||||||
|
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
|
#define EMSCRIPTEN_KEEPALIVE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const TBuiltInResource DefaultTBuiltInResource = {
|
||||||
|
/* .MaxLights = */ 32,
|
||||||
|
/* .MaxClipPlanes = */ 6,
|
||||||
|
/* .MaxTextureUnits = */ 32,
|
||||||
|
/* .MaxTextureCoords = */ 32,
|
||||||
|
/* .MaxVertexAttribs = */ 64,
|
||||||
|
/* .MaxVertexUniformComponents = */ 4096,
|
||||||
|
/* .MaxVaryingFloats = */ 64,
|
||||||
|
/* .MaxVertexTextureImageUnits = */ 32,
|
||||||
|
/* .MaxCombinedTextureImageUnits = */ 80,
|
||||||
|
/* .MaxTextureImageUnits = */ 32,
|
||||||
|
/* .MaxFragmentUniformComponents = */ 4096,
|
||||||
|
/* .MaxDrawBuffers = */ 32,
|
||||||
|
/* .MaxVertexUniformVectors = */ 128,
|
||||||
|
/* .MaxVaryingVectors = */ 8,
|
||||||
|
/* .MaxFragmentUniformVectors = */ 16,
|
||||||
|
/* .MaxVertexOutputVectors = */ 16,
|
||||||
|
/* .MaxFragmentInputVectors = */ 15,
|
||||||
|
/* .MinProgramTexelOffset = */ -8,
|
||||||
|
/* .MaxProgramTexelOffset = */ 7,
|
||||||
|
/* .MaxClipDistances = */ 8,
|
||||||
|
/* .MaxComputeWorkGroupCountX = */ 65535,
|
||||||
|
/* .MaxComputeWorkGroupCountY = */ 65535,
|
||||||
|
/* .MaxComputeWorkGroupCountZ = */ 65535,
|
||||||
|
/* .MaxComputeWorkGroupSizeX = */ 1024,
|
||||||
|
/* .MaxComputeWorkGroupSizeY = */ 1024,
|
||||||
|
/* .MaxComputeWorkGroupSizeZ = */ 64,
|
||||||
|
/* .MaxComputeUniformComponents = */ 1024,
|
||||||
|
/* .MaxComputeTextureImageUnits = */ 16,
|
||||||
|
/* .MaxComputeImageUniforms = */ 8,
|
||||||
|
/* .MaxComputeAtomicCounters = */ 8,
|
||||||
|
/* .MaxComputeAtomicCounterBuffers = */ 1,
|
||||||
|
/* .MaxVaryingComponents = */ 60,
|
||||||
|
/* .MaxVertexOutputComponents = */ 64,
|
||||||
|
/* .MaxGeometryInputComponents = */ 64,
|
||||||
|
/* .MaxGeometryOutputComponents = */ 128,
|
||||||
|
/* .MaxFragmentInputComponents = */ 128,
|
||||||
|
/* .MaxImageUnits = */ 8,
|
||||||
|
/* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8,
|
||||||
|
/* .MaxCombinedShaderOutputResources = */ 8,
|
||||||
|
/* .MaxImageSamples = */ 0,
|
||||||
|
/* .MaxVertexImageUniforms = */ 0,
|
||||||
|
/* .MaxTessControlImageUniforms = */ 0,
|
||||||
|
/* .MaxTessEvaluationImageUniforms = */ 0,
|
||||||
|
/* .MaxGeometryImageUniforms = */ 0,
|
||||||
|
/* .MaxFragmentImageUniforms = */ 8,
|
||||||
|
/* .MaxCombinedImageUniforms = */ 8,
|
||||||
|
/* .MaxGeometryTextureImageUnits = */ 16,
|
||||||
|
/* .MaxGeometryOutputVertices = */ 256,
|
||||||
|
/* .MaxGeometryTotalOutputComponents = */ 1024,
|
||||||
|
/* .MaxGeometryUniformComponents = */ 1024,
|
||||||
|
/* .MaxGeometryVaryingComponents = */ 64,
|
||||||
|
/* .MaxTessControlInputComponents = */ 128,
|
||||||
|
/* .MaxTessControlOutputComponents = */ 128,
|
||||||
|
/* .MaxTessControlTextureImageUnits = */ 16,
|
||||||
|
/* .MaxTessControlUniformComponents = */ 1024,
|
||||||
|
/* .MaxTessControlTotalOutputComponents = */ 4096,
|
||||||
|
/* .MaxTessEvaluationInputComponents = */ 128,
|
||||||
|
/* .MaxTessEvaluationOutputComponents = */ 128,
|
||||||
|
/* .MaxTessEvaluationTextureImageUnits = */ 16,
|
||||||
|
/* .MaxTessEvaluationUniformComponents = */ 1024,
|
||||||
|
/* .MaxTessPatchComponents = */ 120,
|
||||||
|
/* .MaxPatchVertices = */ 32,
|
||||||
|
/* .MaxTessGenLevel = */ 64,
|
||||||
|
/* .MaxViewports = */ 16,
|
||||||
|
/* .MaxVertexAtomicCounters = */ 0,
|
||||||
|
/* .MaxTessControlAtomicCounters = */ 0,
|
||||||
|
/* .MaxTessEvaluationAtomicCounters = */ 0,
|
||||||
|
/* .MaxGeometryAtomicCounters = */ 0,
|
||||||
|
/* .MaxFragmentAtomicCounters = */ 8,
|
||||||
|
/* .MaxCombinedAtomicCounters = */ 8,
|
||||||
|
/* .MaxAtomicCounterBindings = */ 1,
|
||||||
|
/* .MaxVertexAtomicCounterBuffers = */ 0,
|
||||||
|
/* .MaxTessControlAtomicCounterBuffers = */ 0,
|
||||||
|
/* .MaxTessEvaluationAtomicCounterBuffers = */ 0,
|
||||||
|
/* .MaxGeometryAtomicCounterBuffers = */ 0,
|
||||||
|
/* .MaxFragmentAtomicCounterBuffers = */ 1,
|
||||||
|
/* .MaxCombinedAtomicCounterBuffers = */ 1,
|
||||||
|
/* .MaxAtomicCounterBufferSize = */ 16384,
|
||||||
|
/* .MaxTransformFeedbackBuffers = */ 4,
|
||||||
|
/* .MaxTransformFeedbackInterleavedComponents = */ 64,
|
||||||
|
/* .MaxCullDistances = */ 8,
|
||||||
|
/* .MaxCombinedClipAndCullDistances = */ 8,
|
||||||
|
/* .MaxSamples = */ 4,
|
||||||
|
/* .maxMeshOutputVerticesNV = */ 256,
|
||||||
|
/* .maxMeshOutputPrimitivesNV = */ 512,
|
||||||
|
/* .maxMeshWorkGroupSizeX_NV = */ 32,
|
||||||
|
/* .maxMeshWorkGroupSizeY_NV = */ 1,
|
||||||
|
/* .maxMeshWorkGroupSizeZ_NV = */ 1,
|
||||||
|
/* .maxTaskWorkGroupSizeX_NV = */ 32,
|
||||||
|
/* .maxTaskWorkGroupSizeY_NV = */ 1,
|
||||||
|
/* .maxTaskWorkGroupSizeZ_NV = */ 1,
|
||||||
|
/* .maxMeshViewCountNV = */ 4,
|
||||||
|
|
||||||
|
/* .limits = */ {
|
||||||
|
/* .nonInductiveForLoops = */ 1,
|
||||||
|
/* .whileLoops = */ 1,
|
||||||
|
/* .doWhileLoops = */ 1,
|
||||||
|
/* .generalUniformIndexing = */ 1,
|
||||||
|
/* .generalAttributeMatrixVectorIndexing = */ 1,
|
||||||
|
/* .generalVaryingIndexing = */ 1,
|
||||||
|
/* .generalSamplerIndexing = */ 1,
|
||||||
|
/* .generalVariableIndexing = */ 1,
|
||||||
|
/* .generalConstantMatrixVectorIndexing = */ 1,
|
||||||
|
}};
|
||||||
|
|
||||||
|
static bool initialized = false;
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Takes in a GLSL shader as a string and converts it to SPIR-V in binary form.
|
||||||
|
*
|
||||||
|
* |glsl| Null-terminated string containing the shader to be converted.
|
||||||
|
* |stage_int| Magic number indicating the type of shader being processed.
|
||||||
|
* Legal values are as follows:
|
||||||
|
* Vertex = 0
|
||||||
|
* Fragment = 4
|
||||||
|
* Compute = 5
|
||||||
|
* |gen_debug| Flag to indicate if debug information should be generated.
|
||||||
|
* |spirv| Output parameter for a pointer to the resulting SPIR-V data.
|
||||||
|
* |spirv_len| Output parameter for the length of the output binary buffer.
|
||||||
|
*
|
||||||
|
* Returns a void* pointer which, if not null, must be destroyed by
|
||||||
|
* destroy_output_buffer.o. (This is not the same pointer returned in |spirv|.)
|
||||||
|
* If null, the compilation failed.
|
||||||
|
*/
|
||||||
|
EMSCRIPTEN_KEEPALIVE
|
||||||
|
void* convert_glsl_to_spirv(const char* glsl, int stage_int, bool gen_debug, uint32_t** spirv, size_t* spirv_len)
|
||||||
|
{
|
||||||
|
if (glsl == nullptr) {
|
||||||
|
fprintf(stderr, "Input pointer null\n");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
if (spirv == nullptr || spirv_len == nullptr) {
|
||||||
|
fprintf(stderr, "Output pointer null\n");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
*spirv = nullptr;
|
||||||
|
*spirv_len = 0;
|
||||||
|
|
||||||
|
if (stage_int != 0 && stage_int != 4 && stage_int != 5) {
|
||||||
|
fprintf(stderr, "Invalid shader stage\n");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
EShLanguage stage = static_cast<EShLanguage>(stage_int);
|
||||||
|
|
||||||
|
if (!initialized) {
|
||||||
|
glslang::InitializeProcess();
|
||||||
|
initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
glslang::TShader shader(stage);
|
||||||
|
shader.setStrings(&glsl, 1);
|
||||||
|
shader.setEnvInput(glslang::EShSourceGlsl, stage, glslang::EShClientVulkan, 100);
|
||||||
|
shader.setEnvClient(glslang::EShClientVulkan, glslang::EShTargetVulkan_1_1);
|
||||||
|
shader.setEnvTarget(glslang::EShTargetSpv, glslang::EShTargetSpv_1_3);
|
||||||
|
if (!shader.parse(&DefaultTBuiltInResource, 100, true, EShMsgDefault)) {
|
||||||
|
fprintf(stderr, "Parse failed\n");
|
||||||
|
fprintf(stderr, "%s\n", shader.getInfoLog());
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
glslang::TProgram program;
|
||||||
|
program.addShader(&shader);
|
||||||
|
if (!program.link(EShMsgDefault)) {
|
||||||
|
fprintf(stderr, "Link failed\n");
|
||||||
|
fprintf(stderr, "%s\n", program.getInfoLog());
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
glslang::SpvOptions spvOptions;
|
||||||
|
spvOptions.generateDebugInfo = gen_debug;
|
||||||
|
spvOptions.optimizeSize = false;
|
||||||
|
spvOptions.disassemble = false;
|
||||||
|
spvOptions.validate = false;
|
||||||
|
|
||||||
|
std::vector<uint32_t>* output = new std::vector<uint32_t>;
|
||||||
|
glslang::GlslangToSpv(*program.getIntermediate(stage), *output, nullptr, &spvOptions);
|
||||||
|
|
||||||
|
*spirv_len = output->size();
|
||||||
|
*spirv = output->data();
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys a buffer created by convert_glsl_to_spirv
|
||||||
|
*/
|
||||||
|
EMSCRIPTEN_KEEPALIVE
|
||||||
|
void destroy_output_buffer(void* p)
|
||||||
|
{
|
||||||
|
delete static_cast<std::vector<uint32_t>*>(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // extern "C"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For non-Emscripten builds we supply a generic main, so that the glslang.js
|
||||||
|
* build target can generate an executable with a trivial use case instead of
|
||||||
|
* generating a WASM binary. This is done so that there is a target that can be
|
||||||
|
* built and output analyzed using desktop tools, since WASM binaries are
|
||||||
|
* specific to the Emscripten toolchain.
|
||||||
|
*/
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
|
int main() {
|
||||||
|
const char* input = R"(#version 310 es
|
||||||
|
|
||||||
|
void main() { })";
|
||||||
|
|
||||||
|
uint32_t* output;
|
||||||
|
size_t output_len;
|
||||||
|
|
||||||
|
void* id = convert_glsl_to_spirv(input, 4, false, &output, &output_len);
|
||||||
|
assert(output != nullptr);
|
||||||
|
assert(output_len != 0);
|
||||||
|
destroy_output_buffer(id);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif // ifndef __EMSCRIPTEN__
|
45
thirdparty/glslang/glslang/OSDependent/Web/glslang.pre.js
vendored
Normal file
45
thirdparty/glslang/glslang/OSDependent/Web/glslang.pre.js
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
Module['compileGLSLZeroCopy'] = function(glsl, shader_stage, gen_debug) {
|
||||||
|
gen_debug = !!gen_debug;
|
||||||
|
|
||||||
|
var shader_stage_int;
|
||||||
|
if (shader_stage === 'vertex') {
|
||||||
|
shader_stage_int = 0;
|
||||||
|
} else if (shader_stage === 'fragment') {
|
||||||
|
shader_stage_int = 4;
|
||||||
|
} else if (shader_stage === 'compute') {
|
||||||
|
shader_stage_int = 5;
|
||||||
|
} else {
|
||||||
|
throw new Error("shader_stage must be 'vertex', 'fragment', or 'compute'");
|
||||||
|
}
|
||||||
|
|
||||||
|
var p_output = Module['_malloc'](4);
|
||||||
|
var p_output_len = Module['_malloc'](4);
|
||||||
|
var id = ccall('convert_glsl_to_spirv',
|
||||||
|
'number',
|
||||||
|
['string', 'number', 'boolean', 'number', 'number'],
|
||||||
|
[glsl, shader_stage_int, gen_debug, p_output, p_output_len]);
|
||||||
|
var output = getValue(p_output, 'i32');
|
||||||
|
var output_len = getValue(p_output_len, 'i32');
|
||||||
|
Module['_free'](p_output);
|
||||||
|
Module['_free'](p_output_len);
|
||||||
|
|
||||||
|
if (id === 0) {
|
||||||
|
throw new Error('GLSL compilation failed');
|
||||||
|
}
|
||||||
|
|
||||||
|
var ret = {};
|
||||||
|
var outputIndexU32 = output / 4;
|
||||||
|
ret['data'] = Module['HEAPU32'].subarray(outputIndexU32, outputIndexU32 + output_len);
|
||||||
|
ret['free'] = function() {
|
||||||
|
Module['_destroy_output_buffer'](id);
|
||||||
|
};
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
|
||||||
|
Module['compileGLSL'] = function(glsl, shader_stage, gen_debug) {
|
||||||
|
var compiled = Module['compileGLSLZeroCopy'](glsl, shader_stage, gen_debug);
|
||||||
|
var ret = compiled['data'].slice()
|
||||||
|
compiled['free']();
|
||||||
|
return ret;
|
||||||
|
};
|
118
thirdparty/glslang/glslang/Public/ShaderLang.h
vendored
Normal file → Executable file
118
thirdparty/glslang/glslang/Public/ShaderLang.h
vendored
Normal file → Executable file
@ -68,7 +68,7 @@
|
|||||||
// This should always increase, as some paths to do not consume
|
// This should always increase, as some paths to do not consume
|
||||||
// a more major number.
|
// a more major number.
|
||||||
// It should increment by one when new functionality is added.
|
// It should increment by one when new functionality is added.
|
||||||
#define GLSLANG_MINOR_VERSION 12
|
#define GLSLANG_MINOR_VERSION 13
|
||||||
|
|
||||||
//
|
//
|
||||||
// Call before doing any other compiler/linker operations.
|
// Call before doing any other compiler/linker operations.
|
||||||
@ -126,36 +126,38 @@ class TType;
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EShSourceNone,
|
EShSourceNone,
|
||||||
EShSourceGlsl,
|
EShSourceGlsl, // GLSL, includes ESSL (OpenGL ES GLSL)
|
||||||
EShSourceHlsl,
|
EShSourceHlsl, // HLSL
|
||||||
} EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead
|
} EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EShClientNone,
|
EShClientNone, // use when there is no client, e.g. for validation
|
||||||
EShClientVulkan,
|
EShClientVulkan,
|
||||||
EShClientOpenGL,
|
EShClientOpenGL,
|
||||||
} EShClient;
|
} EShClient;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EShTargetNone,
|
EShTargetNone,
|
||||||
EShTargetSpv, // preferred spelling
|
EShTargetSpv, // SPIR-V (preferred spelling)
|
||||||
EshTargetSpv = EShTargetSpv, // legacy spelling
|
EshTargetSpv = EShTargetSpv, // legacy spelling
|
||||||
} EShTargetLanguage;
|
} EShTargetLanguage;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EShTargetVulkan_1_0 = (1 << 22),
|
EShTargetVulkan_1_0 = (1 << 22), // Vulkan 1.0
|
||||||
EShTargetVulkan_1_1 = (1 << 22) | (1 << 12),
|
EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), // Vulkan 1.1
|
||||||
EShTargetOpenGL_450 = 450,
|
EShTargetVulkan_1_2 = (1 << 22) | (2 << 12), // Vulkan 1.2
|
||||||
|
EShTargetOpenGL_450 = 450, // OpenGL
|
||||||
} EShTargetClientVersion;
|
} EShTargetClientVersion;
|
||||||
|
|
||||||
typedef EShTargetClientVersion EshTargetClientVersion;
|
typedef EShTargetClientVersion EshTargetClientVersion;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EShTargetSpv_1_0 = (1 << 16),
|
EShTargetSpv_1_0 = (1 << 16), // SPIR-V 1.0
|
||||||
EShTargetSpv_1_1 = (1 << 16) | (1 << 8),
|
EShTargetSpv_1_1 = (1 << 16) | (1 << 8), // SPIR-V 1.1
|
||||||
EShTargetSpv_1_2 = (1 << 16) | (2 << 8),
|
EShTargetSpv_1_2 = (1 << 16) | (2 << 8), // SPIR-V 1.2
|
||||||
EShTargetSpv_1_3 = (1 << 16) | (3 << 8),
|
EShTargetSpv_1_3 = (1 << 16) | (3 << 8), // SPIR-V 1.3
|
||||||
EShTargetSpv_1_4 = (1 << 16) | (4 << 8),
|
EShTargetSpv_1_4 = (1 << 16) | (4 << 8), // SPIR-V 1.4
|
||||||
|
EShTargetSpv_1_5 = (1 << 16) | (5 << 8), // SPIR-V 1.5
|
||||||
} EShTargetLanguageVersion;
|
} EShTargetLanguageVersion;
|
||||||
|
|
||||||
struct TInputLanguage {
|
struct TInputLanguage {
|
||||||
@ -432,15 +434,42 @@ public:
|
|||||||
void addUniformLocationOverride(const char* name, int loc);
|
void addUniformLocationOverride(const char* name, int loc);
|
||||||
void setUniformLocationBase(int base);
|
void setUniformLocationBase(int base);
|
||||||
void setInvertY(bool invert);
|
void setInvertY(bool invert);
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
void setHlslIoMapping(bool hlslIoMap);
|
void setHlslIoMapping(bool hlslIoMap);
|
||||||
void setFlattenUniformArrays(bool flatten);
|
void setFlattenUniformArrays(bool flatten);
|
||||||
|
#endif
|
||||||
void setNoStorageFormat(bool useUnknownFormat);
|
void setNoStorageFormat(bool useUnknownFormat);
|
||||||
|
void setNanMinMaxClamp(bool nanMinMaxClamp);
|
||||||
void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode);
|
void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode);
|
||||||
|
|
||||||
// For setting up the environment (cleared to nothingness in the constructor).
|
// For setting up the environment (cleared to nothingness in the constructor).
|
||||||
// These must be called so that parsing is done for the right source language and
|
// These must be called so that parsing is done for the right source language and
|
||||||
// target environment, either indirectly through TranslateEnvironment() based on
|
// target environment, either indirectly through TranslateEnvironment() based on
|
||||||
// EShMessages et. al., or directly by the user.
|
// EShMessages et. al., or directly by the user.
|
||||||
|
//
|
||||||
|
// setEnvInput: The input source language and stage. If generating code for a
|
||||||
|
// specific client, the input client semantics to use and the
|
||||||
|
// version of the that client's input semantics to use, otherwise
|
||||||
|
// use EShClientNone and version of 0, e.g. for validation mode.
|
||||||
|
// Note 'version' does not describe the target environment,
|
||||||
|
// just the version of the source dialect to compile under.
|
||||||
|
//
|
||||||
|
// See the definitions of TEnvironment, EShSource, EShLanguage,
|
||||||
|
// and EShClient for choices and more detail.
|
||||||
|
//
|
||||||
|
// setEnvClient: The client that will be hosting the execution, and it's version.
|
||||||
|
// Note 'version' is not the version of the languages involved, but
|
||||||
|
// the version of the client environment.
|
||||||
|
// Use EShClientNone and version of 0 if there is no client, e.g.
|
||||||
|
// for validation mode.
|
||||||
|
//
|
||||||
|
// See EShTargetClientVersion for choices.
|
||||||
|
//
|
||||||
|
// setEnvTarget: The language to translate to when generating code, and that
|
||||||
|
// language's version.
|
||||||
|
// Use EShTargetNone and version of 0 if there is no client, e.g.
|
||||||
|
// for validation mode.
|
||||||
|
//
|
||||||
void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version)
|
void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version)
|
||||||
{
|
{
|
||||||
environment.input.languageFamily = lang;
|
environment.input.languageFamily = lang;
|
||||||
@ -458,8 +487,15 @@ public:
|
|||||||
environment.target.language = lang;
|
environment.target.language = lang;
|
||||||
environment.target.version = version;
|
environment.target.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; }
|
||||||
|
|
||||||
|
#ifdef ENABLE_HLSL
|
||||||
void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; }
|
void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; }
|
||||||
bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; }
|
bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; }
|
||||||
|
#else
|
||||||
|
bool getEnvTargetHlslFunctionality1() const { return false; }
|
||||||
|
#endif
|
||||||
|
|
||||||
// Interface to #include handlers.
|
// Interface to #include handlers.
|
||||||
//
|
//
|
||||||
@ -610,6 +646,8 @@ private:
|
|||||||
TShader& operator=(TShader&);
|
TShader& operator=(TShader&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
//
|
//
|
||||||
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
|
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
|
||||||
//
|
//
|
||||||
@ -647,6 +685,7 @@ protected:
|
|||||||
|
|
||||||
class TReflection;
|
class TReflection;
|
||||||
class TIoMapper;
|
class TIoMapper;
|
||||||
|
struct TVarEntryInfo;
|
||||||
|
|
||||||
// Allows to customize the binding layout after linking.
|
// Allows to customize the binding layout after linking.
|
||||||
// All used uniform variables will invoke at least validateBinding.
|
// All used uniform variables will invoke at least validateBinding.
|
||||||
@ -678,42 +717,54 @@ public:
|
|||||||
|
|
||||||
// Should return true if the resulting/current binding would be okay.
|
// Should return true if the resulting/current binding would be okay.
|
||||||
// Basic idea is to do aliasing binding checks with this.
|
// Basic idea is to do aliasing binding checks with this.
|
||||||
virtual bool validateBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual bool validateBinding(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Should return a value >= 0 if the current binding should be overridden.
|
// Should return a value >= 0 if the current binding should be overridden.
|
||||||
// Return -1 if the current binding (including no binding) should be kept.
|
// Return -1 if the current binding (including no binding) should be kept.
|
||||||
virtual int resolveBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual int resolveBinding(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Should return a value >= 0 if the current set should be overridden.
|
// Should return a value >= 0 if the current set should be overridden.
|
||||||
// Return -1 if the current set (including no set) should be kept.
|
// Return -1 if the current set (including no set) should be kept.
|
||||||
virtual int resolveSet(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual int resolveSet(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Should return a value >= 0 if the current location should be overridden.
|
// Should return a value >= 0 if the current location should be overridden.
|
||||||
// Return -1 if the current location (including no location) should be kept.
|
// Return -1 if the current location (including no location) should be kept.
|
||||||
virtual int resolveUniformLocation(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual int resolveUniformLocation(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Should return true if the resulting/current setup would be okay.
|
// Should return true if the resulting/current setup would be okay.
|
||||||
// Basic idea is to do aliasing checks and reject invalid semantic names.
|
// Basic idea is to do aliasing checks and reject invalid semantic names.
|
||||||
virtual bool validateInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual bool validateInOut(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Should return a value >= 0 if the current location should be overridden.
|
// Should return a value >= 0 if the current location should be overridden.
|
||||||
// Return -1 if the current location (including no location) should be kept.
|
// Return -1 if the current location (including no location) should be kept.
|
||||||
virtual int resolveInOutLocation(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Should return a value >= 0 if the current component index should be overridden.
|
// Should return a value >= 0 if the current component index should be overridden.
|
||||||
// Return -1 if the current component index (including no index) should be kept.
|
// Return -1 if the current component index (including no index) should be kept.
|
||||||
virtual int resolveInOutComponent(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual int resolveInOutComponent(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Should return a value >= 0 if the current color index should be overridden.
|
// Should return a value >= 0 if the current color index should be overridden.
|
||||||
// Return -1 if the current color index (including no index) should be kept.
|
// Return -1 if the current color index (including no index) should be kept.
|
||||||
virtual int resolveInOutIndex(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual int resolveInOutIndex(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Notification of a uniform variable
|
// Notification of a uniform variable
|
||||||
virtual void notifyBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual void notifyBinding(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Notification of a in or out variable
|
// Notification of a in or out variable
|
||||||
virtual void notifyInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
virtual void notifyInOut(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||||
// Called by mapIO when it has finished the notify pass
|
|
||||||
virtual void endNotifications(EShLanguage stage) = 0;
|
|
||||||
// Called by mapIO when it starts its notify pass for the given stage
|
// Called by mapIO when it starts its notify pass for the given stage
|
||||||
virtual void beginNotifications(EShLanguage stage) = 0;
|
virtual void beginNotifications(EShLanguage stage) = 0;
|
||||||
|
// Called by mapIO when it has finished the notify pass
|
||||||
|
virtual void endNotifications(EShLanguage stage) = 0;
|
||||||
// Called by mipIO when it starts its resolve pass for the given stage
|
// Called by mipIO when it starts its resolve pass for the given stage
|
||||||
virtual void beginResolve(EShLanguage stage) = 0;
|
virtual void beginResolve(EShLanguage stage) = 0;
|
||||||
// Called by mapIO when it has finished the resolve pass
|
// Called by mapIO when it has finished the resolve pass
|
||||||
virtual void endResolve(EShLanguage stage) = 0;
|
virtual void endResolve(EShLanguage stage) = 0;
|
||||||
|
// Called by mapIO when it starts its symbol collect for teh given stage
|
||||||
|
virtual void beginCollect(EShLanguage stage) = 0;
|
||||||
|
// Called by mapIO when it has finished the symbol collect
|
||||||
|
virtual void endCollect(EShLanguage stage) = 0;
|
||||||
|
// Called by TSlotCollector to resolve storage locations or bindings
|
||||||
|
virtual void reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0;
|
||||||
|
// Called by TSlotCollector to resolve resource locations or bindings
|
||||||
|
virtual void reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0;
|
||||||
|
// Called by mapIO.addStage to set shader stage mask to mark a stage be added to this pipeline
|
||||||
|
virtual void addStage(EShLanguage stage) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // GLSLANG_WEB
|
||||||
|
|
||||||
// Make one TProgram per set of shaders that will get linked together. Add all
|
// Make one TProgram per set of shaders that will get linked together. Add all
|
||||||
// the shaders that are to be linked together. After calling shader.parse()
|
// the shaders that are to be linked together. After calling shader.parse()
|
||||||
// for all shaders, call link().
|
// for all shaders, call link().
|
||||||
@ -725,7 +776,7 @@ public:
|
|||||||
TProgram();
|
TProgram();
|
||||||
virtual ~TProgram();
|
virtual ~TProgram();
|
||||||
void addShader(TShader* shader) { stages[shader->stage].push_back(shader); }
|
void addShader(TShader* shader) { stages[shader->stage].push_back(shader); }
|
||||||
|
std::list<TShader*>& getShaders(EShLanguage stage) { return stages[stage]; }
|
||||||
// Link Validation interface
|
// Link Validation interface
|
||||||
bool link(EShMessages);
|
bool link(EShMessages);
|
||||||
const char* getInfoLog();
|
const char* getInfoLog();
|
||||||
@ -733,14 +784,15 @@ public:
|
|||||||
|
|
||||||
TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; }
|
TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; }
|
||||||
|
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
|
|
||||||
// Reflection Interface
|
// Reflection Interface
|
||||||
|
|
||||||
// call first, to do liveness analysis, index mapping, etc.; returns false on failure
|
// call first, to do liveness analysis, index mapping, etc.; returns false on failure
|
||||||
bool buildReflection(int opts = EShReflectionDefault);
|
bool buildReflection(int opts = EShReflectionDefault);
|
||||||
|
|
||||||
unsigned getLocalSize(int dim) const; // return dim'th local size
|
unsigned getLocalSize(int dim) const; // return dim'th local size
|
||||||
int getReflectionIndex(const char *name) const;
|
int getReflectionIndex(const char *name) const;
|
||||||
|
int getReflectionPipeIOIndex(const char* name, const bool inOrOut) const;
|
||||||
int getNumUniformVariables() const;
|
int getNumUniformVariables() const;
|
||||||
const TObjectReflection& getUniform(int index) const;
|
const TObjectReflection& getUniform(int index) const;
|
||||||
int getNumUniformBlocks() const;
|
int getNumUniformBlocks() const;
|
||||||
@ -770,6 +822,9 @@ public:
|
|||||||
// can be used for glGetUniformIndices()
|
// can be used for glGetUniformIndices()
|
||||||
int getUniformIndex(const char *name) const { return getReflectionIndex(name); }
|
int getUniformIndex(const char *name) const { return getReflectionIndex(name); }
|
||||||
|
|
||||||
|
int getPipeIOIndex(const char *name, const bool inOrOut) const
|
||||||
|
{ return getReflectionPipeIOIndex(name, inOrOut); }
|
||||||
|
|
||||||
// can be used for "name" part of glGetActiveUniform()
|
// can be used for "name" part of glGetActiveUniform()
|
||||||
const char *getUniformName(int index) const { return getUniform(index).name.c_str(); }
|
const char *getUniformName(int index) const { return getUniform(index).name.c_str(); }
|
||||||
|
|
||||||
@ -819,11 +874,11 @@ public:
|
|||||||
const TType *getAttributeTType(int index) const { return getPipeInput(index).getType(); }
|
const TType *getAttributeTType(int index) const { return getPipeInput(index).getType(); }
|
||||||
|
|
||||||
void dumpReflection();
|
void dumpReflection();
|
||||||
|
|
||||||
// I/O mapping: apply base offsets and map live unbound variables
|
// I/O mapping: apply base offsets and map live unbound variables
|
||||||
// If resolver is not provided it uses the previous approach
|
// If resolver is not provided it uses the previous approach
|
||||||
// and respects auto assignment and offsets.
|
// and respects auto assignment and offsets.
|
||||||
bool mapIO(TIoMapResolver* resolver = NULL);
|
bool mapIO(TIoMapResolver* pResolver = nullptr, TIoMapper* pIoMapper = nullptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool linkStage(EShLanguage, EShMessages);
|
bool linkStage(EShLanguage, EShMessages);
|
||||||
@ -833,8 +888,9 @@ protected:
|
|||||||
TIntermediate* intermediate[EShLangCount];
|
TIntermediate* intermediate[EShLangCount];
|
||||||
bool newedIntermediate[EShLangCount]; // track which intermediate were "new" versus reusing a singleton unit in a stage
|
bool newedIntermediate[EShLangCount]; // track which intermediate were "new" versus reusing a singleton unit in a stage
|
||||||
TInfoSink* infoSink;
|
TInfoSink* infoSink;
|
||||||
|
#ifndef GLSLANG_WEB
|
||||||
TReflection* reflection;
|
TReflection* reflection;
|
||||||
TIoMapper* ioMapper;
|
#endif
|
||||||
bool linked;
|
bool linked;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
15
thirdparty/glslang/patches/fix-mingw-snprintf.patch
vendored
Normal file
15
thirdparty/glslang/patches/fix-mingw-snprintf.patch
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
diff --git a/thirdparty/glslang/glslang/Include/Common.h b/thirdparty/glslang/glslang/Include/Common.h
|
||||||
|
index 733a790cfd..2c511bc1c5 100644
|
||||||
|
--- a/thirdparty/glslang/glslang/Include/Common.h
|
||||||
|
+++ b/thirdparty/glslang/glslang/Include/Common.h
|
||||||
|
@@ -50,7 +50,9 @@ std::string to_string(const T& val) {
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
|
||||||
|
+// -- GODOT start --
|
||||||
|
+#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) /* || defined MINGW_HAS_SECURE_API */
|
||||||
|
+// -- GODOT end --
|
||||||
|
#include <basetsd.h>
|
||||||
|
#ifndef snprintf
|
||||||
|
#define snprintf sprintf_s
|
37231
thirdparty/vulkan/include/vulkan/vulkan.hpp
vendored
37231
thirdparty/vulkan/include/vulkan/vulkan.hpp
vendored
File diff suppressed because it is too large
Load Diff
1676
thirdparty/vulkan/include/vulkan/vulkan_core.h
vendored
1676
thirdparty/vulkan/include/vulkan/vulkan_core.h
vendored
File diff suppressed because it is too large
Load Diff
19
thirdparty/vulkan/loader/extension_manual.c
vendored
19
thirdparty/vulkan/loader/extension_manual.c
vendored
@ -441,3 +441,22 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModes2EXT(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // VK_USE_PLATFORM_WIN32_KHR
|
#endif // VK_USE_PLATFORM_WIN32_KHR
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension trampoline/terminators
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceToolPropertiesEXT(
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
uint32_t* pToolCount,
|
||||||
|
VkPhysicalDeviceToolPropertiesEXT* pToolProperties) {
|
||||||
|
const VkLayerInstanceDispatchTable *disp;
|
||||||
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
||||||
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
||||||
|
return disp->GetPhysicalDeviceToolPropertiesEXT(unwrapped_phys_dev, pToolCount, pToolProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceToolPropertiesEXT(
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
uint32_t* pToolCount,
|
||||||
|
VkPhysicalDeviceToolPropertiesEXT* pToolProperties) {
|
||||||
|
return VK_SUCCESS;
|
||||||
|
}
|
||||||
|
12
thirdparty/vulkan/loader/extension_manual.h
vendored
12
thirdparty/vulkan/loader/extension_manual.h
vendored
@ -104,3 +104,15 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModes2EXT(
|
|||||||
VkDevice device,
|
VkDevice device,
|
||||||
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
||||||
VkDeviceGroupPresentModeFlagsKHR* pModes);
|
VkDeviceGroupPresentModeFlagsKHR* pModes);
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension trampoline/terminators
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceToolPropertiesEXT(
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
uint32_t* pToolCount,
|
||||||
|
VkPhysicalDeviceToolPropertiesEXT* pToolProperties);
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceToolPropertiesEXT(
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
uint32_t* pToolCount,
|
||||||
|
VkPhysicalDeviceToolPropertiesEXT* pToolProperties);
|
||||||
|
21
thirdparty/vulkan/loader/gpa_helper.h
vendored
21
thirdparty/vulkan/loader/gpa_helper.h
vendored
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 The Khronos Group Inc.
|
* Copyright (c) 2015-18, 2020 The Khronos Group Inc.
|
||||||
* Copyright (c) 2015 Valve Corporation
|
* Copyright (c) 2015-18, 2020 Valve Corporation
|
||||||
* Copyright (c) 2015 LunarG, Inc.
|
* Copyright (c) 2015-18, 2020 LunarG, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -190,6 +190,21 @@ static inline void *trampolineGetProcAddr(struct loader_instance *inst, const ch
|
|||||||
if (!strcmp(funcName, "vkGetImageSparseMemoryRequirements2")) return vkGetImageSparseMemoryRequirements2;
|
if (!strcmp(funcName, "vkGetImageSparseMemoryRequirements2")) return vkGetImageSparseMemoryRequirements2;
|
||||||
if (!strcmp(funcName, "vkGetBufferMemoryRequirements2")) return vkGetBufferMemoryRequirements2;
|
if (!strcmp(funcName, "vkGetBufferMemoryRequirements2")) return vkGetBufferMemoryRequirements2;
|
||||||
|
|
||||||
|
// Core 1.2 functions
|
||||||
|
if (!strcmp(funcName, "vkCreateRenderPass2")) return vkCreateRenderPass2;
|
||||||
|
if (!strcmp(funcName, "vkCmdBeginRenderPass2")) return vkCmdBeginRenderPass2;
|
||||||
|
if (!strcmp(funcName, "vkCmdNextSubpass2")) return vkCmdNextSubpass2;
|
||||||
|
if (!strcmp(funcName, "vkCmdEndRenderPass2")) return vkCmdEndRenderPass2;
|
||||||
|
if (!strcmp(funcName, "vkCmdDrawIndirectCount")) return vkCmdDrawIndirectCount;
|
||||||
|
if (!strcmp(funcName, "vkCmdDrawIndexedIndirectCount")) return vkCmdDrawIndexedIndirectCount;
|
||||||
|
if (!strcmp(funcName, "vkGetSemaphoreCounterValue")) return vkGetSemaphoreCounterValue;
|
||||||
|
if (!strcmp(funcName, "vkWaitSemaphores")) return vkWaitSemaphores;
|
||||||
|
if (!strcmp(funcName, "vkSignalSemaphore")) return vkSignalSemaphore;
|
||||||
|
if (!strcmp(funcName, "vkGetBufferDeviceAddress")) return vkGetBufferDeviceAddress;
|
||||||
|
if (!strcmp(funcName, "vkGetBufferOpaqueCaptureAddress")) return vkGetBufferOpaqueCaptureAddress;
|
||||||
|
if (!strcmp(funcName, "vkGetDeviceMemoryOpaqueCaptureAddress")) return vkGetDeviceMemoryOpaqueCaptureAddress;
|
||||||
|
if (!strcmp(funcName, "vkResetQueryPool")) return vkResetQueryPool;
|
||||||
|
|
||||||
// Instance extensions
|
// Instance extensions
|
||||||
void *addr;
|
void *addr;
|
||||||
if (debug_utils_InstanceGpa(inst, funcName, &addr)) return addr;
|
if (debug_utils_InstanceGpa(inst, funcName, &addr)) return addr;
|
||||||
|
167
thirdparty/vulkan/loader/loader.c
vendored
167
thirdparty/vulkan/loader/loader.c
vendored
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2019 The Khronos Group Inc.
|
* Copyright (c) 2014-2020 The Khronos Group Inc.
|
||||||
* Copyright (c) 2014-2019 Valve Corporation
|
* Copyright (c) 2014-2020 Valve Corporation
|
||||||
* Copyright (c) 2014-2019 LunarG, Inc.
|
* Copyright (c) 2014-2020 LunarG, Inc.
|
||||||
* Copyright (C) 2015 Google Inc.
|
* Copyright (C) 2015 Google Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -126,7 +126,7 @@ LOADER_PLATFORM_THREAD_ONCE_DECLARATION(once_init);
|
|||||||
|
|
||||||
// This loader supports Vulkan API version 1.1
|
// This loader supports Vulkan API version 1.1
|
||||||
uint32_t loader_major_version = 1;
|
uint32_t loader_major_version = 1;
|
||||||
uint32_t loader_minor_version = 1;
|
uint32_t loader_minor_version = 2;
|
||||||
|
|
||||||
void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope alloc_scope) {
|
void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope alloc_scope) {
|
||||||
void *pMemory = NULL;
|
void *pMemory = NULL;
|
||||||
@ -252,6 +252,7 @@ static inline char *loader_getenv(const char *name, const struct loader_instance
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline char *loader_secure_getenv(const char *name, const struct loader_instance *inst) {
|
static inline char *loader_secure_getenv(const char *name, const struct loader_instance *inst) {
|
||||||
|
char *out;
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// Apple does not appear to have a secure getenv implementation.
|
// Apple does not appear to have a secure getenv implementation.
|
||||||
// The main difference between secure getenv and getenv is that secure getenv
|
// The main difference between secure getenv and getenv is that secure getenv
|
||||||
@ -263,19 +264,21 @@ static inline char *loader_secure_getenv(const char *name, const struct loader_i
|
|||||||
return IsHighIntegrity() ? NULL : loader_getenv(name, inst);
|
return IsHighIntegrity() ? NULL : loader_getenv(name, inst);
|
||||||
#else
|
#else
|
||||||
// Linux
|
// Linux
|
||||||
#ifdef HAVE_SECURE_GETENV
|
#if defined(HAVE_SECURE_GETENV) && !defined(USE_UNSAFE_FILE_SEARCH)
|
||||||
(void)inst;
|
(void)inst;
|
||||||
return secure_getenv(name);
|
out = secure_getenv(name);
|
||||||
#elif defined(HAVE___SECURE_GETENV)
|
#elif defined(HAVE___SECURE_GETENV) && !defined(USE_UNSAFE_FILE_SEARCH)
|
||||||
(void)inst;
|
(void)inst;
|
||||||
return __secure_getenv(name);
|
out = __secure_getenv(name);
|
||||||
#else
|
#else
|
||||||
#pragma message( \
|
out = loader_getenv(name, inst);
|
||||||
"Warning: Falling back to non-secure getenv for environmental lookups! Consider" \
|
|
||||||
" updating to a different libc.")
|
|
||||||
return loader_getenv(name, inst);
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
if (out == NULL) {
|
||||||
|
loader_log(inst, LOADER_INFO_BIT, 0,
|
||||||
|
"Loader is running with elevated permissions. Environment variable %s will be ignored.", name);
|
||||||
|
}
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void loader_free_getenv(char *val, const struct loader_instance *inst) {
|
static inline void loader_free_getenv(char *val, const struct loader_instance *inst) {
|
||||||
@ -335,9 +338,13 @@ static inline char *loader_getenv(const char *name, const struct loader_instance
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline char *loader_secure_getenv(const char *name, const struct loader_instance *inst) {
|
static inline char *loader_secure_getenv(const char *name, const struct loader_instance *inst) {
|
||||||
|
#if !defined(USE_UNSAFE_FILE_SEARCH)
|
||||||
if (IsHighIntegrity()) {
|
if (IsHighIntegrity()) {
|
||||||
|
loader_log(inst, LOADER_INFO_BIT, 0,
|
||||||
|
"Loader is running with elevated permissions. Environment variable %s will be ignored.", name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return loader_getenv(name, inst);
|
return loader_getenv(name, inst);
|
||||||
}
|
}
|
||||||
@ -578,7 +585,7 @@ static bool loaderAddJsonEntry(const struct loader_instance *inst,
|
|||||||
//
|
//
|
||||||
// This function looks for filename in given device handle, filename is then added to return list
|
// This function looks for filename in given device handle, filename is then added to return list
|
||||||
// function return true if filename was appended to reg_data list
|
// function return true if filename was appended to reg_data list
|
||||||
// If error occures result is updated with failure reason
|
// If error occurs result is updated with failure reason
|
||||||
bool loaderGetDeviceRegistryEntry(const struct loader_instance *inst, char **reg_data, PDWORD total_size, DEVINST dev_id,
|
bool loaderGetDeviceRegistryEntry(const struct loader_instance *inst, char **reg_data, PDWORD total_size, DEVINST dev_id,
|
||||||
LPCSTR value_name, VkResult *result) {
|
LPCSTR value_name, VkResult *result) {
|
||||||
HKEY hkrKey = INVALID_HANDLE_VALUE;
|
HKEY hkrKey = INVALID_HANDLE_VALUE;
|
||||||
@ -855,7 +862,6 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati
|
|||||||
char name[2048];
|
char name[2048];
|
||||||
char *loc = location;
|
char *loc = location;
|
||||||
char *next;
|
char *next;
|
||||||
DWORD idx;
|
|
||||||
DWORD name_size = sizeof(name);
|
DWORD name_size = sizeof(name);
|
||||||
DWORD value;
|
DWORD value;
|
||||||
DWORD value_size = sizeof(value);
|
DWORD value_size = sizeof(value);
|
||||||
@ -885,9 +891,9 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati
|
|||||||
access_flags = KEY_QUERY_VALUE;
|
access_flags = KEY_QUERY_VALUE;
|
||||||
rtn_value = RegOpenKeyEx(hive, loc, 0, access_flags, &key);
|
rtn_value = RegOpenKeyEx(hive, loc, 0, access_flags, &key);
|
||||||
if (ERROR_SUCCESS == rtn_value) {
|
if (ERROR_SUCCESS == rtn_value) {
|
||||||
idx = 0;
|
for (DWORD idx = 0;
|
||||||
while ((rtn_value = RegEnumValue(key, idx++, name, &name_size, NULL, NULL, (LPBYTE)&value, &value_size)) ==
|
(rtn_value = RegEnumValue(key, idx++, name, &name_size, NULL, NULL, (LPBYTE)&value, &value_size)) == ERROR_SUCCESS;
|
||||||
ERROR_SUCCESS) {
|
name_size = sizeof(name), value_size = sizeof(value)) {
|
||||||
if (value_size == sizeof(value) && value == 0) {
|
if (value_size == sizeof(value) && value == 0) {
|
||||||
if (NULL == *reg_data) {
|
if (NULL == *reg_data) {
|
||||||
*reg_data = loader_instance_heap_alloc(inst, *reg_data_size, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
|
*reg_data = loader_instance_heap_alloc(inst, *reg_data_size, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
|
||||||
@ -960,7 +966,7 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati
|
|||||||
|
|
||||||
if (!found_gpu) {
|
if (!found_gpu) {
|
||||||
loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
|
loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
|
||||||
"Dropping driver %s as no corresponduing DXGI adapter was found", name);
|
"Dropping driver %s as no corresponding DXGI adapter was found", name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -972,7 +978,7 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati
|
|||||||
found = true;
|
found = true;
|
||||||
} else {
|
} else {
|
||||||
// At this point the reg_data variable contains other JSON paths, likely from the PNP/device section
|
// At this point the reg_data variable contains other JSON paths, likely from the PNP/device section
|
||||||
// of the registry that we want to have precendence over this non-device specific section of the registry.
|
// of the registry that we want to have precedence over this non-device specific section of the registry.
|
||||||
// To make sure we avoid enumerating old JSON files/drivers that might be present in the non-device specific
|
// To make sure we avoid enumerating old JSON files/drivers that might be present in the non-device specific
|
||||||
// area of the registry when a newer device specific JSON file is present, do a check before adding.
|
// area of the registry when a newer device specific JSON file is present, do a check before adding.
|
||||||
// Find the file name, without path, of the JSON file found in the non-device specific registry location.
|
// Find the file name, without path, of the JSON file found in the non-device specific registry location.
|
||||||
@ -999,8 +1005,6 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
name_size = sizeof(name);
|
|
||||||
value_size = sizeof(value);
|
|
||||||
}
|
}
|
||||||
RegCloseKey(key);
|
RegCloseKey(key);
|
||||||
}
|
}
|
||||||
@ -2045,7 +2049,7 @@ out:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct loader_icd_term *loader_get_icd_and_device(const VkDevice device, struct loader_device **found_dev, uint32_t *icd_index) {
|
struct loader_icd_term *loader_get_icd_and_device(const void *device, struct loader_device **found_dev, uint32_t *icd_index) {
|
||||||
*found_dev = NULL;
|
*found_dev = NULL;
|
||||||
for (struct loader_instance *inst = loader.instances; inst; inst = inst->next) {
|
for (struct loader_instance *inst = loader.instances; inst; inst = inst->next) {
|
||||||
uint32_t index = 0;
|
uint32_t index = 0;
|
||||||
@ -2423,7 +2427,7 @@ static void loader_debug_init(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loader_initialize(void) {
|
void loader_initialize(void) {
|
||||||
// initialize mutexs
|
// initialize mutexes
|
||||||
loader_platform_thread_create_mutex(&loader_lock);
|
loader_platform_thread_create_mutex(&loader_lock);
|
||||||
loader_platform_thread_create_mutex(&loader_json_lock);
|
loader_platform_thread_create_mutex(&loader_json_lock);
|
||||||
|
|
||||||
@ -2450,7 +2454,7 @@ struct loader_data_files {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void loader_release() {
|
void loader_release() {
|
||||||
// release mutexs
|
// release mutexes
|
||||||
loader_platform_thread_delete_mutex(&loader_lock);
|
loader_platform_thread_delete_mutex(&loader_lock);
|
||||||
loader_platform_thread_delete_mutex(&loader_json_lock);
|
loader_platform_thread_delete_mutex(&loader_json_lock);
|
||||||
}
|
}
|
||||||
@ -2578,60 +2582,6 @@ out:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *std_validation_str = "VK_LAYER_LUNARG_standard_validation";
|
|
||||||
|
|
||||||
// Adds the legacy VK_LAYER_LUNARG_standard_validation as a meta-layer if it
|
|
||||||
// fails to find it in the list already. This is usually an indication that a
|
|
||||||
// newer loader is being used with an older layer set.
|
|
||||||
static bool loaderAddLegacyStandardValidationLayer(const struct loader_instance *inst,
|
|
||||||
struct loader_layer_list *layer_instance_list) {
|
|
||||||
uint32_t i;
|
|
||||||
bool success = true;
|
|
||||||
struct loader_layer_properties *props = loaderGetNextLayerPropertySlot(inst, layer_instance_list);
|
|
||||||
const char std_validation_names[6][VK_MAX_EXTENSION_NAME_SIZE] = {
|
|
||||||
"VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", "VK_LAYER_LUNARG_object_tracker",
|
|
||||||
"VK_LAYER_LUNARG_core_validation", "VK_LAYER_GOOGLE_unique_objects"};
|
|
||||||
uint32_t layer_count = sizeof(std_validation_names) / sizeof(std_validation_names[0]);
|
|
||||||
|
|
||||||
loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0,
|
|
||||||
"Adding VK_LAYER_LUNARG_standard_validation using the loader legacy path. This is"
|
|
||||||
" not an error.");
|
|
||||||
|
|
||||||
if (NULL == props) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(props, 0, sizeof(struct loader_layer_properties));
|
|
||||||
props->type_flags = VK_LAYER_TYPE_FLAG_INSTANCE_LAYER | VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER | VK_LAYER_TYPE_FLAG_META_LAYER;
|
|
||||||
strncpy(props->info.description, "LunarG Standard Validation Layer", sizeof(props->info.description));
|
|
||||||
props->info.implementationVersion = 1;
|
|
||||||
strncpy(props->info.layerName, std_validation_str, sizeof(props->info.layerName));
|
|
||||||
props->info.specVersion = VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION);
|
|
||||||
|
|
||||||
props->component_layer_names =
|
|
||||||
loader_instance_heap_alloc(inst, sizeof(char[MAX_STRING_SIZE]) * layer_count, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
|
|
||||||
if (NULL == props->component_layer_names) {
|
|
||||||
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
|
||||||
"Failed to allocate space for legacy VK_LAYER_LUNARG_standard_validation"
|
|
||||||
" meta-layer component_layers information.");
|
|
||||||
success = false;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
for (i = 0; i < layer_count; i++) {
|
|
||||||
strncpy(props->component_layer_names[i], std_validation_names[i], MAX_STRING_SIZE - 1);
|
|
||||||
props->component_layer_names[i][MAX_STRING_SIZE - 1] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
|
|
||||||
if (!success && NULL != props && NULL != props->component_layer_names) {
|
|
||||||
loader_instance_heap_free(inst, props->component_layer_names);
|
|
||||||
props->component_layer_names = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify that all component layers in a meta-layer are valid.
|
// Verify that all component layers in a meta-layer are valid.
|
||||||
static bool verifyMetaLayerComponentLayers(const struct loader_instance *inst, struct loader_layer_properties *prop,
|
static bool verifyMetaLayerComponentLayers(const struct loader_instance *inst, struct loader_layer_properties *prop,
|
||||||
struct loader_layer_list *instance_layers) {
|
struct loader_layer_list *instance_layers) {
|
||||||
@ -3201,7 +3151,7 @@ static VkResult loaderReadLayerJson(const struct loader_instance *inst, struct l
|
|||||||
if (version.major > 1 || version.minor >= 1) {
|
if (version.major > 1 || version.minor >= 1) {
|
||||||
loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
|
loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
|
||||||
"Layer \"%s\" using deprecated \'vkGetInstanceProcAddr\' tag which was deprecated starting with JSON "
|
"Layer \"%s\" using deprecated \'vkGetInstanceProcAddr\' tag which was deprecated starting with JSON "
|
||||||
"file version 1.1.0. The new vkNegotiateLayerInterfaceVersion function is preferred, though for "
|
"file version 1.1.0. The new vkNegotiateLoaderLayerInterfaceVersion function is preferred, though for "
|
||||||
"compatibility reasons it may be desirable to continue using the deprecated tag.",
|
"compatibility reasons it may be desirable to continue using the deprecated tag.",
|
||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
@ -3212,7 +3162,7 @@ static VkResult loaderReadLayerJson(const struct loader_instance *inst, struct l
|
|||||||
if (version.major > 1 || version.minor >= 1) {
|
if (version.major > 1 || version.minor >= 1) {
|
||||||
loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
|
loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0,
|
||||||
"Layer \"%s\" using deprecated \'vkGetDeviceProcAddr\' tag which was deprecated starting with JSON "
|
"Layer \"%s\" using deprecated \'vkGetDeviceProcAddr\' tag which was deprecated starting with JSON "
|
||||||
"file version 1.1.0. The new vkNegotiateLayerInterfaceVersion function is preferred, though for "
|
"file version 1.1.0. The new vkNegotiateLoaderLayerInterfaceVersion function is preferred, though for "
|
||||||
"compatibility reasons it may be desirable to continue using the deprecated tag.",
|
"compatibility reasons it may be desirable to continue using the deprecated tag.",
|
||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
@ -3949,7 +3899,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Read manifest JSON files uing the Windows driver interface
|
// Read manifest JSON files using the Windows driver interface
|
||||||
static VkResult ReadManifestsFromD3DAdapters(const struct loader_instance *inst, char **reg_data, PDWORD reg_data_size,
|
static VkResult ReadManifestsFromD3DAdapters(const struct loader_instance *inst, char **reg_data, PDWORD reg_data_size,
|
||||||
const wchar_t *value_name) {
|
const wchar_t *value_name) {
|
||||||
VkResult result = VK_INCOMPLETE;
|
VkResult result = VK_INCOMPLETE;
|
||||||
@ -3994,7 +3944,7 @@ static VkResult ReadManifestsFromD3DAdapters(const struct loader_instance *inst,
|
|||||||
.value_type = REG_MULTI_SZ,
|
.value_type = REG_MULTI_SZ,
|
||||||
.physical_adapter_index = 0,
|
.physical_adapter_index = 0,
|
||||||
};
|
};
|
||||||
wcsncpy(filename_info.value_name, value_name, sizeof(filename_info.value_name) / sizeof(DWORD));
|
wcsncpy(filename_info.value_name, value_name, sizeof(filename_info.value_name) / sizeof(WCHAR));
|
||||||
LoaderQueryAdapterInfo query_info = {
|
LoaderQueryAdapterInfo query_info = {
|
||||||
.handle = adapters.adapters[i].handle,
|
.handle = adapters.adapters[i].handle,
|
||||||
.type = LOADER_QUERY_TYPE_REGISTRY,
|
.type = LOADER_QUERY_TYPE_REGISTRY,
|
||||||
@ -4603,23 +4553,6 @@ void loaderScanForLayers(struct loader_instance *inst, struct loader_layer_list
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if "VK_LAYER_LUNARG_standard_validation" already in list.
|
|
||||||
bool found_std_val = false;
|
|
||||||
for (uint32_t i = 0; i < instance_layers->count; i++) {
|
|
||||||
struct loader_layer_properties *props = &instance_layers->list[i];
|
|
||||||
if (strcmp(props->info.layerName, std_validation_str) == 0) {
|
|
||||||
found_std_val = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we didn't find the VK_LAYER_LUNARG_standard_validation meta-layer in
|
|
||||||
// the list, then we need to add it manually. This is likely because we're
|
|
||||||
// dealing with a new loader, but an old layer folder.
|
|
||||||
if (!found_std_val && !loaderAddLegacyStandardValidationLayer(inst, instance_layers)) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify any meta-layers in the list are valid and all the component layers are
|
// Verify any meta-layers in the list are valid and all the component layers are
|
||||||
// actually present in the available layer list
|
// actually present in the available layer list
|
||||||
VerifyAllMetaLayers(inst, instance_layers, &override_layer_valid);
|
VerifyAllMetaLayers(inst, instance_layers, &override_layer_valid);
|
||||||
@ -4853,6 +4786,32 @@ static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpa_instance_internal(VkI
|
|||||||
return (PFN_vkVoidFunction)terminator_CreateDevice;
|
return (PFN_vkVoidFunction)terminator_CreateDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The VK_EXT_debug_utils functions need a special case here so the terminators can still be found from vkGetInstanceProcAddr
|
||||||
|
if (!strcmp(pName, "vkSetDebugUtilsObjectNameEXT")) {
|
||||||
|
return (PFN_vkVoidFunction)terminator_SetDebugUtilsObjectNameEXT;
|
||||||
|
}
|
||||||
|
if (!strcmp(pName, "vkSetDebugUtilsObjectTagEXT")) {
|
||||||
|
return (PFN_vkVoidFunction)terminator_SetDebugUtilsObjectTagEXT;
|
||||||
|
}
|
||||||
|
if (!strcmp(pName, "vkQueueBeginDebugUtilsLabelEXT")) {
|
||||||
|
return (PFN_vkVoidFunction)terminator_QueueBeginDebugUtilsLabelEXT;
|
||||||
|
}
|
||||||
|
if (!strcmp(pName, "vkQueueEndDebugUtilsLabelEXT")) {
|
||||||
|
return (PFN_vkVoidFunction)terminator_QueueEndDebugUtilsLabelEXT;
|
||||||
|
}
|
||||||
|
if (!strcmp(pName, "vkQueueInsertDebugUtilsLabelEXT")) {
|
||||||
|
return (PFN_vkVoidFunction)terminator_QueueInsertDebugUtilsLabelEXT;
|
||||||
|
}
|
||||||
|
if (!strcmp(pName, "vkCmdBeginDebugUtilsLabelEXT")) {
|
||||||
|
return (PFN_vkVoidFunction)terminator_CmdBeginDebugUtilsLabelEXT;
|
||||||
|
}
|
||||||
|
if (!strcmp(pName, "vkCmdEndDebugUtilsLabelEXT")) {
|
||||||
|
return (PFN_vkVoidFunction)terminator_CmdEndDebugUtilsLabelEXT;
|
||||||
|
}
|
||||||
|
if (!strcmp(pName, "vkCmdInsertDebugUtilsLabelEXT")) {
|
||||||
|
return (PFN_vkVoidFunction)terminator_CmdInsertDebugUtilsLabelEXT;
|
||||||
|
}
|
||||||
|
|
||||||
// inst is not wrapped
|
// inst is not wrapped
|
||||||
if (inst == VK_NULL_HANDLE) {
|
if (inst == VK_NULL_HANDLE) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -5510,8 +5469,6 @@ VKAPI_ATTR VkResult VKAPI_CALL loader_layer_create_device(VkInstance instance, V
|
|||||||
struct loader_device *dev = NULL;
|
struct loader_device *dev = NULL;
|
||||||
struct loader_instance *inst = NULL;
|
struct loader_instance *inst = NULL;
|
||||||
|
|
||||||
assert(pCreateInfo->queueCreateInfoCount >= 1);
|
|
||||||
|
|
||||||
if (instance != NULL) {
|
if (instance != NULL) {
|
||||||
inst = loader_get_instance(instance);
|
inst = loader_get_instance(instance);
|
||||||
internal_device = physicalDevice;
|
internal_device = physicalDevice;
|
||||||
@ -6187,7 +6144,7 @@ VkResult loader_validate_device_extensions(struct loader_instance *this_instance
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Terminator functions for the Instance chain
|
// Terminator functions for the Instance chain
|
||||||
// All named terminator_<Vulakn API name>
|
// All named terminator_<Vulkan API name>
|
||||||
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
||||||
const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) {
|
const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) {
|
||||||
struct loader_icd_term *icd_term;
|
struct loader_icd_term *icd_term;
|
||||||
@ -7204,6 +7161,10 @@ VkStringErrorFlags vk_string_validate(const int max_length, const char *utf8) {
|
|||||||
int num_char_bytes = 0;
|
int num_char_bytes = 0;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
if (utf8 == NULL) {
|
||||||
|
return VK_STRING_ERROR_NULL_PTR;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i <= max_length; i++) {
|
for (i = 0; i <= max_length; i++) {
|
||||||
if (utf8[i] == 0) {
|
if (utf8[i] == 0) {
|
||||||
break;
|
break;
|
||||||
@ -7369,7 +7330,7 @@ out:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(LOADER_DYNAMIC_LIB)
|
#if defined(_WIN32)
|
||||||
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) {
|
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) {
|
||||||
switch (reason) {
|
switch (reason) {
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
|
6
thirdparty/vulkan/loader/loader.h
vendored
6
thirdparty/vulkan/loader/loader.h
vendored
@ -67,6 +67,7 @@ typedef enum VkStringErrorFlagBits {
|
|||||||
VK_STRING_ERROR_NONE = 0x00000000,
|
VK_STRING_ERROR_NONE = 0x00000000,
|
||||||
VK_STRING_ERROR_LENGTH = 0x00000001,
|
VK_STRING_ERROR_LENGTH = 0x00000001,
|
||||||
VK_STRING_ERROR_BAD_DATA = 0x00000002,
|
VK_STRING_ERROR_BAD_DATA = 0x00000002,
|
||||||
|
VK_STRING_ERROR_NULL_PTR = 0x00000004,
|
||||||
} VkStringErrorFlagBits;
|
} VkStringErrorFlagBits;
|
||||||
typedef VkFlags VkStringErrorFlags;
|
typedef VkFlags VkStringErrorFlags;
|
||||||
|
|
||||||
@ -419,9 +420,6 @@ static inline void loader_init_dispatch(void *obj, const void *data) {
|
|||||||
// Global variables used across files
|
// Global variables used across files
|
||||||
extern struct loader_struct loader;
|
extern struct loader_struct loader;
|
||||||
extern THREAD_LOCAL_DECL struct loader_instance *tls_instance;
|
extern THREAD_LOCAL_DECL struct loader_instance *tls_instance;
|
||||||
#if defined(_WIN32) && !defined(LOADER_DYNAMIC_LIB)
|
|
||||||
extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init);
|
|
||||||
#endif
|
|
||||||
extern loader_platform_thread_mutex loader_lock;
|
extern loader_platform_thread_mutex loader_lock;
|
||||||
extern loader_platform_thread_mutex loader_json_lock;
|
extern loader_platform_thread_mutex loader_json_lock;
|
||||||
|
|
||||||
@ -480,7 +478,7 @@ void loaderScanForImplicitLayers(struct loader_instance *inst, struct loader_lay
|
|||||||
bool loaderImplicitLayerIsEnabled(const struct loader_instance *inst, const struct loader_layer_properties *prop);
|
bool loaderImplicitLayerIsEnabled(const struct loader_instance *inst, const struct loader_layer_properties *prop);
|
||||||
VkResult loader_get_icd_loader_instance_extensions(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list,
|
VkResult loader_get_icd_loader_instance_extensions(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list,
|
||||||
struct loader_extension_list *inst_exts);
|
struct loader_extension_list *inst_exts);
|
||||||
struct loader_icd_term *loader_get_icd_and_device(const VkDevice device, struct loader_device **found_dev, uint32_t *icd_index);
|
struct loader_icd_term *loader_get_icd_and_device(const void *device, struct loader_device **found_dev, uint32_t *icd_index);
|
||||||
void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev);
|
void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev);
|
||||||
void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName);
|
void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName);
|
||||||
void *loader_get_dev_ext_trampoline(uint32_t index);
|
void *loader_get_dev_ext_trampoline(uint32_t index);
|
||||||
|
113
thirdparty/vulkan/loader/trampoline.c
vendored
113
thirdparty/vulkan/loader/trampoline.c
vendored
@ -135,6 +135,12 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionPropert
|
|||||||
}
|
}
|
||||||
|
|
||||||
loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name);
|
loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name);
|
||||||
|
if (layer_lib == NULL) {
|
||||||
|
loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "%s: Unable to load implicit layer library \"%s\"", __FUNCTION__,
|
||||||
|
layers.list[i].lib_name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
libs[lib_count++] = layer_lib;
|
libs[lib_count++] = layer_lib;
|
||||||
void *pfn = loader_platform_get_proc_address(layer_lib,
|
void *pfn = loader_platform_get_proc_address(layer_lib,
|
||||||
layers.list[i].pre_instance_functions.enumerate_instance_extension_properties);
|
layers.list[i].pre_instance_functions.enumerate_instance_extension_properties);
|
||||||
@ -223,6 +229,12 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(
|
|||||||
}
|
}
|
||||||
|
|
||||||
loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name);
|
loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name);
|
||||||
|
if (layer_lib == NULL) {
|
||||||
|
loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "%s: Unable to load implicit layer library \"%s\"", __FUNCTION__,
|
||||||
|
layers.list[i].lib_name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
libs[lib_count++] = layer_lib;
|
libs[lib_count++] = layer_lib;
|
||||||
void *pfn =
|
void *pfn =
|
||||||
loader_platform_get_proc_address(layer_lib, layers.list[i].pre_instance_functions.enumerate_instance_layer_properties);
|
loader_platform_get_proc_address(layer_lib, layers.list[i].pre_instance_functions.enumerate_instance_layer_properties);
|
||||||
@ -311,6 +323,12 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceVersion(uint32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name);
|
loader_platform_dl_handle layer_lib = loader_platform_open_library(layers.list[i].lib_name);
|
||||||
|
if (layer_lib == NULL) {
|
||||||
|
loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "%s: Unable to load implicit layer library \"%s\"", __FUNCTION__,
|
||||||
|
layers.list[i].lib_name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
libs[lib_count++] = layer_lib;
|
libs[lib_count++] = layer_lib;
|
||||||
void *pfn = loader_platform_get_proc_address(layer_lib,
|
void *pfn = loader_platform_get_proc_address(layer_lib,
|
||||||
layers.list[i].pre_instance_functions.enumerate_instance_version);
|
layers.list[i].pre_instance_functions.enumerate_instance_version);
|
||||||
@ -2478,3 +2496,98 @@ LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplate(VkDev
|
|||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
disp->UpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData);
|
disp->UpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- Vulkan core 1.2 trampolines
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo,
|
||||||
|
const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->CreateRenderPass2(device, pCreateInfo, pAllocator, pRenderPass);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer,
|
||||||
|
const VkRenderPassBeginInfo* pRenderPassBegin,
|
||||||
|
const VkSubpassBeginInfo* pSubpassBeginInfo)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
|
disp->CmdBeginRenderPass2(commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass2(VkCommandBuffer commandBuffer,
|
||||||
|
const VkSubpassBeginInfo* pSubpassBeginInfo,
|
||||||
|
const VkSubpassEndInfo* pSubpassEndInfo)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
|
disp->CmdNextSubpass2(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
|
disp->CmdEndRenderPass2(commandBuffer, pSubpassEndInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
|
||||||
|
VkBuffer countBuffer, VkDeviceSize countBufferOffset,
|
||||||
|
uint32_t maxDrawCount, uint32_t stride)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
|
disp->CmdDrawIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer,
|
||||||
|
VkDeviceSize offset, VkBuffer countBuffer,
|
||||||
|
VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
|
||||||
|
uint32_t stride)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
|
disp->CmdDrawIndexedIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t* pValue)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->GetSemaphoreCounterValue(device, semaphore, pValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo,
|
||||||
|
uint64_t timeout)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->WaitSemaphores(device, pWaitInfo, timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->SignalSemaphore(device, pSignalInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddress(VkDevice device,
|
||||||
|
const VkBufferDeviceAddressInfo* pInfo)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->GetBufferDeviceAddress(device, pInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR uint64_t VKAPI_CALL vkGetBufferOpaqueCaptureAddress(VkDevice device,
|
||||||
|
const VkBufferDeviceAddressInfo* pInfo)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->GetBufferOpaqueCaptureAddress(device, pInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR uint64_t VKAPI_CALL vkGetDeviceMemoryOpaqueCaptureAddress(VkDevice device,
|
||||||
|
const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->GetDeviceMemoryOpaqueCaptureAddress(device, pInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
|
||||||
|
uint32_t queryCount)
|
||||||
|
{
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
disp->ResetQueryPool(device, queryPool, firstQuery, queryCount);
|
||||||
|
}
|
||||||
|
885
thirdparty/vulkan/loader/unknown_ext_chain_gas.S
vendored
885
thirdparty/vulkan/loader/unknown_ext_chain_gas.S
vendored
@ -1,885 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2017 The Khronos Group Inc.
|
|
||||||
# Copyright (c) 2017 Valve Corporation
|
|
||||||
# Copyright (c) 2017 LunarG, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
# Author: Lenny Komow <lenny@lunarg.com>
|
|
||||||
#
|
|
||||||
|
|
||||||
# This code is used to pass on device (including physical device) extensions through the call chain. It must do this without
|
|
||||||
# creating a stack frame, because the actual parameters of the call are not known. Since the first parameter is known to be a
|
|
||||||
# VkPhysicalDevice or a dispatchable object it can unwrap the object, possibly overwriting the wrapped physical device, and then
|
|
||||||
# jump to the next function in the call chain
|
|
||||||
|
|
||||||
#ifdef HAVE_CET_H
|
|
||||||
#include <cet.h>
|
|
||||||
#else
|
|
||||||
#define _CET_ENDBR
|
|
||||||
#endif
|
|
||||||
|
|
||||||
.intel_syntax noprefix
|
|
||||||
.include "gen_defines.asm"
|
|
||||||
|
|
||||||
.ifdef X86_64
|
|
||||||
|
|
||||||
.macro PhysDevExtTramp num
|
|
||||||
.global vkPhysDevExtTramp\num
|
|
||||||
vkPhysDevExtTramp\num:
|
|
||||||
_CET_ENDBR
|
|
||||||
mov rax, [rdi]
|
|
||||||
mov rdi, [rdi + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP]
|
|
||||||
jmp [rax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * \num))]
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro PhysDevExtTermin num
|
|
||||||
.global vkPhysDevExtTermin\num
|
|
||||||
vkPhysDevExtTermin\num:
|
|
||||||
_CET_ENDBR
|
|
||||||
mov rax, [rdi + ICD_TERM_OFFSET_PHYS_DEV_TERM] # Store the loader_icd_term* in rax
|
|
||||||
cmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))], 0 # Check if the next function in the chain is NULL
|
|
||||||
je terminError\num # Go to the error section if it is NULL
|
|
||||||
mov rdi, [rdi + PHYS_DEV_OFFSET_PHYS_DEV_TERM] # Load the unwrapped VkPhysicalDevice into the first arg
|
|
||||||
jmp [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))] # Jump to the next function in the chain
|
|
||||||
terminError\num:
|
|
||||||
sub rsp, 56 # Create the stack frame
|
|
||||||
mov rdi, [rax + INSTANCE_OFFSET_ICD_TERM] # Load the loader_instance into rdi (first arg)
|
|
||||||
mov r8, [rdi + (HASH_OFFSET_INSTANCE + (HASH_SIZE * \num) + FUNC_NAME_OFFSET_HASH)] # Load the func name into r8 (fifth arg)
|
|
||||||
lea rcx, termin_error_string@GOTPCREL # Load the error string into rcx (fourth arg)
|
|
||||||
xor edx, edx # Set rdx to zero (third arg)
|
|
||||||
lea esi, [rdx + VK_DEBUG_REPORT_ERROR_BIT_EXT] # Write the error logging bit to rsi (second arg)
|
|
||||||
call loader_log # Log the error message before we crash
|
|
||||||
add rsp, 56 # Clean up the stack frame
|
|
||||||
mov rax, 0
|
|
||||||
jmp rax # Crash intentionally by jumping to address zero
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro DevExtTramp num
|
|
||||||
.global vkdev_ext\num
|
|
||||||
vkdev_ext\num:
|
|
||||||
_CET_ENDBR
|
|
||||||
mov rax, [rdi] # Dereference the handle to get the dispatch table
|
|
||||||
jmp [rax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * \num))] # Jump to the appropriate call chain
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.else
|
|
||||||
|
|
||||||
.macro PhysDevExtTramp num
|
|
||||||
.global vkPhysDevExtTramp\num
|
|
||||||
vkPhysDevExtTramp\num:
|
|
||||||
_CET_ENDBR
|
|
||||||
mov eax, [esp + 4] # Load the wrapped VkPhysicalDevice into eax
|
|
||||||
mov ecx, [eax + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] # Load the unwrapped VkPhysicalDevice into ecx
|
|
||||||
mov [esp + 4], ecx # Overwrite the wrapped VkPhysicalDevice with the unwrapped one (on the stack)
|
|
||||||
mov eax, [eax] # Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
|
|
||||||
jmp [eax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * \num))] # Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro PhysDevExtTermin num
|
|
||||||
.global vkPhysDevExtTermin\num
|
|
||||||
vkPhysDevExtTermin\num:
|
|
||||||
_CET_ENDBR
|
|
||||||
mov ecx, [esp + 4] # Move the wrapped VkPhysicalDevice into ecx
|
|
||||||
mov eax, [ecx + ICD_TERM_OFFSET_PHYS_DEV_TERM] # Store the loader_icd_term* in eax
|
|
||||||
cmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))], 0 # Check if the next function in the chain is NULL
|
|
||||||
je terminError\num # Go to the error section if it is NULL
|
|
||||||
mov ecx, [ecx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] # Unwrap the VkPhysicalDevice in ecx
|
|
||||||
mov [esp + 4], ecx # Copy the unwrapped VkPhysicalDevice into the first arg
|
|
||||||
jmp [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))] # Jump to the next function in the chain
|
|
||||||
terminError\num:
|
|
||||||
mov eax, [eax + INSTANCE_OFFSET_ICD_TERM] # Load the loader_instance into eax
|
|
||||||
push [eax + (HASH_OFFSET_INSTANCE + (HASH_SIZE * \num) + FUNC_NAME_OFFSET_HASH)] # Push the func name (fifth arg)
|
|
||||||
push offset termin_error_string@GOT # Push the error string (fourth arg)
|
|
||||||
push 0 # Push zero (third arg)
|
|
||||||
push VK_DEBUG_REPORT_ERROR_BIT_EXT # Push the error logging bit (second arg)
|
|
||||||
push eax # Push the loader_instance (first arg)
|
|
||||||
call loader_log # Log the error message before we crash
|
|
||||||
add esp, 20 # Clean up the args
|
|
||||||
mov eax, 0
|
|
||||||
jmp eax # Crash intentionally by jumping to address zero
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro DevExtTramp num
|
|
||||||
.global vkdev_ext\num
|
|
||||||
vkdev_ext\num:
|
|
||||||
_CET_ENDBR
|
|
||||||
mov eax, [esp + 4] # Dereference the handle to get the dispatch table
|
|
||||||
jmp [eax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * \num))] # Jump to the appropriate call chain
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.endif
|
|
||||||
|
|
||||||
#if defined(__ELF__)
|
|
||||||
.section .note.GNU-stack,"",%progbits
|
|
||||||
#endif
|
|
||||||
|
|
||||||
.data
|
|
||||||
|
|
||||||
termin_error_string:
|
|
||||||
.string "Extension %s not supported for this physical device"
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
PhysDevExtTramp 0
|
|
||||||
PhysDevExtTramp 1
|
|
||||||
PhysDevExtTramp 2
|
|
||||||
PhysDevExtTramp 3
|
|
||||||
PhysDevExtTramp 4
|
|
||||||
PhysDevExtTramp 5
|
|
||||||
PhysDevExtTramp 6
|
|
||||||
PhysDevExtTramp 7
|
|
||||||
PhysDevExtTramp 8
|
|
||||||
PhysDevExtTramp 9
|
|
||||||
PhysDevExtTramp 10
|
|
||||||
PhysDevExtTramp 11
|
|
||||||
PhysDevExtTramp 12
|
|
||||||
PhysDevExtTramp 13
|
|
||||||
PhysDevExtTramp 14
|
|
||||||
PhysDevExtTramp 15
|
|
||||||
PhysDevExtTramp 16
|
|
||||||
PhysDevExtTramp 17
|
|
||||||
PhysDevExtTramp 18
|
|
||||||
PhysDevExtTramp 19
|
|
||||||
PhysDevExtTramp 20
|
|
||||||
PhysDevExtTramp 21
|
|
||||||
PhysDevExtTramp 22
|
|
||||||
PhysDevExtTramp 23
|
|
||||||
PhysDevExtTramp 24
|
|
||||||
PhysDevExtTramp 25
|
|
||||||
PhysDevExtTramp 26
|
|
||||||
PhysDevExtTramp 27
|
|
||||||
PhysDevExtTramp 28
|
|
||||||
PhysDevExtTramp 29
|
|
||||||
PhysDevExtTramp 30
|
|
||||||
PhysDevExtTramp 31
|
|
||||||
PhysDevExtTramp 32
|
|
||||||
PhysDevExtTramp 33
|
|
||||||
PhysDevExtTramp 34
|
|
||||||
PhysDevExtTramp 35
|
|
||||||
PhysDevExtTramp 36
|
|
||||||
PhysDevExtTramp 37
|
|
||||||
PhysDevExtTramp 38
|
|
||||||
PhysDevExtTramp 39
|
|
||||||
PhysDevExtTramp 40
|
|
||||||
PhysDevExtTramp 41
|
|
||||||
PhysDevExtTramp 42
|
|
||||||
PhysDevExtTramp 43
|
|
||||||
PhysDevExtTramp 44
|
|
||||||
PhysDevExtTramp 45
|
|
||||||
PhysDevExtTramp 46
|
|
||||||
PhysDevExtTramp 47
|
|
||||||
PhysDevExtTramp 48
|
|
||||||
PhysDevExtTramp 49
|
|
||||||
PhysDevExtTramp 50
|
|
||||||
PhysDevExtTramp 51
|
|
||||||
PhysDevExtTramp 52
|
|
||||||
PhysDevExtTramp 53
|
|
||||||
PhysDevExtTramp 54
|
|
||||||
PhysDevExtTramp 55
|
|
||||||
PhysDevExtTramp 56
|
|
||||||
PhysDevExtTramp 57
|
|
||||||
PhysDevExtTramp 58
|
|
||||||
PhysDevExtTramp 59
|
|
||||||
PhysDevExtTramp 60
|
|
||||||
PhysDevExtTramp 61
|
|
||||||
PhysDevExtTramp 62
|
|
||||||
PhysDevExtTramp 63
|
|
||||||
PhysDevExtTramp 64
|
|
||||||
PhysDevExtTramp 65
|
|
||||||
PhysDevExtTramp 66
|
|
||||||
PhysDevExtTramp 67
|
|
||||||
PhysDevExtTramp 68
|
|
||||||
PhysDevExtTramp 69
|
|
||||||
PhysDevExtTramp 70
|
|
||||||
PhysDevExtTramp 71
|
|
||||||
PhysDevExtTramp 72
|
|
||||||
PhysDevExtTramp 73
|
|
||||||
PhysDevExtTramp 74
|
|
||||||
PhysDevExtTramp 75
|
|
||||||
PhysDevExtTramp 76
|
|
||||||
PhysDevExtTramp 77
|
|
||||||
PhysDevExtTramp 78
|
|
||||||
PhysDevExtTramp 79
|
|
||||||
PhysDevExtTramp 80
|
|
||||||
PhysDevExtTramp 81
|
|
||||||
PhysDevExtTramp 82
|
|
||||||
PhysDevExtTramp 83
|
|
||||||
PhysDevExtTramp 84
|
|
||||||
PhysDevExtTramp 85
|
|
||||||
PhysDevExtTramp 86
|
|
||||||
PhysDevExtTramp 87
|
|
||||||
PhysDevExtTramp 88
|
|
||||||
PhysDevExtTramp 89
|
|
||||||
PhysDevExtTramp 90
|
|
||||||
PhysDevExtTramp 91
|
|
||||||
PhysDevExtTramp 92
|
|
||||||
PhysDevExtTramp 93
|
|
||||||
PhysDevExtTramp 94
|
|
||||||
PhysDevExtTramp 95
|
|
||||||
PhysDevExtTramp 96
|
|
||||||
PhysDevExtTramp 97
|
|
||||||
PhysDevExtTramp 98
|
|
||||||
PhysDevExtTramp 99
|
|
||||||
PhysDevExtTramp 100
|
|
||||||
PhysDevExtTramp 101
|
|
||||||
PhysDevExtTramp 102
|
|
||||||
PhysDevExtTramp 103
|
|
||||||
PhysDevExtTramp 104
|
|
||||||
PhysDevExtTramp 105
|
|
||||||
PhysDevExtTramp 106
|
|
||||||
PhysDevExtTramp 107
|
|
||||||
PhysDevExtTramp 108
|
|
||||||
PhysDevExtTramp 109
|
|
||||||
PhysDevExtTramp 110
|
|
||||||
PhysDevExtTramp 111
|
|
||||||
PhysDevExtTramp 112
|
|
||||||
PhysDevExtTramp 113
|
|
||||||
PhysDevExtTramp 114
|
|
||||||
PhysDevExtTramp 115
|
|
||||||
PhysDevExtTramp 116
|
|
||||||
PhysDevExtTramp 117
|
|
||||||
PhysDevExtTramp 118
|
|
||||||
PhysDevExtTramp 119
|
|
||||||
PhysDevExtTramp 120
|
|
||||||
PhysDevExtTramp 121
|
|
||||||
PhysDevExtTramp 122
|
|
||||||
PhysDevExtTramp 123
|
|
||||||
PhysDevExtTramp 124
|
|
||||||
PhysDevExtTramp 125
|
|
||||||
PhysDevExtTramp 126
|
|
||||||
PhysDevExtTramp 127
|
|
||||||
PhysDevExtTramp 128
|
|
||||||
PhysDevExtTramp 129
|
|
||||||
PhysDevExtTramp 130
|
|
||||||
PhysDevExtTramp 131
|
|
||||||
PhysDevExtTramp 132
|
|
||||||
PhysDevExtTramp 133
|
|
||||||
PhysDevExtTramp 134
|
|
||||||
PhysDevExtTramp 135
|
|
||||||
PhysDevExtTramp 136
|
|
||||||
PhysDevExtTramp 137
|
|
||||||
PhysDevExtTramp 138
|
|
||||||
PhysDevExtTramp 139
|
|
||||||
PhysDevExtTramp 140
|
|
||||||
PhysDevExtTramp 141
|
|
||||||
PhysDevExtTramp 142
|
|
||||||
PhysDevExtTramp 143
|
|
||||||
PhysDevExtTramp 144
|
|
||||||
PhysDevExtTramp 145
|
|
||||||
PhysDevExtTramp 146
|
|
||||||
PhysDevExtTramp 147
|
|
||||||
PhysDevExtTramp 148
|
|
||||||
PhysDevExtTramp 149
|
|
||||||
PhysDevExtTramp 150
|
|
||||||
PhysDevExtTramp 151
|
|
||||||
PhysDevExtTramp 152
|
|
||||||
PhysDevExtTramp 153
|
|
||||||
PhysDevExtTramp 154
|
|
||||||
PhysDevExtTramp 155
|
|
||||||
PhysDevExtTramp 156
|
|
||||||
PhysDevExtTramp 157
|
|
||||||
PhysDevExtTramp 158
|
|
||||||
PhysDevExtTramp 159
|
|
||||||
PhysDevExtTramp 160
|
|
||||||
PhysDevExtTramp 161
|
|
||||||
PhysDevExtTramp 162
|
|
||||||
PhysDevExtTramp 163
|
|
||||||
PhysDevExtTramp 164
|
|
||||||
PhysDevExtTramp 165
|
|
||||||
PhysDevExtTramp 166
|
|
||||||
PhysDevExtTramp 167
|
|
||||||
PhysDevExtTramp 168
|
|
||||||
PhysDevExtTramp 169
|
|
||||||
PhysDevExtTramp 170
|
|
||||||
PhysDevExtTramp 171
|
|
||||||
PhysDevExtTramp 172
|
|
||||||
PhysDevExtTramp 173
|
|
||||||
PhysDevExtTramp 174
|
|
||||||
PhysDevExtTramp 175
|
|
||||||
PhysDevExtTramp 176
|
|
||||||
PhysDevExtTramp 177
|
|
||||||
PhysDevExtTramp 178
|
|
||||||
PhysDevExtTramp 179
|
|
||||||
PhysDevExtTramp 180
|
|
||||||
PhysDevExtTramp 181
|
|
||||||
PhysDevExtTramp 182
|
|
||||||
PhysDevExtTramp 183
|
|
||||||
PhysDevExtTramp 184
|
|
||||||
PhysDevExtTramp 185
|
|
||||||
PhysDevExtTramp 186
|
|
||||||
PhysDevExtTramp 187
|
|
||||||
PhysDevExtTramp 188
|
|
||||||
PhysDevExtTramp 189
|
|
||||||
PhysDevExtTramp 190
|
|
||||||
PhysDevExtTramp 191
|
|
||||||
PhysDevExtTramp 192
|
|
||||||
PhysDevExtTramp 193
|
|
||||||
PhysDevExtTramp 194
|
|
||||||
PhysDevExtTramp 195
|
|
||||||
PhysDevExtTramp 196
|
|
||||||
PhysDevExtTramp 197
|
|
||||||
PhysDevExtTramp 198
|
|
||||||
PhysDevExtTramp 199
|
|
||||||
PhysDevExtTramp 200
|
|
||||||
PhysDevExtTramp 201
|
|
||||||
PhysDevExtTramp 202
|
|
||||||
PhysDevExtTramp 203
|
|
||||||
PhysDevExtTramp 204
|
|
||||||
PhysDevExtTramp 205
|
|
||||||
PhysDevExtTramp 206
|
|
||||||
PhysDevExtTramp 207
|
|
||||||
PhysDevExtTramp 208
|
|
||||||
PhysDevExtTramp 209
|
|
||||||
PhysDevExtTramp 210
|
|
||||||
PhysDevExtTramp 211
|
|
||||||
PhysDevExtTramp 212
|
|
||||||
PhysDevExtTramp 213
|
|
||||||
PhysDevExtTramp 214
|
|
||||||
PhysDevExtTramp 215
|
|
||||||
PhysDevExtTramp 216
|
|
||||||
PhysDevExtTramp 217
|
|
||||||
PhysDevExtTramp 218
|
|
||||||
PhysDevExtTramp 219
|
|
||||||
PhysDevExtTramp 220
|
|
||||||
PhysDevExtTramp 221
|
|
||||||
PhysDevExtTramp 222
|
|
||||||
PhysDevExtTramp 223
|
|
||||||
PhysDevExtTramp 224
|
|
||||||
PhysDevExtTramp 225
|
|
||||||
PhysDevExtTramp 226
|
|
||||||
PhysDevExtTramp 227
|
|
||||||
PhysDevExtTramp 228
|
|
||||||
PhysDevExtTramp 229
|
|
||||||
PhysDevExtTramp 230
|
|
||||||
PhysDevExtTramp 231
|
|
||||||
PhysDevExtTramp 232
|
|
||||||
PhysDevExtTramp 233
|
|
||||||
PhysDevExtTramp 234
|
|
||||||
PhysDevExtTramp 235
|
|
||||||
PhysDevExtTramp 236
|
|
||||||
PhysDevExtTramp 237
|
|
||||||
PhysDevExtTramp 238
|
|
||||||
PhysDevExtTramp 239
|
|
||||||
PhysDevExtTramp 240
|
|
||||||
PhysDevExtTramp 241
|
|
||||||
PhysDevExtTramp 242
|
|
||||||
PhysDevExtTramp 243
|
|
||||||
PhysDevExtTramp 244
|
|
||||||
PhysDevExtTramp 245
|
|
||||||
PhysDevExtTramp 246
|
|
||||||
PhysDevExtTramp 247
|
|
||||||
PhysDevExtTramp 248
|
|
||||||
PhysDevExtTramp 249
|
|
||||||
|
|
||||||
PhysDevExtTermin 0
|
|
||||||
PhysDevExtTermin 1
|
|
||||||
PhysDevExtTermin 2
|
|
||||||
PhysDevExtTermin 3
|
|
||||||
PhysDevExtTermin 4
|
|
||||||
PhysDevExtTermin 5
|
|
||||||
PhysDevExtTermin 6
|
|
||||||
PhysDevExtTermin 7
|
|
||||||
PhysDevExtTermin 8
|
|
||||||
PhysDevExtTermin 9
|
|
||||||
PhysDevExtTermin 10
|
|
||||||
PhysDevExtTermin 11
|
|
||||||
PhysDevExtTermin 12
|
|
||||||
PhysDevExtTermin 13
|
|
||||||
PhysDevExtTermin 14
|
|
||||||
PhysDevExtTermin 15
|
|
||||||
PhysDevExtTermin 16
|
|
||||||
PhysDevExtTermin 17
|
|
||||||
PhysDevExtTermin 18
|
|
||||||
PhysDevExtTermin 19
|
|
||||||
PhysDevExtTermin 20
|
|
||||||
PhysDevExtTermin 21
|
|
||||||
PhysDevExtTermin 22
|
|
||||||
PhysDevExtTermin 23
|
|
||||||
PhysDevExtTermin 24
|
|
||||||
PhysDevExtTermin 25
|
|
||||||
PhysDevExtTermin 26
|
|
||||||
PhysDevExtTermin 27
|
|
||||||
PhysDevExtTermin 28
|
|
||||||
PhysDevExtTermin 29
|
|
||||||
PhysDevExtTermin 30
|
|
||||||
PhysDevExtTermin 31
|
|
||||||
PhysDevExtTermin 32
|
|
||||||
PhysDevExtTermin 33
|
|
||||||
PhysDevExtTermin 34
|
|
||||||
PhysDevExtTermin 35
|
|
||||||
PhysDevExtTermin 36
|
|
||||||
PhysDevExtTermin 37
|
|
||||||
PhysDevExtTermin 38
|
|
||||||
PhysDevExtTermin 39
|
|
||||||
PhysDevExtTermin 40
|
|
||||||
PhysDevExtTermin 41
|
|
||||||
PhysDevExtTermin 42
|
|
||||||
PhysDevExtTermin 43
|
|
||||||
PhysDevExtTermin 44
|
|
||||||
PhysDevExtTermin 45
|
|
||||||
PhysDevExtTermin 46
|
|
||||||
PhysDevExtTermin 47
|
|
||||||
PhysDevExtTermin 48
|
|
||||||
PhysDevExtTermin 49
|
|
||||||
PhysDevExtTermin 50
|
|
||||||
PhysDevExtTermin 51
|
|
||||||
PhysDevExtTermin 52
|
|
||||||
PhysDevExtTermin 53
|
|
||||||
PhysDevExtTermin 54
|
|
||||||
PhysDevExtTermin 55
|
|
||||||
PhysDevExtTermin 56
|
|
||||||
PhysDevExtTermin 57
|
|
||||||
PhysDevExtTermin 58
|
|
||||||
PhysDevExtTermin 59
|
|
||||||
PhysDevExtTermin 60
|
|
||||||
PhysDevExtTermin 61
|
|
||||||
PhysDevExtTermin 62
|
|
||||||
PhysDevExtTermin 63
|
|
||||||
PhysDevExtTermin 64
|
|
||||||
PhysDevExtTermin 65
|
|
||||||
PhysDevExtTermin 66
|
|
||||||
PhysDevExtTermin 67
|
|
||||||
PhysDevExtTermin 68
|
|
||||||
PhysDevExtTermin 69
|
|
||||||
PhysDevExtTermin 70
|
|
||||||
PhysDevExtTermin 71
|
|
||||||
PhysDevExtTermin 72
|
|
||||||
PhysDevExtTermin 73
|
|
||||||
PhysDevExtTermin 74
|
|
||||||
PhysDevExtTermin 75
|
|
||||||
PhysDevExtTermin 76
|
|
||||||
PhysDevExtTermin 77
|
|
||||||
PhysDevExtTermin 78
|
|
||||||
PhysDevExtTermin 79
|
|
||||||
PhysDevExtTermin 80
|
|
||||||
PhysDevExtTermin 81
|
|
||||||
PhysDevExtTermin 82
|
|
||||||
PhysDevExtTermin 83
|
|
||||||
PhysDevExtTermin 84
|
|
||||||
PhysDevExtTermin 85
|
|
||||||
PhysDevExtTermin 86
|
|
||||||
PhysDevExtTermin 87
|
|
||||||
PhysDevExtTermin 88
|
|
||||||
PhysDevExtTermin 89
|
|
||||||
PhysDevExtTermin 90
|
|
||||||
PhysDevExtTermin 91
|
|
||||||
PhysDevExtTermin 92
|
|
||||||
PhysDevExtTermin 93
|
|
||||||
PhysDevExtTermin 94
|
|
||||||
PhysDevExtTermin 95
|
|
||||||
PhysDevExtTermin 96
|
|
||||||
PhysDevExtTermin 97
|
|
||||||
PhysDevExtTermin 98
|
|
||||||
PhysDevExtTermin 99
|
|
||||||
PhysDevExtTermin 100
|
|
||||||
PhysDevExtTermin 101
|
|
||||||
PhysDevExtTermin 102
|
|
||||||
PhysDevExtTermin 103
|
|
||||||
PhysDevExtTermin 104
|
|
||||||
PhysDevExtTermin 105
|
|
||||||
PhysDevExtTermin 106
|
|
||||||
PhysDevExtTermin 107
|
|
||||||
PhysDevExtTermin 108
|
|
||||||
PhysDevExtTermin 109
|
|
||||||
PhysDevExtTermin 110
|
|
||||||
PhysDevExtTermin 111
|
|
||||||
PhysDevExtTermin 112
|
|
||||||
PhysDevExtTermin 113
|
|
||||||
PhysDevExtTermin 114
|
|
||||||
PhysDevExtTermin 115
|
|
||||||
PhysDevExtTermin 116
|
|
||||||
PhysDevExtTermin 117
|
|
||||||
PhysDevExtTermin 118
|
|
||||||
PhysDevExtTermin 119
|
|
||||||
PhysDevExtTermin 120
|
|
||||||
PhysDevExtTermin 121
|
|
||||||
PhysDevExtTermin 122
|
|
||||||
PhysDevExtTermin 123
|
|
||||||
PhysDevExtTermin 124
|
|
||||||
PhysDevExtTermin 125
|
|
||||||
PhysDevExtTermin 126
|
|
||||||
PhysDevExtTermin 127
|
|
||||||
PhysDevExtTermin 128
|
|
||||||
PhysDevExtTermin 129
|
|
||||||
PhysDevExtTermin 130
|
|
||||||
PhysDevExtTermin 131
|
|
||||||
PhysDevExtTermin 132
|
|
||||||
PhysDevExtTermin 133
|
|
||||||
PhysDevExtTermin 134
|
|
||||||
PhysDevExtTermin 135
|
|
||||||
PhysDevExtTermin 136
|
|
||||||
PhysDevExtTermin 137
|
|
||||||
PhysDevExtTermin 138
|
|
||||||
PhysDevExtTermin 139
|
|
||||||
PhysDevExtTermin 140
|
|
||||||
PhysDevExtTermin 141
|
|
||||||
PhysDevExtTermin 142
|
|
||||||
PhysDevExtTermin 143
|
|
||||||
PhysDevExtTermin 144
|
|
||||||
PhysDevExtTermin 145
|
|
||||||
PhysDevExtTermin 146
|
|
||||||
PhysDevExtTermin 147
|
|
||||||
PhysDevExtTermin 148
|
|
||||||
PhysDevExtTermin 149
|
|
||||||
PhysDevExtTermin 150
|
|
||||||
PhysDevExtTermin 151
|
|
||||||
PhysDevExtTermin 152
|
|
||||||
PhysDevExtTermin 153
|
|
||||||
PhysDevExtTermin 154
|
|
||||||
PhysDevExtTermin 155
|
|
||||||
PhysDevExtTermin 156
|
|
||||||
PhysDevExtTermin 157
|
|
||||||
PhysDevExtTermin 158
|
|
||||||
PhysDevExtTermin 159
|
|
||||||
PhysDevExtTermin 160
|
|
||||||
PhysDevExtTermin 161
|
|
||||||
PhysDevExtTermin 162
|
|
||||||
PhysDevExtTermin 163
|
|
||||||
PhysDevExtTermin 164
|
|
||||||
PhysDevExtTermin 165
|
|
||||||
PhysDevExtTermin 166
|
|
||||||
PhysDevExtTermin 167
|
|
||||||
PhysDevExtTermin 168
|
|
||||||
PhysDevExtTermin 169
|
|
||||||
PhysDevExtTermin 170
|
|
||||||
PhysDevExtTermin 171
|
|
||||||
PhysDevExtTermin 172
|
|
||||||
PhysDevExtTermin 173
|
|
||||||
PhysDevExtTermin 174
|
|
||||||
PhysDevExtTermin 175
|
|
||||||
PhysDevExtTermin 176
|
|
||||||
PhysDevExtTermin 177
|
|
||||||
PhysDevExtTermin 178
|
|
||||||
PhysDevExtTermin 179
|
|
||||||
PhysDevExtTermin 180
|
|
||||||
PhysDevExtTermin 181
|
|
||||||
PhysDevExtTermin 182
|
|
||||||
PhysDevExtTermin 183
|
|
||||||
PhysDevExtTermin 184
|
|
||||||
PhysDevExtTermin 185
|
|
||||||
PhysDevExtTermin 186
|
|
||||||
PhysDevExtTermin 187
|
|
||||||
PhysDevExtTermin 188
|
|
||||||
PhysDevExtTermin 189
|
|
||||||
PhysDevExtTermin 190
|
|
||||||
PhysDevExtTermin 191
|
|
||||||
PhysDevExtTermin 192
|
|
||||||
PhysDevExtTermin 193
|
|
||||||
PhysDevExtTermin 194
|
|
||||||
PhysDevExtTermin 195
|
|
||||||
PhysDevExtTermin 196
|
|
||||||
PhysDevExtTermin 197
|
|
||||||
PhysDevExtTermin 198
|
|
||||||
PhysDevExtTermin 199
|
|
||||||
PhysDevExtTermin 200
|
|
||||||
PhysDevExtTermin 201
|
|
||||||
PhysDevExtTermin 202
|
|
||||||
PhysDevExtTermin 203
|
|
||||||
PhysDevExtTermin 204
|
|
||||||
PhysDevExtTermin 205
|
|
||||||
PhysDevExtTermin 206
|
|
||||||
PhysDevExtTermin 207
|
|
||||||
PhysDevExtTermin 208
|
|
||||||
PhysDevExtTermin 209
|
|
||||||
PhysDevExtTermin 210
|
|
||||||
PhysDevExtTermin 211
|
|
||||||
PhysDevExtTermin 212
|
|
||||||
PhysDevExtTermin 213
|
|
||||||
PhysDevExtTermin 214
|
|
||||||
PhysDevExtTermin 215
|
|
||||||
PhysDevExtTermin 216
|
|
||||||
PhysDevExtTermin 217
|
|
||||||
PhysDevExtTermin 218
|
|
||||||
PhysDevExtTermin 219
|
|
||||||
PhysDevExtTermin 220
|
|
||||||
PhysDevExtTermin 221
|
|
||||||
PhysDevExtTermin 222
|
|
||||||
PhysDevExtTermin 223
|
|
||||||
PhysDevExtTermin 224
|
|
||||||
PhysDevExtTermin 225
|
|
||||||
PhysDevExtTermin 226
|
|
||||||
PhysDevExtTermin 227
|
|
||||||
PhysDevExtTermin 228
|
|
||||||
PhysDevExtTermin 229
|
|
||||||
PhysDevExtTermin 230
|
|
||||||
PhysDevExtTermin 231
|
|
||||||
PhysDevExtTermin 232
|
|
||||||
PhysDevExtTermin 233
|
|
||||||
PhysDevExtTermin 234
|
|
||||||
PhysDevExtTermin 235
|
|
||||||
PhysDevExtTermin 236
|
|
||||||
PhysDevExtTermin 237
|
|
||||||
PhysDevExtTermin 238
|
|
||||||
PhysDevExtTermin 239
|
|
||||||
PhysDevExtTermin 240
|
|
||||||
PhysDevExtTermin 241
|
|
||||||
PhysDevExtTermin 242
|
|
||||||
PhysDevExtTermin 243
|
|
||||||
PhysDevExtTermin 244
|
|
||||||
PhysDevExtTermin 245
|
|
||||||
PhysDevExtTermin 246
|
|
||||||
PhysDevExtTermin 247
|
|
||||||
PhysDevExtTermin 248
|
|
||||||
PhysDevExtTermin 249
|
|
||||||
|
|
||||||
DevExtTramp 0
|
|
||||||
DevExtTramp 1
|
|
||||||
DevExtTramp 2
|
|
||||||
DevExtTramp 3
|
|
||||||
DevExtTramp 4
|
|
||||||
DevExtTramp 5
|
|
||||||
DevExtTramp 6
|
|
||||||
DevExtTramp 7
|
|
||||||
DevExtTramp 8
|
|
||||||
DevExtTramp 9
|
|
||||||
DevExtTramp 10
|
|
||||||
DevExtTramp 11
|
|
||||||
DevExtTramp 12
|
|
||||||
DevExtTramp 13
|
|
||||||
DevExtTramp 14
|
|
||||||
DevExtTramp 15
|
|
||||||
DevExtTramp 16
|
|
||||||
DevExtTramp 17
|
|
||||||
DevExtTramp 18
|
|
||||||
DevExtTramp 19
|
|
||||||
DevExtTramp 20
|
|
||||||
DevExtTramp 21
|
|
||||||
DevExtTramp 22
|
|
||||||
DevExtTramp 23
|
|
||||||
DevExtTramp 24
|
|
||||||
DevExtTramp 25
|
|
||||||
DevExtTramp 26
|
|
||||||
DevExtTramp 27
|
|
||||||
DevExtTramp 28
|
|
||||||
DevExtTramp 29
|
|
||||||
DevExtTramp 30
|
|
||||||
DevExtTramp 31
|
|
||||||
DevExtTramp 32
|
|
||||||
DevExtTramp 33
|
|
||||||
DevExtTramp 34
|
|
||||||
DevExtTramp 35
|
|
||||||
DevExtTramp 36
|
|
||||||
DevExtTramp 37
|
|
||||||
DevExtTramp 38
|
|
||||||
DevExtTramp 39
|
|
||||||
DevExtTramp 40
|
|
||||||
DevExtTramp 41
|
|
||||||
DevExtTramp 42
|
|
||||||
DevExtTramp 43
|
|
||||||
DevExtTramp 44
|
|
||||||
DevExtTramp 45
|
|
||||||
DevExtTramp 46
|
|
||||||
DevExtTramp 47
|
|
||||||
DevExtTramp 48
|
|
||||||
DevExtTramp 49
|
|
||||||
DevExtTramp 50
|
|
||||||
DevExtTramp 51
|
|
||||||
DevExtTramp 52
|
|
||||||
DevExtTramp 53
|
|
||||||
DevExtTramp 54
|
|
||||||
DevExtTramp 55
|
|
||||||
DevExtTramp 56
|
|
||||||
DevExtTramp 57
|
|
||||||
DevExtTramp 58
|
|
||||||
DevExtTramp 59
|
|
||||||
DevExtTramp 60
|
|
||||||
DevExtTramp 61
|
|
||||||
DevExtTramp 62
|
|
||||||
DevExtTramp 63
|
|
||||||
DevExtTramp 64
|
|
||||||
DevExtTramp 65
|
|
||||||
DevExtTramp 66
|
|
||||||
DevExtTramp 67
|
|
||||||
DevExtTramp 68
|
|
||||||
DevExtTramp 69
|
|
||||||
DevExtTramp 70
|
|
||||||
DevExtTramp 71
|
|
||||||
DevExtTramp 72
|
|
||||||
DevExtTramp 73
|
|
||||||
DevExtTramp 74
|
|
||||||
DevExtTramp 75
|
|
||||||
DevExtTramp 76
|
|
||||||
DevExtTramp 77
|
|
||||||
DevExtTramp 78
|
|
||||||
DevExtTramp 79
|
|
||||||
DevExtTramp 80
|
|
||||||
DevExtTramp 81
|
|
||||||
DevExtTramp 82
|
|
||||||
DevExtTramp 83
|
|
||||||
DevExtTramp 84
|
|
||||||
DevExtTramp 85
|
|
||||||
DevExtTramp 86
|
|
||||||
DevExtTramp 87
|
|
||||||
DevExtTramp 88
|
|
||||||
DevExtTramp 89
|
|
||||||
DevExtTramp 90
|
|
||||||
DevExtTramp 91
|
|
||||||
DevExtTramp 92
|
|
||||||
DevExtTramp 93
|
|
||||||
DevExtTramp 94
|
|
||||||
DevExtTramp 95
|
|
||||||
DevExtTramp 96
|
|
||||||
DevExtTramp 97
|
|
||||||
DevExtTramp 98
|
|
||||||
DevExtTramp 99
|
|
||||||
DevExtTramp 100
|
|
||||||
DevExtTramp 101
|
|
||||||
DevExtTramp 102
|
|
||||||
DevExtTramp 103
|
|
||||||
DevExtTramp 104
|
|
||||||
DevExtTramp 105
|
|
||||||
DevExtTramp 106
|
|
||||||
DevExtTramp 107
|
|
||||||
DevExtTramp 108
|
|
||||||
DevExtTramp 109
|
|
||||||
DevExtTramp 110
|
|
||||||
DevExtTramp 111
|
|
||||||
DevExtTramp 112
|
|
||||||
DevExtTramp 113
|
|
||||||
DevExtTramp 114
|
|
||||||
DevExtTramp 115
|
|
||||||
DevExtTramp 116
|
|
||||||
DevExtTramp 117
|
|
||||||
DevExtTramp 118
|
|
||||||
DevExtTramp 119
|
|
||||||
DevExtTramp 120
|
|
||||||
DevExtTramp 121
|
|
||||||
DevExtTramp 122
|
|
||||||
DevExtTramp 123
|
|
||||||
DevExtTramp 124
|
|
||||||
DevExtTramp 125
|
|
||||||
DevExtTramp 126
|
|
||||||
DevExtTramp 127
|
|
||||||
DevExtTramp 128
|
|
||||||
DevExtTramp 129
|
|
||||||
DevExtTramp 130
|
|
||||||
DevExtTramp 131
|
|
||||||
DevExtTramp 132
|
|
||||||
DevExtTramp 133
|
|
||||||
DevExtTramp 134
|
|
||||||
DevExtTramp 135
|
|
||||||
DevExtTramp 136
|
|
||||||
DevExtTramp 137
|
|
||||||
DevExtTramp 138
|
|
||||||
DevExtTramp 139
|
|
||||||
DevExtTramp 140
|
|
||||||
DevExtTramp 141
|
|
||||||
DevExtTramp 142
|
|
||||||
DevExtTramp 143
|
|
||||||
DevExtTramp 144
|
|
||||||
DevExtTramp 145
|
|
||||||
DevExtTramp 146
|
|
||||||
DevExtTramp 147
|
|
||||||
DevExtTramp 148
|
|
||||||
DevExtTramp 149
|
|
||||||
DevExtTramp 150
|
|
||||||
DevExtTramp 151
|
|
||||||
DevExtTramp 152
|
|
||||||
DevExtTramp 153
|
|
||||||
DevExtTramp 154
|
|
||||||
DevExtTramp 155
|
|
||||||
DevExtTramp 156
|
|
||||||
DevExtTramp 157
|
|
||||||
DevExtTramp 158
|
|
||||||
DevExtTramp 159
|
|
||||||
DevExtTramp 160
|
|
||||||
DevExtTramp 161
|
|
||||||
DevExtTramp 162
|
|
||||||
DevExtTramp 163
|
|
||||||
DevExtTramp 164
|
|
||||||
DevExtTramp 165
|
|
||||||
DevExtTramp 166
|
|
||||||
DevExtTramp 167
|
|
||||||
DevExtTramp 168
|
|
||||||
DevExtTramp 169
|
|
||||||
DevExtTramp 170
|
|
||||||
DevExtTramp 171
|
|
||||||
DevExtTramp 172
|
|
||||||
DevExtTramp 173
|
|
||||||
DevExtTramp 174
|
|
||||||
DevExtTramp 175
|
|
||||||
DevExtTramp 176
|
|
||||||
DevExtTramp 177
|
|
||||||
DevExtTramp 178
|
|
||||||
DevExtTramp 179
|
|
||||||
DevExtTramp 180
|
|
||||||
DevExtTramp 181
|
|
||||||
DevExtTramp 182
|
|
||||||
DevExtTramp 183
|
|
||||||
DevExtTramp 184
|
|
||||||
DevExtTramp 185
|
|
||||||
DevExtTramp 186
|
|
||||||
DevExtTramp 187
|
|
||||||
DevExtTramp 188
|
|
||||||
DevExtTramp 189
|
|
||||||
DevExtTramp 190
|
|
||||||
DevExtTramp 191
|
|
||||||
DevExtTramp 192
|
|
||||||
DevExtTramp 193
|
|
||||||
DevExtTramp 194
|
|
||||||
DevExtTramp 195
|
|
||||||
DevExtTramp 196
|
|
||||||
DevExtTramp 197
|
|
||||||
DevExtTramp 198
|
|
||||||
DevExtTramp 199
|
|
||||||
DevExtTramp 200
|
|
||||||
DevExtTramp 201
|
|
||||||
DevExtTramp 202
|
|
||||||
DevExtTramp 203
|
|
||||||
DevExtTramp 204
|
|
||||||
DevExtTramp 205
|
|
||||||
DevExtTramp 206
|
|
||||||
DevExtTramp 207
|
|
||||||
DevExtTramp 208
|
|
||||||
DevExtTramp 209
|
|
||||||
DevExtTramp 210
|
|
||||||
DevExtTramp 211
|
|
||||||
DevExtTramp 212
|
|
||||||
DevExtTramp 213
|
|
||||||
DevExtTramp 214
|
|
||||||
DevExtTramp 215
|
|
||||||
DevExtTramp 216
|
|
||||||
DevExtTramp 217
|
|
||||||
DevExtTramp 218
|
|
||||||
DevExtTramp 219
|
|
||||||
DevExtTramp 220
|
|
||||||
DevExtTramp 221
|
|
||||||
DevExtTramp 222
|
|
||||||
DevExtTramp 223
|
|
||||||
DevExtTramp 224
|
|
||||||
DevExtTramp 225
|
|
||||||
DevExtTramp 226
|
|
||||||
DevExtTramp 227
|
|
||||||
DevExtTramp 228
|
|
||||||
DevExtTramp 229
|
|
||||||
DevExtTramp 230
|
|
||||||
DevExtTramp 231
|
|
||||||
DevExtTramp 232
|
|
||||||
DevExtTramp 233
|
|
||||||
DevExtTramp 234
|
|
||||||
DevExtTramp 235
|
|
||||||
DevExtTramp 236
|
|
||||||
DevExtTramp 237
|
|
||||||
DevExtTramp 238
|
|
||||||
DevExtTramp 239
|
|
||||||
DevExtTramp 240
|
|
||||||
DevExtTramp 241
|
|
||||||
DevExtTramp 242
|
|
||||||
DevExtTramp 243
|
|
||||||
DevExtTramp 244
|
|
||||||
DevExtTramp 245
|
|
||||||
DevExtTramp 246
|
|
||||||
DevExtTramp 247
|
|
||||||
DevExtTramp 248
|
|
||||||
DevExtTramp 249
|
|
883
thirdparty/vulkan/loader/unknown_ext_chain_masm.asm
vendored
883
thirdparty/vulkan/loader/unknown_ext_chain_masm.asm
vendored
@ -1,883 +0,0 @@
|
|||||||
;
|
|
||||||
; Copyright (c) 2017 The Khronos Group Inc.
|
|
||||||
; Copyright (c) 2017 Valve Corporation
|
|
||||||
; Copyright (c) 2017 LunarG, Inc.
|
|
||||||
;
|
|
||||||
; Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
; you may not use this file except in compliance with the License.
|
|
||||||
; You may obtain a copy of the License at
|
|
||||||
;
|
|
||||||
; http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
;
|
|
||||||
; Unless required by applicable law or agreed to in writing, software
|
|
||||||
; distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
; See the License for the specific language governing permissions and
|
|
||||||
; limitations under the License.
|
|
||||||
;
|
|
||||||
; Author: Lenny Komow <lenny@lunarg.com>
|
|
||||||
;
|
|
||||||
|
|
||||||
; This code is used to pass on device (including physical device) extensions through the call chain. It must do this without
|
|
||||||
; creating a stack frame, because the actual parameters of the call are not known. Since the first parameter is known to be a
|
|
||||||
; VkPhysicalDevice or a dispatchable object it can unwrap the object, possibly overwriting the wrapped physical device, and then
|
|
||||||
; jump to the next function in the call chain
|
|
||||||
|
|
||||||
; Codegen defines a number of values, chiefly offsets of members within structs and sizes of data types within gen_defines.asm.
|
|
||||||
; Struct member offsets are defined in the format "XX_OFFSET_YY" where XX indicates the member within the struct and YY indicates
|
|
||||||
; the struct type that it is a member of. Data type sizes are defined in the format "XX_SIZE" where XX indicates the data type.
|
|
||||||
INCLUDE gen_defines.asm
|
|
||||||
|
|
||||||
; 64-bit values and macro
|
|
||||||
IFDEF rax
|
|
||||||
|
|
||||||
PhysDevExtTramp macro num:req
|
|
||||||
public vkPhysDevExtTramp&num&
|
|
||||||
vkPhysDevExtTramp&num&:
|
|
||||||
mov rax, qword ptr [rcx] ; Dereference the wrapped VkPhysicalDevice to get the dispatch table in rax
|
|
||||||
mov rcx, qword ptr [rcx + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] ; Load the unwrapped VkPhysicalDevice into rcx
|
|
||||||
jmp qword ptr [rax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * num))] ; Jump to the next function in the chain, preserving the args in other registers
|
|
||||||
endm
|
|
||||||
|
|
||||||
PhysDevExtTermin macro num
|
|
||||||
public vkPhysDevExtTermin&num&
|
|
||||||
vkPhysDevExtTermin&num&:
|
|
||||||
mov rax, qword ptr [rcx + ICD_TERM_OFFSET_PHYS_DEV_TERM] ; Store the loader_icd_term* in rax
|
|
||||||
cmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))], 0 ; Check if the next function in the chain is NULL
|
|
||||||
je terminError&num& ; Go to the error section if it is NULL
|
|
||||||
mov rcx, qword ptr [rcx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] ; Load the unwrapped VkPhysicalDevice into the first arg
|
|
||||||
jmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))] ; Jump to the next function in the chain
|
|
||||||
terminError&num&:
|
|
||||||
sub rsp, 56 ; Create the stack frame
|
|
||||||
mov rcx, qword ptr [rax + INSTANCE_OFFSET_ICD_TERM] ; Load the loader_instance into rcx (first arg)
|
|
||||||
mov rax, qword ptr [rcx + (HASH_OFFSET_INSTANCE + (HASH_SIZE * num) + FUNC_NAME_OFFSET_HASH)] ; Load the func name into rax
|
|
||||||
lea r9, termin_error_string ; Load the error string into r9 (fourth arg)
|
|
||||||
xor r8d, r8d ; Set r8 to zero (third arg)
|
|
||||||
mov qword ptr [rsp + 32], rax ; Move the func name onto the stack (fifth arg)
|
|
||||||
lea edx, [r8 + VK_DEBUG_REPORT_ERROR_BIT_EXT] ; Write the error logging bit to rdx (second arg)
|
|
||||||
call loader_log ; Log the error message before we crash
|
|
||||||
add rsp, 56 ; Clean up the stack frame
|
|
||||||
mov rax, 0
|
|
||||||
jmp rax ; Crash intentionally by jumping to address zero
|
|
||||||
endm
|
|
||||||
|
|
||||||
DevExtTramp macro num
|
|
||||||
public vkdev_ext&num&
|
|
||||||
vkdev_ext&num&:
|
|
||||||
mov rax, qword ptr [rcx] ; Dereference the handle to get the dispatch table
|
|
||||||
jmp qword ptr [rax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * num))] ; Jump to the appropriate call chain
|
|
||||||
endm
|
|
||||||
|
|
||||||
; 32-bit values and macro
|
|
||||||
ELSE
|
|
||||||
|
|
||||||
PhysDevExtTramp macro num
|
|
||||||
public _vkPhysDevExtTramp&num&@4
|
|
||||||
_vkPhysDevExtTramp&num&@4:
|
|
||||||
mov eax, dword ptr [esp + 4] ; Load the wrapped VkPhysicalDevice into eax
|
|
||||||
mov ecx, [eax + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] ; Load the unwrapped VkPhysicalDevice into ecx
|
|
||||||
mov [esp + 4], ecx ; Overwrite the wrapped VkPhysicalDevice with the unwrapped one (on the stack)
|
|
||||||
mov eax, [eax] ; Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
|
|
||||||
jmp dword ptr [eax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * num))] ; Jump to the next function in the chain, preserving the args on the stack
|
|
||||||
endm
|
|
||||||
|
|
||||||
PhysDevExtTermin macro num
|
|
||||||
public _vkPhysDevExtTermin&num&@4
|
|
||||||
_vkPhysDevExtTermin&num&@4:
|
|
||||||
mov ecx, dword ptr [esp + 4] ; Move the wrapped VkPhysicalDevice into ecx
|
|
||||||
mov eax, dword ptr [ecx + ICD_TERM_OFFSET_PHYS_DEV_TERM] ; Store the loader_icd_term* in eax
|
|
||||||
cmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))], 0 ; Check if the next function in the chain is NULL
|
|
||||||
je terminError&num& ; Go to the error section if it is NULL
|
|
||||||
mov ecx, dword ptr [ecx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] ; Unwrap the VkPhysicalDevice in ecx
|
|
||||||
mov dword ptr [esp + 4], ecx ; Copy the unwrapped VkPhysicalDevice into the first arg
|
|
||||||
jmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))] ; Jump to the next function in the chain
|
|
||||||
terminError&num&:
|
|
||||||
mov eax, dword ptr [eax + INSTANCE_OFFSET_ICD_TERM] ; Load the loader_instance into eax
|
|
||||||
push dword ptr [eax + (HASH_OFFSET_INSTANCE + (HASH_SIZE * num) + FUNC_NAME_OFFSET_HASH)] ; Push the func name (fifth arg)
|
|
||||||
push offset termin_error_string ; Push the error string (fourth arg)
|
|
||||||
push 0 ; Push zero (third arg)
|
|
||||||
push VK_DEBUG_REPORT_ERROR_BIT_EXT ; Push the error logging bit (second arg)
|
|
||||||
push eax ; Push the loader_instance (first arg)
|
|
||||||
call _loader_log ; Log the error message before we crash
|
|
||||||
add esp, 20 ; Clean up the args
|
|
||||||
mov eax, 0
|
|
||||||
jmp eax ; Crash intentionally by jumping to address zero
|
|
||||||
endm
|
|
||||||
|
|
||||||
DevExtTramp macro num
|
|
||||||
public _vkdev_ext&num&@4
|
|
||||||
_vkdev_ext&num&@4:
|
|
||||||
mov eax, dword ptr [esp + 4] ; Dereference the handle to get the dispatch table
|
|
||||||
jmp dword ptr [eax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * num))] ; Jump to the appropriate call chain
|
|
||||||
endm
|
|
||||||
|
|
||||||
; This is also needed for 32-bit only
|
|
||||||
.model flat
|
|
||||||
|
|
||||||
ENDIF
|
|
||||||
|
|
||||||
.const
|
|
||||||
termin_error_string db 'Extension %s not supported for this physical device', 0
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
IFDEF rax
|
|
||||||
extrn loader_log:near
|
|
||||||
ELSE
|
|
||||||
extrn _loader_log:near
|
|
||||||
ENDIF
|
|
||||||
|
|
||||||
PhysDevExtTramp 0
|
|
||||||
PhysDevExtTramp 1
|
|
||||||
PhysDevExtTramp 2
|
|
||||||
PhysDevExtTramp 3
|
|
||||||
PhysDevExtTramp 4
|
|
||||||
PhysDevExtTramp 5
|
|
||||||
PhysDevExtTramp 6
|
|
||||||
PhysDevExtTramp 7
|
|
||||||
PhysDevExtTramp 8
|
|
||||||
PhysDevExtTramp 9
|
|
||||||
PhysDevExtTramp 10
|
|
||||||
PhysDevExtTramp 11
|
|
||||||
PhysDevExtTramp 12
|
|
||||||
PhysDevExtTramp 13
|
|
||||||
PhysDevExtTramp 14
|
|
||||||
PhysDevExtTramp 15
|
|
||||||
PhysDevExtTramp 16
|
|
||||||
PhysDevExtTramp 17
|
|
||||||
PhysDevExtTramp 18
|
|
||||||
PhysDevExtTramp 19
|
|
||||||
PhysDevExtTramp 20
|
|
||||||
PhysDevExtTramp 21
|
|
||||||
PhysDevExtTramp 22
|
|
||||||
PhysDevExtTramp 23
|
|
||||||
PhysDevExtTramp 24
|
|
||||||
PhysDevExtTramp 25
|
|
||||||
PhysDevExtTramp 26
|
|
||||||
PhysDevExtTramp 27
|
|
||||||
PhysDevExtTramp 28
|
|
||||||
PhysDevExtTramp 29
|
|
||||||
PhysDevExtTramp 30
|
|
||||||
PhysDevExtTramp 31
|
|
||||||
PhysDevExtTramp 32
|
|
||||||
PhysDevExtTramp 33
|
|
||||||
PhysDevExtTramp 34
|
|
||||||
PhysDevExtTramp 35
|
|
||||||
PhysDevExtTramp 36
|
|
||||||
PhysDevExtTramp 37
|
|
||||||
PhysDevExtTramp 38
|
|
||||||
PhysDevExtTramp 39
|
|
||||||
PhysDevExtTramp 40
|
|
||||||
PhysDevExtTramp 41
|
|
||||||
PhysDevExtTramp 42
|
|
||||||
PhysDevExtTramp 43
|
|
||||||
PhysDevExtTramp 44
|
|
||||||
PhysDevExtTramp 45
|
|
||||||
PhysDevExtTramp 46
|
|
||||||
PhysDevExtTramp 47
|
|
||||||
PhysDevExtTramp 48
|
|
||||||
PhysDevExtTramp 49
|
|
||||||
PhysDevExtTramp 50
|
|
||||||
PhysDevExtTramp 51
|
|
||||||
PhysDevExtTramp 52
|
|
||||||
PhysDevExtTramp 53
|
|
||||||
PhysDevExtTramp 54
|
|
||||||
PhysDevExtTramp 55
|
|
||||||
PhysDevExtTramp 56
|
|
||||||
PhysDevExtTramp 57
|
|
||||||
PhysDevExtTramp 58
|
|
||||||
PhysDevExtTramp 59
|
|
||||||
PhysDevExtTramp 60
|
|
||||||
PhysDevExtTramp 61
|
|
||||||
PhysDevExtTramp 62
|
|
||||||
PhysDevExtTramp 63
|
|
||||||
PhysDevExtTramp 64
|
|
||||||
PhysDevExtTramp 65
|
|
||||||
PhysDevExtTramp 66
|
|
||||||
PhysDevExtTramp 67
|
|
||||||
PhysDevExtTramp 68
|
|
||||||
PhysDevExtTramp 69
|
|
||||||
PhysDevExtTramp 70
|
|
||||||
PhysDevExtTramp 71
|
|
||||||
PhysDevExtTramp 72
|
|
||||||
PhysDevExtTramp 73
|
|
||||||
PhysDevExtTramp 74
|
|
||||||
PhysDevExtTramp 75
|
|
||||||
PhysDevExtTramp 76
|
|
||||||
PhysDevExtTramp 77
|
|
||||||
PhysDevExtTramp 78
|
|
||||||
PhysDevExtTramp 79
|
|
||||||
PhysDevExtTramp 80
|
|
||||||
PhysDevExtTramp 81
|
|
||||||
PhysDevExtTramp 82
|
|
||||||
PhysDevExtTramp 83
|
|
||||||
PhysDevExtTramp 84
|
|
||||||
PhysDevExtTramp 85
|
|
||||||
PhysDevExtTramp 86
|
|
||||||
PhysDevExtTramp 87
|
|
||||||
PhysDevExtTramp 88
|
|
||||||
PhysDevExtTramp 89
|
|
||||||
PhysDevExtTramp 90
|
|
||||||
PhysDevExtTramp 91
|
|
||||||
PhysDevExtTramp 92
|
|
||||||
PhysDevExtTramp 93
|
|
||||||
PhysDevExtTramp 94
|
|
||||||
PhysDevExtTramp 95
|
|
||||||
PhysDevExtTramp 96
|
|
||||||
PhysDevExtTramp 97
|
|
||||||
PhysDevExtTramp 98
|
|
||||||
PhysDevExtTramp 99
|
|
||||||
PhysDevExtTramp 100
|
|
||||||
PhysDevExtTramp 101
|
|
||||||
PhysDevExtTramp 102
|
|
||||||
PhysDevExtTramp 103
|
|
||||||
PhysDevExtTramp 104
|
|
||||||
PhysDevExtTramp 105
|
|
||||||
PhysDevExtTramp 106
|
|
||||||
PhysDevExtTramp 107
|
|
||||||
PhysDevExtTramp 108
|
|
||||||
PhysDevExtTramp 109
|
|
||||||
PhysDevExtTramp 110
|
|
||||||
PhysDevExtTramp 111
|
|
||||||
PhysDevExtTramp 112
|
|
||||||
PhysDevExtTramp 113
|
|
||||||
PhysDevExtTramp 114
|
|
||||||
PhysDevExtTramp 115
|
|
||||||
PhysDevExtTramp 116
|
|
||||||
PhysDevExtTramp 117
|
|
||||||
PhysDevExtTramp 118
|
|
||||||
PhysDevExtTramp 119
|
|
||||||
PhysDevExtTramp 120
|
|
||||||
PhysDevExtTramp 121
|
|
||||||
PhysDevExtTramp 122
|
|
||||||
PhysDevExtTramp 123
|
|
||||||
PhysDevExtTramp 124
|
|
||||||
PhysDevExtTramp 125
|
|
||||||
PhysDevExtTramp 126
|
|
||||||
PhysDevExtTramp 127
|
|
||||||
PhysDevExtTramp 128
|
|
||||||
PhysDevExtTramp 129
|
|
||||||
PhysDevExtTramp 130
|
|
||||||
PhysDevExtTramp 131
|
|
||||||
PhysDevExtTramp 132
|
|
||||||
PhysDevExtTramp 133
|
|
||||||
PhysDevExtTramp 134
|
|
||||||
PhysDevExtTramp 135
|
|
||||||
PhysDevExtTramp 136
|
|
||||||
PhysDevExtTramp 137
|
|
||||||
PhysDevExtTramp 138
|
|
||||||
PhysDevExtTramp 139
|
|
||||||
PhysDevExtTramp 140
|
|
||||||
PhysDevExtTramp 141
|
|
||||||
PhysDevExtTramp 142
|
|
||||||
PhysDevExtTramp 143
|
|
||||||
PhysDevExtTramp 144
|
|
||||||
PhysDevExtTramp 145
|
|
||||||
PhysDevExtTramp 146
|
|
||||||
PhysDevExtTramp 147
|
|
||||||
PhysDevExtTramp 148
|
|
||||||
PhysDevExtTramp 149
|
|
||||||
PhysDevExtTramp 150
|
|
||||||
PhysDevExtTramp 151
|
|
||||||
PhysDevExtTramp 152
|
|
||||||
PhysDevExtTramp 153
|
|
||||||
PhysDevExtTramp 154
|
|
||||||
PhysDevExtTramp 155
|
|
||||||
PhysDevExtTramp 156
|
|
||||||
PhysDevExtTramp 157
|
|
||||||
PhysDevExtTramp 158
|
|
||||||
PhysDevExtTramp 159
|
|
||||||
PhysDevExtTramp 160
|
|
||||||
PhysDevExtTramp 161
|
|
||||||
PhysDevExtTramp 162
|
|
||||||
PhysDevExtTramp 163
|
|
||||||
PhysDevExtTramp 164
|
|
||||||
PhysDevExtTramp 165
|
|
||||||
PhysDevExtTramp 166
|
|
||||||
PhysDevExtTramp 167
|
|
||||||
PhysDevExtTramp 168
|
|
||||||
PhysDevExtTramp 169
|
|
||||||
PhysDevExtTramp 170
|
|
||||||
PhysDevExtTramp 171
|
|
||||||
PhysDevExtTramp 172
|
|
||||||
PhysDevExtTramp 173
|
|
||||||
PhysDevExtTramp 174
|
|
||||||
PhysDevExtTramp 175
|
|
||||||
PhysDevExtTramp 176
|
|
||||||
PhysDevExtTramp 177
|
|
||||||
PhysDevExtTramp 178
|
|
||||||
PhysDevExtTramp 179
|
|
||||||
PhysDevExtTramp 180
|
|
||||||
PhysDevExtTramp 181
|
|
||||||
PhysDevExtTramp 182
|
|
||||||
PhysDevExtTramp 183
|
|
||||||
PhysDevExtTramp 184
|
|
||||||
PhysDevExtTramp 185
|
|
||||||
PhysDevExtTramp 186
|
|
||||||
PhysDevExtTramp 187
|
|
||||||
PhysDevExtTramp 188
|
|
||||||
PhysDevExtTramp 189
|
|
||||||
PhysDevExtTramp 190
|
|
||||||
PhysDevExtTramp 191
|
|
||||||
PhysDevExtTramp 192
|
|
||||||
PhysDevExtTramp 193
|
|
||||||
PhysDevExtTramp 194
|
|
||||||
PhysDevExtTramp 195
|
|
||||||
PhysDevExtTramp 196
|
|
||||||
PhysDevExtTramp 197
|
|
||||||
PhysDevExtTramp 198
|
|
||||||
PhysDevExtTramp 199
|
|
||||||
PhysDevExtTramp 200
|
|
||||||
PhysDevExtTramp 201
|
|
||||||
PhysDevExtTramp 202
|
|
||||||
PhysDevExtTramp 203
|
|
||||||
PhysDevExtTramp 204
|
|
||||||
PhysDevExtTramp 205
|
|
||||||
PhysDevExtTramp 206
|
|
||||||
PhysDevExtTramp 207
|
|
||||||
PhysDevExtTramp 208
|
|
||||||
PhysDevExtTramp 209
|
|
||||||
PhysDevExtTramp 210
|
|
||||||
PhysDevExtTramp 211
|
|
||||||
PhysDevExtTramp 212
|
|
||||||
PhysDevExtTramp 213
|
|
||||||
PhysDevExtTramp 214
|
|
||||||
PhysDevExtTramp 215
|
|
||||||
PhysDevExtTramp 216
|
|
||||||
PhysDevExtTramp 217
|
|
||||||
PhysDevExtTramp 218
|
|
||||||
PhysDevExtTramp 219
|
|
||||||
PhysDevExtTramp 220
|
|
||||||
PhysDevExtTramp 221
|
|
||||||
PhysDevExtTramp 222
|
|
||||||
PhysDevExtTramp 223
|
|
||||||
PhysDevExtTramp 224
|
|
||||||
PhysDevExtTramp 225
|
|
||||||
PhysDevExtTramp 226
|
|
||||||
PhysDevExtTramp 227
|
|
||||||
PhysDevExtTramp 228
|
|
||||||
PhysDevExtTramp 229
|
|
||||||
PhysDevExtTramp 230
|
|
||||||
PhysDevExtTramp 231
|
|
||||||
PhysDevExtTramp 232
|
|
||||||
PhysDevExtTramp 233
|
|
||||||
PhysDevExtTramp 234
|
|
||||||
PhysDevExtTramp 235
|
|
||||||
PhysDevExtTramp 236
|
|
||||||
PhysDevExtTramp 237
|
|
||||||
PhysDevExtTramp 238
|
|
||||||
PhysDevExtTramp 239
|
|
||||||
PhysDevExtTramp 240
|
|
||||||
PhysDevExtTramp 241
|
|
||||||
PhysDevExtTramp 242
|
|
||||||
PhysDevExtTramp 243
|
|
||||||
PhysDevExtTramp 244
|
|
||||||
PhysDevExtTramp 245
|
|
||||||
PhysDevExtTramp 246
|
|
||||||
PhysDevExtTramp 247
|
|
||||||
PhysDevExtTramp 248
|
|
||||||
PhysDevExtTramp 249
|
|
||||||
|
|
||||||
PhysDevExtTermin 0
|
|
||||||
PhysDevExtTermin 1
|
|
||||||
PhysDevExtTermin 2
|
|
||||||
PhysDevExtTermin 3
|
|
||||||
PhysDevExtTermin 4
|
|
||||||
PhysDevExtTermin 5
|
|
||||||
PhysDevExtTermin 6
|
|
||||||
PhysDevExtTermin 7
|
|
||||||
PhysDevExtTermin 8
|
|
||||||
PhysDevExtTermin 9
|
|
||||||
PhysDevExtTermin 10
|
|
||||||
PhysDevExtTermin 11
|
|
||||||
PhysDevExtTermin 12
|
|
||||||
PhysDevExtTermin 13
|
|
||||||
PhysDevExtTermin 14
|
|
||||||
PhysDevExtTermin 15
|
|
||||||
PhysDevExtTermin 16
|
|
||||||
PhysDevExtTermin 17
|
|
||||||
PhysDevExtTermin 18
|
|
||||||
PhysDevExtTermin 19
|
|
||||||
PhysDevExtTermin 20
|
|
||||||
PhysDevExtTermin 21
|
|
||||||
PhysDevExtTermin 22
|
|
||||||
PhysDevExtTermin 23
|
|
||||||
PhysDevExtTermin 24
|
|
||||||
PhysDevExtTermin 25
|
|
||||||
PhysDevExtTermin 26
|
|
||||||
PhysDevExtTermin 27
|
|
||||||
PhysDevExtTermin 28
|
|
||||||
PhysDevExtTermin 29
|
|
||||||
PhysDevExtTermin 30
|
|
||||||
PhysDevExtTermin 31
|
|
||||||
PhysDevExtTermin 32
|
|
||||||
PhysDevExtTermin 33
|
|
||||||
PhysDevExtTermin 34
|
|
||||||
PhysDevExtTermin 35
|
|
||||||
PhysDevExtTermin 36
|
|
||||||
PhysDevExtTermin 37
|
|
||||||
PhysDevExtTermin 38
|
|
||||||
PhysDevExtTermin 39
|
|
||||||
PhysDevExtTermin 40
|
|
||||||
PhysDevExtTermin 41
|
|
||||||
PhysDevExtTermin 42
|
|
||||||
PhysDevExtTermin 43
|
|
||||||
PhysDevExtTermin 44
|
|
||||||
PhysDevExtTermin 45
|
|
||||||
PhysDevExtTermin 46
|
|
||||||
PhysDevExtTermin 47
|
|
||||||
PhysDevExtTermin 48
|
|
||||||
PhysDevExtTermin 49
|
|
||||||
PhysDevExtTermin 50
|
|
||||||
PhysDevExtTermin 51
|
|
||||||
PhysDevExtTermin 52
|
|
||||||
PhysDevExtTermin 53
|
|
||||||
PhysDevExtTermin 54
|
|
||||||
PhysDevExtTermin 55
|
|
||||||
PhysDevExtTermin 56
|
|
||||||
PhysDevExtTermin 57
|
|
||||||
PhysDevExtTermin 58
|
|
||||||
PhysDevExtTermin 59
|
|
||||||
PhysDevExtTermin 60
|
|
||||||
PhysDevExtTermin 61
|
|
||||||
PhysDevExtTermin 62
|
|
||||||
PhysDevExtTermin 63
|
|
||||||
PhysDevExtTermin 64
|
|
||||||
PhysDevExtTermin 65
|
|
||||||
PhysDevExtTermin 66
|
|
||||||
PhysDevExtTermin 67
|
|
||||||
PhysDevExtTermin 68
|
|
||||||
PhysDevExtTermin 69
|
|
||||||
PhysDevExtTermin 70
|
|
||||||
PhysDevExtTermin 71
|
|
||||||
PhysDevExtTermin 72
|
|
||||||
PhysDevExtTermin 73
|
|
||||||
PhysDevExtTermin 74
|
|
||||||
PhysDevExtTermin 75
|
|
||||||
PhysDevExtTermin 76
|
|
||||||
PhysDevExtTermin 77
|
|
||||||
PhysDevExtTermin 78
|
|
||||||
PhysDevExtTermin 79
|
|
||||||
PhysDevExtTermin 80
|
|
||||||
PhysDevExtTermin 81
|
|
||||||
PhysDevExtTermin 82
|
|
||||||
PhysDevExtTermin 83
|
|
||||||
PhysDevExtTermin 84
|
|
||||||
PhysDevExtTermin 85
|
|
||||||
PhysDevExtTermin 86
|
|
||||||
PhysDevExtTermin 87
|
|
||||||
PhysDevExtTermin 88
|
|
||||||
PhysDevExtTermin 89
|
|
||||||
PhysDevExtTermin 90
|
|
||||||
PhysDevExtTermin 91
|
|
||||||
PhysDevExtTermin 92
|
|
||||||
PhysDevExtTermin 93
|
|
||||||
PhysDevExtTermin 94
|
|
||||||
PhysDevExtTermin 95
|
|
||||||
PhysDevExtTermin 96
|
|
||||||
PhysDevExtTermin 97
|
|
||||||
PhysDevExtTermin 98
|
|
||||||
PhysDevExtTermin 99
|
|
||||||
PhysDevExtTermin 100
|
|
||||||
PhysDevExtTermin 101
|
|
||||||
PhysDevExtTermin 102
|
|
||||||
PhysDevExtTermin 103
|
|
||||||
PhysDevExtTermin 104
|
|
||||||
PhysDevExtTermin 105
|
|
||||||
PhysDevExtTermin 106
|
|
||||||
PhysDevExtTermin 107
|
|
||||||
PhysDevExtTermin 108
|
|
||||||
PhysDevExtTermin 109
|
|
||||||
PhysDevExtTermin 110
|
|
||||||
PhysDevExtTermin 111
|
|
||||||
PhysDevExtTermin 112
|
|
||||||
PhysDevExtTermin 113
|
|
||||||
PhysDevExtTermin 114
|
|
||||||
PhysDevExtTermin 115
|
|
||||||
PhysDevExtTermin 116
|
|
||||||
PhysDevExtTermin 117
|
|
||||||
PhysDevExtTermin 118
|
|
||||||
PhysDevExtTermin 119
|
|
||||||
PhysDevExtTermin 120
|
|
||||||
PhysDevExtTermin 121
|
|
||||||
PhysDevExtTermin 122
|
|
||||||
PhysDevExtTermin 123
|
|
||||||
PhysDevExtTermin 124
|
|
||||||
PhysDevExtTermin 125
|
|
||||||
PhysDevExtTermin 126
|
|
||||||
PhysDevExtTermin 127
|
|
||||||
PhysDevExtTermin 128
|
|
||||||
PhysDevExtTermin 129
|
|
||||||
PhysDevExtTermin 130
|
|
||||||
PhysDevExtTermin 131
|
|
||||||
PhysDevExtTermin 132
|
|
||||||
PhysDevExtTermin 133
|
|
||||||
PhysDevExtTermin 134
|
|
||||||
PhysDevExtTermin 135
|
|
||||||
PhysDevExtTermin 136
|
|
||||||
PhysDevExtTermin 137
|
|
||||||
PhysDevExtTermin 138
|
|
||||||
PhysDevExtTermin 139
|
|
||||||
PhysDevExtTermin 140
|
|
||||||
PhysDevExtTermin 141
|
|
||||||
PhysDevExtTermin 142
|
|
||||||
PhysDevExtTermin 143
|
|
||||||
PhysDevExtTermin 144
|
|
||||||
PhysDevExtTermin 145
|
|
||||||
PhysDevExtTermin 146
|
|
||||||
PhysDevExtTermin 147
|
|
||||||
PhysDevExtTermin 148
|
|
||||||
PhysDevExtTermin 149
|
|
||||||
PhysDevExtTermin 150
|
|
||||||
PhysDevExtTermin 151
|
|
||||||
PhysDevExtTermin 152
|
|
||||||
PhysDevExtTermin 153
|
|
||||||
PhysDevExtTermin 154
|
|
||||||
PhysDevExtTermin 155
|
|
||||||
PhysDevExtTermin 156
|
|
||||||
PhysDevExtTermin 157
|
|
||||||
PhysDevExtTermin 158
|
|
||||||
PhysDevExtTermin 159
|
|
||||||
PhysDevExtTermin 160
|
|
||||||
PhysDevExtTermin 161
|
|
||||||
PhysDevExtTermin 162
|
|
||||||
PhysDevExtTermin 163
|
|
||||||
PhysDevExtTermin 164
|
|
||||||
PhysDevExtTermin 165
|
|
||||||
PhysDevExtTermin 166
|
|
||||||
PhysDevExtTermin 167
|
|
||||||
PhysDevExtTermin 168
|
|
||||||
PhysDevExtTermin 169
|
|
||||||
PhysDevExtTermin 170
|
|
||||||
PhysDevExtTermin 171
|
|
||||||
PhysDevExtTermin 172
|
|
||||||
PhysDevExtTermin 173
|
|
||||||
PhysDevExtTermin 174
|
|
||||||
PhysDevExtTermin 175
|
|
||||||
PhysDevExtTermin 176
|
|
||||||
PhysDevExtTermin 177
|
|
||||||
PhysDevExtTermin 178
|
|
||||||
PhysDevExtTermin 179
|
|
||||||
PhysDevExtTermin 180
|
|
||||||
PhysDevExtTermin 181
|
|
||||||
PhysDevExtTermin 182
|
|
||||||
PhysDevExtTermin 183
|
|
||||||
PhysDevExtTermin 184
|
|
||||||
PhysDevExtTermin 185
|
|
||||||
PhysDevExtTermin 186
|
|
||||||
PhysDevExtTermin 187
|
|
||||||
PhysDevExtTermin 188
|
|
||||||
PhysDevExtTermin 189
|
|
||||||
PhysDevExtTermin 190
|
|
||||||
PhysDevExtTermin 191
|
|
||||||
PhysDevExtTermin 192
|
|
||||||
PhysDevExtTermin 193
|
|
||||||
PhysDevExtTermin 194
|
|
||||||
PhysDevExtTermin 195
|
|
||||||
PhysDevExtTermin 196
|
|
||||||
PhysDevExtTermin 197
|
|
||||||
PhysDevExtTermin 198
|
|
||||||
PhysDevExtTermin 199
|
|
||||||
PhysDevExtTermin 200
|
|
||||||
PhysDevExtTermin 201
|
|
||||||
PhysDevExtTermin 202
|
|
||||||
PhysDevExtTermin 203
|
|
||||||
PhysDevExtTermin 204
|
|
||||||
PhysDevExtTermin 205
|
|
||||||
PhysDevExtTermin 206
|
|
||||||
PhysDevExtTermin 207
|
|
||||||
PhysDevExtTermin 208
|
|
||||||
PhysDevExtTermin 209
|
|
||||||
PhysDevExtTermin 210
|
|
||||||
PhysDevExtTermin 211
|
|
||||||
PhysDevExtTermin 212
|
|
||||||
PhysDevExtTermin 213
|
|
||||||
PhysDevExtTermin 214
|
|
||||||
PhysDevExtTermin 215
|
|
||||||
PhysDevExtTermin 216
|
|
||||||
PhysDevExtTermin 217
|
|
||||||
PhysDevExtTermin 218
|
|
||||||
PhysDevExtTermin 219
|
|
||||||
PhysDevExtTermin 220
|
|
||||||
PhysDevExtTermin 221
|
|
||||||
PhysDevExtTermin 222
|
|
||||||
PhysDevExtTermin 223
|
|
||||||
PhysDevExtTermin 224
|
|
||||||
PhysDevExtTermin 225
|
|
||||||
PhysDevExtTermin 226
|
|
||||||
PhysDevExtTermin 227
|
|
||||||
PhysDevExtTermin 228
|
|
||||||
PhysDevExtTermin 229
|
|
||||||
PhysDevExtTermin 230
|
|
||||||
PhysDevExtTermin 231
|
|
||||||
PhysDevExtTermin 232
|
|
||||||
PhysDevExtTermin 233
|
|
||||||
PhysDevExtTermin 234
|
|
||||||
PhysDevExtTermin 235
|
|
||||||
PhysDevExtTermin 236
|
|
||||||
PhysDevExtTermin 237
|
|
||||||
PhysDevExtTermin 238
|
|
||||||
PhysDevExtTermin 239
|
|
||||||
PhysDevExtTermin 240
|
|
||||||
PhysDevExtTermin 241
|
|
||||||
PhysDevExtTermin 242
|
|
||||||
PhysDevExtTermin 243
|
|
||||||
PhysDevExtTermin 244
|
|
||||||
PhysDevExtTermin 245
|
|
||||||
PhysDevExtTermin 246
|
|
||||||
PhysDevExtTermin 247
|
|
||||||
PhysDevExtTermin 248
|
|
||||||
PhysDevExtTermin 249
|
|
||||||
|
|
||||||
DevExtTramp 0
|
|
||||||
DevExtTramp 1
|
|
||||||
DevExtTramp 2
|
|
||||||
DevExtTramp 3
|
|
||||||
DevExtTramp 4
|
|
||||||
DevExtTramp 5
|
|
||||||
DevExtTramp 6
|
|
||||||
DevExtTramp 7
|
|
||||||
DevExtTramp 8
|
|
||||||
DevExtTramp 9
|
|
||||||
DevExtTramp 10
|
|
||||||
DevExtTramp 11
|
|
||||||
DevExtTramp 12
|
|
||||||
DevExtTramp 13
|
|
||||||
DevExtTramp 14
|
|
||||||
DevExtTramp 15
|
|
||||||
DevExtTramp 16
|
|
||||||
DevExtTramp 17
|
|
||||||
DevExtTramp 18
|
|
||||||
DevExtTramp 19
|
|
||||||
DevExtTramp 20
|
|
||||||
DevExtTramp 21
|
|
||||||
DevExtTramp 22
|
|
||||||
DevExtTramp 23
|
|
||||||
DevExtTramp 24
|
|
||||||
DevExtTramp 25
|
|
||||||
DevExtTramp 26
|
|
||||||
DevExtTramp 27
|
|
||||||
DevExtTramp 28
|
|
||||||
DevExtTramp 29
|
|
||||||
DevExtTramp 30
|
|
||||||
DevExtTramp 31
|
|
||||||
DevExtTramp 32
|
|
||||||
DevExtTramp 33
|
|
||||||
DevExtTramp 34
|
|
||||||
DevExtTramp 35
|
|
||||||
DevExtTramp 36
|
|
||||||
DevExtTramp 37
|
|
||||||
DevExtTramp 38
|
|
||||||
DevExtTramp 39
|
|
||||||
DevExtTramp 40
|
|
||||||
DevExtTramp 41
|
|
||||||
DevExtTramp 42
|
|
||||||
DevExtTramp 43
|
|
||||||
DevExtTramp 44
|
|
||||||
DevExtTramp 45
|
|
||||||
DevExtTramp 46
|
|
||||||
DevExtTramp 47
|
|
||||||
DevExtTramp 48
|
|
||||||
DevExtTramp 49
|
|
||||||
DevExtTramp 50
|
|
||||||
DevExtTramp 51
|
|
||||||
DevExtTramp 52
|
|
||||||
DevExtTramp 53
|
|
||||||
DevExtTramp 54
|
|
||||||
DevExtTramp 55
|
|
||||||
DevExtTramp 56
|
|
||||||
DevExtTramp 57
|
|
||||||
DevExtTramp 58
|
|
||||||
DevExtTramp 59
|
|
||||||
DevExtTramp 60
|
|
||||||
DevExtTramp 61
|
|
||||||
DevExtTramp 62
|
|
||||||
DevExtTramp 63
|
|
||||||
DevExtTramp 64
|
|
||||||
DevExtTramp 65
|
|
||||||
DevExtTramp 66
|
|
||||||
DevExtTramp 67
|
|
||||||
DevExtTramp 68
|
|
||||||
DevExtTramp 69
|
|
||||||
DevExtTramp 70
|
|
||||||
DevExtTramp 71
|
|
||||||
DevExtTramp 72
|
|
||||||
DevExtTramp 73
|
|
||||||
DevExtTramp 74
|
|
||||||
DevExtTramp 75
|
|
||||||
DevExtTramp 76
|
|
||||||
DevExtTramp 77
|
|
||||||
DevExtTramp 78
|
|
||||||
DevExtTramp 79
|
|
||||||
DevExtTramp 80
|
|
||||||
DevExtTramp 81
|
|
||||||
DevExtTramp 82
|
|
||||||
DevExtTramp 83
|
|
||||||
DevExtTramp 84
|
|
||||||
DevExtTramp 85
|
|
||||||
DevExtTramp 86
|
|
||||||
DevExtTramp 87
|
|
||||||
DevExtTramp 88
|
|
||||||
DevExtTramp 89
|
|
||||||
DevExtTramp 90
|
|
||||||
DevExtTramp 91
|
|
||||||
DevExtTramp 92
|
|
||||||
DevExtTramp 93
|
|
||||||
DevExtTramp 94
|
|
||||||
DevExtTramp 95
|
|
||||||
DevExtTramp 96
|
|
||||||
DevExtTramp 97
|
|
||||||
DevExtTramp 98
|
|
||||||
DevExtTramp 99
|
|
||||||
DevExtTramp 100
|
|
||||||
DevExtTramp 101
|
|
||||||
DevExtTramp 102
|
|
||||||
DevExtTramp 103
|
|
||||||
DevExtTramp 104
|
|
||||||
DevExtTramp 105
|
|
||||||
DevExtTramp 106
|
|
||||||
DevExtTramp 107
|
|
||||||
DevExtTramp 108
|
|
||||||
DevExtTramp 109
|
|
||||||
DevExtTramp 110
|
|
||||||
DevExtTramp 111
|
|
||||||
DevExtTramp 112
|
|
||||||
DevExtTramp 113
|
|
||||||
DevExtTramp 114
|
|
||||||
DevExtTramp 115
|
|
||||||
DevExtTramp 116
|
|
||||||
DevExtTramp 117
|
|
||||||
DevExtTramp 118
|
|
||||||
DevExtTramp 119
|
|
||||||
DevExtTramp 120
|
|
||||||
DevExtTramp 121
|
|
||||||
DevExtTramp 122
|
|
||||||
DevExtTramp 123
|
|
||||||
DevExtTramp 124
|
|
||||||
DevExtTramp 125
|
|
||||||
DevExtTramp 126
|
|
||||||
DevExtTramp 127
|
|
||||||
DevExtTramp 128
|
|
||||||
DevExtTramp 129
|
|
||||||
DevExtTramp 130
|
|
||||||
DevExtTramp 131
|
|
||||||
DevExtTramp 132
|
|
||||||
DevExtTramp 133
|
|
||||||
DevExtTramp 134
|
|
||||||
DevExtTramp 135
|
|
||||||
DevExtTramp 136
|
|
||||||
DevExtTramp 137
|
|
||||||
DevExtTramp 138
|
|
||||||
DevExtTramp 139
|
|
||||||
DevExtTramp 140
|
|
||||||
DevExtTramp 141
|
|
||||||
DevExtTramp 142
|
|
||||||
DevExtTramp 143
|
|
||||||
DevExtTramp 144
|
|
||||||
DevExtTramp 145
|
|
||||||
DevExtTramp 146
|
|
||||||
DevExtTramp 147
|
|
||||||
DevExtTramp 148
|
|
||||||
DevExtTramp 149
|
|
||||||
DevExtTramp 150
|
|
||||||
DevExtTramp 151
|
|
||||||
DevExtTramp 152
|
|
||||||
DevExtTramp 153
|
|
||||||
DevExtTramp 154
|
|
||||||
DevExtTramp 155
|
|
||||||
DevExtTramp 156
|
|
||||||
DevExtTramp 157
|
|
||||||
DevExtTramp 158
|
|
||||||
DevExtTramp 159
|
|
||||||
DevExtTramp 160
|
|
||||||
DevExtTramp 161
|
|
||||||
DevExtTramp 162
|
|
||||||
DevExtTramp 163
|
|
||||||
DevExtTramp 164
|
|
||||||
DevExtTramp 165
|
|
||||||
DevExtTramp 166
|
|
||||||
DevExtTramp 167
|
|
||||||
DevExtTramp 168
|
|
||||||
DevExtTramp 169
|
|
||||||
DevExtTramp 170
|
|
||||||
DevExtTramp 171
|
|
||||||
DevExtTramp 172
|
|
||||||
DevExtTramp 173
|
|
||||||
DevExtTramp 174
|
|
||||||
DevExtTramp 175
|
|
||||||
DevExtTramp 176
|
|
||||||
DevExtTramp 177
|
|
||||||
DevExtTramp 178
|
|
||||||
DevExtTramp 179
|
|
||||||
DevExtTramp 180
|
|
||||||
DevExtTramp 181
|
|
||||||
DevExtTramp 182
|
|
||||||
DevExtTramp 183
|
|
||||||
DevExtTramp 184
|
|
||||||
DevExtTramp 185
|
|
||||||
DevExtTramp 186
|
|
||||||
DevExtTramp 187
|
|
||||||
DevExtTramp 188
|
|
||||||
DevExtTramp 189
|
|
||||||
DevExtTramp 190
|
|
||||||
DevExtTramp 191
|
|
||||||
DevExtTramp 192
|
|
||||||
DevExtTramp 193
|
|
||||||
DevExtTramp 194
|
|
||||||
DevExtTramp 195
|
|
||||||
DevExtTramp 196
|
|
||||||
DevExtTramp 197
|
|
||||||
DevExtTramp 198
|
|
||||||
DevExtTramp 199
|
|
||||||
DevExtTramp 200
|
|
||||||
DevExtTramp 201
|
|
||||||
DevExtTramp 202
|
|
||||||
DevExtTramp 203
|
|
||||||
DevExtTramp 204
|
|
||||||
DevExtTramp 205
|
|
||||||
DevExtTramp 206
|
|
||||||
DevExtTramp 207
|
|
||||||
DevExtTramp 208
|
|
||||||
DevExtTramp 209
|
|
||||||
DevExtTramp 210
|
|
||||||
DevExtTramp 211
|
|
||||||
DevExtTramp 212
|
|
||||||
DevExtTramp 213
|
|
||||||
DevExtTramp 214
|
|
||||||
DevExtTramp 215
|
|
||||||
DevExtTramp 216
|
|
||||||
DevExtTramp 217
|
|
||||||
DevExtTramp 218
|
|
||||||
DevExtTramp 219
|
|
||||||
DevExtTramp 220
|
|
||||||
DevExtTramp 221
|
|
||||||
DevExtTramp 222
|
|
||||||
DevExtTramp 223
|
|
||||||
DevExtTramp 224
|
|
||||||
DevExtTramp 225
|
|
||||||
DevExtTramp 226
|
|
||||||
DevExtTramp 227
|
|
||||||
DevExtTramp 228
|
|
||||||
DevExtTramp 229
|
|
||||||
DevExtTramp 230
|
|
||||||
DevExtTramp 231
|
|
||||||
DevExtTramp 232
|
|
||||||
DevExtTramp 233
|
|
||||||
DevExtTramp 234
|
|
||||||
DevExtTramp 235
|
|
||||||
DevExtTramp 236
|
|
||||||
DevExtTramp 237
|
|
||||||
DevExtTramp 238
|
|
||||||
DevExtTramp 239
|
|
||||||
DevExtTramp 240
|
|
||||||
DevExtTramp 241
|
|
||||||
DevExtTramp 242
|
|
||||||
DevExtTramp 243
|
|
||||||
DevExtTramp 244
|
|
||||||
DevExtTramp 245
|
|
||||||
DevExtTramp 246
|
|
||||||
DevExtTramp 247
|
|
||||||
DevExtTramp 248
|
|
||||||
DevExtTramp 249
|
|
||||||
|
|
||||||
end
|
|
@ -63,10 +63,10 @@ static VKAPI_ATTR void VKAPI_CALL StubCmdPushDescriptorSetWithTemplateKHR(VkComm
|
|||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) { };
|
static VKAPI_ATTR void VKAPI_CALL StubDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) { };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) { };
|
static VKAPI_ATTR void VKAPI_CALL StubUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) { };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2KHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfoKHR* pSubpassBeginInfo) { };
|
static VKAPI_ATTR void VKAPI_CALL StubCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) { };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfoKHR* pSubpassBeginInfo, const VkSubpassEndInfoKHR* pSubpassEndInfo) { };
|
static VKAPI_ATTR void VKAPI_CALL StubCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) { };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfoKHR* pSubpassEndInfo) { };
|
static VKAPI_ATTR void VKAPI_CALL StubCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) { };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain) { return VK_SUCCESS; };
|
||||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) { return VK_SUCCESS; };
|
||||||
@ -76,6 +76,8 @@ static VKAPI_ATTR VkResult VKAPI_CALL StubGetFenceWin32HandleKHR(VkDevice device
|
|||||||
#endif // VK_USE_PLATFORM_WIN32_KHR
|
#endif // VK_USE_PLATFORM_WIN32_KHR
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) { return VK_SUCCESS; };
|
||||||
|
static VKAPI_ATTR VkResult VKAPI_CALL StubAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo) { return VK_SUCCESS; };
|
||||||
|
static VKAPI_ATTR void VKAPI_CALL StubReleaseProfilingLockKHR(VkDevice device) { };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { };
|
static VKAPI_ATTR void VKAPI_CALL StubGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { };
|
static VKAPI_ATTR void VKAPI_CALL StubGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { };
|
static VKAPI_ATTR void VKAPI_CALL StubGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { };
|
||||||
@ -87,8 +89,11 @@ static VKAPI_ATTR void VKAPI_CALL StubGetDescriptorSetLayoutSupportKHR(VkDevice
|
|||||||
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
|
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
|
static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfoKHR* pWaitInfo, uint64_t timeout) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfoKHR* pSignalInfo) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) { return VK_SUCCESS; };
|
||||||
|
static VKAPI_ATTR void VKAPI_CALL StubGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { };
|
||||||
|
static VKAPI_ATTR void VKAPI_CALL StubGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { };
|
||||||
|
static VKAPI_ATTR void VKAPI_CALL StubGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) { };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount, VkPipelineExecutablePropertiesKHR* pProperties) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount, VkPipelineExecutablePropertiesKHR* pProperties) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) { return VK_SUCCESS; };
|
||||||
@ -175,7 +180,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL StubReleasePerformanceConfigurationINTEL(V
|
|||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue) { return VK_SUCCESS; };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable) { };
|
static VKAPI_ATTR void VKAPI_CALL StubSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable) { };
|
||||||
static VKAPI_ATTR void VKAPI_CALL StubGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfoEXT* pInfo) { };
|
static VKAPI_ATTR void VKAPI_CALL StubGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { };
|
||||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||||
static VKAPI_ATTR VkResult VKAPI_CALL StubAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) { return VK_SUCCESS; };
|
static VKAPI_ATTR VkResult VKAPI_CALL StubAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) { return VK_SUCCESS; };
|
||||||
#endif // VK_USE_PLATFORM_WIN32_KHR
|
#endif // VK_USE_PLATFORM_WIN32_KHR
|
||||||
@ -330,6 +335,19 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp
|
|||||||
table->DestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate) gpa(device, "vkDestroyDescriptorUpdateTemplate");
|
table->DestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate) gpa(device, "vkDestroyDescriptorUpdateTemplate");
|
||||||
table->UpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate) gpa(device, "vkUpdateDescriptorSetWithTemplate");
|
table->UpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate) gpa(device, "vkUpdateDescriptorSetWithTemplate");
|
||||||
table->GetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport) gpa(device, "vkGetDescriptorSetLayoutSupport");
|
table->GetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport) gpa(device, "vkGetDescriptorSetLayoutSupport");
|
||||||
|
table->CmdDrawIndirectCount = (PFN_vkCmdDrawIndirectCount) gpa(device, "vkCmdDrawIndirectCount");
|
||||||
|
table->CmdDrawIndexedIndirectCount = (PFN_vkCmdDrawIndexedIndirectCount) gpa(device, "vkCmdDrawIndexedIndirectCount");
|
||||||
|
table->CreateRenderPass2 = (PFN_vkCreateRenderPass2) gpa(device, "vkCreateRenderPass2");
|
||||||
|
table->CmdBeginRenderPass2 = (PFN_vkCmdBeginRenderPass2) gpa(device, "vkCmdBeginRenderPass2");
|
||||||
|
table->CmdNextSubpass2 = (PFN_vkCmdNextSubpass2) gpa(device, "vkCmdNextSubpass2");
|
||||||
|
table->CmdEndRenderPass2 = (PFN_vkCmdEndRenderPass2) gpa(device, "vkCmdEndRenderPass2");
|
||||||
|
table->ResetQueryPool = (PFN_vkResetQueryPool) gpa(device, "vkResetQueryPool");
|
||||||
|
table->GetSemaphoreCounterValue = (PFN_vkGetSemaphoreCounterValue) gpa(device, "vkGetSemaphoreCounterValue");
|
||||||
|
table->WaitSemaphores = (PFN_vkWaitSemaphores) gpa(device, "vkWaitSemaphores");
|
||||||
|
table->SignalSemaphore = (PFN_vkSignalSemaphore) gpa(device, "vkSignalSemaphore");
|
||||||
|
table->GetBufferDeviceAddress = (PFN_vkGetBufferDeviceAddress) gpa(device, "vkGetBufferDeviceAddress");
|
||||||
|
table->GetBufferOpaqueCaptureAddress = (PFN_vkGetBufferOpaqueCaptureAddress) gpa(device, "vkGetBufferOpaqueCaptureAddress");
|
||||||
|
table->GetDeviceMemoryOpaqueCaptureAddress = (PFN_vkGetDeviceMemoryOpaqueCaptureAddress) gpa(device, "vkGetDeviceMemoryOpaqueCaptureAddress");
|
||||||
table->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR) gpa(device, "vkCreateSwapchainKHR");
|
table->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR) gpa(device, "vkCreateSwapchainKHR");
|
||||||
if (table->CreateSwapchainKHR == nullptr) { table->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR)StubCreateSwapchainKHR; }
|
if (table->CreateSwapchainKHR == nullptr) { table->CreateSwapchainKHR = (PFN_vkCreateSwapchainKHR)StubCreateSwapchainKHR; }
|
||||||
table->DestroySwapchainKHR = (PFN_vkDestroySwapchainKHR) gpa(device, "vkDestroySwapchainKHR");
|
table->DestroySwapchainKHR = (PFN_vkDestroySwapchainKHR) gpa(device, "vkDestroySwapchainKHR");
|
||||||
@ -412,6 +430,10 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp
|
|||||||
if (table->ImportFenceFdKHR == nullptr) { table->ImportFenceFdKHR = (PFN_vkImportFenceFdKHR)StubImportFenceFdKHR; }
|
if (table->ImportFenceFdKHR == nullptr) { table->ImportFenceFdKHR = (PFN_vkImportFenceFdKHR)StubImportFenceFdKHR; }
|
||||||
table->GetFenceFdKHR = (PFN_vkGetFenceFdKHR) gpa(device, "vkGetFenceFdKHR");
|
table->GetFenceFdKHR = (PFN_vkGetFenceFdKHR) gpa(device, "vkGetFenceFdKHR");
|
||||||
if (table->GetFenceFdKHR == nullptr) { table->GetFenceFdKHR = (PFN_vkGetFenceFdKHR)StubGetFenceFdKHR; }
|
if (table->GetFenceFdKHR == nullptr) { table->GetFenceFdKHR = (PFN_vkGetFenceFdKHR)StubGetFenceFdKHR; }
|
||||||
|
table->AcquireProfilingLockKHR = (PFN_vkAcquireProfilingLockKHR) gpa(device, "vkAcquireProfilingLockKHR");
|
||||||
|
if (table->AcquireProfilingLockKHR == nullptr) { table->AcquireProfilingLockKHR = (PFN_vkAcquireProfilingLockKHR)StubAcquireProfilingLockKHR; }
|
||||||
|
table->ReleaseProfilingLockKHR = (PFN_vkReleaseProfilingLockKHR) gpa(device, "vkReleaseProfilingLockKHR");
|
||||||
|
if (table->ReleaseProfilingLockKHR == nullptr) { table->ReleaseProfilingLockKHR = (PFN_vkReleaseProfilingLockKHR)StubReleaseProfilingLockKHR; }
|
||||||
table->GetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR) gpa(device, "vkGetImageMemoryRequirements2KHR");
|
table->GetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR) gpa(device, "vkGetImageMemoryRequirements2KHR");
|
||||||
if (table->GetImageMemoryRequirements2KHR == nullptr) { table->GetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR)StubGetImageMemoryRequirements2KHR; }
|
if (table->GetImageMemoryRequirements2KHR == nullptr) { table->GetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR)StubGetImageMemoryRequirements2KHR; }
|
||||||
table->GetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR) gpa(device, "vkGetBufferMemoryRequirements2KHR");
|
table->GetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR) gpa(device, "vkGetBufferMemoryRequirements2KHR");
|
||||||
@ -438,6 +460,12 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp
|
|||||||
if (table->WaitSemaphoresKHR == nullptr) { table->WaitSemaphoresKHR = (PFN_vkWaitSemaphoresKHR)StubWaitSemaphoresKHR; }
|
if (table->WaitSemaphoresKHR == nullptr) { table->WaitSemaphoresKHR = (PFN_vkWaitSemaphoresKHR)StubWaitSemaphoresKHR; }
|
||||||
table->SignalSemaphoreKHR = (PFN_vkSignalSemaphoreKHR) gpa(device, "vkSignalSemaphoreKHR");
|
table->SignalSemaphoreKHR = (PFN_vkSignalSemaphoreKHR) gpa(device, "vkSignalSemaphoreKHR");
|
||||||
if (table->SignalSemaphoreKHR == nullptr) { table->SignalSemaphoreKHR = (PFN_vkSignalSemaphoreKHR)StubSignalSemaphoreKHR; }
|
if (table->SignalSemaphoreKHR == nullptr) { table->SignalSemaphoreKHR = (PFN_vkSignalSemaphoreKHR)StubSignalSemaphoreKHR; }
|
||||||
|
table->GetBufferDeviceAddressKHR = (PFN_vkGetBufferDeviceAddressKHR) gpa(device, "vkGetBufferDeviceAddressKHR");
|
||||||
|
if (table->GetBufferDeviceAddressKHR == nullptr) { table->GetBufferDeviceAddressKHR = (PFN_vkGetBufferDeviceAddressKHR)StubGetBufferDeviceAddressKHR; }
|
||||||
|
table->GetBufferOpaqueCaptureAddressKHR = (PFN_vkGetBufferOpaqueCaptureAddressKHR) gpa(device, "vkGetBufferOpaqueCaptureAddressKHR");
|
||||||
|
if (table->GetBufferOpaqueCaptureAddressKHR == nullptr) { table->GetBufferOpaqueCaptureAddressKHR = (PFN_vkGetBufferOpaqueCaptureAddressKHR)StubGetBufferOpaqueCaptureAddressKHR; }
|
||||||
|
table->GetDeviceMemoryOpaqueCaptureAddressKHR = (PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR) gpa(device, "vkGetDeviceMemoryOpaqueCaptureAddressKHR");
|
||||||
|
if (table->GetDeviceMemoryOpaqueCaptureAddressKHR == nullptr) { table->GetDeviceMemoryOpaqueCaptureAddressKHR = (PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR)StubGetDeviceMemoryOpaqueCaptureAddressKHR; }
|
||||||
table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR) gpa(device, "vkGetPipelineExecutablePropertiesKHR");
|
table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR) gpa(device, "vkGetPipelineExecutablePropertiesKHR");
|
||||||
if (table->GetPipelineExecutablePropertiesKHR == nullptr) { table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)StubGetPipelineExecutablePropertiesKHR; }
|
if (table->GetPipelineExecutablePropertiesKHR == nullptr) { table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)StubGetPipelineExecutablePropertiesKHR; }
|
||||||
table->GetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR) gpa(device, "vkGetPipelineExecutableStatisticsKHR");
|
table->GetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR) gpa(device, "vkGetPipelineExecutableStatisticsKHR");
|
||||||
@ -710,6 +738,8 @@ static inline void layer_init_instance_dispatch_table(VkInstance instance, VkLay
|
|||||||
table->GetPhysicalDeviceExternalBufferPropertiesKHR = (PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalBufferPropertiesKHR");
|
table->GetPhysicalDeviceExternalBufferPropertiesKHR = (PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalBufferPropertiesKHR");
|
||||||
table->GetPhysicalDeviceExternalSemaphorePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");
|
table->GetPhysicalDeviceExternalSemaphorePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");
|
||||||
table->GetPhysicalDeviceExternalFencePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalFencePropertiesKHR");
|
table->GetPhysicalDeviceExternalFencePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR) gpa(instance, "vkGetPhysicalDeviceExternalFencePropertiesKHR");
|
||||||
|
table->EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = (PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR) gpa(instance, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR");
|
||||||
|
table->GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = (PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR) gpa(instance, "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR");
|
||||||
table->GetPhysicalDeviceSurfaceCapabilities2KHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR) gpa(instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR");
|
table->GetPhysicalDeviceSurfaceCapabilities2KHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR) gpa(instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR");
|
||||||
table->GetPhysicalDeviceSurfaceFormats2KHR = (PFN_vkGetPhysicalDeviceSurfaceFormats2KHR) gpa(instance, "vkGetPhysicalDeviceSurfaceFormats2KHR");
|
table->GetPhysicalDeviceSurfaceFormats2KHR = (PFN_vkGetPhysicalDeviceSurfaceFormats2KHR) gpa(instance, "vkGetPhysicalDeviceSurfaceFormats2KHR");
|
||||||
table->GetPhysicalDeviceDisplayProperties2KHR = (PFN_vkGetPhysicalDeviceDisplayProperties2KHR) gpa(instance, "vkGetPhysicalDeviceDisplayProperties2KHR");
|
table->GetPhysicalDeviceDisplayProperties2KHR = (PFN_vkGetPhysicalDeviceDisplayProperties2KHR) gpa(instance, "vkGetPhysicalDeviceDisplayProperties2KHR");
|
||||||
@ -752,6 +782,7 @@ static inline void layer_init_instance_dispatch_table(VkInstance instance, VkLay
|
|||||||
#ifdef VK_USE_PLATFORM_METAL_EXT
|
#ifdef VK_USE_PLATFORM_METAL_EXT
|
||||||
table->CreateMetalSurfaceEXT = (PFN_vkCreateMetalSurfaceEXT) gpa(instance, "vkCreateMetalSurfaceEXT");
|
table->CreateMetalSurfaceEXT = (PFN_vkCreateMetalSurfaceEXT) gpa(instance, "vkCreateMetalSurfaceEXT");
|
||||||
#endif // VK_USE_PLATFORM_METAL_EXT
|
#endif // VK_USE_PLATFORM_METAL_EXT
|
||||||
|
table->GetPhysicalDeviceToolPropertiesEXT = (PFN_vkGetPhysicalDeviceToolPropertiesEXT) gpa(instance, "vkGetPhysicalDeviceToolPropertiesEXT");
|
||||||
table->GetPhysicalDeviceCooperativeMatrixPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV) gpa(instance, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV");
|
table->GetPhysicalDeviceCooperativeMatrixPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV) gpa(instance, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV");
|
||||||
table->GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = (PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV) gpa(instance, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV");
|
table->GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = (PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV) gpa(instance, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV");
|
||||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||||
|
@ -140,6 +140,10 @@ typedef struct VkLayerInstanceDispatchTable_ {
|
|||||||
// ---- VK_KHR_external_fence_capabilities extension commands
|
// ---- VK_KHR_external_fence_capabilities extension commands
|
||||||
PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR GetPhysicalDeviceExternalFencePropertiesKHR;
|
PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR GetPhysicalDeviceExternalFencePropertiesKHR;
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR;
|
||||||
|
PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR;
|
||||||
|
|
||||||
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
||||||
PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR GetPhysicalDeviceSurfaceCapabilities2KHR;
|
PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR GetPhysicalDeviceSurfaceCapabilities2KHR;
|
||||||
PFN_vkGetPhysicalDeviceSurfaceFormats2KHR GetPhysicalDeviceSurfaceFormats2KHR;
|
PFN_vkGetPhysicalDeviceSurfaceFormats2KHR GetPhysicalDeviceSurfaceFormats2KHR;
|
||||||
@ -216,6 +220,9 @@ typedef struct VkLayerInstanceDispatchTable_ {
|
|||||||
PFN_vkCreateMetalSurfaceEXT CreateMetalSurfaceEXT;
|
PFN_vkCreateMetalSurfaceEXT CreateMetalSurfaceEXT;
|
||||||
#endif // VK_USE_PLATFORM_METAL_EXT
|
#endif // VK_USE_PLATFORM_METAL_EXT
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension commands
|
||||||
|
PFN_vkGetPhysicalDeviceToolPropertiesEXT GetPhysicalDeviceToolPropertiesEXT;
|
||||||
|
|
||||||
// ---- VK_NV_cooperative_matrix extension commands
|
// ---- VK_NV_cooperative_matrix extension commands
|
||||||
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV GetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV GetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
||||||
|
|
||||||
@ -375,6 +382,21 @@ typedef struct VkLayerDispatchTable_ {
|
|||||||
PFN_vkUpdateDescriptorSetWithTemplate UpdateDescriptorSetWithTemplate;
|
PFN_vkUpdateDescriptorSetWithTemplate UpdateDescriptorSetWithTemplate;
|
||||||
PFN_vkGetDescriptorSetLayoutSupport GetDescriptorSetLayoutSupport;
|
PFN_vkGetDescriptorSetLayoutSupport GetDescriptorSetLayoutSupport;
|
||||||
|
|
||||||
|
// ---- Core 1_2 commands
|
||||||
|
PFN_vkCmdDrawIndirectCount CmdDrawIndirectCount;
|
||||||
|
PFN_vkCmdDrawIndexedIndirectCount CmdDrawIndexedIndirectCount;
|
||||||
|
PFN_vkCreateRenderPass2 CreateRenderPass2;
|
||||||
|
PFN_vkCmdBeginRenderPass2 CmdBeginRenderPass2;
|
||||||
|
PFN_vkCmdNextSubpass2 CmdNextSubpass2;
|
||||||
|
PFN_vkCmdEndRenderPass2 CmdEndRenderPass2;
|
||||||
|
PFN_vkResetQueryPool ResetQueryPool;
|
||||||
|
PFN_vkGetSemaphoreCounterValue GetSemaphoreCounterValue;
|
||||||
|
PFN_vkWaitSemaphores WaitSemaphores;
|
||||||
|
PFN_vkSignalSemaphore SignalSemaphore;
|
||||||
|
PFN_vkGetBufferDeviceAddress GetBufferDeviceAddress;
|
||||||
|
PFN_vkGetBufferOpaqueCaptureAddress GetBufferOpaqueCaptureAddress;
|
||||||
|
PFN_vkGetDeviceMemoryOpaqueCaptureAddress GetDeviceMemoryOpaqueCaptureAddress;
|
||||||
|
|
||||||
// ---- VK_KHR_swapchain extension commands
|
// ---- VK_KHR_swapchain extension commands
|
||||||
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
|
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
|
||||||
PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
|
PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
|
||||||
@ -450,6 +472,10 @@ typedef struct VkLayerDispatchTable_ {
|
|||||||
PFN_vkImportFenceFdKHR ImportFenceFdKHR;
|
PFN_vkImportFenceFdKHR ImportFenceFdKHR;
|
||||||
PFN_vkGetFenceFdKHR GetFenceFdKHR;
|
PFN_vkGetFenceFdKHR GetFenceFdKHR;
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
PFN_vkAcquireProfilingLockKHR AcquireProfilingLockKHR;
|
||||||
|
PFN_vkReleaseProfilingLockKHR ReleaseProfilingLockKHR;
|
||||||
|
|
||||||
// ---- VK_KHR_get_memory_requirements2 extension commands
|
// ---- VK_KHR_get_memory_requirements2 extension commands
|
||||||
PFN_vkGetImageMemoryRequirements2KHR GetImageMemoryRequirements2KHR;
|
PFN_vkGetImageMemoryRequirements2KHR GetImageMemoryRequirements2KHR;
|
||||||
PFN_vkGetBufferMemoryRequirements2KHR GetBufferMemoryRequirements2KHR;
|
PFN_vkGetBufferMemoryRequirements2KHR GetBufferMemoryRequirements2KHR;
|
||||||
@ -475,6 +501,11 @@ typedef struct VkLayerDispatchTable_ {
|
|||||||
PFN_vkWaitSemaphoresKHR WaitSemaphoresKHR;
|
PFN_vkWaitSemaphoresKHR WaitSemaphoresKHR;
|
||||||
PFN_vkSignalSemaphoreKHR SignalSemaphoreKHR;
|
PFN_vkSignalSemaphoreKHR SignalSemaphoreKHR;
|
||||||
|
|
||||||
|
// ---- VK_KHR_buffer_device_address extension commands
|
||||||
|
PFN_vkGetBufferDeviceAddressKHR GetBufferDeviceAddressKHR;
|
||||||
|
PFN_vkGetBufferOpaqueCaptureAddressKHR GetBufferOpaqueCaptureAddressKHR;
|
||||||
|
PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR GetDeviceMemoryOpaqueCaptureAddressKHR;
|
||||||
|
|
||||||
// ---- VK_KHR_pipeline_executable_properties extension commands
|
// ---- VK_KHR_pipeline_executable_properties extension commands
|
||||||
PFN_vkGetPipelineExecutablePropertiesKHR GetPipelineExecutablePropertiesKHR;
|
PFN_vkGetPipelineExecutablePropertiesKHR GetPipelineExecutablePropertiesKHR;
|
||||||
PFN_vkGetPipelineExecutableStatisticsKHR GetPipelineExecutableStatisticsKHR;
|
PFN_vkGetPipelineExecutableStatisticsKHR GetPipelineExecutableStatisticsKHR;
|
||||||
|
302
thirdparty/vulkan/loader/vk_loader_extensions.c
vendored
302
thirdparty/vulkan/loader/vk_loader_extensions.c
vendored
@ -172,6 +172,10 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_t
|
|||||||
// ---- VK_KHR_external_fence_capabilities extension commands
|
// ---- VK_KHR_external_fence_capabilities extension commands
|
||||||
LOOKUP_GIPA(GetPhysicalDeviceExternalFencePropertiesKHR, false);
|
LOOKUP_GIPA(GetPhysicalDeviceExternalFencePropertiesKHR, false);
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
LOOKUP_GIPA(EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, false);
|
||||||
|
LOOKUP_GIPA(GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, false);
|
||||||
|
|
||||||
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
||||||
LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilities2KHR, false);
|
LOOKUP_GIPA(GetPhysicalDeviceSurfaceCapabilities2KHR, false);
|
||||||
LOOKUP_GIPA(GetPhysicalDeviceSurfaceFormats2KHR, false);
|
LOOKUP_GIPA(GetPhysicalDeviceSurfaceFormats2KHR, false);
|
||||||
@ -234,6 +238,12 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_t
|
|||||||
// ---- VK_EXT_debug_utils extension commands
|
// ---- VK_EXT_debug_utils extension commands
|
||||||
LOOKUP_GIPA(SetDebugUtilsObjectNameEXT, false);
|
LOOKUP_GIPA(SetDebugUtilsObjectNameEXT, false);
|
||||||
LOOKUP_GIPA(SetDebugUtilsObjectTagEXT, false);
|
LOOKUP_GIPA(SetDebugUtilsObjectTagEXT, false);
|
||||||
|
LOOKUP_GIPA(QueueBeginDebugUtilsLabelEXT, false);
|
||||||
|
LOOKUP_GIPA(QueueEndDebugUtilsLabelEXT, false);
|
||||||
|
LOOKUP_GIPA(QueueInsertDebugUtilsLabelEXT, false);
|
||||||
|
LOOKUP_GIPA(CmdBeginDebugUtilsLabelEXT, false);
|
||||||
|
LOOKUP_GIPA(CmdEndDebugUtilsLabelEXT, false);
|
||||||
|
LOOKUP_GIPA(CmdInsertDebugUtilsLabelEXT, false);
|
||||||
LOOKUP_GIPA(CreateDebugUtilsMessengerEXT, false);
|
LOOKUP_GIPA(CreateDebugUtilsMessengerEXT, false);
|
||||||
LOOKUP_GIPA(DestroyDebugUtilsMessengerEXT, false);
|
LOOKUP_GIPA(DestroyDebugUtilsMessengerEXT, false);
|
||||||
LOOKUP_GIPA(SubmitDebugUtilsMessageEXT, false);
|
LOOKUP_GIPA(SubmitDebugUtilsMessageEXT, false);
|
||||||
@ -254,6 +264,9 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_t
|
|||||||
LOOKUP_GIPA(CreateMetalSurfaceEXT, false);
|
LOOKUP_GIPA(CreateMetalSurfaceEXT, false);
|
||||||
#endif // VK_USE_PLATFORM_METAL_EXT
|
#endif // VK_USE_PLATFORM_METAL_EXT
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension commands
|
||||||
|
LOOKUP_GIPA(GetPhysicalDeviceToolPropertiesEXT, false);
|
||||||
|
|
||||||
// ---- VK_NV_cooperative_matrix extension commands
|
// ---- VK_NV_cooperative_matrix extension commands
|
||||||
LOOKUP_GIPA(GetPhysicalDeviceCooperativeMatrixPropertiesNV, false);
|
LOOKUP_GIPA(GetPhysicalDeviceCooperativeMatrixPropertiesNV, false);
|
||||||
|
|
||||||
@ -422,6 +435,21 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_dispatch_table(struct loader_dev_d
|
|||||||
table->DestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate)gpa(dev, "vkDestroyDescriptorUpdateTemplate");
|
table->DestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate)gpa(dev, "vkDestroyDescriptorUpdateTemplate");
|
||||||
table->UpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate)gpa(dev, "vkUpdateDescriptorSetWithTemplate");
|
table->UpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate)gpa(dev, "vkUpdateDescriptorSetWithTemplate");
|
||||||
table->GetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport)gpa(dev, "vkGetDescriptorSetLayoutSupport");
|
table->GetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport)gpa(dev, "vkGetDescriptorSetLayoutSupport");
|
||||||
|
|
||||||
|
// ---- Core 1_2 commands
|
||||||
|
table->CmdDrawIndirectCount = (PFN_vkCmdDrawIndirectCount)gpa(dev, "vkCmdDrawIndirectCount");
|
||||||
|
table->CmdDrawIndexedIndirectCount = (PFN_vkCmdDrawIndexedIndirectCount)gpa(dev, "vkCmdDrawIndexedIndirectCount");
|
||||||
|
table->CreateRenderPass2 = (PFN_vkCreateRenderPass2)gpa(dev, "vkCreateRenderPass2");
|
||||||
|
table->CmdBeginRenderPass2 = (PFN_vkCmdBeginRenderPass2)gpa(dev, "vkCmdBeginRenderPass2");
|
||||||
|
table->CmdNextSubpass2 = (PFN_vkCmdNextSubpass2)gpa(dev, "vkCmdNextSubpass2");
|
||||||
|
table->CmdEndRenderPass2 = (PFN_vkCmdEndRenderPass2)gpa(dev, "vkCmdEndRenderPass2");
|
||||||
|
table->ResetQueryPool = (PFN_vkResetQueryPool)gpa(dev, "vkResetQueryPool");
|
||||||
|
table->GetSemaphoreCounterValue = (PFN_vkGetSemaphoreCounterValue)gpa(dev, "vkGetSemaphoreCounterValue");
|
||||||
|
table->WaitSemaphores = (PFN_vkWaitSemaphores)gpa(dev, "vkWaitSemaphores");
|
||||||
|
table->SignalSemaphore = (PFN_vkSignalSemaphore)gpa(dev, "vkSignalSemaphore");
|
||||||
|
table->GetBufferDeviceAddress = (PFN_vkGetBufferDeviceAddress)gpa(dev, "vkGetBufferDeviceAddress");
|
||||||
|
table->GetBufferOpaqueCaptureAddress = (PFN_vkGetBufferOpaqueCaptureAddress)gpa(dev, "vkGetBufferOpaqueCaptureAddress");
|
||||||
|
table->GetDeviceMemoryOpaqueCaptureAddress = (PFN_vkGetDeviceMemoryOpaqueCaptureAddress)gpa(dev, "vkGetDeviceMemoryOpaqueCaptureAddress");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init Device function pointer dispatch table with extension commands
|
// Init Device function pointer dispatch table with extension commands
|
||||||
@ -507,6 +535,10 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo
|
|||||||
table->ImportFenceFdKHR = (PFN_vkImportFenceFdKHR)gdpa(dev, "vkImportFenceFdKHR");
|
table->ImportFenceFdKHR = (PFN_vkImportFenceFdKHR)gdpa(dev, "vkImportFenceFdKHR");
|
||||||
table->GetFenceFdKHR = (PFN_vkGetFenceFdKHR)gdpa(dev, "vkGetFenceFdKHR");
|
table->GetFenceFdKHR = (PFN_vkGetFenceFdKHR)gdpa(dev, "vkGetFenceFdKHR");
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
table->AcquireProfilingLockKHR = (PFN_vkAcquireProfilingLockKHR)gdpa(dev, "vkAcquireProfilingLockKHR");
|
||||||
|
table->ReleaseProfilingLockKHR = (PFN_vkReleaseProfilingLockKHR)gdpa(dev, "vkReleaseProfilingLockKHR");
|
||||||
|
|
||||||
// ---- VK_KHR_get_memory_requirements2 extension commands
|
// ---- VK_KHR_get_memory_requirements2 extension commands
|
||||||
table->GetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR)gdpa(dev, "vkGetImageMemoryRequirements2KHR");
|
table->GetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR)gdpa(dev, "vkGetImageMemoryRequirements2KHR");
|
||||||
table->GetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR)gdpa(dev, "vkGetBufferMemoryRequirements2KHR");
|
table->GetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR)gdpa(dev, "vkGetBufferMemoryRequirements2KHR");
|
||||||
@ -532,6 +564,11 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo
|
|||||||
table->WaitSemaphoresKHR = (PFN_vkWaitSemaphoresKHR)gdpa(dev, "vkWaitSemaphoresKHR");
|
table->WaitSemaphoresKHR = (PFN_vkWaitSemaphoresKHR)gdpa(dev, "vkWaitSemaphoresKHR");
|
||||||
table->SignalSemaphoreKHR = (PFN_vkSignalSemaphoreKHR)gdpa(dev, "vkSignalSemaphoreKHR");
|
table->SignalSemaphoreKHR = (PFN_vkSignalSemaphoreKHR)gdpa(dev, "vkSignalSemaphoreKHR");
|
||||||
|
|
||||||
|
// ---- VK_KHR_buffer_device_address extension commands
|
||||||
|
table->GetBufferDeviceAddressKHR = (PFN_vkGetBufferDeviceAddressKHR)gdpa(dev, "vkGetBufferDeviceAddressKHR");
|
||||||
|
table->GetBufferOpaqueCaptureAddressKHR = (PFN_vkGetBufferOpaqueCaptureAddressKHR)gdpa(dev, "vkGetBufferOpaqueCaptureAddressKHR");
|
||||||
|
table->GetDeviceMemoryOpaqueCaptureAddressKHR = (PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR)gdpa(dev, "vkGetDeviceMemoryOpaqueCaptureAddressKHR");
|
||||||
|
|
||||||
// ---- VK_KHR_pipeline_executable_properties extension commands
|
// ---- VK_KHR_pipeline_executable_properties extension commands
|
||||||
table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)gdpa(dev, "vkGetPipelineExecutablePropertiesKHR");
|
table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)gdpa(dev, "vkGetPipelineExecutablePropertiesKHR");
|
||||||
table->GetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR)gdpa(dev, "vkGetPipelineExecutableStatisticsKHR");
|
table->GetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR)gdpa(dev, "vkGetPipelineExecutableStatisticsKHR");
|
||||||
@ -818,6 +855,10 @@ VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayer
|
|||||||
// ---- VK_KHR_external_fence_capabilities extension commands
|
// ---- VK_KHR_external_fence_capabilities extension commands
|
||||||
table->GetPhysicalDeviceExternalFencePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)gpa(inst, "vkGetPhysicalDeviceExternalFencePropertiesKHR");
|
table->GetPhysicalDeviceExternalFencePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)gpa(inst, "vkGetPhysicalDeviceExternalFencePropertiesKHR");
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
table->EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = (PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)gpa(inst, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR");
|
||||||
|
table->GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = (PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)gpa(inst, "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR");
|
||||||
|
|
||||||
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
||||||
table->GetPhysicalDeviceSurfaceCapabilities2KHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)gpa(inst, "vkGetPhysicalDeviceSurfaceCapabilities2KHR");
|
table->GetPhysicalDeviceSurfaceCapabilities2KHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)gpa(inst, "vkGetPhysicalDeviceSurfaceCapabilities2KHR");
|
||||||
table->GetPhysicalDeviceSurfaceFormats2KHR = (PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)gpa(inst, "vkGetPhysicalDeviceSurfaceFormats2KHR");
|
table->GetPhysicalDeviceSurfaceFormats2KHR = (PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)gpa(inst, "vkGetPhysicalDeviceSurfaceFormats2KHR");
|
||||||
@ -894,6 +935,9 @@ VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayer
|
|||||||
table->CreateMetalSurfaceEXT = (PFN_vkCreateMetalSurfaceEXT)gpa(inst, "vkCreateMetalSurfaceEXT");
|
table->CreateMetalSurfaceEXT = (PFN_vkCreateMetalSurfaceEXT)gpa(inst, "vkCreateMetalSurfaceEXT");
|
||||||
#endif // VK_USE_PLATFORM_METAL_EXT
|
#endif // VK_USE_PLATFORM_METAL_EXT
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension commands
|
||||||
|
table->GetPhysicalDeviceToolPropertiesEXT = (PFN_vkGetPhysicalDeviceToolPropertiesEXT)gpa(inst, "vkGetPhysicalDeviceToolPropertiesEXT");
|
||||||
|
|
||||||
// ---- VK_NV_cooperative_matrix extension commands
|
// ---- VK_NV_cooperative_matrix extension commands
|
||||||
table->GetPhysicalDeviceCooperativeMatrixPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)gpa(inst, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV");
|
table->GetPhysicalDeviceCooperativeMatrixPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)gpa(inst, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV");
|
||||||
|
|
||||||
@ -1056,6 +1100,21 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis
|
|||||||
if (!strcmp(name, "UpdateDescriptorSetWithTemplate")) return (void *)table->UpdateDescriptorSetWithTemplate;
|
if (!strcmp(name, "UpdateDescriptorSetWithTemplate")) return (void *)table->UpdateDescriptorSetWithTemplate;
|
||||||
if (!strcmp(name, "GetDescriptorSetLayoutSupport")) return (void *)table->GetDescriptorSetLayoutSupport;
|
if (!strcmp(name, "GetDescriptorSetLayoutSupport")) return (void *)table->GetDescriptorSetLayoutSupport;
|
||||||
|
|
||||||
|
// ---- Core 1_2 commands
|
||||||
|
if (!strcmp(name, "CmdDrawIndirectCount")) return (void *)table->CmdDrawIndirectCount;
|
||||||
|
if (!strcmp(name, "CmdDrawIndexedIndirectCount")) return (void *)table->CmdDrawIndexedIndirectCount;
|
||||||
|
if (!strcmp(name, "CreateRenderPass2")) return (void *)table->CreateRenderPass2;
|
||||||
|
if (!strcmp(name, "CmdBeginRenderPass2")) return (void *)table->CmdBeginRenderPass2;
|
||||||
|
if (!strcmp(name, "CmdNextSubpass2")) return (void *)table->CmdNextSubpass2;
|
||||||
|
if (!strcmp(name, "CmdEndRenderPass2")) return (void *)table->CmdEndRenderPass2;
|
||||||
|
if (!strcmp(name, "ResetQueryPool")) return (void *)table->ResetQueryPool;
|
||||||
|
if (!strcmp(name, "GetSemaphoreCounterValue")) return (void *)table->GetSemaphoreCounterValue;
|
||||||
|
if (!strcmp(name, "WaitSemaphores")) return (void *)table->WaitSemaphores;
|
||||||
|
if (!strcmp(name, "SignalSemaphore")) return (void *)table->SignalSemaphore;
|
||||||
|
if (!strcmp(name, "GetBufferDeviceAddress")) return (void *)table->GetBufferDeviceAddress;
|
||||||
|
if (!strcmp(name, "GetBufferOpaqueCaptureAddress")) return (void *)table->GetBufferOpaqueCaptureAddress;
|
||||||
|
if (!strcmp(name, "GetDeviceMemoryOpaqueCaptureAddress")) return (void *)table->GetDeviceMemoryOpaqueCaptureAddress;
|
||||||
|
|
||||||
// ---- VK_KHR_swapchain extension commands
|
// ---- VK_KHR_swapchain extension commands
|
||||||
if (!strcmp(name, "CreateSwapchainKHR")) return (void *)table->CreateSwapchainKHR;
|
if (!strcmp(name, "CreateSwapchainKHR")) return (void *)table->CreateSwapchainKHR;
|
||||||
if (!strcmp(name, "DestroySwapchainKHR")) return (void *)table->DestroySwapchainKHR;
|
if (!strcmp(name, "DestroySwapchainKHR")) return (void *)table->DestroySwapchainKHR;
|
||||||
@ -1131,6 +1190,10 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis
|
|||||||
if (!strcmp(name, "ImportFenceFdKHR")) return (void *)table->ImportFenceFdKHR;
|
if (!strcmp(name, "ImportFenceFdKHR")) return (void *)table->ImportFenceFdKHR;
|
||||||
if (!strcmp(name, "GetFenceFdKHR")) return (void *)table->GetFenceFdKHR;
|
if (!strcmp(name, "GetFenceFdKHR")) return (void *)table->GetFenceFdKHR;
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
if (!strcmp(name, "AcquireProfilingLockKHR")) return (void *)table->AcquireProfilingLockKHR;
|
||||||
|
if (!strcmp(name, "ReleaseProfilingLockKHR")) return (void *)table->ReleaseProfilingLockKHR;
|
||||||
|
|
||||||
// ---- VK_KHR_get_memory_requirements2 extension commands
|
// ---- VK_KHR_get_memory_requirements2 extension commands
|
||||||
if (!strcmp(name, "GetImageMemoryRequirements2KHR")) return (void *)table->GetImageMemoryRequirements2KHR;
|
if (!strcmp(name, "GetImageMemoryRequirements2KHR")) return (void *)table->GetImageMemoryRequirements2KHR;
|
||||||
if (!strcmp(name, "GetBufferMemoryRequirements2KHR")) return (void *)table->GetBufferMemoryRequirements2KHR;
|
if (!strcmp(name, "GetBufferMemoryRequirements2KHR")) return (void *)table->GetBufferMemoryRequirements2KHR;
|
||||||
@ -1156,6 +1219,11 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis
|
|||||||
if (!strcmp(name, "WaitSemaphoresKHR")) return (void *)table->WaitSemaphoresKHR;
|
if (!strcmp(name, "WaitSemaphoresKHR")) return (void *)table->WaitSemaphoresKHR;
|
||||||
if (!strcmp(name, "SignalSemaphoreKHR")) return (void *)table->SignalSemaphoreKHR;
|
if (!strcmp(name, "SignalSemaphoreKHR")) return (void *)table->SignalSemaphoreKHR;
|
||||||
|
|
||||||
|
// ---- VK_KHR_buffer_device_address extension commands
|
||||||
|
if (!strcmp(name, "GetBufferDeviceAddressKHR")) return (void *)table->GetBufferDeviceAddressKHR;
|
||||||
|
if (!strcmp(name, "GetBufferOpaqueCaptureAddressKHR")) return (void *)table->GetBufferOpaqueCaptureAddressKHR;
|
||||||
|
if (!strcmp(name, "GetDeviceMemoryOpaqueCaptureAddressKHR")) return (void *)table->GetDeviceMemoryOpaqueCaptureAddressKHR;
|
||||||
|
|
||||||
// ---- VK_KHR_pipeline_executable_properties extension commands
|
// ---- VK_KHR_pipeline_executable_properties extension commands
|
||||||
if (!strcmp(name, "GetPipelineExecutablePropertiesKHR")) return (void *)table->GetPipelineExecutablePropertiesKHR;
|
if (!strcmp(name, "GetPipelineExecutablePropertiesKHR")) return (void *)table->GetPipelineExecutablePropertiesKHR;
|
||||||
if (!strcmp(name, "GetPipelineExecutableStatisticsKHR")) return (void *)table->GetPipelineExecutableStatisticsKHR;
|
if (!strcmp(name, "GetPipelineExecutableStatisticsKHR")) return (void *)table->GetPipelineExecutableStatisticsKHR;
|
||||||
@ -1446,6 +1514,10 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerI
|
|||||||
// ---- VK_KHR_external_fence_capabilities extension commands
|
// ---- VK_KHR_external_fence_capabilities extension commands
|
||||||
if (!strcmp(name, "GetPhysicalDeviceExternalFencePropertiesKHR")) return (void *)table->GetPhysicalDeviceExternalFencePropertiesKHR;
|
if (!strcmp(name, "GetPhysicalDeviceExternalFencePropertiesKHR")) return (void *)table->GetPhysicalDeviceExternalFencePropertiesKHR;
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
if (!strcmp(name, "EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR")) return (void *)table->EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR;
|
||||||
|
if (!strcmp(name, "GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR")) return (void *)table->GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR;
|
||||||
|
|
||||||
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
||||||
if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilities2KHR")) return (void *)table->GetPhysicalDeviceSurfaceCapabilities2KHR;
|
if (!strcmp(name, "GetPhysicalDeviceSurfaceCapabilities2KHR")) return (void *)table->GetPhysicalDeviceSurfaceCapabilities2KHR;
|
||||||
if (!strcmp(name, "GetPhysicalDeviceSurfaceFormats2KHR")) return (void *)table->GetPhysicalDeviceSurfaceFormats2KHR;
|
if (!strcmp(name, "GetPhysicalDeviceSurfaceFormats2KHR")) return (void *)table->GetPhysicalDeviceSurfaceFormats2KHR;
|
||||||
@ -1522,6 +1594,9 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerI
|
|||||||
if (!strcmp(name, "CreateMetalSurfaceEXT")) return (void *)table->CreateMetalSurfaceEXT;
|
if (!strcmp(name, "CreateMetalSurfaceEXT")) return (void *)table->CreateMetalSurfaceEXT;
|
||||||
#endif // VK_USE_PLATFORM_METAL_EXT
|
#endif // VK_USE_PLATFORM_METAL_EXT
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension commands
|
||||||
|
if (!strcmp(name, "GetPhysicalDeviceToolPropertiesEXT")) return (void *)table->GetPhysicalDeviceToolPropertiesEXT;
|
||||||
|
|
||||||
// ---- VK_NV_cooperative_matrix extension commands
|
// ---- VK_NV_cooperative_matrix extension commands
|
||||||
if (!strcmp(name, "GetPhysicalDeviceCooperativeMatrixPropertiesNV")) return (void *)table->GetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
if (!strcmp(name, "GetPhysicalDeviceCooperativeMatrixPropertiesNV")) return (void *)table->GetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
||||||
|
|
||||||
@ -1725,7 +1800,7 @@ VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR(
|
|||||||
|
|
||||||
VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass2KHR(
|
VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass2KHR(
|
||||||
VkDevice device,
|
VkDevice device,
|
||||||
const VkRenderPassCreateInfo2KHR* pCreateInfo,
|
const VkRenderPassCreateInfo2* pCreateInfo,
|
||||||
const VkAllocationCallbacks* pAllocator,
|
const VkAllocationCallbacks* pAllocator,
|
||||||
VkRenderPass* pRenderPass) {
|
VkRenderPass* pRenderPass) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
@ -1735,22 +1810,22 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass2KHR(
|
|||||||
VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass2KHR(
|
VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass2KHR(
|
||||||
VkCommandBuffer commandBuffer,
|
VkCommandBuffer commandBuffer,
|
||||||
const VkRenderPassBeginInfo* pRenderPassBegin,
|
const VkRenderPassBeginInfo* pRenderPassBegin,
|
||||||
const VkSubpassBeginInfoKHR* pSubpassBeginInfo) {
|
const VkSubpassBeginInfo* pSubpassBeginInfo) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
disp->CmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
|
disp->CmdBeginRenderPass2KHR(commandBuffer, pRenderPassBegin, pSubpassBeginInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL CmdNextSubpass2KHR(
|
VKAPI_ATTR void VKAPI_CALL CmdNextSubpass2KHR(
|
||||||
VkCommandBuffer commandBuffer,
|
VkCommandBuffer commandBuffer,
|
||||||
const VkSubpassBeginInfoKHR* pSubpassBeginInfo,
|
const VkSubpassBeginInfo* pSubpassBeginInfo,
|
||||||
const VkSubpassEndInfoKHR* pSubpassEndInfo) {
|
const VkSubpassEndInfo* pSubpassEndInfo) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
disp->CmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
|
disp->CmdNextSubpass2KHR(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass2KHR(
|
VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass2KHR(
|
||||||
VkCommandBuffer commandBuffer,
|
VkCommandBuffer commandBuffer,
|
||||||
const VkSubpassEndInfoKHR* pSubpassEndInfo) {
|
const VkSubpassEndInfo* pSubpassEndInfo) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
disp->CmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo);
|
disp->CmdEndRenderPass2KHR(commandBuffer, pSubpassEndInfo);
|
||||||
}
|
}
|
||||||
@ -1806,6 +1881,72 @@ VKAPI_ATTR VkResult VKAPI_CALL GetFenceFdKHR(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension trampoline/terminators
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
uint32_t queueFamilyIndex,
|
||||||
|
uint32_t* pCounterCount,
|
||||||
|
VkPerformanceCounterKHR* pCounters,
|
||||||
|
VkPerformanceCounterDescriptionKHR* pCounterDescriptions) {
|
||||||
|
const VkLayerInstanceDispatchTable *disp;
|
||||||
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
||||||
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
||||||
|
return disp->EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(unwrapped_phys_dev, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
uint32_t queueFamilyIndex,
|
||||||
|
uint32_t* pCounterCount,
|
||||||
|
VkPerformanceCounterKHR* pCounters,
|
||||||
|
VkPerformanceCounterDescriptionKHR* pCounterDescriptions) {
|
||||||
|
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
|
||||||
|
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
|
||||||
|
if (NULL == icd_term->dispatch.EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR) {
|
||||||
|
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
||||||
|
"ICD associated with VkPhysicalDevice does not support EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR");
|
||||||
|
}
|
||||||
|
return icd_term->dispatch.EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(phys_dev_term->phys_dev, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo,
|
||||||
|
uint32_t* pNumPasses) {
|
||||||
|
const VkLayerInstanceDispatchTable *disp;
|
||||||
|
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
|
||||||
|
disp = loader_get_instance_layer_dispatch(physicalDevice);
|
||||||
|
disp->GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(unwrapped_phys_dev, pPerformanceQueryCreateInfo, pNumPasses);
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo,
|
||||||
|
uint32_t* pNumPasses) {
|
||||||
|
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
|
||||||
|
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
|
||||||
|
if (NULL == icd_term->dispatch.GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR) {
|
||||||
|
loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
||||||
|
"ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR");
|
||||||
|
}
|
||||||
|
icd_term->dispatch.GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(phys_dev_term->phys_dev, pPerformanceQueryCreateInfo, pNumPasses);
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR VkResult VKAPI_CALL AcquireProfilingLockKHR(
|
||||||
|
VkDevice device,
|
||||||
|
const VkAcquireProfilingLockInfoKHR* pInfo) {
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->AcquireProfilingLockKHR(device, pInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL ReleaseProfilingLockKHR(
|
||||||
|
VkDevice device) {
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
disp->ReleaseProfilingLockKHR(device);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---- VK_KHR_get_memory_requirements2 extension trampoline/terminators
|
// ---- VK_KHR_get_memory_requirements2 extension trampoline/terminators
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2KHR(
|
VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2KHR(
|
||||||
@ -1923,7 +2064,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreCounterValueKHR(
|
|||||||
|
|
||||||
VKAPI_ATTR VkResult VKAPI_CALL WaitSemaphoresKHR(
|
VKAPI_ATTR VkResult VKAPI_CALL WaitSemaphoresKHR(
|
||||||
VkDevice device,
|
VkDevice device,
|
||||||
const VkSemaphoreWaitInfoKHR* pWaitInfo,
|
const VkSemaphoreWaitInfo* pWaitInfo,
|
||||||
uint64_t timeout) {
|
uint64_t timeout) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
return disp->WaitSemaphoresKHR(device, pWaitInfo, timeout);
|
return disp->WaitSemaphoresKHR(device, pWaitInfo, timeout);
|
||||||
@ -1931,12 +2072,36 @@ VKAPI_ATTR VkResult VKAPI_CALL WaitSemaphoresKHR(
|
|||||||
|
|
||||||
VKAPI_ATTR VkResult VKAPI_CALL SignalSemaphoreKHR(
|
VKAPI_ATTR VkResult VKAPI_CALL SignalSemaphoreKHR(
|
||||||
VkDevice device,
|
VkDevice device,
|
||||||
const VkSemaphoreSignalInfoKHR* pSignalInfo) {
|
const VkSemaphoreSignalInfo* pSignalInfo) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
return disp->SignalSemaphoreKHR(device, pSignalInfo);
|
return disp->SignalSemaphoreKHR(device, pSignalInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---- VK_KHR_buffer_device_address extension trampoline/terminators
|
||||||
|
|
||||||
|
VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressKHR(
|
||||||
|
VkDevice device,
|
||||||
|
const VkBufferDeviceAddressInfo* pInfo) {
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->GetBufferDeviceAddressKHR(device, pInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR uint64_t VKAPI_CALL GetBufferOpaqueCaptureAddressKHR(
|
||||||
|
VkDevice device,
|
||||||
|
const VkBufferDeviceAddressInfo* pInfo) {
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->GetBufferOpaqueCaptureAddressKHR(device, pInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR uint64_t VKAPI_CALL GetDeviceMemoryOpaqueCaptureAddressKHR(
|
||||||
|
VkDevice device,
|
||||||
|
const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {
|
||||||
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
|
return disp->GetDeviceMemoryOpaqueCaptureAddressKHR(device, pInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---- VK_KHR_pipeline_executable_properties extension trampoline/terminators
|
// ---- VK_KHR_pipeline_executable_properties extension trampoline/terminators
|
||||||
|
|
||||||
VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutablePropertiesKHR(
|
VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutablePropertiesKHR(
|
||||||
@ -2556,6 +2721,17 @@ VKAPI_ATTR void VKAPI_CALL QueueBeginDebugUtilsLabelEXT(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL terminator_QueueBeginDebugUtilsLabelEXT(
|
||||||
|
VkQueue queue,
|
||||||
|
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
||||||
|
uint32_t icd_index = 0;
|
||||||
|
struct loader_device *dev;
|
||||||
|
struct loader_icd_term *icd_term = loader_get_icd_and_device(queue, &dev, &icd_index);
|
||||||
|
if (NULL != icd_term && NULL != icd_term->dispatch.QueueBeginDebugUtilsLabelEXT) {
|
||||||
|
icd_term->dispatch.QueueBeginDebugUtilsLabelEXT(queue, pLabelInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL QueueEndDebugUtilsLabelEXT(
|
VKAPI_ATTR void VKAPI_CALL QueueEndDebugUtilsLabelEXT(
|
||||||
VkQueue queue) {
|
VkQueue queue) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(queue);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(queue);
|
||||||
@ -2564,6 +2740,16 @@ VKAPI_ATTR void VKAPI_CALL QueueEndDebugUtilsLabelEXT(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL terminator_QueueEndDebugUtilsLabelEXT(
|
||||||
|
VkQueue queue) {
|
||||||
|
uint32_t icd_index = 0;
|
||||||
|
struct loader_device *dev;
|
||||||
|
struct loader_icd_term *icd_term = loader_get_icd_and_device(queue, &dev, &icd_index);
|
||||||
|
if (NULL != icd_term && NULL != icd_term->dispatch.QueueEndDebugUtilsLabelEXT) {
|
||||||
|
icd_term->dispatch.QueueEndDebugUtilsLabelEXT(queue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL QueueInsertDebugUtilsLabelEXT(
|
VKAPI_ATTR void VKAPI_CALL QueueInsertDebugUtilsLabelEXT(
|
||||||
VkQueue queue,
|
VkQueue queue,
|
||||||
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
||||||
@ -2573,6 +2759,17 @@ VKAPI_ATTR void VKAPI_CALL QueueInsertDebugUtilsLabelEXT(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL terminator_QueueInsertDebugUtilsLabelEXT(
|
||||||
|
VkQueue queue,
|
||||||
|
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
||||||
|
uint32_t icd_index = 0;
|
||||||
|
struct loader_device *dev;
|
||||||
|
struct loader_icd_term *icd_term = loader_get_icd_and_device(queue, &dev, &icd_index);
|
||||||
|
if (NULL != icd_term && NULL != icd_term->dispatch.QueueInsertDebugUtilsLabelEXT) {
|
||||||
|
icd_term->dispatch.QueueInsertDebugUtilsLabelEXT(queue, pLabelInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT(
|
VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT(
|
||||||
VkCommandBuffer commandBuffer,
|
VkCommandBuffer commandBuffer,
|
||||||
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
||||||
@ -2582,6 +2779,17 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL terminator_CmdBeginDebugUtilsLabelEXT(
|
||||||
|
VkCommandBuffer commandBuffer,
|
||||||
|
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
||||||
|
uint32_t icd_index = 0;
|
||||||
|
struct loader_device *dev;
|
||||||
|
struct loader_icd_term *icd_term = loader_get_icd_and_device(commandBuffer, &dev, &icd_index);
|
||||||
|
if (NULL != icd_term && NULL != icd_term->dispatch.CmdBeginDebugUtilsLabelEXT) {
|
||||||
|
icd_term->dispatch.CmdBeginDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL CmdEndDebugUtilsLabelEXT(
|
VKAPI_ATTR void VKAPI_CALL CmdEndDebugUtilsLabelEXT(
|
||||||
VkCommandBuffer commandBuffer) {
|
VkCommandBuffer commandBuffer) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
|
||||||
@ -2590,6 +2798,16 @@ VKAPI_ATTR void VKAPI_CALL CmdEndDebugUtilsLabelEXT(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL terminator_CmdEndDebugUtilsLabelEXT(
|
||||||
|
VkCommandBuffer commandBuffer) {
|
||||||
|
uint32_t icd_index = 0;
|
||||||
|
struct loader_device *dev;
|
||||||
|
struct loader_icd_term *icd_term = loader_get_icd_and_device(commandBuffer, &dev, &icd_index);
|
||||||
|
if (NULL != icd_term && NULL != icd_term->dispatch.CmdEndDebugUtilsLabelEXT) {
|
||||||
|
icd_term->dispatch.CmdEndDebugUtilsLabelEXT(commandBuffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL CmdInsertDebugUtilsLabelEXT(
|
VKAPI_ATTR void VKAPI_CALL CmdInsertDebugUtilsLabelEXT(
|
||||||
VkCommandBuffer commandBuffer,
|
VkCommandBuffer commandBuffer,
|
||||||
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
||||||
@ -2599,6 +2817,17 @@ VKAPI_ATTR void VKAPI_CALL CmdInsertDebugUtilsLabelEXT(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VKAPI_ATTR void VKAPI_CALL terminator_CmdInsertDebugUtilsLabelEXT(
|
||||||
|
VkCommandBuffer commandBuffer,
|
||||||
|
const VkDebugUtilsLabelEXT* pLabelInfo) {
|
||||||
|
uint32_t icd_index = 0;
|
||||||
|
struct loader_device *dev;
|
||||||
|
struct loader_icd_term *icd_term = loader_get_icd_and_device(commandBuffer, &dev, &icd_index);
|
||||||
|
if (NULL != icd_term && NULL != icd_term->dispatch.CmdInsertDebugUtilsLabelEXT) {
|
||||||
|
icd_term->dispatch.CmdInsertDebugUtilsLabelEXT(commandBuffer, pLabelInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---- VK_ANDROID_external_memory_android_hardware_buffer extension trampoline/terminators
|
// ---- VK_ANDROID_external_memory_android_hardware_buffer extension trampoline/terminators
|
||||||
|
|
||||||
@ -3091,7 +3320,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateImagePipeSurfaceFUCHSIA(
|
|||||||
|
|
||||||
VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressEXT(
|
VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressEXT(
|
||||||
VkDevice device,
|
VkDevice device,
|
||||||
const VkBufferDeviceAddressInfoEXT* pInfo) {
|
const VkBufferDeviceAddressInfo* pInfo) {
|
||||||
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
|
||||||
return disp->GetBufferDeviceAddressEXT(device, pInfo);
|
return disp->GetBufferDeviceAddressEXT(device, pInfo);
|
||||||
}
|
}
|
||||||
@ -3413,6 +3642,24 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
if (!strcmp("vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR", name)) {
|
||||||
|
*addr = (void *)EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!strcmp("vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR", name)) {
|
||||||
|
*addr = (void *)GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!strcmp("vkAcquireProfilingLockKHR", name)) {
|
||||||
|
*addr = (void *)AcquireProfilingLockKHR;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!strcmp("vkReleaseProfilingLockKHR", name)) {
|
||||||
|
*addr = (void *)ReleaseProfilingLockKHR;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
||||||
if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilities2KHR", name)) {
|
if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilities2KHR", name)) {
|
||||||
*addr = (ptr_instance->enabled_known_extensions.khr_get_surface_capabilities2 == 1)
|
*addr = (ptr_instance->enabled_known_extensions.khr_get_surface_capabilities2 == 1)
|
||||||
@ -3491,6 +3738,20 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- VK_KHR_buffer_device_address extension commands
|
||||||
|
if (!strcmp("vkGetBufferDeviceAddressKHR", name)) {
|
||||||
|
*addr = (void *)GetBufferDeviceAddressKHR;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!strcmp("vkGetBufferOpaqueCaptureAddressKHR", name)) {
|
||||||
|
*addr = (void *)GetBufferOpaqueCaptureAddressKHR;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!strcmp("vkGetDeviceMemoryOpaqueCaptureAddressKHR", name)) {
|
||||||
|
*addr = (void *)GetDeviceMemoryOpaqueCaptureAddressKHR;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// ---- VK_KHR_pipeline_executable_properties extension commands
|
// ---- VK_KHR_pipeline_executable_properties extension commands
|
||||||
if (!strcmp("vkGetPipelineExecutablePropertiesKHR", name)) {
|
if (!strcmp("vkGetPipelineExecutablePropertiesKHR", name)) {
|
||||||
*addr = (void *)GetPipelineExecutablePropertiesKHR;
|
*addr = (void *)GetPipelineExecutablePropertiesKHR;
|
||||||
@ -4013,6 +4274,12 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension commands
|
||||||
|
if (!strcmp("vkGetPhysicalDeviceToolPropertiesEXT", name)) {
|
||||||
|
*addr = (void *)GetPhysicalDeviceToolPropertiesEXT;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// ---- VK_NV_cooperative_matrix extension commands
|
// ---- VK_NV_cooperative_matrix extension commands
|
||||||
if (!strcmp("vkGetPhysicalDeviceCooperativeMatrixPropertiesNV", name)) {
|
if (!strcmp("vkGetPhysicalDeviceCooperativeMatrixPropertiesNV", name)) {
|
||||||
*addr = (void *)GetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
*addr = (void *)GetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
||||||
@ -4173,6 +4440,18 @@ PFN_vkVoidFunction get_extension_device_proc_terminator(struct loader_device *de
|
|||||||
addr = (PFN_vkVoidFunction)terminator_SetDebugUtilsObjectNameEXT;
|
addr = (PFN_vkVoidFunction)terminator_SetDebugUtilsObjectNameEXT;
|
||||||
} else if(!strcmp(pName, "vkSetDebugUtilsObjectTagEXT")) {
|
} else if(!strcmp(pName, "vkSetDebugUtilsObjectTagEXT")) {
|
||||||
addr = (PFN_vkVoidFunction)terminator_SetDebugUtilsObjectTagEXT;
|
addr = (PFN_vkVoidFunction)terminator_SetDebugUtilsObjectTagEXT;
|
||||||
|
} else if(!strcmp(pName, "vkQueueBeginDebugUtilsLabelEXT")) {
|
||||||
|
addr = (PFN_vkVoidFunction)terminator_QueueBeginDebugUtilsLabelEXT;
|
||||||
|
} else if(!strcmp(pName, "vkQueueEndDebugUtilsLabelEXT")) {
|
||||||
|
addr = (PFN_vkVoidFunction)terminator_QueueEndDebugUtilsLabelEXT;
|
||||||
|
} else if(!strcmp(pName, "vkQueueInsertDebugUtilsLabelEXT")) {
|
||||||
|
addr = (PFN_vkVoidFunction)terminator_QueueInsertDebugUtilsLabelEXT;
|
||||||
|
} else if(!strcmp(pName, "vkCmdBeginDebugUtilsLabelEXT")) {
|
||||||
|
addr = (PFN_vkVoidFunction)terminator_CmdBeginDebugUtilsLabelEXT;
|
||||||
|
} else if(!strcmp(pName, "vkCmdEndDebugUtilsLabelEXT")) {
|
||||||
|
addr = (PFN_vkVoidFunction)terminator_CmdEndDebugUtilsLabelEXT;
|
||||||
|
} else if(!strcmp(pName, "vkCmdInsertDebugUtilsLabelEXT")) {
|
||||||
|
addr = (PFN_vkVoidFunction)terminator_CmdInsertDebugUtilsLabelEXT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||||
@ -4296,6 +4575,10 @@ const VkLayerInstanceDispatchTable instance_disp = {
|
|||||||
// ---- VK_KHR_external_fence_capabilities extension commands
|
// ---- VK_KHR_external_fence_capabilities extension commands
|
||||||
.GetPhysicalDeviceExternalFencePropertiesKHR = terminator_GetPhysicalDeviceExternalFenceProperties,
|
.GetPhysicalDeviceExternalFencePropertiesKHR = terminator_GetPhysicalDeviceExternalFenceProperties,
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
.EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = terminator_EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR,
|
||||||
|
.GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = terminator_GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR,
|
||||||
|
|
||||||
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
||||||
.GetPhysicalDeviceSurfaceCapabilities2KHR = terminator_GetPhysicalDeviceSurfaceCapabilities2KHR,
|
.GetPhysicalDeviceSurfaceCapabilities2KHR = terminator_GetPhysicalDeviceSurfaceCapabilities2KHR,
|
||||||
.GetPhysicalDeviceSurfaceFormats2KHR = terminator_GetPhysicalDeviceSurfaceFormats2KHR,
|
.GetPhysicalDeviceSurfaceFormats2KHR = terminator_GetPhysicalDeviceSurfaceFormats2KHR,
|
||||||
@ -4372,6 +4655,9 @@ const VkLayerInstanceDispatchTable instance_disp = {
|
|||||||
.CreateMetalSurfaceEXT = terminator_CreateMetalSurfaceEXT,
|
.CreateMetalSurfaceEXT = terminator_CreateMetalSurfaceEXT,
|
||||||
#endif // VK_USE_PLATFORM_METAL_EXT
|
#endif // VK_USE_PLATFORM_METAL_EXT
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension commands
|
||||||
|
.GetPhysicalDeviceToolPropertiesEXT = terminator_GetPhysicalDeviceToolPropertiesEXT,
|
||||||
|
|
||||||
// ---- VK_NV_cooperative_matrix extension commands
|
// ---- VK_NV_cooperative_matrix extension commands
|
||||||
.GetPhysicalDeviceCooperativeMatrixPropertiesNV = terminator_GetPhysicalDeviceCooperativeMatrixPropertiesNV,
|
.GetPhysicalDeviceCooperativeMatrixPropertiesNV = terminator_GetPhysicalDeviceCooperativeMatrixPropertiesNV,
|
||||||
|
|
||||||
|
13
thirdparty/vulkan/loader/vk_loader_extensions.h
vendored
13
thirdparty/vulkan/loader/vk_loader_extensions.h
vendored
@ -320,6 +320,10 @@ struct loader_icd_term_dispatch {
|
|||||||
// ---- VK_KHR_external_fence_capabilities extension commands
|
// ---- VK_KHR_external_fence_capabilities extension commands
|
||||||
PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR GetPhysicalDeviceExternalFencePropertiesKHR;
|
PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR GetPhysicalDeviceExternalFencePropertiesKHR;
|
||||||
|
|
||||||
|
// ---- VK_KHR_performance_query extension commands
|
||||||
|
PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR;
|
||||||
|
PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR;
|
||||||
|
|
||||||
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
// ---- VK_KHR_get_surface_capabilities2 extension commands
|
||||||
PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR GetPhysicalDeviceSurfaceCapabilities2KHR;
|
PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR GetPhysicalDeviceSurfaceCapabilities2KHR;
|
||||||
PFN_vkGetPhysicalDeviceSurfaceFormats2KHR GetPhysicalDeviceSurfaceFormats2KHR;
|
PFN_vkGetPhysicalDeviceSurfaceFormats2KHR GetPhysicalDeviceSurfaceFormats2KHR;
|
||||||
@ -382,6 +386,12 @@ struct loader_icd_term_dispatch {
|
|||||||
// ---- VK_EXT_debug_utils extension commands
|
// ---- VK_EXT_debug_utils extension commands
|
||||||
PFN_vkSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT;
|
PFN_vkSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT;
|
||||||
PFN_vkSetDebugUtilsObjectTagEXT SetDebugUtilsObjectTagEXT;
|
PFN_vkSetDebugUtilsObjectTagEXT SetDebugUtilsObjectTagEXT;
|
||||||
|
PFN_vkQueueBeginDebugUtilsLabelEXT QueueBeginDebugUtilsLabelEXT;
|
||||||
|
PFN_vkQueueEndDebugUtilsLabelEXT QueueEndDebugUtilsLabelEXT;
|
||||||
|
PFN_vkQueueInsertDebugUtilsLabelEXT QueueInsertDebugUtilsLabelEXT;
|
||||||
|
PFN_vkCmdBeginDebugUtilsLabelEXT CmdBeginDebugUtilsLabelEXT;
|
||||||
|
PFN_vkCmdEndDebugUtilsLabelEXT CmdEndDebugUtilsLabelEXT;
|
||||||
|
PFN_vkCmdInsertDebugUtilsLabelEXT CmdInsertDebugUtilsLabelEXT;
|
||||||
PFN_vkCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT;
|
PFN_vkCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT;
|
||||||
PFN_vkDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT;
|
PFN_vkDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT;
|
||||||
PFN_vkSubmitDebugUtilsMessageEXT SubmitDebugUtilsMessageEXT;
|
PFN_vkSubmitDebugUtilsMessageEXT SubmitDebugUtilsMessageEXT;
|
||||||
@ -402,6 +412,9 @@ struct loader_icd_term_dispatch {
|
|||||||
PFN_vkCreateMetalSurfaceEXT CreateMetalSurfaceEXT;
|
PFN_vkCreateMetalSurfaceEXT CreateMetalSurfaceEXT;
|
||||||
#endif // VK_USE_PLATFORM_METAL_EXT
|
#endif // VK_USE_PLATFORM_METAL_EXT
|
||||||
|
|
||||||
|
// ---- VK_EXT_tooling_info extension commands
|
||||||
|
PFN_vkGetPhysicalDeviceToolPropertiesEXT GetPhysicalDeviceToolPropertiesEXT;
|
||||||
|
|
||||||
// ---- VK_NV_cooperative_matrix extension commands
|
// ---- VK_NV_cooperative_matrix extension commands
|
||||||
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV GetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV GetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
||||||
|
|
||||||
|
47
thirdparty/vulkan/loader/vk_loader_platform.h
vendored
47
thirdparty/vulkan/loader/vk_loader_platform.h
vendored
@ -279,31 +279,6 @@ static inline char *loader_platform_dirname(char *path) {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WIN32 runtime doesn't have basename().
|
|
||||||
// Microsoft also doesn't have basename(). Paths are different on Windows, and
|
|
||||||
// so this is just a temporary solution in order to get us compiling, so that we
|
|
||||||
// can test some scenarios, and develop the correct solution for Windows.
|
|
||||||
// TODO: Develop a better, permanent solution for Windows, to replace this
|
|
||||||
// temporary code:
|
|
||||||
static char *loader_platform_basename(char *pathname) {
|
|
||||||
char *current, *next;
|
|
||||||
|
|
||||||
// TODO/TBD: Do we need to deal with the Windows's ":" character?
|
|
||||||
|
|
||||||
for (current = pathname; *current != '\0'; current = next) {
|
|
||||||
next = strchr(current, DIRECTORY_SYMBOL);
|
|
||||||
if (next == NULL) {
|
|
||||||
// No more DIRECTORY_SYMBOL's so return p:
|
|
||||||
return current;
|
|
||||||
} else {
|
|
||||||
// Point one character past the DIRECTORY_SYMBOL:
|
|
||||||
next++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// We shouldn't get to here, but this makes the compiler happy:
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dynamic Loading:
|
// Dynamic Loading:
|
||||||
typedef HMODULE loader_platform_dl_handle;
|
typedef HMODULE loader_platform_dl_handle;
|
||||||
static loader_platform_dl_handle loader_platform_open_library(const char *lib_path) {
|
static loader_platform_dl_handle loader_platform_open_library(const char *lib_path) {
|
||||||
@ -336,15 +311,15 @@ static char *loader_platform_get_proc_address_error(const char *name) {
|
|||||||
typedef HANDLE loader_platform_thread;
|
typedef HANDLE loader_platform_thread;
|
||||||
|
|
||||||
// __declspec(thread) is not supported by MinGW compiler (ignored with warning or
|
// __declspec(thread) is not supported by MinGW compiler (ignored with warning or
|
||||||
// cause erorr depending on compiler switches)
|
// cause error depending on compiler switches)
|
||||||
//
|
//
|
||||||
// __thread should be used instead
|
// __thread should be used instead
|
||||||
//
|
//
|
||||||
// __MINGW32__ defined for both 32 and 64 bit MinGW compilers, so it is enough to
|
// __MINGW32__ defined for both 32 and 64 bit MinGW compilers, so it is enough to
|
||||||
// detect any (32 or 64) flawor of MinGW compiler.
|
// detect any (32 or 64) flavor of MinGW compiler.
|
||||||
//
|
//
|
||||||
// @note __GNUC__ could be used as a more generic way to detect _any_
|
// @note __GNUC__ could be used as a more generic way to detect _any_
|
||||||
// GCC[-compitible] compiler on Windows, but this fix was tested
|
// GCC[-compatible] compiler on Windows, but this fix was tested
|
||||||
// only with MinGW, so keep it explicit at the moment.
|
// only with MinGW, so keep it explicit at the moment.
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
#define THREAD_LOCAL_DECL __thread
|
#define THREAD_LOCAL_DECL __thread
|
||||||
@ -355,25 +330,9 @@ typedef HANDLE loader_platform_thread;
|
|||||||
// The once init functionality is not used when building a DLL on Windows. This is because there is no way to clean up the
|
// The once init functionality is not used when building a DLL on Windows. This is because there is no way to clean up the
|
||||||
// resources allocated by anything allocated by once init. This isn't a problem for static libraries, but it is for dynamic
|
// resources allocated by anything allocated by once init. This isn't a problem for static libraries, but it is for dynamic
|
||||||
// ones. When building a DLL, we use DllMain() instead to allow properly cleaning up resources.
|
// ones. When building a DLL, we use DllMain() instead to allow properly cleaning up resources.
|
||||||
#if defined(LOADER_DYNAMIC_LIB)
|
|
||||||
#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var)
|
#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var)
|
||||||
#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var)
|
#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var)
|
||||||
#define LOADER_PLATFORM_THREAD_ONCE(ctl, func)
|
#define LOADER_PLATFORM_THREAD_ONCE(ctl, func)
|
||||||
#else
|
|
||||||
#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) INIT_ONCE var = INIT_ONCE_STATIC_INIT;
|
|
||||||
#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) INIT_ONCE var;
|
|
||||||
#define LOADER_PLATFORM_THREAD_ONCE(ctl, func) loader_platform_thread_once_fn(ctl, func)
|
|
||||||
static BOOL CALLBACK InitFuncWrapper(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) {
|
|
||||||
void (*func)(void) = (void (*)(void))Parameter;
|
|
||||||
func();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
static void loader_platform_thread_once_fn(void *ctl, void (*func)(void)) {
|
|
||||||
assert(func != NULL);
|
|
||||||
assert(ctl != NULL);
|
|
||||||
InitOnceExecuteOnce((PINIT_ONCE)ctl, InitFuncWrapper, (void *)func, NULL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Thread IDs:
|
// Thread IDs:
|
||||||
typedef DWORD loader_platform_thread_id;
|
typedef DWORD loader_platform_thread_id;
|
||||||
|
6236
thirdparty/vulkan/vk_enum_string_helper.h
vendored
6236
thirdparty/vulkan/vk_enum_string_helper.h
vendored
File diff suppressed because it is too large
Load Diff
668
thirdparty/vulkan/vk_mem_alloc.h
vendored
668
thirdparty/vulkan/vk_mem_alloc.h
vendored
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user