Implement 4 AMD-specific extensions.
- Support GL_AMD_shader_ballot (SPV_AMD_shader_ballot). - Support GL_AMD_shader_trinary_minmax (SPV_AMD_shader_trinary_minmax). - Support GL_AMD_shader_explicit_vertex_parameter (SPV_AMD_shader_explicit_vertex_parameter). - Support GL_AMD_gcn_shader (SPV_AMD_gcn_shader).
This commit is contained in:
parent
934855a642
commit
9d93a2370d
@ -1,12 +1,18 @@
|
|||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 2.8.12)
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
|
option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" OFF)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix")
|
set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix")
|
||||||
|
|
||||||
project(glslang)
|
project(glslang)
|
||||||
|
|
||||||
|
if(ENABLE_AMD_EXTENSIONS)
|
||||||
|
add_definitions(-DAMD_EXTENSIONS)
|
||||||
|
endif(ENABLE_AMD_EXTENSIONS)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CMAKE_DEBUG_POSTFIX "d")
|
set(CMAKE_DEBUG_POSTFIX "d")
|
||||||
include(ChooseMSVCCRT.cmake)
|
include(ChooseMSVCCRT.cmake)
|
||||||
|
@ -18,6 +18,11 @@ set(HEADERS
|
|||||||
doc.h
|
doc.h
|
||||||
disassemble.h)
|
disassemble.h)
|
||||||
|
|
||||||
|
if(ENABLE_AMD_EXTENSIONS)
|
||||||
|
set(HEADERS
|
||||||
|
GLSL.ext.AMD.h)
|
||||||
|
endif(ENABLE_AMD_EXTENSIONS)
|
||||||
|
|
||||||
add_library(SPIRV STATIC ${SOURCES} ${HEADERS})
|
add_library(SPIRV STATIC ${SOURCES} ${HEADERS})
|
||||||
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
|
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
|
||||||
|
|
||||||
|
113
SPIRV/GLSL.ext.AMD.h
Normal file
113
SPIRV/GLSL.ext.AMD.h
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
/*
|
||||||
|
** Copyright (c) 2014-2016 The Khronos Group Inc.
|
||||||
|
**
|
||||||
|
** Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
** of this software and/or associated documentation files (the "Materials"),
|
||||||
|
** to deal in the Materials without restriction, including without limitation
|
||||||
|
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
** and/or sell copies of the Materials, and to permit persons to whom the
|
||||||
|
** Materials are furnished to do so, subject to the following conditions:
|
||||||
|
**
|
||||||
|
** The above copyright notice and this permission notice shall be included in
|
||||||
|
** all copies or substantial portions of the Materials.
|
||||||
|
**
|
||||||
|
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
|
||||||
|
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
|
||||||
|
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
|
||||||
|
**
|
||||||
|
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
|
||||||
|
** IN THE MATERIALS.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GLSLextAMD_H
|
||||||
|
#define GLSLextAMD_H
|
||||||
|
|
||||||
|
enum BuiltIn;
|
||||||
|
enum Decoration;
|
||||||
|
enum Op;
|
||||||
|
|
||||||
|
static const int GLSLextAMDVersion = 100;
|
||||||
|
static const int GLSLextAMDRevision = 1;
|
||||||
|
|
||||||
|
// SPV_AMD_shader_ballot
|
||||||
|
static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot";
|
||||||
|
|
||||||
|
static const Op OpGroupIAddNonUniformAMD = static_cast<Op>(5000);
|
||||||
|
static const Op OpGroupFAddNonUniformAMD = static_cast<Op>(5001);
|
||||||
|
static const Op OpGroupFMinNonUniformAMD = static_cast<Op>(5002);
|
||||||
|
static const Op OpGroupUMinNonUniformAMD = static_cast<Op>(5003);
|
||||||
|
static const Op OpGroupSMinNonUniformAMD = static_cast<Op>(5004);
|
||||||
|
static const Op OpGroupFMaxNonUniformAMD = static_cast<Op>(5005);
|
||||||
|
static const Op OpGroupUMaxNonUniformAMD = static_cast<Op>(5006);
|
||||||
|
static const Op OpGroupSMaxNonUniformAMD = static_cast<Op>(5007);
|
||||||
|
|
||||||
|
enum ShaderBallotAMD {
|
||||||
|
ShaderBallotBadAMD = 0, // Don't use
|
||||||
|
|
||||||
|
SwizzleInvocationsAMD = 1,
|
||||||
|
SwizzleInvocationsMaskedAMD = 2,
|
||||||
|
WriteInvocationAMD = 3,
|
||||||
|
MbcntAMD = 4,
|
||||||
|
|
||||||
|
ShaderBallotCountAMD
|
||||||
|
};
|
||||||
|
|
||||||
|
// SPV_AMD_shader_trinary_minmax
|
||||||
|
static const char* const E_SPV_AMD_shader_trinary_minmax = "SPV_AMD_shader_trinary_minmax";
|
||||||
|
|
||||||
|
enum ShaderTrinaryMinMaxAMD {
|
||||||
|
ShaderTrinaryMinMaxBadAMD = 0, // Don't use
|
||||||
|
|
||||||
|
FMin3AMD = 1,
|
||||||
|
UMin3AMD = 2,
|
||||||
|
SMin3AMD = 3,
|
||||||
|
FMax3AMD = 4,
|
||||||
|
UMax3AMD = 5,
|
||||||
|
SMax3AMD = 6,
|
||||||
|
FMid3AMD = 7,
|
||||||
|
UMid3AMD = 8,
|
||||||
|
SMid3AMD = 9,
|
||||||
|
|
||||||
|
ShaderTrinaryMinMaxCountAMD
|
||||||
|
};
|
||||||
|
|
||||||
|
// SPV_AMD_shader_explicit_vertex_parameter
|
||||||
|
static const char* const E_SPV_AMD_shader_explicit_vertex_parameter = "SPV_AMD_shader_explicit_vertex_parameter";
|
||||||
|
|
||||||
|
static const BuiltIn BuiltInBaryCoordNoPerspAMD = static_cast<BuiltIn>(4992);
|
||||||
|
static const BuiltIn BuiltInBaryCoordNoPerspCentroidAMD = static_cast<BuiltIn>(4993);
|
||||||
|
static const BuiltIn BuiltInBaryCoordNoPerspSampleAMD = static_cast<BuiltIn>(4994);
|
||||||
|
static const BuiltIn BuiltInBaryCoordSmoothAMD = static_cast<BuiltIn>(4995);
|
||||||
|
static const BuiltIn BuiltInBaryCoordSmoothCentroidAMD = static_cast<BuiltIn>(4996);
|
||||||
|
static const BuiltIn BuiltInBaryCoordSmoothSampleAMD = static_cast<BuiltIn>(4997);
|
||||||
|
static const BuiltIn BuiltInBaryCoordPullModelAMD = static_cast<BuiltIn>(4998);
|
||||||
|
|
||||||
|
static const Decoration DecorationExplicitInterpAMD = static_cast<Decoration>(4999);
|
||||||
|
|
||||||
|
enum ShaderExplicitVertexParameterAMD {
|
||||||
|
ShaderExplicitVertexParameterBadAMD = 0, // Don't use
|
||||||
|
|
||||||
|
InterpolateAtVertexAMD = 1,
|
||||||
|
|
||||||
|
ShaderExplicitVertexParameterCountAMD
|
||||||
|
};
|
||||||
|
|
||||||
|
// SPV_AMD_gcn_shader
|
||||||
|
static const char* const E_SPV_AMD_gcn_shader = "SPV_AMD_gcn_shader";
|
||||||
|
|
||||||
|
enum GcnShaderAMD {
|
||||||
|
GcnShaderBadAMD = 0, // Don't use
|
||||||
|
|
||||||
|
CubeFaceIndexAMD = 1,
|
||||||
|
CubeFaceCoordAMD = 2,
|
||||||
|
TimeAMD = 3,
|
||||||
|
|
||||||
|
GcnShaderCountAMD
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // #ifndef GLSLextAMD_H
|
@ -43,6 +43,9 @@
|
|||||||
#include "SpvBuilder.h"
|
#include "SpvBuilder.h"
|
||||||
namespace spv {
|
namespace spv {
|
||||||
#include "GLSL.std.450.h"
|
#include "GLSL.std.450.h"
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
#include "GLSL.ext.AMD.h"
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Glslang includes
|
// Glslang includes
|
||||||
@ -147,9 +150,9 @@ protected:
|
|||||||
spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destTypeId, spv::Id operand, glslang::TBasicType typeProxy);
|
spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destTypeId, spv::Id operand, glslang::TBasicType typeProxy);
|
||||||
spv::Id makeSmearedConstant(spv::Id constant, int vectorSize);
|
spv::Id makeSmearedConstant(spv::Id constant, int vectorSize);
|
||||||
spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
|
spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
|
||||||
spv::Id createInvocationsOperation(glslang::TOperator, spv::Id typeId, spv::Id operand);
|
spv::Id createInvocationsOperation(glslang::TOperator, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy);
|
||||||
spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
|
spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
|
||||||
spv::Id createNoArgOperation(glslang::TOperator op);
|
spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId);
|
||||||
spv::Id getSymbolId(const glslang::TIntermSymbol* node);
|
spv::Id getSymbolId(const glslang::TIntermSymbol* node);
|
||||||
void addDecoration(spv::Id id, spv::Decoration dec);
|
void addDecoration(spv::Id id, spv::Decoration dec);
|
||||||
void addDecoration(spv::Id id, spv::Decoration dec, unsigned value);
|
void addDecoration(spv::Id id, spv::Decoration dec, unsigned value);
|
||||||
@ -160,6 +163,7 @@ protected:
|
|||||||
bool isTrivialLeaf(const glslang::TIntermTyped* node);
|
bool isTrivialLeaf(const glslang::TIntermTyped* node);
|
||||||
bool isTrivial(const glslang::TIntermTyped* node);
|
bool isTrivial(const glslang::TIntermTyped* node);
|
||||||
spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right);
|
spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right);
|
||||||
|
spv::Id getExtBuiltins(const char* name);
|
||||||
|
|
||||||
spv::Function* shaderEntry;
|
spv::Function* shaderEntry;
|
||||||
spv::Instruction* entryPoint;
|
spv::Instruction* entryPoint;
|
||||||
@ -175,6 +179,7 @@ protected:
|
|||||||
std::set<spv::Id> iOSet; // all input/output variables from either static use or declaration of interface
|
std::set<spv::Id> iOSet; // all input/output variables from either static use or declaration of interface
|
||||||
const glslang::TIntermediate* glslangIntermediate;
|
const glslang::TIntermediate* glslangIntermediate;
|
||||||
spv::Id stdBuiltins;
|
spv::Id stdBuiltins;
|
||||||
|
std::unordered_map<const char*, spv::Id> extBuiltinMap;
|
||||||
|
|
||||||
std::unordered_map<int, spv::Id> symbolValues;
|
std::unordered_map<int, spv::Id> symbolValues;
|
||||||
std::unordered_set<int> constReadOnlyParameters; // set of formal function parameters that have glslang qualifier constReadOnly, so we know they are not local function "const" that are write-once
|
std::unordered_set<int> constReadOnlyParameters; // set of formal function parameters that have glslang qualifier constReadOnly, so we know they are not local function "const" that are write-once
|
||||||
@ -371,6 +376,10 @@ spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qual
|
|||||||
return spv::DecorationNoPerspective;
|
return spv::DecorationNoPerspective;
|
||||||
else if (qualifier.flat)
|
else if (qualifier.flat)
|
||||||
return spv::DecorationFlat;
|
return spv::DecorationFlat;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (qualifier.explicitInterp)
|
||||||
|
return spv::DecorationExplicitInterpAMD;
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
return spv::DecorationMax;
|
return spv::DecorationMax;
|
||||||
}
|
}
|
||||||
@ -508,6 +517,15 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
|||||||
// TODO: Add SPIR-V builtin ID.
|
// TODO: Add SPIR-V builtin ID.
|
||||||
logger->missingFunctionality("shader ballot");
|
logger->missingFunctionality("shader ballot");
|
||||||
return spv::BuiltInMax;
|
return spv::BuiltInMax;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EbvBaryCoordNoPersp: return spv::BuiltInBaryCoordNoPerspAMD;
|
||||||
|
case glslang::EbvBaryCoordNoPerspCentroid: return spv::BuiltInBaryCoordNoPerspCentroidAMD;
|
||||||
|
case glslang::EbvBaryCoordNoPerspSample: return spv::BuiltInBaryCoordNoPerspSampleAMD;
|
||||||
|
case glslang::EbvBaryCoordSmooth: return spv::BuiltInBaryCoordSmoothAMD;
|
||||||
|
case glslang::EbvBaryCoordSmoothCentroid: return spv::BuiltInBaryCoordSmoothCentroidAMD;
|
||||||
|
case glslang::EbvBaryCoordSmoothSample: return spv::BuiltInBaryCoordSmoothSampleAMD;
|
||||||
|
case glslang::EbvBaryCoordPullModel: return spv::BuiltInBaryCoordPullModelAMD;
|
||||||
|
#endif
|
||||||
default: return spv::BuiltInMax;
|
default: return spv::BuiltInMax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -628,6 +646,10 @@ void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& pa
|
|||||||
child.invariant = true;
|
child.invariant = true;
|
||||||
if (parent.nopersp)
|
if (parent.nopersp)
|
||||||
child.nopersp = true;
|
child.nopersp = true;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (parent.explicitInterp)
|
||||||
|
child.explicitInterp = true;
|
||||||
|
#endif
|
||||||
if (parent.flat)
|
if (parent.flat)
|
||||||
child.flat = true;
|
child.flat = true;
|
||||||
if (parent.centroid)
|
if (parent.centroid)
|
||||||
@ -1484,6 +1506,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|||||||
break;
|
break;
|
||||||
case glslang::EOpInterpolateAtSample:
|
case glslang::EOpInterpolateAtSample:
|
||||||
case glslang::EOpInterpolateAtOffset:
|
case glslang::EOpInterpolateAtOffset:
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpInterpolateAtVertex:
|
||||||
|
#endif
|
||||||
if (arg == 0)
|
if (arg == 0)
|
||||||
lvalue = true;
|
lvalue = true;
|
||||||
break;
|
break;
|
||||||
@ -1524,7 +1549,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|||||||
// Pass through to generic operations.
|
// Pass through to generic operations.
|
||||||
switch (glslangOperands.size()) {
|
switch (glslangOperands.size()) {
|
||||||
case 0:
|
case 0:
|
||||||
result = createNoArgOperation(node->getOp());
|
result = createNoArgOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
result = createUnaryOperation(
|
result = createUnaryOperation(
|
||||||
@ -3169,6 +3194,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec
|
|||||||
spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy)
|
spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy)
|
||||||
{
|
{
|
||||||
spv::Op unaryOp = spv::OpNop;
|
spv::Op unaryOp = spv::OpNop;
|
||||||
|
int extBuiltins = -1;
|
||||||
int libCall = -1;
|
int libCall = -1;
|
||||||
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
@ -3448,7 +3474,32 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
|||||||
case glslang::EOpAnyInvocation:
|
case glslang::EOpAnyInvocation:
|
||||||
case glslang::EOpAllInvocations:
|
case glslang::EOpAllInvocations:
|
||||||
case glslang::EOpAllInvocationsEqual:
|
case glslang::EOpAllInvocationsEqual:
|
||||||
return createInvocationsOperation(op, typeId, operand);
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpMinInvocations:
|
||||||
|
case glslang::EOpMaxInvocations:
|
||||||
|
case glslang::EOpAddInvocations:
|
||||||
|
case glslang::EOpMinInvocationsNonUniform:
|
||||||
|
case glslang::EOpMaxInvocationsNonUniform:
|
||||||
|
case glslang::EOpAddInvocationsNonUniform:
|
||||||
|
#endif
|
||||||
|
return createInvocationsOperation(op, typeId, operand, typeProxy);
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpMbcnt:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot);
|
||||||
|
libCall = spv::MbcntAMD;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case glslang::EOpCubeFaceIndex:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_gcn_shader);
|
||||||
|
libCall = spv::CubeFaceIndexAMD;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case glslang::EOpCubeFaceCoord:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_gcn_shader);
|
||||||
|
libCall = spv::CubeFaceCoordAMD;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
@ -3458,7 +3509,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
|
|||||||
if (libCall >= 0) {
|
if (libCall >= 0) {
|
||||||
std::vector<spv::Id> args;
|
std::vector<spv::Id> args;
|
||||||
args.push_back(operand);
|
args.push_back(operand);
|
||||||
id = builder.createBuiltinCall(typeId, stdBuiltins, libCall, args);
|
id = builder.createBuiltinCall(typeId, extBuiltins >= 0 ? extBuiltins : stdBuiltins, libCall, args);
|
||||||
} else {
|
} else {
|
||||||
id = builder.createUnaryOp(unaryOp, typeId, operand);
|
id = builder.createUnaryOp(unaryOp, typeId, operand);
|
||||||
}
|
}
|
||||||
@ -3765,12 +3816,20 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create group invocation operations.
|
// Create group invocation operations.
|
||||||
spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, spv::Id operand)
|
spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy)
|
||||||
{
|
{
|
||||||
|
bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
|
||||||
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
|
|
||||||
builder.addCapability(spv::CapabilityGroups);
|
builder.addCapability(spv::CapabilityGroups);
|
||||||
|
|
||||||
std::vector<spv::Id> operands;
|
std::vector<spv::Id> operands;
|
||||||
operands.push_back(builder.makeUintConstant(spv::ScopeSubgroup));
|
operands.push_back(builder.makeUintConstant(spv::ScopeSubgroup));
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (op == glslang::EOpMinInvocations || op == glslang::EOpMaxInvocations || op == glslang::EOpAddInvocations ||
|
||||||
|
op == glslang::EOpMinInvocationsNonUniform || op == glslang::EOpMaxInvocationsNonUniform || op == glslang::EOpAddInvocationsNonUniform)
|
||||||
|
operands.push_back(spv::GroupOperationReduce);
|
||||||
|
#endif
|
||||||
operands.push_back(operand);
|
operands.push_back(operand);
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
@ -3786,6 +3845,74 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op
|
|||||||
return builder.createBinOp(spv::OpLogicalOr, typeId, groupAll,
|
return builder.createBinOp(spv::OpLogicalOr, typeId, groupAll,
|
||||||
builder.createUnaryOp(spv::OpLogicalNot, typeId, groupAny));
|
builder.createUnaryOp(spv::OpLogicalNot, typeId, groupAny));
|
||||||
}
|
}
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpMinInvocations:
|
||||||
|
case glslang::EOpMaxInvocations:
|
||||||
|
case glslang::EOpAddInvocations:
|
||||||
|
{
|
||||||
|
spv::Op spvOp = spv::OpNop;
|
||||||
|
if (op == glslang::EOpMinInvocations) {
|
||||||
|
if (isFloat)
|
||||||
|
spvOp = spv::OpGroupFMin;
|
||||||
|
else {
|
||||||
|
if (isUnsigned)
|
||||||
|
spvOp = spv::OpGroupUMin;
|
||||||
|
else
|
||||||
|
spvOp = spv::OpGroupSMin;
|
||||||
|
}
|
||||||
|
} else if (op == glslang::EOpMaxInvocations) {
|
||||||
|
if (isFloat)
|
||||||
|
spvOp = spv::OpGroupFMax;
|
||||||
|
else {
|
||||||
|
if (isUnsigned)
|
||||||
|
spvOp = spv::OpGroupUMax;
|
||||||
|
else
|
||||||
|
spvOp = spv::OpGroupSMax;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isFloat)
|
||||||
|
spvOp = spv::OpGroupFAdd;
|
||||||
|
else
|
||||||
|
spvOp = spv::OpGroupIAdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.createOp(spvOp, typeId, operands);
|
||||||
|
}
|
||||||
|
case glslang::EOpMinInvocationsNonUniform:
|
||||||
|
case glslang::EOpMaxInvocationsNonUniform:
|
||||||
|
case glslang::EOpAddInvocationsNonUniform:
|
||||||
|
{
|
||||||
|
spv::Op spvOp = spv::OpNop;
|
||||||
|
if (op == glslang::EOpMinInvocationsNonUniform) {
|
||||||
|
if (isFloat)
|
||||||
|
spvOp = spv::OpGroupFMinNonUniformAMD;
|
||||||
|
else {
|
||||||
|
if (isUnsigned)
|
||||||
|
spvOp = spv::OpGroupUMinNonUniformAMD;
|
||||||
|
else
|
||||||
|
spvOp = spv::OpGroupSMinNonUniformAMD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (op == glslang::EOpMaxInvocationsNonUniform) {
|
||||||
|
if (isFloat)
|
||||||
|
spvOp = spv::OpGroupFMaxNonUniformAMD;
|
||||||
|
else {
|
||||||
|
if (isUnsigned)
|
||||||
|
spvOp = spv::OpGroupUMaxNonUniformAMD;
|
||||||
|
else
|
||||||
|
spvOp = spv::OpGroupSMaxNonUniformAMD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (isFloat)
|
||||||
|
spvOp = spv::OpGroupFAddNonUniformAMD;
|
||||||
|
else
|
||||||
|
spvOp = spv::OpGroupIAddNonUniformAMD;
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.createOp(spvOp, typeId, operands);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
logger->missingFunctionality("invocation operation");
|
logger->missingFunctionality("invocation operation");
|
||||||
return spv::NoResult;
|
return spv::NoResult;
|
||||||
@ -3798,6 +3925,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
|||||||
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
|
||||||
|
|
||||||
spv::Op opCode = spv::OpNop;
|
spv::Op opCode = spv::OpNop;
|
||||||
|
int extBuiltins = -1;
|
||||||
int libCall = -1;
|
int libCall = -1;
|
||||||
size_t consumedOperands = operands.size();
|
size_t consumedOperands = operands.size();
|
||||||
spv::Id typeId0 = 0;
|
spv::Id typeId0 = 0;
|
||||||
@ -3941,6 +4069,60 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
|||||||
libCall = spv::GLSLstd450Bad;
|
libCall = spv::GLSLstd450Bad;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpSwizzleInvocations:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot);
|
||||||
|
libCall = spv::SwizzleInvocationsAMD;
|
||||||
|
break;
|
||||||
|
case glslang::EOpSwizzleInvocationsMasked:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot);
|
||||||
|
libCall = spv::SwizzleInvocationsMaskedAMD;
|
||||||
|
break;
|
||||||
|
case glslang::EOpWriteInvocation:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_ballot);
|
||||||
|
libCall = spv::WriteInvocationAMD;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case glslang::EOpMin3:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_trinary_minmax);
|
||||||
|
if (isFloat)
|
||||||
|
libCall = spv::FMin3AMD;
|
||||||
|
else {
|
||||||
|
if (isUnsigned)
|
||||||
|
libCall = spv::UMin3AMD;
|
||||||
|
else
|
||||||
|
libCall = spv::SMin3AMD;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case glslang::EOpMax3:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_trinary_minmax);
|
||||||
|
if (isFloat)
|
||||||
|
libCall = spv::FMax3AMD;
|
||||||
|
else {
|
||||||
|
if (isUnsigned)
|
||||||
|
libCall = spv::UMax3AMD;
|
||||||
|
else
|
||||||
|
libCall = spv::SMax3AMD;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case glslang::EOpMid3:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_trinary_minmax);
|
||||||
|
if (isFloat)
|
||||||
|
libCall = spv::FMid3AMD;
|
||||||
|
else {
|
||||||
|
if (isUnsigned)
|
||||||
|
libCall = spv::UMid3AMD;
|
||||||
|
else
|
||||||
|
libCall = spv::SMid3AMD;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case glslang::EOpInterpolateAtVertex:
|
||||||
|
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter);
|
||||||
|
libCall = spv::InterpolateAtVertexAMD;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3951,7 +4133,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
|||||||
// Construct the call arguments, without modifying the original operands vector.
|
// Construct the call arguments, without modifying the original operands vector.
|
||||||
// We might need the remaining arguments, e.g. in the EOpFrexp case.
|
// We might need the remaining arguments, e.g. in the EOpFrexp case.
|
||||||
std::vector<spv::Id> callArguments(operands.begin(), operands.begin() + consumedOperands);
|
std::vector<spv::Id> callArguments(operands.begin(), operands.begin() + consumedOperands);
|
||||||
id = builder.createBuiltinCall(typeId, stdBuiltins, libCall, callArguments);
|
id = builder.createBuiltinCall(typeId, extBuiltins >= 0 ? extBuiltins : stdBuiltins, libCall, callArguments);
|
||||||
} else {
|
} else {
|
||||||
switch (consumedOperands) {
|
switch (consumedOperands) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -3997,8 +4179,8 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
|||||||
return builder.setPrecision(id, precision);
|
return builder.setPrecision(id, precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Intrinsics with no arguments, no return value, and no precision.
|
// Intrinsics with no arguments (or no return value, and no precision).
|
||||||
spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op)
|
spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId)
|
||||||
{
|
{
|
||||||
// TODO: get the barrier operands correct
|
// TODO: get the barrier operands correct
|
||||||
|
|
||||||
@ -4045,6 +4227,14 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op)
|
|||||||
// Control barrier with non-"None" semantic is also a memory barrier.
|
// Control barrier with non-"None" semantic is also a memory barrier.
|
||||||
builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask);
|
builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask);
|
||||||
return 0;
|
return 0;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case glslang::EOpTime:
|
||||||
|
{
|
||||||
|
std::vector<spv::Id> args; // Dummy arguments
|
||||||
|
spv::Id id = builder.createBuiltinCall(typeId, getExtBuiltins(spv::E_SPV_AMD_gcn_shader), spv::TimeAMD, args);
|
||||||
|
return builder.setPrecision(id, precision);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
logger->missingFunctionality("unknown operation with no arguments");
|
logger->missingFunctionality("unknown operation with no arguments");
|
||||||
return 0;
|
return 0;
|
||||||
@ -4437,6 +4627,20 @@ spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslan
|
|||||||
return builder.createOp(spv::OpPhi, boolTypeId, phiOperands);
|
return builder.createOp(spv::OpPhi, boolTypeId, phiOperands);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return type Id of the imported set of extended instructions corresponds to the name.
|
||||||
|
// Import this set if it has not been imported yet.
|
||||||
|
spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name)
|
||||||
|
{
|
||||||
|
if (extBuiltinMap.find(name) != extBuiltinMap.end())
|
||||||
|
return extBuiltinMap[name];
|
||||||
|
else {
|
||||||
|
builder.addExtensions(name);
|
||||||
|
spv::Id extBuiltins = builder.import(name);
|
||||||
|
extBuiltinMap[name] = extBuiltins;
|
||||||
|
return extBuiltins;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}; // end anonymous namespace
|
}; // end anonymous namespace
|
||||||
|
|
||||||
namespace glslang {
|
namespace glslang {
|
||||||
|
@ -2312,7 +2312,11 @@ void Builder::dump(std::vector<unsigned int>& out) const
|
|||||||
capInst.dump(out);
|
capInst.dump(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TBD: OpExtension ...
|
for (int e = 0; e < (int)extensions.size(); ++e) {
|
||||||
|
Instruction extInst(0, 0, OpExtension);
|
||||||
|
extInst.addStringOperand(extensions[e]);
|
||||||
|
extInst.dump(out);
|
||||||
|
}
|
||||||
|
|
||||||
dumpInstructions(out, imports);
|
dumpInstructions(out, imports);
|
||||||
Instruction memInst(0, 0, OpMemoryModel);
|
Instruction memInst(0, 0, OpMemoryModel);
|
||||||
@ -2331,10 +2335,10 @@ void Builder::dump(std::vector<unsigned int>& out) const
|
|||||||
sourceInst.addImmediateOperand(sourceVersion);
|
sourceInst.addImmediateOperand(sourceVersion);
|
||||||
sourceInst.dump(out);
|
sourceInst.dump(out);
|
||||||
}
|
}
|
||||||
for (int e = 0; e < (int)extensions.size(); ++e) {
|
for (int e = 0; e < (int)sourceExtensions.size(); ++e) {
|
||||||
Instruction extInst(0, 0, OpSourceExtension);
|
Instruction sourceExtInst(0, 0, OpSourceExtension);
|
||||||
extInst.addStringOperand(extensions[e]);
|
sourceExtInst.addStringOperand(sourceExtensions[e]);
|
||||||
extInst.dump(out);
|
sourceExtInst.dump(out);
|
||||||
}
|
}
|
||||||
dumpInstructions(out, names);
|
dumpInstructions(out, names);
|
||||||
dumpInstructions(out, lines);
|
dumpInstructions(out, lines);
|
||||||
|
@ -70,7 +70,8 @@ public:
|
|||||||
source = lang;
|
source = lang;
|
||||||
sourceVersion = version;
|
sourceVersion = version;
|
||||||
}
|
}
|
||||||
void addSourceExtension(const char* ext) { extensions.push_back(ext); }
|
void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); }
|
||||||
|
void addExtensions(const char* ext) { extensions.push_back(ext); }
|
||||||
Id import(const char*);
|
Id import(const char*);
|
||||||
void setMemoryModel(spv::AddressingModel addr, spv::MemoryModel mem)
|
void setMemoryModel(spv::AddressingModel addr, spv::MemoryModel mem)
|
||||||
{
|
{
|
||||||
@ -552,6 +553,7 @@ public:
|
|||||||
SourceLanguage source;
|
SourceLanguage source;
|
||||||
int sourceVersion;
|
int sourceVersion;
|
||||||
std::vector<const char*> extensions;
|
std::vector<const char*> extensions;
|
||||||
|
std::vector<const char*> sourceExtensions;
|
||||||
AddressingModel addressModel;
|
AddressingModel addressModel;
|
||||||
MemoryModel memoryModel;
|
MemoryModel memoryModel;
|
||||||
std::set<spv::Capability> capabilities;
|
std::set<spv::Capability> capabilities;
|
||||||
|
@ -44,16 +44,25 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace spv {
|
|
||||||
// Include C-based headers that don't have a namespace
|
|
||||||
#include "GLSL.std.450.h"
|
|
||||||
}
|
|
||||||
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
|
|
||||||
|
|
||||||
#include "disassemble.h"
|
#include "disassemble.h"
|
||||||
#include "doc.h"
|
#include "doc.h"
|
||||||
|
|
||||||
namespace spv {
|
namespace spv {
|
||||||
|
extern "C" {
|
||||||
|
// Include C-based headers that don't have a namespace
|
||||||
|
#include "GLSL.std.450.h"
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
#include "GLSL.ext.AMD.h"
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
|
||||||
|
|
||||||
|
namespace spv {
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
static const char* GLSLextAMDGetDebugNames(const char*, unsigned);
|
||||||
|
#endif
|
||||||
|
|
||||||
static void Kill(std::ostream& out, const char* message)
|
static void Kill(std::ostream& out, const char* message)
|
||||||
{
|
{
|
||||||
@ -64,6 +73,9 @@ 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,
|
||||||
|
#endif
|
||||||
OpenCLExtInst,
|
OpenCLExtInst,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -446,14 +458,26 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
|||||||
--numOperands;
|
--numOperands;
|
||||||
if (opCode == OpExtInst) {
|
if (opCode == OpExtInst) {
|
||||||
ExtInstSet extInstSet = GLSL450Inst;
|
ExtInstSet extInstSet = GLSL450Inst;
|
||||||
if (0 == memcmp("OpenCL", (const char*)(idDescriptor[stream[word-2]].c_str()), 6)) {
|
const char* name = idDescriptor[stream[word - 2]].c_str();
|
||||||
|
if (0 == memcmp("OpenCL", name, 6)) {
|
||||||
extInstSet = OpenCLExtInst;
|
extInstSet = OpenCLExtInst;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
} 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_explicit_vertex_parameter, name) == 0 ||
|
||||||
|
strcmp(spv::E_SPV_AMD_gcn_shader, name) == 0) {
|
||||||
|
extInstSet = GLSLextAMDInst;
|
||||||
|
#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) {
|
||||||
|
out << "(" << GLSLextAMDGetDebugNames(name, entrypoint) << ")";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -561,6 +585,50 @@ static void GLSLstd450GetDebugNames(const char** names)
|
|||||||
names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset";
|
names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint)
|
||||||
|
{
|
||||||
|
if (strcmp(name, spv::E_SPV_AMD_shader_ballot) == 0) {
|
||||||
|
switch (entrypoint) {
|
||||||
|
case SwizzleInvocationsAMD: return "SwizzleInvocationsAMD";
|
||||||
|
case SwizzleInvocationsMaskedAMD: return "SwizzleInvocationsMaskedAMD";
|
||||||
|
case WriteInvocationAMD: return "WriteInvocationAMD";
|
||||||
|
case MbcntAMD: return "MbcntAMD";
|
||||||
|
default: return "Bad";
|
||||||
|
}
|
||||||
|
} else if (strcmp(name, spv::E_SPV_AMD_shader_trinary_minmax) == 0) {
|
||||||
|
switch (entrypoint) {
|
||||||
|
case FMin3AMD: return "FMin3AMD";
|
||||||
|
case UMin3AMD: return "UMin3AMD";
|
||||||
|
case SMin3AMD: return "SMin3AMD";
|
||||||
|
case FMax3AMD: return "FMax3AMD";
|
||||||
|
case UMax3AMD: return "UMax3AMD";
|
||||||
|
case SMax3AMD: return "SMax3AMD";
|
||||||
|
case FMid3AMD: return "FMid3AMD";
|
||||||
|
case UMid3AMD: return "UMid3AMD";
|
||||||
|
case SMid3AMD: return "SMid3AMD";
|
||||||
|
default: return "Bad";
|
||||||
|
}
|
||||||
|
} else if (strcmp(name, spv::E_SPV_AMD_shader_explicit_vertex_parameter) == 0) {
|
||||||
|
switch (entrypoint) {
|
||||||
|
case InterpolateAtVertexAMD: return "InterpolateAtVertexAMD";
|
||||||
|
default: return "Bad";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strcmp(name, spv::E_SPV_AMD_gcn_shader) == 0) {
|
||||||
|
switch (entrypoint) {
|
||||||
|
case CubeFaceIndexAMD: return "CubeFaceIndexAMD";
|
||||||
|
case CubeFaceCoordAMD: return "CubeFaceCoordAMD";
|
||||||
|
case TimeAMD: return "TimeAMD";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
SpirvStream SpirvStream(out, stream);
|
SpirvStream SpirvStream(out, stream);
|
||||||
|
@ -45,6 +45,15 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
namespace spv {
|
||||||
|
extern "C" {
|
||||||
|
// Include C-based headers that don't have a namespace
|
||||||
|
#include "GLSL.ext.AMD.h"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace spv {
|
namespace spv {
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -243,6 +252,10 @@ const char* DecorationString(int decoration)
|
|||||||
|
|
||||||
case DecorationCeiling:
|
case DecorationCeiling:
|
||||||
default: return "Bad";
|
default: return "Bad";
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case 4999: return "ExplicitInterpAMD";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,6 +311,16 @@ const char* BuiltInString(int builtIn)
|
|||||||
|
|
||||||
case BuiltInCeiling:
|
case BuiltInCeiling:
|
||||||
default: return "Bad";
|
default: return "Bad";
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case 4992: return "BaryCoordNoPerspAMD";
|
||||||
|
case 4993: return "BaryCoordNoPerspCentroidAMD";
|
||||||
|
case 4994: return "BaryCoordNoPerspSampleAMD";
|
||||||
|
case 4995: return "BaryCoordSmoothAMD";
|
||||||
|
case 4996: return "BaryCoordSmoothCentroidAMD";
|
||||||
|
case 4997: return "BaryCoordSmoothSampleAMD";
|
||||||
|
case 4998: return "BaryCoordPullModelAMD";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1107,12 +1130,27 @@ const char* OpcodeString(int op)
|
|||||||
case OpcodeCeiling:
|
case OpcodeCeiling:
|
||||||
default:
|
default:
|
||||||
return "Bad";
|
return "Bad";
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case 5000: return "OpGroupIAddNonUniformAMD";
|
||||||
|
case 5001: return "OpGroupFAddNonUniformAMD";
|
||||||
|
case 5002: return "OpGroupFMinNonUniformAMD";
|
||||||
|
case 5003: return "OpGroupUMinNonUniformAMD";
|
||||||
|
case 5004: return "OpGroupSMinNonUniformAMD";
|
||||||
|
case 5005: return "OpGroupFMaxNonUniformAMD";
|
||||||
|
case 5006: return "OpGroupUMaxNonUniformAMD";
|
||||||
|
case 5007: return "OpGroupSMaxNonUniformAMD";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The set of objects that hold all the instruction/operand
|
// The set of objects that hold all the instruction/operand
|
||||||
// parameterization information.
|
// parameterization information.
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
InstructionParameters InstructionDesc[OpCodeMask + 1];
|
||||||
|
#else
|
||||||
InstructionParameters InstructionDesc[OpcodeCeiling];
|
InstructionParameters InstructionDesc[OpcodeCeiling];
|
||||||
|
#endif
|
||||||
OperandParameters ExecutionModeOperands[ExecutionModeCeiling];
|
OperandParameters ExecutionModeOperands[ExecutionModeCeiling];
|
||||||
OperandParameters DecorationOperands[DecorationCeiling];
|
OperandParameters DecorationOperands[DecorationCeiling];
|
||||||
|
|
||||||
@ -2703,6 +2741,48 @@ void Parameterize()
|
|||||||
InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Num Events'");
|
InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Num Events'");
|
||||||
InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Wait Events'");
|
InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Wait Events'");
|
||||||
InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Ret Event'");
|
InstructionDesc[OpEnqueueMarker].operands.push(OperandId, "'Ret Event'");
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
InstructionDesc[OpGroupIAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
|
||||||
|
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
|
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
|
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'");
|
||||||
|
|
||||||
|
InstructionDesc[OpGroupFAddNonUniformAMD].capabilities.push_back(CapabilityGroups);
|
||||||
|
InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
|
InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
|
InstructionDesc[OpGroupFAddNonUniformAMD].operands.push(OperandId, "'X'");
|
||||||
|
|
||||||
|
InstructionDesc[OpGroupUMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
|
||||||
|
InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
|
InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
|
InstructionDesc[OpGroupUMinNonUniformAMD].operands.push(OperandId, "'X'");
|
||||||
|
|
||||||
|
InstructionDesc[OpGroupSMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
|
||||||
|
InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
|
InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
|
InstructionDesc[OpGroupSMinNonUniformAMD].operands.push(OperandId, "X");
|
||||||
|
|
||||||
|
InstructionDesc[OpGroupFMinNonUniformAMD].capabilities.push_back(CapabilityGroups);
|
||||||
|
InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
|
InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
|
InstructionDesc[OpGroupFMinNonUniformAMD].operands.push(OperandId, "X");
|
||||||
|
|
||||||
|
InstructionDesc[OpGroupUMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
|
||||||
|
InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
|
InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
|
InstructionDesc[OpGroupUMaxNonUniformAMD].operands.push(OperandId, "X");
|
||||||
|
|
||||||
|
InstructionDesc[OpGroupSMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
|
||||||
|
InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
|
InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
|
InstructionDesc[OpGroupSMaxNonUniformAMD].operands.push(OperandId, "X");
|
||||||
|
|
||||||
|
InstructionDesc[OpGroupFMaxNonUniformAMD].capabilities.push_back(CapabilityGroups);
|
||||||
|
InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||||
|
InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||||
|
InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandId, "X");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end spv namespace
|
}; // end spv namespace
|
||||||
|
@ -186,6 +186,15 @@ enum TBuiltInVariable {
|
|||||||
EbvSamplePosition,
|
EbvSamplePosition,
|
||||||
EbvSampleMask,
|
EbvSampleMask,
|
||||||
EbvHelperInvocation,
|
EbvHelperInvocation,
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EbvBaryCoordNoPersp,
|
||||||
|
EbvBaryCoordNoPerspCentroid,
|
||||||
|
EbvBaryCoordNoPerspSample,
|
||||||
|
EbvBaryCoordSmooth,
|
||||||
|
EbvBaryCoordSmoothCentroid,
|
||||||
|
EbvBaryCoordSmoothSample,
|
||||||
|
EbvBaryCoordPullModel,
|
||||||
|
#endif
|
||||||
|
|
||||||
EbvLast
|
EbvLast
|
||||||
};
|
};
|
||||||
@ -286,6 +295,15 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
|||||||
case EbvSamplePosition: return "SamplePosition";
|
case EbvSamplePosition: return "SamplePosition";
|
||||||
case EbvSampleMask: return "SampleMaskIn";
|
case EbvSampleMask: return "SampleMaskIn";
|
||||||
case EbvHelperInvocation: return "HelperInvocation";
|
case EbvHelperInvocation: return "HelperInvocation";
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EbvBaryCoordNoPersp: return "BaryCoordNoPersp";
|
||||||
|
case EbvBaryCoordNoPerspCentroid: return "BaryCoordNoPerspCentroid";
|
||||||
|
case EbvBaryCoordNoPerspSample: return "BaryCoordNoPerspSample";
|
||||||
|
case EbvBaryCoordSmooth: return "BaryCoordSmooth";
|
||||||
|
case EbvBaryCoordSmoothCentroid: return "BaryCoordSmoothCentroid";
|
||||||
|
case EbvBaryCoordSmoothSample: return "BaryCoordSmoothSample";
|
||||||
|
case EbvBaryCoordPullModel: return "BaryCoordPullModel";
|
||||||
|
#endif
|
||||||
default: return "unknown built-in variable";
|
default: return "unknown built-in variable";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,6 +405,9 @@ public:
|
|||||||
smooth = false;
|
smooth = false;
|
||||||
flat = false;
|
flat = false;
|
||||||
nopersp = false;
|
nopersp = false;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
explicitInterp = false;
|
||||||
|
#endif
|
||||||
patch = false;
|
patch = false;
|
||||||
sample = false;
|
sample = false;
|
||||||
coherent = false;
|
coherent = false;
|
||||||
@ -438,6 +441,9 @@ public:
|
|||||||
bool smooth : 1;
|
bool smooth : 1;
|
||||||
bool flat : 1;
|
bool flat : 1;
|
||||||
bool nopersp : 1;
|
bool nopersp : 1;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
bool explicitInterp : 1;
|
||||||
|
#endif
|
||||||
bool patch : 1;
|
bool patch : 1;
|
||||||
bool sample : 1;
|
bool sample : 1;
|
||||||
bool coherent : 1;
|
bool coherent : 1;
|
||||||
@ -453,7 +459,11 @@ public:
|
|||||||
}
|
}
|
||||||
bool isInterpolation() const
|
bool isInterpolation() const
|
||||||
{
|
{
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
return flat || smooth || nopersp || explicitInterp;
|
||||||
|
#else
|
||||||
return flat || smooth || nopersp;
|
return flat || smooth || nopersp;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
bool isAuxiliary() const
|
bool isAuxiliary() const
|
||||||
{
|
{
|
||||||
@ -1518,6 +1528,10 @@ public:
|
|||||||
p += snprintf(p, end - p, "flat ");
|
p += snprintf(p, end - p, "flat ");
|
||||||
if (qualifier.nopersp)
|
if (qualifier.nopersp)
|
||||||
p += snprintf(p, end - p, "noperspective ");
|
p += snprintf(p, end - p, "noperspective ");
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (qualifier.explicitInterp)
|
||||||
|
p += snprintf(p, end - p, "__explicitInterpAMD ");
|
||||||
|
#endif
|
||||||
if (qualifier.patch)
|
if (qualifier.patch)
|
||||||
p += snprintf(p, end - p, "patch ");
|
p += snprintf(p, end - p, "patch ");
|
||||||
if (qualifier.sample)
|
if (qualifier.sample)
|
||||||
|
@ -246,6 +246,12 @@ enum TOperator {
|
|||||||
EOpReflect,
|
EOpReflect,
|
||||||
EOpRefract,
|
EOpRefract,
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EOpMin3,
|
||||||
|
EOpMax3,
|
||||||
|
EOpMid3,
|
||||||
|
#endif
|
||||||
|
|
||||||
EOpDPdx, // Fragment only
|
EOpDPdx, // Fragment only
|
||||||
EOpDPdy, // Fragment only
|
EOpDPdy, // Fragment only
|
||||||
EOpFwidth, // Fragment only
|
EOpFwidth, // Fragment only
|
||||||
@ -260,6 +266,10 @@ enum TOperator {
|
|||||||
EOpInterpolateAtSample, // Fragment only
|
EOpInterpolateAtSample, // Fragment only
|
||||||
EOpInterpolateAtOffset, // Fragment only
|
EOpInterpolateAtOffset, // Fragment only
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EOpInterpolateAtVertex,
|
||||||
|
#endif
|
||||||
|
|
||||||
EOpMatrixTimesMatrix,
|
EOpMatrixTimesMatrix,
|
||||||
EOpOuterProduct,
|
EOpOuterProduct,
|
||||||
EOpDeterminant,
|
EOpDeterminant,
|
||||||
@ -291,6 +301,23 @@ enum TOperator {
|
|||||||
EOpAllInvocations,
|
EOpAllInvocations,
|
||||||
EOpAllInvocationsEqual,
|
EOpAllInvocationsEqual,
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
EOpMinInvocations,
|
||||||
|
EOpMaxInvocations,
|
||||||
|
EOpAddInvocations,
|
||||||
|
EOpMinInvocationsNonUniform,
|
||||||
|
EOpMaxInvocationsNonUniform,
|
||||||
|
EOpAddInvocationsNonUniform,
|
||||||
|
EOpSwizzleInvocations,
|
||||||
|
EOpSwizzleInvocationsMasked,
|
||||||
|
EOpWriteInvocation,
|
||||||
|
EOpMbcnt,
|
||||||
|
|
||||||
|
EOpCubeFaceIndex,
|
||||||
|
EOpCubeFaceCoord,
|
||||||
|
EOpTime,
|
||||||
|
#endif
|
||||||
|
|
||||||
EOpAtomicAdd,
|
EOpAtomicAdd,
|
||||||
EOpAtomicMin,
|
EOpAtomicMin,
|
||||||
EOpAtomicMax,
|
EOpAtomicMax,
|
||||||
|
@ -801,10 +801,85 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||||||
"bvec3 notEqual(u64vec3, u64vec3);"
|
"bvec3 notEqual(u64vec3, u64vec3);"
|
||||||
"bvec4 notEqual(u64vec4, u64vec4);"
|
"bvec4 notEqual(u64vec4, u64vec4);"
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
"int findLSB(int64_t);"
|
||||||
|
"ivec2 findLSB(i64vec2);"
|
||||||
|
"ivec3 findLSB(i64vec3);"
|
||||||
|
"ivec4 findLSB(i64vec4);"
|
||||||
|
|
||||||
|
"int findLSB(uint64_t);"
|
||||||
|
"ivec2 findLSB(u64vec2);"
|
||||||
|
"ivec3 findLSB(u64vec3);"
|
||||||
|
"ivec4 findLSB(u64vec4);"
|
||||||
|
|
||||||
|
"int findMSB(int64_t);"
|
||||||
|
"ivec2 findMSB(i64vec2);"
|
||||||
|
"ivec3 findMSB(i64vec3);"
|
||||||
|
"ivec4 findMSB(i64vec4);"
|
||||||
|
|
||||||
|
"int findMSB(uint64_t);"
|
||||||
|
"ivec2 findMSB(u64vec2);"
|
||||||
|
"ivec3 findMSB(u64vec3);"
|
||||||
|
"ivec4 findMSB(u64vec4);"
|
||||||
|
#endif
|
||||||
"\n"
|
"\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
// GL_AMD_shader_trinary_minmax
|
||||||
|
if (profile != EEsProfile && version >= 430) {
|
||||||
|
commonBuiltins.append(
|
||||||
|
"float min3(float, float, float);"
|
||||||
|
"vec2 min3(vec2, vec2, vec2);"
|
||||||
|
"vec3 min3(vec3, vec3, vec3);"
|
||||||
|
"vec4 min3(vec4, vec4, vec4);"
|
||||||
|
|
||||||
|
"int min3(int, int, int);"
|
||||||
|
"ivec2 min3(ivec2, ivec2, ivec2);"
|
||||||
|
"ivec3 min3(ivec3, ivec3, ivec3);"
|
||||||
|
"ivec4 min3(ivec4, ivec4, ivec4);"
|
||||||
|
|
||||||
|
"uint min3(uint, uint, uint);"
|
||||||
|
"uvec2 min3(uvec2, uvec2, uvec2);"
|
||||||
|
"uvec3 min3(uvec3, uvec3, uvec3);"
|
||||||
|
"uvec4 min3(uvec4, uvec4, uvec4);"
|
||||||
|
|
||||||
|
"float max3(float, float, float);"
|
||||||
|
"vec2 max3(vec2, vec2, vec2);"
|
||||||
|
"vec3 max3(vec3, vec3, vec3);"
|
||||||
|
"vec4 max3(vec4, vec4, vec4);"
|
||||||
|
|
||||||
|
"int max3(int, int, int);"
|
||||||
|
"ivec2 max3(ivec2, ivec2, ivec2);"
|
||||||
|
"ivec3 max3(ivec3, ivec3, ivec3);"
|
||||||
|
"ivec4 max3(ivec4, ivec4, ivec4);"
|
||||||
|
|
||||||
|
"uint max3(uint, uint, uint);"
|
||||||
|
"uvec2 max3(uvec2, uvec2, uvec2);"
|
||||||
|
"uvec3 max3(uvec3, uvec3, uvec3);"
|
||||||
|
"uvec4 max3(uvec4, uvec4, uvec4);"
|
||||||
|
|
||||||
|
"float mid3(float, float, float);"
|
||||||
|
"vec2 mid3(vec2, vec2, vec2);"
|
||||||
|
"vec3 mid3(vec3, vec3, vec3);"
|
||||||
|
"vec4 mid3(vec4, vec4, vec4);"
|
||||||
|
|
||||||
|
"int mid3(int, int, int);"
|
||||||
|
"ivec2 mid3(ivec2, ivec2, ivec2);"
|
||||||
|
"ivec3 mid3(ivec3, ivec3, ivec3);"
|
||||||
|
"ivec4 mid3(ivec4, ivec4, ivec4);"
|
||||||
|
|
||||||
|
"uint mid3(uint, uint, uint);"
|
||||||
|
"uvec2 mid3(uvec2, uvec2, uvec2);"
|
||||||
|
"uvec3 mid3(uvec3, uvec3, uvec3);"
|
||||||
|
"uvec4 mid3(uvec4, uvec4, uvec4);"
|
||||||
|
|
||||||
|
"\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((profile == EEsProfile && version >= 310) ||
|
if ((profile == EEsProfile && version >= 310) ||
|
||||||
(profile != EEsProfile && version >= 430)) {
|
(profile != EEsProfile && version >= 430)) {
|
||||||
commonBuiltins.append(
|
commonBuiltins.append(
|
||||||
@ -1468,6 +1543,161 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||||||
"\n");
|
"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
// GL_AMD_shader_ballot
|
||||||
|
if (profile != EEsProfile && version >= 450) {
|
||||||
|
commonBuiltins.append(
|
||||||
|
"float minInvocationsAMD(float);"
|
||||||
|
"vec2 minInvocationsAMD(vec2);"
|
||||||
|
"vec3 minInvocationsAMD(vec3);"
|
||||||
|
"vec4 minInvocationsAMD(vec4);"
|
||||||
|
|
||||||
|
"int minInvocationsAMD(int);"
|
||||||
|
"ivec2 minInvocationsAMD(ivec2);"
|
||||||
|
"ivec3 minInvocationsAMD(ivec3);"
|
||||||
|
"ivec4 minInvocationsAMD(ivec4);"
|
||||||
|
|
||||||
|
"uint minInvocationsAMD(uint);"
|
||||||
|
"uvec2 minInvocationsAMD(uvec2);"
|
||||||
|
"uvec3 minInvocationsAMD(uvec3);"
|
||||||
|
"uvec4 minInvocationsAMD(uvec4);"
|
||||||
|
|
||||||
|
"float maxInvocationsAMD(float);"
|
||||||
|
"vec2 maxInvocationsAMD(vec2);"
|
||||||
|
"vec3 maxInvocationsAMD(vec3);"
|
||||||
|
"vec4 maxInvocationsAMD(vec4);"
|
||||||
|
|
||||||
|
"int maxInvocationsAMD(int);"
|
||||||
|
"ivec2 maxInvocationsAMD(ivec2);"
|
||||||
|
"ivec3 maxInvocationsAMD(ivec3);"
|
||||||
|
"ivec4 maxInvocationsAMD(ivec4);"
|
||||||
|
|
||||||
|
"uint maxInvocationsAMD(uint);"
|
||||||
|
"uvec2 maxInvocationsAMD(uvec2);"
|
||||||
|
"uvec3 maxInvocationsAMD(uvec3);"
|
||||||
|
"uvec4 maxInvocationsAMD(uvec4);"
|
||||||
|
|
||||||
|
"float addInvocationsAMD(float);"
|
||||||
|
"vec2 addInvocationsAMD(vec2);"
|
||||||
|
"vec3 addInvocationsAMD(vec3);"
|
||||||
|
"vec4 addInvocationsAMD(vec4);"
|
||||||
|
|
||||||
|
"int addInvocationsAMD(int);"
|
||||||
|
"ivec2 addInvocationsAMD(ivec2);"
|
||||||
|
"ivec3 addInvocationsAMD(ivec3);"
|
||||||
|
"ivec4 addInvocationsAMD(ivec4);"
|
||||||
|
|
||||||
|
"uint addInvocationsAMD(uint);"
|
||||||
|
"uvec2 addInvocationsAMD(uvec2);"
|
||||||
|
"uvec3 addInvocationsAMD(uvec3);"
|
||||||
|
"uvec4 addInvocationsAMD(uvec4);"
|
||||||
|
|
||||||
|
"float minInvocationsNonUniformAMD(float);"
|
||||||
|
"vec2 minInvocationsNonUniformAMD(vec2);"
|
||||||
|
"vec3 minInvocationsNonUniformAMD(vec3);"
|
||||||
|
"vec4 minInvocationsNonUniformAMD(vec4);"
|
||||||
|
|
||||||
|
"int minInvocationsNonUniformAMD(int);"
|
||||||
|
"ivec2 minInvocationsNonUniformAMD(ivec2);"
|
||||||
|
"ivec3 minInvocationsNonUniformAMD(ivec3);"
|
||||||
|
"ivec4 minInvocationsNonUniformAMD(ivec4);"
|
||||||
|
|
||||||
|
"uint minInvocationsNonUniformAMD(uint);"
|
||||||
|
"uvec2 minInvocationsNonUniformAMD(uvec2);"
|
||||||
|
"uvec3 minInvocationsNonUniformAMD(uvec3);"
|
||||||
|
"uvec4 minInvocationsNonUniformAMD(uvec4);"
|
||||||
|
|
||||||
|
"float maxInvocationsNonUniformAMD(float);"
|
||||||
|
"vec2 maxInvocationsNonUniformAMD(vec2);"
|
||||||
|
"vec3 maxInvocationsNonUniformAMD(vec3);"
|
||||||
|
"vec4 maxInvocationsNonUniformAMD(vec4);"
|
||||||
|
|
||||||
|
"int maxInvocationsNonUniformAMD(int);"
|
||||||
|
"ivec2 maxInvocationsNonUniformAMD(ivec2);"
|
||||||
|
"ivec3 maxInvocationsNonUniformAMD(ivec3);"
|
||||||
|
"ivec4 maxInvocationsNonUniformAMD(ivec4);"
|
||||||
|
|
||||||
|
"uint maxInvocationsNonUniformAMD(uint);"
|
||||||
|
"uvec2 maxInvocationsNonUniformAMD(uvec2);"
|
||||||
|
"uvec3 maxInvocationsNonUniformAMD(uvec3);"
|
||||||
|
"uvec4 maxInvocationsNonUniformAMD(uvec4);"
|
||||||
|
|
||||||
|
"float addInvocationsNonUniformAMD(float);"
|
||||||
|
"vec2 addInvocationsNonUniformAMD(vec2);"
|
||||||
|
"vec3 addInvocationsNonUniformAMD(vec3);"
|
||||||
|
"vec4 addInvocationsNonUniformAMD(vec4);"
|
||||||
|
|
||||||
|
"int addInvocationsNonUniformAMD(int);"
|
||||||
|
"ivec2 addInvocationsNonUniformAMD(ivec2);"
|
||||||
|
"ivec3 addInvocationsNonUniformAMD(ivec3);"
|
||||||
|
"ivec4 addInvocationsNonUniformAMD(ivec4);"
|
||||||
|
|
||||||
|
"uint addInvocationsNonUniformAMD(uint);"
|
||||||
|
"uvec2 addInvocationsNonUniformAMD(uvec2);"
|
||||||
|
"uvec3 addInvocationsNonUniformAMD(uvec3);"
|
||||||
|
"uvec4 addInvocationsNonUniformAMD(uvec4);"
|
||||||
|
|
||||||
|
"float swizzleInvocationsAMD(float, uvec4);"
|
||||||
|
"vec2 swizzleInvocationsAMD(vec2, uvec4);"
|
||||||
|
"vec3 swizzleInvocationsAMD(vec3, uvec4);"
|
||||||
|
"vec4 swizzleInvocationsAMD(vec4, uvec4);"
|
||||||
|
|
||||||
|
"int swizzleInvocationsAMD(int, uvec4);"
|
||||||
|
"ivec2 swizzleInvocationsAMD(ivec2, uvec4);"
|
||||||
|
"ivec3 swizzleInvocationsAMD(ivec3, uvec4);"
|
||||||
|
"ivec4 swizzleInvocationsAMD(ivec4, uvec4);"
|
||||||
|
|
||||||
|
"uint swizzleInvocationsAMD(uint, uvec4);"
|
||||||
|
"uvec2 swizzleInvocationsAMD(uvec2, uvec4);"
|
||||||
|
"uvec3 swizzleInvocationsAMD(uvec3, uvec4);"
|
||||||
|
"uvec4 swizzleInvocationsAMD(uvec4, uvec4);"
|
||||||
|
|
||||||
|
"float swizzleInvocationsMaskedAMD(float, uvec3);"
|
||||||
|
"vec2 swizzleInvocationsMaskedAMD(vec2, uvec3);"
|
||||||
|
"vec3 swizzleInvocationsMaskedAMD(vec3, uvec3);"
|
||||||
|
"vec4 swizzleInvocationsMaskedAMD(vec4, uvec3);"
|
||||||
|
|
||||||
|
"int swizzleInvocationsMaskedAMD(int, uvec3);"
|
||||||
|
"ivec2 swizzleInvocationsMaskedAMD(ivec2, uvec3);"
|
||||||
|
"ivec3 swizzleInvocationsMaskedAMD(ivec3, uvec3);"
|
||||||
|
"ivec4 swizzleInvocationsMaskedAMD(ivec4, uvec3);"
|
||||||
|
|
||||||
|
"uint swizzleInvocationsMaskedAMD(uint, uvec3);"
|
||||||
|
"uvec2 swizzleInvocationsMaskedAMD(uvec2, uvec3);"
|
||||||
|
"uvec3 swizzleInvocationsMaskedAMD(uvec3, uvec3);"
|
||||||
|
"uvec4 swizzleInvocationsMaskedAMD(uvec4, uvec3);"
|
||||||
|
|
||||||
|
"float writeInvocationAMD(float, float, uint);"
|
||||||
|
"vec2 writeInvocationAMD(vec2, vec2, uint);"
|
||||||
|
"vec3 writeInvocationAMD(vec3, vec3, uint);"
|
||||||
|
"vec4 writeInvocationAMD(vec4, vec4, uint);"
|
||||||
|
|
||||||
|
"int writeInvocationAMD(int, int, uint);"
|
||||||
|
"ivec2 writeInvocationAMD(ivec2, ivec2, uint);"
|
||||||
|
"ivec3 writeInvocationAMD(ivec3, ivec3, uint);"
|
||||||
|
"ivec4 writeInvocationAMD(ivec4, ivec4, uint);"
|
||||||
|
|
||||||
|
"uint writeInvocationAMD(uint, uint, uint);"
|
||||||
|
"uvec2 writeInvocationAMD(uvec2, uvec2, uint);"
|
||||||
|
"uvec3 writeInvocationAMD(uvec3, uvec3, uint);"
|
||||||
|
"uvec4 writeInvocationAMD(uvec4, uvec4, uint);"
|
||||||
|
|
||||||
|
"uint mbcntAMD(uint64_t);"
|
||||||
|
|
||||||
|
"\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// GL_AMD_gcn_shader
|
||||||
|
if (profile != EEsProfile && version >= 450) {
|
||||||
|
commonBuiltins.append(
|
||||||
|
"float cubeFaceIndexAMD(vec3);"
|
||||||
|
"vec2 cubeFaceCoordAMD(vec3);"
|
||||||
|
"uint64_t timeAMD();"
|
||||||
|
|
||||||
|
"\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//
|
//
|
||||||
// Prototypes for built-in functions seen by vertex shaders only.
|
// Prototypes for built-in functions seen by vertex shaders only.
|
||||||
@ -1713,6 +1943,29 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||||||
"\n");
|
"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
// GL_AMD_shader_explicit_vertex_parameter
|
||||||
|
if (profile != EEsProfile && version >= 450) {
|
||||||
|
stageBuiltins[EShLangFragment].append(
|
||||||
|
"float interpolateAtVertexAMD(float, uint);"
|
||||||
|
"vec2 interpolateAtVertexAMD(vec2, uint);"
|
||||||
|
"vec3 interpolateAtVertexAMD(vec3, uint);"
|
||||||
|
"vec4 interpolateAtVertexAMD(vec4, uint);"
|
||||||
|
|
||||||
|
"int interpolateAtVertexAMD(int, uint);"
|
||||||
|
"ivec2 interpolateAtVertexAMD(ivec2, uint);"
|
||||||
|
"ivec3 interpolateAtVertexAMD(ivec3, uint);"
|
||||||
|
"ivec4 interpolateAtVertexAMD(ivec4, uint);"
|
||||||
|
|
||||||
|
"uint interpolateAtVertexAMD(uint, uint);"
|
||||||
|
"uvec2 interpolateAtVertexAMD(uvec2, uint);"
|
||||||
|
"uvec3 interpolateAtVertexAMD(uvec3, uint);"
|
||||||
|
"uvec4 interpolateAtVertexAMD(uvec4, uint);"
|
||||||
|
|
||||||
|
"\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//
|
//
|
||||||
// Standard Uniforms
|
// Standard Uniforms
|
||||||
@ -2332,6 +2585,19 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
|||||||
"in float gl_CullDistance[];"
|
"in float gl_CullDistance[];"
|
||||||
"bool gl_HelperInvocation;" // needs qualifier fixed later
|
"bool gl_HelperInvocation;" // needs qualifier fixed later
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (version >= 450)
|
||||||
|
stageBuiltins[EShLangFragment].append(
|
||||||
|
"in vec2 gl_BaryCoordNoPerspAMD;"
|
||||||
|
"in vec2 gl_BaryCoordNoPerspCentroidAMD;"
|
||||||
|
"in vec2 gl_BaryCoordNoPerspSampleAMD;"
|
||||||
|
"in vec2 gl_BaryCoordSmoothAMD;"
|
||||||
|
"in vec2 gl_BaryCoordSmoothCentroidAMD;"
|
||||||
|
"in vec2 gl_BaryCoordSmoothSampleAMD;"
|
||||||
|
"in vec3 gl_BaryCoordPullModelAMD;"
|
||||||
|
);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
// ES profile
|
// ES profile
|
||||||
|
|
||||||
@ -3460,6 +3726,14 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||||||
s.append(builtInConstant);
|
s.append(builtInConstant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
// GL_AMD_gcn_shader
|
||||||
|
if (profile != EEsProfile && version >= 450) {
|
||||||
|
snprintf(builtInConstant, maxSize, "const int gl_SIMDGroupSizeAMD = 64;");
|
||||||
|
s.append(builtInConstant);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
s.append("\n");
|
s.append("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3588,6 +3862,33 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||||||
symbolTable.setFunctionExtensions("allInvocationsEqualARB", 1, &E_GL_ARB_shader_group_vote);
|
symbolTable.setFunctionExtensions("allInvocationsEqualARB", 1, &E_GL_ARB_shader_group_vote);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (profile != EEsProfile) {
|
||||||
|
symbolTable.setFunctionExtensions("minInvocationsAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("maxInvocationsAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("addInvocationsAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("minInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("maxInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("addInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("swizzleInvocationsAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("swizzleInvocationsWithPatternAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("writeInvocationAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
symbolTable.setFunctionExtensions("mbcntAMD", 1, &E_GL_AMD_shader_ballot);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile != EEsProfile) {
|
||||||
|
symbolTable.setFunctionExtensions("min3", 1, &E_GL_AMD_shader_trinary_minmax);
|
||||||
|
symbolTable.setFunctionExtensions("max3", 1, &E_GL_AMD_shader_trinary_minmax);
|
||||||
|
symbolTable.setFunctionExtensions("mid3", 1, &E_GL_AMD_shader_trinary_minmax);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile != EEsProfile) {
|
||||||
|
symbolTable.setFunctionExtensions("cubeFaceIndexAMD", 1, &E_GL_AMD_gcn_shader);
|
||||||
|
symbolTable.setFunctionExtensions("cubeFaceCoordAMD", 1, &E_GL_AMD_gcn_shader);
|
||||||
|
symbolTable.setFunctionExtensions("timeAMD", 1, &E_GL_AMD_gcn_shader);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Compatibility variables, vertex only
|
// Compatibility variables, vertex only
|
||||||
if (spvVersion.spv == 0) {
|
if (spvVersion.spv == 0) {
|
||||||
BuiltInVariable("gl_Color", EbvColor, symbolTable);
|
BuiltInVariable("gl_Color", EbvColor, symbolTable);
|
||||||
@ -3872,6 +4173,29 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||||||
symbolTable.setFunctionExtensions("textureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp);
|
symbolTable.setFunctionExtensions("textureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
// E_GL_AMD_shader_explicit_vertex_parameter
|
||||||
|
if (profile != EEsProfile) {
|
||||||
|
symbolTable.setVariableExtensions("gl_BaryCoordNoPerspAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter);
|
||||||
|
symbolTable.setVariableExtensions("gl_BaryCoordNoPerspCentroidAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter);
|
||||||
|
symbolTable.setVariableExtensions("gl_BaryCoordNoPerspSampleAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter);
|
||||||
|
symbolTable.setVariableExtensions("gl_BaryCoordSmoothAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter);
|
||||||
|
symbolTable.setVariableExtensions("gl_BaryCoordSmoothCentroidAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter);
|
||||||
|
symbolTable.setVariableExtensions("gl_BaryCoordSmoothSampleAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter);
|
||||||
|
symbolTable.setVariableExtensions("gl_BaryCoordPullModelAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter);
|
||||||
|
|
||||||
|
symbolTable.setFunctionExtensions("interpolateAtVertexAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter);
|
||||||
|
|
||||||
|
BuiltInVariable("gl_BaryCoordNoPerspAMD", EbvBaryCoordNoPersp, symbolTable);
|
||||||
|
BuiltInVariable("gl_BaryCoordNoPerspCentroidAMD", EbvBaryCoordNoPerspCentroid, symbolTable);
|
||||||
|
BuiltInVariable("gl_BaryCoordNoPerspSampleAMD", EbvBaryCoordNoPerspSample, symbolTable);
|
||||||
|
BuiltInVariable("gl_BaryCoordSmoothAMD", EbvBaryCoordSmooth, symbolTable);
|
||||||
|
BuiltInVariable("gl_BaryCoordSmoothCentroidAMD", EbvBaryCoordSmoothCentroid, symbolTable);
|
||||||
|
BuiltInVariable("gl_BaryCoordSmoothSampleAMD", EbvBaryCoordSmoothSample, symbolTable);
|
||||||
|
BuiltInVariable("gl_BaryCoordPullModelAMD", EbvBaryCoordPullModel, symbolTable);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth);
|
symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth);
|
||||||
|
|
||||||
if (profile == EEsProfile) {
|
if (profile == EEsProfile) {
|
||||||
@ -4205,6 +4529,27 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||||||
symbolTable.relateToOperator("anyInvocationARB", EOpAnyInvocation);
|
symbolTable.relateToOperator("anyInvocationARB", EOpAnyInvocation);
|
||||||
symbolTable.relateToOperator("allInvocationsARB", EOpAllInvocations);
|
symbolTable.relateToOperator("allInvocationsARB", EOpAllInvocations);
|
||||||
symbolTable.relateToOperator("allInvocationsEqualARB", EOpAllInvocationsEqual);
|
symbolTable.relateToOperator("allInvocationsEqualARB", EOpAllInvocationsEqual);
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
symbolTable.relateToOperator("minInvocationsAMD", EOpMinInvocations);
|
||||||
|
symbolTable.relateToOperator("maxInvocationsAMD", EOpMaxInvocations);
|
||||||
|
symbolTable.relateToOperator("addInvocationsAMD", EOpAddInvocations);
|
||||||
|
symbolTable.relateToOperator("minInvocationsNonUniformAMD", EOpMinInvocationsNonUniform);
|
||||||
|
symbolTable.relateToOperator("maxInvocationsNonUniformAMD", EOpMaxInvocationsNonUniform);
|
||||||
|
symbolTable.relateToOperator("addInvocationsNonUniformAMD", EOpAddInvocationsNonUniform);
|
||||||
|
symbolTable.relateToOperator("swizzleInvocationsAMD", EOpSwizzleInvocations);
|
||||||
|
symbolTable.relateToOperator("swizzleInvocationsMaskedAMD", EOpSwizzleInvocationsMasked);
|
||||||
|
symbolTable.relateToOperator("writeInvocationAMD", EOpWriteInvocation);
|
||||||
|
symbolTable.relateToOperator("mbcntAMD", EOpMbcnt);
|
||||||
|
|
||||||
|
symbolTable.relateToOperator("min3", EOpMin3);
|
||||||
|
symbolTable.relateToOperator("max3", EOpMax3);
|
||||||
|
symbolTable.relateToOperator("mid3", EOpMid3);
|
||||||
|
|
||||||
|
symbolTable.relateToOperator("cubeFaceIndexAMD", EOpCubeFaceIndex);
|
||||||
|
symbolTable.relateToOperator("cubeFaceCoordAMD", EOpCubeFaceCoord);
|
||||||
|
symbolTable.relateToOperator("timeAMD", EOpTime);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4238,7 +4583,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
|||||||
symbolTable.relateToOperator("interpolateAtCentroid", EOpInterpolateAtCentroid);
|
symbolTable.relateToOperator("interpolateAtCentroid", EOpInterpolateAtCentroid);
|
||||||
symbolTable.relateToOperator("interpolateAtSample", EOpInterpolateAtSample);
|
symbolTable.relateToOperator("interpolateAtSample", EOpInterpolateAtSample);
|
||||||
symbolTable.relateToOperator("interpolateAtOffset", EOpInterpolateAtOffset);
|
symbolTable.relateToOperator("interpolateAtOffset", EOpInterpolateAtOffset);
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (profile != EEsProfile)
|
||||||
|
symbolTable.relateToOperator("interpolateAtVertexAMD", EOpInterpolateAtVertex);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case EShLangCompute:
|
case EShLangCompute:
|
||||||
symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared);
|
symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared);
|
||||||
|
@ -2119,6 +2119,10 @@ void TParseContext::rValueErrorCheck(const TSourceLoc& loc, const char* op, TInt
|
|||||||
TIntermSymbol* symNode = node->getAsSymbolNode();
|
TIntermSymbol* symNode = node->getAsSymbolNode();
|
||||||
if (symNode && symNode->getQualifier().writeonly)
|
if (symNode && symNode->getQualifier().writeonly)
|
||||||
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());
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
else if (symNode && symNode->getQualifier().explicitInterp)
|
||||||
|
error(loc, "can't read from explicitly-interpolated object: ", op, symNode->getName().c_str());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -2665,7 +2669,11 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
|
|||||||
publicType.basicType == EbtDouble)
|
publicType.basicType == EbtDouble)
|
||||||
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
|
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
|
||||||
|
|
||||||
if (! qualifier.flat) {
|
#ifdef AMD_EXTENSIONS
|
||||||
|
if (! qualifier.flat && ! qualifier.explicitInterp) {
|
||||||
|
#else
|
||||||
|
if (!qualifier.flat) {
|
||||||
|
#endif
|
||||||
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint ||
|
||||||
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 ||
|
||||||
publicType.basicType == EbtDouble ||
|
publicType.basicType == EbtDouble ||
|
||||||
@ -2802,7 +2810,11 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
|
|||||||
|
|
||||||
// Multiple interpolation qualifiers (mostly done later by 'individual qualifiers')
|
// Multiple interpolation qualifiers (mostly done later by 'individual qualifiers')
|
||||||
if (src.isInterpolation() && dst.isInterpolation())
|
if (src.isInterpolation() && dst.isInterpolation())
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
error(loc, "can only have one interpolation qualifier (flat, smooth, noperspective, __explicitInterpAMD)", "", "");
|
||||||
|
#else
|
||||||
error(loc, "can only have one interpolation qualifier (flat, smooth, noperspective)", "", "");
|
error(loc, "can only have one interpolation qualifier (flat, smooth, noperspective)", "", "");
|
||||||
|
#endif
|
||||||
|
|
||||||
// Ordering
|
// Ordering
|
||||||
if (! force && ((profile != EEsProfile && version < 420) ||
|
if (! force && ((profile != EEsProfile && version < 420) ||
|
||||||
@ -2858,6 +2870,9 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
|
|||||||
MERGE_SINGLETON(smooth);
|
MERGE_SINGLETON(smooth);
|
||||||
MERGE_SINGLETON(flat);
|
MERGE_SINGLETON(flat);
|
||||||
MERGE_SINGLETON(nopersp);
|
MERGE_SINGLETON(nopersp);
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
MERGE_SINGLETON(explicitInterp);
|
||||||
|
#endif
|
||||||
MERGE_SINGLETON(patch);
|
MERGE_SINGLETON(patch);
|
||||||
MERGE_SINGLETON(sample);
|
MERGE_SINGLETON(sample);
|
||||||
MERGE_SINGLETON(coherent);
|
MERGE_SINGLETON(coherent);
|
||||||
|
@ -553,6 +553,9 @@ void TScanContext::fillInKeywordMap()
|
|||||||
(*KeywordMap)["noperspective"] = NOPERSPECTIVE;
|
(*KeywordMap)["noperspective"] = NOPERSPECTIVE;
|
||||||
(*KeywordMap)["smooth"] = SMOOTH;
|
(*KeywordMap)["smooth"] = SMOOTH;
|
||||||
(*KeywordMap)["flat"] = FLAT;
|
(*KeywordMap)["flat"] = FLAT;
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
(*KeywordMap)["__explicitInterpAMD"] = __EXPLICITINTERPAMD;
|
||||||
|
#endif
|
||||||
(*KeywordMap)["centroid"] = CENTROID;
|
(*KeywordMap)["centroid"] = CENTROID;
|
||||||
(*KeywordMap)["precise"] = PRECISE;
|
(*KeywordMap)["precise"] = PRECISE;
|
||||||
(*KeywordMap)["invariant"] = INVARIANT;
|
(*KeywordMap)["invariant"] = INVARIANT;
|
||||||
@ -1117,6 +1120,14 @@ int TScanContext::tokenizeIdentifier()
|
|||||||
return identifierOrType();
|
return identifierOrType();
|
||||||
return keyword;
|
return keyword;
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case __EXPLICITINTERPAMD:
|
||||||
|
if (parseContext.profile != EEsProfile && parseContext.version >= 450 &&
|
||||||
|
parseContext.extensionTurnedOn(E_GL_AMD_shader_explicit_vertex_parameter))
|
||||||
|
return keyword;
|
||||||
|
return identifierOrType();
|
||||||
|
#endif
|
||||||
|
|
||||||
case FLAT:
|
case FLAT:
|
||||||
if (parseContext.profile == EEsProfile && parseContext.version < 300)
|
if (parseContext.profile == EEsProfile && parseContext.version < 300)
|
||||||
reservedWord();
|
reservedWord();
|
||||||
|
@ -187,6 +187,13 @@ 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_trinary_minmax] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_AMD_shader_explicit_vertex_parameter] = EBhDisable;
|
||||||
|
extensionBehavior[E_GL_AMD_gcn_shader] = EBhDisable;
|
||||||
|
#endif
|
||||||
|
|
||||||
// AEP
|
// AEP
|
||||||
extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable;
|
extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable;
|
||||||
extensionBehavior[E_GL_KHR_blend_equation_advanced] = EBhDisable;
|
extensionBehavior[E_GL_KHR_blend_equation_advanced] = EBhDisable;
|
||||||
@ -286,6 +293,13 @@ void TParseVersions::getPreamble(std::string& preamble)
|
|||||||
"#define GL_ARB_sparse_texture_clamp 1\n"
|
"#define GL_ARB_sparse_texture_clamp 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_EXT_shader_non_constant_global_initializers 1\n"
|
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
"#define GL_AMD_shader_ballot 1\n"
|
||||||
|
"#define GL_AMD_shader_trinary_minmax 1\n"
|
||||||
|
"#define GL_AMD_shader_explicit_vertex_parameter 1\n"
|
||||||
|
"#define GL_AMD_gcn_shader 1\n"
|
||||||
|
#endif
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,13 @@ const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_sha
|
|||||||
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_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_gcn_shader = "GL_AMD_gcn_shader";
|
||||||
|
#endif
|
||||||
|
|
||||||
// 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";
|
||||||
const char* const E_GL_KHR_blend_equation_advanced = "GL_KHR_blend_equation_advanced";
|
const char* const E_GL_KHR_blend_equation_advanced = "GL_KHR_blend_equation_advanced";
|
||||||
|
@ -126,7 +126,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
|||||||
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED
|
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED
|
||||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
|
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
|
||||||
%token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
|
%token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
|
||||||
%token <lex> NOPERSPECTIVE FLAT SMOOTH LAYOUT
|
%token <lex> NOPERSPECTIVE FLAT SMOOTH LAYOUT __EXPLICITINTERPAMD
|
||||||
|
|
||||||
%token <lex> MAT2X2 MAT2X3 MAT2X4
|
%token <lex> MAT2X2 MAT2X3 MAT2X4
|
||||||
%token <lex> MAT3X2 MAT3X3 MAT3X4
|
%token <lex> MAT3X2 MAT3X3 MAT3X4
|
||||||
@ -1050,6 +1050,15 @@ interpolation_qualifier
|
|||||||
$$.init($1.loc);
|
$$.init($1.loc);
|
||||||
$$.qualifier.nopersp = true;
|
$$.qualifier.nopersp = true;
|
||||||
}
|
}
|
||||||
|
| __EXPLICITINTERPAMD {
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
parseContext.globalCheck($1.loc, "__explicitInterpAMD");
|
||||||
|
parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
|
||||||
|
parseContext.profileRequires($1.loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
|
||||||
|
$$.init($1.loc);
|
||||||
|
$$.qualifier.explicitInterp = true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
layout_qualifier
|
layout_qualifier
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,19 @@
|
|||||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
/* A Bison parser, made by GNU Bison 2.7. */
|
||||||
|
|
||||||
/* Bison interface for Yacc-like parsers in C
|
/* Bison interface for Yacc-like parsers in C
|
||||||
|
|
||||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
@ -26,13 +26,13 @@
|
|||||||
special exception, which will cause the skeleton and the resulting
|
special exception, which will cause the skeleton and the resulting
|
||||||
Bison output files to be licensed under the GNU General Public
|
Bison output files to be licensed under the GNU General Public
|
||||||
License without this special exception.
|
License without this special exception.
|
||||||
|
|
||||||
This special exception was added by the Free Software Foundation in
|
This special exception was added by the Free Software Foundation in
|
||||||
version 2.2 of Bison. */
|
version 2.2 of Bison. */
|
||||||
|
|
||||||
#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
|
#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
|
||||||
# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
|
# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
|
||||||
/* Debug traces. */
|
/* Enabling traces. */
|
||||||
#ifndef YYDEBUG
|
#ifndef YYDEBUG
|
||||||
# define YYDEBUG 1
|
# define YYDEBUG 1
|
||||||
#endif
|
#endif
|
||||||
@ -40,287 +40,289 @@
|
|||||||
extern int yydebug;
|
extern int yydebug;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Token type. */
|
/* Tokens. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
enum yytokentype
|
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||||
{
|
know about them. */
|
||||||
ATTRIBUTE = 258,
|
enum yytokentype {
|
||||||
VARYING = 259,
|
ATTRIBUTE = 258,
|
||||||
CONST = 260,
|
VARYING = 259,
|
||||||
BOOL = 261,
|
CONST = 260,
|
||||||
FLOAT = 262,
|
BOOL = 261,
|
||||||
DOUBLE = 263,
|
FLOAT = 262,
|
||||||
INT = 264,
|
DOUBLE = 263,
|
||||||
UINT = 265,
|
INT = 264,
|
||||||
INT64_T = 266,
|
UINT = 265,
|
||||||
UINT64_T = 267,
|
INT64_T = 266,
|
||||||
BREAK = 268,
|
UINT64_T = 267,
|
||||||
CONTINUE = 269,
|
BREAK = 268,
|
||||||
DO = 270,
|
CONTINUE = 269,
|
||||||
ELSE = 271,
|
DO = 270,
|
||||||
FOR = 272,
|
ELSE = 271,
|
||||||
IF = 273,
|
FOR = 272,
|
||||||
DISCARD = 274,
|
IF = 273,
|
||||||
RETURN = 275,
|
DISCARD = 274,
|
||||||
SWITCH = 276,
|
RETURN = 275,
|
||||||
CASE = 277,
|
SWITCH = 276,
|
||||||
DEFAULT = 278,
|
CASE = 277,
|
||||||
SUBROUTINE = 279,
|
DEFAULT = 278,
|
||||||
BVEC2 = 280,
|
SUBROUTINE = 279,
|
||||||
BVEC3 = 281,
|
BVEC2 = 280,
|
||||||
BVEC4 = 282,
|
BVEC3 = 281,
|
||||||
IVEC2 = 283,
|
BVEC4 = 282,
|
||||||
IVEC3 = 284,
|
IVEC2 = 283,
|
||||||
IVEC4 = 285,
|
IVEC3 = 284,
|
||||||
I64VEC2 = 286,
|
IVEC4 = 285,
|
||||||
I64VEC3 = 287,
|
I64VEC2 = 286,
|
||||||
I64VEC4 = 288,
|
I64VEC3 = 287,
|
||||||
UVEC2 = 289,
|
I64VEC4 = 288,
|
||||||
UVEC3 = 290,
|
UVEC2 = 289,
|
||||||
UVEC4 = 291,
|
UVEC3 = 290,
|
||||||
U64VEC2 = 292,
|
UVEC4 = 291,
|
||||||
U64VEC3 = 293,
|
U64VEC2 = 292,
|
||||||
U64VEC4 = 294,
|
U64VEC3 = 293,
|
||||||
VEC2 = 295,
|
U64VEC4 = 294,
|
||||||
VEC3 = 296,
|
VEC2 = 295,
|
||||||
VEC4 = 297,
|
VEC3 = 296,
|
||||||
MAT2 = 298,
|
VEC4 = 297,
|
||||||
MAT3 = 299,
|
MAT2 = 298,
|
||||||
MAT4 = 300,
|
MAT3 = 299,
|
||||||
CENTROID = 301,
|
MAT4 = 300,
|
||||||
IN = 302,
|
CENTROID = 301,
|
||||||
OUT = 303,
|
IN = 302,
|
||||||
INOUT = 304,
|
OUT = 303,
|
||||||
UNIFORM = 305,
|
INOUT = 304,
|
||||||
PATCH = 306,
|
UNIFORM = 305,
|
||||||
SAMPLE = 307,
|
PATCH = 306,
|
||||||
BUFFER = 308,
|
SAMPLE = 307,
|
||||||
SHARED = 309,
|
BUFFER = 308,
|
||||||
COHERENT = 310,
|
SHARED = 309,
|
||||||
VOLATILE = 311,
|
COHERENT = 310,
|
||||||
RESTRICT = 312,
|
VOLATILE = 311,
|
||||||
READONLY = 313,
|
RESTRICT = 312,
|
||||||
WRITEONLY = 314,
|
READONLY = 313,
|
||||||
DVEC2 = 315,
|
WRITEONLY = 314,
|
||||||
DVEC3 = 316,
|
DVEC2 = 315,
|
||||||
DVEC4 = 317,
|
DVEC3 = 316,
|
||||||
DMAT2 = 318,
|
DVEC4 = 317,
|
||||||
DMAT3 = 319,
|
DMAT2 = 318,
|
||||||
DMAT4 = 320,
|
DMAT3 = 319,
|
||||||
NOPERSPECTIVE = 321,
|
DMAT4 = 320,
|
||||||
FLAT = 322,
|
NOPERSPECTIVE = 321,
|
||||||
SMOOTH = 323,
|
FLAT = 322,
|
||||||
LAYOUT = 324,
|
SMOOTH = 323,
|
||||||
MAT2X2 = 325,
|
LAYOUT = 324,
|
||||||
MAT2X3 = 326,
|
__EXPLICITINTERPAMD = 325,
|
||||||
MAT2X4 = 327,
|
MAT2X2 = 326,
|
||||||
MAT3X2 = 328,
|
MAT2X3 = 327,
|
||||||
MAT3X3 = 329,
|
MAT2X4 = 328,
|
||||||
MAT3X4 = 330,
|
MAT3X2 = 329,
|
||||||
MAT4X2 = 331,
|
MAT3X3 = 330,
|
||||||
MAT4X3 = 332,
|
MAT3X4 = 331,
|
||||||
MAT4X4 = 333,
|
MAT4X2 = 332,
|
||||||
DMAT2X2 = 334,
|
MAT4X3 = 333,
|
||||||
DMAT2X3 = 335,
|
MAT4X4 = 334,
|
||||||
DMAT2X4 = 336,
|
DMAT2X2 = 335,
|
||||||
DMAT3X2 = 337,
|
DMAT2X3 = 336,
|
||||||
DMAT3X3 = 338,
|
DMAT2X4 = 337,
|
||||||
DMAT3X4 = 339,
|
DMAT3X2 = 338,
|
||||||
DMAT4X2 = 340,
|
DMAT3X3 = 339,
|
||||||
DMAT4X3 = 341,
|
DMAT3X4 = 340,
|
||||||
DMAT4X4 = 342,
|
DMAT4X2 = 341,
|
||||||
ATOMIC_UINT = 343,
|
DMAT4X3 = 342,
|
||||||
SAMPLER1D = 344,
|
DMAT4X4 = 343,
|
||||||
SAMPLER2D = 345,
|
ATOMIC_UINT = 344,
|
||||||
SAMPLER3D = 346,
|
SAMPLER1D = 345,
|
||||||
SAMPLERCUBE = 347,
|
SAMPLER2D = 346,
|
||||||
SAMPLER1DSHADOW = 348,
|
SAMPLER3D = 347,
|
||||||
SAMPLER2DSHADOW = 349,
|
SAMPLERCUBE = 348,
|
||||||
SAMPLERCUBESHADOW = 350,
|
SAMPLER1DSHADOW = 349,
|
||||||
SAMPLER1DARRAY = 351,
|
SAMPLER2DSHADOW = 350,
|
||||||
SAMPLER2DARRAY = 352,
|
SAMPLERCUBESHADOW = 351,
|
||||||
SAMPLER1DARRAYSHADOW = 353,
|
SAMPLER1DARRAY = 352,
|
||||||
SAMPLER2DARRAYSHADOW = 354,
|
SAMPLER2DARRAY = 353,
|
||||||
ISAMPLER1D = 355,
|
SAMPLER1DARRAYSHADOW = 354,
|
||||||
ISAMPLER2D = 356,
|
SAMPLER2DARRAYSHADOW = 355,
|
||||||
ISAMPLER3D = 357,
|
ISAMPLER1D = 356,
|
||||||
ISAMPLERCUBE = 358,
|
ISAMPLER2D = 357,
|
||||||
ISAMPLER1DARRAY = 359,
|
ISAMPLER3D = 358,
|
||||||
ISAMPLER2DARRAY = 360,
|
ISAMPLERCUBE = 359,
|
||||||
USAMPLER1D = 361,
|
ISAMPLER1DARRAY = 360,
|
||||||
USAMPLER2D = 362,
|
ISAMPLER2DARRAY = 361,
|
||||||
USAMPLER3D = 363,
|
USAMPLER1D = 362,
|
||||||
USAMPLERCUBE = 364,
|
USAMPLER2D = 363,
|
||||||
USAMPLER1DARRAY = 365,
|
USAMPLER3D = 364,
|
||||||
USAMPLER2DARRAY = 366,
|
USAMPLERCUBE = 365,
|
||||||
SAMPLER2DRECT = 367,
|
USAMPLER1DARRAY = 366,
|
||||||
SAMPLER2DRECTSHADOW = 368,
|
USAMPLER2DARRAY = 367,
|
||||||
ISAMPLER2DRECT = 369,
|
SAMPLER2DRECT = 368,
|
||||||
USAMPLER2DRECT = 370,
|
SAMPLER2DRECTSHADOW = 369,
|
||||||
SAMPLERBUFFER = 371,
|
ISAMPLER2DRECT = 370,
|
||||||
ISAMPLERBUFFER = 372,
|
USAMPLER2DRECT = 371,
|
||||||
USAMPLERBUFFER = 373,
|
SAMPLERBUFFER = 372,
|
||||||
SAMPLERCUBEARRAY = 374,
|
ISAMPLERBUFFER = 373,
|
||||||
SAMPLERCUBEARRAYSHADOW = 375,
|
USAMPLERBUFFER = 374,
|
||||||
ISAMPLERCUBEARRAY = 376,
|
SAMPLERCUBEARRAY = 375,
|
||||||
USAMPLERCUBEARRAY = 377,
|
SAMPLERCUBEARRAYSHADOW = 376,
|
||||||
SAMPLER2DMS = 378,
|
ISAMPLERCUBEARRAY = 377,
|
||||||
ISAMPLER2DMS = 379,
|
USAMPLERCUBEARRAY = 378,
|
||||||
USAMPLER2DMS = 380,
|
SAMPLER2DMS = 379,
|
||||||
SAMPLER2DMSARRAY = 381,
|
ISAMPLER2DMS = 380,
|
||||||
ISAMPLER2DMSARRAY = 382,
|
USAMPLER2DMS = 381,
|
||||||
USAMPLER2DMSARRAY = 383,
|
SAMPLER2DMSARRAY = 382,
|
||||||
SAMPLEREXTERNALOES = 384,
|
ISAMPLER2DMSARRAY = 383,
|
||||||
SAMPLER = 385,
|
USAMPLER2DMSARRAY = 384,
|
||||||
SAMPLERSHADOW = 386,
|
SAMPLEREXTERNALOES = 385,
|
||||||
TEXTURE1D = 387,
|
SAMPLER = 386,
|
||||||
TEXTURE2D = 388,
|
SAMPLERSHADOW = 387,
|
||||||
TEXTURE3D = 389,
|
TEXTURE1D = 388,
|
||||||
TEXTURECUBE = 390,
|
TEXTURE2D = 389,
|
||||||
TEXTURE1DARRAY = 391,
|
TEXTURE3D = 390,
|
||||||
TEXTURE2DARRAY = 392,
|
TEXTURECUBE = 391,
|
||||||
ITEXTURE1D = 393,
|
TEXTURE1DARRAY = 392,
|
||||||
ITEXTURE2D = 394,
|
TEXTURE2DARRAY = 393,
|
||||||
ITEXTURE3D = 395,
|
ITEXTURE1D = 394,
|
||||||
ITEXTURECUBE = 396,
|
ITEXTURE2D = 395,
|
||||||
ITEXTURE1DARRAY = 397,
|
ITEXTURE3D = 396,
|
||||||
ITEXTURE2DARRAY = 398,
|
ITEXTURECUBE = 397,
|
||||||
UTEXTURE1D = 399,
|
ITEXTURE1DARRAY = 398,
|
||||||
UTEXTURE2D = 400,
|
ITEXTURE2DARRAY = 399,
|
||||||
UTEXTURE3D = 401,
|
UTEXTURE1D = 400,
|
||||||
UTEXTURECUBE = 402,
|
UTEXTURE2D = 401,
|
||||||
UTEXTURE1DARRAY = 403,
|
UTEXTURE3D = 402,
|
||||||
UTEXTURE2DARRAY = 404,
|
UTEXTURECUBE = 403,
|
||||||
TEXTURE2DRECT = 405,
|
UTEXTURE1DARRAY = 404,
|
||||||
ITEXTURE2DRECT = 406,
|
UTEXTURE2DARRAY = 405,
|
||||||
UTEXTURE2DRECT = 407,
|
TEXTURE2DRECT = 406,
|
||||||
TEXTUREBUFFER = 408,
|
ITEXTURE2DRECT = 407,
|
||||||
ITEXTUREBUFFER = 409,
|
UTEXTURE2DRECT = 408,
|
||||||
UTEXTUREBUFFER = 410,
|
TEXTUREBUFFER = 409,
|
||||||
TEXTURECUBEARRAY = 411,
|
ITEXTUREBUFFER = 410,
|
||||||
ITEXTURECUBEARRAY = 412,
|
UTEXTUREBUFFER = 411,
|
||||||
UTEXTURECUBEARRAY = 413,
|
TEXTURECUBEARRAY = 412,
|
||||||
TEXTURE2DMS = 414,
|
ITEXTURECUBEARRAY = 413,
|
||||||
ITEXTURE2DMS = 415,
|
UTEXTURECUBEARRAY = 414,
|
||||||
UTEXTURE2DMS = 416,
|
TEXTURE2DMS = 415,
|
||||||
TEXTURE2DMSARRAY = 417,
|
ITEXTURE2DMS = 416,
|
||||||
ITEXTURE2DMSARRAY = 418,
|
UTEXTURE2DMS = 417,
|
||||||
UTEXTURE2DMSARRAY = 419,
|
TEXTURE2DMSARRAY = 418,
|
||||||
SUBPASSINPUT = 420,
|
ITEXTURE2DMSARRAY = 419,
|
||||||
SUBPASSINPUTMS = 421,
|
UTEXTURE2DMSARRAY = 420,
|
||||||
ISUBPASSINPUT = 422,
|
SUBPASSINPUT = 421,
|
||||||
ISUBPASSINPUTMS = 423,
|
SUBPASSINPUTMS = 422,
|
||||||
USUBPASSINPUT = 424,
|
ISUBPASSINPUT = 423,
|
||||||
USUBPASSINPUTMS = 425,
|
ISUBPASSINPUTMS = 424,
|
||||||
IMAGE1D = 426,
|
USUBPASSINPUT = 425,
|
||||||
IIMAGE1D = 427,
|
USUBPASSINPUTMS = 426,
|
||||||
UIMAGE1D = 428,
|
IMAGE1D = 427,
|
||||||
IMAGE2D = 429,
|
IIMAGE1D = 428,
|
||||||
IIMAGE2D = 430,
|
UIMAGE1D = 429,
|
||||||
UIMAGE2D = 431,
|
IMAGE2D = 430,
|
||||||
IMAGE3D = 432,
|
IIMAGE2D = 431,
|
||||||
IIMAGE3D = 433,
|
UIMAGE2D = 432,
|
||||||
UIMAGE3D = 434,
|
IMAGE3D = 433,
|
||||||
IMAGE2DRECT = 435,
|
IIMAGE3D = 434,
|
||||||
IIMAGE2DRECT = 436,
|
UIMAGE3D = 435,
|
||||||
UIMAGE2DRECT = 437,
|
IMAGE2DRECT = 436,
|
||||||
IMAGECUBE = 438,
|
IIMAGE2DRECT = 437,
|
||||||
IIMAGECUBE = 439,
|
UIMAGE2DRECT = 438,
|
||||||
UIMAGECUBE = 440,
|
IMAGECUBE = 439,
|
||||||
IMAGEBUFFER = 441,
|
IIMAGECUBE = 440,
|
||||||
IIMAGEBUFFER = 442,
|
UIMAGECUBE = 441,
|
||||||
UIMAGEBUFFER = 443,
|
IMAGEBUFFER = 442,
|
||||||
IMAGE1DARRAY = 444,
|
IIMAGEBUFFER = 443,
|
||||||
IIMAGE1DARRAY = 445,
|
UIMAGEBUFFER = 444,
|
||||||
UIMAGE1DARRAY = 446,
|
IMAGE1DARRAY = 445,
|
||||||
IMAGE2DARRAY = 447,
|
IIMAGE1DARRAY = 446,
|
||||||
IIMAGE2DARRAY = 448,
|
UIMAGE1DARRAY = 447,
|
||||||
UIMAGE2DARRAY = 449,
|
IMAGE2DARRAY = 448,
|
||||||
IMAGECUBEARRAY = 450,
|
IIMAGE2DARRAY = 449,
|
||||||
IIMAGECUBEARRAY = 451,
|
UIMAGE2DARRAY = 450,
|
||||||
UIMAGECUBEARRAY = 452,
|
IMAGECUBEARRAY = 451,
|
||||||
IMAGE2DMS = 453,
|
IIMAGECUBEARRAY = 452,
|
||||||
IIMAGE2DMS = 454,
|
UIMAGECUBEARRAY = 453,
|
||||||
UIMAGE2DMS = 455,
|
IMAGE2DMS = 454,
|
||||||
IMAGE2DMSARRAY = 456,
|
IIMAGE2DMS = 455,
|
||||||
IIMAGE2DMSARRAY = 457,
|
UIMAGE2DMS = 456,
|
||||||
UIMAGE2DMSARRAY = 458,
|
IMAGE2DMSARRAY = 457,
|
||||||
STRUCT = 459,
|
IIMAGE2DMSARRAY = 458,
|
||||||
VOID = 460,
|
UIMAGE2DMSARRAY = 459,
|
||||||
WHILE = 461,
|
STRUCT = 460,
|
||||||
IDENTIFIER = 462,
|
VOID = 461,
|
||||||
TYPE_NAME = 463,
|
WHILE = 462,
|
||||||
FLOATCONSTANT = 464,
|
IDENTIFIER = 463,
|
||||||
DOUBLECONSTANT = 465,
|
TYPE_NAME = 464,
|
||||||
INTCONSTANT = 466,
|
FLOATCONSTANT = 465,
|
||||||
UINTCONSTANT = 467,
|
DOUBLECONSTANT = 466,
|
||||||
INT64CONSTANT = 468,
|
INTCONSTANT = 467,
|
||||||
UINT64CONSTANT = 469,
|
UINTCONSTANT = 468,
|
||||||
BOOLCONSTANT = 470,
|
INT64CONSTANT = 469,
|
||||||
LEFT_OP = 471,
|
UINT64CONSTANT = 470,
|
||||||
RIGHT_OP = 472,
|
BOOLCONSTANT = 471,
|
||||||
INC_OP = 473,
|
LEFT_OP = 472,
|
||||||
DEC_OP = 474,
|
RIGHT_OP = 473,
|
||||||
LE_OP = 475,
|
INC_OP = 474,
|
||||||
GE_OP = 476,
|
DEC_OP = 475,
|
||||||
EQ_OP = 477,
|
LE_OP = 476,
|
||||||
NE_OP = 478,
|
GE_OP = 477,
|
||||||
AND_OP = 479,
|
EQ_OP = 478,
|
||||||
OR_OP = 480,
|
NE_OP = 479,
|
||||||
XOR_OP = 481,
|
AND_OP = 480,
|
||||||
MUL_ASSIGN = 482,
|
OR_OP = 481,
|
||||||
DIV_ASSIGN = 483,
|
XOR_OP = 482,
|
||||||
ADD_ASSIGN = 484,
|
MUL_ASSIGN = 483,
|
||||||
MOD_ASSIGN = 485,
|
DIV_ASSIGN = 484,
|
||||||
LEFT_ASSIGN = 486,
|
ADD_ASSIGN = 485,
|
||||||
RIGHT_ASSIGN = 487,
|
MOD_ASSIGN = 486,
|
||||||
AND_ASSIGN = 488,
|
LEFT_ASSIGN = 487,
|
||||||
XOR_ASSIGN = 489,
|
RIGHT_ASSIGN = 488,
|
||||||
OR_ASSIGN = 490,
|
AND_ASSIGN = 489,
|
||||||
SUB_ASSIGN = 491,
|
XOR_ASSIGN = 490,
|
||||||
LEFT_PAREN = 492,
|
OR_ASSIGN = 491,
|
||||||
RIGHT_PAREN = 493,
|
SUB_ASSIGN = 492,
|
||||||
LEFT_BRACKET = 494,
|
LEFT_PAREN = 493,
|
||||||
RIGHT_BRACKET = 495,
|
RIGHT_PAREN = 494,
|
||||||
LEFT_BRACE = 496,
|
LEFT_BRACKET = 495,
|
||||||
RIGHT_BRACE = 497,
|
RIGHT_BRACKET = 496,
|
||||||
DOT = 498,
|
LEFT_BRACE = 497,
|
||||||
COMMA = 499,
|
RIGHT_BRACE = 498,
|
||||||
COLON = 500,
|
DOT = 499,
|
||||||
EQUAL = 501,
|
COMMA = 500,
|
||||||
SEMICOLON = 502,
|
COLON = 501,
|
||||||
BANG = 503,
|
EQUAL = 502,
|
||||||
DASH = 504,
|
SEMICOLON = 503,
|
||||||
TILDE = 505,
|
BANG = 504,
|
||||||
PLUS = 506,
|
DASH = 505,
|
||||||
STAR = 507,
|
TILDE = 506,
|
||||||
SLASH = 508,
|
PLUS = 507,
|
||||||
PERCENT = 509,
|
STAR = 508,
|
||||||
LEFT_ANGLE = 510,
|
SLASH = 509,
|
||||||
RIGHT_ANGLE = 511,
|
PERCENT = 510,
|
||||||
VERTICAL_BAR = 512,
|
LEFT_ANGLE = 511,
|
||||||
CARET = 513,
|
RIGHT_ANGLE = 512,
|
||||||
AMPERSAND = 514,
|
VERTICAL_BAR = 513,
|
||||||
QUESTION = 515,
|
CARET = 514,
|
||||||
INVARIANT = 516,
|
AMPERSAND = 515,
|
||||||
PRECISE = 517,
|
QUESTION = 516,
|
||||||
HIGH_PRECISION = 518,
|
INVARIANT = 517,
|
||||||
MEDIUM_PRECISION = 519,
|
PRECISE = 518,
|
||||||
LOW_PRECISION = 520,
|
HIGH_PRECISION = 519,
|
||||||
PRECISION = 521,
|
MEDIUM_PRECISION = 520,
|
||||||
PACKED = 522,
|
LOW_PRECISION = 521,
|
||||||
RESOURCE = 523,
|
PRECISION = 522,
|
||||||
SUPERP = 524
|
PACKED = 523,
|
||||||
};
|
RESOURCE = 524,
|
||||||
|
SUPERP = 525
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Value type. */
|
|
||||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
|
||||||
|
|
||||||
union YYSTYPE
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||||
|
typedef union YYSTYPE
|
||||||
{
|
{
|
||||||
#line 66 "MachineIndependent/glslang.y" /* yacc.c:1909 */
|
/* Line 2058 of yacc.c */
|
||||||
|
#line 66 "glslang.y"
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
glslang::TSourceLoc loc;
|
glslang::TSourceLoc loc;
|
||||||
@ -354,16 +356,28 @@ union YYSTYPE
|
|||||||
};
|
};
|
||||||
} interm;
|
} interm;
|
||||||
|
|
||||||
#line 358 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef union YYSTYPE YYSTYPE;
|
/* Line 2058 of yacc.c */
|
||||||
|
#line 362 "glslang_tab.cpp.h"
|
||||||
|
} YYSTYPE;
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef YYPARSE_PARAM
|
||||||
|
#if defined __STDC__ || defined __cplusplus
|
||||||
|
int yyparse (void *YYPARSE_PARAM);
|
||||||
|
#else
|
||||||
|
int yyparse ();
|
||||||
|
#endif
|
||||||
|
#else /* ! YYPARSE_PARAM */
|
||||||
|
#if defined __STDC__ || defined __cplusplus
|
||||||
int yyparse (glslang::TParseContext* pParseContext);
|
int yyparse (glslang::TParseContext* pParseContext);
|
||||||
|
#else
|
||||||
|
int yyparse ();
|
||||||
|
#endif
|
||||||
|
#endif /* ! YYPARSE_PARAM */
|
||||||
|
|
||||||
#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */
|
#endif /* !YY_YY_GLSLANG_TAB_CPP_H_INCLUDED */
|
||||||
|
@ -355,6 +355,7 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
|
|
||||||
case EOpBallot: out.debug << "ballot"; break;
|
case EOpBallot: out.debug << "ballot"; break;
|
||||||
case EOpReadFirstInvocation: out.debug << "readFirstInvocation"; break;
|
case EOpReadFirstInvocation: out.debug << "readFirstInvocation"; break;
|
||||||
|
|
||||||
case EOpAnyInvocation: out.debug << "anyInvocation"; break;
|
case EOpAnyInvocation: out.debug << "anyInvocation"; break;
|
||||||
case EOpAllInvocations: out.debug << "allInvocations"; break;
|
case EOpAllInvocations: out.debug << "allInvocations"; break;
|
||||||
case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break;
|
case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break;
|
||||||
@ -365,6 +366,19 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
|||||||
case EOpRcp: out.debug << "rcp"; break;
|
case EOpRcp: out.debug << "rcp"; break;
|
||||||
case EOpSaturate: out.debug << "saturate"; break;
|
case EOpSaturate: out.debug << "saturate"; break;
|
||||||
|
|
||||||
|
#ifdef AMD_EXTENSIONS
|
||||||
|
case EOpMinInvocations: out.debug << "minInvocations"; break;
|
||||||
|
case EOpMaxInvocations: out.debug << "maxInvocations"; break;
|
||||||
|
case EOpAddInvocations: out.debug << "addInvocations"; break;
|
||||||
|
case EOpMinInvocationsNonUniform: out.debug << "minInvocationsNonUniform"; break;
|
||||||
|
case EOpMaxInvocationsNonUniform: out.debug << "maxInvocationsNonUniform"; break;
|
||||||
|
case EOpAddInvocationsNonUniform: out.debug << "addInvocationsNonUniform"; break;
|
||||||
|
case EOpMbcnt: out.debug << "mbcnt"; break;
|
||||||
|
|
||||||
|
case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break;
|
||||||
|
case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default: out.debug.message(EPrefixError, "Bad unary op");
|
default: out.debug.message(EPrefixError, "Bad unary op");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,6 +496,18 @@ 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 EOpSwizzleInvocationsMasked: out.debug << "swizzleInvocationsMasked"; break;
|
||||||
|
case EOpWriteInvocation: out.debug << "writeInvocation"; break;
|
||||||
|
|
||||||
|
case EOpMin3: out.debug << "min3"; break;
|
||||||
|
case EOpMax3: out.debug << "max3"; break;
|
||||||
|
case EOpMid3: out.debug << "mid3"; 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;
|
||||||
case EOpAtomicMax: out.debug << "AtomicMax"; break;
|
case EOpAtomicMax: out.debug << "AtomicMax"; break;
|
||||||
@ -539,6 +565,9 @@ 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;
|
||||||
|
#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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user