Merge pull request #5 from KhronosGroup/master
Sync code from KhronosGroup/glslang master
This commit is contained in:
commit
f7f2694b19
26
BUILD.gn
26
BUILD.gn
@ -37,6 +37,8 @@ spirv_tools_dir = glslang_spirv_tools_dir
|
||||
|
||||
config("glslang_public") {
|
||||
include_dirs = [ "." ]
|
||||
|
||||
defines = [ "ENABLE_HLSL=1" ]
|
||||
}
|
||||
|
||||
source_set("glslang_sources") {
|
||||
@ -129,9 +131,25 @@ source_set("glslang_sources") {
|
||||
"glslang/MachineIndependent/reflection.h",
|
||||
"glslang/OSDependent/osinclude.h",
|
||||
"glslang/Public/ShaderLang.h",
|
||||
"hlsl/hlslAttributes.cpp",
|
||||
"hlsl/hlslAttributes.h",
|
||||
"hlsl/hlslGrammar.cpp",
|
||||
"hlsl/hlslGrammar.h",
|
||||
"hlsl/hlslOpMap.cpp",
|
||||
"hlsl/hlslOpMap.h",
|
||||
"hlsl/hlslParseHelper.cpp",
|
||||
"hlsl/hlslParseHelper.h",
|
||||
"hlsl/hlslParseables.cpp",
|
||||
"hlsl/hlslParseables.h",
|
||||
"hlsl/hlslScanContext.cpp",
|
||||
"hlsl/hlslScanContext.h",
|
||||
"hlsl/hlslTokenStream.cpp",
|
||||
"hlsl/hlslTokenStream.h",
|
||||
"hlsl/hlslTokens.h",
|
||||
]
|
||||
|
||||
defines = [ "ENABLE_OPT=1" ]
|
||||
|
||||
if (is_win) {
|
||||
sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
|
||||
defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
|
||||
@ -153,8 +171,8 @@ source_set("glslang_sources") {
|
||||
}
|
||||
if (is_win && !is_clang) {
|
||||
cflags = [
|
||||
"/wd4018", # signed/unsigned mismatch
|
||||
"/wd4189", # local variable is initialized but not referenced
|
||||
"/wd4018", # signed/unsigned mismatch
|
||||
"/wd4189", # local variable is initialized but not referenced
|
||||
]
|
||||
}
|
||||
|
||||
@ -169,7 +187,9 @@ source_set("glslang_default_resource_limits_sources") {
|
||||
"StandAlone/ResourceLimits.cpp",
|
||||
"StandAlone/ResourceLimits.h",
|
||||
]
|
||||
deps = [ ":glslang_sources" ]
|
||||
deps = [
|
||||
":glslang_sources",
|
||||
]
|
||||
public_configs = [ ":glslang_public" ]
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,9 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
# Adhere to GNU filesystem layout conventions
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Needed for CMAKE_DEPENDENT_OPTION macro
|
||||
include(CMakeDependentOption)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
|
||||
|
||||
set(LIB_TYPE STATIC)
|
||||
@ -23,12 +26,13 @@ if(NOT ${SKIP_GLSLANG_INSTALL})
|
||||
endif()
|
||||
option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)
|
||||
|
||||
option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON)
|
||||
option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
|
||||
|
||||
option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)
|
||||
option(ENABLE_GLSLANG_WEB "Reduces glslang to minumum needed for web use" OFF)
|
||||
option(ENABLE_EMSCRIPTEN_SINGLE_FILE "If using emscripten, enables SINGLE_FILE build" OFF)
|
||||
option(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE "If using emscripten, builds to run on Node instead of Web" OFF)
|
||||
|
||||
option(ENABLE_HLSL "Enables HLSL input support" ON)
|
||||
CMAKE_DEPENDENT_OPTION(ENABLE_HLSL "Enables HLSL input support" ON "NOT ENABLE_GLSLANG_WEB" OFF)
|
||||
|
||||
option(ENABLE_OPT "Enables spirv-opt capability if present" ON)
|
||||
|
||||
@ -60,18 +64,14 @@ project(glslang)
|
||||
# make testing optional
|
||||
include(CTest)
|
||||
|
||||
if(ENABLE_AMD_EXTENSIONS)
|
||||
add_definitions(-DAMD_EXTENSIONS)
|
||||
endif(ENABLE_AMD_EXTENSIONS)
|
||||
|
||||
if(ENABLE_NV_EXTENSIONS)
|
||||
add_definitions(-DNV_EXTENSIONS)
|
||||
endif(ENABLE_NV_EXTENSIONS)
|
||||
|
||||
if(ENABLE_HLSL)
|
||||
add_definitions(-DENABLE_HLSL)
|
||||
endif(ENABLE_HLSL)
|
||||
|
||||
if(ENABLE_GLSLANG_WEB)
|
||||
add_definitions(-DGLSLANG_WEB)
|
||||
endif(ENABLE_GLSLANG_WEB)
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
if(MSVC)
|
||||
@ -88,12 +88,49 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
||||
add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs
|
||||
-Wunused-parameter -Wunused-value -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable -fno-exceptions)
|
||||
add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over.
|
||||
add_compile_options(-fno-rtti)
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs
|
||||
-Wunused-parameter -Wunused-value -Wunused-variable)
|
||||
add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over.
|
||||
add_compile_options(-fno-rtti)
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
|
||||
add_compile_options(/GR-) # Disable RTTI
|
||||
endif()
|
||||
|
||||
if(ENABLE_GLSLANG_WEB)
|
||||
if(EMSCRIPTEN)
|
||||
add_compile_options(-Os -fno-exceptions)
|
||||
add_compile_options("SHELL: -s WASM=1")
|
||||
add_compile_options("SHELL: -s WASM_OBJECT_FILES=0")
|
||||
add_link_options(-Os)
|
||||
add_link_options("SHELL: -s FILESYSTEM=0")
|
||||
add_link_options("SHELL: --llvm-lto 1")
|
||||
add_link_options("SHELL: --closure 1")
|
||||
add_link_options("SHELL: -s ALLOW_MEMORY_GROWTH=1")
|
||||
|
||||
add_link_options("SHELL: -s MODULARIZE=1")
|
||||
if(ENABLE_EMSCRIPTEN_SINGLE_FILE)
|
||||
add_link_options("SHELL: -s SINGLE_FILE=1")
|
||||
endif(ENABLE_EMSCRIPTEN_SINGLE_FILE)
|
||||
|
||||
if(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE)
|
||||
add_link_options("SHELL: -s ENVIRONMENT=node")
|
||||
add_link_options("SHELL: -s BINARYEN_ASYNC_COMPILATION=0")
|
||||
else()
|
||||
add_link_options("SHELL: -s ENVIRONMENT=web,worker")
|
||||
add_link_options("SHELL: -s EXPORT_ES6=1")
|
||||
endif()
|
||||
else()
|
||||
if(MSVC)
|
||||
add_compile_options(/Os /GR-)
|
||||
else()
|
||||
add_compile_options(-Os -fno-exceptions)
|
||||
add_link_options(-Os)
|
||||
endif()
|
||||
endif(EMSCRIPTEN)
|
||||
endif(ENABLE_GLSLANG_WEB)
|
||||
|
||||
# Request C++11
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.1)
|
||||
# CMake versions before 3.1 do not understand CMAKE_CXX_STANDARD
|
||||
@ -105,8 +142,6 @@ else()
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
add_compile_options(-fno-rtti)
|
||||
|
||||
function(glslang_set_link_args TARGET)
|
||||
# For MinGW compiles, statically link against the GCC and C++ runtimes.
|
||||
# This avoids the need to ship those runtimes as DLLs.
|
||||
|
0
LICENSE.txt
Executable file → Normal file
0
LICENSE.txt
Executable file → Normal file
41
README.md
41
README.md
@ -155,13 +155,36 @@ changes are quite infrequent. For windows you can get binaries from
|
||||
The command to rebuild is:
|
||||
|
||||
```bash
|
||||
m4 -P MachineIndependent/glslang.m4 > MachineIndependent/glslang.y
|
||||
bison --defines=MachineIndependent/glslang_tab.cpp.h
|
||||
-t MachineIndependent/glslang.y
|
||||
-o MachineIndependent/glslang_tab.cpp
|
||||
```
|
||||
|
||||
The above command is also available in the bash script at
|
||||
`glslang/updateGrammar`.
|
||||
The above commands are also available in the bash script in `updateGrammar`,
|
||||
when executed from the glslang subdirectory of the glslang repository.
|
||||
With no arguments it builds the full grammar, and with a "web" argument,
|
||||
the web grammar subset (see more about the web subset in the next section).
|
||||
|
||||
### WASM for the the Web
|
||||
|
||||
Use the steps in [Build Steps](#build-steps), which following notes/exceptions:
|
||||
* For building the web subset of core glslang:
|
||||
+ `m4` also needs a `-DGLSLANG_WEB` argument, or simply execute `updateGrammar web` from the glslang subdirectory
|
||||
+ turn off the CMAKE options for `BUILD_TESTING`, `ENABLE_OPT`, and `INSTALL_GTEST`,
|
||||
while turning on `ENABLE_GLSLANG_WEB`
|
||||
* `emsdk` needs to be present in your executable search path, *PATH* for
|
||||
Bash-like enivironments
|
||||
+ Instructions located
|
||||
[here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install)
|
||||
* Do not checkout SPIRV-Tools into `External`
|
||||
+ Does not work correctly with emscripten out of the box and we don't want it
|
||||
in the build anyway. *TBD* Have build ignore SPIRV-Tools for web build
|
||||
* Wrap call to `cmake` using `emconfigure` with ENABLE_GLSLANG_WEB=ON:
|
||||
+ e.g. For Linux, `emconfigure cmake -DCMAKE_BUILD_TYPE=Release
|
||||
-DENABLE_GLSLANG_WEB=ON -DCMAKE_INSTALL_PREFIX="$(pwd)/install" ..`
|
||||
* To get a 'true' minimized build, make sure to use `brotli` to compress the .js
|
||||
and .wasm files
|
||||
|
||||
Testing
|
||||
-------
|
||||
@ -244,7 +267,8 @@ The `main()` in `StandAlone/StandAlone.cpp` shows examples using both styles.
|
||||
### C++ Class Interface (new, preferred)
|
||||
|
||||
This interface is in roughly the last 1/3 of `ShaderLang.h`. It is in the
|
||||
glslang namespace and contains the following.
|
||||
glslang namespace and contains the following, here with suggested calls
|
||||
for generating SPIR-V:
|
||||
|
||||
```cxx
|
||||
const char* GetEsslVersionString();
|
||||
@ -267,8 +291,17 @@ class TProgram
|
||||
Reflection queries
|
||||
```
|
||||
|
||||
For just validating (not generating code), subsitute these calls:
|
||||
|
||||
```cxx
|
||||
setEnvInput(EShSourceHlsl or EShSourceGlsl, stage, EShClientNone, 0);
|
||||
setEnvClient(EShClientNone, 0);
|
||||
setEnvTarget(EShTargetNone, 0);
|
||||
```
|
||||
|
||||
See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more
|
||||
details.
|
||||
details. There is a block comment giving more detail above the calls for
|
||||
`setEnvInput, setEnvClient, and setEnvTarget`.
|
||||
|
||||
### C Functional Interface (orignal)
|
||||
|
||||
|
@ -25,24 +25,14 @@ set(HEADERS
|
||||
spvIR.h
|
||||
doc.h
|
||||
SpvTools.h
|
||||
disassemble.h)
|
||||
disassemble.h
|
||||
GLSL.ext.AMD.h
|
||||
GLSL.ext.NV.h)
|
||||
|
||||
set(SPVREMAP_HEADERS
|
||||
SPVRemapper.h
|
||||
doc.h)
|
||||
|
||||
if(ENABLE_AMD_EXTENSIONS)
|
||||
list(APPEND
|
||||
HEADERS
|
||||
GLSL.ext.AMD.h)
|
||||
endif(ENABLE_AMD_EXTENSIONS)
|
||||
|
||||
if(ENABLE_NV_EXTENSIONS)
|
||||
list(APPEND
|
||||
HEADERS
|
||||
GLSL.ext.NV.h)
|
||||
endif(ENABLE_NV_EXTENSIONS)
|
||||
|
||||
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
|
||||
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
|
||||
set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,8 @@
|
||||
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
#include "Logger.h"
|
||||
|
||||
#include <algorithm>
|
||||
@ -66,3 +68,5 @@ std::string SpvBuildLogger::getAllMessages() const {
|
||||
}
|
||||
|
||||
} // end spv namespace
|
||||
|
||||
#endif
|
@ -46,6 +46,14 @@ class SpvBuildLogger {
|
||||
public:
|
||||
SpvBuildLogger() {}
|
||||
|
||||
#ifdef GLSLANG_WEB
|
||||
void tbdFunctionality(const std::string& f) { }
|
||||
void missingFunctionality(const std::string& f) { }
|
||||
void warning(const std::string& w) { }
|
||||
void error(const std::string& e) { errors.push_back(e); }
|
||||
std::string getAllMessages() { return ""; }
|
||||
#else
|
||||
|
||||
// Registers a TBD functionality.
|
||||
void tbdFunctionality(const std::string& f);
|
||||
// Registers a missing functionality.
|
||||
@ -59,6 +67,7 @@ public:
|
||||
// Returns all messages accumulated in the order of:
|
||||
// TBD functionalities, missing functionalities, warnings, errors.
|
||||
std::string getAllMessages() const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
SpvBuildLogger(const SpvBuildLogger&);
|
||||
|
@ -46,7 +46,9 @@
|
||||
|
||||
#include "SpvBuilder.h"
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
#include "hex_float.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <cstdio>
|
||||
@ -230,6 +232,11 @@ Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardP
|
||||
|
||||
Id Builder::makeIntegerType(int width, bool hasSign)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
assert(width == 32);
|
||||
width = 32;
|
||||
#endif
|
||||
|
||||
// try to find it
|
||||
Instruction* type;
|
||||
for (int t = 0; t < (int)groupedTypes[OpTypeInt].size(); ++t) {
|
||||
@ -265,6 +272,11 @@ Id Builder::makeIntegerType(int width, bool hasSign)
|
||||
|
||||
Id Builder::makeFloatType(int width)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
assert(width == 32);
|
||||
width = 32;
|
||||
#endif
|
||||
|
||||
// try to find it
|
||||
Instruction* type;
|
||||
for (int t = 0; t < (int)groupedTypes[OpTypeFloat].size(); ++t) {
|
||||
@ -516,6 +528,7 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// deal with capabilities
|
||||
switch (dim) {
|
||||
case DimBuffer:
|
||||
@ -561,6 +574,7 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
|
||||
addCapability(CapabilityImageMSArray);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return type->getResultId();
|
||||
}
|
||||
@ -586,7 +600,7 @@ Id Builder::makeSampledImageType(Id imageType)
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
#ifndef GLSLANG_WEB
|
||||
Id Builder::makeAccelerationStructureNVType()
|
||||
{
|
||||
Instruction *type;
|
||||
@ -602,6 +616,7 @@ Id Builder::makeAccelerationStructureNVType()
|
||||
return type->getResultId();
|
||||
}
|
||||
#endif
|
||||
|
||||
Id Builder::getDerefTypeId(Id resultId) const
|
||||
{
|
||||
Id typeId = getTypeId(resultId);
|
||||
@ -939,6 +954,10 @@ Id Builder::makeFloatConstant(float f, bool specConstant)
|
||||
|
||||
Id Builder::makeDoubleConstant(double d, bool specConstant)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
assert(0);
|
||||
return NoResult;
|
||||
#else
|
||||
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
||||
Id typeId = makeFloatType(64);
|
||||
union { double db; unsigned long long ull; } u;
|
||||
@ -963,10 +982,15 @@ Id Builder::makeDoubleConstant(double d, bool specConstant)
|
||||
module.mapInstruction(c);
|
||||
|
||||
return c->getResultId();
|
||||
#endif
|
||||
}
|
||||
|
||||
Id Builder::makeFloat16Constant(float f16, bool specConstant)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
assert(0);
|
||||
return NoResult;
|
||||
#else
|
||||
Op opcode = specConstant ? OpSpecConstant : OpConstant;
|
||||
Id typeId = makeFloatType(16);
|
||||
|
||||
@ -991,25 +1015,33 @@ Id Builder::makeFloat16Constant(float f16, bool specConstant)
|
||||
module.mapInstruction(c);
|
||||
|
||||
return c->getResultId();
|
||||
#endif
|
||||
}
|
||||
|
||||
Id Builder::makeFpConstant(Id type, double d, bool specConstant)
|
||||
{
|
||||
assert(isFloatType(type));
|
||||
#ifdef GLSLANG_WEB
|
||||
const int width = 32;
|
||||
assert(width == getScalarTypeWidth(type));
|
||||
#else
|
||||
const int width = getScalarTypeWidth(type);
|
||||
#endif
|
||||
|
||||
switch (getScalarTypeWidth(type)) {
|
||||
case 16:
|
||||
return makeFloat16Constant((float)d, specConstant);
|
||||
case 32:
|
||||
return makeFloatConstant((float)d, specConstant);
|
||||
case 64:
|
||||
return makeDoubleConstant(d, specConstant);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
assert(isFloatType(type));
|
||||
|
||||
assert(false);
|
||||
return NoResult;
|
||||
switch (width) {
|
||||
case 16:
|
||||
return makeFloat16Constant((float)d, specConstant);
|
||||
case 32:
|
||||
return makeFloatConstant((float)d, specConstant);
|
||||
case 64:
|
||||
return makeDoubleConstant(d, specConstant);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
assert(false);
|
||||
return NoResult;
|
||||
}
|
||||
|
||||
Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector<Id>& comps)
|
||||
@ -1825,7 +1857,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
if (parameters.component != NoResult)
|
||||
texArgs[numArgs++] = parameters.component;
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
#ifndef GLSLANG_WEB
|
||||
if (parameters.granularity != NoResult)
|
||||
texArgs[numArgs++] = parameters.granularity;
|
||||
if (parameters.coarse != NoResult)
|
||||
@ -1872,6 +1904,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask);
|
||||
texArgs[numArgs++] = parameters.offsets;
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
if (parameters.sample) {
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask);
|
||||
texArgs[numArgs++] = parameters.sample;
|
||||
@ -1889,6 +1922,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
if (parameters.volatil) {
|
||||
mask = mask | ImageOperandsVolatileTexelKHRMask;
|
||||
}
|
||||
#endif
|
||||
mask = mask | signExtensionMask;
|
||||
if (mask == ImageOperandsMaskNone)
|
||||
--numArgs; // undo speculative reservation for the mask argument
|
||||
@ -1904,10 +1938,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
opCode = OpImageSparseFetch;
|
||||
else
|
||||
opCode = OpImageFetch;
|
||||
#ifdef NV_EXTENSIONS
|
||||
#ifndef GLSLANG_WEB
|
||||
} else if (parameters.granularity && parameters.coarse) {
|
||||
opCode = OpImageSampleFootprintNV;
|
||||
#endif
|
||||
} else if (gather) {
|
||||
if (parameters.Dref)
|
||||
if (sparse)
|
||||
@ -1919,6 +1952,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
opCode = OpImageSparseGather;
|
||||
else
|
||||
opCode = OpImageGather;
|
||||
#endif
|
||||
} else if (explicitLod) {
|
||||
if (parameters.Dref) {
|
||||
if (proj)
|
||||
@ -2067,11 +2101,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
|
||||
break;
|
||||
}
|
||||
case OpImageQueryLod:
|
||||
#ifdef AMD_EXTENSIONS
|
||||
resultType = makeVectorType(getScalarTypeId(getTypeId(parameters.coords)), 2);
|
||||
#else
|
||||
resultType = makeVectorType(makeFloatType(32), 2);
|
||||
#endif
|
||||
break;
|
||||
case OpImageQueryLevels:
|
||||
case OpImageQuerySamples:
|
||||
@ -2089,6 +2119,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
|
||||
if (parameters.lod)
|
||||
query->addIdOperand(parameters.lod);
|
||||
buildPoint->addInstruction(std::unique_ptr<Instruction>(query));
|
||||
addCapability(CapabilityImageQuery);
|
||||
|
||||
return query->getResultId();
|
||||
}
|
||||
@ -2282,7 +2313,12 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
|
||||
int numRows = getTypeNumRows(resultTypeId);
|
||||
|
||||
Instruction* instr = module.getInstruction(componentTypeId);
|
||||
unsigned bitCount = instr->getImmediateOperand(0);
|
||||
#ifdef GLSLANG_WEB
|
||||
const unsigned bitCount = 32;
|
||||
assert(bitCount == instr->getImmediateOperand(0));
|
||||
#else
|
||||
const unsigned bitCount = instr->getImmediateOperand(0);
|
||||
#endif
|
||||
|
||||
// Optimize matrix constructed from a bigger matrix
|
||||
if (isMatrix(sources[0]) && getNumColumns(sources[0]) >= numCols && getNumRows(sources[0]) >= numRows) {
|
||||
|
@ -201,7 +201,11 @@ public:
|
||||
bool isMatrixType(Id typeId) const { return getTypeClass(typeId) == OpTypeMatrix; }
|
||||
bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; }
|
||||
bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; }
|
||||
#ifdef GLSLANG_WEB
|
||||
bool isCooperativeMatrixType(Id typeId)const { return false; }
|
||||
#else
|
||||
bool isCooperativeMatrixType(Id typeId)const { return getTypeClass(typeId) == OpTypeCooperativeMatrixNV; }
|
||||
#endif
|
||||
bool isAggregateType(Id typeId) const { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
|
||||
bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; }
|
||||
bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; }
|
||||
@ -557,6 +561,14 @@ public:
|
||||
|
||||
// Accumulate whether anything in the chain of structures has coherent decorations.
|
||||
struct CoherentFlags {
|
||||
CoherentFlags() { clear(); }
|
||||
#ifdef GLSLANG_WEB
|
||||
void clear() { }
|
||||
bool isVolatile() const { return false; }
|
||||
CoherentFlags operator |=(const CoherentFlags &other) { return *this; }
|
||||
#else
|
||||
bool isVolatile() const { return volatil; }
|
||||
|
||||
unsigned coherent : 1;
|
||||
unsigned devicecoherent : 1;
|
||||
unsigned queuefamilycoherent : 1;
|
||||
@ -577,7 +589,6 @@ public:
|
||||
isImage = 0;
|
||||
}
|
||||
|
||||
CoherentFlags() { clear(); }
|
||||
CoherentFlags operator |=(const CoherentFlags &other) {
|
||||
coherent |= other.coherent;
|
||||
devicecoherent |= other.devicecoherent;
|
||||
@ -589,6 +600,7 @@ public:
|
||||
isImage |= other.isImage;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
CoherentFlags coherentFlags;
|
||||
};
|
||||
|
@ -51,12 +51,8 @@ namespace spv {
|
||||
#include "GLSL.std.450.h"
|
||||
#include "GLSL.ext.KHR.h"
|
||||
#include "GLSL.ext.EXT.h"
|
||||
#ifdef AMD_EXTENSIONS
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#endif
|
||||
#ifdef NV_EXTENSIONS
|
||||
#include "GLSL.ext.NV.h"
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace spv {
|
||||
@ -160,7 +156,6 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
|
||||
}
|
||||
break;
|
||||
case OpExtInst:
|
||||
#if AMD_EXTENSIONS
|
||||
switch (inst.getImmediateOperand(1)) {
|
||||
case GLSLstd450Frexp:
|
||||
case GLSLstd450FrexpStruct:
|
||||
@ -176,7 +171,6 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
if (basicTypeOp == OpTypeFloat && width == 16)
|
||||
@ -222,12 +216,10 @@ void Builder::postProcess(Instruction& inst)
|
||||
addCapability(CapabilityImageQuery);
|
||||
break;
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case OpGroupNonUniformPartitionNV:
|
||||
addExtension(E_SPV_NV_shader_subgroup_partitioned);
|
||||
addCapability(CapabilityGroupNonUniformPartitionedNV);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case OpLoad:
|
||||
case OpStore:
|
||||
|
@ -41,8 +41,10 @@
|
||||
#ifndef GLSLANG_SPV_TOOLS_H
|
||||
#define GLSLANG_SPV_TOOLS_H
|
||||
|
||||
#ifdef ENABLE_OPT
|
||||
#include <vector>
|
||||
#include <ostream>
|
||||
#endif
|
||||
|
||||
#include "../glslang/MachineIndependent/localintermediate.h"
|
||||
#include "Logger.h"
|
||||
@ -59,7 +61,7 @@ struct SpvOptions {
|
||||
bool validate;
|
||||
};
|
||||
|
||||
#if ENABLE_OPT
|
||||
#ifdef ENABLE_OPT
|
||||
|
||||
// Use the SPIRV-Tools disassembler to print SPIR-V.
|
||||
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv);
|
||||
|
@ -52,26 +52,16 @@ 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
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
#include "GLSL.ext.NV.h"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
|
||||
|
||||
namespace spv {
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
static const char* GLSLextAMDGetDebugNames(const char*, unsigned);
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
static const char* GLSLextNVGetDebugNames(const char*, unsigned);
|
||||
#endif
|
||||
|
||||
static void Kill(std::ostream& out, const char* message)
|
||||
{
|
||||
@ -82,15 +72,8 @@ static void Kill(std::ostream& out, const char* message)
|
||||
// used to identify the extended instruction library imported when printing
|
||||
enum ExtInstSet {
|
||||
GLSL450Inst,
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
GLSLextAMDInst,
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
GLSLextNVInst,
|
||||
#endif
|
||||
|
||||
OpenCLExtInst,
|
||||
};
|
||||
|
||||
@ -499,37 +482,29 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
||||
const char* name = idDescriptor[stream[word - 2]].c_str();
|
||||
if (0 == memcmp("OpenCL", name, 6)) {
|
||||
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
|
||||
#ifdef NV_EXTENSIONS
|
||||
}else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 ||
|
||||
} else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 ||
|
||||
strcmp(spv::E_SPV_NV_geometry_shader_passthrough, name) == 0 ||
|
||||
strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 ||
|
||||
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 ||
|
||||
strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 ||
|
||||
strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) {
|
||||
extInstSet = GLSLextNVInst;
|
||||
#endif
|
||||
}
|
||||
unsigned entrypoint = stream[word - 1];
|
||||
if (extInstSet == GLSL450Inst) {
|
||||
if (entrypoint < GLSLstd450Count) {
|
||||
out << "(" << GlslStd450DebugNames[entrypoint] << ")";
|
||||
}
|
||||
#ifdef AMD_EXTENSIONS
|
||||
} else if (extInstSet == GLSLextAMDInst) {
|
||||
out << "(" << GLSLextAMDGetDebugNames(name, entrypoint) << ")";
|
||||
#endif
|
||||
#ifdef NV_EXTENSIONS
|
||||
}
|
||||
else if (extInstSet == GLSLextNVInst) {
|
||||
out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -653,7 +628,6 @@ static void GLSLstd450GetDebugNames(const char** names)
|
||||
names[GLSLstd450NClamp] = "NClamp";
|
||||
}
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint)
|
||||
{
|
||||
if (strcmp(name, spv::E_SPV_AMD_shader_ballot) == 0) {
|
||||
@ -695,9 +669,7 @@ static const char* GLSLextAMDGetDebugNames(const char* name, unsigned entrypoint
|
||||
|
||||
return "Bad";
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
|
||||
{
|
||||
if (strcmp(name, spv::E_SPV_NV_sample_mask_override_coverage) == 0 ||
|
||||
@ -751,7 +723,6 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
|
||||
}
|
||||
return "Bad";
|
||||
}
|
||||
#endif
|
||||
|
||||
void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
|
||||
{
|
||||
|
@ -50,12 +50,8 @@ namespace spv {
|
||||
// Include C-based headers that don't have a namespace
|
||||
#include "GLSL.ext.KHR.h"
|
||||
#include "GLSL.ext.EXT.h"
|
||||
#ifdef AMD_EXTENSIONS
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#endif
|
||||
#ifdef NV_EXTENSIONS
|
||||
#include "GLSL.ext.NV.h"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,22 +94,17 @@ const char* ExecutionModelString(int model)
|
||||
case 4: return "Fragment";
|
||||
case 5: return "GLCompute";
|
||||
case 6: return "Kernel";
|
||||
#ifdef NV_EXTENSIONS
|
||||
case ExecutionModelTaskNV: return "TaskNV";
|
||||
case ExecutionModelMeshNV: return "MeshNV";
|
||||
#endif
|
||||
|
||||
default: return "Bad";
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case ExecutionModelRayGenerationNV: return "RayGenerationNV";
|
||||
case ExecutionModelIntersectionNV: return "IntersectionNV";
|
||||
case ExecutionModelAnyHitNV: return "AnyHitNV";
|
||||
case ExecutionModelClosestHitNV: return "ClosestHitNV";
|
||||
case ExecutionModelMissNV: return "MissNV";
|
||||
case ExecutionModelCallableNV: return "CallableNV";
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,13 +174,11 @@ const char* ExecutionModeString(int mode)
|
||||
|
||||
case 4446: return "PostDepthCoverage";
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case ExecutionModeOutputLinesNV: return "OutputLinesNV";
|
||||
case ExecutionModeOutputPrimitivesNV: return "OutputPrimitivesNV";
|
||||
case ExecutionModeOutputTrianglesNV: return "OutputTrianglesNV";
|
||||
case ExecutionModeDerivativeGroupQuadsNV: return "DerivativeGroupQuadsNV";
|
||||
case ExecutionModeDerivativeGroupLinearNV: return "DerivativeGroupLinearNV";
|
||||
#endif
|
||||
|
||||
case ExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT";
|
||||
case ExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT";
|
||||
@ -220,14 +209,12 @@ const char* StorageClassString(int StorageClass)
|
||||
case 11: return "Image";
|
||||
case 12: return "StorageBuffer";
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case StorageClassRayPayloadNV: return "RayPayloadNV";
|
||||
case StorageClassHitAttributeNV: return "HitAttributeNV";
|
||||
case StorageClassIncomingRayPayloadNV: return "IncomingRayPayloadNV";
|
||||
case StorageClassShaderRecordBufferNV: return "ShaderRecordBufferNV";
|
||||
case StorageClassCallableDataNV: return "CallableDataNV";
|
||||
case StorageClassIncomingCallableDataNV: return "IncomingCallableDataNV";
|
||||
#endif
|
||||
|
||||
case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT";
|
||||
|
||||
@ -289,10 +276,7 @@ const char* DecorationString(int decoration)
|
||||
case DecorationCeiling:
|
||||
default: return "Bad";
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case DecorationExplicitInterpAMD: return "ExplicitInterpAMD";
|
||||
#endif
|
||||
#ifdef NV_EXTENSIONS
|
||||
case DecorationOverrideCoverageNV: return "OverrideCoverageNV";
|
||||
case DecorationPassthroughNV: return "PassthroughNV";
|
||||
case DecorationViewportRelativeNV: return "ViewportRelativeNV";
|
||||
@ -301,7 +285,6 @@ const char* DecorationString(int decoration)
|
||||
case DecorationPerViewNV: return "PerViewNV";
|
||||
case DecorationPerTaskNV: return "PerTaskNV";
|
||||
case DecorationPerVertexNV: return "PerVertexNV";
|
||||
#endif
|
||||
|
||||
case DecorationNonUniformEXT: return "DecorationNonUniformEXT";
|
||||
case DecorationHlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE";
|
||||
@ -371,7 +354,6 @@ const char* BuiltInString(int builtIn)
|
||||
case 4426: return "DrawIndex";
|
||||
case 5014: return "FragStencilRefEXT";
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case 4992: return "BaryCoordNoPerspAMD";
|
||||
case 4993: return "BaryCoordNoPerspCentroidAMD";
|
||||
case 4994: return "BaryCoordNoPerspSampleAMD";
|
||||
@ -379,9 +361,6 @@ const char* BuiltInString(int builtIn)
|
||||
case 4996: return "BaryCoordSmoothCentroidAMD";
|
||||
case 4997: return "BaryCoordSmoothSampleAMD";
|
||||
case 4998: return "BaryCoordPullModelAMD";
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case BuiltInLaunchIdNV: return "LaunchIdNV";
|
||||
case BuiltInLaunchSizeNV: return "LaunchSizeNV";
|
||||
case BuiltInWorldRayOriginNV: return "WorldRayOriginNV";
|
||||
@ -405,15 +384,12 @@ const char* BuiltInString(int builtIn)
|
||||
// case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV"; // superseded by BuiltInFragInvocationCountEXT
|
||||
case BuiltInBaryCoordNV: return "BaryCoordNV";
|
||||
case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
|
||||
#endif
|
||||
|
||||
case BuiltInFragSizeEXT: return "FragSizeEXT";
|
||||
case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT";
|
||||
|
||||
case 5264: return "FullyCoveredEXT";
|
||||
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case BuiltInTaskCountNV: return "TaskCountNV";
|
||||
case BuiltInPrimitiveCountNV: return "PrimitiveCountNV";
|
||||
case BuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV";
|
||||
@ -422,7 +398,6 @@ const char* BuiltInString(int builtIn)
|
||||
case BuiltInLayerPerViewNV: return "LayerPerViewNV";
|
||||
case BuiltInMeshViewCountNV: return "MeshViewCountNV";
|
||||
case BuiltInMeshViewIndicesNV: return "MeshViewIndicesNV";
|
||||
#endif
|
||||
case BuiltInWarpsPerSMNV: return "WarpsPerSMNV";
|
||||
case BuiltInSMCountNV: return "SMCountNV";
|
||||
case BuiltInWarpIDNV: return "WarpIDNV";
|
||||
@ -781,11 +756,9 @@ const char* GroupOperationString(int gop)
|
||||
case GroupOperationInclusiveScan: return "InclusiveScan";
|
||||
case GroupOperationExclusiveScan: return "ExclusiveScan";
|
||||
case GroupOperationClusteredReduce: return "ClusteredReduce";
|
||||
#ifdef NV_EXTENSIONS
|
||||
case GroupOperationPartitionedReduceNV: return "PartitionedReduceNV";
|
||||
case GroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV";
|
||||
case GroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV";
|
||||
#endif
|
||||
|
||||
default: return "Bad";
|
||||
}
|
||||
@ -902,17 +875,14 @@ const char* CapabilityString(int info)
|
||||
|
||||
case CapabilityStencilExportEXT: return "StencilExportEXT";
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case CapabilityFloat16ImageAMD: return "Float16ImageAMD";
|
||||
case CapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD";
|
||||
case CapabilityFragmentMaskAMD: return "FragmentMaskAMD";
|
||||
case CapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD";
|
||||
#endif
|
||||
|
||||
case CapabilityAtomicStorageOps: return "AtomicStorageOps";
|
||||
|
||||
case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage";
|
||||
#ifdef NV_EXTENSIONS
|
||||
case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV";
|
||||
case CapabilityShaderViewportIndexLayerNV: return "ShaderViewportIndexLayerNV";
|
||||
case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV";
|
||||
@ -927,7 +897,6 @@ const char* CapabilityString(int info)
|
||||
case CapabilityImageFootprintNV: return "ImageFootprintNV";
|
||||
// case CapabilityShadingRateNV: return "ShadingRateNV"; // superseded by FragmentDensityEXT
|
||||
case CapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV";
|
||||
#endif
|
||||
case CapabilityFragmentDensityEXT: return "FragmentDensityEXT";
|
||||
|
||||
case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT";
|
||||
@ -1337,7 +1306,6 @@ const char* OpcodeString(int op)
|
||||
case 4430: return "OpSubgroupAllEqualKHR";
|
||||
case 4432: return "OpSubgroupReadInvocationKHR";
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case 5000: return "OpGroupIAddNonUniformAMD";
|
||||
case 5001: return "OpGroupFAddNonUniformAMD";
|
||||
case 5002: return "OpGroupFMinNonUniformAMD";
|
||||
@ -1349,14 +1317,12 @@ const char* OpcodeString(int op)
|
||||
|
||||
case 5011: return "OpFragmentMaskFetchAMD";
|
||||
case 5012: return "OpFragmentFetchAMD";
|
||||
#endif
|
||||
|
||||
case OpReadClockKHR: return "OpReadClockKHR";
|
||||
|
||||
case OpDecorateStringGOOGLE: return "OpDecorateStringGOOGLE";
|
||||
case OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE";
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV";
|
||||
case OpReportIntersectionNV: return "OpReportIntersectionNV";
|
||||
case OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV";
|
||||
@ -1366,7 +1332,6 @@ const char* OpcodeString(int op)
|
||||
case OpExecuteCallableNV: return "OpExecuteCallableNV";
|
||||
case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV";
|
||||
case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV";
|
||||
#endif
|
||||
|
||||
case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV";
|
||||
case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV";
|
||||
@ -2686,7 +2651,6 @@ void Parameterize()
|
||||
|
||||
InstructionDesc[OpModuleProcessed].operands.push(OperandLiteralString, "'process'");
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandScope, "'Execution'");
|
||||
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
|
||||
InstructionDesc[OpGroupIAddNonUniformAMD].operands.push(OperandId, "'X'");
|
||||
@ -2725,9 +2689,7 @@ void Parameterize()
|
||||
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Image'");
|
||||
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Coordinate'");
|
||||
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Fragment Index'");
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X");
|
||||
|
||||
InstructionDesc[OpTypeAccelerationStructureNV].setResultAndType(true, false);
|
||||
@ -2765,7 +2727,6 @@ void Parameterize()
|
||||
|
||||
InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Index Offset'");
|
||||
InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Packed Indices'");
|
||||
#endif
|
||||
|
||||
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Component Type'");
|
||||
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Scope'");
|
||||
|
@ -234,7 +234,6 @@ std::string GetDefaultTBuiltInResourceString()
|
||||
<< "MaxCullDistances " << DefaultTBuiltInResource.maxCullDistances << "\n"
|
||||
<< "MaxCombinedClipAndCullDistances " << DefaultTBuiltInResource.maxCombinedClipAndCullDistances << "\n"
|
||||
<< "MaxSamples " << DefaultTBuiltInResource.maxSamples << "\n"
|
||||
#ifdef NV_EXTENSIONS
|
||||
<< "MaxMeshOutputVerticesNV " << DefaultTBuiltInResource.maxMeshOutputVerticesNV << "\n"
|
||||
<< "MaxMeshOutputPrimitivesNV " << DefaultTBuiltInResource.maxMeshOutputPrimitivesNV << "\n"
|
||||
<< "MaxMeshWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeX_NV << "\n"
|
||||
@ -244,7 +243,6 @@ std::string GetDefaultTBuiltInResourceString()
|
||||
<< "MaxTaskWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_NV << "\n"
|
||||
<< "MaxTaskWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_NV << "\n"
|
||||
<< "MaxMeshViewCountNV " << DefaultTBuiltInResource.maxMeshViewCountNV << "\n"
|
||||
#endif
|
||||
<< "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n"
|
||||
<< "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n"
|
||||
<< "doWhileLoops " << DefaultTBuiltInResource.limits.doWhileLoops << "\n"
|
||||
@ -451,7 +449,6 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config)
|
||||
resources->maxCombinedClipAndCullDistances = value;
|
||||
else if (tokenStr == "MaxSamples")
|
||||
resources->maxSamples = value;
|
||||
#ifdef NV_EXTENSIONS
|
||||
else if (tokenStr == "MaxMeshOutputVerticesNV")
|
||||
resources->maxMeshOutputVerticesNV = value;
|
||||
else if (tokenStr == "MaxMeshOutputPrimitivesNV")
|
||||
@ -470,7 +467,6 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config)
|
||||
resources->maxTaskWorkGroupSizeZ_NV = value;
|
||||
else if (tokenStr == "MaxMeshViewCountNV")
|
||||
resources->maxMeshViewCountNV = value;
|
||||
#endif
|
||||
else if (tokenStr == "nonInductiveForLoops")
|
||||
resources->limits.nonInductiveForLoops = (value != 0);
|
||||
else if (tokenStr == "whileLoops")
|
||||
|
@ -146,11 +146,13 @@ void ProcessConfigFile()
|
||||
{
|
||||
if (ConfigFile.size() == 0)
|
||||
Resources = glslang::DefaultTBuiltInResource;
|
||||
#ifndef GLSLANG_WEB
|
||||
else {
|
||||
char* configString = ReadFileData(ConfigFile.c_str());
|
||||
glslang::DecodeResourceLimits(&Resources, configString);
|
||||
FreeFileData(configString);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int ReflectOptions = EShReflectionDefault;
|
||||
@ -255,7 +257,6 @@ const char* GetBinaryName(EShLanguage stage)
|
||||
case EShLangGeometry: name = "geom.spv"; break;
|
||||
case EShLangFragment: name = "frag.spv"; break;
|
||||
case EShLangCompute: name = "comp.spv"; break;
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EShLangRayGenNV: name = "rgen.spv"; break;
|
||||
case EShLangIntersectNV: name = "rint.spv"; break;
|
||||
case EShLangAnyHitNV: name = "rahit.spv"; break;
|
||||
@ -264,7 +265,6 @@ const char* GetBinaryName(EShLanguage stage)
|
||||
case EShLangCallableNV: name = "rcall.spv"; break;
|
||||
case EShLangMeshNV: name = "mesh.spv"; break;
|
||||
case EShLangTaskNV: name = "task.spv"; break;
|
||||
#endif
|
||||
default: name = "unknown"; break;
|
||||
}
|
||||
} else
|
||||
@ -977,6 +977,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
shader->setPreamble(UserPreamble.get());
|
||||
shader->addProcesses(Processes);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Set IO mapper binding shift values
|
||||
for (int r = 0; r < glslang::EResCount; ++r) {
|
||||
const glslang::TResourceType res = glslang::TResourceType(r);
|
||||
@ -990,30 +991,33 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
i != baseBindingForSet[res][compUnit.stage].end(); ++i)
|
||||
shader->setShiftBindingForSet(res, i->second, i->first);
|
||||
}
|
||||
|
||||
shader->setFlattenUniformArrays((Options & EOptionFlattenUniformArrays) != 0);
|
||||
shader->setNoStorageFormat((Options & EOptionNoStorageFormat) != 0);
|
||||
shader->setNanMinMaxClamp(NaNClamp);
|
||||
shader->setResourceSetBinding(baseResourceSetBinding[compUnit.stage]);
|
||||
|
||||
if (Options & EOptionHlslIoMapping)
|
||||
shader->setHlslIoMapping(true);
|
||||
|
||||
if (Options & EOptionAutoMapBindings)
|
||||
shader->setAutoMapBindings(true);
|
||||
|
||||
if (Options & EOptionAutoMapLocations)
|
||||
shader->setAutoMapLocations(true);
|
||||
|
||||
if (Options & EOptionInvertY)
|
||||
shader->setInvertY(true);
|
||||
|
||||
for (auto& uniOverride : uniformLocationOverrides) {
|
||||
shader->addUniformLocationOverride(uniOverride.first.c_str(),
|
||||
uniOverride.second);
|
||||
}
|
||||
|
||||
shader->setUniformLocationBase(uniformBase);
|
||||
#endif
|
||||
|
||||
shader->setNanMinMaxClamp(NaNClamp);
|
||||
|
||||
#ifdef ENABLE_HLSL
|
||||
shader->setFlattenUniformArrays((Options & EOptionFlattenUniformArrays) != 0);
|
||||
if (Options & EOptionHlslIoMapping)
|
||||
shader->setHlslIoMapping(true);
|
||||
#endif
|
||||
|
||||
if (Options & EOptionInvertY)
|
||||
shader->setInvertY(true);
|
||||
|
||||
// Set up the environment, some subsettings take precedence over earlier
|
||||
// ways of setting things.
|
||||
@ -1023,8 +1027,10 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
compUnit.stage, Client, ClientInputSemanticsVersion);
|
||||
shader->setEnvClient(Client, ClientVersion);
|
||||
shader->setEnvTarget(TargetLanguage, TargetVersion);
|
||||
#ifdef ENABLE_HLSL
|
||||
if (targetHlslFunctionality1)
|
||||
shader->setEnvTargetHlslFunctionality1();
|
||||
#endif
|
||||
}
|
||||
|
||||
shaders.push_back(shader);
|
||||
@ -1034,6 +1040,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
DirStackFileIncluder includer;
|
||||
std::for_each(IncludeDirectoryList.rbegin(), IncludeDirectoryList.rend(), [&includer](const std::string& dir) {
|
||||
includer.pushExternalLocalDirectory(dir); });
|
||||
#ifndef GLSLANG_WEB
|
||||
if (Options & EOptionOutputPreprocessed) {
|
||||
std::string str;
|
||||
if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, messages, &str, includer)) {
|
||||
@ -1045,6 +1052,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
StderrIfNonEmpty(shader->getInfoDebugLog());
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! shader->parse(&Resources, defaultVersion, false, messages, includer))
|
||||
CompileFailed = true;
|
||||
@ -1067,11 +1075,13 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
if (! (Options & EOptionOutputPreprocessed) && ! program.link(messages))
|
||||
LinkFailed = true;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Map IO
|
||||
if (Options & EOptionSpv) {
|
||||
if (!program.mapIO())
|
||||
LinkFailed = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Report
|
||||
if (! (Options & EOptionSuppressInfolog) &&
|
||||
@ -1080,11 +1090,13 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
PutsIfNonEmpty(program.getInfoDebugLog());
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Reflect
|
||||
if (Options & EOptionDumpReflection) {
|
||||
program.buildReflection(ReflectOptions);
|
||||
program.dumpReflection();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Dump SPIR-V
|
||||
if (Options & EOptionSpv) {
|
||||
@ -1114,8 +1126,10 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
} else {
|
||||
glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage));
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv))
|
||||
spv::Disassemble(std::cout, spirv);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1203,11 +1217,13 @@ int singleMain()
|
||||
workList.add(item.get());
|
||||
});
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if (Options & EOptionDumpConfig) {
|
||||
printf("%s", glslang::GetDefaultTBuiltInResourceString().c_str());
|
||||
if (workList.empty())
|
||||
return ESuccess;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Options & EOptionDumpBareVersion) {
|
||||
printf("%d.%d.%d\n",
|
||||
@ -1379,7 +1395,6 @@ EShLanguage FindLanguage(const std::string& name, bool parseStageName)
|
||||
return EShLangFragment;
|
||||
else if (stageName == "comp")
|
||||
return EShLangCompute;
|
||||
#ifdef NV_EXTENSIONS
|
||||
else if (stageName == "rgen")
|
||||
return EShLangRayGenNV;
|
||||
else if (stageName == "rint")
|
||||
@ -1396,7 +1411,6 @@ EShLanguage FindLanguage(const std::string& name, bool parseStageName)
|
||||
return EShLangMeshNV;
|
||||
else if (stageName == "task")
|
||||
return EShLangTaskNV;
|
||||
#endif
|
||||
|
||||
usage();
|
||||
return EShLangVertex;
|
||||
@ -1466,7 +1480,6 @@ void usage()
|
||||
" .geom for a geometry shader\n"
|
||||
" .frag for a fragment shader\n"
|
||||
" .comp for a compute shader\n"
|
||||
#ifdef NV_EXTENSIONS
|
||||
" .mesh for a mesh shader\n"
|
||||
" .task for a task shader\n"
|
||||
" .rgen for a ray generation shader\n"
|
||||
@ -1475,7 +1488,6 @@ void usage()
|
||||
" .rchit for a ray closest hit shader\n"
|
||||
" .rmiss for a ray miss shader\n"
|
||||
" .rcall for a ray callable shader\n"
|
||||
#endif
|
||||
" .glsl for .vert.glsl, .tesc.glsl, ..., .comp.glsl compound suffixes\n"
|
||||
" .hlsl for .vert.hlsl, .tesc.hlsl, ..., .comp.hlsl compound suffixes\n"
|
||||
"\n"
|
||||
|
43
Test/310.inheritMemory.frag
Normal file
43
Test/310.inheritMemory.frag
Normal file
@ -0,0 +1,43 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
struct S {
|
||||
float buff[10];
|
||||
};
|
||||
|
||||
layout(std430, binding=2) readonly buffer RoBuff {
|
||||
float buff_ro[10];
|
||||
S s_ro;
|
||||
} ro_buffer;
|
||||
|
||||
layout(std430, binding=2) buffer Buff {
|
||||
float buff[10];
|
||||
S s;
|
||||
} non_ro_buffer;
|
||||
|
||||
void non_ro_fun(float[10] buff) { }
|
||||
void non_ro_funf(float el) { }
|
||||
void non_ro_funS(S s) { }
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
S s;
|
||||
|
||||
non_ro_fun(s.buff);
|
||||
non_ro_funf(s.buff[3]);
|
||||
non_ro_funS(s);
|
||||
|
||||
non_ro_fun(non_ro_buffer.buff);
|
||||
non_ro_fun(non_ro_buffer.s.buff);
|
||||
non_ro_funf(non_ro_buffer.buff[3]);
|
||||
non_ro_funf(non_ro_buffer.s.buff[3]);
|
||||
non_ro_funS(non_ro_buffer.s);
|
||||
|
||||
non_ro_fun(ro_buffer.buff_ro);
|
||||
non_ro_fun(ro_buffer.s_ro.buff);
|
||||
non_ro_funf(ro_buffer.buff_ro[3]);
|
||||
non_ro_funf(ro_buffer.s_ro.buff[3]);
|
||||
non_ro_funS(ro_buffer.s_ro);
|
||||
}
|
@ -119,9 +119,9 @@ ERROR: node is still EOpNull!
|
||||
0:59 Function Parameters:
|
||||
0:61 Sequence
|
||||
0:61 move second child to first child ( temp highp float)
|
||||
0:61 direct index (layout( column_major shared) temp highp float)
|
||||
0:61 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:61 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:61 direct index (layout( column_major shared) readonly temp highp float)
|
||||
0:61 values: direct index for structure (layout( column_major shared) readonly buffer unsized 3-element array of highp float)
|
||||
0:61 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) readonly buffer unsized 3-element array of highp float values})
|
||||
0:61 Constant:
|
||||
0:61 1 (const int)
|
||||
0:61 Constant:
|
||||
@ -129,8 +129,8 @@ ERROR: node is still EOpNull!
|
||||
0:61 Constant:
|
||||
0:61 4.700000
|
||||
0:62 array length ( temp int)
|
||||
0:62 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:62 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:62 values: direct index for structure (layout( column_major shared) readonly buffer unsized 3-element array of highp float)
|
||||
0:62 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) readonly buffer unsized 3-element array of highp float values})
|
||||
0:62 Constant:
|
||||
0:62 1 (const int)
|
||||
0:63 Pre-Increment ( temp highp 4-component vector of float)
|
||||
@ -282,9 +282,9 @@ ERROR: node is still EOpNull!
|
||||
0:? Sequence
|
||||
0:194 move second child to first child ( temp highp float)
|
||||
0:194 'g' ( temp highp float)
|
||||
0:194 direct index (layout( column_major shared) temp highp float)
|
||||
0:194 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:194 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:194 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:194 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:194 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:194 Constant:
|
||||
0:194 1 (const int)
|
||||
0:194 Constant:
|
||||
@ -292,42 +292,42 @@ ERROR: node is still EOpNull!
|
||||
0:195 Sequence
|
||||
0:195 move second child to first child ( temp highp float)
|
||||
0:195 'f' ( temp highp float)
|
||||
0:195 direct index (layout( column_major shared) temp highp float)
|
||||
0:195 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:195 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:195 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:195 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:195 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:195 Constant:
|
||||
0:195 1 (const int)
|
||||
0:195 Constant:
|
||||
0:195 2 (const int)
|
||||
0:196 Pre-Increment ( temp highp float)
|
||||
0:196 direct index (layout( column_major shared) temp highp float)
|
||||
0:196 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:196 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:196 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:196 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:196 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:196 Constant:
|
||||
0:196 1 (const int)
|
||||
0:196 Constant:
|
||||
0:196 2 (const int)
|
||||
0:197 Post-Decrement ( temp highp float)
|
||||
0:197 direct index (layout( column_major shared) temp highp float)
|
||||
0:197 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:197 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:197 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:197 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:197 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:197 Constant:
|
||||
0:197 1 (const int)
|
||||
0:197 Constant:
|
||||
0:197 2 (const int)
|
||||
0:198 add ( temp highp float)
|
||||
0:198 'f' ( temp highp float)
|
||||
0:198 direct index (layout( column_major shared) temp highp float)
|
||||
0:198 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:198 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:198 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:198 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:198 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:198 Constant:
|
||||
0:198 1 (const int)
|
||||
0:198 Constant:
|
||||
0:198 2 (const int)
|
||||
0:199 subtract ( temp highp float)
|
||||
0:199 direct index (layout( column_major shared) temp highp float)
|
||||
0:199 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:199 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:199 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:199 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:199 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:199 Constant:
|
||||
0:199 1 (const int)
|
||||
0:199 Constant:
|
||||
@ -339,9 +339,9 @@ ERROR: node is still EOpNull!
|
||||
0:201 true case
|
||||
0:201 'f' ( temp highp float)
|
||||
0:201 false case
|
||||
0:201 direct index (layout( column_major shared) temp highp float)
|
||||
0:201 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:201 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:201 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:201 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:201 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:201 Constant:
|
||||
0:201 1 (const int)
|
||||
0:201 Constant:
|
||||
@ -350,9 +350,9 @@ ERROR: node is still EOpNull!
|
||||
0:202 Condition
|
||||
0:202 'b' ( temp bool)
|
||||
0:202 true case
|
||||
0:202 direct index (layout( column_major shared) temp highp float)
|
||||
0:202 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:202 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:202 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:202 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:202 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:202 Constant:
|
||||
0:202 1 (const int)
|
||||
0:202 Constant:
|
||||
@ -363,9 +363,9 @@ ERROR: node is still EOpNull!
|
||||
0:203 Condition
|
||||
0:203 Compare Equal ( temp bool)
|
||||
0:203 'f' ( temp highp float)
|
||||
0:203 direct index (layout( column_major shared) temp highp float)
|
||||
0:203 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:203 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:203 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:203 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:203 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:203 Constant:
|
||||
0:203 1 (const int)
|
||||
0:203 Constant:
|
||||
@ -377,9 +377,9 @@ ERROR: node is still EOpNull!
|
||||
0:205 Condition
|
||||
0:205 Compare Greater Than or Equal ( temp bool)
|
||||
0:205 'f' ( temp highp float)
|
||||
0:205 direct index (layout( column_major shared) temp highp float)
|
||||
0:205 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:205 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:205 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:205 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:205 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:205 Constant:
|
||||
0:205 1 (const int)
|
||||
0:205 Constant:
|
||||
@ -391,9 +391,9 @@ ERROR: node is still EOpNull!
|
||||
0:207 'f' ( temp highp float)
|
||||
0:207 direct index ( temp highp float)
|
||||
0:207 Construct vec3 ( temp highp 3-component vector of float)
|
||||
0:207 direct index (layout( column_major shared) temp highp float)
|
||||
0:207 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:207 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:207 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:207 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:207 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:207 Constant:
|
||||
0:207 1 (const int)
|
||||
0:207 Constant:
|
||||
@ -401,14 +401,14 @@ ERROR: node is still EOpNull!
|
||||
0:207 Constant:
|
||||
0:207 0 (const int)
|
||||
0:208 Bitwise not ( temp highp int)
|
||||
0:208 value: direct index for structure (layout( column_major shared) buffer highp int)
|
||||
0:208 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:208 value: direct index for structure (layout( column_major shared) writeonly buffer highp int)
|
||||
0:208 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:208 Constant:
|
||||
0:208 0 (const int)
|
||||
0:209 move second child to first child ( temp highp float)
|
||||
0:209 direct index (layout( column_major shared) temp highp float)
|
||||
0:209 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:209 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:209 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:209 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:209 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:209 Constant:
|
||||
0:209 1 (const int)
|
||||
0:209 Constant:
|
||||
@ -420,22 +420,22 @@ ERROR: node is still EOpNull!
|
||||
0:? Sequence
|
||||
0:221 move second child to first child ( temp highp float)
|
||||
0:221 'g' ( temp highp float)
|
||||
0:221 direct index (layout( column_major shared) temp highp float)
|
||||
0:221 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:221 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:221 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:221 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:221 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:221 Constant:
|
||||
0:221 1 (const int)
|
||||
0:221 Constant:
|
||||
0:221 2 (const int)
|
||||
0:222 Bitwise not ( temp highp int)
|
||||
0:222 value: direct index for structure (layout( column_major shared) buffer highp int)
|
||||
0:222 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:222 value: direct index for structure (layout( column_major shared) writeonly buffer highp int)
|
||||
0:222 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:222 Constant:
|
||||
0:222 0 (const int)
|
||||
0:223 move second child to first child ( temp highp float)
|
||||
0:223 direct index (layout( column_major shared) temp highp float)
|
||||
0:223 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of highp float)
|
||||
0:223 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:223 direct index (layout( column_major shared) writeonly temp highp float)
|
||||
0:223 values: direct index for structure (layout( column_major shared) writeonly buffer unsized 3-element array of highp float)
|
||||
0:223 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:223 Constant:
|
||||
0:223 1 (const int)
|
||||
0:223 Constant:
|
||||
@ -443,8 +443,8 @@ ERROR: node is still EOpNull!
|
||||
0:223 Constant:
|
||||
0:223 3.400000
|
||||
0:224 move second child to first child ( temp highp int)
|
||||
0:224 value: direct index for structure (layout( column_major shared) buffer highp int)
|
||||
0:224 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:224 value: direct index for structure (layout( column_major shared) writeonly buffer highp int)
|
||||
0:224 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:224 Constant:
|
||||
0:224 0 (const int)
|
||||
0:224 Constant:
|
||||
@ -477,7 +477,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'arrX' ( global 2-element array of highp int)
|
||||
0:? 'arrY' ( global 1-element array of highp int)
|
||||
0:? 'arrZ' ( global 4096-element array of highp int)
|
||||
0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) readonly buffer unsized 3-element array of highp float values})
|
||||
0:? 'v' ( buffer highp 4-component vector of float)
|
||||
0:? 'us2dbad' ( uniform mediump usampler2D)
|
||||
0:? 'us2d' ( uniform highp usampler2D)
|
||||
@ -516,7 +516,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'badQ1' (layout( rgba32f) coherent volatile restrict uniform highp image2D)
|
||||
0:? 'badQ2' (layout( rgba8i) coherent volatile restrict uniform highp iimage2D)
|
||||
0:? 'badQ3' (layout( rgba16ui) coherent volatile restrict uniform highp uimage2D)
|
||||
0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:? 'multio' (layout( column_major shared) buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 1-element array of highp float values})
|
||||
0:? 'inbi' ( in block{ in highp int a})
|
||||
0:? 'outbi' ( out block{ out highp int a})
|
||||
@ -571,7 +571,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'arrX' ( global 2-element array of highp int)
|
||||
0:? 'arrY' ( global 1-element array of highp int)
|
||||
0:? 'arrZ' ( global 4096-element array of highp int)
|
||||
0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) readonly buffer unsized 3-element array of highp float values})
|
||||
0:? 'v' ( buffer highp 4-component vector of float)
|
||||
0:? 'us2dbad' ( uniform mediump usampler2D)
|
||||
0:? 'us2d' ( uniform highp usampler2D)
|
||||
@ -610,7 +610,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'badQ1' (layout( rgba32f) coherent volatile restrict uniform highp image2D)
|
||||
0:? 'badQ2' (layout( rgba8i) coherent volatile restrict uniform highp iimage2D)
|
||||
0:? 'badQ3' (layout( rgba16ui) coherent volatile restrict uniform highp uimage2D)
|
||||
0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) buffer highp int value, layout( column_major shared) buffer unsized 3-element array of highp float values})
|
||||
0:? 'wo' (layout( column_major shared) writeonly buffer block{layout( column_major shared) writeonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 3-element array of highp float values})
|
||||
0:? 'multio' (layout( column_major shared) buffer block{layout( column_major shared) readonly buffer highp int value, layout( column_major shared) writeonly buffer unsized 1-element array of highp float values})
|
||||
0:? 'inbi' ( in block{ in highp int a})
|
||||
0:? 'outbi' ( out block{ out highp int a})
|
||||
|
221
Test/baseResults/310.inheritMemory.frag.out
Normal file
221
Test/baseResults/310.inheritMemory.frag.out
Normal file
@ -0,0 +1,221 @@
|
||||
310.inheritMemory.frag
|
||||
Shader version: 310
|
||||
0:? Sequence
|
||||
0:18 Function Definition: non_ro_fun(f1[10]; ( global void)
|
||||
0:18 Function Parameters:
|
||||
0:18 'buff' ( in 10-element array of mediump float)
|
||||
0:19 Function Definition: non_ro_funf(f1; ( global void)
|
||||
0:19 Function Parameters:
|
||||
0:19 'el' ( in mediump float)
|
||||
0:20 Function Definition: non_ro_funS(struct-S-f1[10]1; ( global void)
|
||||
0:20 Function Parameters:
|
||||
0:20 's' ( in structure{ global 10-element array of mediump float buff})
|
||||
0:24 Function Definition: main( ( global void)
|
||||
0:24 Function Parameters:
|
||||
0:? Sequence
|
||||
0:28 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:28 buff: direct index for structure ( global 10-element array of mediump float)
|
||||
0:28 's' ( temp structure{ global 10-element array of mediump float buff})
|
||||
0:28 Constant:
|
||||
0:28 0 (const int)
|
||||
0:29 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:29 direct index ( temp mediump float)
|
||||
0:29 buff: direct index for structure ( global 10-element array of mediump float)
|
||||
0:29 's' ( temp structure{ global 10-element array of mediump float buff})
|
||||
0:29 Constant:
|
||||
0:29 0 (const int)
|
||||
0:29 Constant:
|
||||
0:29 3 (const int)
|
||||
0:30 Function Call: non_ro_funS(struct-S-f1[10]1; ( global void)
|
||||
0:30 's' ( temp structure{ global 10-element array of mediump float buff})
|
||||
0:32 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:32 buff: direct index for structure (layout( column_major std430 offset=0) buffer 10-element array of mediump float)
|
||||
0:32 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:32 Constant:
|
||||
0:32 0 (const int)
|
||||
0:33 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:33 buff: direct index for structure ( global 10-element array of mediump float)
|
||||
0:33 s: direct index for structure (layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff})
|
||||
0:33 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:33 Constant:
|
||||
0:33 1 (const int)
|
||||
0:33 Constant:
|
||||
0:33 0 (const int)
|
||||
0:34 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:34 direct index (layout( column_major std430 offset=0) temp mediump float)
|
||||
0:34 buff: direct index for structure (layout( column_major std430 offset=0) buffer 10-element array of mediump float)
|
||||
0:34 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:34 Constant:
|
||||
0:34 0 (const int)
|
||||
0:34 Constant:
|
||||
0:34 3 (const int)
|
||||
0:35 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:35 direct index ( temp mediump float)
|
||||
0:35 buff: direct index for structure ( global 10-element array of mediump float)
|
||||
0:35 s: direct index for structure (layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff})
|
||||
0:35 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:35 Constant:
|
||||
0:35 1 (const int)
|
||||
0:35 Constant:
|
||||
0:35 0 (const int)
|
||||
0:35 Constant:
|
||||
0:35 3 (const int)
|
||||
0:36 Function Call: non_ro_funS(struct-S-f1[10]1; ( global void)
|
||||
0:36 s: direct index for structure (layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff})
|
||||
0:36 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:36 Constant:
|
||||
0:36 1 (const int)
|
||||
0:38 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:38 buff_ro: direct index for structure (layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float)
|
||||
0:38 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:38 Constant:
|
||||
0:38 0 (const int)
|
||||
0:39 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:39 buff: direct index for structure ( readonly global 10-element array of mediump float)
|
||||
0:39 s_ro: direct index for structure (layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff})
|
||||
0:39 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:39 Constant:
|
||||
0:39 1 (const int)
|
||||
0:39 Constant:
|
||||
0:39 0 (const int)
|
||||
0:40 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:40 direct index (layout( column_major std430 offset=0) readonly temp mediump float)
|
||||
0:40 buff_ro: direct index for structure (layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float)
|
||||
0:40 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:40 Constant:
|
||||
0:40 0 (const int)
|
||||
0:40 Constant:
|
||||
0:40 3 (const int)
|
||||
0:41 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:41 direct index ( readonly temp mediump float)
|
||||
0:41 buff: direct index for structure ( readonly global 10-element array of mediump float)
|
||||
0:41 s_ro: direct index for structure (layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff})
|
||||
0:41 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:41 Constant:
|
||||
0:41 1 (const int)
|
||||
0:41 Constant:
|
||||
0:41 0 (const int)
|
||||
0:41 Constant:
|
||||
0:41 3 (const int)
|
||||
0:42 Function Call: non_ro_funS(struct-S-f1[10]1; ( global void)
|
||||
0:42 s_ro: direct index for structure (layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff})
|
||||
0:42 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:42 Constant:
|
||||
0:42 1 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:? 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:? 'fragColor' ( out mediump 4-component vector of float)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 310
|
||||
0:? Sequence
|
||||
0:18 Function Definition: non_ro_fun(f1[10]; ( global void)
|
||||
0:18 Function Parameters:
|
||||
0:18 'buff' ( in 10-element array of mediump float)
|
||||
0:19 Function Definition: non_ro_funf(f1; ( global void)
|
||||
0:19 Function Parameters:
|
||||
0:19 'el' ( in mediump float)
|
||||
0:20 Function Definition: non_ro_funS(struct-S-f1[10]1; ( global void)
|
||||
0:20 Function Parameters:
|
||||
0:20 's' ( in structure{ global 10-element array of mediump float buff})
|
||||
0:24 Function Definition: main( ( global void)
|
||||
0:24 Function Parameters:
|
||||
0:? Sequence
|
||||
0:28 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:28 buff: direct index for structure ( global 10-element array of mediump float)
|
||||
0:28 's' ( temp structure{ global 10-element array of mediump float buff})
|
||||
0:28 Constant:
|
||||
0:28 0 (const int)
|
||||
0:29 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:29 direct index ( temp mediump float)
|
||||
0:29 buff: direct index for structure ( global 10-element array of mediump float)
|
||||
0:29 's' ( temp structure{ global 10-element array of mediump float buff})
|
||||
0:29 Constant:
|
||||
0:29 0 (const int)
|
||||
0:29 Constant:
|
||||
0:29 3 (const int)
|
||||
0:30 Function Call: non_ro_funS(struct-S-f1[10]1; ( global void)
|
||||
0:30 's' ( temp structure{ global 10-element array of mediump float buff})
|
||||
0:32 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:32 buff: direct index for structure (layout( column_major std430 offset=0) buffer 10-element array of mediump float)
|
||||
0:32 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:32 Constant:
|
||||
0:32 0 (const int)
|
||||
0:33 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:33 buff: direct index for structure ( global 10-element array of mediump float)
|
||||
0:33 s: direct index for structure (layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff})
|
||||
0:33 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:33 Constant:
|
||||
0:33 1 (const int)
|
||||
0:33 Constant:
|
||||
0:33 0 (const int)
|
||||
0:34 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:34 direct index (layout( column_major std430 offset=0) temp mediump float)
|
||||
0:34 buff: direct index for structure (layout( column_major std430 offset=0) buffer 10-element array of mediump float)
|
||||
0:34 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:34 Constant:
|
||||
0:34 0 (const int)
|
||||
0:34 Constant:
|
||||
0:34 3 (const int)
|
||||
0:35 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:35 direct index ( temp mediump float)
|
||||
0:35 buff: direct index for structure ( global 10-element array of mediump float)
|
||||
0:35 s: direct index for structure (layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff})
|
||||
0:35 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:35 Constant:
|
||||
0:35 1 (const int)
|
||||
0:35 Constant:
|
||||
0:35 0 (const int)
|
||||
0:35 Constant:
|
||||
0:35 3 (const int)
|
||||
0:36 Function Call: non_ro_funS(struct-S-f1[10]1; ( global void)
|
||||
0:36 s: direct index for structure (layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff})
|
||||
0:36 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:36 Constant:
|
||||
0:36 1 (const int)
|
||||
0:38 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:38 buff_ro: direct index for structure (layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float)
|
||||
0:38 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:38 Constant:
|
||||
0:38 0 (const int)
|
||||
0:39 Function Call: non_ro_fun(f1[10]; ( global void)
|
||||
0:39 buff: direct index for structure ( readonly global 10-element array of mediump float)
|
||||
0:39 s_ro: direct index for structure (layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff})
|
||||
0:39 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:39 Constant:
|
||||
0:39 1 (const int)
|
||||
0:39 Constant:
|
||||
0:39 0 (const int)
|
||||
0:40 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:40 direct index (layout( column_major std430 offset=0) readonly temp mediump float)
|
||||
0:40 buff_ro: direct index for structure (layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float)
|
||||
0:40 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:40 Constant:
|
||||
0:40 0 (const int)
|
||||
0:40 Constant:
|
||||
0:40 3 (const int)
|
||||
0:41 Function Call: non_ro_funf(f1; ( global void)
|
||||
0:41 direct index ( readonly temp mediump float)
|
||||
0:41 buff: direct index for structure ( readonly global 10-element array of mediump float)
|
||||
0:41 s_ro: direct index for structure (layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff})
|
||||
0:41 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:41 Constant:
|
||||
0:41 1 (const int)
|
||||
0:41 Constant:
|
||||
0:41 0 (const int)
|
||||
0:41 Constant:
|
||||
0:41 3 (const int)
|
||||
0:42 Function Call: non_ro_funS(struct-S-f1[10]1; ( global void)
|
||||
0:42 s_ro: direct index for structure (layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff})
|
||||
0:42 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:42 Constant:
|
||||
0:42 1 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'ro_buffer' (layout( binding=2 column_major std430) readonly buffer block{layout( column_major std430 offset=0) readonly buffer 10-element array of mediump float buff_ro, layout( column_major std430 offset=40) readonly buffer structure{ global 10-element array of mediump float buff} s_ro})
|
||||
0:? 'non_ro_buffer' (layout( binding=2 column_major std430) buffer block{layout( column_major std430 offset=0) buffer 10-element array of mediump float buff, layout( column_major std430 offset=40) buffer structure{ global 10-element array of mediump float buff} s})
|
||||
0:? 'fragColor' ( out mediump 4-component vector of float)
|
||||
|
@ -269,7 +269,7 @@ ERROR: node is still EOpNull!
|
||||
0:117 'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
|
||||
0:118 move second child to first child ( temp highp 4-component vector of float)
|
||||
0:118 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position)
|
||||
0:118 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:118 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:118 Constant:
|
||||
0:118 0 (const uint)
|
||||
0:118 Constant:
|
||||
@ -278,7 +278,7 @@ ERROR: node is still EOpNull!
|
||||
0:118 1.000000
|
||||
0:118 1.000000
|
||||
0:119 gl_PointSize: direct index for structure ( gl_PointSize highp void PointSize)
|
||||
0:119 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:119 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:119 Constant:
|
||||
0:119 1 (const uint)
|
||||
0:153 Function Definition: pfooBad( ( global void)
|
||||
@ -940,7 +940,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon})
|
||||
0:? 'aliased' (layout( location=12) smooth out highp int)
|
||||
0:? 'inbinst' ( in block{ in highp int a})
|
||||
0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:? 'smon' ( smooth out block{ out highp int i})
|
||||
0:? 'fmon' ( flat out block{ out highp int i})
|
||||
0:? 'cmon' ( centroid out block{ out highp int i})
|
||||
@ -1184,7 +1184,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon})
|
||||
0:? 'aliased' (layout( location=12) smooth out highp int)
|
||||
0:? 'inbinst' ( in block{ in highp int a})
|
||||
0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:? 'smon' ( smooth out block{ out highp int i})
|
||||
0:? 'fmon' ( flat out block{ out highp int i})
|
||||
0:? 'cmon' ( centroid out block{ out highp int i})
|
||||
|
@ -49,7 +49,7 @@ ERROR: node is still EOpNull!
|
||||
0:26 'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
|
||||
0:27 move second child to first child ( temp highp 4-component vector of float)
|
||||
0:27 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position)
|
||||
0:27 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:27 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:27 Constant:
|
||||
0:27 0 (const uint)
|
||||
0:27 Constant:
|
||||
@ -58,7 +58,7 @@ ERROR: node is still EOpNull!
|
||||
0:27 1.000000
|
||||
0:27 1.000000
|
||||
0:28 gl_PointSize: direct index for structure ( gl_PointSize highp void PointSize)
|
||||
0:28 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:28 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:28 Constant:
|
||||
0:28 1 (const uint)
|
||||
0:62 Function Definition: pfoo( ( global void)
|
||||
@ -623,7 +623,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon})
|
||||
0:? 'aliased' (layout( location=12) smooth out highp int)
|
||||
0:? 'inbinst' ( in block{ in highp int a})
|
||||
0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:? 'smon' ( smooth out block{ out highp int i})
|
||||
0:? 'fmon' ( flat out block{ out highp int i})
|
||||
0:? 'cmon' ( centroid out block{ out highp int i})
|
||||
@ -709,7 +709,7 @@ ERROR: node is still EOpNull!
|
||||
0:26 'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
|
||||
0:27 move second child to first child ( temp highp 4-component vector of float)
|
||||
0:27 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position)
|
||||
0:27 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:27 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:27 Constant:
|
||||
0:27 0 (const uint)
|
||||
0:27 Constant:
|
||||
@ -718,7 +718,7 @@ ERROR: node is still EOpNull!
|
||||
0:27 1.000000
|
||||
0:27 1.000000
|
||||
0:28 gl_PointSize: direct index for structure ( gl_PointSize highp void PointSize)
|
||||
0:28 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:28 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:28 Constant:
|
||||
0:28 1 (const uint)
|
||||
0:? Linker Objects
|
||||
@ -726,7 +726,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'anon@0' ( out block{layout( location=12) out highp int aAnon, layout( location=13) out highp 4-component vector of float vAnon})
|
||||
0:? 'aliased' (layout( location=12) smooth out highp int)
|
||||
0:? 'inbinst' ( in block{ in highp int a})
|
||||
0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position, })
|
||||
0:? 'anon@1' ( out block{ gl_Position highp 4-component vector of float Position gl_Position})
|
||||
0:? 'smon' ( smooth out block{ out highp int i})
|
||||
0:? 'fmon' ( flat out block{ out highp int i})
|
||||
0:? 'cmon' ( centroid out block{ out highp int i})
|
||||
|
@ -71,7 +71,7 @@ ERROR: node is still EOpNull!
|
||||
0:23 move second child to first child ( temp 4-component vector of float)
|
||||
0:23 'c' ( temp 4-component vector of float)
|
||||
0:23 gl_Color: direct index for structure ( in 4-component vector of float Color)
|
||||
0:23 'anon@0' ( in block{ in 4-component vector of float Color gl_Color, })
|
||||
0:23 'anon@0' ( in block{ in 4-component vector of float Color gl_Color})
|
||||
0:23 Constant:
|
||||
0:23 2 (const uint)
|
||||
0:24 move second child to first child ( temp 4-component vector of float)
|
||||
@ -93,7 +93,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'inVar' ( smooth in 4-component vector of float)
|
||||
0:? 'outVar' (layout( location=0 index=0) out 4-component vector of float)
|
||||
0:? 'varyingVar' ( smooth in 4-component vector of float)
|
||||
0:? 'anon@0' ( in block{ in 4-component vector of float Color gl_Color, })
|
||||
0:? 'anon@0' ( in block{ in 4-component vector of float Color gl_Color})
|
||||
0:? 'gl_name' ( in block{ in int gl_i})
|
||||
0:? 'start' ( const int)
|
||||
0:? 6 (const int)
|
||||
@ -158,7 +158,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'inVar' ( smooth in 4-component vector of float)
|
||||
0:? 'outVar' (layout( location=0 index=0) out 4-component vector of float)
|
||||
0:? 'varyingVar' ( smooth in 4-component vector of float)
|
||||
0:? 'anon@0' ( in block{ in 4-component vector of float Color gl_Color, })
|
||||
0:? 'anon@0' ( in block{ in 4-component vector of float Color gl_Color})
|
||||
0:? 'gl_name' ( in block{ in int gl_i})
|
||||
0:? 'start' ( const int)
|
||||
0:? 6 (const int)
|
||||
|
@ -38,12 +38,12 @@ ERROR: node is still EOpNull!
|
||||
0:30 0 (const int)
|
||||
0:31 move second child to first child ( temp float)
|
||||
0:31 gl_PointSize: direct index for structure (layout( stream=0) gl_PointSize float PointSize)
|
||||
0:31 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, })
|
||||
0:31 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize})
|
||||
0:31 Constant:
|
||||
0:31 1 (const uint)
|
||||
0:31 'p' ( temp float)
|
||||
0:33 gl_Position: direct index for structure (layout( stream=0) gl_Position void Position)
|
||||
0:33 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, })
|
||||
0:33 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize})
|
||||
0:33 Constant:
|
||||
0:33 0 (const uint)
|
||||
0:36 Function Definition: foo5( ( global float)
|
||||
@ -54,7 +54,7 @@ ERROR: node is still EOpNull!
|
||||
0:38 4.000000
|
||||
0:? Linker Objects
|
||||
0:? 'gl_in' ( in unsized 2-element array of block{ in float PointSize gl_PointSize})
|
||||
0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, })
|
||||
0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize})
|
||||
|
||||
|
||||
Linked geometry stage:
|
||||
@ -78,5 +78,5 @@ ERROR: node is still EOpNull!
|
||||
0:5 7 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'gl_in' ( in 2-element array of block{ in float PointSize gl_PointSize})
|
||||
0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize, })
|
||||
0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_PointSize float PointSize gl_PointSize})
|
||||
|
||||
|
@ -281,7 +281,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'sampb3' (layout( binding=80) uniform sampler2D)
|
||||
0:? 'sampb4' (layout( binding=31) uniform sampler2D)
|
||||
0:? 'sampb5' (layout( binding=79) uniform 2-element array of sampler2D)
|
||||
0:? 'anon@3' ( out block{ out 4-element array of float ClipDistance gl_ClipDistance, })
|
||||
0:? 'anon@3' ( out block{ out 4-element array of float ClipDistance gl_ClipDistance})
|
||||
0:? 'patchIn' ( patch in 4-component vector of float)
|
||||
0:? 'patchOut' ( smooth patch out 4-component vector of float)
|
||||
0:? 'comma0' ( temp int)
|
||||
@ -363,7 +363,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'sampb3' (layout( binding=80) uniform sampler2D)
|
||||
0:? 'sampb4' (layout( binding=31) uniform sampler2D)
|
||||
0:? 'sampb5' (layout( binding=79) uniform 2-element array of sampler2D)
|
||||
0:? 'anon@3' ( out block{ out 4-element array of float ClipDistance gl_ClipDistance, })
|
||||
0:? 'anon@3' ( out block{ out 4-element array of float ClipDistance gl_ClipDistance})
|
||||
0:? 'patchIn' ( patch in 4-component vector of float)
|
||||
0:? 'patchOut' ( smooth patch out 4-component vector of float)
|
||||
0:? 'comma0' ( temp int)
|
||||
|
@ -55,9 +55,9 @@ ERROR: node is still EOpNull!
|
||||
0:63 Function Parameters:
|
||||
0:65 Sequence
|
||||
0:65 move second child to first child ( temp float)
|
||||
0:65 direct index (layout( column_major shared) temp float)
|
||||
0:65 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of float)
|
||||
0:65 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values})
|
||||
0:65 direct index (layout( column_major shared) readonly temp float)
|
||||
0:65 values: direct index for structure (layout( column_major shared) readonly buffer unsized 3-element array of float)
|
||||
0:65 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer int value, layout( column_major shared) readonly buffer unsized 3-element array of float values})
|
||||
0:65 Constant:
|
||||
0:65 1 (const int)
|
||||
0:65 Constant:
|
||||
@ -65,8 +65,8 @@ ERROR: node is still EOpNull!
|
||||
0:65 Constant:
|
||||
0:65 4.700000
|
||||
0:66 array length ( temp int)
|
||||
0:66 values: direct index for structure (layout( column_major shared) buffer unsized 3-element array of float)
|
||||
0:66 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values})
|
||||
0:66 values: direct index for structure (layout( column_major shared) readonly buffer unsized 3-element array of float)
|
||||
0:66 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer int value, layout( column_major shared) readonly buffer unsized 3-element array of float values})
|
||||
0:66 Constant:
|
||||
0:66 1 (const int)
|
||||
0:67 Barrier ( global void)
|
||||
@ -140,7 +140,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'arrX' ( global 2-element array of int)
|
||||
0:? 'arrY' ( global 1-element array of int)
|
||||
0:? 'arrZ' ( global 4096-element array of int)
|
||||
0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values})
|
||||
0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer int value, layout( column_major shared) readonly buffer unsized 3-element array of float values})
|
||||
0:? 'roll' ( uniform double)
|
||||
0:? 'destTex' ( writeonly uniform image2D)
|
||||
0:? 'inbi' ( in block{ in int a})
|
||||
@ -201,7 +201,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'arrX' ( global 2-element array of int)
|
||||
0:? 'arrY' ( global 1-element array of int)
|
||||
0:? 'arrZ' ( global 4096-element array of int)
|
||||
0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) buffer int value, layout( column_major shared) buffer unsized 3-element array of float values})
|
||||
0:? 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer int value, layout( column_major shared) readonly buffer unsized 3-element array of float values})
|
||||
0:? 'roll' ( uniform double)
|
||||
0:? 'destTex' ( writeonly uniform image2D)
|
||||
0:? 'inbi' ( in block{ in int a})
|
||||
|
@ -78,7 +78,7 @@ ERROR: node is still EOpNull!
|
||||
0:16 move second child to first child ( temp float)
|
||||
0:16 direct index ( temp float ClipDistance)
|
||||
0:16 gl_ClipDistance: direct index for structure ( out 17-element array of float ClipDistance)
|
||||
0:16 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance, })
|
||||
0:16 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance})
|
||||
0:16 Constant:
|
||||
0:16 2 (const uint)
|
||||
0:16 Constant:
|
||||
@ -206,7 +206,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'uv4' (layout( location=4) uniform 4-component vector of float)
|
||||
0:? 'b1' (layout( location=2) in block{ in 4-component vector of float v})
|
||||
0:? 'b2' (layout( location=2) out block{ out 4-component vector of float v})
|
||||
0:? 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance, })
|
||||
0:? 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance})
|
||||
0:? 'cs' (layout( location=10) smooth out 2-element array of structure{ global 7-element array of 3X2 matrix of float m, global float f})
|
||||
0:? 'cf' (layout( location=54) smooth out float)
|
||||
0:? 'cg' (layout( location=53) smooth out float)
|
||||
@ -281,7 +281,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'uv4' (layout( location=4) uniform 4-component vector of float)
|
||||
0:? 'b1' (layout( location=2) in block{ in 4-component vector of float v})
|
||||
0:? 'b2' (layout( location=2) out block{ out 4-component vector of float v})
|
||||
0:? 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance, })
|
||||
0:? 'anon@0' ( out block{ out 17-element array of float ClipDistance gl_ClipDistance})
|
||||
0:? 'cs' (layout( location=10) smooth out 2-element array of structure{ global 7-element array of 3X2 matrix of float m, global float f})
|
||||
0:? 'cf' (layout( location=54) smooth out float)
|
||||
0:? 'cg' (layout( location=53) smooth out float)
|
||||
|
@ -156,7 +156,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s})
|
||||
0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float)
|
||||
0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f})
|
||||
0:? 'anon@0' ( out block{layout( xfb_buffer=3 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=3 xfb_offset=32) gl_PointSize float PointSize gl_PointSize, })
|
||||
0:? 'anon@0' ( out block{layout( xfb_buffer=3 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=3 xfb_offset=32) gl_PointSize float PointSize gl_PointSize})
|
||||
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
|
||||
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
|
||||
|
||||
@ -241,7 +241,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'bbinst9' ( out block{layout( xfb_buffer=4 xfb_offset=1) out bool b, layout( xfb_buffer=4 xfb_offset=12) out structure{ global bool b, global structure{ global int i, global double d, global float f} s, global 2-component vector of float v2} t, layout( xfb_buffer=4 xfb_offset=52) out 3X3 matrix of float m3, layout( xfb_buffer=4 xfb_offset=90) out int i, layout( xfb_buffer=4 xfb_offset=98) out double d, layout( xfb_buffer=4 xfb_offset=108) out structure{ global int a} s})
|
||||
0:? 'bm' (layout( xfb_buffer=5 xfb_offset=0) smooth out float)
|
||||
0:? 'bbinst10' ( out block{layout( xfb_buffer=7 xfb_offset=0) out 4X4 matrix of double m1, layout( xfb_buffer=7 xfb_offset=128) out 4X4 matrix of double m2, layout( xfb_buffer=7 xfb_offset=256) out float f})
|
||||
0:? 'anon@0' ( out block{layout( xfb_buffer=3 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=3 xfb_offset=32) gl_PointSize float PointSize gl_PointSize, })
|
||||
0:? 'anon@0' ( out block{layout( xfb_buffer=3 xfb_offset=36) gl_Position 4-component vector of float Position gl_Position, layout( xfb_buffer=3 xfb_offset=32) gl_PointSize float PointSize gl_PointSize})
|
||||
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
|
||||
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
|
||||
|
||||
|
@ -1,6 +1,25 @@
|
||||
glspv.esversion.vert
|
||||
ERROR: #version: ES shaders for OpenGL SPIR-V are not supported
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 10
|
||||
|
||||
|
||||
SPIR-V is not generated for failed compile or link
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main" 8 9
|
||||
Source ESSL 310
|
||||
Name 4 "main"
|
||||
Name 8 "gl_VertexID"
|
||||
Name 9 "gl_InstanceID"
|
||||
Decorate 8(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 9(gl_InstanceID) BuiltIn InstanceId
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7: TypePointer Input 6(int)
|
||||
8(gl_VertexID): 7(ptr) Variable Input
|
||||
9(gl_InstanceID): 7(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
Return
|
||||
FunctionEnd
|
||||
|
@ -2,12 +2,14 @@ glspv.vert
|
||||
ERROR: 0:3: 'push_constant' : only allowed when using GLSL for Vulkan
|
||||
ERROR: 0:6: 'descriptor set' : only allowed when using GLSL for Vulkan
|
||||
ERROR: 0:8: 'shared' : not allowed when generating SPIR-V
|
||||
ERROR: 0:8: 'binding' : uniform/buffer blocks require layout(binding=X)
|
||||
ERROR: 0:9: 'packed' : not allowed when generating SPIR-V
|
||||
ERROR: 0:9: 'binding' : uniform/buffer blocks require layout(binding=X)
|
||||
ERROR: 0:13: 'gl_VertexIndex' : undeclared identifier
|
||||
ERROR: 0:14: 'gl_InstanceIndex' : undeclared identifier
|
||||
ERROR: 0:17: 'gl_DepthRangeParameters' : undeclared identifier
|
||||
ERROR: 0:20: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
|
||||
ERROR: 8 compilation errors. No code generated.
|
||||
ERROR: 10 compilation errors. No code generated.
|
||||
|
||||
|
||||
SPIR-V is not generated for failed compile or link
|
||||
|
@ -58,8 +58,8 @@ using depth_greater
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction" 18
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
ExecutionMode 4 DepthGreater
|
||||
ExecutionMode 4 DepthReplacing
|
||||
ExecutionMode 4 DepthGreater
|
||||
Source HLSL 500
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 10 "@PixelShaderFunction(f1;"
|
||||
|
@ -50,8 +50,8 @@ using depth_less
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction" 14
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
ExecutionMode 4 DepthLess
|
||||
ExecutionMode 4 DepthReplacing
|
||||
ExecutionMode 4 DepthLess
|
||||
Source HLSL 500
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 8 "@PixelShaderFunction("
|
||||
|
@ -170,8 +170,8 @@ using depth_greater
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 22 27 31 36 45 48 51 55
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
ExecutionMode 4 DepthGreater
|
||||
ExecutionMode 4 DepthReplacing
|
||||
ExecutionMode 4 DepthGreater
|
||||
Source HLSL 500
|
||||
Name 4 "main"
|
||||
Name 8 "T"
|
||||
|
@ -42,8 +42,8 @@ gl_FragCoord origin is upper left
|
||||
0:? 'b' ( global 5-element array of highp int)
|
||||
0:? 'c' ( global unsized 4-element array of highp int)
|
||||
0:? 'i' ( global highp int)
|
||||
0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r})
|
||||
0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float m})
|
||||
0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r})
|
||||
0:? 'anon@1' (layout( binding=1 column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float m})
|
||||
|
||||
link2.vk.frag
|
||||
Shader version: 450
|
||||
@ -99,8 +99,8 @@ gl_FragCoord origin is upper left
|
||||
0:? 'b' ( global unsized 3-element array of highp int)
|
||||
0:? 'c' ( global 7-element array of highp int)
|
||||
0:? 'i' ( global highp int)
|
||||
0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r})
|
||||
0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer 4-element array of highp float m})
|
||||
0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r})
|
||||
0:? 'anon@1' (layout( binding=1 column_major std430) buffer block{layout( column_major std430) buffer 4-element array of highp float m})
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
@ -192,8 +192,8 @@ gl_FragCoord origin is upper left
|
||||
0:? 'b' ( global 5-element array of highp int)
|
||||
0:? 'c' ( global 7-element array of highp int)
|
||||
0:? 'i' ( global highp int)
|
||||
0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r})
|
||||
0:? 'anon@1' (layout( column_major std430) buffer block{layout( column_major std430) buffer 4-element array of highp float m})
|
||||
0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430) buffer unsized 1-element array of highp float r})
|
||||
0:? 'anon@1' (layout( binding=1 column_major std430) buffer block{layout( column_major std430) buffer 4-element array of highp float m})
|
||||
0:? 's2D' (layout( binding=1) uniform highp sampler2D)
|
||||
|
||||
// Module Version 10000
|
||||
@ -233,7 +233,7 @@ gl_FragCoord origin is upper left
|
||||
MemberDecorate 67(bnameImplicit) 0 Offset 0
|
||||
Decorate 67(bnameImplicit) BufferBlock
|
||||
Decorate 69 DescriptorSet 0
|
||||
Decorate 69 Binding 0
|
||||
Decorate 69 Binding 1
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
|
@ -51,10 +51,15 @@ MultipleArrays.tri[0].v[2].normal[0]: offset 60, type 1406, size 3, index 1, bin
|
||||
MultipleArrays.vert[0].position[0]: offset 360, type 1406, size 3, index 1, binding -1, stages 1, arrayStride 4, topLevelArrayStride 24
|
||||
MultipleArrays.vert[0].normal[0]: offset 372, type 1406, size 3, index 1, binding -1, stages 0, arrayStride 4, topLevelArrayStride 24
|
||||
MultipleArrays.f[0]: offset 480, type 1406, size 5, index 1, binding -1, stages 1, arrayStride 4, topLevelArrayStride 4
|
||||
ArrayedBind[0].a: offset 0, type 1406, size 1, index 4, binding -1, stages 0
|
||||
ArrayedBind[0].b: offset 4, type 1406, size 1, index 4, binding -1, stages 1
|
||||
|
||||
Buffer block reflection:
|
||||
VertexCollection: offset -1, type ffffffff, size 400, index -1, binding -1, stages 1, numMembers 7
|
||||
MultipleArrays: offset -1, type ffffffff, size 500, index -1, binding -1, stages 1, numMembers 9
|
||||
ArrayedBind[0]: offset -1, type ffffffff, size 8, index -1, binding -1, stages 1, numMembers 2
|
||||
ArrayedBind[1]: offset -1, type ffffffff, size 8, index -1, binding -1, stages 1, numMembers 2
|
||||
ArrayedBind[2]: offset -1, type ffffffff, size 8, index -1, binding -1, stages 1, numMembers 2
|
||||
|
||||
Pipeline input reflection:
|
||||
gl_InstanceID: offset 0, type 1404, size 1, index 0, binding -1, stages 1
|
||||
|
1
Test/baseResults/size
Normal file
1
Test/baseResults/size
Normal file
@ -0,0 +1 @@
|
||||
388096 ../build/install/bin/glslangValidator.exe
|
@ -307,7 +307,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'c' ( in 4-component vector of float)
|
||||
0:? 'd' ( in 4-component vector of float)
|
||||
0:? 'v' ( noContraction smooth out 4-component vector of float)
|
||||
0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2})
|
||||
0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1, layout( column_major shared) coherent buffer 4-component vector of float member2})
|
||||
0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A})
|
||||
0:? 'shv' ( shared 4-component vector of float)
|
||||
0:? 'img1' (layout( rgba32f) uniform image2D)
|
||||
@ -590,7 +590,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'c' ( in 4-component vector of float)
|
||||
0:? 'd' ( in 4-component vector of float)
|
||||
0:? 'v' ( noContraction smooth out 4-component vector of float)
|
||||
0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2})
|
||||
0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1, layout( column_major shared) coherent buffer 4-component vector of float member2})
|
||||
0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A})
|
||||
0:? 'shv' ( shared 4-component vector of float)
|
||||
0:? 'img1' (layout( rgba32f) uniform image2D)
|
||||
|
@ -308,7 +308,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'c' ( in 4-component vector of float)
|
||||
0:? 'd' ( in 4-component vector of float)
|
||||
0:? 'v' ( noContraction smooth out 4-component vector of float)
|
||||
0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2})
|
||||
0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1, layout( column_major shared) coherent buffer 4-component vector of float member2})
|
||||
0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A})
|
||||
0:? 'shv' ( shared 4-component vector of float)
|
||||
0:? 'img1' (layout( rgba32f) uniform image2D)
|
||||
@ -591,7 +591,7 @@ ERROR: node is still EOpNull!
|
||||
0:? 'c' ( in 4-component vector of float)
|
||||
0:? 'd' ( in 4-component vector of float)
|
||||
0:? 'v' ( noContraction smooth out 4-component vector of float)
|
||||
0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) readonly buffer 4-component vector of float member1, layout( column_major shared) buffer 4-component vector of float member2})
|
||||
0:? 'anon@6' (layout( column_major shared) coherent buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1, layout( column_major shared) coherent buffer 4-component vector of float member2})
|
||||
0:? 'anon@7' (layout( column_major shared) buffer block{layout( column_major shared) coherent readonly buffer 4-component vector of float member1A, layout( column_major shared) coherent buffer 4-component vector of float member2A})
|
||||
0:? 'shv' ( shared 4-component vector of float)
|
||||
0:? 'img1' (layout( rgba32f) uniform image2D)
|
||||
|
62
Test/baseResults/spv.1.4.constructComposite.comp.out
Normal file
62
Test/baseResults/spv.1.4.constructComposite.comp.out
Normal file
@ -0,0 +1,62 @@
|
||||
spv.1.4.constructComposite.comp
|
||||
// Module Version 10400
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 27
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint GLCompute 4 "main" 10 15
|
||||
ExecutionMode 4 LocalSize 64 1 1
|
||||
Source GLSL 460
|
||||
Name 4 "main"
|
||||
Name 7 "sA"
|
||||
MemberName 7(sA) 0 "x"
|
||||
MemberName 7(sA) 1 "y"
|
||||
Name 8 "sC"
|
||||
MemberName 8(sC) 0 "state"
|
||||
Name 10 "c"
|
||||
Name 11 "sA"
|
||||
MemberName 11(sA) 0 "x"
|
||||
MemberName 11(sA) 1 "y"
|
||||
Name 12 "sB"
|
||||
MemberName 12(sB) 0 "a"
|
||||
Name 13 "ubo"
|
||||
MemberName 13(ubo) 0 "b"
|
||||
Name 15 ""
|
||||
MemberDecorate 11(sA) 0 Offset 0
|
||||
MemberDecorate 11(sA) 1 Offset 4
|
||||
MemberDecorate 12(sB) 0 Offset 0
|
||||
MemberDecorate 13(ubo) 0 Offset 0
|
||||
Decorate 13(ubo) Block
|
||||
Decorate 15 DescriptorSet 0
|
||||
Decorate 15 Binding 0
|
||||
Decorate 26 BuiltIn WorkgroupSize
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7(sA): TypeStruct 6(int) 6(int)
|
||||
8(sC): TypeStruct 7(sA)
|
||||
9: TypePointer Private 8(sC)
|
||||
10(c): 9(ptr) Variable Private
|
||||
11(sA): TypeStruct 6(int) 6(int)
|
||||
12(sB): TypeStruct 11(sA)
|
||||
13(ubo): TypeStruct 12(sB)
|
||||
14: TypePointer Uniform 13(ubo)
|
||||
15: 14(ptr) Variable Uniform
|
||||
16: 6(int) Constant 0
|
||||
17: TypePointer Uniform 11(sA)
|
||||
22: TypeInt 32 0
|
||||
23: TypeVector 22(int) 3
|
||||
24: 22(int) Constant 64
|
||||
25: 22(int) Constant 1
|
||||
26: 23(ivec3) ConstantComposite 24 25 25
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
18: 17(ptr) AccessChain 15 16 16
|
||||
19: 11(sA) Load 18
|
||||
20: 7(sA) CopyLogical 19
|
||||
21: 8(sC) CompositeConstruct 20
|
||||
Store 10(c) 21
|
||||
Return
|
||||
FunctionEnd
|
64
Test/baseResults/spv.constructComposite.comp.out
Normal file
64
Test/baseResults/spv.constructComposite.comp.out
Normal file
@ -0,0 +1,64 @@
|
||||
spv.constructComposite.comp
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 29
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint GLCompute 4 "main"
|
||||
ExecutionMode 4 LocalSize 64 1 1
|
||||
Source GLSL 460
|
||||
Name 4 "main"
|
||||
Name 7 "sA"
|
||||
MemberName 7(sA) 0 "x"
|
||||
MemberName 7(sA) 1 "y"
|
||||
Name 8 "sC"
|
||||
MemberName 8(sC) 0 "state"
|
||||
Name 10 "c"
|
||||
Name 11 "sA"
|
||||
MemberName 11(sA) 0 "x"
|
||||
MemberName 11(sA) 1 "y"
|
||||
Name 12 "sB"
|
||||
MemberName 12(sB) 0 "a"
|
||||
Name 13 "ubo"
|
||||
MemberName 13(ubo) 0 "b"
|
||||
Name 15 ""
|
||||
MemberDecorate 11(sA) 0 Offset 0
|
||||
MemberDecorate 11(sA) 1 Offset 4
|
||||
MemberDecorate 12(sB) 0 Offset 0
|
||||
MemberDecorate 13(ubo) 0 Offset 0
|
||||
Decorate 13(ubo) Block
|
||||
Decorate 15 DescriptorSet 0
|
||||
Decorate 15 Binding 0
|
||||
Decorate 28 BuiltIn WorkgroupSize
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7(sA): TypeStruct 6(int) 6(int)
|
||||
8(sC): TypeStruct 7(sA)
|
||||
9: TypePointer Private 8(sC)
|
||||
10(c): 9(ptr) Variable Private
|
||||
11(sA): TypeStruct 6(int) 6(int)
|
||||
12(sB): TypeStruct 11(sA)
|
||||
13(ubo): TypeStruct 12(sB)
|
||||
14: TypePointer Uniform 13(ubo)
|
||||
15: 14(ptr) Variable Uniform
|
||||
16: 6(int) Constant 0
|
||||
17: TypePointer Uniform 11(sA)
|
||||
24: TypeInt 32 0
|
||||
25: TypeVector 24(int) 3
|
||||
26: 24(int) Constant 64
|
||||
27: 24(int) Constant 1
|
||||
28: 25(ivec3) ConstantComposite 26 27 27
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
18: 17(ptr) AccessChain 15 16 16
|
||||
19: 11(sA) Load 18
|
||||
20: 6(int) CompositeExtract 19 0
|
||||
21: 6(int) CompositeExtract 19 1
|
||||
22: 7(sA) CompositeConstruct 20 21
|
||||
23: 8(sC) CompositeConstruct 22
|
||||
Store 10(c) 23
|
||||
Return
|
||||
FunctionEnd
|
@ -282,7 +282,7 @@ spv.coopmat.comp
|
||||
101: 100(ptr) AccessChain 91(block16) 99
|
||||
102: 85(ptr) Load 101 MakePointerVisibleKHR NonPrivatePointerKHR 71
|
||||
104: 103(ptr) AccessChain 102 58 31
|
||||
105: 32 CooperativeMatrixLoadNV 104 74 76 Aligned 16
|
||||
105: 32 CooperativeMatrixLoadNV 104 74 76 Aligned MakePointerVisibleKHR NonPrivatePointerKHR 16 71
|
||||
Store 98(tempArg) 105
|
||||
106: 32 Load 98(tempArg)
|
||||
Store 34(m) 106
|
||||
@ -290,7 +290,7 @@ spv.coopmat.comp
|
||||
108: 100(ptr) AccessChain 91(block16) 99
|
||||
109: 85(ptr) Load 108 MakePointerVisibleKHR NonPrivatePointerKHR 71
|
||||
110: 103(ptr) AccessChain 109 58 31
|
||||
CooperativeMatrixStoreNV 110 107 74 76 Aligned 16
|
||||
CooperativeMatrixStoreNV 110 107 74 76 Aligned MakePointerAvailableKHR NonPrivatePointerKHR 16 71
|
||||
113: 50 Load 112(A)
|
||||
115: 10 Load 114(B)
|
||||
117: 32 Load 116(C)
|
||||
|
@ -81,6 +81,7 @@ void main()
|
||||
Name 97 "i"
|
||||
ModuleProcessed "no-storage-format"
|
||||
ModuleProcessed "resource-set-binding 3"
|
||||
ModuleProcessed "auto-map-bindings"
|
||||
ModuleProcessed "auto-map-locations"
|
||||
ModuleProcessed "client opengl100"
|
||||
ModuleProcessed "target-env spirv1.3"
|
||||
@ -99,7 +100,7 @@ void main()
|
||||
Decorate 56 Binding 0
|
||||
Decorate 67(s2d) Location 0
|
||||
Decorate 67(s2d) DescriptorSet 3
|
||||
Decorate 67(s2d) Binding 0
|
||||
Decorate 67(s2d) Binding 1
|
||||
3: TypeVoid
|
||||
4: TypeFunction 3
|
||||
7: TypeInt 32 1
|
||||
|
@ -8,8 +8,8 @@ spv.depthOut.frag
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 8 10 14
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
ExecutionMode 4 DepthGreater
|
||||
ExecutionMode 4 DepthReplacing
|
||||
ExecutionMode 4 DepthGreater
|
||||
Source GLSL 450
|
||||
Name 4 "main"
|
||||
Name 8 "gl_FragDepth"
|
||||
|
@ -15,12 +15,12 @@ spv.hlslDebugInfo.vert
|
||||
// OpModuleProcessed shift-UBO-binding 6
|
||||
// OpModuleProcessed shift-ssbo-binding 3
|
||||
// OpModuleProcessed shift-uav-binding 5
|
||||
// OpModuleProcessed flatten-uniform-arrays
|
||||
// OpModuleProcessed no-storage-format
|
||||
// OpModuleProcessed resource-set-binding t0 0 0
|
||||
// OpModuleProcessed hlsl-iomap
|
||||
// OpModuleProcessed auto-map-bindings
|
||||
// OpModuleProcessed auto-map-locations
|
||||
// OpModuleProcessed flatten-uniform-arrays
|
||||
// OpModuleProcessed hlsl-iomap
|
||||
// OpModuleProcessed client vulkan100
|
||||
// OpModuleProcessed target-env vulkan1.0
|
||||
// OpModuleProcessed source-entrypoint origMain
|
||||
|
@ -4,7 +4,7 @@ Shader version: 450
|
||||
0:27 Function Definition: main( ( global void)
|
||||
0:27 Function Parameters:
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer highp float m0, layout( column_major std430) buffer highp 3-component vector of float m4, layout( column_major std430) buffer highp float m16, layout( column_major std430 offset=20) buffer highp 3-component vector of float m20, layout( column_major std430) buffer highp 3-component vector of float m32, layout( column_major std430) buffer highp 2-component vector of float m48, layout( column_major std430) buffer highp 2-component vector of float m56, layout( column_major std430) buffer highp float m64, layout( column_major std430) buffer highp 2-component vector of float m68, layout( column_major std430) buffer highp float m76, layout( column_major std430) buffer highp float m80, layout( column_major std430 offset=88) buffer highp 2-component vector of float m88, layout( column_major std430) buffer highp 2-component vector of float m96, layout( column_major std430) buffer 2-component vector of double m112})
|
||||
0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430) buffer highp float m0, layout( column_major std430) buffer highp 3-component vector of float m4, layout( column_major std430) buffer highp float m16, layout( column_major std430 offset=20) buffer highp 3-component vector of float m20, layout( column_major std430) buffer highp 3-component vector of float m32, layout( column_major std430) buffer highp 2-component vector of float m48, layout( column_major std430) buffer highp 2-component vector of float m56, layout( column_major std430) buffer highp float m64, layout( column_major std430) buffer highp 2-component vector of float m68, layout( column_major std430) buffer highp float m76, layout( column_major std430) buffer highp float m80, layout( column_major std430 offset=88) buffer highp 2-component vector of float m88, layout( column_major std430) buffer highp 2-component vector of float m96, layout( column_major std430) buffer 2-component vector of double m112})
|
||||
|
||||
|
||||
Linked vertex stage:
|
||||
@ -15,7 +15,7 @@ Shader version: 450
|
||||
0:27 Function Definition: main( ( global void)
|
||||
0:27 Function Parameters:
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout( column_major std430) buffer block{layout( column_major std430) buffer highp float m0, layout( column_major std430) buffer highp 3-component vector of float m4, layout( column_major std430) buffer highp float m16, layout( column_major std430 offset=20) buffer highp 3-component vector of float m20, layout( column_major std430) buffer highp 3-component vector of float m32, layout( column_major std430) buffer highp 2-component vector of float m48, layout( column_major std430) buffer highp 2-component vector of float m56, layout( column_major std430) buffer highp float m64, layout( column_major std430) buffer highp 2-component vector of float m68, layout( column_major std430) buffer highp float m76, layout( column_major std430) buffer highp float m80, layout( column_major std430 offset=88) buffer highp 2-component vector of float m88, layout( column_major std430) buffer highp 2-component vector of float m96, layout( column_major std430) buffer 2-component vector of double m112})
|
||||
0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430) buffer highp float m0, layout( column_major std430) buffer highp 3-component vector of float m4, layout( column_major std430) buffer highp float m16, layout( column_major std430 offset=20) buffer highp 3-component vector of float m20, layout( column_major std430) buffer highp 3-component vector of float m32, layout( column_major std430) buffer highp 2-component vector of float m48, layout( column_major std430) buffer highp 2-component vector of float m56, layout( column_major std430) buffer highp float m64, layout( column_major std430) buffer highp 2-component vector of float m68, layout( column_major std430) buffer highp float m76, layout( column_major std430) buffer highp float m80, layout( column_major std430 offset=88) buffer highp 2-component vector of float m88, layout( column_major std430) buffer highp 2-component vector of float m96, layout( column_major std430) buffer 2-component vector of double m112})
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
|
418
Test/baseResults/spv.intcoopmat.comp.out
Normal file
418
Test/baseResults/spv.intcoopmat.comp.out
Normal file
@ -0,0 +1,418 @@
|
||||
spv.intcoopmat.comp
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 262
|
||||
|
||||
Capability Shader
|
||||
Capability Float16
|
||||
Capability Int8
|
||||
Capability StorageBuffer8BitAccess
|
||||
Capability VulkanMemoryModelKHR
|
||||
Capability PhysicalStorageBufferAddressesEXT
|
||||
Capability CooperativeMatrixNV
|
||||
Extension "SPV_EXT_physical_storage_buffer"
|
||||
Extension "SPV_KHR_8bit_storage"
|
||||
Extension "SPV_KHR_storage_buffer_storage_class"
|
||||
Extension "SPV_KHR_vulkan_memory_model"
|
||||
Extension "SPV_NV_cooperative_matrix"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel PhysicalStorageBuffer64EXT VulkanKHR
|
||||
EntryPoint GLCompute 4 "main"
|
||||
ExecutionMode 4 LocalSize 64 1 1
|
||||
Source GLSL 450
|
||||
SourceExtension "GL_EXT_buffer_reference"
|
||||
SourceExtension "GL_EXT_shader_explicit_arithmetic_types"
|
||||
SourceExtension "GL_KHR_memory_scope_semantics"
|
||||
SourceExtension "GL_NV_cooperative_matrix"
|
||||
SourceExtension "GL_NV_integer_cooperative_matrix"
|
||||
Name 4 "main"
|
||||
Name 14 "ineg(i81;"
|
||||
Name 13 "m"
|
||||
Name 21 "umul(u81;"
|
||||
Name 20 "m"
|
||||
Name 35 "mu"
|
||||
Name 39 "mi"
|
||||
Name 55 "mf16_0"
|
||||
Name 61 "mf32_0"
|
||||
Name 64 "mf16_1"
|
||||
Name 67 "mf32_1"
|
||||
Name 71 "x"
|
||||
Name 81 "tempArg"
|
||||
Name 85 "Block"
|
||||
MemberName 85(Block) 0 "y"
|
||||
MemberName 85(Block) 1 "x"
|
||||
Name 87 "block"
|
||||
Name 98 "tempArg"
|
||||
Name 103 "Block16"
|
||||
MemberName 103(Block16) 0 "y"
|
||||
MemberName 103(Block16) 1 "x"
|
||||
MemberName 103(Block16) 2 "b"
|
||||
Name 106 "Block"
|
||||
MemberName 106(Block) 0 "y"
|
||||
MemberName 106(Block) 1 "x"
|
||||
Name 108 "block8"
|
||||
Name 115 "tempArg"
|
||||
Name 128 "D"
|
||||
Name 129 "A"
|
||||
Name 131 "B"
|
||||
Name 133 "C"
|
||||
Name 137 "l"
|
||||
Name 142 "a"
|
||||
Name 146 "md1"
|
||||
Name 156 "Y"
|
||||
Name 157 "Z"
|
||||
Name 161 "muC2"
|
||||
Name 169 "miC2"
|
||||
Name 176 "tempArg"
|
||||
Name 182 "tempArg"
|
||||
Name 188 "p1"
|
||||
Name 189 "param"
|
||||
Name 192 "p2"
|
||||
Name 193 "param"
|
||||
Name 207 "tempArg"
|
||||
Name 212 "shmatrix"
|
||||
Name 217 "ms"
|
||||
Name 225 "miC"
|
||||
Name 226 "muC"
|
||||
Name 231 "iarr"
|
||||
Name 236 "iarr2"
|
||||
Name 241 "uarr"
|
||||
Name 246 "uarr2"
|
||||
Name 251 "S"
|
||||
MemberName 251(S) 0 "a"
|
||||
MemberName 251(S) 1 "b"
|
||||
MemberName 251(S) 2 "c"
|
||||
Name 256 "SC"
|
||||
Name 261 "scm"
|
||||
Decorate 83 ArrayStride 4
|
||||
Decorate 84 ArrayStride 4
|
||||
MemberDecorate 85(Block) 0 Offset 0
|
||||
MemberDecorate 85(Block) 1 Offset 4194304
|
||||
Decorate 85(Block) Block
|
||||
Decorate 87(block) DescriptorSet 0
|
||||
Decorate 87(block) Binding 0
|
||||
Decorate 99 ArrayStride 1
|
||||
Decorate 101 ArrayStride 1
|
||||
MemberDecorate 103(Block16) 0 Offset 0
|
||||
MemberDecorate 103(Block16) 1 Offset 1048576
|
||||
MemberDecorate 103(Block16) 2 Offset 1048584
|
||||
Decorate 103(Block16) Block
|
||||
Decorate 104 ArrayStride 4
|
||||
Decorate 105 ArrayStride 4
|
||||
MemberDecorate 106(Block) 0 Offset 0
|
||||
MemberDecorate 106(Block) 1 Offset 4194304
|
||||
Decorate 106(Block) Block
|
||||
Decorate 108(block8) DescriptorSet 0
|
||||
Decorate 108(block8) Binding 0
|
||||
Decorate 156(Y) SpecId 0
|
||||
Decorate 223 BuiltIn WorkgroupSize
|
||||
Decorate 256(SC) SpecId 2
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 8 1
|
||||
7: TypeInt 32 0
|
||||
8: 7(int) Constant 3
|
||||
9: 7(int) Constant 8
|
||||
10: TypeCooperativeMatrixNV 6(int8_t) 8 9 9
|
||||
11: TypePointer Function 10
|
||||
12: TypeFunction 10 11(ptr)
|
||||
16: TypeInt 8 0
|
||||
17: TypeCooperativeMatrixNV 16(int8_t) 8 9 9
|
||||
18: TypePointer Function 17
|
||||
19: TypeFunction 17 18(ptr)
|
||||
28: 16(int8_t) Constant 2
|
||||
32: 7(int) Constant 16
|
||||
33: TypeCooperativeMatrixNV 16(int8_t) 8 32 9
|
||||
34: TypePointer Function 33
|
||||
36: 33 ConstantComposite 28
|
||||
37: TypeCooperativeMatrixNV 6(int8_t) 8 32 9
|
||||
38: TypePointer Function 37
|
||||
40: 6(int8_t) Constant 2
|
||||
41: 37 ConstantComposite 40
|
||||
52: TypeFloat 16
|
||||
53: TypeCooperativeMatrixNV 52(float16_t) 8 32 9
|
||||
54: TypePointer Function 53
|
||||
58: TypeFloat 32
|
||||
59: TypeCooperativeMatrixNV 58(float) 8 32 9
|
||||
60: TypePointer Function 59
|
||||
70: TypePointer Function 16(int8_t)
|
||||
72: TypeInt 32 1
|
||||
73: 72(int) Constant 1
|
||||
76: 72(int) Constant 0
|
||||
79: TypePointer Function 6(int8_t)
|
||||
82: 7(int) Constant 1048576
|
||||
83: TypeArray 7(int) 82
|
||||
84: TypeRuntimeArray 7(int)
|
||||
85(Block): TypeStruct 83 84
|
||||
86: TypePointer StorageBuffer 85(Block)
|
||||
87(block): 86(ptr) Variable StorageBuffer
|
||||
88: 7(int) Constant 5
|
||||
89: TypePointer StorageBuffer 7(int)
|
||||
91: 7(int) Constant 128
|
||||
92: TypeBool
|
||||
93: 92(bool) ConstantFalse
|
||||
99: TypeArray 6(int8_t) 82
|
||||
100: 7(int) Constant 1
|
||||
101: TypeArray 6(int8_t) 100
|
||||
TypeForwardPointer 102 PhysicalStorageBufferEXT
|
||||
103(Block16): TypeStruct 99 101 102
|
||||
104: TypeArray 7(int) 82
|
||||
105: TypeRuntimeArray 7(int)
|
||||
106(Block): TypeStruct 104 105
|
||||
102: TypePointer PhysicalStorageBufferEXT 106(Block)
|
||||
107: TypePointer StorageBuffer 103(Block16)
|
||||
108(block8): 107(ptr) Variable StorageBuffer
|
||||
109: TypePointer StorageBuffer 6(int8_t)
|
||||
116: 72(int) Constant 2
|
||||
117: TypePointer StorageBuffer 102(ptr)
|
||||
120: TypePointer PhysicalStorageBufferEXT 7(int)
|
||||
136: TypePointer Function 72(int)
|
||||
138: 7(int) SpecConstantOp 5362 33
|
||||
139: 72(int) SpecConstantOp 128 138 76
|
||||
140: TypeArray 37 88
|
||||
141: TypePointer Function 140
|
||||
143: 72(int) Constant 3
|
||||
144: 6(int8_t) Constant 1
|
||||
150: 72(int) Constant 1234
|
||||
155: 72(int) Constant 8
|
||||
156(Y): 72(int) SpecConstant 2
|
||||
157(Z): 72(int) SpecConstantOp 132 155 156(Y)
|
||||
158: TypeCooperativeMatrixNV 16(int8_t) 8 157(Z) 9
|
||||
159: TypeArray 158 8
|
||||
160: TypePointer Private 159
|
||||
161(muC2): 160(ptr) Variable Private
|
||||
162: TypePointer Private 158
|
||||
166: TypeCooperativeMatrixNV 6(int8_t) 8 157(Z) 9
|
||||
167: TypeArray 166 8
|
||||
168: TypePointer Private 167
|
||||
169(miC2): 168(ptr) Variable Private
|
||||
170: TypePointer Private 6(int8_t)
|
||||
174: TypePointer Private 16(int8_t)
|
||||
204: 16(int8_t) Constant 4
|
||||
208: TypeVector 7(int) 4
|
||||
209: 7(int) Constant 32
|
||||
210: TypeArray 208(ivec4) 209
|
||||
211: TypePointer Workgroup 210
|
||||
212(shmatrix): 211(ptr) Variable Workgroup
|
||||
213: 7(int) Constant 2
|
||||
214: TypePointer Workgroup 208(ivec4)
|
||||
221: TypeVector 7(int) 3
|
||||
222: 7(int) Constant 64
|
||||
223: 221(ivec3) ConstantComposite 222 100 100
|
||||
224: TypePointer Private 166
|
||||
225(miC): 224(ptr) Variable Private
|
||||
226(muC): 162(ptr) Variable Private
|
||||
227: 7(int) SpecConstantOp 5362 166
|
||||
228: 72(int) SpecConstantOp 128 227 76
|
||||
229: TypeArray 72(int) 228
|
||||
230: TypePointer Private 229
|
||||
231(iarr): 230(ptr) Variable Private
|
||||
232: 7(int) SpecConstantOp 5362 166
|
||||
233: 72(int) SpecConstantOp 128 232 76
|
||||
234: TypeArray 72(int) 233
|
||||
235: TypePointer Private 234
|
||||
236(iarr2): 235(ptr) Variable Private
|
||||
237: 7(int) SpecConstantOp 5362 158
|
||||
238: 72(int) SpecConstantOp 128 237 76
|
||||
239: TypeArray 72(int) 238
|
||||
240: TypePointer Private 239
|
||||
241(uarr): 240(ptr) Variable Private
|
||||
242: 7(int) SpecConstantOp 5362 158
|
||||
243: 72(int) SpecConstantOp 128 242 76
|
||||
244: TypeArray 72(int) 243
|
||||
245: TypePointer Private 244
|
||||
246(uarr2): 245(ptr) Variable Private
|
||||
247: TypeCooperativeMatrixNV 72(int) 8 157(Z) 9
|
||||
248: 247 ConstantComposite 73
|
||||
249: 16(int8_t) Constant 1
|
||||
250: 17 ConstantComposite 249
|
||||
251(S): TypeStruct 72(int) 72(int) 72(int)
|
||||
252: 72(int) Constant 12
|
||||
253: 72(int) Constant 23
|
||||
254: 72(int) Constant 34
|
||||
255: 251(S) ConstantComposite 252 253 254
|
||||
256(SC): 72(int) SpecConstant 1
|
||||
257: TypeCooperativeMatrixNV 7(int) 8 256(SC) 256(SC)
|
||||
258: TypeArray 257 256(SC)
|
||||
259: TypeArray 258 256(SC)
|
||||
260: TypePointer Private 259
|
||||
261(scm): 260(ptr) Variable Private
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
35(mu): 34(ptr) Variable Function
|
||||
39(mi): 38(ptr) Variable Function
|
||||
55(mf16_0): 54(ptr) Variable Function
|
||||
61(mf32_0): 60(ptr) Variable Function
|
||||
64(mf16_1): 54(ptr) Variable Function
|
||||
67(mf32_1): 60(ptr) Variable Function
|
||||
71(x): 70(ptr) Variable Function
|
||||
81(tempArg): 38(ptr) Variable Function
|
||||
98(tempArg): 34(ptr) Variable Function
|
||||
115(tempArg): 38(ptr) Variable Function
|
||||
128(D): 34(ptr) Variable Function
|
||||
129(A): 34(ptr) Variable Function
|
||||
131(B): 18(ptr) Variable Function
|
||||
133(C): 34(ptr) Variable Function
|
||||
137(l): 136(ptr) Variable Function
|
||||
142(a): 141(ptr) Variable Function
|
||||
146(md1): 136(ptr) Variable Function
|
||||
176(tempArg): 38(ptr) Variable Function
|
||||
182(tempArg): 34(ptr) Variable Function
|
||||
188(p1): 11(ptr) Variable Function
|
||||
189(param): 11(ptr) Variable Function
|
||||
192(p2): 18(ptr) Variable Function
|
||||
193(param): 18(ptr) Variable Function
|
||||
207(tempArg): 38(ptr) Variable Function
|
||||
217(ms): 38(ptr) Variable Function
|
||||
Store 35(mu) 36
|
||||
Store 39(mi) 41
|
||||
42: 33 Load 35(mu)
|
||||
43: 33 Load 35(mu)
|
||||
44: 33 IAdd 42 43
|
||||
Store 35(mu) 44
|
||||
45: 33 Load 35(mu)
|
||||
46: 33 Load 35(mu)
|
||||
47: 33 ISub 45 46
|
||||
Store 35(mu) 47
|
||||
48: 37 Load 39(mi)
|
||||
49: 37 SNegate 48
|
||||
Store 39(mi) 49
|
||||
50: 37 Load 39(mi)
|
||||
51: 37 MatrixTimesScalar 50 40
|
||||
Store 39(mi) 51
|
||||
56: 33 Load 35(mu)
|
||||
57: 53 ConvertUToF 56
|
||||
Store 55(mf16_0) 57
|
||||
62: 33 Load 35(mu)
|
||||
63: 59 ConvertUToF 62
|
||||
Store 61(mf32_0) 63
|
||||
65: 37 Load 39(mi)
|
||||
66: 53 ConvertSToF 65
|
||||
Store 64(mf16_1) 66
|
||||
68: 37 Load 39(mi)
|
||||
69: 59 ConvertSToF 68
|
||||
Store 67(mf32_1) 69
|
||||
74: 70(ptr) AccessChain 35(mu) 73
|
||||
75: 16(int8_t) Load 74
|
||||
Store 71(x) 75
|
||||
77: 16(int8_t) Load 71(x)
|
||||
78: 6(int8_t) Bitcast 77
|
||||
80: 79(ptr) AccessChain 39(mi) 76
|
||||
Store 80 78
|
||||
90: 89(ptr) AccessChain 87(block) 73 32
|
||||
94: 37 CooperativeMatrixLoadNV 90 91 93 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
Store 81(tempArg) 94
|
||||
95: 37 Load 81(tempArg)
|
||||
Store 39(mi) 95
|
||||
96: 37 Load 39(mi)
|
||||
97: 89(ptr) AccessChain 87(block) 73 32
|
||||
CooperativeMatrixStoreNV 97 96 91 93 MakePointerAvailableKHR NonPrivatePointerKHR 88
|
||||
110: 109(ptr) AccessChain 108(block8) 73 32
|
||||
111: 33 CooperativeMatrixLoadNV 110 91 93 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
Store 98(tempArg) 111
|
||||
112: 33 Load 98(tempArg)
|
||||
Store 35(mu) 112
|
||||
113: 33 Load 35(mu)
|
||||
114: 109(ptr) AccessChain 108(block8) 73 32
|
||||
CooperativeMatrixStoreNV 114 113 91 93 MakePointerAvailableKHR NonPrivatePointerKHR 88
|
||||
118: 117(ptr) AccessChain 108(block8) 116
|
||||
119: 102(ptr) Load 118 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
121: 120(ptr) AccessChain 119 73 32
|
||||
122: 37 CooperativeMatrixLoadNV 121 91 93 Aligned MakePointerVisibleKHR NonPrivatePointerKHR 16 88
|
||||
Store 115(tempArg) 122
|
||||
123: 37 Load 115(tempArg)
|
||||
Store 39(mi) 123
|
||||
124: 37 Load 39(mi)
|
||||
125: 117(ptr) AccessChain 108(block8) 116
|
||||
126: 102(ptr) Load 125 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
127: 120(ptr) AccessChain 126 73 32
|
||||
CooperativeMatrixStoreNV 127 124 91 93 Aligned MakePointerAvailableKHR NonPrivatePointerKHR 16 88
|
||||
130: 33 Load 129(A)
|
||||
132: 17 Load 131(B)
|
||||
134: 33 Load 133(C)
|
||||
135: 33 CooperativeMatrixMulAddNV 130 132 134
|
||||
Store 128(D) 135
|
||||
Store 137(l) 139
|
||||
145: 79(ptr) AccessChain 142(a) 143 76
|
||||
Store 145 144
|
||||
Store 146(md1) 73
|
||||
147: 37 Load 39(mi)
|
||||
148: 37 Load 39(mi)
|
||||
149: 37 IAdd 148 147
|
||||
Store 39(mi) 149
|
||||
151: 6(int8_t) CompositeExtract 149 1234
|
||||
152: 72(int) SConvert 151
|
||||
153: 72(int) Load 146(md1)
|
||||
154: 72(int) IAdd 153 152
|
||||
Store 146(md1) 154
|
||||
163: 162(ptr) AccessChain 161(muC2) 73
|
||||
164: 158 Load 163
|
||||
165: 162(ptr) AccessChain 161(muC2) 76
|
||||
Store 165 164
|
||||
171: 170(ptr) AccessChain 169(miC2) 116 76
|
||||
172: 6(int8_t) Load 171
|
||||
173: 16(int8_t) Bitcast 172
|
||||
175: 174(ptr) AccessChain 161(muC2) 73 76
|
||||
Store 175 173
|
||||
177: 89(ptr) AccessChain 87(block) 76 32
|
||||
178: 37 CooperativeMatrixLoadNV 177 91 93 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
Store 176(tempArg) 178
|
||||
179: 37 Load 176(tempArg)
|
||||
Store 39(mi) 179
|
||||
180: 37 Load 39(mi)
|
||||
181: 89(ptr) AccessChain 87(block) 76 32
|
||||
CooperativeMatrixStoreNV 181 180 91 93 MakePointerAvailableKHR NonPrivatePointerKHR 88
|
||||
183: 109(ptr) AccessChain 108(block8) 76 32
|
||||
184: 33 CooperativeMatrixLoadNV 183 91 93 MakePointerVisibleKHR NonPrivatePointerKHR 88
|
||||
Store 182(tempArg) 184
|
||||
185: 33 Load 182(tempArg)
|
||||
Store 35(mu) 185
|
||||
186: 33 Load 35(mu)
|
||||
187: 109(ptr) AccessChain 108(block8) 76 32
|
||||
CooperativeMatrixStoreNV 187 186 91 93 MakePointerAvailableKHR NonPrivatePointerKHR 88
|
||||
190: 10 Load 188(p1)
|
||||
Store 189(param) 190
|
||||
191: 10 FunctionCall 14(ineg(i81;) 189(param)
|
||||
Store 188(p1) 191
|
||||
194: 17 Load 192(p2)
|
||||
Store 193(param) 194
|
||||
195: 17 FunctionCall 21(umul(u81;) 193(param)
|
||||
Store 192(p2) 195
|
||||
196: 10 Load 188(p1)
|
||||
197: 10 Load 188(p1)
|
||||
198: 10 SDiv 197 196
|
||||
Store 188(p1) 198
|
||||
199: 17 Load 192(p2)
|
||||
200: 17 Load 192(p2)
|
||||
201: 17 UDiv 200 199
|
||||
Store 192(p2) 201
|
||||
202: 10 Load 188(p1)
|
||||
203: 10 MatrixTimesScalar 202 40
|
||||
Store 188(p1) 203
|
||||
205: 17 Load 192(p2)
|
||||
206: 17 MatrixTimesScalar 205 204
|
||||
Store 192(p2) 206
|
||||
215: 214(ptr) AccessChain 212(shmatrix) 100
|
||||
216: 37 CooperativeMatrixLoadNV 215 213 93 MakePointerVisibleKHR NonPrivatePointerKHR 213
|
||||
Store 207(tempArg) 216
|
||||
218: 37 Load 207(tempArg)
|
||||
Store 217(ms) 218
|
||||
219: 37 Load 217(ms)
|
||||
220: 214(ptr) AccessChain 212(shmatrix) 100
|
||||
CooperativeMatrixStoreNV 220 219 213 93 MakePointerAvailableKHR NonPrivatePointerKHR 213
|
||||
Return
|
||||
FunctionEnd
|
||||
14(ineg(i81;): 10 Function None 12
|
||||
13(m): 11(ptr) FunctionParameter
|
||||
15: Label
|
||||
23: 10 Load 13(m)
|
||||
24: 10 SNegate 23
|
||||
ReturnValue 24
|
||||
FunctionEnd
|
||||
21(umul(u81;): 17 Function None 19
|
||||
20(m): 18(ptr) FunctionParameter
|
||||
22: Label
|
||||
27: 17 Load 20(m)
|
||||
29: 17 MatrixTimesScalar 27 28
|
||||
ReturnValue 29
|
||||
FunctionEnd
|
102
Test/baseResults/web.array.frag.out
Normal file
102
Test/baseResults/web.array.frag.out
Normal file
@ -0,0 +1,102 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 7
|
||||
; Bound: 74
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %colorOut
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %foo_f1_5__ "foo(f1[5];"
|
||||
OpName %a "a"
|
||||
OpName %g4 "g4"
|
||||
OpName %g5 "g5"
|
||||
OpName %param "param"
|
||||
OpName %u "u"
|
||||
OpName %param_0 "param"
|
||||
OpName %colorOut "colorOut"
|
||||
OpDecorate %colorOut Location 0
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%_arr_float_uint_5 = OpTypeArray %float %uint_5
|
||||
%_ptr_Function__arr_float_uint_5 = OpTypePointer Function %_arr_float_uint_5
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_float_uint_4 = OpTypeArray %float %uint_4
|
||||
%13 = OpTypeFunction %_arr_float_uint_4 %_ptr_Function__arr_float_uint_5
|
||||
%int = OpTypeInt 32 1
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_3 = OpConstant %int 3
|
||||
%_ptr_Private__arr_float_uint_4 = OpTypePointer Private %_arr_float_uint_4
|
||||
%g4 = OpVariable %_ptr_Private__arr_float_uint_4 Private
|
||||
%_ptr_Private__arr_float_uint_5 = OpTypePointer Private %_arr_float_uint_5
|
||||
%g5 = OpVariable %_ptr_Private__arr_float_uint_5 Private
|
||||
%float_1 = OpConstant %float 1
|
||||
%float_2 = OpConstant %float 2
|
||||
%float_3 = OpConstant %float 3
|
||||
%float_4 = OpConstant %float 4
|
||||
%45 = OpConstantComposite %_arr_float_uint_4 %float_1 %float_2 %float_3 %float_4
|
||||
%bool = OpTypeBool
|
||||
%v2float = OpTypeVector %float 2
|
||||
%_ptr_Output_v2float = OpTypePointer Output %v2float
|
||||
%colorOut = OpVariable %_ptr_Output_v2float Output
|
||||
%float_5 = OpConstant %float 5
|
||||
%73 = OpConstantComposite %v2float %float_4 %float_5
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%param = OpVariable %_ptr_Function__arr_float_uint_5 Function
|
||||
%u = OpVariable %_ptr_Function__arr_float_uint_5 Function
|
||||
%param_0 = OpVariable %_ptr_Function__arr_float_uint_5 Function
|
||||
%39 = OpLoad %_arr_float_uint_5 %g5
|
||||
OpStore %param %39
|
||||
%40 = OpFunctionCall %_arr_float_uint_4 %foo_f1_5__ %param
|
||||
OpStore %g4 %40
|
||||
%46 = OpLoad %_arr_float_uint_4 %g4
|
||||
%48 = OpCompositeExtract %float %45 0
|
||||
%49 = OpCompositeExtract %float %46 0
|
||||
%50 = OpFOrdEqual %bool %48 %49
|
||||
%51 = OpCompositeExtract %float %45 1
|
||||
%52 = OpCompositeExtract %float %46 1
|
||||
%53 = OpFOrdEqual %bool %51 %52
|
||||
%54 = OpLogicalAnd %bool %50 %53
|
||||
%55 = OpCompositeExtract %float %45 2
|
||||
%56 = OpCompositeExtract %float %46 2
|
||||
%57 = OpFOrdEqual %bool %55 %56
|
||||
%58 = OpLogicalAnd %bool %54 %57
|
||||
%59 = OpCompositeExtract %float %45 3
|
||||
%60 = OpCompositeExtract %float %46 3
|
||||
%61 = OpFOrdEqual %bool %59 %60
|
||||
%62 = OpLogicalAnd %bool %58 %61
|
||||
OpSelectionMerge %64 None
|
||||
OpBranchConditional %62 %63 %64
|
||||
%63 = OpLabel
|
||||
OpBranch %64
|
||||
%64 = OpLabel
|
||||
%67 = OpLoad %_arr_float_uint_5 %u
|
||||
OpStore %param_0 %67
|
||||
%68 = OpFunctionCall %_arr_float_uint_4 %foo_f1_5__ %param_0
|
||||
OpStore %colorOut %73
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo_f1_5__ = OpFunction %_arr_float_uint_4 None %13
|
||||
%a = OpFunctionParameter %_ptr_Function__arr_float_uint_5
|
||||
%16 = OpLabel
|
||||
%20 = OpAccessChain %_ptr_Function_float %a %int_0
|
||||
%21 = OpLoad %float %20
|
||||
%23 = OpAccessChain %_ptr_Function_float %a %int_1
|
||||
%24 = OpLoad %float %23
|
||||
%26 = OpAccessChain %_ptr_Function_float %a %int_2
|
||||
%27 = OpLoad %float %26
|
||||
%29 = OpAccessChain %_ptr_Function_float %a %int_3
|
||||
%30 = OpLoad %float %29
|
||||
%31 = OpCompositeConstruct %_arr_float_uint_4 %21 %24 %27 %30
|
||||
OpReturnValue %31
|
||||
OpFunctionEnd
|
65
Test/baseResults/web.basic.vert.out
Normal file
65
Test/baseResults/web.basic.vert.out
Normal file
@ -0,0 +1,65 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 7
|
||||
; Bound: 38
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %main "main" %outv4 %inv4
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %outv4 "outv4"
|
||||
OpName %inv4 "inv4"
|
||||
OpName %uBlock "uBlock"
|
||||
OpMemberName %uBlock 0 "a"
|
||||
OpMemberName %uBlock 1 "b"
|
||||
OpMemberName %uBlock 2 "c"
|
||||
OpName %uInst "uInst"
|
||||
OpDecorate %outv4 Location 1
|
||||
OpDecorate %inv4 Location 2
|
||||
OpMemberDecorate %uBlock 0 Offset 0
|
||||
OpMemberDecorate %uBlock 1 Offset 16
|
||||
OpMemberDecorate %uBlock 2 Offset 32
|
||||
OpDecorate %uBlock Block
|
||||
OpDecorate %uInst DescriptorSet 0
|
||||
OpDecorate %uInst Binding 3
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%outv4 = OpVariable %_ptr_Output_v4float Output
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%inv4 = OpVariable %_ptr_Input_v4float Input
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%uint = OpTypeInt 32 0
|
||||
%v4uint = OpTypeVector %uint 4
|
||||
%uBlock = OpTypeStruct %v4float %v4int %v4uint
|
||||
%_ptr_Uniform_uBlock = OpTypePointer Uniform %uBlock
|
||||
%uInst = OpVariable %_ptr_Uniform_uBlock Uniform
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_Uniform_v4int = OpTypePointer Uniform %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_v4uint = OpTypePointer Uniform %v4uint
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%12 = OpLoad %v4float %inv4
|
||||
%13 = OpExtInst %v4float %1 Normalize %12
|
||||
%23 = OpAccessChain %_ptr_Uniform_v4float %uInst %int_0
|
||||
%24 = OpLoad %v4float %23
|
||||
%25 = OpFMul %v4float %13 %24
|
||||
%28 = OpAccessChain %_ptr_Uniform_v4int %uInst %int_1
|
||||
%29 = OpLoad %v4int %28
|
||||
%30 = OpConvertSToF %v4float %29
|
||||
%31 = OpFMul %v4float %25 %30
|
||||
%34 = OpAccessChain %_ptr_Uniform_v4uint %uInst %int_2
|
||||
%35 = OpLoad %v4uint %34
|
||||
%36 = OpConvertUToF %v4float %35
|
||||
%37 = OpFMul %v4float %31 %36
|
||||
OpStore %outv4 %37
|
||||
OpReturn
|
||||
OpFunctionEnd
|
149
Test/baseResults/web.builtins.frag.out
Normal file
149
Test/baseResults/web.builtins.frag.out
Normal file
@ -0,0 +1,149 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 7
|
||||
; Bound: 69
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %gl_FragCoord %gl_FragDepth %sc %s2 %sf %c1D %c2D %c4D %c3D %ic1D %ic3D %ic4D
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpExecutionMode %main DepthReplacing
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %f "f"
|
||||
OpName %gl_FragCoord "gl_FragCoord"
|
||||
OpName %gl_FragDepth "gl_FragDepth"
|
||||
OpName %sc "sc"
|
||||
OpName %S2 "S2"
|
||||
OpMemberName %S2 0 "c"
|
||||
OpMemberName %S2 1 "f"
|
||||
OpName %s2 "s2"
|
||||
OpName %sf "sf"
|
||||
OpName %c1D "c1D"
|
||||
OpName %c2D "c2D"
|
||||
OpName %c4D "c4D"
|
||||
OpName %c3D "c3D"
|
||||
OpName %ic1D "ic1D"
|
||||
OpName %ic3D "ic3D"
|
||||
OpName %ic4D "ic4D"
|
||||
OpDecorate %f RelaxedPrecision
|
||||
OpDecorate %gl_FragCoord BuiltIn FragCoord
|
||||
OpDecorate %gl_FragDepth BuiltIn FragDepth
|
||||
OpDecorate %19 RelaxedPrecision
|
||||
OpDecorate %sc RelaxedPrecision
|
||||
OpDecorate %sc Location 0
|
||||
OpMemberDecorate %S2 0 RelaxedPrecision
|
||||
OpMemberDecorate %S2 1 RelaxedPrecision
|
||||
OpDecorate %s2 Location 8
|
||||
OpDecorate %30 RelaxedPrecision
|
||||
OpDecorate %sf RelaxedPrecision
|
||||
OpDecorate %sf Location 1
|
||||
OpDecorate %34 RelaxedPrecision
|
||||
OpDecorate %c1D RelaxedPrecision
|
||||
OpDecorate %c1D Location 4
|
||||
OpDecorate %36 RelaxedPrecision
|
||||
OpDecorate %37 RelaxedPrecision
|
||||
OpDecorate %38 RelaxedPrecision
|
||||
OpDecorate %39 RelaxedPrecision
|
||||
OpDecorate %c2D RelaxedPrecision
|
||||
OpDecorate %c2D Location 5
|
||||
OpDecorate %43 RelaxedPrecision
|
||||
OpDecorate %44 RelaxedPrecision
|
||||
OpDecorate %45 RelaxedPrecision
|
||||
OpDecorate %46 RelaxedPrecision
|
||||
OpDecorate %47 RelaxedPrecision
|
||||
OpDecorate %c4D RelaxedPrecision
|
||||
OpDecorate %c4D Location 7
|
||||
OpDecorate %49 RelaxedPrecision
|
||||
OpDecorate %50 RelaxedPrecision
|
||||
OpDecorate %51 RelaxedPrecision
|
||||
OpDecorate %52 RelaxedPrecision
|
||||
OpDecorate %53 RelaxedPrecision
|
||||
OpDecorate %c3D RelaxedPrecision
|
||||
OpDecorate %c3D Location 6
|
||||
OpDecorate %55 RelaxedPrecision
|
||||
OpDecorate %56 RelaxedPrecision
|
||||
OpDecorate %ic1D RelaxedPrecision
|
||||
OpDecorate %ic1D Flat
|
||||
OpDecorate %ic1D Location 1
|
||||
OpDecorate %ic3D RelaxedPrecision
|
||||
OpDecorate %ic3D Flat
|
||||
OpDecorate %ic3D Location 2
|
||||
OpDecorate %ic4D RelaxedPrecision
|
||||
OpDecorate %ic4D Flat
|
||||
OpDecorate %ic4D Location 3
|
||||
OpDecorate %68 RelaxedPrecision
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Input_float = OpTypePointer Input %float
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%gl_FragDepth = OpVariable %_ptr_Output_float Output
|
||||
%v3float = OpTypeVector %float 3
|
||||
%_ptr_Output_v3float = OpTypePointer Output %v3float
|
||||
%sc = OpVariable %_ptr_Output_v3float Output
|
||||
%S2 = OpTypeStruct %v3float %float
|
||||
%_ptr_Input_S2 = OpTypePointer Input %S2
|
||||
%s2 = OpVariable %_ptr_Input_S2 Input
|
||||
%int = OpTypeInt 32 1
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Input_v3float = OpTypePointer Input %v3float
|
||||
%sf = OpVariable %_ptr_Output_float Output
|
||||
%int_1 = OpConstant %int 1
|
||||
%c1D = OpVariable %_ptr_Input_float Input
|
||||
%v2float = OpTypeVector %float 2
|
||||
%_ptr_Input_v2float = OpTypePointer Input %v2float
|
||||
%c2D = OpVariable %_ptr_Input_v2float Input
|
||||
%c4D = OpVariable %_ptr_Input_v4float Input
|
||||
%c3D = OpVariable %_ptr_Input_v3float Input
|
||||
%_ptr_Input_int = OpTypePointer Input %int
|
||||
%ic1D = OpVariable %_ptr_Input_int Input
|
||||
%v3int = OpTypeVector %int 3
|
||||
%_ptr_Input_v3int = OpTypePointer Input %v3int
|
||||
%ic3D = OpVariable %_ptr_Input_v3int Input
|
||||
%v4int = OpTypeVector %int 4
|
||||
%_ptr_Input_v4int = OpTypePointer Input %v4int
|
||||
%ic4D = OpVariable %_ptr_Input_v4int Input
|
||||
%v2int = OpTypeVector %int 2
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_3 = OpConstant %int 3
|
||||
%68 = OpConstantComposite %v2int %int_2 %int_3
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%f = OpVariable %_ptr_Function_float Function
|
||||
%15 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
|
||||
%16 = OpLoad %float %15
|
||||
OpStore %f %16
|
||||
%19 = OpLoad %float %f
|
||||
OpStore %gl_FragDepth %19
|
||||
%29 = OpAccessChain %_ptr_Input_v3float %s2 %int_0
|
||||
%30 = OpLoad %v3float %29
|
||||
OpStore %sc %30
|
||||
%33 = OpAccessChain %_ptr_Input_float %s2 %int_1
|
||||
%34 = OpLoad %float %33
|
||||
OpStore %sf %34
|
||||
%36 = OpLoad %float %c1D
|
||||
%37 = OpExtInst %float %1 Sinh %36
|
||||
%38 = OpLoad %float %c1D
|
||||
%39 = OpExtInst %float %1 Cosh %38
|
||||
%43 = OpLoad %v2float %c2D
|
||||
%44 = OpExtInst %v2float %1 Tanh %43
|
||||
%45 = OpVectorTimesScalar %v2float %44 %39
|
||||
%46 = OpCompositeConstruct %v2float %37 %37
|
||||
%47 = OpFAdd %v2float %46 %45
|
||||
%49 = OpLoad %v4float %c4D
|
||||
%50 = OpExtInst %v4float %1 Asinh %49
|
||||
%51 = OpLoad %v4float %c4D
|
||||
%52 = OpExtInst %v4float %1 Acosh %51
|
||||
%53 = OpFAdd %v4float %50 %52
|
||||
%55 = OpLoad %v3float %c3D
|
||||
%56 = OpExtInst %v3float %1 Atanh %55
|
||||
OpReturn
|
||||
OpFunctionEnd
|
62
Test/baseResults/web.builtins.vert.out
Normal file
62
Test/baseResults/web.builtins.vert.out
Normal file
@ -0,0 +1,62 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 7
|
||||
; Bound: 33
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %main "main" %gl_Position %ps %gl_VertexIndex %gl_PointSize %gl_InstanceIndex
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %gl_Position "gl_Position"
|
||||
OpName %ps "ps"
|
||||
OpName %gl_VertexIndex "gl_VertexIndex"
|
||||
OpName %gl_PointSize "gl_PointSize"
|
||||
OpName %gl_InstanceIndex "gl_InstanceIndex"
|
||||
OpDecorate %gl_Position Invariant
|
||||
OpDecorate %gl_Position BuiltIn Position
|
||||
OpDecorate %ps RelaxedPrecision
|
||||
OpDecorate %ps Location 0
|
||||
OpDecorate %12 RelaxedPrecision
|
||||
OpDecorate %gl_VertexIndex BuiltIn VertexIndex
|
||||
OpDecorate %gl_PointSize BuiltIn PointSize
|
||||
OpDecorate %25 RelaxedPrecision
|
||||
OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%gl_Position = OpVariable %_ptr_Output_v4float Output
|
||||
%_ptr_Input_float = OpTypePointer Input %float
|
||||
%ps = OpVariable %_ptr_Input_float Input
|
||||
%int = OpTypeInt 32 1
|
||||
%int_4 = OpConstant %int 4
|
||||
%_ptr_Input_int = OpTypePointer Input %int
|
||||
%gl_VertexIndex = OpVariable %_ptr_Input_int Input
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%gl_PointSize = OpVariable %_ptr_Output_float Output
|
||||
%int_5 = OpConstant %int 5
|
||||
%gl_InstanceIndex = OpVariable %_ptr_Input_int Input
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%12 = OpLoad %float %ps
|
||||
%13 = OpCompositeConstruct %v4float %12 %12 %12 %12
|
||||
OpStore %gl_Position %13
|
||||
%18 = OpLoad %int %gl_VertexIndex
|
||||
%19 = OpISub %int %int_4 %18
|
||||
%20 = OpConvertSToF %float %19
|
||||
%21 = OpLoad %v4float %gl_Position
|
||||
%22 = OpVectorTimesScalar %v4float %21 %20
|
||||
OpStore %gl_Position %22
|
||||
%25 = OpLoad %float %ps
|
||||
OpStore %gl_PointSize %25
|
||||
%28 = OpLoad %int %gl_InstanceIndex
|
||||
%29 = OpISub %int %int_5 %28
|
||||
%30 = OpConvertSToF %float %29
|
||||
%31 = OpLoad %float %gl_PointSize
|
||||
%32 = OpFMul %float %31 %30
|
||||
OpStore %gl_PointSize %32
|
||||
OpReturn
|
||||
OpFunctionEnd
|
347
Test/baseResults/web.controlFlow.frag.out
Normal file
347
Test/baseResults/web.controlFlow.frag.out
Normal file
@ -0,0 +1,347 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 7
|
||||
; Bound: 193
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %x %BaseColor %Count %bigColor %outColor %v4 %f_0
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %c "c"
|
||||
OpName %f "f"
|
||||
OpName %x "x"
|
||||
OpName %d "d"
|
||||
OpName %color "color"
|
||||
OpName %BaseColor "BaseColor"
|
||||
OpName %i "i"
|
||||
OpName %Count "Count"
|
||||
OpName %bigColor "bigColor"
|
||||
OpName %outColor "outColor"
|
||||
OpName %sum "sum"
|
||||
OpName %i_0 "i"
|
||||
OpName %v4 "v4"
|
||||
OpName %i_1 "i"
|
||||
OpName %tv4 "tv4"
|
||||
OpName %r "r"
|
||||
OpName %i_2 "i"
|
||||
OpName %i_3 "i"
|
||||
OpName %i_4 "i"
|
||||
OpName %A "A"
|
||||
OpName %B "B"
|
||||
OpName %C "C"
|
||||
OpName %D "D"
|
||||
OpName %f_0 "f"
|
||||
OpDecorate %f RelaxedPrecision
|
||||
OpDecorate %x Location 0
|
||||
OpDecorate %color RelaxedPrecision
|
||||
OpDecorate %BaseColor RelaxedPrecision
|
||||
OpDecorate %BaseColor Location 2
|
||||
OpDecorate %47 RelaxedPrecision
|
||||
OpDecorate %Count Flat
|
||||
OpDecorate %Count Location 4
|
||||
OpDecorate %bigColor RelaxedPrecision
|
||||
OpDecorate %bigColor Location 1
|
||||
OpDecorate %63 RelaxedPrecision
|
||||
OpDecorate %64 RelaxedPrecision
|
||||
OpDecorate %65 RelaxedPrecision
|
||||
OpDecorate %outColor RelaxedPrecision
|
||||
OpDecorate %outColor Location 0
|
||||
OpDecorate %71 RelaxedPrecision
|
||||
OpDecorate %sum RelaxedPrecision
|
||||
OpDecorate %v4 Flat
|
||||
OpDecorate %v4 Location 5
|
||||
OpDecorate %91 RelaxedPrecision
|
||||
OpDecorate %92 RelaxedPrecision
|
||||
OpDecorate %93 RelaxedPrecision
|
||||
OpDecorate %tv4 RelaxedPrecision
|
||||
OpDecorate %111 RelaxedPrecision
|
||||
OpDecorate %115 RelaxedPrecision
|
||||
OpDecorate %116 RelaxedPrecision
|
||||
OpDecorate %117 RelaxedPrecision
|
||||
OpDecorate %118 RelaxedPrecision
|
||||
OpDecorate %119 RelaxedPrecision
|
||||
OpDecorate %120 RelaxedPrecision
|
||||
OpDecorate %r RelaxedPrecision
|
||||
OpDecorate %123 RelaxedPrecision
|
||||
OpDecorate %124 RelaxedPrecision
|
||||
OpDecorate %136 RelaxedPrecision
|
||||
OpDecorate %141 RelaxedPrecision
|
||||
OpDecorate %142 RelaxedPrecision
|
||||
OpDecorate %143 RelaxedPrecision
|
||||
OpDecorate %144 RelaxedPrecision
|
||||
OpDecorate %145 RelaxedPrecision
|
||||
OpDecorate %157 RelaxedPrecision
|
||||
OpDecorate %158 RelaxedPrecision
|
||||
OpDecorate %159 RelaxedPrecision
|
||||
OpDecorate %f_0 RelaxedPrecision
|
||||
OpDecorate %f_0 Location 3
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Private_int = OpTypePointer Private %int
|
||||
%c = OpVariable %_ptr_Private_int Private
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%_ptr_Input_float = OpTypePointer Input %float
|
||||
%x = OpVariable %_ptr_Input_float Input
|
||||
%d = OpVariable %_ptr_Private_int Private
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%BaseColor = OpVariable %_ptr_Input_v4float Input
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Input_int = OpTypePointer Input %int
|
||||
%Count = OpVariable %_ptr_Input_int Input
|
||||
%bool = OpTypeBool
|
||||
%bigColor = OpVariable %_ptr_Input_v4float Input
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%outColor = OpVariable %_ptr_Output_v4float Output
|
||||
%float_0 = OpConstant %float 0
|
||||
%int_4 = OpConstant %int 4
|
||||
%uint = OpTypeInt 32 0
|
||||
%v4uint = OpTypeVector %uint 4
|
||||
%_ptr_Input_v4uint = OpTypePointer Input %v4uint
|
||||
%v4 = OpVariable %_ptr_Input_v4uint Input
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%v3float = OpTypeVector %float 3
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%int_16 = OpConstant %int 16
|
||||
%int_10 = OpConstant %int 10
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_5 = OpConstant %int 5
|
||||
%int_3 = OpConstant %int 3
|
||||
%f_0 = OpVariable %_ptr_Input_float Input
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%f = OpVariable %_ptr_Function_float Function
|
||||
%color = OpVariable %_ptr_Function_v4float Function
|
||||
%i = OpVariable %_ptr_Function_int Function
|
||||
%sum = OpVariable %_ptr_Function_float Function
|
||||
%i_0 = OpVariable %_ptr_Function_int Function
|
||||
%i_1 = OpVariable %_ptr_Function_int Function
|
||||
%tv4 = OpVariable %_ptr_Function_v4float Function
|
||||
%r = OpVariable %_ptr_Function_v4float Function
|
||||
%i_2 = OpVariable %_ptr_Function_int Function
|
||||
%i_3 = OpVariable %_ptr_Function_int Function
|
||||
%i_4 = OpVariable %_ptr_Function_int Function
|
||||
%A = OpVariable %_ptr_Function_int Function
|
||||
%B = OpVariable %_ptr_Function_int Function
|
||||
%C = OpVariable %_ptr_Function_int Function
|
||||
%D = OpVariable %_ptr_Function_int Function
|
||||
%9 = OpLoad %int %c
|
||||
OpSelectionMerge %13 None
|
||||
OpSwitch %9 %12 1 %10 2 %11
|
||||
%12 = OpLabel
|
||||
%39 = OpLoad %float %x
|
||||
%40 = OpExtInst %float %1 Tan %39
|
||||
OpStore %f %40
|
||||
OpBranch %13
|
||||
%10 = OpLabel
|
||||
%19 = OpLoad %float %x
|
||||
%20 = OpExtInst %float %1 Sin %19
|
||||
OpStore %f %20
|
||||
OpBranch %13
|
||||
%11 = OpLabel
|
||||
%23 = OpLoad %int %d
|
||||
OpSelectionMerge %26 None
|
||||
OpSwitch %23 %26 1 %24 2 %25
|
||||
%24 = OpLabel
|
||||
%27 = OpLoad %float %x
|
||||
%28 = OpLoad %float %x
|
||||
%29 = OpFMul %float %27 %28
|
||||
%30 = OpLoad %float %x
|
||||
%31 = OpFMul %float %29 %30
|
||||
OpStore %f %31
|
||||
OpBranch %26
|
||||
%25 = OpLabel
|
||||
%33 = OpLoad %float %x
|
||||
%34 = OpLoad %float %x
|
||||
%35 = OpFMul %float %33 %34
|
||||
OpStore %f %35
|
||||
OpBranch %26
|
||||
%26 = OpLabel
|
||||
OpBranch %13
|
||||
%13 = OpLabel
|
||||
%47 = OpLoad %v4float %BaseColor
|
||||
OpStore %color %47
|
||||
OpStore %i %int_0
|
||||
OpBranch %51
|
||||
%51 = OpLabel
|
||||
OpLoopMerge %53 %54 None
|
||||
OpBranch %55
|
||||
%55 = OpLabel
|
||||
%56 = OpLoad %int %i
|
||||
%59 = OpLoad %int %Count
|
||||
%61 = OpSLessThan %bool %56 %59
|
||||
OpBranchConditional %61 %52 %53
|
||||
%52 = OpLabel
|
||||
%63 = OpLoad %v4float %bigColor
|
||||
%64 = OpLoad %v4float %color
|
||||
%65 = OpFAdd %v4float %64 %63
|
||||
OpStore %color %65
|
||||
OpBranch %54
|
||||
%54 = OpLabel
|
||||
%66 = OpLoad %int %i
|
||||
%68 = OpIAdd %int %66 %int_1
|
||||
OpStore %i %68
|
||||
OpBranch %51
|
||||
%53 = OpLabel
|
||||
%71 = OpLoad %v4float %color
|
||||
OpStore %outColor %71
|
||||
OpStore %sum %float_0
|
||||
OpStore %i_0 %int_0
|
||||
OpBranch %75
|
||||
%75 = OpLabel
|
||||
OpLoopMerge %77 %78 None
|
||||
OpBranch %79
|
||||
%79 = OpLabel
|
||||
%80 = OpLoad %int %i_0
|
||||
%82 = OpSLessThan %bool %80 %int_4
|
||||
OpBranchConditional %82 %76 %77
|
||||
%76 = OpLabel
|
||||
%87 = OpLoad %int %i_0
|
||||
%89 = OpAccessChain %_ptr_Input_uint %v4 %87
|
||||
%90 = OpLoad %uint %89
|
||||
%91 = OpConvertUToF %float %90
|
||||
%92 = OpLoad %float %sum
|
||||
%93 = OpFAdd %float %92 %91
|
||||
OpStore %sum %93
|
||||
OpBranch %78
|
||||
%78 = OpLabel
|
||||
%94 = OpLoad %int %i_0
|
||||
%95 = OpIAdd %int %94 %int_1
|
||||
OpStore %i_0 %95
|
||||
OpBranch %75
|
||||
%77 = OpLabel
|
||||
OpStore %i_1 %int_0
|
||||
OpBranch %97
|
||||
%97 = OpLabel
|
||||
OpLoopMerge %99 %100 None
|
||||
OpBranch %101
|
||||
%101 = OpLabel
|
||||
%102 = OpLoad %int %i_1
|
||||
%103 = OpSLessThan %bool %102 %int_4
|
||||
OpBranchConditional %103 %98 %99
|
||||
%98 = OpLabel
|
||||
%105 = OpLoad %int %i_1
|
||||
%106 = OpLoad %int %i_1
|
||||
%107 = OpAccessChain %_ptr_Input_uint %v4 %106
|
||||
%108 = OpLoad %uint %107
|
||||
%110 = OpIMul %uint %108 %uint_4
|
||||
%111 = OpConvertUToF %float %110
|
||||
%112 = OpAccessChain %_ptr_Function_float %tv4 %105
|
||||
OpStore %112 %111
|
||||
OpBranch %100
|
||||
%100 = OpLabel
|
||||
%113 = OpLoad %int %i_1
|
||||
%114 = OpIAdd %int %113 %int_1
|
||||
OpStore %i_1 %114
|
||||
OpBranch %97
|
||||
%99 = OpLabel
|
||||
%115 = OpLoad %float %sum
|
||||
%116 = OpCompositeConstruct %v4float %115 %115 %115 %115
|
||||
%117 = OpLoad %v4float %tv4
|
||||
%118 = OpFAdd %v4float %116 %117
|
||||
%119 = OpLoad %v4float %outColor
|
||||
%120 = OpFAdd %v4float %119 %118
|
||||
OpStore %outColor %120
|
||||
%123 = OpLoad %v4float %BaseColor
|
||||
%124 = OpVectorShuffle %v3float %123 %123 0 1 2
|
||||
%125 = OpLoad %v4float %r
|
||||
%126 = OpVectorShuffle %v4float %125 %124 4 5 6 3
|
||||
OpStore %r %126
|
||||
OpStore %i_2 %int_0
|
||||
OpBranch %128
|
||||
%128 = OpLabel
|
||||
OpLoopMerge %130 %131 None
|
||||
OpBranch %132
|
||||
%132 = OpLabel
|
||||
%133 = OpLoad %int %i_2
|
||||
%134 = OpLoad %int %Count
|
||||
%135 = OpSLessThan %bool %133 %134
|
||||
OpBranchConditional %135 %129 %130
|
||||
%129 = OpLabel
|
||||
%136 = OpLoad %float %f
|
||||
%138 = OpAccessChain %_ptr_Function_float %r %uint_3
|
||||
OpStore %138 %136
|
||||
OpBranch %131
|
||||
%131 = OpLabel
|
||||
%139 = OpLoad %int %i_2
|
||||
%140 = OpIAdd %int %139 %int_1
|
||||
OpStore %i_2 %140
|
||||
OpBranch %128
|
||||
%130 = OpLabel
|
||||
%141 = OpLoad %v4float %r
|
||||
%142 = OpVectorShuffle %v3float %141 %141 0 1 2
|
||||
%143 = OpLoad %v4float %outColor
|
||||
%144 = OpVectorShuffle %v3float %143 %143 0 1 2
|
||||
%145 = OpFAdd %v3float %144 %142
|
||||
%146 = OpLoad %v4float %outColor
|
||||
%147 = OpVectorShuffle %v4float %146 %145 4 5 6 3
|
||||
OpStore %outColor %147
|
||||
OpStore %i_3 %int_0
|
||||
OpBranch %149
|
||||
%149 = OpLabel
|
||||
OpLoopMerge %151 %152 None
|
||||
OpBranch %153
|
||||
%153 = OpLabel
|
||||
%154 = OpLoad %int %i_3
|
||||
%156 = OpSLessThan %bool %154 %int_16
|
||||
OpBranchConditional %156 %150 %151
|
||||
%150 = OpLabel
|
||||
%157 = OpLoad %float %f
|
||||
%158 = OpLoad %v4float %outColor
|
||||
%159 = OpVectorTimesScalar %v4float %158 %157
|
||||
OpStore %outColor %159
|
||||
OpBranch %152
|
||||
%152 = OpLabel
|
||||
%160 = OpLoad %int %i_3
|
||||
%161 = OpIAdd %int %160 %int_4
|
||||
OpStore %i_3 %161
|
||||
OpBranch %149
|
||||
%151 = OpLabel
|
||||
OpStore %i_4 %int_0
|
||||
OpBranch %163
|
||||
%163 = OpLabel
|
||||
OpLoopMerge %165 %166 None
|
||||
OpBranch %167
|
||||
%167 = OpLabel
|
||||
%168 = OpLoad %int %i_4
|
||||
%170 = OpSLessThan %bool %168 %int_10
|
||||
OpBranchConditional %170 %164 %165
|
||||
%164 = OpLabel
|
||||
OpStore %A %int_1
|
||||
%172 = OpLoad %int %i_4
|
||||
%174 = OpSMod %int %172 %int_2
|
||||
%175 = OpIEqual %bool %174 %int_0
|
||||
OpSelectionMerge %177 None
|
||||
OpBranchConditional %175 %176 %177
|
||||
%176 = OpLabel
|
||||
OpStore %B %int_2
|
||||
OpBranch %166
|
||||
%177 = OpLabel
|
||||
%181 = OpLoad %int %i_4
|
||||
%183 = OpSMod %int %181 %int_5
|
||||
%184 = OpIEqual %bool %183 %int_0
|
||||
OpSelectionMerge %186 None
|
||||
OpBranchConditional %184 %185 %186
|
||||
%185 = OpLabel
|
||||
OpStore %B %int_2
|
||||
OpBranch %165
|
||||
%186 = OpLabel
|
||||
%188 = OpLoad %int %i_4
|
||||
%189 = OpIAdd %int %188 %int_1
|
||||
OpStore %i_4 %189
|
||||
OpBranch %166
|
||||
%166 = OpLabel
|
||||
OpBranch %163
|
||||
%165 = OpLabel
|
||||
OpStore %D %int_3
|
||||
OpReturn
|
||||
OpFunctionEnd
|
321
Test/baseResults/web.operations.frag.out
Normal file
321
Test/baseResults/web.operations.frag.out
Normal file
@ -0,0 +1,321 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 7
|
||||
; Bound: 207
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main"
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %f "f"
|
||||
OpName %v4 "v4"
|
||||
OpName %u "u"
|
||||
OpName %uv4 "uv4"
|
||||
OpName %iv3 "iv3"
|
||||
OpName %i "i"
|
||||
OpName %uv3 "uv3"
|
||||
OpName %m2 "m2"
|
||||
OpName %iv4 "iv4"
|
||||
OpName %m4 "m4"
|
||||
OpName %a "a"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "i"
|
||||
OpName %s "s"
|
||||
OpName %b "b"
|
||||
OpName %arr "arr"
|
||||
OpName %arr2 "arr2"
|
||||
OpName %block "block"
|
||||
OpMemberName %block 0 "f"
|
||||
OpName %instanceName "instanceName"
|
||||
OpDecorate %u RelaxedPrecision
|
||||
OpDecorate %18 RelaxedPrecision
|
||||
OpDecorate %19 RelaxedPrecision
|
||||
OpDecorate %20 RelaxedPrecision
|
||||
OpDecorate %uv4 RelaxedPrecision
|
||||
OpDecorate %24 RelaxedPrecision
|
||||
OpDecorate %25 RelaxedPrecision
|
||||
OpDecorate %26 RelaxedPrecision
|
||||
OpDecorate %27 RelaxedPrecision
|
||||
OpDecorate %iv3 RelaxedPrecision
|
||||
OpDecorate %32 RelaxedPrecision
|
||||
OpDecorate %33 RelaxedPrecision
|
||||
OpDecorate %34 RelaxedPrecision
|
||||
OpDecorate %i RelaxedPrecision
|
||||
OpDecorate %38 RelaxedPrecision
|
||||
OpDecorate %39 RelaxedPrecision
|
||||
OpDecorate %uv3 RelaxedPrecision
|
||||
OpDecorate %43 RelaxedPrecision
|
||||
OpDecorate %45 RelaxedPrecision
|
||||
OpDecorate %46 RelaxedPrecision
|
||||
OpDecorate %iv4 RelaxedPrecision
|
||||
OpDecorate %62 RelaxedPrecision
|
||||
OpDecorate %64 RelaxedPrecision
|
||||
OpDecorate %65 RelaxedPrecision
|
||||
OpDecorate %104 RelaxedPrecision
|
||||
OpDecorate %105 RelaxedPrecision
|
||||
OpMemberDecorate %S 0 RelaxedPrecision
|
||||
OpDecorate %153 RelaxedPrecision
|
||||
OpDecorate %154 RelaxedPrecision
|
||||
OpDecorate %155 RelaxedPrecision
|
||||
OpDecorate %156 RelaxedPrecision
|
||||
OpDecorate %157 RelaxedPrecision
|
||||
OpDecorate %158 RelaxedPrecision
|
||||
OpDecorate %159 RelaxedPrecision
|
||||
OpDecorate %160 RelaxedPrecision
|
||||
OpDecorate %161 RelaxedPrecision
|
||||
OpDecorate %162 RelaxedPrecision
|
||||
OpDecorate %163 RelaxedPrecision
|
||||
OpDecorate %164 RelaxedPrecision
|
||||
OpDecorate %165 RelaxedPrecision
|
||||
OpDecorate %166 RelaxedPrecision
|
||||
OpDecorate %167 RelaxedPrecision
|
||||
OpDecorate %168 RelaxedPrecision
|
||||
OpDecorate %169 RelaxedPrecision
|
||||
OpDecorate %170 RelaxedPrecision
|
||||
OpDecorate %171 RelaxedPrecision
|
||||
OpDecorate %172 RelaxedPrecision
|
||||
OpDecorate %173 RelaxedPrecision
|
||||
OpDecorate %174 RelaxedPrecision
|
||||
OpDecorate %175 RelaxedPrecision
|
||||
OpDecorate %176 RelaxedPrecision
|
||||
OpDecorate %177 RelaxedPrecision
|
||||
OpDecorate %178 RelaxedPrecision
|
||||
OpDecorate %179 RelaxedPrecision
|
||||
OpDecorate %180 RelaxedPrecision
|
||||
OpDecorate %181 RelaxedPrecision
|
||||
OpDecorate %182 RelaxedPrecision
|
||||
OpDecorate %183 RelaxedPrecision
|
||||
OpDecorate %184 RelaxedPrecision
|
||||
OpDecorate %185 RelaxedPrecision
|
||||
OpDecorate %186 RelaxedPrecision
|
||||
OpDecorate %187 RelaxedPrecision
|
||||
OpDecorate %188 RelaxedPrecision
|
||||
OpDecorate %189 RelaxedPrecision
|
||||
OpDecorate %190 RelaxedPrecision
|
||||
OpDecorate %191 RelaxedPrecision
|
||||
OpDecorate %192 RelaxedPrecision
|
||||
OpDecorate %193 RelaxedPrecision
|
||||
OpDecorate %194 RelaxedPrecision
|
||||
OpDecorate %arr RelaxedPrecision
|
||||
OpDecorate %arr2 RelaxedPrecision
|
||||
OpMemberDecorate %block 0 RelaxedPrecision
|
||||
OpMemberDecorate %block 0 Offset 0
|
||||
OpDecorate %block Block
|
||||
OpDecorate %instanceName DescriptorSet 0
|
||||
OpDecorate %instanceName Binding 0
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%v4uint = OpTypeVector %uint 4
|
||||
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%_ptr_Function_v3int = OpTypePointer Function %v3int
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%int_3 = OpConstant %int 3
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%v2float = OpTypeVector %float 2
|
||||
%mat2v2float = OpTypeMatrix %v2float 2
|
||||
%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
|
||||
%float_1 = OpConstant %float 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%int_1 = OpConstant %int 1
|
||||
%mat4v4float = OpTypeMatrix %v4float 4
|
||||
%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
|
||||
%bool = OpTypeBool
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%_arr_float_uint_5 = OpTypeArray %float %uint_5
|
||||
%_ptr_Private__arr_float_uint_5 = OpTypePointer Private %_arr_float_uint_5
|
||||
%a = OpVariable %_ptr_Private__arr_float_uint_5 Private
|
||||
%S = OpTypeStruct %int
|
||||
%_ptr_Private_S = OpTypePointer Private %S
|
||||
%s = OpVariable %_ptr_Private_S Private
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_arr_int_uint_2 = OpTypeArray %int %uint_2
|
||||
%_ptr_Function__arr_int_uint_2 = OpTypePointer Function %_arr_int_uint_2
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%_ptr_Function__arr_int_uint_3 = OpTypePointer Function %_arr_int_uint_3
|
||||
%int_2 = OpConstant %int 2
|
||||
%block = OpTypeStruct %float
|
||||
%_ptr_Uniform_block = OpTypePointer Uniform %block
|
||||
%instanceName = OpVariable %_ptr_Uniform_block Uniform
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%f = OpVariable %_ptr_Function_float Function
|
||||
%v4 = OpVariable %_ptr_Function_v4float Function
|
||||
%u = OpVariable %_ptr_Function_uint Function
|
||||
%uv4 = OpVariable %_ptr_Function_v4uint Function
|
||||
%iv3 = OpVariable %_ptr_Function_v3int Function
|
||||
%i = OpVariable %_ptr_Function_int Function
|
||||
%uv3 = OpVariable %_ptr_Function_v3uint Function
|
||||
%m2 = OpVariable %_ptr_Function_mat2v2float Function
|
||||
%iv4 = OpVariable %_ptr_Function_v4int Function
|
||||
%m4 = OpVariable %_ptr_Function_mat4v4float Function
|
||||
%b = OpVariable %_ptr_Function_bool Function
|
||||
%arr = OpVariable %_ptr_Function__arr_int_uint_2 Function
|
||||
%arr2 = OpVariable %_ptr_Function__arr_int_uint_3 Function
|
||||
%9 = OpLoad %float %f
|
||||
%13 = OpLoad %v4float %v4
|
||||
%14 = OpVectorTimesScalar %v4float %13 %9
|
||||
%18 = OpLoad %uint %u
|
||||
%19 = OpLoad %uint %u
|
||||
%20 = OpIAdd %uint %18 %19
|
||||
%24 = OpLoad %v4uint %uv4
|
||||
%25 = OpLoad %uint %u
|
||||
%26 = OpCompositeConstruct %v4uint %25 %25 %25 %25
|
||||
%27 = OpUDiv %v4uint %24 %26
|
||||
%32 = OpLoad %v3int %iv3
|
||||
%33 = OpLoad %v3int %iv3
|
||||
%34 = OpISub %v3int %33 %32
|
||||
OpStore %iv3 %34
|
||||
%38 = OpLoad %int %i
|
||||
%39 = OpSMod %int %38 %int_3
|
||||
OpStore %i %39
|
||||
%43 = OpLoad %v3uint %uv3
|
||||
%45 = OpCompositeConstruct %v3uint %uint_4 %uint_4 %uint_4
|
||||
%46 = OpUMod %v3uint %43 %45
|
||||
%51 = OpLoad %mat2v2float %m2
|
||||
%53 = OpCompositeConstruct %v2float %float_1 %float_1
|
||||
%54 = OpCompositeExtract %v2float %51 0
|
||||
%55 = OpFSub %v2float %54 %53
|
||||
%56 = OpCompositeExtract %v2float %51 1
|
||||
%57 = OpFSub %v2float %56 %53
|
||||
%58 = OpCompositeConstruct %mat2v2float %55 %57
|
||||
OpStore %m2 %58
|
||||
%62 = OpLoad %v4int %iv4
|
||||
%64 = OpCompositeConstruct %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%65 = OpIAdd %v4int %62 %64
|
||||
OpStore %iv4 %65
|
||||
%69 = OpLoad %mat4v4float %m4
|
||||
%70 = OpLoad %mat4v4float %m4
|
||||
%72 = OpCompositeExtract %v4float %69 0
|
||||
%73 = OpCompositeExtract %v4float %70 0
|
||||
%75 = OpFOrdNotEqual %v4bool %72 %73
|
||||
%76 = OpAny %bool %75
|
||||
%77 = OpCompositeExtract %v4float %69 1
|
||||
%78 = OpCompositeExtract %v4float %70 1
|
||||
%79 = OpFOrdNotEqual %v4bool %77 %78
|
||||
%80 = OpAny %bool %79
|
||||
%81 = OpLogicalOr %bool %76 %80
|
||||
%82 = OpCompositeExtract %v4float %69 2
|
||||
%83 = OpCompositeExtract %v4float %70 2
|
||||
%84 = OpFOrdNotEqual %v4bool %82 %83
|
||||
%85 = OpAny %bool %84
|
||||
%86 = OpLogicalOr %bool %81 %85
|
||||
%87 = OpCompositeExtract %v4float %69 3
|
||||
%88 = OpCompositeExtract %v4float %70 3
|
||||
%89 = OpFOrdNotEqual %v4bool %87 %88
|
||||
%90 = OpAny %bool %89
|
||||
%91 = OpLogicalOr %bool %86 %90
|
||||
%92 = OpLoad %mat2v2float %m2
|
||||
%93 = OpLoad %mat2v2float %m2
|
||||
%94 = OpCompositeExtract %v2float %92 0
|
||||
%95 = OpCompositeExtract %v2float %93 0
|
||||
%97 = OpFOrdEqual %v2bool %94 %95
|
||||
%98 = OpAll %bool %97
|
||||
%99 = OpCompositeExtract %v2float %92 1
|
||||
%100 = OpCompositeExtract %v2float %93 1
|
||||
%101 = OpFOrdEqual %v2bool %99 %100
|
||||
%102 = OpAll %bool %101
|
||||
%103 = OpLogicalAnd %bool %98 %102
|
||||
%104 = OpLoad %int %i
|
||||
%105 = OpLoad %int %i
|
||||
%106 = OpSLessThanEqual %bool %104 %105
|
||||
%111 = OpLoad %_arr_float_uint_5 %a
|
||||
%112 = OpLoad %_arr_float_uint_5 %a
|
||||
%113 = OpCompositeExtract %float %111 0
|
||||
%114 = OpCompositeExtract %float %112 0
|
||||
%115 = OpFOrdEqual %bool %113 %114
|
||||
%116 = OpCompositeExtract %float %111 1
|
||||
%117 = OpCompositeExtract %float %112 1
|
||||
%118 = OpFOrdEqual %bool %116 %117
|
||||
%119 = OpLogicalAnd %bool %115 %118
|
||||
%120 = OpCompositeExtract %float %111 2
|
||||
%121 = OpCompositeExtract %float %112 2
|
||||
%122 = OpFOrdEqual %bool %120 %121
|
||||
%123 = OpLogicalAnd %bool %119 %122
|
||||
%124 = OpCompositeExtract %float %111 3
|
||||
%125 = OpCompositeExtract %float %112 3
|
||||
%126 = OpFOrdEqual %bool %124 %125
|
||||
%127 = OpLogicalAnd %bool %123 %126
|
||||
%128 = OpCompositeExtract %float %111 4
|
||||
%129 = OpCompositeExtract %float %112 4
|
||||
%130 = OpFOrdEqual %bool %128 %129
|
||||
%131 = OpLogicalAnd %bool %127 %130
|
||||
%135 = OpLoad %S %s
|
||||
%136 = OpLoad %S %s
|
||||
%137 = OpCompositeExtract %int %135 0
|
||||
%138 = OpCompositeExtract %int %136 0
|
||||
%139 = OpINotEqual %bool %137 %138
|
||||
%142 = OpLoad %bool %b
|
||||
%143 = OpLoad %bool %b
|
||||
%144 = OpLogicalAnd %bool %142 %143
|
||||
%145 = OpLoad %bool %b
|
||||
%146 = OpLoad %bool %b
|
||||
%147 = OpLogicalOr %bool %145 %146
|
||||
%148 = OpLoad %bool %b
|
||||
%149 = OpLoad %bool %b
|
||||
%150 = OpLogicalNotEqual %bool %148 %149
|
||||
%151 = OpLoad %bool %b
|
||||
%152 = OpLogicalNot %bool %151
|
||||
%153 = OpLoad %int %i
|
||||
%154 = OpNot %int %153
|
||||
%155 = OpLoad %uint %u
|
||||
%156 = OpNot %uint %155
|
||||
%157 = OpLoad %v3uint %uv3
|
||||
%158 = OpNot %v3uint %157
|
||||
%159 = OpLoad %v3int %iv3
|
||||
%160 = OpNot %v3int %159
|
||||
%161 = OpLoad %int %i
|
||||
%162 = OpLoad %v3uint %uv3
|
||||
%163 = OpCompositeConstruct %v3int %161 %161 %161
|
||||
%164 = OpShiftLeftLogical %v3uint %162 %163
|
||||
OpStore %uv3 %164
|
||||
%165 = OpLoad %int %i
|
||||
%166 = OpLoad %int %i
|
||||
%167 = OpShiftRightArithmetic %int %165 %166
|
||||
%168 = OpLoad %uint %u
|
||||
%169 = OpLoad %uint %u
|
||||
%170 = OpShiftLeftLogical %uint %168 %169
|
||||
%171 = OpLoad %v3int %iv3
|
||||
%172 = OpLoad %v3int %iv3
|
||||
%173 = OpShiftRightArithmetic %v3int %171 %172
|
||||
%174 = OpLoad %int %i
|
||||
%175 = OpLoad %int %i
|
||||
%176 = OpBitwiseAnd %int %174 %175
|
||||
%177 = OpLoad %uint %u
|
||||
%178 = OpLoad %uint %u
|
||||
%179 = OpBitwiseOr %uint %177 %178
|
||||
%180 = OpLoad %v3int %iv3
|
||||
%181 = OpLoad %v3int %iv3
|
||||
%182 = OpBitwiseXor %v3int %180 %181
|
||||
%183 = OpLoad %uint %u
|
||||
%184 = OpLoad %v3uint %uv3
|
||||
%185 = OpCompositeConstruct %v3uint %183 %183 %183
|
||||
%186 = OpBitwiseAnd %v3uint %185 %184
|
||||
%187 = OpLoad %v3uint %uv3
|
||||
%188 = OpLoad %uint %u
|
||||
%189 = OpCompositeConstruct %v3uint %188 %188 %188
|
||||
%190 = OpBitwiseOr %v3uint %187 %189
|
||||
%191 = OpLoad %uint %u
|
||||
%192 = OpLoad %v3uint %uv3
|
||||
%193 = OpCompositeConstruct %v3uint %191 %191 %191
|
||||
%194 = OpBitwiseAnd %v3uint %192 %193
|
||||
OpStore %uv3 %194
|
||||
OpReturn
|
||||
OpFunctionEnd
|
396
Test/baseResults/web.texture.frag.out
Normal file
396
Test/baseResults/web.texture.frag.out
Normal file
@ -0,0 +1,396 @@
|
||||
; SPIR-V
|
||||
; Version: 1.0
|
||||
; Generator: Khronos Glslang Reference Front End; 7
|
||||
; Bound: 189
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability ImageQuery
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %c2D %c4D %c3D %ic3D %ic1D %c1D %ic4D %s2 %sc %sf
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %v "v"
|
||||
OpName %s2D "s2D"
|
||||
OpName %c2D "c2D"
|
||||
OpName %s3D "s3D"
|
||||
OpName %c4D "c4D"
|
||||
OpName %s2DArray "s2DArray"
|
||||
OpName %c3D "c3D"
|
||||
OpName %ic3D "ic3D"
|
||||
OpName %ic1D "ic1D"
|
||||
OpName %f "f"
|
||||
OpName %s2DShadow "s2DShadow"
|
||||
OpName %c1D "c1D"
|
||||
OpName %sCube "sCube"
|
||||
OpName %s2DArrayShadow "s2DArrayShadow"
|
||||
OpName %iv "iv"
|
||||
OpName %is2D "is2D"
|
||||
OpName %is3D "is3D"
|
||||
OpName %isCube "isCube"
|
||||
OpName %is2DArray "is2DArray"
|
||||
OpName %sCubeShadow "sCubeShadow"
|
||||
OpName %us2D "us2D"
|
||||
OpName %us3D "us3D"
|
||||
OpName %usCube "usCube"
|
||||
OpName %us2DArray "us2DArray"
|
||||
OpName %ic4D "ic4D"
|
||||
OpName %S2 "S2"
|
||||
OpMemberName %S2 0 "c"
|
||||
OpMemberName %S2 1 "f"
|
||||
OpName %s2 "s2"
|
||||
OpName %sc "sc"
|
||||
OpName %sf "sf"
|
||||
OpName %arrayedSampler "arrayedSampler"
|
||||
OpDecorate %v RelaxedPrecision
|
||||
OpDecorate %s2D RelaxedPrecision
|
||||
OpDecorate %s2D DescriptorSet 0
|
||||
OpDecorate %s2D Binding 1
|
||||
OpDecorate %14 RelaxedPrecision
|
||||
OpDecorate %c2D RelaxedPrecision
|
||||
OpDecorate %c2D Location 5
|
||||
OpDecorate %18 RelaxedPrecision
|
||||
OpDecorate %19 RelaxedPrecision
|
||||
OpDecorate %s3D RelaxedPrecision
|
||||
OpDecorate %s3D DescriptorSet 0
|
||||
OpDecorate %s3D Binding 2
|
||||
OpDecorate %24 RelaxedPrecision
|
||||
OpDecorate %c4D RelaxedPrecision
|
||||
OpDecorate %c4D Location 7
|
||||
OpDecorate %27 RelaxedPrecision
|
||||
OpDecorate %28 RelaxedPrecision
|
||||
OpDecorate %s2DArray RelaxedPrecision
|
||||
OpDecorate %s2DArray DescriptorSet 0
|
||||
OpDecorate %s2DArray Binding 6
|
||||
OpDecorate %33 RelaxedPrecision
|
||||
OpDecorate %c3D RelaxedPrecision
|
||||
OpDecorate %c3D Location 6
|
||||
OpDecorate %37 RelaxedPrecision
|
||||
OpDecorate %39 RelaxedPrecision
|
||||
OpDecorate %40 RelaxedPrecision
|
||||
OpDecorate %ic3D RelaxedPrecision
|
||||
OpDecorate %ic3D Flat
|
||||
OpDecorate %ic3D Location 2
|
||||
OpDecorate %45 RelaxedPrecision
|
||||
OpDecorate %ic1D RelaxedPrecision
|
||||
OpDecorate %ic1D Flat
|
||||
OpDecorate %ic1D Location 1
|
||||
OpDecorate %48 RelaxedPrecision
|
||||
OpDecorate %50 RelaxedPrecision
|
||||
OpDecorate %f RelaxedPrecision
|
||||
OpDecorate %s2DShadow RelaxedPrecision
|
||||
OpDecorate %s2DShadow DescriptorSet 0
|
||||
OpDecorate %s2DShadow Binding 5
|
||||
OpDecorate %57 RelaxedPrecision
|
||||
OpDecorate %58 RelaxedPrecision
|
||||
OpDecorate %c1D RelaxedPrecision
|
||||
OpDecorate %c1D Location 4
|
||||
OpDecorate %61 RelaxedPrecision
|
||||
OpDecorate %67 RelaxedPrecision
|
||||
OpDecorate %68 RelaxedPrecision
|
||||
OpDecorate %69 RelaxedPrecision
|
||||
OpDecorate %70 RelaxedPrecision
|
||||
OpDecorate %71 RelaxedPrecision
|
||||
OpDecorate %sCube RelaxedPrecision
|
||||
OpDecorate %sCube DescriptorSet 0
|
||||
OpDecorate %sCube Binding 3
|
||||
OpDecorate %76 RelaxedPrecision
|
||||
OpDecorate %77 RelaxedPrecision
|
||||
OpDecorate %78 RelaxedPrecision
|
||||
OpDecorate %79 RelaxedPrecision
|
||||
OpDecorate %80 RelaxedPrecision
|
||||
OpDecorate %s2DArrayShadow RelaxedPrecision
|
||||
OpDecorate %s2DArrayShadow DescriptorSet 0
|
||||
OpDecorate %s2DArrayShadow Binding 7
|
||||
OpDecorate %85 RelaxedPrecision
|
||||
OpDecorate %86 RelaxedPrecision
|
||||
OpDecorate %87 RelaxedPrecision
|
||||
OpDecorate %88 RelaxedPrecision
|
||||
OpDecorate %90 RelaxedPrecision
|
||||
OpDecorate %91 RelaxedPrecision
|
||||
OpDecorate %92 RelaxedPrecision
|
||||
OpDecorate %93 RelaxedPrecision
|
||||
OpDecorate %94 RelaxedPrecision
|
||||
OpDecorate %95 RelaxedPrecision
|
||||
OpDecorate %96 RelaxedPrecision
|
||||
OpDecorate %97 RelaxedPrecision
|
||||
OpDecorate %98 RelaxedPrecision
|
||||
OpDecorate %99 RelaxedPrecision
|
||||
OpDecorate %100 RelaxedPrecision
|
||||
OpDecorate %iv RelaxedPrecision
|
||||
OpDecorate %is2D RelaxedPrecision
|
||||
OpDecorate %is2D DescriptorSet 0
|
||||
OpDecorate %is2D Binding 8
|
||||
OpDecorate %108 RelaxedPrecision
|
||||
OpDecorate %109 RelaxedPrecision
|
||||
OpDecorate %110 RelaxedPrecision
|
||||
OpDecorate %111 RelaxedPrecision
|
||||
OpDecorate %112 RelaxedPrecision
|
||||
OpDecorate %115 RelaxedPrecision
|
||||
OpDecorate %116 RelaxedPrecision
|
||||
OpDecorate %117 RelaxedPrecision
|
||||
OpDecorate %118 RelaxedPrecision
|
||||
OpDecorate %119 RelaxedPrecision
|
||||
OpDecorate %120 RelaxedPrecision
|
||||
OpDecorate %121 RelaxedPrecision
|
||||
OpDecorate %122 RelaxedPrecision
|
||||
OpDecorate %123 RelaxedPrecision
|
||||
OpDecorate %124 RelaxedPrecision
|
||||
OpDecorate %is3D RelaxedPrecision
|
||||
OpDecorate %is3D DescriptorSet 0
|
||||
OpDecorate %is3D Binding 9
|
||||
OpDecorate %129 RelaxedPrecision
|
||||
OpDecorate %130 RelaxedPrecision
|
||||
OpDecorate %132 RelaxedPrecision
|
||||
OpDecorate %isCube RelaxedPrecision
|
||||
OpDecorate %isCube DescriptorSet 0
|
||||
OpDecorate %isCube Binding 10
|
||||
OpDecorate %137 RelaxedPrecision
|
||||
OpDecorate %138 RelaxedPrecision
|
||||
OpDecorate %139 RelaxedPrecision
|
||||
OpDecorate %140 RelaxedPrecision
|
||||
OpDecorate %is2DArray RelaxedPrecision
|
||||
OpDecorate %is2DArray DescriptorSet 0
|
||||
OpDecorate %is2DArray Binding 11
|
||||
OpDecorate %145 RelaxedPrecision
|
||||
OpDecorate %146 RelaxedPrecision
|
||||
OpDecorate %147 RelaxedPrecision
|
||||
OpDecorate %149 RelaxedPrecision
|
||||
OpDecorate %sCubeShadow RelaxedPrecision
|
||||
OpDecorate %sCubeShadow DescriptorSet 0
|
||||
OpDecorate %sCubeShadow Binding 4
|
||||
OpDecorate %154 RelaxedPrecision
|
||||
OpDecorate %us2D RelaxedPrecision
|
||||
OpDecorate %us2D DescriptorSet 0
|
||||
OpDecorate %us2D Binding 12
|
||||
OpDecorate %us3D RelaxedPrecision
|
||||
OpDecorate %us3D DescriptorSet 0
|
||||
OpDecorate %us3D Binding 13
|
||||
OpDecorate %usCube RelaxedPrecision
|
||||
OpDecorate %usCube DescriptorSet 0
|
||||
OpDecorate %usCube Binding 14
|
||||
OpDecorate %us2DArray RelaxedPrecision
|
||||
OpDecorate %us2DArray DescriptorSet 0
|
||||
OpDecorate %us2DArray Binding 15
|
||||
OpDecorate %ic4D RelaxedPrecision
|
||||
OpDecorate %ic4D Flat
|
||||
OpDecorate %ic4D Location 3
|
||||
OpDecorate %65 RelaxedPrecision
|
||||
OpMemberDecorate %S2 0 RelaxedPrecision
|
||||
OpMemberDecorate %S2 1 RelaxedPrecision
|
||||
OpDecorate %s2 Location 8
|
||||
OpDecorate %sc RelaxedPrecision
|
||||
OpDecorate %sc Location 0
|
||||
OpDecorate %sf RelaxedPrecision
|
||||
OpDecorate %sf Location 1
|
||||
OpDecorate %arrayedSampler RelaxedPrecision
|
||||
OpDecorate %arrayedSampler DescriptorSet 0
|
||||
OpDecorate %arrayedSampler Binding 0
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%10 = OpTypeImage %float 2D 0 0 0 1 Unknown
|
||||
%11 = OpTypeSampledImage %10
|
||||
%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
|
||||
%s2D = OpVariable %_ptr_UniformConstant_11 UniformConstant
|
||||
%v2float = OpTypeVector %float 2
|
||||
%_ptr_Input_v2float = OpTypePointer Input %v2float
|
||||
%c2D = OpVariable %_ptr_Input_v2float Input
|
||||
%20 = OpTypeImage %float 3D 0 0 0 1 Unknown
|
||||
%21 = OpTypeSampledImage %20
|
||||
%_ptr_UniformConstant_21 = OpTypePointer UniformConstant %21
|
||||
%s3D = OpVariable %_ptr_UniformConstant_21 UniformConstant
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%c4D = OpVariable %_ptr_Input_v4float Input
|
||||
%29 = OpTypeImage %float 2D 0 1 0 1 Unknown
|
||||
%30 = OpTypeSampledImage %29
|
||||
%_ptr_UniformConstant_30 = OpTypePointer UniformConstant %30
|
||||
%s2DArray = OpVariable %_ptr_UniformConstant_30 UniformConstant
|
||||
%v3float = OpTypeVector %float 3
|
||||
%_ptr_Input_v3float = OpTypePointer Input %v3float
|
||||
%c3D = OpVariable %_ptr_Input_v3float Input
|
||||
%float_1_20000005 = OpConstant %float 1.20000005
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%_ptr_Input_v3int = OpTypePointer Input %v3int
|
||||
%ic3D = OpVariable %_ptr_Input_v3int Input
|
||||
%_ptr_Input_int = OpTypePointer Input %int
|
||||
%ic1D = OpVariable %_ptr_Input_int Input
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%53 = OpTypeImage %float 2D 1 0 0 1 Unknown
|
||||
%54 = OpTypeSampledImage %53
|
||||
%_ptr_UniformConstant_54 = OpTypePointer UniformConstant %54
|
||||
%s2DShadow = OpVariable %_ptr_UniformConstant_54 UniformConstant
|
||||
%_ptr_Input_float = OpTypePointer Input %float
|
||||
%c1D = OpVariable %_ptr_Input_float Input
|
||||
%v2int = OpTypeVector %int 2
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_3 = OpConstant %int 3
|
||||
%65 = OpConstantComposite %v2int %int_2 %int_3
|
||||
%72 = OpTypeImage %float Cube 0 0 0 1 Unknown
|
||||
%73 = OpTypeSampledImage %72
|
||||
%_ptr_UniformConstant_73 = OpTypePointer UniformConstant %73
|
||||
%sCube = OpVariable %_ptr_UniformConstant_73 UniformConstant
|
||||
%81 = OpTypeImage %float 2D 1 1 0 1 Unknown
|
||||
%82 = OpTypeSampledImage %81
|
||||
%_ptr_UniformConstant_82 = OpTypePointer UniformConstant %82
|
||||
%s2DArrayShadow = OpVariable %_ptr_UniformConstant_82 UniformConstant
|
||||
%v4int = OpTypeVector %int 4
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%104 = OpTypeImage %int 2D 0 0 0 1 Unknown
|
||||
%105 = OpTypeSampledImage %104
|
||||
%_ptr_UniformConstant_105 = OpTypePointer UniformConstant %105
|
||||
%is2D = OpVariable %_ptr_UniformConstant_105 UniformConstant
|
||||
%125 = OpTypeImage %int 3D 0 0 0 1 Unknown
|
||||
%126 = OpTypeSampledImage %125
|
||||
%_ptr_UniformConstant_126 = OpTypePointer UniformConstant %126
|
||||
%is3D = OpVariable %_ptr_UniformConstant_126 UniformConstant
|
||||
%float_4_19999981 = OpConstant %float 4.19999981
|
||||
%133 = OpTypeImage %int Cube 0 0 0 1 Unknown
|
||||
%134 = OpTypeSampledImage %133
|
||||
%_ptr_UniformConstant_134 = OpTypePointer UniformConstant %134
|
||||
%isCube = OpVariable %_ptr_UniformConstant_134 UniformConstant
|
||||
%141 = OpTypeImage %int 2D 0 1 0 1 Unknown
|
||||
%142 = OpTypeSampledImage %141
|
||||
%_ptr_UniformConstant_142 = OpTypePointer UniformConstant %142
|
||||
%is2DArray = OpVariable %_ptr_UniformConstant_142 UniformConstant
|
||||
%150 = OpTypeImage %float Cube 1 0 0 1 Unknown
|
||||
%151 = OpTypeSampledImage %150
|
||||
%_ptr_UniformConstant_151 = OpTypePointer UniformConstant %151
|
||||
%sCubeShadow = OpVariable %_ptr_UniformConstant_151 UniformConstant
|
||||
%uint = OpTypeInt 32 0
|
||||
%160 = OpTypeImage %uint 2D 0 0 0 1 Unknown
|
||||
%161 = OpTypeSampledImage %160
|
||||
%_ptr_UniformConstant_161 = OpTypePointer UniformConstant %161
|
||||
%us2D = OpVariable %_ptr_UniformConstant_161 UniformConstant
|
||||
%164 = OpTypeImage %uint 3D 0 0 0 1 Unknown
|
||||
%165 = OpTypeSampledImage %164
|
||||
%_ptr_UniformConstant_165 = OpTypePointer UniformConstant %165
|
||||
%us3D = OpVariable %_ptr_UniformConstant_165 UniformConstant
|
||||
%168 = OpTypeImage %uint Cube 0 0 0 1 Unknown
|
||||
%169 = OpTypeSampledImage %168
|
||||
%_ptr_UniformConstant_169 = OpTypePointer UniformConstant %169
|
||||
%usCube = OpVariable %_ptr_UniformConstant_169 UniformConstant
|
||||
%172 = OpTypeImage %uint 2D 0 1 0 1 Unknown
|
||||
%173 = OpTypeSampledImage %172
|
||||
%_ptr_UniformConstant_173 = OpTypePointer UniformConstant %173
|
||||
%us2DArray = OpVariable %_ptr_UniformConstant_173 UniformConstant
|
||||
%_ptr_Input_v4int = OpTypePointer Input %v4int
|
||||
%ic4D = OpVariable %_ptr_Input_v4int Input
|
||||
%S2 = OpTypeStruct %v3float %float
|
||||
%_ptr_Input_S2 = OpTypePointer Input %S2
|
||||
%s2 = OpVariable %_ptr_Input_S2 Input
|
||||
%_ptr_Output_v3float = OpTypePointer Output %v3float
|
||||
%sc = OpVariable %_ptr_Output_v3float Output
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%sf = OpVariable %_ptr_Output_float Output
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%_arr_11_uint_5 = OpTypeArray %11 %uint_5
|
||||
%_ptr_UniformConstant__arr_11_uint_5 = OpTypePointer UniformConstant %_arr_11_uint_5
|
||||
%arrayedSampler = OpVariable %_ptr_UniformConstant__arr_11_uint_5 UniformConstant
|
||||
%main = OpFunction %void None %3
|
||||
%5 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_v4float Function
|
||||
%f = OpVariable %_ptr_Function_float Function
|
||||
%iv = OpVariable %_ptr_Function_v4int Function
|
||||
%14 = OpLoad %11 %s2D
|
||||
%18 = OpLoad %v2float %c2D
|
||||
%19 = OpImageSampleImplicitLod %v4float %14 %18
|
||||
OpStore %v %19
|
||||
%24 = OpLoad %21 %s3D
|
||||
%27 = OpLoad %v4float %c4D
|
||||
%28 = OpImageSampleProjImplicitLod %v4float %24 %27
|
||||
OpStore %v %28
|
||||
%33 = OpLoad %30 %s2DArray
|
||||
%37 = OpLoad %v3float %c3D
|
||||
%39 = OpImageSampleExplicitLod %v4float %33 %37 Lod %float_1_20000005
|
||||
OpStore %v %39
|
||||
%40 = OpLoad %21 %s3D
|
||||
%45 = OpLoad %v3int %ic3D
|
||||
%48 = OpLoad %int %ic1D
|
||||
%49 = OpImage %20 %40
|
||||
%50 = OpImageFetch %v4float %49 %45 Lod %48
|
||||
OpStore %v %50
|
||||
%57 = OpLoad %54 %s2DShadow
|
||||
%58 = OpLoad %v3float %c3D
|
||||
%61 = OpLoad %float %c1D
|
||||
%66 = OpCompositeExtract %float %58 2
|
||||
%67 = OpImageSampleDrefExplicitLod %float %57 %58 %66 Lod|ConstOffset %61 %65
|
||||
OpStore %f %67
|
||||
%68 = OpLoad %11 %s2D
|
||||
%69 = OpLoad %v3float %c3D
|
||||
%70 = OpLoad %float %c1D
|
||||
%71 = OpImageSampleProjExplicitLod %v4float %68 %69 Lod|ConstOffset %70 %65
|
||||
OpStore %v %71
|
||||
%76 = OpLoad %73 %sCube
|
||||
%77 = OpLoad %v3float %c3D
|
||||
%78 = OpLoad %v3float %c3D
|
||||
%79 = OpLoad %v3float %c3D
|
||||
%80 = OpImageSampleExplicitLod %v4float %76 %77 Grad %78 %79
|
||||
OpStore %v %80
|
||||
%85 = OpLoad %82 %s2DArrayShadow
|
||||
%86 = OpLoad %v4float %c4D
|
||||
%87 = OpLoad %v2float %c2D
|
||||
%88 = OpLoad %v2float %c2D
|
||||
%89 = OpCompositeExtract %float %86 3
|
||||
%90 = OpImageSampleDrefExplicitLod %float %85 %86 %89 Grad|ConstOffset %87 %88 %65
|
||||
OpStore %f %90
|
||||
%91 = OpLoad %21 %s3D
|
||||
%92 = OpLoad %v4float %c4D
|
||||
%93 = OpLoad %v3float %c3D
|
||||
%94 = OpLoad %v3float %c3D
|
||||
%95 = OpImageSampleProjExplicitLod %v4float %91 %92 Grad %93 %94
|
||||
OpStore %v %95
|
||||
%96 = OpLoad %11 %s2D
|
||||
%97 = OpLoad %v3float %c3D
|
||||
%98 = OpLoad %v2float %c2D
|
||||
%99 = OpLoad %v2float %c2D
|
||||
%100 = OpImageSampleProjExplicitLod %v4float %96 %97 Grad|ConstOffset %98 %99 %65
|
||||
OpStore %v %100
|
||||
%108 = OpLoad %105 %is2D
|
||||
%109 = OpLoad %v2float %c2D
|
||||
%110 = OpImageSampleImplicitLod %v4int %108 %109
|
||||
OpStore %iv %110
|
||||
%111 = OpLoad %105 %is2D
|
||||
%112 = OpLoad %v4float %c4D
|
||||
%113 = OpCompositeExtract %float %112 3
|
||||
%114 = OpCompositeInsert %v4float %113 %112 2
|
||||
%115 = OpImageSampleProjImplicitLod %v4int %111 %114 ConstOffset %65
|
||||
OpStore %iv %115
|
||||
%116 = OpLoad %105 %is2D
|
||||
%117 = OpLoad %v3float %c3D
|
||||
%118 = OpLoad %float %c1D
|
||||
%119 = OpImageSampleProjExplicitLod %v4int %116 %117 Lod %118
|
||||
OpStore %iv %119
|
||||
%120 = OpLoad %105 %is2D
|
||||
%121 = OpLoad %v3float %c3D
|
||||
%122 = OpLoad %v2float %c2D
|
||||
%123 = OpLoad %v2float %c2D
|
||||
%124 = OpImageSampleProjExplicitLod %v4int %120 %121 Grad %122 %123
|
||||
OpStore %iv %124
|
||||
%129 = OpLoad %126 %is3D
|
||||
%130 = OpLoad %v3float %c3D
|
||||
%132 = OpImageSampleImplicitLod %v4int %129 %130 Bias %float_4_19999981
|
||||
OpStore %iv %132
|
||||
%137 = OpLoad %134 %isCube
|
||||
%138 = OpLoad %v3float %c3D
|
||||
%139 = OpLoad %float %c1D
|
||||
%140 = OpImageSampleExplicitLod %v4int %137 %138 Lod %139
|
||||
OpStore %iv %140
|
||||
%145 = OpLoad %142 %is2DArray
|
||||
%146 = OpLoad %v3int %ic3D
|
||||
%147 = OpLoad %int %ic1D
|
||||
%148 = OpImage %141 %145
|
||||
%149 = OpImageFetch %v4int %148 %146 Lod %147
|
||||
OpStore %iv %149
|
||||
%154 = OpLoad %151 %sCubeShadow
|
||||
%155 = OpImage %150 %154
|
||||
%156 = OpImageQuerySizeLod %v2int %155 %int_2
|
||||
%157 = OpLoad %v4int %iv
|
||||
%158 = OpVectorShuffle %v4int %157 %156 4 5 2 3
|
||||
OpStore %iv %158
|
||||
OpReturn
|
||||
OpFunctionEnd
|
@ -10,8 +10,8 @@ int b[5];
|
||||
int c[];
|
||||
int i;
|
||||
|
||||
buffer bnameRuntime { float r[]; };
|
||||
buffer bnameImplicit { float m[]; };
|
||||
layout (binding = 0) buffer bnameRuntime { float r[]; };
|
||||
layout (binding = 1) buffer bnameImplicit { float m[]; };
|
||||
|
||||
void main()
|
||||
{
|
||||
|
@ -8,8 +8,8 @@ int b[];
|
||||
int c[7];
|
||||
int i;
|
||||
|
||||
buffer bnameRuntime { float r[]; };
|
||||
buffer bnameImplicit { float m[4]; };
|
||||
layout (binding = 0) buffer bnameRuntime { float r[]; };
|
||||
layout (binding = 1) buffer bnameImplicit { float m[4]; };
|
||||
|
||||
vec4 getColor()
|
||||
{
|
||||
|
@ -20,6 +20,11 @@ buffer MultipleArrays {
|
||||
float f[5];
|
||||
} multiarray;
|
||||
|
||||
buffer ArrayedBind {
|
||||
float a;
|
||||
float b;
|
||||
} buffers[3];
|
||||
|
||||
uniform UBO {
|
||||
VertexInfo verts[2];
|
||||
float flt[8];
|
||||
@ -52,6 +57,7 @@ void main()
|
||||
f += ubo.flt[gl_InstanceID];
|
||||
f += ubo.uniform_multi[0][0][0];
|
||||
f += uniform_multi[gl_InstanceID][gl_InstanceID][gl_InstanceID];
|
||||
f += buffers[gl_InstanceID].b;
|
||||
TriangleInfo tlocal[5] = t;
|
||||
outval.val = f;
|
||||
outarr[2] = f;
|
||||
|
@ -55,8 +55,8 @@ diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASER
|
||||
# multi-threaded test
|
||||
#
|
||||
echo Comparing single thread to multithread for all tests in current directory...
|
||||
$EXE -i -C *.vert *.geom *.frag *.tes* *.comp > singleThread.out
|
||||
$EXE -i -C *.vert *.geom *.frag *.tes* *.comp -t > multiThread.out
|
||||
$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > singleThread.out
|
||||
$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > multiThread.out
|
||||
diff singleThread.out multiThread.out || HASERROR=1
|
||||
if [ $HASERROR -eq 0 ]
|
||||
then
|
||||
@ -145,7 +145,7 @@ echo Testing SPV Debug Information
|
||||
$EXE -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
|
||||
-G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out
|
||||
diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1
|
||||
$EXE -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf --spirv-val \
|
||||
$EXE -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
|
||||
-G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.1.1.frag.out
|
||||
diff -b $BASEDIR/spv.debugInfo.1.1.frag.out $TARGETDIR/spv.debugInfo.1.1.frag.out || HASERROR=1
|
||||
$EXE -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --spirv-val --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \
|
||||
|
25
Test/spv.1.4.constructComposite.comp
Normal file
25
Test/spv.1.4.constructComposite.comp
Normal file
@ -0,0 +1,25 @@
|
||||
#version 460 core
|
||||
|
||||
layout(local_size_x=64) in;
|
||||
|
||||
struct sA {
|
||||
int x, y;
|
||||
};
|
||||
|
||||
struct sB {
|
||||
sA a;
|
||||
};
|
||||
|
||||
layout(binding=0,set=0) uniform ubo {
|
||||
sB b;
|
||||
};
|
||||
|
||||
struct sC {
|
||||
sA state;
|
||||
} c = {
|
||||
b.a,
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
}
|
25
Test/spv.constructComposite.comp
Normal file
25
Test/spv.constructComposite.comp
Normal file
@ -0,0 +1,25 @@
|
||||
#version 460 core
|
||||
|
||||
layout(local_size_x=64) in;
|
||||
|
||||
struct sA {
|
||||
int x, y;
|
||||
};
|
||||
|
||||
struct sB {
|
||||
sA a;
|
||||
};
|
||||
|
||||
layout(binding=0,set=0) uniform ubo {
|
||||
sB b;
|
||||
};
|
||||
|
||||
struct sC {
|
||||
sA state;
|
||||
} c = {
|
||||
b.a,
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
#version 450
|
||||
|
||||
buffer block {
|
||||
layout(binding = 0) buffer block {
|
||||
float m0;
|
||||
vec3 m4;
|
||||
//////
|
||||
|
117
Test/spv.intcoopmat.comp
Normal file
117
Test/spv.intcoopmat.comp
Normal file
@ -0,0 +1,117 @@
|
||||
#version 450 core
|
||||
#extension GL_KHR_memory_scope_semantics : enable
|
||||
#extension GL_NV_cooperative_matrix : enable
|
||||
#extension GL_NV_integer_cooperative_matrix : enable
|
||||
#extension GL_EXT_shader_explicit_arithmetic_types : enable
|
||||
#extension GL_EXT_buffer_reference : enable
|
||||
|
||||
layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
const int X = 8;
|
||||
layout(constant_id = 0) const int Y = 2;
|
||||
const int Z = X*Y;
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, Z, 8> miC;
|
||||
icoopmatNV<8, gl_ScopeSubgroup, Z, 8> miC2[3];
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, Z, 8> muC;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, Z, 8> muC2[3];
|
||||
|
||||
int iarr[miC.length()];
|
||||
int iarr2[miC2[1].length()];
|
||||
int uarr[muC.length()];
|
||||
int uarr2[muC2[1].length()];
|
||||
|
||||
const icoopmatNV<32, gl_ScopeSubgroup, Z, 8> mD = icoopmatNV<32, gl_ScopeSubgroup, Z, 8>(1);
|
||||
const ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> mD2 = ucoopmatNV<8, gl_ScopeSubgroup, 8, 8>(1);
|
||||
|
||||
struct S { int a; int b; int c; };
|
||||
|
||||
const S s = S(12, 23, 34);
|
||||
|
||||
layout(set = 0, binding = 0, buffer_reference) coherent buffer Block {
|
||||
uint y[1024*1024];
|
||||
uint x[];
|
||||
} block;
|
||||
|
||||
layout(set = 0, binding = 0) coherent buffer Block16 {
|
||||
int8_t y[1024*1024];
|
||||
int8_t x[];
|
||||
|
||||
Block b;
|
||||
} block8;
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 8, 8> ineg(icoopmatNV<8, gl_ScopeSubgroup, 8, 8> m) { return -m; }
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> umul(ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> m) { return m * uint8_t(2); }
|
||||
|
||||
layout(constant_id = 2) const int SC = 1;
|
||||
ucoopmatNV<32, gl_ScopeSubgroup, SC, SC> scm[SC][SC];
|
||||
|
||||
// sized for icoopmatNV<8, gl_ScopeSubgroup, 16, 16>
|
||||
shared uvec4 shmatrix[16*16*2/16];
|
||||
|
||||
void main()
|
||||
{
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> mu = ucoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)>(2);
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> mi = icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)>(2);
|
||||
|
||||
mu = mu + mu;
|
||||
mu = mu - mu;
|
||||
mi = -mi;
|
||||
mi = mi * int8_t(2);
|
||||
|
||||
fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> mf16_0 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(mu);
|
||||
fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> mf32_0 = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(mu);
|
||||
fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> mf16_1 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(mi);
|
||||
fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> mf32_1 = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(mi);
|
||||
|
||||
uint8_t x = mu[1];
|
||||
mi[0] = int8_t(x);
|
||||
|
||||
coopMatLoadNV(mi, block.x, 16, 128, false);
|
||||
coopMatStoreNV(mi, block.x, 16, 128, false);
|
||||
coopMatLoadNV(mu, block8.x, 16, 128, false);
|
||||
coopMatStoreNV(mu, block8.x, 16, 128, false);
|
||||
coopMatLoadNV(mi, block8.b.x, 16, 128, false);
|
||||
coopMatStoreNV(mi, block8.b.x, 16, 128, false);
|
||||
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> A;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> B;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> C;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> D;
|
||||
D = coopMatMulAddNV(A, B, C);
|
||||
|
||||
int l = D.length();
|
||||
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> a[5];
|
||||
a[3][0] = int8_t(1);
|
||||
|
||||
int md1 = mD[1];
|
||||
|
||||
md1 += (mi += mi)[1234];
|
||||
|
||||
muC2[0] = muC2[1];
|
||||
muC2[1][0] = (miC2[2][0]);
|
||||
|
||||
coopMatLoadNV(mi, block.y, 16, 128, false);
|
||||
coopMatStoreNV(mi, block.y, 16, 128, false);
|
||||
coopMatLoadNV(mu, block8.y, 16, 128, false);
|
||||
coopMatStoreNV(mu, block8.y, 16, 128, false);
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 8, 8> p1;
|
||||
ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> p2;
|
||||
|
||||
p1 = ineg(p1);
|
||||
p2 = umul(p2);
|
||||
|
||||
p1 /= p1;
|
||||
p2 /= p2;
|
||||
|
||||
p1 *= int8_t(2);
|
||||
p2 *= uint8_t(4);
|
||||
|
||||
icoopmatNV<8, gl_ScopeSubgroup, 16, 8> ms;
|
||||
coopMatLoadNV(ms, shmatrix, 1, 2, false);
|
||||
coopMatStoreNV(ms, shmatrix, 1, 2, false);
|
||||
|
||||
}
|
@ -21,8 +21,8 @@ void main()
|
||||
}
|
||||
|
||||
layout(binding = 0) uniform atomic_uint aui; // ERROR, no atomics in Vulkan
|
||||
layout(shared) uniform ub1n { int a; } ub1i; // ERROR, no shared
|
||||
layout(packed) uniform ub2n { int a; } ub2i; // ERROR, no packed
|
||||
layout(shared, binding = 1) uniform ub1n { int a; } ub1i; // ERROR, no shared
|
||||
layout(packed, binding = 2) uniform ub2n { int a; } ub2i; // ERROR, no packed
|
||||
|
||||
layout(constant_id=222) const int arraySize = 4;
|
||||
|
||||
|
26
Test/web.array.frag
Normal file
26
Test/web.array.frag
Normal file
@ -0,0 +1,26 @@
|
||||
#version 310 es
|
||||
|
||||
precision highp float;
|
||||
|
||||
float g4[4];
|
||||
float g5[5];
|
||||
|
||||
layout(location = 0) out vec2 colorOut;
|
||||
|
||||
float[4] foo(float a[5])
|
||||
{
|
||||
return float[](a[0], a[1], a[2], a[3]);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
g4 = foo(g5);
|
||||
|
||||
if (float[4](1.0, 2.0, 3.0, 4.0) == g4)
|
||||
;
|
||||
|
||||
float u[5];
|
||||
foo(u);
|
||||
|
||||
colorOut = vec2(g4.length(), g5.length());
|
||||
}
|
15
Test/web.basic.vert
Normal file
15
Test/web.basic.vert
Normal file
@ -0,0 +1,15 @@
|
||||
#version 310 es
|
||||
|
||||
layout(location = 2) in vec4 inv4;
|
||||
layout(location = 1) out vec4 outv4;
|
||||
|
||||
layout(binding = 3) uniform uBlock {
|
||||
vec4 a;
|
||||
ivec4 b;
|
||||
uvec4 c;
|
||||
} uInst;
|
||||
|
||||
void main()
|
||||
{
|
||||
outv4 = normalize(inv4) * uInst.a * vec4(uInst.b) * vec4(uInst.c);
|
||||
}
|
58
Test/web.builtins.frag
Normal file
58
Test/web.builtins.frag
Normal file
@ -0,0 +1,58 @@
|
||||
#version 310 es
|
||||
|
||||
precision lowp float;
|
||||
layout(location = 4) in float c1D;
|
||||
layout(location = 5) in vec2 c2D;
|
||||
layout(location = 6) in vec3 c3D;
|
||||
layout(location = 7) in smooth vec4 c4D;
|
||||
|
||||
layout(location = 1) flat in int ic1D;
|
||||
layout(location = 2) flat in ivec3 ic3D;
|
||||
layout(location = 3) flat in ivec4 ic4D;
|
||||
|
||||
const ivec2 ic2D = ivec2(2, 3);
|
||||
|
||||
struct s {
|
||||
int i;
|
||||
sampler2D s;
|
||||
};
|
||||
|
||||
struct S2 {
|
||||
vec3 c;
|
||||
float f;
|
||||
};
|
||||
|
||||
layout(location = 8) in S2 s2;
|
||||
|
||||
layout(location = 0) out vec3 sc;
|
||||
layout(location = 1) out float sf;
|
||||
|
||||
void main()
|
||||
{
|
||||
float f = gl_FragCoord.y;
|
||||
gl_FragDepth = f;
|
||||
|
||||
sc = s2.c;
|
||||
sf = s2.f;
|
||||
|
||||
sinh(c1D) +
|
||||
cosh(c1D) * tanh(c2D);
|
||||
asinh(c4D) + acosh(c4D);
|
||||
atanh(c3D);
|
||||
}
|
||||
|
||||
void foo324(void)
|
||||
{
|
||||
float p = pow(3.2, 4.6);
|
||||
p += sin(0.4);
|
||||
p += distance(vec2(10.0, 11.0), vec2(13.0, 15.0)); // 5
|
||||
p += dot(vec3(2,3,5), vec3(-2,-1,4)); // 13
|
||||
vec3 c3 = cross(vec3(3,-3,1), vec3(4,9,2)); // (-15, -2, 39)
|
||||
c3 += faceforward(vec3(1,2,3), vec3(2,3,5), vec3(-2,-1,4)); // (-1,-2,-3)
|
||||
c3 += faceforward(vec3(1,2,3), vec3(-2,-3,-5), vec3(-2,-1,4)); // (1,2,3)
|
||||
vec2 c2 = reflect(vec2(1,3), vec2(0,1)); // (1,-3)
|
||||
c2 += refract(vec2(1,3), vec2(0,1), 1.0); // (1,-3)
|
||||
c2 += refract(vec2(1,3), vec2(0,1), 3.0);
|
||||
c2 += refract(vec2(1,0.1), vec2(0,1), 5.0); // (0,0)
|
||||
mat3x2 m32 = outerProduct(vec2(2,3), vec3(5,7,11));// rows: (10, 14, 22), (15, 21, 33)
|
||||
}
|
14
Test/web.builtins.vert
Normal file
14
Test/web.builtins.vert
Normal file
@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(location = 0) in mediump float ps;
|
||||
|
||||
invariant gl_Position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(ps);
|
||||
gl_Position *= float(4 - gl_VertexIndex);
|
||||
|
||||
gl_PointSize = ps;
|
||||
gl_PointSize *= float(5 - gl_InstanceIndex);
|
||||
}
|
91
Test/web.controlFlow.frag
Normal file
91
Test/web.controlFlow.frag
Normal file
@ -0,0 +1,91 @@
|
||||
#version 310 es
|
||||
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
|
||||
int c, d;
|
||||
layout(location = 0) in highp float x;
|
||||
layout(location = 1) in vec4 bigColor;
|
||||
layout(location = 2) in vec4 BaseColor;
|
||||
layout(location = 3) in float f;
|
||||
|
||||
layout(location = 4) flat in int Count;
|
||||
layout(location = 5) flat in uvec4 v4;
|
||||
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
float f;
|
||||
int a[2];
|
||||
|
||||
switch(c)
|
||||
{
|
||||
}
|
||||
|
||||
switch (c) { // a no-error normal switch
|
||||
case 1:
|
||||
f = sin(x);
|
||||
break;
|
||||
case 2:
|
||||
switch (d) {
|
||||
case 1:
|
||||
f = x * x * x;
|
||||
break;
|
||||
case 2:
|
||||
f = x * x;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
f = tan(x);
|
||||
}
|
||||
|
||||
vec4 color = BaseColor;
|
||||
|
||||
for (int i = 0; i < Count; ++i) {
|
||||
color += bigColor;
|
||||
}
|
||||
|
||||
outColor = color;
|
||||
|
||||
float sum = 0.0;
|
||||
for (int i = 0; i < 4; ++i)
|
||||
sum += float(v4[i]);
|
||||
|
||||
vec4 tv4;
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
tv4[i] = float(v4[i] * 4u);
|
||||
|
||||
outColor += vec4(sum) + tv4;
|
||||
|
||||
vec4 r;
|
||||
r.xyz = BaseColor.xyz;
|
||||
|
||||
for (int i = 0; i < Count; ++i)
|
||||
r.w = f;
|
||||
|
||||
outColor.xyz += r.xyz;
|
||||
|
||||
for (int i = 0; i < 16; i += 4)
|
||||
outColor *= f;
|
||||
|
||||
int i = 0;
|
||||
int A, B, C, D;
|
||||
while (i<10) {
|
||||
A = 1;
|
||||
if (i%2 == 0) {
|
||||
B = 2;
|
||||
continue;
|
||||
C = 2;
|
||||
}
|
||||
if (i%5 == 0) {
|
||||
B = 2;
|
||||
break;
|
||||
C = 2;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
D = 3;
|
||||
}
|
73
Test/web.operations.frag
Normal file
73
Test/web.operations.frag
Normal file
@ -0,0 +1,73 @@
|
||||
#version 310 es
|
||||
|
||||
precision highp float;
|
||||
|
||||
layout(binding = 0) uniform block {
|
||||
mediump float f;
|
||||
} instanceName;
|
||||
|
||||
struct S {
|
||||
int i;
|
||||
} s;
|
||||
|
||||
float a[5];
|
||||
|
||||
void main()
|
||||
{
|
||||
bool b;
|
||||
float f;
|
||||
int i;
|
||||
uint u;
|
||||
bvec3 b3;
|
||||
vec3 v3;
|
||||
ivec3 iv3;
|
||||
uvec3 uv3;
|
||||
vec4 v4;
|
||||
ivec4 iv4;
|
||||
uvec4 uv4;
|
||||
mat2 m2;
|
||||
mat4 m4;
|
||||
|
||||
f * v4;
|
||||
u + u;
|
||||
uv4 / u;
|
||||
iv3 -= iv3;
|
||||
|
||||
i %= 3;
|
||||
uv3 % 4u;
|
||||
--m2;
|
||||
iv4++;
|
||||
|
||||
m4 != m4;
|
||||
m2 == m2;
|
||||
i <= i;
|
||||
a == a;
|
||||
s != s;
|
||||
|
||||
b && b;
|
||||
b || b;
|
||||
b ^^ b;
|
||||
|
||||
!b, uv3;
|
||||
|
||||
~i;
|
||||
~u;
|
||||
~uv3;
|
||||
~iv3;
|
||||
|
||||
uv3 <<= i;
|
||||
i >> i;
|
||||
u << u;
|
||||
iv3 >> iv3;
|
||||
|
||||
i & i;
|
||||
u | u;
|
||||
iv3 ^ iv3;
|
||||
u & uv3;
|
||||
uv3 | u;
|
||||
uv3 &= u;
|
||||
int arr[0x222 & 0xf];
|
||||
arr[1]; // size 2
|
||||
int arr2[(uvec2(0, 0x2) | 0x1u).y];
|
||||
arr2[2]; // size 3
|
||||
}
|
38
Test/web.runtests
Executable file
38
Test/web.runtests
Executable file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
TESTLIST=web.testlist
|
||||
TARGETDIR=localResults
|
||||
BASEDIR=baseResults
|
||||
EXE=../build/install/bin/glslangValidator.exe
|
||||
HASERROR=0
|
||||
mkdir -p $TARGETDIR
|
||||
|
||||
if [ -a $TESTLIST ]
|
||||
then
|
||||
while read t; do
|
||||
echo Running $t...
|
||||
b=`basename $t`
|
||||
$EXE -V -o webtest.spv $t
|
||||
spirv-dis webtest.spv > $TARGETDIR/$b.out
|
||||
rm -f webtest.spv
|
||||
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
||||
done < $TESTLIST
|
||||
else
|
||||
echo $TESTLIST is missing
|
||||
fi
|
||||
|
||||
wc --bytes $EXE > $TARGETDIR/size
|
||||
echo "base size was" `cat $BASEDIR/size`
|
||||
echo "new size is" `cat $TARGETDIR/size`
|
||||
|
||||
#
|
||||
# Final checking
|
||||
#
|
||||
if [ $HASERROR -eq 0 ]
|
||||
then
|
||||
echo Tests Succeeded.
|
||||
else
|
||||
echo Tests Failed.
|
||||
fi
|
||||
|
||||
exit $HASERROR
|
7
Test/web.testlist
Normal file
7
Test/web.testlist
Normal file
@ -0,0 +1,7 @@
|
||||
web.builtins.vert
|
||||
web.builtins.frag
|
||||
web.basic.vert
|
||||
web.controlFlow.frag
|
||||
web.operations.frag
|
||||
web.texture.frag
|
||||
web.array.frag
|
77
Test/web.texture.frag
Normal file
77
Test/web.texture.frag
Normal file
@ -0,0 +1,77 @@
|
||||
#version 310 es
|
||||
layout(binding = 1) uniform sampler2D s2D;
|
||||
layout(binding = 2) uniform lowp sampler3D s3D;
|
||||
layout(binding = 3) uniform samplerCube sCube;
|
||||
layout(binding = 4) uniform lowp samplerCubeShadow sCubeShadow;
|
||||
layout(binding = 5) uniform lowp sampler2DShadow s2DShadow;
|
||||
layout(binding = 6) uniform lowp sampler2DArray s2DArray;
|
||||
layout(binding = 7) uniform lowp sampler2DArrayShadow s2DArrayShadow;
|
||||
layout(binding = 8) uniform lowp isampler2D is2D;
|
||||
layout(binding = 9) uniform lowp isampler3D is3D;
|
||||
layout(binding = 10) uniform lowp isamplerCube isCube;
|
||||
layout(binding = 11) uniform lowp isampler2DArray is2DArray;
|
||||
layout(binding = 12) uniform lowp usampler2D us2D;
|
||||
layout(binding = 13) uniform lowp usampler3D us3D;
|
||||
layout(binding = 14) uniform lowp usamplerCube usCube;
|
||||
layout(binding = 15) uniform lowp usampler2DArray us2DArray;
|
||||
|
||||
precision lowp float;
|
||||
layout(location = 4) in float c1D;
|
||||
layout(location = 5) in vec2 c2D;
|
||||
layout(location = 6) in vec3 c3D;
|
||||
layout(location = 7) in smooth vec4 c4D;
|
||||
|
||||
layout(location = 1) flat in int ic1D;
|
||||
layout(location = 2) flat in ivec3 ic3D;
|
||||
layout(location = 3) flat in ivec4 ic4D;
|
||||
|
||||
const ivec2 ic2D = ivec2(2, 3);
|
||||
|
||||
struct s {
|
||||
int i;
|
||||
sampler2D s;
|
||||
};
|
||||
|
||||
struct S2 {
|
||||
vec3 c;
|
||||
float f;
|
||||
};
|
||||
|
||||
layout(location = 8) in S2 s2;
|
||||
|
||||
layout(location = 0) out vec3 sc;
|
||||
layout(location = 1) out float sf;
|
||||
|
||||
layout(binding = 0) uniform sampler2D arrayedSampler[5];
|
||||
|
||||
void main()
|
||||
{
|
||||
float f;
|
||||
vec4 v;
|
||||
v = texture(s2D, c2D);
|
||||
v = textureProj(s3D, c4D);
|
||||
v = textureLod(s2DArray, c3D, 1.2);
|
||||
v = texelFetch(s3D, ic3D, ic1D);
|
||||
f = textureLodOffset(s2DShadow, c3D, c1D, ic2D);
|
||||
v = textureProjLodOffset(s2D, c3D, c1D, ic2D);
|
||||
v = textureGrad(sCube, c3D, c3D, c3D);
|
||||
f = textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ic2D);
|
||||
v = textureProjGrad(s3D, c4D, c3D, c3D);
|
||||
v = textureProjGradOffset(s2D, c3D, c2D, c2D, ic2D);
|
||||
|
||||
ivec4 iv;
|
||||
iv = texture(is2D, c2D);
|
||||
iv = textureProjOffset(is2D, c4D, ic2D);
|
||||
iv = textureProjLod(is2D, c3D, c1D);
|
||||
iv = textureProjGrad(is2D, c3D, c2D, c2D);
|
||||
iv = texture(is3D, c3D, 4.2);
|
||||
iv = textureLod(isCube, c3D, c1D);
|
||||
iv = texelFetch(is2DArray, ic3D, ic1D);
|
||||
|
||||
iv.xy = textureSize(sCubeShadow, 2);
|
||||
}
|
||||
|
||||
void foo23()
|
||||
{
|
||||
textureOffset(s2DShadow, c3D, ivec2(-8, 7), c1D);
|
||||
}
|
1
_config.yml
Normal file
1
_config.yml
Normal file
@ -0,0 +1 @@
|
||||
theme: jekyll-theme-merlot
|
@ -7,6 +7,7 @@ else(WIN32)
|
||||
endif(WIN32)
|
||||
|
||||
set(SOURCES
|
||||
MachineIndependent/glslang.m4
|
||||
MachineIndependent/glslang.y
|
||||
MachineIndependent/glslang_tab.cpp
|
||||
MachineIndependent/attribute.cpp
|
||||
@ -71,15 +72,6 @@ set(HEADERS
|
||||
MachineIndependent/preprocessor/PpContext.h
|
||||
MachineIndependent/preprocessor/PpTokens.h)
|
||||
|
||||
# This might be useful for making grammar changes:
|
||||
#
|
||||
# find_package(BISON)
|
||||
# add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h
|
||||
# COMMAND ${BISON_EXECUTABLE} --defines=${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp.h -t ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang.y -o ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp
|
||||
# MAIN_DEPENDENCY MachineIndependent/glslang.y
|
||||
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
# set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp)
|
||||
|
||||
glslang_pch(SOURCES MachineIndependent/pch.cpp)
|
||||
|
||||
add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})
|
||||
@ -122,3 +114,16 @@ if(ENABLE_GLSLANG_INSTALL)
|
||||
install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir})
|
||||
endforeach()
|
||||
endif(ENABLE_GLSLANG_INSTALL)
|
||||
|
||||
if(ENABLE_GLSLANG_WEB)
|
||||
add_executable(glslang.js glslang.js.cpp)
|
||||
glslang_set_link_args(glslang.js)
|
||||
target_link_libraries(glslang.js glslang SPIRV)
|
||||
if(EMSCRIPTEN)
|
||||
set_target_properties(glslang.js PROPERTIES
|
||||
OUTPUT_NAME "glslang"
|
||||
SUFFIX ".js"
|
||||
LINK_FLAGS "--bind -s EXPORT_NAME=\"glslangModule\"")
|
||||
em_link_pre_js(glslang.js ${CMAKE_CURRENT_SOURCE_DIR}/glslang.pre.js)
|
||||
endif(EMSCRIPTEN)
|
||||
endif(ENABLE_GLSLANG_WEB)
|
||||
|
@ -61,11 +61,7 @@ enum TBasicType {
|
||||
EbtSampler,
|
||||
EbtStruct,
|
||||
EbtBlock,
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
EbtAccStructNV,
|
||||
#endif
|
||||
|
||||
EbtReference,
|
||||
|
||||
// HLSL types that live only temporarily.
|
||||
@ -94,13 +90,11 @@ enum TStorageQualifier {
|
||||
EvqBuffer, // read/write, shared with app
|
||||
EvqShared, // compute shader's read/write 'shared' qualifier
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
EvqPayloadNV,
|
||||
EvqPayloadInNV,
|
||||
EvqHitAttrNV,
|
||||
EvqCallableDataNV,
|
||||
EvqCallableDataInNV,
|
||||
#endif
|
||||
|
||||
// parameters
|
||||
EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter
|
||||
@ -221,7 +215,6 @@ enum TBuiltInVariable {
|
||||
EbvSampleMask,
|
||||
EbvHelperInvocation,
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EbvBaryCoordNoPersp,
|
||||
EbvBaryCoordNoPerspCentroid,
|
||||
EbvBaryCoordNoPerspSample,
|
||||
@ -229,7 +222,6 @@ enum TBuiltInVariable {
|
||||
EbvBaryCoordSmoothCentroid,
|
||||
EbvBaryCoordSmoothSample,
|
||||
EbvBaryCoordPullModel,
|
||||
#endif
|
||||
|
||||
EbvViewIndex,
|
||||
EbvDeviceIndex,
|
||||
@ -237,7 +229,6 @@ enum TBuiltInVariable {
|
||||
EbvFragSizeEXT,
|
||||
EbvFragInvocationCountEXT,
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
EbvViewportMaskNV,
|
||||
EbvSecondaryPositionNV,
|
||||
EbvSecondaryViewportMaskNV,
|
||||
@ -273,7 +264,6 @@ enum TBuiltInVariable {
|
||||
EbvLayerPerViewNV,
|
||||
EbvMeshViewCountNV,
|
||||
EbvMeshViewIndicesNV,
|
||||
#endif
|
||||
|
||||
// sm builtins
|
||||
EbvWarpsPerSM,
|
||||
@ -299,6 +289,19 @@ enum TBuiltInVariable {
|
||||
EbvLast
|
||||
};
|
||||
|
||||
// In this enum, order matters; users can assume higher precision is a bigger value
|
||||
// and EpqNone is 0.
|
||||
enum TPrecisionQualifier {
|
||||
EpqNone = 0,
|
||||
EpqLow,
|
||||
EpqMedium,
|
||||
EpqHigh
|
||||
};
|
||||
|
||||
#ifdef GLSLANG_WEB
|
||||
__inline const char* GetStorageQualifierString(TStorageQualifier q) { return ""; }
|
||||
__inline const char* GetPrecisionQualifierString(TPrecisionQualifier p) { return ""; }
|
||||
#else
|
||||
// These will show up in error messages
|
||||
__inline const char* GetStorageQualifierString(TStorageQualifier q)
|
||||
{
|
||||
@ -325,13 +328,11 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q)
|
||||
case EvqPointCoord: return "gl_PointCoord"; break;
|
||||
case EvqFragColor: return "fragColor"; break;
|
||||
case EvqFragDepth: return "gl_FragDepth"; break;
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EvqPayloadNV: return "rayPayloadNV"; break;
|
||||
case EvqPayloadInNV: return "rayPayloadInNV"; break;
|
||||
case EvqHitAttrNV: return "hitAttributeNV"; break;
|
||||
case EvqCallableDataNV: return "callableDataNV"; break;
|
||||
case EvqCallableDataInNV: return "callableDataInNV"; break;
|
||||
#endif
|
||||
default: return "unknown qualifier";
|
||||
}
|
||||
}
|
||||
@ -413,7 +414,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
||||
case EbvSampleMask: return "SampleMaskIn";
|
||||
case EbvHelperInvocation: return "HelperInvocation";
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EbvBaryCoordNoPersp: return "BaryCoordNoPersp";
|
||||
case EbvBaryCoordNoPerspCentroid: return "BaryCoordNoPerspCentroid";
|
||||
case EbvBaryCoordNoPerspSample: return "BaryCoordNoPerspSample";
|
||||
@ -421,7 +421,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
||||
case EbvBaryCoordSmoothCentroid: return "BaryCoordSmoothCentroid";
|
||||
case EbvBaryCoordSmoothSample: return "BaryCoordSmoothSample";
|
||||
case EbvBaryCoordPullModel: return "BaryCoordPullModel";
|
||||
#endif
|
||||
|
||||
case EbvViewIndex: return "ViewIndex";
|
||||
case EbvDeviceIndex: return "DeviceIndex";
|
||||
@ -429,7 +428,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
||||
case EbvFragSizeEXT: return "FragSizeEXT";
|
||||
case EbvFragInvocationCountEXT: return "FragInvocationCountEXT";
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EbvViewportMaskNV: return "ViewportMaskNV";
|
||||
case EbvSecondaryPositionNV: return "SecondaryPositionNV";
|
||||
case EbvSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
|
||||
@ -464,7 +462,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
||||
case EbvLayerPerViewNV: return "LayerPerViewNV";
|
||||
case EbvMeshViewCountNV: return "MeshViewCountNV";
|
||||
case EbvMeshViewIndicesNV: return "MeshViewIndicesNV";
|
||||
#endif
|
||||
|
||||
case EbvWarpsPerSM: return "WarpsPerSMNV";
|
||||
case EbvSMCount: return "SMCountNV";
|
||||
@ -475,15 +472,6 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
|
||||
}
|
||||
}
|
||||
|
||||
// In this enum, order matters; users can assume higher precision is a bigger value
|
||||
// and EpqNone is 0.
|
||||
enum TPrecisionQualifier {
|
||||
EpqNone = 0,
|
||||
EpqLow,
|
||||
EpqMedium,
|
||||
EpqHigh
|
||||
};
|
||||
|
||||
__inline const char* GetPrecisionQualifierString(TPrecisionQualifier p)
|
||||
{
|
||||
switch (p) {
|
||||
@ -494,6 +482,7 @@ __inline const char* GetPrecisionQualifierString(TPrecisionQualifier p)
|
||||
default: return "unknown precision qualifier";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
__inline bool isTypeSignedInt(TBasicType type)
|
||||
{
|
||||
@ -538,7 +527,8 @@ __inline bool isTypeFloat(TBasicType type)
|
||||
}
|
||||
}
|
||||
|
||||
__inline int getTypeRank(TBasicType type) {
|
||||
__inline int getTypeRank(TBasicType type)
|
||||
{
|
||||
int res = -1;
|
||||
switch(type) {
|
||||
case EbtInt8:
|
||||
|
@ -213,6 +213,28 @@ public:
|
||||
return false;
|
||||
|
||||
switch (type) {
|
||||
case EbtInt:
|
||||
if (constant.iConst == iConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtUint:
|
||||
if (constant.uConst == uConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtBool:
|
||||
if (constant.bConst == bConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtDouble:
|
||||
if (constant.dConst == dConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt16:
|
||||
if (constant.i16Const == i16Const)
|
||||
return true;
|
||||
@ -232,16 +254,6 @@ public:
|
||||
if (constant.u8Const == u8Const)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtInt:
|
||||
if (constant.iConst == iConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtUint:
|
||||
if (constant.uConst == uConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtInt64:
|
||||
if (constant.i64Const == i64Const)
|
||||
@ -253,16 +265,7 @@ public:
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtDouble:
|
||||
if (constant.dConst == dConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtBool:
|
||||
if (constant.bConst == bConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
assert(false && "Default missing");
|
||||
}
|
||||
@ -329,6 +332,22 @@ public:
|
||||
{
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
case EbtInt:
|
||||
if (iConst > constant.iConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtUint:
|
||||
if (uConst > constant.uConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtDouble:
|
||||
if (dConst > constant.dConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
if (i8Const > constant.i8Const)
|
||||
return true;
|
||||
@ -348,16 +367,6 @@ public:
|
||||
if (u16Const > constant.u16Const)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtInt:
|
||||
if (iConst > constant.iConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtUint:
|
||||
if (uConst > constant.uConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtInt64:
|
||||
if (i64Const > constant.i64Const)
|
||||
@ -369,11 +378,7 @@ public:
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtDouble:
|
||||
if (dConst > constant.dConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
assert(false && "Default missing");
|
||||
return false;
|
||||
@ -384,6 +389,7 @@ public:
|
||||
{
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
if (i8Const < constant.i8Const)
|
||||
return true;
|
||||
@ -394,7 +400,7 @@ public:
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtInt16:
|
||||
case EbtInt16:
|
||||
if (i16Const < constant.i16Const)
|
||||
return true;
|
||||
|
||||
@ -402,17 +408,6 @@ public:
|
||||
case EbtUint16:
|
||||
if (u16Const < constant.u16Const)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtInt:
|
||||
if (iConst < constant.iConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtUint:
|
||||
if (uConst < constant.uConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtInt64:
|
||||
if (i64Const < constant.i64Const)
|
||||
@ -424,10 +419,21 @@ public:
|
||||
return true;
|
||||
|
||||
return false;
|
||||
#endif
|
||||
case EbtDouble:
|
||||
if (dConst < constant.dConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtInt:
|
||||
if (iConst < constant.iConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtUint:
|
||||
if (uConst < constant.uConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
default:
|
||||
assert(false && "Default missing");
|
||||
@ -440,15 +446,17 @@ public:
|
||||
TConstUnion returnValue;
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst + constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst + constant.uConst); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setI8Const(i8Const + constant.i8Const); break;
|
||||
case EbtInt16: returnValue.setI16Const(i16Const + constant.i16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst + constant.iConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break;
|
||||
case EbtUint8: returnValue.setU8Const(u8Const + constant.u8Const); break;
|
||||
case EbtUint16: returnValue.setU16Const(u16Const + constant.u16Const); break;
|
||||
case EbtUint: returnValue.setUConst(uConst + constant.uConst); break;
|
||||
case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -460,15 +468,17 @@ public:
|
||||
TConstUnion returnValue;
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst - constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst - constant.uConst); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setI8Const(i8Const - constant.i8Const); break;
|
||||
case EbtInt16: returnValue.setI16Const(i16Const - constant.i16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst - constant.iConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break;
|
||||
case EbtUint8: returnValue.setU8Const(u8Const - constant.u8Const); break;
|
||||
case EbtUint16: returnValue.setU16Const(u16Const - constant.u16Const); break;
|
||||
case EbtUint: returnValue.setUConst(uConst - constant.uConst); break;
|
||||
case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -480,15 +490,17 @@ public:
|
||||
TConstUnion returnValue;
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst * constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst * constant.uConst); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setI8Const(i8Const * constant.i8Const); break;
|
||||
case EbtInt16: returnValue.setI16Const(i16Const * constant.i16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst * constant.iConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break;
|
||||
case EbtUint8: returnValue.setU8Const(u8Const * constant.u8Const); break;
|
||||
case EbtUint16: returnValue.setU16Const(u16Const * constant.u16Const); break;
|
||||
case EbtUint: returnValue.setUConst(uConst * constant.uConst); break;
|
||||
case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -500,14 +512,16 @@ public:
|
||||
TConstUnion returnValue;
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst % constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst % constant.uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setI8Const(i8Const % constant.i8Const); break;
|
||||
case EbtInt16: returnValue.setI8Const(i8Const % constant.i16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst % constant.iConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break;
|
||||
case EbtUint8: returnValue.setU8Const(u8Const % constant.u8Const); break;
|
||||
case EbtUint16: returnValue.setU16Const(u16Const % constant.u16Const); break;
|
||||
case EbtUint: returnValue.setUConst(uConst % constant.uConst); break;
|
||||
case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -518,6 +532,7 @@ public:
|
||||
{
|
||||
TConstUnion returnValue;
|
||||
switch (type) {
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
switch (constant.type) {
|
||||
case EbtInt8: returnValue.setI8Const(i8Const >> constant.i8Const); break;
|
||||
@ -570,32 +585,38 @@ public:
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case EbtInt:
|
||||
switch (constant.type) {
|
||||
case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
|
||||
case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setIConst(iConst >> constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setIConst(iConst >> constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setIConst(iConst >> constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setIConst(iConst >> constant.u16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break;
|
||||
case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break;
|
||||
case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setIConst(iConst >> constant.u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
switch (constant.type) {
|
||||
case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setUConst(uConst >> constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setUConst(uConst >> constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setUConst(uConst >> constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setUConst(uConst >> constant.u16Const); break;
|
||||
case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break;
|
||||
case EbtInt64: returnValue.setUConst(uConst >> constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setUConst(uConst >> constant.u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt64:
|
||||
switch (constant.type) {
|
||||
case EbtInt8: returnValue.setI64Const(i64Const >> constant.i8Const); break;
|
||||
@ -622,6 +643,7 @@ public:
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -632,6 +654,7 @@ public:
|
||||
{
|
||||
TConstUnion returnValue;
|
||||
switch (type) {
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
switch (constant.type) {
|
||||
case EbtInt8: returnValue.setI8Const(i8Const << constant.i8Const); break;
|
||||
@ -684,32 +707,6 @@ public:
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
case EbtInt:
|
||||
switch (constant.type) {
|
||||
case EbtInt8: returnValue.setIConst(iConst << constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setIConst(iConst << constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setIConst(iConst << constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setIConst(iConst << constant.u16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
|
||||
case EbtUint: returnValue.setIConst(iConst << constant.uConst); break;
|
||||
case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
switch (constant.type) {
|
||||
case EbtInt8: returnValue.setUConst(uConst << constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setUConst(uConst << constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setUConst(uConst << constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setUConst(uConst << constant.u16Const); break;
|
||||
case EbtInt: returnValue.setUConst(uConst << constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst << constant.uConst); break;
|
||||
case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setUConst(uConst << constant.u64Const); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
case EbtInt64:
|
||||
switch (constant.type) {
|
||||
case EbtInt8: returnValue.setI64Const(i64Const << constant.i8Const); break;
|
||||
@ -736,6 +733,37 @@ public:
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case EbtInt:
|
||||
switch (constant.type) {
|
||||
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
|
||||
case EbtUint: returnValue.setIConst(iConst << constant.uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setIConst(iConst << constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setIConst(iConst << constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setIConst(iConst << constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setIConst(iConst << constant.u16Const); break;
|
||||
case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
switch (constant.type) {
|
||||
case EbtInt: returnValue.setUConst(uConst << constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst << constant.uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setUConst(uConst << constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setUConst(uConst << constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setUConst(uConst << constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setUConst(uConst << constant.u16Const); break;
|
||||
case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setUConst(uConst << constant.u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -747,14 +775,16 @@ public:
|
||||
TConstUnion returnValue;
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst & constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst & constant.uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setI8Const(i8Const & constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setU8Const(u8Const & constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setI16Const(i16Const & constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setU16Const(u16Const & constant.u16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst & constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst & constant.uConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(i64Const & constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -766,14 +796,16 @@ public:
|
||||
TConstUnion returnValue;
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst | constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst | constant.uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setI8Const(i8Const | constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setU8Const(u8Const | constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setI16Const(i16Const | constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setU16Const(u16Const | constant.u16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst | constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst | constant.uConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(i64Const | constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -785,14 +817,16 @@ public:
|
||||
TConstUnion returnValue;
|
||||
assert(type == constant.type);
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setI8Const(i8Const ^ constant.i8Const); break;
|
||||
case EbtUint8: returnValue.setU8Const(u8Const ^ constant.u8Const); break;
|
||||
case EbtInt16: returnValue.setI16Const(i16Const ^ constant.i16Const); break;
|
||||
case EbtUint16: returnValue.setU16Const(u16Const ^ constant.u16Const); break;
|
||||
case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(i64Const ^ constant.i64Const); break;
|
||||
case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
@ -803,14 +837,16 @@ public:
|
||||
{
|
||||
TConstUnion returnValue;
|
||||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(~iConst); break;
|
||||
case EbtUint: returnValue.setUConst(~uConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: returnValue.setI8Const(~i8Const); break;
|
||||
case EbtUint8: returnValue.setU8Const(~u8Const); break;
|
||||
case EbtInt16: returnValue.setI16Const(~i16Const); break;
|
||||
case EbtUint16: returnValue.setU16Const(~u16Const); break;
|
||||
case EbtInt: returnValue.setIConst(~iConst); break;
|
||||
case EbtUint: returnValue.setUConst(~uConst); break;
|
||||
case EbtInt64: returnValue.setI64Const(~i64Const); break;
|
||||
case EbtUint64: returnValue.setU64Const(~u64Const); break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -422,11 +422,9 @@ enum TOperator {
|
||||
EOpReflect,
|
||||
EOpRefract,
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpMin3,
|
||||
EOpMax3,
|
||||
EOpMid3,
|
||||
#endif
|
||||
|
||||
EOpDPdx, // Fragment only
|
||||
EOpDPdy, // Fragment only
|
||||
@ -441,10 +439,7 @@ enum TOperator {
|
||||
EOpInterpolateAtCentroid, // Fragment only
|
||||
EOpInterpolateAtSample, // Fragment only
|
||||
EOpInterpolateAtOffset, // Fragment only
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpInterpolateAtVertex,
|
||||
#endif
|
||||
|
||||
EOpMatrixTimesMatrix,
|
||||
EOpOuterProduct,
|
||||
@ -534,7 +529,6 @@ enum TOperator {
|
||||
EOpSubgroupQuadSwapVertical,
|
||||
EOpSubgroupQuadSwapDiagonal,
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
EOpSubgroupPartition,
|
||||
EOpSubgroupPartitionedAdd,
|
||||
EOpSubgroupPartitionedMul,
|
||||
@ -557,11 +551,9 @@ enum TOperator {
|
||||
EOpSubgroupPartitionedExclusiveAnd,
|
||||
EOpSubgroupPartitionedExclusiveOr,
|
||||
EOpSubgroupPartitionedExclusiveXor,
|
||||
#endif
|
||||
|
||||
EOpSubgroupGuardStop,
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpMinInvocations,
|
||||
EOpMaxInvocations,
|
||||
EOpAddInvocations,
|
||||
@ -588,7 +580,6 @@ enum TOperator {
|
||||
EOpCubeFaceIndex,
|
||||
EOpCubeFaceCoord,
|
||||
EOpTime,
|
||||
#endif
|
||||
|
||||
EOpAtomicAdd,
|
||||
EOpAtomicMin,
|
||||
@ -795,10 +786,8 @@ enum TOperator {
|
||||
EOpImageQuerySamples,
|
||||
EOpImageLoad,
|
||||
EOpImageStore,
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpImageLoadLod,
|
||||
EOpImageStoreLod,
|
||||
#endif
|
||||
EOpImageAtomicAdd,
|
||||
EOpImageAtomicMin,
|
||||
EOpImageAtomicMax,
|
||||
@ -813,9 +802,7 @@ enum TOperator {
|
||||
EOpSubpassLoad,
|
||||
EOpSubpassLoadMS,
|
||||
EOpSparseImageLoad,
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpSparseImageLoadLod,
|
||||
#endif
|
||||
|
||||
EOpImageGuardEnd,
|
||||
|
||||
@ -853,13 +840,11 @@ enum TOperator {
|
||||
EOpTextureOffsetClamp,
|
||||
EOpTextureGradClamp,
|
||||
EOpTextureGradOffsetClamp,
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpTextureGatherLod,
|
||||
EOpTextureGatherLodOffset,
|
||||
EOpTextureGatherLodOffsets,
|
||||
EOpFragmentMaskFetch,
|
||||
EOpFragmentFetch,
|
||||
#endif
|
||||
|
||||
EOpSparseTextureGuardBegin,
|
||||
|
||||
@ -879,15 +864,12 @@ enum TOperator {
|
||||
EOpSparseTextureOffsetClamp,
|
||||
EOpSparseTextureGradClamp,
|
||||
EOpSparseTextureGradOffsetClamp,
|
||||
#ifdef AMD_EXTENSIONS
|
||||
EOpSparseTextureGatherLod,
|
||||
EOpSparseTextureGatherLodOffset,
|
||||
EOpSparseTextureGatherLodOffsets,
|
||||
#endif
|
||||
|
||||
EOpSparseTextureGuardEnd,
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
EOpImageFootprintGuardBegin,
|
||||
EOpImageSampleFootprintNV,
|
||||
EOpImageSampleFootprintClampNV,
|
||||
@ -895,7 +877,6 @@ enum TOperator {
|
||||
EOpImageSampleFootprintGradNV,
|
||||
EOpImageSampleFootprintGradClampNV,
|
||||
EOpImageFootprintGuardEnd,
|
||||
#endif
|
||||
EOpSamplingGuardEnd,
|
||||
EOpTextureGuardEnd,
|
||||
|
||||
@ -914,14 +895,12 @@ enum TOperator {
|
||||
EOpFindLSB,
|
||||
EOpFindMSB,
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
EOpTraceNV,
|
||||
EOpReportIntersectionNV,
|
||||
EOpIgnoreIntersectionNV,
|
||||
EOpTerminateRayNV,
|
||||
EOpExecuteCallableNV,
|
||||
EOpWritePackedPrimitiveIndices4x8NV,
|
||||
#endif
|
||||
//
|
||||
// HLSL operations
|
||||
//
|
||||
@ -1110,6 +1089,8 @@ public:
|
||||
virtual bool isStruct() const { return type.isStruct(); }
|
||||
virtual bool isFloatingDomain() const { return type.isFloatingDomain(); }
|
||||
virtual bool isIntegerDomain() const { return type.isIntegerDomain(); }
|
||||
bool isAtomic() const { return type.isAtomic(); }
|
||||
bool isReference() const { return type.isReference(); }
|
||||
TString getCompleteString() const { return type.getCompleteString(); }
|
||||
|
||||
protected:
|
||||
@ -1303,9 +1284,7 @@ struct TCrackedTextureOp {
|
||||
bool grad;
|
||||
bool subpass;
|
||||
bool lodClamp;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
bool fragMask;
|
||||
#endif
|
||||
};
|
||||
|
||||
//
|
||||
@ -1321,12 +1300,17 @@ public:
|
||||
bool isConstructor() const;
|
||||
bool isTexture() const { return op > EOpTextureGuardBegin && op < EOpTextureGuardEnd; }
|
||||
bool isSampling() const { return op > EOpSamplingGuardBegin && op < EOpSamplingGuardEnd; }
|
||||
#ifdef GLSLANG_WEB
|
||||
bool isImage() const { return false; }
|
||||
bool isSparseTexture() const { return false; }
|
||||
bool isImageFootprint() const { return false; }
|
||||
bool isSparseImage() const { return false; }
|
||||
#else
|
||||
bool isImage() const { return op > EOpImageGuardBegin && op < EOpImageGuardEnd; }
|
||||
bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; }
|
||||
#ifdef NV_EXTENSIONS
|
||||
bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
|
||||
#endif
|
||||
bool isSparseImage() const { return op == EOpSparseImageLoad; }
|
||||
#endif
|
||||
|
||||
void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
|
||||
TPrecisionQualifier getOperationPrecision() const { return operationPrecision != EpqNone ?
|
||||
@ -1356,9 +1340,7 @@ public:
|
||||
cracked.grad = false;
|
||||
cracked.subpass = false;
|
||||
cracked.lodClamp = false;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
cracked.fragMask = false;
|
||||
#endif
|
||||
|
||||
switch (op) {
|
||||
case EOpImageQuerySize:
|
||||
@ -1373,10 +1355,6 @@ public:
|
||||
case EOpTexture:
|
||||
case EOpSparseTexture:
|
||||
break;
|
||||
case EOpTextureClamp:
|
||||
case EOpSparseTextureClamp:
|
||||
cracked.lodClamp = true;
|
||||
break;
|
||||
case EOpTextureProj:
|
||||
cracked.proj = true;
|
||||
break;
|
||||
@ -1388,22 +1366,17 @@ public:
|
||||
case EOpSparseTextureOffset:
|
||||
cracked.offset = true;
|
||||
break;
|
||||
case EOpTextureOffsetClamp:
|
||||
case EOpSparseTextureOffsetClamp:
|
||||
cracked.offset = true;
|
||||
cracked.lodClamp = true;
|
||||
break;
|
||||
case EOpTextureFetch:
|
||||
case EOpSparseTextureFetch:
|
||||
cracked.fetch = true;
|
||||
if (sampler.dim == Esd1D || (sampler.dim == Esd2D && ! sampler.ms) || sampler.dim == Esd3D)
|
||||
if (sampler.is1D() || (sampler.dim == Esd2D && ! sampler.isMultiSample()) || sampler.dim == Esd3D)
|
||||
cracked.lod = true;
|
||||
break;
|
||||
case EOpTextureFetchOffset:
|
||||
case EOpSparseTextureFetchOffset:
|
||||
cracked.fetch = true;
|
||||
cracked.offset = true;
|
||||
if (sampler.dim == Esd1D || (sampler.dim == Esd2D && ! sampler.ms) || sampler.dim == Esd3D)
|
||||
if (sampler.is1D() || (sampler.dim == Esd2D && ! sampler.isMultiSample()) || sampler.dim == Esd3D)
|
||||
cracked.lod = true;
|
||||
break;
|
||||
case EOpTextureProjOffset:
|
||||
@ -1428,11 +1401,6 @@ public:
|
||||
case EOpSparseTextureGrad:
|
||||
cracked.grad = true;
|
||||
break;
|
||||
case EOpTextureGradClamp:
|
||||
case EOpSparseTextureGradClamp:
|
||||
cracked.grad = true;
|
||||
cracked.lodClamp = true;
|
||||
break;
|
||||
case EOpTextureGradOffset:
|
||||
case EOpSparseTextureGradOffset:
|
||||
cracked.grad = true;
|
||||
@ -1447,6 +1415,21 @@ public:
|
||||
cracked.offset = true;
|
||||
cracked.proj = true;
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpTextureClamp:
|
||||
case EOpSparseTextureClamp:
|
||||
cracked.lodClamp = true;
|
||||
break;
|
||||
case EOpTextureOffsetClamp:
|
||||
case EOpSparseTextureOffsetClamp:
|
||||
cracked.offset = true;
|
||||
cracked.lodClamp = true;
|
||||
break;
|
||||
case EOpTextureGradClamp:
|
||||
case EOpSparseTextureGradClamp:
|
||||
cracked.grad = true;
|
||||
cracked.lodClamp = true;
|
||||
break;
|
||||
case EOpTextureGradOffsetClamp:
|
||||
case EOpSparseTextureGradOffsetClamp:
|
||||
cracked.grad = true;
|
||||
@ -1467,7 +1450,6 @@ public:
|
||||
cracked.gather = true;
|
||||
cracked.offsets = true;
|
||||
break;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EOpTextureGatherLod:
|
||||
case EOpSparseTextureGatherLod:
|
||||
cracked.gather = true;
|
||||
@ -1498,8 +1480,6 @@ public:
|
||||
cracked.subpass = sampler.dim == EsdSubpass;
|
||||
cracked.fragMask = true;
|
||||
break;
|
||||
#endif
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EOpImageSampleFootprintNV:
|
||||
break;
|
||||
case EOpImageSampleFootprintClampNV:
|
||||
@ -1515,11 +1495,11 @@ public:
|
||||
cracked.lodClamp = true;
|
||||
cracked.grad = true;
|
||||
break;
|
||||
#endif
|
||||
case EOpSubpassLoad:
|
||||
case EOpSubpassLoadMS:
|
||||
cracked.subpass = true;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
// This header is generated by the make-revision script.
|
||||
|
||||
#define GLSLANG_PATCH_LEVEL 3321
|
||||
#define GLSLANG_PATCH_LEVEL 3381
|
||||
|
@ -189,6 +189,24 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
else
|
||||
newConstArray[i].setDConst((double)NAN);
|
||||
break;
|
||||
|
||||
case EbtInt:
|
||||
if (rightUnionArray[i] == 0)
|
||||
newConstArray[i].setIConst(0x7FFFFFFF);
|
||||
else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)-0x80000000ll)
|
||||
newConstArray[i].setIConst((int)-0x80000000ll);
|
||||
else
|
||||
newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst());
|
||||
break;
|
||||
|
||||
case EbtUint:
|
||||
if (rightUnionArray[i] == 0u)
|
||||
newConstArray[i].setUConst(0xFFFFFFFFu);
|
||||
else
|
||||
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
||||
break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
if (rightUnionArray[i] == (signed char)0)
|
||||
newConstArray[i].setI8Const((signed char)0x7F);
|
||||
@ -221,22 +239,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
newConstArray[i].setU16Const(leftUnionArray[i].getU16Const() / rightUnionArray[i].getU16Const());
|
||||
break;
|
||||
|
||||
case EbtInt:
|
||||
if (rightUnionArray[i] == 0)
|
||||
newConstArray[i].setIConst(0x7FFFFFFF);
|
||||
else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == (int)-0x80000000ll)
|
||||
newConstArray[i].setIConst((int)-0x80000000ll);
|
||||
else
|
||||
newConstArray[i].setIConst(leftUnionArray[i].getIConst() / rightUnionArray[i].getIConst());
|
||||
break;
|
||||
|
||||
case EbtUint:
|
||||
if (rightUnionArray[i] == 0u)
|
||||
newConstArray[i].setUConst(0xFFFFFFFFu);
|
||||
else
|
||||
newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
|
||||
break;
|
||||
|
||||
case EbtInt64:
|
||||
if (rightUnionArray[i] == 0ll)
|
||||
newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll);
|
||||
@ -254,6 +256,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -292,13 +295,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
newConstArray[i].setIConst(0);
|
||||
break;
|
||||
} else goto modulo_default;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt64:
|
||||
if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) {
|
||||
newConstArray[i].setI64Const(0);
|
||||
break;
|
||||
} else goto modulo_default;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EbtInt16:
|
||||
if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == SHRT_MIN) {
|
||||
newConstArray[i].setIConst(0);
|
||||
@ -527,14 +529,16 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EbtDouble:
|
||||
case EbtFloat16:
|
||||
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
|
||||
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
|
||||
case EbtUint: newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst()))); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break;
|
||||
case EbtUint8: newConstArray[i].setU8Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU8Const()))); break;
|
||||
case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break;
|
||||
case EbtUint16:newConstArray[i].setU16Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU16Const()))); break;
|
||||
case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
|
||||
case EbtUint: newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst()))); break;
|
||||
case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break;
|
||||
case EbtUint64: newConstArray[i].setU64Const(static_cast<unsigned long long>(-static_cast<long long>(unionArray[i].getU64Const()))); break;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
@ -669,6 +673,48 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
break;
|
||||
}
|
||||
|
||||
case EOpConvIntToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getIConst() != 0); break;
|
||||
case EOpConvUintToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getUConst() != 0); break;
|
||||
case EOpConvBoolToInt:
|
||||
newConstArray[i].setIConst(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToUint:
|
||||
newConstArray[i].setUConst(unionArray[i].getBConst()); break;
|
||||
case EOpConvIntToUint:
|
||||
newConstArray[i].setUConst(unionArray[i].getIConst()); break;
|
||||
case EOpConvUintToInt:
|
||||
newConstArray[i].setIConst(unionArray[i].getUConst()); break;
|
||||
|
||||
case EOpConvFloatToBool:
|
||||
case EOpConvDoubleToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
||||
|
||||
case EOpConvBoolToFloat:
|
||||
case EOpConvBoolToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
||||
|
||||
case EOpConvIntToFloat:
|
||||
case EOpConvIntToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
||||
|
||||
case EOpConvUintToFloat:
|
||||
case EOpConvUintToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
||||
|
||||
case EOpConvDoubleToFloat:
|
||||
case EOpConvFloatToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
|
||||
case EOpConvFloatToUint:
|
||||
case EOpConvDoubleToUint:
|
||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
||||
|
||||
case EOpConvFloatToInt:
|
||||
case EOpConvDoubleToInt:
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpConvInt8ToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getI8Const() != 0); break;
|
||||
case EOpConvUint8ToBool:
|
||||
@ -677,20 +723,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
newConstArray[i].setBConst(unionArray[i].getI16Const() != 0); break;
|
||||
case EOpConvUint16ToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getU16Const() != 0); break;
|
||||
case EOpConvIntToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getIConst() != 0); break;
|
||||
case EOpConvUintToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getUConst() != 0); break;
|
||||
case EOpConvInt64ToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break;
|
||||
case EOpConvUint64ToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getI64Const() != 0); break;
|
||||
case EOpConvFloat16ToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
||||
case EOpConvFloatToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
||||
case EOpConvDoubleToBool:
|
||||
newConstArray[i].setBConst(unionArray[i].getDConst() != 0); break;
|
||||
|
||||
case EOpConvBoolToInt8:
|
||||
newConstArray[i].setI8Const(unionArray[i].getBConst()); break;
|
||||
@ -700,20 +738,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
newConstArray[i].setI16Const(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToUint16:
|
||||
newConstArray[i].setU16Const(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToInt:
|
||||
newConstArray[i].setIConst(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToUint:
|
||||
newConstArray[i].setUConst(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToInt64:
|
||||
newConstArray[i].setI64Const(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToUint64:
|
||||
newConstArray[i].setU64Const(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToFloat16:
|
||||
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToFloat:
|
||||
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
||||
case EOpConvBoolToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getBConst()); break;
|
||||
|
||||
case EOpConvInt8ToInt16:
|
||||
newConstArray[i].setI16Const(unionArray[i].getI8Const()); break;
|
||||
@ -808,8 +838,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
newConstArray[i].setU8Const((unsigned char)unionArray[i].getIConst()); break;
|
||||
case EOpConvIntToUint16:
|
||||
newConstArray[i].setU16Const((unsigned char)unionArray[i].getIConst()); break;
|
||||
case EOpConvIntToUint:
|
||||
newConstArray[i].setUConst(unionArray[i].getIConst()); break;
|
||||
case EOpConvIntToUint64:
|
||||
newConstArray[i].setU64Const(unionArray[i].getIConst()); break;
|
||||
|
||||
@ -817,8 +845,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
newConstArray[i].setI8Const((signed char)unionArray[i].getUConst()); break;
|
||||
case EOpConvUintToInt16:
|
||||
newConstArray[i].setI16Const((signed short)unionArray[i].getUConst()); break;
|
||||
case EOpConvUintToInt:
|
||||
newConstArray[i].setIConst(unionArray[i].getUConst()); break;
|
||||
case EOpConvUintToInt64:
|
||||
newConstArray[i].setI64Const(unionArray[i].getUConst()); break;
|
||||
case EOpConvUintToUint8:
|
||||
@ -829,16 +855,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
newConstArray[i].setU64Const(unionArray[i].getUConst()); break;
|
||||
case EOpConvIntToFloat16:
|
||||
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
||||
case EOpConvIntToFloat:
|
||||
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
||||
case EOpConvIntToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getIConst()); break;
|
||||
case EOpConvUintToFloat16:
|
||||
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
||||
case EOpConvUintToFloat:
|
||||
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
||||
case EOpConvUintToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getUConst()); break;
|
||||
case EOpConvInt64ToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getI64Const())); break;
|
||||
case EOpConvInt64ToInt16:
|
||||
@ -903,48 +921,35 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToInt16:
|
||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToInt:
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToInt64:
|
||||
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToUint16:
|
||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToUint:
|
||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToUint64:
|
||||
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvFloatToFloat16:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvFloatToDouble:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvDoubleToInt8:
|
||||
newConstArray[i].setI8Const(static_cast<signed char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToInt16:
|
||||
newConstArray[i].setI16Const(static_cast<signed short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToInt:
|
||||
newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToInt64:
|
||||
newConstArray[i].setI64Const(static_cast<long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToUint8:
|
||||
newConstArray[i].setU8Const(static_cast<unsigned char>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToUint16:
|
||||
newConstArray[i].setU16Const(static_cast<unsigned short>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToUint:
|
||||
newConstArray[i].setUConst(static_cast<unsigned int>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToUint64:
|
||||
newConstArray[i].setU64Const(static_cast<unsigned long long>(unionArray[i].getDConst())); break;
|
||||
case EOpConvDoubleToFloat16:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvDoubleToFloat:
|
||||
newConstArray[i].setDConst(unionArray[i].getDConst()); break;
|
||||
case EOpConvPtrToUint64:
|
||||
case EOpConvUint64ToPtr:
|
||||
case EOpConstructReference:
|
||||
newConstArray[i].setU64Const(unionArray[i].getU64Const()); break;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out
|
||||
|
||||
@ -1076,6 +1081,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
case EbtDouble:
|
||||
newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||
break;
|
||||
case EbtInt:
|
||||
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||
break;
|
||||
case EbtUint:
|
||||
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
|
||||
break;
|
||||
@ -1088,18 +1100,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
case EbtUint16:
|
||||
newConstArray[comp].setU16Const(std::min(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()));
|
||||
break;
|
||||
case EbtInt:
|
||||
newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||
break;
|
||||
case EbtUint:
|
||||
newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
break;
|
||||
case EbtInt64:
|
||||
newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
||||
break;
|
||||
case EbtUint64:
|
||||
newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
||||
break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
@ -1110,6 +1117,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
case EbtDouble:
|
||||
newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||
break;
|
||||
case EbtInt:
|
||||
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||
break;
|
||||
case EbtUint:
|
||||
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
|
||||
break;
|
||||
@ -1122,18 +1136,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
case EbtUint16:
|
||||
newConstArray[comp].setU16Const(std::max(childConstUnions[0][arg0comp].getU16Const(), childConstUnions[1][arg1comp].getU16Const()));
|
||||
break;
|
||||
case EbtInt:
|
||||
newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()));
|
||||
break;
|
||||
case EbtUint:
|
||||
newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
|
||||
break;
|
||||
case EbtInt64:
|
||||
newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()));
|
||||
break;
|
||||
case EbtUint64:
|
||||
newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
|
||||
break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
@ -1145,6 +1154,11 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()),
|
||||
childConstUnions[2][arg2comp].getDConst()));
|
||||
break;
|
||||
case EbtUint:
|
||||
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
|
||||
childConstUnions[2][arg2comp].getUConst()));
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()),
|
||||
childConstUnions[2][arg2comp].getI8Const()));
|
||||
@ -1165,10 +1179,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()),
|
||||
childConstUnions[2][arg2comp].getIConst()));
|
||||
break;
|
||||
case EbtUint:
|
||||
newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
|
||||
childConstUnions[2][arg2comp].getUConst()));
|
||||
break;
|
||||
case EbtInt64:
|
||||
newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()),
|
||||
childConstUnions[2][arg2comp].getI64Const()));
|
||||
@ -1177,6 +1187,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()),
|
||||
childConstUnions[2][arg2comp].getU64Const()));
|
||||
break;
|
||||
#endif
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
break;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -91,6 +91,8 @@ public:
|
||||
void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources);
|
||||
|
||||
protected:
|
||||
void addTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion);
|
||||
void relateTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage, TSymbolTable&);
|
||||
void add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion);
|
||||
void addSubpassSampling(TSampler, const TString& typeName, int version, EProfile profile);
|
||||
void addQueryFunctions(TSampler, const TString& typeName, int version, EProfile profile);
|
||||
|
@ -123,12 +123,12 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn
|
||||
if ((op == EOpAdd || op == EOpSub) && extensionRequested(E_GL_EXT_buffer_reference2)) {
|
||||
|
||||
// No addressing math on struct with unsized array.
|
||||
if ((left->getBasicType() == EbtReference && left->getType().getReferentType()->containsUnsizedArray()) ||
|
||||
(right->getBasicType() == EbtReference && right->getType().getReferentType()->containsUnsizedArray())) {
|
||||
if ((left->isReference() && left->getType().getReferentType()->containsUnsizedArray()) ||
|
||||
(right->isReference() && right->getType().getReferentType()->containsUnsizedArray())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (left->getBasicType() == EbtReference && isTypeInt(right->getBasicType())) {
|
||||
if (left->isReference() && isTypeInt(right->getBasicType())) {
|
||||
const TType& referenceType = left->getType();
|
||||
TIntermConstantUnion* size = addConstantUnion((unsigned long long)computeBufferReferenceTypeSize(left->getType()), loc, true);
|
||||
left = addBuiltInFunctionCall(loc, EOpConvPtrToUint64, true, left, TType(EbtUint64));
|
||||
@ -141,7 +141,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn
|
||||
return node;
|
||||
}
|
||||
|
||||
if (op == EOpAdd && right->getBasicType() == EbtReference && isTypeInt(left->getBasicType())) {
|
||||
if (op == EOpAdd && right->isReference() && isTypeInt(left->getBasicType())) {
|
||||
const TType& referenceType = right->getType();
|
||||
TIntermConstantUnion* size = addConstantUnion((unsigned long long)computeBufferReferenceTypeSize(right->getType()), loc, true);
|
||||
right = addBuiltInFunctionCall(loc, EOpConvPtrToUint64, true, right, TType(EbtUint64));
|
||||
@ -154,7 +154,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn
|
||||
return node;
|
||||
}
|
||||
|
||||
if (op == EOpSub && left->getBasicType() == EbtReference && right->getBasicType() == EbtReference) {
|
||||
if (op == EOpSub && left->isReference() && right->isReference()) {
|
||||
TIntermConstantUnion* size = addConstantUnion((long long)computeBufferReferenceTypeSize(left->getType()), loc, true);
|
||||
|
||||
left = addBuiltInFunctionCall(loc, EOpConvPtrToUint64, true, left, TType(EbtUint64));
|
||||
@ -170,7 +170,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn
|
||||
}
|
||||
|
||||
// No other math operators supported on references
|
||||
if (left->getBasicType() == EbtReference || right->getBasicType() == EbtReference) {
|
||||
if (left->isReference() || right->isReference()) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
@ -216,7 +216,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn
|
||||
node->getWritableType().getQualifier().makeSpecConstant();
|
||||
|
||||
// If must propagate nonuniform, make a nonuniform.
|
||||
if ((node->getLeft()->getQualifier().nonUniform || node->getRight()->getQualifier().nonUniform) &&
|
||||
if ((node->getLeft()->getQualifier().isNonUniform() || node->getRight()->getQualifier().isNonUniform()) &&
|
||||
isNonuniformPropagating(node->getOp()))
|
||||
node->getWritableType().getQualifier().nonUniform = true;
|
||||
|
||||
@ -290,7 +290,7 @@ TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TInterm
|
||||
// Convert "reference += int" to "reference = reference + int". We need this because the
|
||||
// "reference + int" calculation involves a cast back to the original type, which makes it
|
||||
// not an lvalue.
|
||||
if ((op == EOpAddAssign || op == EOpSubAssign) && left->getBasicType() == EbtReference &&
|
||||
if ((op == EOpAddAssign || op == EOpSubAssign) && left->isReference() &&
|
||||
extensionRequested(E_GL_EXT_buffer_reference2)) {
|
||||
|
||||
if (!(right->getType().isScalar() && right->getType().isIntegerDomain()))
|
||||
@ -359,7 +359,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
|
||||
switch (op) {
|
||||
case EOpLogicalNot:
|
||||
if (source == EShSourceHlsl) {
|
||||
if (getSource() == EShSourceHlsl) {
|
||||
break; // HLSL can promote logical not
|
||||
}
|
||||
|
||||
@ -383,18 +383,20 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
//
|
||||
TBasicType newType = EbtVoid;
|
||||
switch (op) {
|
||||
case EOpConstructInt8: newType = EbtInt8; break;
|
||||
case EOpConstructUint8: newType = EbtUint8; break;
|
||||
case EOpConstructInt16: newType = EbtInt16; break;
|
||||
case EOpConstructUint16: newType = EbtUint16; break;
|
||||
case EOpConstructInt: newType = EbtInt; break;
|
||||
case EOpConstructUint: newType = EbtUint; break;
|
||||
case EOpConstructInt64: newType = EbtInt64; break;
|
||||
case EOpConstructUint64: newType = EbtUint64; break;
|
||||
case EOpConstructBool: newType = EbtBool; break;
|
||||
case EOpConstructFloat: newType = EbtFloat; break;
|
||||
case EOpConstructInt: newType = EbtInt; break;
|
||||
case EOpConstructUint: newType = EbtUint; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpConstructInt8: newType = EbtInt8; break;
|
||||
case EOpConstructUint8: newType = EbtUint8; break;
|
||||
case EOpConstructInt16: newType = EbtInt16; break;
|
||||
case EOpConstructUint16: newType = EbtUint16; break;
|
||||
case EOpConstructInt64: newType = EbtInt64; break;
|
||||
case EOpConstructUint64: newType = EbtUint64; break;
|
||||
case EOpConstructDouble: newType = EbtDouble; break;
|
||||
case EOpConstructFloat16: newType = EbtFloat16; break;
|
||||
#endif
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
|
||||
@ -449,7 +451,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
node->getWritableType().getQualifier().makeSpecConstant();
|
||||
|
||||
// If must propagate nonuniform, make a nonuniform.
|
||||
if (node->getOperand()->getQualifier().nonUniform && isNonuniformPropagating(node->getOp()))
|
||||
if (node->getOperand()->getQualifier().isNonUniform() && isNonuniformPropagating(node->getOp()))
|
||||
node->getWritableType().getQualifier().nonUniform = true;
|
||||
|
||||
return node;
|
||||
@ -536,15 +538,13 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const
|
||||
return false;
|
||||
case EbtAtomicUint:
|
||||
case EbtSampler:
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EbtAccStructNV:
|
||||
#endif
|
||||
// opaque types can be passed to functions
|
||||
if (op == EOpFunction)
|
||||
break;
|
||||
|
||||
// HLSL can assign samplers directly (no constructor)
|
||||
if (source == EShSourceHlsl && node->getBasicType() == EbtSampler)
|
||||
if (getSource() == EShSourceHlsl && node->getBasicType() == EbtSampler)
|
||||
break;
|
||||
|
||||
// samplers can get assigned via a sampler constructor
|
||||
@ -609,16 +609,17 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
}
|
||||
|
||||
switch (convertTo) {
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble:
|
||||
switch (node->getBasicType()) {
|
||||
case EbtUint: newOp = EOpConvUintToDouble; break;
|
||||
case EbtBool: newOp = EOpConvBoolToDouble; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToDouble; break;
|
||||
case EbtInt: newOp = EOpConvIntToDouble; break;
|
||||
case EbtInt8: newOp = EOpConvInt8ToDouble; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToDouble; break;
|
||||
case EbtInt16: newOp = EOpConvInt16ToDouble; break;
|
||||
case EbtUint16: newOp = EOpConvUint16ToDouble; break;
|
||||
case EbtInt: newOp = EOpConvIntToDouble; break;
|
||||
case EbtUint: newOp = EOpConvUintToDouble; break;
|
||||
case EbtBool: newOp = EOpConvBoolToDouble; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToDouble; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToDouble; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToDouble; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToDouble; break;
|
||||
@ -626,23 +627,27 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case EbtFloat:
|
||||
switch (node->getBasicType()) {
|
||||
case EbtInt: newOp = EOpConvIntToFloat; break;
|
||||
case EbtUint: newOp = EOpConvUintToFloat; break;
|
||||
case EbtBool: newOp = EOpConvBoolToFloat; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble: newOp = EOpConvDoubleToFloat; break;
|
||||
case EbtInt8: newOp = EOpConvInt8ToFloat; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToFloat; break;
|
||||
case EbtInt16: newOp = EOpConvInt16ToFloat; break;
|
||||
case EbtUint16: newOp = EOpConvUint16ToFloat; break;
|
||||
case EbtInt: newOp = EOpConvIntToFloat; break;
|
||||
case EbtUint: newOp = EOpConvUintToFloat; break;
|
||||
case EbtBool: newOp = EOpConvBoolToFloat; break;
|
||||
case EbtDouble: newOp = EOpConvDoubleToFloat; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToFloat; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToFloat; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToFloat; break;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtFloat16:
|
||||
switch (node->getBasicType()) {
|
||||
case EbtInt8: newOp = EOpConvInt8ToFloat16; break;
|
||||
@ -660,23 +665,27 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case EbtBool:
|
||||
switch (node->getBasicType()) {
|
||||
case EbtInt: newOp = EOpConvIntToBool; break;
|
||||
case EbtUint: newOp = EOpConvUintToBool; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToBool; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble: newOp = EOpConvDoubleToBool; break;
|
||||
case EbtInt8: newOp = EOpConvInt8ToBool; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToBool; break;
|
||||
case EbtInt16: newOp = EOpConvInt16ToBool; break;
|
||||
case EbtUint16: newOp = EOpConvUint16ToBool; break;
|
||||
case EbtInt: newOp = EOpConvIntToBool; break;
|
||||
case EbtUint: newOp = EOpConvUintToBool; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToBool; break;
|
||||
case EbtDouble: newOp = EOpConvDoubleToBool; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToBool; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToBool; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToBool; break;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
switch (node->getBasicType()) {
|
||||
case EbtUint8: newOp = EOpConvUint8ToInt8; break;
|
||||
@ -746,41 +755,47 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case EbtInt:
|
||||
switch (node->getBasicType()) {
|
||||
case EbtUint: newOp = EOpConvUintToInt; break;
|
||||
case EbtBool: newOp = EOpConvBoolToInt; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToInt; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: newOp = EOpConvInt8ToInt; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToInt; break;
|
||||
case EbtInt16: newOp = EOpConvInt16ToInt; break;
|
||||
case EbtUint16: newOp = EOpConvUint16ToInt; break;
|
||||
case EbtUint: newOp = EOpConvUintToInt; break;
|
||||
case EbtBool: newOp = EOpConvBoolToInt; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToInt; break;
|
||||
case EbtDouble: newOp = EOpConvDoubleToInt; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToInt; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToInt; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToInt; break;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
switch (node->getBasicType()) {
|
||||
case EbtInt: newOp = EOpConvIntToUint; break;
|
||||
case EbtBool: newOp = EOpConvBoolToUint; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToUint; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8: newOp = EOpConvInt8ToUint; break;
|
||||
case EbtUint8: newOp = EOpConvUint8ToUint; break;
|
||||
case EbtInt16: newOp = EOpConvInt16ToUint; break;
|
||||
case EbtUint16: newOp = EOpConvUint16ToUint; break;
|
||||
case EbtInt: newOp = EOpConvIntToUint; break;
|
||||
case EbtBool: newOp = EOpConvBoolToUint; break;
|
||||
case EbtFloat: newOp = EOpConvFloatToUint; break;
|
||||
case EbtDouble: newOp = EOpConvDoubleToUint; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToUint; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToUint; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToUint; break;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt64:
|
||||
switch (node->getBasicType()) {
|
||||
case EbtInt8: newOp = EOpConvInt8ToInt64; break;
|
||||
@ -815,6 +830,7 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
@ -921,7 +937,7 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no
|
||||
case EOpLogicalAnd:
|
||||
case EOpLogicalOr:
|
||||
case EOpLogicalXor:
|
||||
if (source == EShSourceHlsl)
|
||||
if (getSource() == EShSourceHlsl)
|
||||
promoteTo = std::make_tuple(EbtBool, EbtBool);
|
||||
else
|
||||
return std::make_tuple(node0, node1);
|
||||
@ -932,7 +948,7 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no
|
||||
// HLSL can promote bools to ints to make this work.
|
||||
case EOpLeftShift:
|
||||
case EOpRightShift:
|
||||
if (source == EShSourceHlsl) {
|
||||
if (getSource() == EShSourceHlsl) {
|
||||
TBasicType node0BasicType = node0->getBasicType();
|
||||
if (node0BasicType == EbtBool)
|
||||
node0BasicType = EbtInt;
|
||||
@ -1027,6 +1043,13 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EOpConstructFloat:
|
||||
promoteTo = EbtFloat;
|
||||
break;
|
||||
case EOpConstructInt:
|
||||
promoteTo = EbtInt;
|
||||
break;
|
||||
case EOpConstructUint:
|
||||
promoteTo = EbtUint;
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpConstructDouble:
|
||||
promoteTo = EbtDouble;
|
||||
break;
|
||||
@ -1055,18 +1078,13 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
canPromoteConstant = extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
extensionRequested(E_GL_EXT_shader_explicit_arithmetic_types_int16);
|
||||
break;
|
||||
case EOpConstructInt:
|
||||
promoteTo = EbtInt;
|
||||
break;
|
||||
case EOpConstructUint:
|
||||
promoteTo = EbtUint;
|
||||
break;
|
||||
case EOpConstructInt64:
|
||||
promoteTo = EbtInt64;
|
||||
break;
|
||||
case EOpConstructUint64:
|
||||
promoteTo = EbtUint64;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case EOpLogicalNot:
|
||||
|
||||
@ -1110,7 +1128,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EOpConstructStruct:
|
||||
case EOpConstructCooperativeMatrix:
|
||||
|
||||
if (type.getBasicType() == EbtReference || node->getType().getBasicType() == EbtReference) {
|
||||
if (type.isReference() || node->getType().isReference()) {
|
||||
// types must match to assign a reference
|
||||
if (type == node->getType())
|
||||
return node;
|
||||
@ -1133,7 +1151,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EOpLeftShiftAssign:
|
||||
case EOpRightShiftAssign:
|
||||
{
|
||||
if (source == EShSourceHlsl && node->getType().getBasicType() == EbtBool)
|
||||
if (getSource() == EShSourceHlsl && node->getType().getBasicType() == EbtBool)
|
||||
promoteTo = type.getBasicType();
|
||||
else {
|
||||
if (isTypeInt(type.getBasicType()) && isTypeInt(node->getBasicType()))
|
||||
@ -1179,7 +1197,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
TIntermTyped* TIntermediate::addUniShapeConversion(TOperator op, const TType& type, TIntermTyped* node)
|
||||
{
|
||||
// some source languages don't do this
|
||||
switch (source) {
|
||||
switch (getSource()) {
|
||||
case EShSourceHlsl:
|
||||
break;
|
||||
case EShSourceGlsl:
|
||||
@ -1232,7 +1250,7 @@ TIntermTyped* TIntermediate::addUniShapeConversion(TOperator op, const TType& ty
|
||||
void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode)
|
||||
{
|
||||
// some source languages don't do this
|
||||
switch (source) {
|
||||
switch (getSource()) {
|
||||
case EShSourceHlsl:
|
||||
break;
|
||||
case EShSourceGlsl:
|
||||
@ -1335,7 +1353,7 @@ TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped*
|
||||
// The new node that handles the conversion
|
||||
TOperator constructorOp = mapTypeToConstructorOp(type);
|
||||
|
||||
if (source == EShSourceHlsl) {
|
||||
if (getSource() == EShSourceHlsl) {
|
||||
// HLSL rules for scalar, vector and matrix conversions:
|
||||
// 1) scalar can become anything, initializing every component with its value
|
||||
// 2) vector and matrix can become scalar, first element is used (warning: truncation)
|
||||
@ -1448,7 +1466,31 @@ bool TIntermediate::isFPPromotion(TBasicType from, TBasicType to) const
|
||||
|
||||
bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
return false;
|
||||
#endif
|
||||
|
||||
switch (from) {
|
||||
case EbtInt:
|
||||
switch(to) {
|
||||
case EbtUint:
|
||||
return version >= 400 || getSource() == EShSourceHlsl;
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
switch(to) {
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EbtInt8:
|
||||
switch (to) {
|
||||
case EbtUint8:
|
||||
@ -1495,26 +1537,6 @@ bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EbtInt:
|
||||
switch(to) {
|
||||
case EbtUint:
|
||||
return version >= 400 || (source == EShSourceHlsl);
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
switch(to) {
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EbtInt64:
|
||||
if (to == EbtUint64) {
|
||||
return true;
|
||||
@ -1528,6 +1550,10 @@ bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const
|
||||
|
||||
bool TIntermediate::isFPConversion(TBasicType from, TBasicType to) const
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (to == EbtFloat && from == EbtFloat16) {
|
||||
return true;
|
||||
} else {
|
||||
@ -1538,6 +1564,17 @@ bool TIntermediate::isFPConversion(TBasicType from, TBasicType to) const
|
||||
bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const
|
||||
{
|
||||
switch (from) {
|
||||
case EbtInt:
|
||||
case EbtUint:
|
||||
switch(to) {
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtInt8:
|
||||
case EbtUint8:
|
||||
case EbtInt16:
|
||||
@ -1551,23 +1588,13 @@ bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EbtInt:
|
||||
case EbtUint:
|
||||
switch(to) {
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
if (to == EbtDouble) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1580,7 +1607,7 @@ bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const
|
||||
//
|
||||
bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperator op) const
|
||||
{
|
||||
if (profile == EEsProfile || version == 110)
|
||||
if (isEsProfile() || version == 110)
|
||||
return false;
|
||||
|
||||
if (from == to)
|
||||
@ -1588,7 +1615,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
|
||||
// TODO: Move more policies into language-specific handlers.
|
||||
// Some languages allow more general (or potentially, more specific) conversions under some conditions.
|
||||
if (source == EShSourceHlsl) {
|
||||
if (getSource() == EShSourceHlsl) {
|
||||
const bool fromConvertable = (from == EbtFloat || from == EbtDouble || from == EbtInt || from == EbtUint || from == EbtBool);
|
||||
const bool toConvertable = (to == EbtFloat || to == EbtDouble || to == EbtInt || to == EbtUint || to == EbtBool);
|
||||
|
||||
@ -1655,7 +1682,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
}
|
||||
|
||||
// hlsl supported conversions
|
||||
if (source == EShSourceHlsl) {
|
||||
if (getSource() == EShSourceHlsl) {
|
||||
if (from == EbtBool && (to == EbtInt || to == EbtUint || to == EbtFloat))
|
||||
return true;
|
||||
}
|
||||
@ -1670,13 +1697,11 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
return true;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EbtInt16:
|
||||
case EbtUint16:
|
||||
return extensionRequested(E_GL_AMD_gpu_shader_int16);
|
||||
case EbtFloat16:
|
||||
return extensionRequested(E_GL_AMD_gpu_shader_half_float);
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -1687,34 +1712,28 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
case EbtFloat:
|
||||
return true;
|
||||
case EbtBool:
|
||||
return (source == EShSourceHlsl);
|
||||
#ifdef AMD_EXTENSIONS
|
||||
return getSource() == EShSourceHlsl;
|
||||
case EbtInt16:
|
||||
case EbtUint16:
|
||||
return extensionRequested(E_GL_AMD_gpu_shader_int16);
|
||||
#endif
|
||||
case EbtFloat16:
|
||||
return
|
||||
#ifdef AMD_EXTENSIONS
|
||||
extensionRequested(E_GL_AMD_gpu_shader_half_float) ||
|
||||
#endif
|
||||
(source == EShSourceHlsl);
|
||||
getSource() == EShSourceHlsl;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
case EbtUint:
|
||||
switch (from) {
|
||||
case EbtInt:
|
||||
return version >= 400 || (source == EShSourceHlsl);
|
||||
return version >= 400 || getSource() == EShSourceHlsl;
|
||||
case EbtUint:
|
||||
return true;
|
||||
case EbtBool:
|
||||
return (source == EShSourceHlsl);
|
||||
#ifdef AMD_EXTENSIONS
|
||||
return getSource() == EShSourceHlsl;
|
||||
case EbtInt16:
|
||||
case EbtUint16:
|
||||
return extensionRequested(E_GL_AMD_gpu_shader_int16);
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -1723,11 +1742,9 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
case EbtInt:
|
||||
return true;
|
||||
case EbtBool:
|
||||
return (source == EShSourceHlsl);
|
||||
#ifdef AMD_EXTENSIONS
|
||||
return getSource() == EShSourceHlsl;
|
||||
case EbtInt16:
|
||||
return extensionRequested(E_GL_AMD_gpu_shader_int16);
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -1738,11 +1755,9 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
case EbtInt64:
|
||||
case EbtUint64:
|
||||
return true;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EbtInt16:
|
||||
case EbtUint16:
|
||||
return extensionRequested(E_GL_AMD_gpu_shader_int16);
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -1751,15 +1766,12 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
case EbtInt:
|
||||
case EbtInt64:
|
||||
return true;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EbtInt16:
|
||||
return extensionRequested(E_GL_AMD_gpu_shader_int16);
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
case EbtFloat16:
|
||||
#ifdef AMD_EXTENSIONS
|
||||
switch (from) {
|
||||
case EbtInt16:
|
||||
case EbtUint16:
|
||||
@ -1769,10 +1781,8 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
case EbtUint16:
|
||||
#ifdef AMD_EXTENSIONS
|
||||
switch (from) {
|
||||
case EbtInt16:
|
||||
case EbtUint16:
|
||||
@ -1780,7 +1790,6 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
@ -1790,7 +1799,12 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBasicType uintType) {
|
||||
static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBasicType uintType)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
return false;
|
||||
#endif
|
||||
|
||||
switch(sintType) {
|
||||
case EbtInt8:
|
||||
switch(uintType) {
|
||||
@ -1849,7 +1863,13 @@ static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBas
|
||||
}
|
||||
|
||||
|
||||
static TBasicType getCorrespondingUnsignedType(TBasicType type) {
|
||||
static TBasicType getCorrespondingUnsignedType(TBasicType type)
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
assert(type == EbtInt);
|
||||
return EbtUint;
|
||||
#endif
|
||||
|
||||
switch(type) {
|
||||
case EbtInt8:
|
||||
return EbtUint8;
|
||||
@ -1898,10 +1918,10 @@ std::tuple<TBasicType, TBasicType> TIntermediate::getConversionDestinatonType(TB
|
||||
TBasicType res0 = EbtNumTypes;
|
||||
TBasicType res1 = EbtNumTypes;
|
||||
|
||||
if (profile == EEsProfile || version == 110)
|
||||
return std::make_tuple(res0, res1);;
|
||||
if (isEsProfile() || version == 110)
|
||||
return std::make_tuple(res0, res1);
|
||||
|
||||
if (source == EShSourceHlsl) {
|
||||
if (getSource() == EShSourceHlsl) {
|
||||
if (canImplicitlyPromote(type1, type0, op)) {
|
||||
res0 = type0;
|
||||
res1 = type0;
|
||||
@ -1970,7 +1990,7 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
||||
{
|
||||
TOperator op = EOpNull;
|
||||
|
||||
if (type.getQualifier().nonUniform)
|
||||
if (type.getQualifier().isNonUniform())
|
||||
return EOpConstructNonuniform;
|
||||
|
||||
if (type.isCoopMat())
|
||||
@ -1981,7 +2001,7 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
||||
op = EOpConstructStruct;
|
||||
break;
|
||||
case EbtSampler:
|
||||
if (type.getSampler().combined)
|
||||
if (type.getSampler().isCombined())
|
||||
op = EOpConstructTextureSampler;
|
||||
break;
|
||||
case EbtFloat:
|
||||
@ -2023,6 +2043,121 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EbtInt:
|
||||
if (type.getMatrixCols()) {
|
||||
switch (type.getMatrixCols()) {
|
||||
case 2:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructIMat2x2; break;
|
||||
case 3: op = EOpConstructIMat2x3; break;
|
||||
case 4: op = EOpConstructIMat2x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructIMat3x2; break;
|
||||
case 3: op = EOpConstructIMat3x3; break;
|
||||
case 4: op = EOpConstructIMat3x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructIMat4x2; break;
|
||||
case 3: op = EOpConstructIMat4x3; break;
|
||||
case 4: op = EOpConstructIMat4x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructInt; break;
|
||||
case 2: op = EOpConstructIVec2; break;
|
||||
case 3: op = EOpConstructIVec3; break;
|
||||
case 4: op = EOpConstructIVec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
if (type.getMatrixCols()) {
|
||||
switch (type.getMatrixCols()) {
|
||||
case 2:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructUMat2x2; break;
|
||||
case 3: op = EOpConstructUMat2x3; break;
|
||||
case 4: op = EOpConstructUMat2x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructUMat3x2; break;
|
||||
case 3: op = EOpConstructUMat3x3; break;
|
||||
case 4: op = EOpConstructUMat3x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructUMat4x2; break;
|
||||
case 3: op = EOpConstructUMat4x3; break;
|
||||
case 4: op = EOpConstructUMat4x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructUint; break;
|
||||
case 2: op = EOpConstructUVec2; break;
|
||||
case 3: op = EOpConstructUVec3; break;
|
||||
case 4: op = EOpConstructUVec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EbtBool:
|
||||
if (type.getMatrixCols()) {
|
||||
switch (type.getMatrixCols()) {
|
||||
case 2:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructBMat2x2; break;
|
||||
case 3: op = EOpConstructBMat2x3; break;
|
||||
case 4: op = EOpConstructBMat2x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructBMat3x2; break;
|
||||
case 3: op = EOpConstructBMat3x3; break;
|
||||
case 4: op = EOpConstructBMat3x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructBMat4x2; break;
|
||||
case 3: op = EOpConstructBMat4x3; break;
|
||||
case 4: op = EOpConstructBMat4x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructBool; break;
|
||||
case 2: op = EOpConstructBVec2; break;
|
||||
case 3: op = EOpConstructBVec3; break;
|
||||
case 4: op = EOpConstructBVec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble:
|
||||
if (type.getMatrixCols()) {
|
||||
switch (type.getMatrixCols()) {
|
||||
@ -2136,82 +2271,6 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case EbtInt:
|
||||
if (type.getMatrixCols()) {
|
||||
switch (type.getMatrixCols()) {
|
||||
case 2:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructIMat2x2; break;
|
||||
case 3: op = EOpConstructIMat2x3; break;
|
||||
case 4: op = EOpConstructIMat2x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructIMat3x2; break;
|
||||
case 3: op = EOpConstructIMat3x3; break;
|
||||
case 4: op = EOpConstructIMat3x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructIMat4x2; break;
|
||||
case 3: op = EOpConstructIMat4x3; break;
|
||||
case 4: op = EOpConstructIMat4x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructInt; break;
|
||||
case 2: op = EOpConstructIVec2; break;
|
||||
case 3: op = EOpConstructIVec3; break;
|
||||
case 4: op = EOpConstructIVec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
if (type.getMatrixCols()) {
|
||||
switch (type.getMatrixCols()) {
|
||||
case 2:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructUMat2x2; break;
|
||||
case 3: op = EOpConstructUMat2x3; break;
|
||||
case 4: op = EOpConstructUMat2x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructUMat3x2; break;
|
||||
case 3: op = EOpConstructUMat3x3; break;
|
||||
case 4: op = EOpConstructUMat3x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructUMat4x2; break;
|
||||
case 3: op = EOpConstructUMat4x3; break;
|
||||
case 4: op = EOpConstructUMat4x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructUint; break;
|
||||
case 2: op = EOpConstructUVec2; break;
|
||||
case 3: op = EOpConstructUVec3; break;
|
||||
case 4: op = EOpConstructUVec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EbtInt64:
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructInt64; break;
|
||||
@ -2230,47 +2289,10 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case EbtBool:
|
||||
if (type.getMatrixCols()) {
|
||||
switch (type.getMatrixCols()) {
|
||||
case 2:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructBMat2x2; break;
|
||||
case 3: op = EOpConstructBMat2x3; break;
|
||||
case 4: op = EOpConstructBMat2x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructBMat3x2; break;
|
||||
case 3: op = EOpConstructBMat3x3; break;
|
||||
case 4: op = EOpConstructBMat3x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch (type.getMatrixRows()) {
|
||||
case 2: op = EOpConstructBMat4x2; break;
|
||||
case 3: op = EOpConstructBMat4x3; break;
|
||||
case 4: op = EOpConstructBMat4x4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructBool; break;
|
||||
case 2: op = EOpConstructBVec2; break;
|
||||
case 3: op = EOpConstructBVec3; break;
|
||||
case 4: op = EOpConstructBVec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EbtReference:
|
||||
op = EOpConstructReference;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2729,6 +2751,7 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/)
|
||||
if (aggRoot && aggRoot->getOp() == EOpNull)
|
||||
aggRoot->setOperator(EOpSequence);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Propagate 'noContraction' label in backward from 'precise' variables.
|
||||
glslang::PropagateNoContraction(*this);
|
||||
|
||||
@ -2739,6 +2762,7 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/)
|
||||
performTextureUpgradeAndSamplerRemovalTransformation(root);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -3780,6 +3804,16 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
#define PROMOTE(Set, CType, Get) leftUnionArray[i].Set(static_cast<CType>(rightUnionArray[i].Get()))
|
||||
#define PROMOTE_TO_BOOL(Get) leftUnionArray[i].setBConst(rightUnionArray[i].Get() != 0)
|
||||
|
||||
#ifdef GLSLANG_WEB
|
||||
#define TO_ALL(Get) \
|
||||
switch (promoteTo) { \
|
||||
case EbtFloat: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtInt: PROMOTE(setIConst, int, Get); break; \
|
||||
case EbtUint: PROMOTE(setUConst, unsigned int, Get); break; \
|
||||
case EbtBool: PROMOTE_TO_BOOL(Get); break; \
|
||||
default: return node; \
|
||||
}
|
||||
#else
|
||||
#define TO_ALL(Get) \
|
||||
switch (promoteTo) { \
|
||||
case EbtFloat16: PROMOTE(setDConst, double, Get); break; \
|
||||
@ -3796,20 +3830,23 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
case EbtBool: PROMOTE_TO_BOOL(Get); break; \
|
||||
default: return node; \
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (node->getType().getBasicType()) {
|
||||
case EbtFloat16: TO_ALL(getDConst); break;
|
||||
case EbtFloat: TO_ALL(getDConst); break;
|
||||
case EbtInt: TO_ALL(getIConst); break;
|
||||
case EbtUint: TO_ALL(getUConst); break;
|
||||
case EbtBool: TO_ALL(getBConst); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtFloat16: TO_ALL(getDConst); break;
|
||||
case EbtDouble: TO_ALL(getDConst); break;
|
||||
case EbtInt8: TO_ALL(getI8Const); break;
|
||||
case EbtInt16: TO_ALL(getI16Const); break;
|
||||
case EbtInt: TO_ALL(getIConst); break;
|
||||
case EbtInt64: TO_ALL(getI64Const); break;
|
||||
case EbtUint8: TO_ALL(getU8Const); break;
|
||||
case EbtUint16: TO_ALL(getU16Const); break;
|
||||
case EbtUint: TO_ALL(getUConst); break;
|
||||
case EbtUint64: TO_ALL(getU64Const); break;
|
||||
case EbtBool: TO_ALL(getBConst); break;
|
||||
#endif
|
||||
default: return node;
|
||||
}
|
||||
}
|
||||
@ -3839,7 +3876,7 @@ bool TIntermediate::specConstantPropagates(const TIntermTyped& node1, const TInt
|
||||
struct TextureUpgradeAndSamplerRemovalTransform : public TIntermTraverser {
|
||||
void visitSymbol(TIntermSymbol* symbol) override {
|
||||
if (symbol->getBasicType() == EbtSampler && symbol->getType().getSampler().isTexture()) {
|
||||
symbol->getWritableType().getSampler().combined = true;
|
||||
symbol->getWritableType().getSampler().setCombined(true);
|
||||
}
|
||||
}
|
||||
bool visitAggregate(TVisit, TIntermAggregate* ag) override {
|
||||
|
@ -67,6 +67,8 @@ void TParseContextBase::outputMessage(const TSourceLoc& loc, const char* szReaso
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(GLSLANG_WEB) || defined(GLSLANG_WEB_DEVEL)
|
||||
|
||||
void C_DECL TParseContextBase::error(const TSourceLoc& loc, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...)
|
||||
{
|
||||
@ -113,6 +115,8 @@ void C_DECL TParseContextBase::ppWarn(const TSourceLoc& loc, const char* szReaso
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Both test and if necessary, spit out an error, to see if the node is really
|
||||
// an l-value that can be operated on this way.
|
||||
@ -149,15 +153,13 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
case EvqConst: message = "can't modify a const"; break;
|
||||
case EvqConstReadOnly: message = "can't modify a const"; break;
|
||||
case EvqUniform: message = "can't modify a uniform"; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EvqBuffer:
|
||||
if (node->getQualifier().readonly)
|
||||
if (node->getQualifier().isReadOnly())
|
||||
message = "can't modify a readonly buffer";
|
||||
#ifdef NV_EXTENSIONS
|
||||
if (node->getQualifier().layoutShaderRecordNV)
|
||||
if (node->getQualifier().isShaderRecordNV())
|
||||
message = "can't modify a shaderrecordnv qualified buffer";
|
||||
#endif
|
||||
break;
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EvqHitAttrNV:
|
||||
if (language != EShLangIntersectNV)
|
||||
message = "cannot modify hitAttributeNV in this stage";
|
||||
@ -172,13 +174,13 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
case EbtSampler:
|
||||
message = "can't modify a sampler";
|
||||
break;
|
||||
case EbtAtomicUint:
|
||||
message = "can't modify an atomic_uint";
|
||||
break;
|
||||
case EbtVoid:
|
||||
message = "can't modify void";
|
||||
break;
|
||||
#ifdef NV_EXTENSIONS
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtAtomicUint:
|
||||
message = "can't modify an atomic_uint";
|
||||
break;
|
||||
case EbtAccStructNV:
|
||||
message = "can't modify accelerationStructureNV";
|
||||
break;
|
||||
@ -234,7 +236,7 @@ void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
}
|
||||
|
||||
TIntermSymbol* symNode = node->getAsSymbolNode();
|
||||
if (symNode && symNode->getQualifier().writeonly)
|
||||
if (symNode && symNode->getQualifier().isWriteOnly())
|
||||
error(loc, "can't read from writeonly object: ", op, symNode->getName().c_str());
|
||||
}
|
||||
|
||||
@ -574,6 +576,7 @@ void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TStrin
|
||||
selector.push_back(0);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_HLSL
|
||||
//
|
||||
// Make the passed-in variable information become a member of the
|
||||
// global uniform block. If this doesn't exist yet, make it.
|
||||
@ -618,6 +621,7 @@ void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& mem
|
||||
|
||||
++firstNewMember;
|
||||
}
|
||||
#endif
|
||||
|
||||
void TParseContextBase::finish()
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -97,6 +97,7 @@ public:
|
||||
}
|
||||
virtual ~TParseContextBase() { }
|
||||
|
||||
#if !defined(GLSLANG_WEB) || defined(GLSLANG_WEB_DEVEL)
|
||||
virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...);
|
||||
virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
@ -105,6 +106,7 @@ public:
|
||||
const char* szExtraInfoFormat, ...);
|
||||
virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
|
||||
const char* szExtraInfoFormat, ...);
|
||||
#endif
|
||||
|
||||
virtual void setLimits(const TBuiltInResource&) = 0;
|
||||
|
||||
@ -150,8 +152,10 @@ public:
|
||||
extensionCallback(line, extension, behavior);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_HLSL
|
||||
// Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
|
||||
virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr);
|
||||
#endif
|
||||
|
||||
// Potentially rename shader entry point function
|
||||
void renameShaderFunction(TString*& name) const
|
||||
@ -297,10 +301,12 @@ public:
|
||||
TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
||||
void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
void makeEditable(TSymbol*&) override;
|
||||
void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier);
|
||||
#endif
|
||||
bool isIoResizeArray(const TType&) const;
|
||||
void fixIoArraySize(const TSourceLoc&, TType&);
|
||||
void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier);
|
||||
void handleIoResizeArrayAccess(const TSourceLoc&, TIntermTyped* base);
|
||||
void checkIoArraysConsistency(const TSourceLoc&, bool tailOnly = false);
|
||||
int getIoArrayImplicitSize(const TQualifier&, TString* featureString = nullptr) const;
|
||||
@ -404,6 +410,7 @@ public:
|
||||
TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&);
|
||||
TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
|
||||
TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
|
||||
void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to);
|
||||
void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
|
||||
void blockStageIoCheck(const TSourceLoc&, const TQualifier&);
|
||||
void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName);
|
||||
@ -417,6 +424,7 @@ public:
|
||||
void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
|
||||
TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
TAttributeType attributeFromName(const TString& name) const;
|
||||
TAttributes* makeAttributes(const TString& identifier) const;
|
||||
TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const;
|
||||
@ -425,9 +433,9 @@ public:
|
||||
// Determine selection control from attributes
|
||||
void handleSelectionAttributes(const TAttributes& attributes, TIntermNode*);
|
||||
void handleSwitchAttributes(const TAttributes& attributes, TIntermNode*);
|
||||
|
||||
// Determine loop control from attributes
|
||||
void handleLoopAttributes(const TAttributes& attributes, TIntermNode*);
|
||||
#endif
|
||||
|
||||
void checkAndResizeMeshViewDim(const TSourceLoc&, TType&, bool isBlockMember);
|
||||
|
||||
@ -441,7 +449,9 @@ protected:
|
||||
bool isRuntimeLength(const TIntermTyped&) const;
|
||||
TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable);
|
||||
TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer);
|
||||
#ifndef GLSLANG_WEB
|
||||
void finish() override;
|
||||
#endif
|
||||
|
||||
public:
|
||||
//
|
||||
@ -467,10 +477,11 @@ protected:
|
||||
TQualifier globalUniformDefaults;
|
||||
TQualifier globalInputDefaults;
|
||||
TQualifier globalOutputDefaults;
|
||||
int* atomicUintOffsets; // to become an array of the right size to hold an offset per binding point
|
||||
TString currentCaller; // name of last function body entered (not valid when at global scope)
|
||||
TIdSetType inductiveLoopIds;
|
||||
#ifndef GLSLANG_WEB
|
||||
int* atomicUintOffsets; // to become an array of the right size to hold an offset per binding point
|
||||
bool anyIndexLimits;
|
||||
TIdSetType inductiveLoopIds;
|
||||
TVector<TIntermTyped*> needsIndexLimitationChecking;
|
||||
|
||||
//
|
||||
@ -506,6 +517,7 @@ protected:
|
||||
// array-sizing declarations
|
||||
//
|
||||
TVector<TSymbol*> ioArraySymbolResizeList;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // end namespace glslang
|
||||
|
@ -324,7 +324,9 @@ struct str_hash
|
||||
// A single global usable by all threads, by all versions, by all languages.
|
||||
// After a single process-level initialization, this is read only and thread safe
|
||||
std::unordered_map<const char*, int, str_hash, str_eq>* KeywordMap = nullptr;
|
||||
#ifndef GLSLANG_WEB
|
||||
std::unordered_set<const char*, str_hash, str_eq>* ReservedSet = nullptr;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
@ -341,9 +343,14 @@ void TScanContext::fillInKeywordMap()
|
||||
|
||||
(*KeywordMap)["const"] = CONST;
|
||||
(*KeywordMap)["uniform"] = UNIFORM;
|
||||
(*KeywordMap)["nonuniformEXT"] = NONUNIFORM;
|
||||
(*KeywordMap)["in"] = IN;
|
||||
(*KeywordMap)["out"] = OUT;
|
||||
(*KeywordMap)["smooth"] = SMOOTH;
|
||||
(*KeywordMap)["flat"] = FLAT;
|
||||
(*KeywordMap)["centroid"] = CENTROID;
|
||||
(*KeywordMap)["invariant"] = INVARIANT;
|
||||
(*KeywordMap)["packed"] = PACKED;
|
||||
(*KeywordMap)["resource"] = RESOURCE;
|
||||
(*KeywordMap)["inout"] = INOUT;
|
||||
(*KeywordMap)["struct"] = STRUCT;
|
||||
(*KeywordMap)["break"] = BREAK;
|
||||
@ -356,7 +363,6 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["default"] = DEFAULT;
|
||||
(*KeywordMap)["if"] = IF;
|
||||
(*KeywordMap)["else"] = ELSE;
|
||||
(*KeywordMap)["demote"] = DEMOTE;
|
||||
(*KeywordMap)["discard"] = DISCARD;
|
||||
(*KeywordMap)["return"] = RETURN;
|
||||
(*KeywordMap)["void"] = VOID;
|
||||
@ -377,8 +383,33 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["mat4"] = MAT4;
|
||||
(*KeywordMap)["true"] = BOOLCONSTANT;
|
||||
(*KeywordMap)["false"] = BOOLCONSTANT;
|
||||
(*KeywordMap)["layout"] = LAYOUT;
|
||||
(*KeywordMap)["shared"] = SHARED;
|
||||
(*KeywordMap)["highp"] = HIGH_PRECISION;
|
||||
(*KeywordMap)["mediump"] = MEDIUM_PRECISION;
|
||||
(*KeywordMap)["lowp"] = LOW_PRECISION;
|
||||
(*KeywordMap)["superp"] = SUPERP;
|
||||
(*KeywordMap)["precision"] = PRECISION;
|
||||
(*KeywordMap)["mat2x2"] = MAT2X2;
|
||||
(*KeywordMap)["mat2x3"] = MAT2X3;
|
||||
(*KeywordMap)["mat2x4"] = MAT2X4;
|
||||
(*KeywordMap)["mat3x2"] = MAT3X2;
|
||||
(*KeywordMap)["mat3x3"] = MAT3X3;
|
||||
(*KeywordMap)["mat3x4"] = MAT3X4;
|
||||
(*KeywordMap)["mat4x2"] = MAT4X2;
|
||||
(*KeywordMap)["mat4x3"] = MAT4X3;
|
||||
(*KeywordMap)["mat4x4"] = MAT4X4;
|
||||
(*KeywordMap)["uint"] = UINT;
|
||||
(*KeywordMap)["uvec2"] = UVEC2;
|
||||
(*KeywordMap)["uvec3"] = UVEC3;
|
||||
(*KeywordMap)["uvec4"] = UVEC4;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
(*KeywordMap)["nonuniformEXT"] = NONUNIFORM;
|
||||
(*KeywordMap)["demote"] = DEMOTE;
|
||||
(*KeywordMap)["attribute"] = ATTRIBUTE;
|
||||
(*KeywordMap)["varying"] = VARYING;
|
||||
(*KeywordMap)["noperspective"] = NOPERSPECTIVE;
|
||||
(*KeywordMap)["buffer"] = BUFFER;
|
||||
(*KeywordMap)["coherent"] = COHERENT;
|
||||
(*KeywordMap)["devicecoherent"] = DEVICECOHERENT;
|
||||
@ -391,24 +422,9 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["writeonly"] = WRITEONLY;
|
||||
(*KeywordMap)["atomic_uint"] = ATOMIC_UINT;
|
||||
(*KeywordMap)["volatile"] = VOLATILE;
|
||||
(*KeywordMap)["layout"] = LAYOUT;
|
||||
(*KeywordMap)["shared"] = SHARED;
|
||||
(*KeywordMap)["patch"] = PATCH;
|
||||
(*KeywordMap)["sample"] = SAMPLE;
|
||||
(*KeywordMap)["subroutine"] = SUBROUTINE;
|
||||
(*KeywordMap)["highp"] = HIGH_PRECISION;
|
||||
(*KeywordMap)["mediump"] = MEDIUM_PRECISION;
|
||||
(*KeywordMap)["lowp"] = LOW_PRECISION;
|
||||
(*KeywordMap)["precision"] = PRECISION;
|
||||
(*KeywordMap)["mat2x2"] = MAT2X2;
|
||||
(*KeywordMap)["mat2x3"] = MAT2X3;
|
||||
(*KeywordMap)["mat2x4"] = MAT2X4;
|
||||
(*KeywordMap)["mat3x2"] = MAT3X2;
|
||||
(*KeywordMap)["mat3x3"] = MAT3X3;
|
||||
(*KeywordMap)["mat3x4"] = MAT3X4;
|
||||
(*KeywordMap)["mat4x2"] = MAT4X2;
|
||||
(*KeywordMap)["mat4x3"] = MAT4X3;
|
||||
(*KeywordMap)["mat4x4"] = MAT4X4;
|
||||
(*KeywordMap)["dmat2"] = DMAT2;
|
||||
(*KeywordMap)["dmat3"] = DMAT3;
|
||||
(*KeywordMap)["dmat4"] = DMAT4;
|
||||
@ -458,11 +474,6 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["dvec2"] = DVEC2;
|
||||
(*KeywordMap)["dvec3"] = DVEC3;
|
||||
(*KeywordMap)["dvec4"] = DVEC4;
|
||||
(*KeywordMap)["uint"] = UINT;
|
||||
(*KeywordMap)["uvec2"] = UVEC2;
|
||||
(*KeywordMap)["uvec3"] = UVEC3;
|
||||
(*KeywordMap)["uvec4"] = UVEC4;
|
||||
|
||||
(*KeywordMap)["int64_t"] = INT64_T;
|
||||
(*KeywordMap)["uint64_t"] = UINT64_T;
|
||||
(*KeywordMap)["i64vec2"] = I64VEC2;
|
||||
@ -549,6 +560,7 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["f64mat4x2"] = F64MAT4X2;
|
||||
(*KeywordMap)["f64mat4x3"] = F64MAT4X3;
|
||||
(*KeywordMap)["f64mat4x4"] = F64MAT4X4;
|
||||
#endif
|
||||
|
||||
(*KeywordMap)["sampler2D"] = SAMPLER2D;
|
||||
(*KeywordMap)["samplerCube"] = SAMPLERCUBE;
|
||||
@ -556,12 +568,6 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["samplerCubeArrayShadow"] = SAMPLERCUBEARRAYSHADOW;
|
||||
(*KeywordMap)["isamplerCubeArray"] = ISAMPLERCUBEARRAY;
|
||||
(*KeywordMap)["usamplerCubeArray"] = USAMPLERCUBEARRAY;
|
||||
(*KeywordMap)["sampler1DArrayShadow"] = SAMPLER1DARRAYSHADOW;
|
||||
(*KeywordMap)["isampler1DArray"] = ISAMPLER1DARRAY;
|
||||
(*KeywordMap)["usampler1D"] = USAMPLER1D;
|
||||
(*KeywordMap)["isampler1D"] = ISAMPLER1D;
|
||||
(*KeywordMap)["usampler1DArray"] = USAMPLER1DARRAY;
|
||||
(*KeywordMap)["samplerBuffer"] = SAMPLERBUFFER;
|
||||
(*KeywordMap)["samplerCubeShadow"] = SAMPLERCUBESHADOW;
|
||||
(*KeywordMap)["sampler2DArray"] = SAMPLER2DARRAY;
|
||||
(*KeywordMap)["sampler2DArrayShadow"] = SAMPLER2DARRAYSHADOW;
|
||||
@ -573,6 +579,16 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["usampler3D"] = USAMPLER3D;
|
||||
(*KeywordMap)["usamplerCube"] = USAMPLERCUBE;
|
||||
(*KeywordMap)["usampler2DArray"] = USAMPLER2DARRAY;
|
||||
(*KeywordMap)["sampler3D"] = SAMPLER3D;
|
||||
(*KeywordMap)["sampler2DShadow"] = SAMPLER2DSHADOW;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
(*KeywordMap)["sampler1DArrayShadow"] = SAMPLER1DARRAYSHADOW;
|
||||
(*KeywordMap)["isampler1DArray"] = ISAMPLER1DARRAY;
|
||||
(*KeywordMap)["usampler1D"] = USAMPLER1D;
|
||||
(*KeywordMap)["isampler1D"] = ISAMPLER1D;
|
||||
(*KeywordMap)["usampler1DArray"] = USAMPLER1DARRAY;
|
||||
(*KeywordMap)["samplerBuffer"] = SAMPLERBUFFER;
|
||||
(*KeywordMap)["isampler2DRect"] = ISAMPLER2DRECT;
|
||||
(*KeywordMap)["usampler2DRect"] = USAMPLER2DRECT;
|
||||
(*KeywordMap)["isamplerBuffer"] = ISAMPLERBUFFER;
|
||||
@ -585,8 +601,6 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["usampler2DMSArray"] = USAMPLER2DMSARRAY;
|
||||
(*KeywordMap)["sampler1D"] = SAMPLER1D;
|
||||
(*KeywordMap)["sampler1DShadow"] = SAMPLER1DSHADOW;
|
||||
(*KeywordMap)["sampler3D"] = SAMPLER3D;
|
||||
(*KeywordMap)["sampler2DShadow"] = SAMPLER2DSHADOW;
|
||||
(*KeywordMap)["sampler2DRect"] = SAMPLER2DRECT;
|
||||
(*KeywordMap)["sampler2DRectShadow"] = SAMPLER2DRECTSHADOW;
|
||||
(*KeywordMap)["sampler1DArray"] = SAMPLER1DARRAY;
|
||||
@ -639,7 +653,6 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["usubpassInput"] = USUBPASSINPUT;
|
||||
(*KeywordMap)["usubpassInputMS"] = USUBPASSINPUTMS;
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
(*KeywordMap)["f16sampler1D"] = F16SAMPLER1D;
|
||||
(*KeywordMap)["f16sampler2D"] = F16SAMPLER2D;
|
||||
(*KeywordMap)["f16sampler3D"] = F16SAMPLER3D;
|
||||
@ -685,25 +698,10 @@ void TScanContext::fillInKeywordMap()
|
||||
|
||||
(*KeywordMap)["f16subpassInput"] = F16SUBPASSINPUT;
|
||||
(*KeywordMap)["f16subpassInputMS"] = F16SUBPASSINPUTMS;
|
||||
#endif
|
||||
|
||||
(*KeywordMap)["noperspective"] = NOPERSPECTIVE;
|
||||
(*KeywordMap)["smooth"] = SMOOTH;
|
||||
(*KeywordMap)["flat"] = FLAT;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
(*KeywordMap)["__explicitInterpAMD"] = EXPLICITINTERPAMD;
|
||||
#endif
|
||||
(*KeywordMap)["centroid"] = CENTROID;
|
||||
#ifdef NV_EXTENSIONS
|
||||
(*KeywordMap)["pervertexNV"] = PERVERTEXNV;
|
||||
#endif
|
||||
(*KeywordMap)["precise"] = PRECISE;
|
||||
(*KeywordMap)["invariant"] = INVARIANT;
|
||||
(*KeywordMap)["packed"] = PACKED;
|
||||
(*KeywordMap)["resource"] = RESOURCE;
|
||||
(*KeywordMap)["superp"] = SUPERP;
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
(*KeywordMap)["rayPayloadNV"] = PAYLOADNV;
|
||||
(*KeywordMap)["rayPayloadInNV"] = PAYLOADINNV;
|
||||
(*KeywordMap)["hitAttributeNV"] = HITATTRNV;
|
||||
@ -713,9 +711,10 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["perprimitiveNV"] = PERPRIMITIVENV;
|
||||
(*KeywordMap)["perviewNV"] = PERVIEWNV;
|
||||
(*KeywordMap)["taskNV"] = PERTASKNV;
|
||||
#endif
|
||||
|
||||
(*KeywordMap)["fcoopmatNV"] = FCOOPMATNV;
|
||||
(*KeywordMap)["icoopmatNV"] = ICOOPMATNV;
|
||||
(*KeywordMap)["ucoopmatNV"] = UCOOPMATNV;
|
||||
|
||||
ReservedSet = new std::unordered_set<const char*, str_hash, str_eq>;
|
||||
|
||||
@ -756,14 +755,17 @@ void TScanContext::fillInKeywordMap()
|
||||
ReservedSet->insert("cast");
|
||||
ReservedSet->insert("namespace");
|
||||
ReservedSet->insert("using");
|
||||
#endif
|
||||
}
|
||||
|
||||
void TScanContext::deleteKeywordMap()
|
||||
{
|
||||
delete KeywordMap;
|
||||
KeywordMap = nullptr;
|
||||
#ifndef GLSLANG_WEB
|
||||
delete ReservedSet;
|
||||
ReservedSet = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Called by yylex to get the next token.
|
||||
@ -842,13 +844,15 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
||||
|
||||
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
|
||||
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
|
||||
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
|
||||
#ifndef GLSLANG_WEB
|
||||
case PpAtomConstInt16: parserToken->sType.lex.i = ppToken.ival; return INT16CONSTANT;
|
||||
case PpAtomConstUint16: parserToken->sType.lex.i = ppToken.ival; return UINT16CONSTANT;
|
||||
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;
|
||||
case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT;
|
||||
case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT;
|
||||
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
|
||||
case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT;
|
||||
#endif
|
||||
case PpAtomIdentifier:
|
||||
{
|
||||
int token = tokenizeIdentifier();
|
||||
@ -870,8 +874,10 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
||||
|
||||
int TScanContext::tokenizeIdentifier()
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if (ReservedSet->find(tokenText) != ReservedSet->end())
|
||||
return reservedWord();
|
||||
#endif
|
||||
|
||||
auto it = KeywordMap->find(tokenText);
|
||||
if (it == KeywordMap->end()) {
|
||||
@ -902,16 +908,10 @@ int TScanContext::tokenizeIdentifier()
|
||||
afterStruct = true;
|
||||
return keyword;
|
||||
|
||||
case NONUNIFORM:
|
||||
if (parseContext.extensionTurnedOn(E_GL_EXT_nonuniform_qualifier))
|
||||
return keyword;
|
||||
else
|
||||
return identifierOrType();
|
||||
|
||||
case SWITCH:
|
||||
case DEFAULT:
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < 130))
|
||||
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 130))
|
||||
reservedWord();
|
||||
return keyword;
|
||||
|
||||
@ -943,20 +943,66 @@ int TScanContext::tokenizeIdentifier()
|
||||
parserToken->sType.lex.b = false;
|
||||
return keyword;
|
||||
|
||||
case ATTRIBUTE:
|
||||
case VARYING:
|
||||
if (parseContext.profile == EEsProfile && parseContext.version >= 300)
|
||||
reservedWord();
|
||||
return keyword;
|
||||
|
||||
case BUFFER:
|
||||
afterBuffer = true;
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version < 310) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < 430))
|
||||
case SMOOTH:
|
||||
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 130))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
case FLAT:
|
||||
if (parseContext.isEsProfile() && parseContext.version < 300)
|
||||
reservedWord();
|
||||
else if (!parseContext.isEsProfile() && parseContext.version < 130)
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
case CENTROID:
|
||||
if (parseContext.version < 120)
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
case INVARIANT:
|
||||
if (!parseContext.isEsProfile() && parseContext.version < 120)
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
case PACKED:
|
||||
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 330))
|
||||
return reservedWord();
|
||||
return identifierOrType();
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case RESOURCE:
|
||||
{
|
||||
bool reserved = (parseContext.isEsProfile() && parseContext.version >= 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 420);
|
||||
return identifierOrReserved(reserved);
|
||||
}
|
||||
case SUPERP:
|
||||
{
|
||||
bool reserved = parseContext.isEsProfile() || parseContext.version >= 130;
|
||||
return identifierOrReserved(reserved);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case NOPERSPECTIVE:
|
||||
if (parseContext.isEsProfile() && parseContext.version >= 300 &&
|
||||
parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation))
|
||||
return keyword;
|
||||
return es30ReservedFromGLSL(130);
|
||||
|
||||
case NONUNIFORM:
|
||||
if (parseContext.extensionTurnedOn(E_GL_EXT_nonuniform_qualifier))
|
||||
return keyword;
|
||||
else
|
||||
return identifierOrType();
|
||||
case ATTRIBUTE:
|
||||
case VARYING:
|
||||
if (parseContext.isEsProfile() && parseContext.version >= 300)
|
||||
reservedWord();
|
||||
return keyword;
|
||||
case BUFFER:
|
||||
afterBuffer = true;
|
||||
if ((parseContext.isEsProfile() && parseContext.version < 310) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 430))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
case PAYLOADNV:
|
||||
case PAYLOADINNV:
|
||||
case HITATTRNV:
|
||||
@ -964,14 +1010,12 @@ int TScanContext::tokenizeIdentifier()
|
||||
case CALLDATAINNV:
|
||||
case ACCSTRUCTNV:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version >= 460
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 460
|
||||
&& parseContext.extensionTurnedOn(E_GL_NV_ray_tracing)))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
case ATOMIC_UINT:
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 310) ||
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 310) ||
|
||||
parseContext.extensionTurnedOn(E_GL_ARB_shader_atomic_counters))
|
||||
return keyword;
|
||||
return es30ReservedFromGLSL(420);
|
||||
@ -985,53 +1029,52 @@ int TScanContext::tokenizeIdentifier()
|
||||
case RESTRICT:
|
||||
case READONLY:
|
||||
case WRITEONLY:
|
||||
if (parseContext.profile == EEsProfile && parseContext.version >= 310)
|
||||
if (parseContext.isEsProfile() && parseContext.version >= 310)
|
||||
return keyword;
|
||||
return es30ReservedFromGLSL(parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store) ? 130 : 420);
|
||||
|
||||
case VOLATILE:
|
||||
if (parseContext.profile == EEsProfile && parseContext.version >= 310)
|
||||
if (parseContext.isEsProfile() && parseContext.version >= 310)
|
||||
return keyword;
|
||||
if (! parseContext.symbolTable.atBuiltInLevel() && (parseContext.profile == EEsProfile ||
|
||||
if (! parseContext.symbolTable.atBuiltInLevel() && (parseContext.isEsProfile() ||
|
||||
(parseContext.version < 420 && ! parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))))
|
||||
reservedWord();
|
||||
return keyword;
|
||||
|
||||
case LAYOUT:
|
||||
{
|
||||
const int numLayoutExts = 2;
|
||||
const char* layoutExts[numLayoutExts] = { E_GL_ARB_shading_language_420pack,
|
||||
E_GL_ARB_explicit_attrib_location };
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < 140 &&
|
||||
! parseContext.extensionsTurnedOn(numLayoutExts, layoutExts)))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
}
|
||||
case SHARED:
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < 140))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
|
||||
case PATCH:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.profile == EEsProfile &&
|
||||
(parseContext.isEsProfile() &&
|
||||
(parseContext.version >= 320 ||
|
||||
parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader)))
|
||||
(!parseContext.isEsProfile() && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader)))
|
||||
return keyword;
|
||||
|
||||
return es30ReservedFromGLSL(400);
|
||||
|
||||
case SAMPLE:
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 320) ||
|
||||
parseContext.extensionsTurnedOn(1, &E_GL_OES_shader_multisample_interpolation))
|
||||
return keyword;
|
||||
return es30ReservedFromGLSL(400);
|
||||
|
||||
case SUBROUTINE:
|
||||
return es30ReservedFromGLSL(400);
|
||||
case SHARED:
|
||||
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 140))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
#endif
|
||||
|
||||
case LAYOUT:
|
||||
{
|
||||
const int numLayoutExts = 2;
|
||||
const char* layoutExts[numLayoutExts] = { E_GL_ARB_shading_language_420pack,
|
||||
E_GL_ARB_explicit_attrib_location };
|
||||
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 140 &&
|
||||
! parseContext.extensionsTurnedOn(numLayoutExts, layoutExts)))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
}
|
||||
|
||||
case HIGH_PRECISION:
|
||||
case MEDIUM_PRECISION:
|
||||
@ -1050,6 +1093,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
case MAT4X4:
|
||||
return matNxM();
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case DMAT2:
|
||||
case DMAT3:
|
||||
case DMAT4:
|
||||
@ -1080,7 +1124,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
case IIMAGEBUFFER:
|
||||
case UIMAGEBUFFER:
|
||||
afterType = true;
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 320) ||
|
||||
parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
|
||||
return keyword;
|
||||
return firstGenerationImage(false);
|
||||
@ -1104,7 +1148,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
case IIMAGECUBEARRAY:
|
||||
case UIMAGECUBEARRAY:
|
||||
afterType = true;
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 320) ||
|
||||
parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array))
|
||||
return keyword;
|
||||
return secondGenerationImage();
|
||||
@ -1123,7 +1167,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
case DVEC3:
|
||||
case DVEC4:
|
||||
afterType = true;
|
||||
if (parseContext.profile == EEsProfile || parseContext.version < 400)
|
||||
if (parseContext.isEsProfile() || parseContext.version < 400)
|
||||
reservedWord();
|
||||
return keyword;
|
||||
|
||||
@ -1137,7 +1181,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
case U64VEC4:
|
||||
afterType = true;
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version >= 450 &&
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 450 &&
|
||||
(parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int64))))
|
||||
@ -1157,7 +1201,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
((parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_8bit_storage) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int8)) &&
|
||||
parseContext.profile != EEsProfile && parseContext.version >= 450))
|
||||
!parseContext.isEsProfile() && parseContext.version >= 450))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
@ -1171,11 +1215,8 @@ int TScanContext::tokenizeIdentifier()
|
||||
case U16VEC4:
|
||||
afterType = true;
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version >= 450 &&
|
||||
(
|
||||
#ifdef AMD_EXTENSIONS
|
||||
parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) ||
|
||||
#endif
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 450 &&
|
||||
(parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int16))))
|
||||
@ -1193,7 +1234,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
((parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int32)) &&
|
||||
parseContext.profile != EEsProfile && parseContext.version >= 450))
|
||||
!parseContext.isEsProfile() && parseContext.version >= 450))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
case FLOAT32_T:
|
||||
@ -1216,7 +1257,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
((parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32)) &&
|
||||
parseContext.profile != EEsProfile && parseContext.version >= 450))
|
||||
!parseContext.isEsProfile() && parseContext.version >= 450))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
@ -1240,7 +1281,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
((parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64)) &&
|
||||
parseContext.profile != EEsProfile && parseContext.version >= 450))
|
||||
!parseContext.isEsProfile() && parseContext.version >= 450))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
@ -1250,11 +1291,8 @@ int TScanContext::tokenizeIdentifier()
|
||||
case F16VEC4:
|
||||
afterType = true;
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version >= 450 &&
|
||||
(
|
||||
#ifdef AMD_EXTENSIONS
|
||||
parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) ||
|
||||
#endif
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 450 &&
|
||||
(parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16))))
|
||||
@ -1276,37 +1314,27 @@ int TScanContext::tokenizeIdentifier()
|
||||
case F16MAT4X4:
|
||||
afterType = true;
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version >= 450 &&
|
||||
(
|
||||
#ifdef AMD_EXTENSIONS
|
||||
parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) ||
|
||||
#endif
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 450 &&
|
||||
(parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16))))
|
||||
return keyword;
|
||||
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
case SAMPLERCUBEARRAY:
|
||||
case SAMPLERCUBEARRAYSHADOW:
|
||||
case ISAMPLERCUBEARRAY:
|
||||
case USAMPLERCUBEARRAY:
|
||||
afterType = true;
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 320) ||
|
||||
parseContext.extensionsTurnedOn(Num_AEP_texture_cube_map_array, AEP_texture_cube_map_array))
|
||||
return keyword;
|
||||
if (parseContext.profile == EEsProfile || (parseContext.version < 400 && ! parseContext.extensionTurnedOn(E_GL_ARB_texture_cube_map_array)))
|
||||
if (parseContext.isEsProfile() || (parseContext.version < 400 && ! parseContext.extensionTurnedOn(E_GL_ARB_texture_cube_map_array)))
|
||||
reservedWord();
|
||||
return keyword;
|
||||
|
||||
case ISAMPLER1D:
|
||||
case ISAMPLER1DARRAY:
|
||||
case SAMPLER1DARRAYSHADOW:
|
||||
case USAMPLER1D:
|
||||
case USAMPLER1DARRAY:
|
||||
afterType = true;
|
||||
return es30ReservedFromGLSL(130);
|
||||
|
||||
case UINT:
|
||||
case UVEC2:
|
||||
case UVEC3:
|
||||
@ -1325,6 +1353,30 @@ int TScanContext::tokenizeIdentifier()
|
||||
afterType = true;
|
||||
return nonreservedKeyword(300, 130);
|
||||
|
||||
case SAMPLER3D:
|
||||
afterType = true;
|
||||
if (parseContext.isEsProfile() && parseContext.version < 300) {
|
||||
if (!parseContext.extensionTurnedOn(E_GL_OES_texture_3D))
|
||||
reservedWord();
|
||||
}
|
||||
return keyword;
|
||||
|
||||
case SAMPLER2DSHADOW:
|
||||
afterType = true;
|
||||
if (parseContext.isEsProfile() && parseContext.version < 300) {
|
||||
if (!parseContext.extensionTurnedOn(E_GL_EXT_shadow_samplers))
|
||||
reservedWord();
|
||||
}
|
||||
return keyword;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case ISAMPLER1D:
|
||||
case ISAMPLER1DARRAY:
|
||||
case SAMPLER1DARRAYSHADOW:
|
||||
case USAMPLER1D:
|
||||
case USAMPLER1DARRAY:
|
||||
afterType = true;
|
||||
return es30ReservedFromGLSL(130);
|
||||
case ISAMPLER2DRECT:
|
||||
case USAMPLER2DRECT:
|
||||
afterType = true;
|
||||
@ -1332,7 +1384,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
|
||||
case SAMPLERBUFFER:
|
||||
afterType = true;
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 320) ||
|
||||
parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
|
||||
return keyword;
|
||||
return es30ReservedFromGLSL(130);
|
||||
@ -1340,7 +1392,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
case ISAMPLERBUFFER:
|
||||
case USAMPLERBUFFER:
|
||||
afterType = true;
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 320) ||
|
||||
parseContext.extensionsTurnedOn(Num_AEP_texture_buffer, AEP_texture_buffer))
|
||||
return keyword;
|
||||
return es30ReservedFromGLSL(140);
|
||||
@ -1349,7 +1401,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
case ISAMPLER2DMS:
|
||||
case USAMPLER2DMS:
|
||||
afterType = true;
|
||||
if (parseContext.profile == EEsProfile && parseContext.version >= 310)
|
||||
if (parseContext.isEsProfile() && parseContext.version >= 310)
|
||||
return keyword;
|
||||
return es30ReservedFromGLSL(150);
|
||||
|
||||
@ -1357,7 +1409,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
case ISAMPLER2DMSARRAY:
|
||||
case USAMPLER2DMSARRAY:
|
||||
afterType = true;
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 320) ||
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 320) ||
|
||||
parseContext.extensionsTurnedOn(1, &E_GL_OES_texture_storage_multisample_2d_array))
|
||||
return keyword;
|
||||
return es30ReservedFromGLSL(150);
|
||||
@ -1365,30 +1417,14 @@ int TScanContext::tokenizeIdentifier()
|
||||
case SAMPLER1D:
|
||||
case SAMPLER1DSHADOW:
|
||||
afterType = true;
|
||||
if (parseContext.profile == EEsProfile)
|
||||
if (parseContext.isEsProfile())
|
||||
reservedWord();
|
||||
return keyword;
|
||||
|
||||
case SAMPLER3D:
|
||||
afterType = true;
|
||||
if (parseContext.profile == EEsProfile && parseContext.version < 300) {
|
||||
if (!parseContext.extensionTurnedOn(E_GL_OES_texture_3D))
|
||||
reservedWord();
|
||||
}
|
||||
return keyword;
|
||||
|
||||
case SAMPLER2DSHADOW:
|
||||
afterType = true;
|
||||
if (parseContext.profile == EEsProfile && parseContext.version < 300) {
|
||||
if (!parseContext.extensionTurnedOn(E_GL_EXT_shadow_samplers))
|
||||
reservedWord();
|
||||
}
|
||||
return keyword;
|
||||
|
||||
case SAMPLER2DRECT:
|
||||
case SAMPLER2DRECTSHADOW:
|
||||
afterType = true;
|
||||
if (parseContext.profile == EEsProfile)
|
||||
if (parseContext.isEsProfile())
|
||||
reservedWord();
|
||||
else if (parseContext.version < 140 && ! parseContext.symbolTable.atBuiltInLevel() && ! parseContext.extensionTurnedOn(E_GL_ARB_texture_rectangle)) {
|
||||
if (parseContext.relaxedErrors())
|
||||
@ -1400,10 +1436,10 @@ int TScanContext::tokenizeIdentifier()
|
||||
|
||||
case SAMPLER1DARRAY:
|
||||
afterType = true;
|
||||
if (parseContext.profile == EEsProfile && parseContext.version == 300)
|
||||
if (parseContext.isEsProfile() && parseContext.version == 300)
|
||||
reservedWord();
|
||||
else if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < 130))
|
||||
else if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < 130))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
|
||||
@ -1473,7 +1509,6 @@ int TScanContext::tokenizeIdentifier()
|
||||
else
|
||||
return identifierOrType();
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case F16SAMPLER1D:
|
||||
case F16SAMPLER2D:
|
||||
case F16SAMPLER3D:
|
||||
@ -1522,98 +1557,42 @@ int TScanContext::tokenizeIdentifier()
|
||||
afterType = true;
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float_fetch) &&
|
||||
parseContext.profile != EEsProfile && parseContext.version >= 450))
|
||||
!parseContext.isEsProfile() && parseContext.version >= 450))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
case NOPERSPECTIVE:
|
||||
#ifdef NV_EXTENSIONS
|
||||
if (parseContext.profile == EEsProfile && parseContext.version >= 300 &&
|
||||
parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation))
|
||||
return keyword;
|
||||
#endif
|
||||
return es30ReservedFromGLSL(130);
|
||||
|
||||
case SMOOTH:
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < 130))
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EXPLICITINTERPAMD:
|
||||
if (parseContext.profile != EEsProfile && parseContext.version >= 450 &&
|
||||
if (!parseContext.isEsProfile() && parseContext.version >= 450 &&
|
||||
parseContext.extensionTurnedOn(E_GL_AMD_shader_explicit_vertex_parameter))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case PERVERTEXNV:
|
||||
if (((parseContext.profile != EEsProfile && parseContext.version >= 450) ||
|
||||
(parseContext.profile == EEsProfile && parseContext.version >= 320)) &&
|
||||
if (((!parseContext.isEsProfile() && parseContext.version >= 450) ||
|
||||
(parseContext.isEsProfile() && parseContext.version >= 320)) &&
|
||||
parseContext.extensionTurnedOn(E_GL_NV_fragment_shader_barycentric))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
case FLAT:
|
||||
if (parseContext.profile == EEsProfile && parseContext.version < 300)
|
||||
reservedWord();
|
||||
else if (parseContext.profile != EEsProfile && parseContext.version < 130)
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
|
||||
case CENTROID:
|
||||
if (parseContext.version < 120)
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
|
||||
case PRECISE:
|
||||
if ((parseContext.profile == EEsProfile &&
|
||||
if ((parseContext.isEsProfile() &&
|
||||
(parseContext.version >= 320 || parseContext.extensionsTurnedOn(Num_AEP_gpu_shader5, AEP_gpu_shader5))) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version >= 400))
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 400))
|
||||
return keyword;
|
||||
if (parseContext.profile == EEsProfile && parseContext.version == 310) {
|
||||
if (parseContext.isEsProfile() && parseContext.version == 310) {
|
||||
reservedWord();
|
||||
return keyword;
|
||||
}
|
||||
return identifierOrType();
|
||||
|
||||
case INVARIANT:
|
||||
if (parseContext.profile != EEsProfile && parseContext.version < 120)
|
||||
return identifierOrType();
|
||||
return keyword;
|
||||
|
||||
case PACKED:
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < 330))
|
||||
return reservedWord();
|
||||
return identifierOrType();
|
||||
|
||||
case RESOURCE:
|
||||
{
|
||||
bool reserved = (parseContext.profile == EEsProfile && parseContext.version >= 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version >= 420);
|
||||
return identifierOrReserved(reserved);
|
||||
}
|
||||
case SUPERP:
|
||||
{
|
||||
bool reserved = parseContext.profile == EEsProfile || parseContext.version >= 130;
|
||||
return identifierOrReserved(reserved);
|
||||
}
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case PERPRIMITIVENV:
|
||||
case PERVIEWNV:
|
||||
case PERTASKNV:
|
||||
if ((parseContext.profile != EEsProfile && parseContext.version >= 450) ||
|
||||
(parseContext.profile == EEsProfile && parseContext.version >= 320) ||
|
||||
if ((!parseContext.isEsProfile() && parseContext.version >= 450) ||
|
||||
(parseContext.isEsProfile() && parseContext.version >= 320) ||
|
||||
parseContext.extensionTurnedOn(E_GL_NV_mesh_shader))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
case FCOOPMATNV:
|
||||
afterType = true;
|
||||
@ -1622,11 +1601,20 @@ int TScanContext::tokenizeIdentifier()
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case UCOOPMATNV:
|
||||
case ICOOPMATNV:
|
||||
afterType = true;
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
parseContext.extensionTurnedOn(E_GL_NV_integer_cooperative_matrix))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case DEMOTE:
|
||||
if (parseContext.extensionTurnedOn(E_GL_EXT_demote_to_helper_invocation))
|
||||
return keyword;
|
||||
else
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
default:
|
||||
parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc);
|
||||
@ -1645,7 +1633,7 @@ int TScanContext::identifierOrType()
|
||||
if (const TVariable* variable = parserToken->sType.lex.symbol->getAsVariable()) {
|
||||
if (variable->isUserType() &&
|
||||
// treat redeclaration of forward-declared buffer/uniform reference as an identifier
|
||||
!(variable->getType().getBasicType() == EbtReference && afterBuffer)) {
|
||||
!(variable->getType().isReference() && afterBuffer)) {
|
||||
afterType = true;
|
||||
|
||||
return TYPE_NAME;
|
||||
@ -1675,7 +1663,7 @@ int TScanContext::identifierOrReserved(bool reserved)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (parseContext.forwardCompatible)
|
||||
if (parseContext.isForwardCompatible())
|
||||
parseContext.warn(loc, "using future reserved keyword", tokenText, "");
|
||||
|
||||
return identifierOrType();
|
||||
@ -1688,13 +1676,13 @@ int TScanContext::es30ReservedFromGLSL(int version)
|
||||
if (parseContext.symbolTable.atBuiltInLevel())
|
||||
return keyword;
|
||||
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < version)) {
|
||||
if (parseContext.forwardCompatible)
|
||||
if ((parseContext.isEsProfile() && parseContext.version < 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < version)) {
|
||||
if (parseContext.isForwardCompatible())
|
||||
parseContext.warn(loc, "future reserved word in ES 300 and keyword in GLSL", tokenText, "");
|
||||
|
||||
return identifierOrType();
|
||||
} else if (parseContext.profile == EEsProfile && parseContext.version >= 300)
|
||||
} else if (parseContext.isEsProfile() && parseContext.version >= 300)
|
||||
reservedWord();
|
||||
|
||||
return keyword;
|
||||
@ -1704,9 +1692,9 @@ int TScanContext::es30ReservedFromGLSL(int version)
|
||||
// showed up, both in an es version and a non-ES version.
|
||||
int TScanContext::nonreservedKeyword(int esVersion, int nonEsVersion)
|
||||
{
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version < esVersion) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version < nonEsVersion)) {
|
||||
if (parseContext.forwardCompatible)
|
||||
if ((parseContext.isEsProfile() && parseContext.version < esVersion) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version < nonEsVersion)) {
|
||||
if (parseContext.isForwardCompatible())
|
||||
parseContext.warn(loc, "using future keyword", tokenText, "");
|
||||
|
||||
return identifierOrType();
|
||||
@ -1717,10 +1705,10 @@ int TScanContext::nonreservedKeyword(int esVersion, int nonEsVersion)
|
||||
|
||||
int TScanContext::precisionKeyword()
|
||||
{
|
||||
if (parseContext.profile == EEsProfile || parseContext.version >= 130)
|
||||
if (parseContext.isEsProfile() || parseContext.version >= 130)
|
||||
return keyword;
|
||||
|
||||
if (parseContext.forwardCompatible)
|
||||
if (parseContext.isForwardCompatible())
|
||||
parseContext.warn(loc, "using ES precision qualifier keyword", tokenText, "");
|
||||
|
||||
return identifierOrType();
|
||||
@ -1733,7 +1721,7 @@ int TScanContext::matNxM()
|
||||
if (parseContext.version > 110)
|
||||
return keyword;
|
||||
|
||||
if (parseContext.forwardCompatible)
|
||||
if (parseContext.isForwardCompatible())
|
||||
parseContext.warn(loc, "using future non-square matrix type keyword", tokenText, "");
|
||||
|
||||
return identifierOrType();
|
||||
@ -1743,16 +1731,16 @@ int TScanContext::dMat()
|
||||
{
|
||||
afterType = true;
|
||||
|
||||
if (parseContext.profile == EEsProfile && parseContext.version >= 300) {
|
||||
if (parseContext.isEsProfile() && parseContext.version >= 300) {
|
||||
reservedWord();
|
||||
|
||||
return keyword;
|
||||
}
|
||||
|
||||
if (parseContext.profile != EEsProfile && parseContext.version >= 400)
|
||||
if (!parseContext.isEsProfile() && parseContext.version >= 400)
|
||||
return keyword;
|
||||
|
||||
if (parseContext.forwardCompatible)
|
||||
if (parseContext.isForwardCompatible())
|
||||
parseContext.warn(loc, "using future type keyword", tokenText, "");
|
||||
|
||||
return identifierOrType();
|
||||
@ -1761,19 +1749,19 @@ int TScanContext::dMat()
|
||||
int TScanContext::firstGenerationImage(bool inEs310)
|
||||
{
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.profile != EEsProfile && (parseContext.version >= 420 ||
|
||||
(!parseContext.isEsProfile() && (parseContext.version >= 420 ||
|
||||
parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) ||
|
||||
(inEs310 && parseContext.profile == EEsProfile && parseContext.version >= 310))
|
||||
(inEs310 && parseContext.isEsProfile() && parseContext.version >= 310))
|
||||
return keyword;
|
||||
|
||||
if ((parseContext.profile == EEsProfile && parseContext.version >= 300) ||
|
||||
(parseContext.profile != EEsProfile && parseContext.version >= 130)) {
|
||||
if ((parseContext.isEsProfile() && parseContext.version >= 300) ||
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 130)) {
|
||||
reservedWord();
|
||||
|
||||
return keyword;
|
||||
}
|
||||
|
||||
if (parseContext.forwardCompatible)
|
||||
if (parseContext.isForwardCompatible())
|
||||
parseContext.warn(loc, "using future type keyword", tokenText, "");
|
||||
|
||||
return identifierOrType();
|
||||
@ -1781,17 +1769,17 @@ int TScanContext::firstGenerationImage(bool inEs310)
|
||||
|
||||
int TScanContext::secondGenerationImage()
|
||||
{
|
||||
if (parseContext.profile == EEsProfile && parseContext.version >= 310) {
|
||||
if (parseContext.isEsProfile() && parseContext.version >= 310) {
|
||||
reservedWord();
|
||||
return keyword;
|
||||
}
|
||||
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(parseContext.profile != EEsProfile &&
|
||||
(!parseContext.isEsProfile() &&
|
||||
(parseContext.version >= 420 || parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))))
|
||||
return keyword;
|
||||
|
||||
if (parseContext.forwardCompatible)
|
||||
if (parseContext.isForwardCompatible())
|
||||
parseContext.warn(loc, "using future type keyword", tokenText, "");
|
||||
|
||||
return identifierOrType();
|
||||
|
@ -326,6 +326,7 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangFragment, source,
|
||||
infoSink, commonTable, symbolTables);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// check for tessellation
|
||||
if ((profile != EEsProfile && version >= 150) ||
|
||||
(profile == EEsProfile && version >= 310)) {
|
||||
@ -347,7 +348,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCompute, source,
|
||||
infoSink, commonTable, symbolTables);
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
// check for ray tracing stages
|
||||
if (profile != EEsProfile && version >= 450) {
|
||||
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGenNV, source,
|
||||
@ -377,8 +377,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
||||
infoSink, commonTable, symbolTables);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -479,11 +477,13 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp
|
||||
// Function to Print all builtins
|
||||
void DumpBuiltinSymbolTable(TInfoSink& infoSink, const TSymbolTable& symbolTable)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
infoSink.debug << "BuiltinSymbolTable {\n";
|
||||
|
||||
symbolTable.dump(infoSink, true);
|
||||
|
||||
infoSink.debug << "}\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
// Return true if the shader was correctly specified for version/profile/stage.
|
||||
@ -581,6 +581,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Correct for stage type...
|
||||
switch (stage) {
|
||||
case EShLangGeometry:
|
||||
@ -612,7 +613,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
||||
version = profile == EEsProfile ? 310 : 420;
|
||||
}
|
||||
break;
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EShLangRayGenNV:
|
||||
case EShLangIntersectNV:
|
||||
case EShLangAnyHitNV:
|
||||
@ -633,7 +633,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
||||
infoSink.info.message(EPrefixError, "#version: mesh/task shaders require es profile with version 320 or above, or non-es profile with version 450 or above");
|
||||
version = profile == EEsProfile ? 320 : 450;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -646,15 +645,10 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
||||
// Check for SPIR-V compatibility
|
||||
if (spvVersion.spv != 0) {
|
||||
switch (profile) {
|
||||
case EEsProfile:
|
||||
if (spvVersion.vulkan > 0 && version < 310) {
|
||||
case EEsProfile:
|
||||
if (version < 310) {
|
||||
correct = false;
|
||||
infoSink.info.message(EPrefixError, "#version: ES shaders for Vulkan SPIR-V require version 310 or higher");
|
||||
version = 310;
|
||||
}
|
||||
if (spvVersion.openGl >= 100) {
|
||||
correct = false;
|
||||
infoSink.info.message(EPrefixError, "#version: ES shaders for OpenGL SPIR-V are not supported");
|
||||
infoSink.info.message(EPrefixError, "#version: ES shaders for SPIR-V require version 310 or higher");
|
||||
version = 310;
|
||||
}
|
||||
break;
|
||||
@ -675,6 +669,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return correct;
|
||||
}
|
||||
@ -833,13 +828,17 @@ bool ProcessDeferred(
|
||||
|
||||
// Get all the stages, languages, clients, and other environment
|
||||
// stuff sorted out.
|
||||
EShSource source = (messages & EShMsgReadHlsl) != 0 ? EShSourceHlsl : EShSourceGlsl;
|
||||
EShSource sourceGuess = (messages & EShMsgReadHlsl) != 0 ? EShSourceHlsl : EShSourceGlsl;
|
||||
SpvVersion spvVersion;
|
||||
EShLanguage stage = compiler->getLanguage();
|
||||
TranslateEnvironment(environment, messages, source, stage, spvVersion);
|
||||
TranslateEnvironment(environment, messages, sourceGuess, stage, spvVersion);
|
||||
#ifdef ENABLE_HLSL
|
||||
EShSource source = sourceGuess;
|
||||
if (environment != nullptr && environment->target.hlslFunctionality1)
|
||||
intermediate.setHlslFunctionality1();
|
||||
|
||||
#else
|
||||
const EShSource source = EShSourceGlsl;
|
||||
#endif
|
||||
// First, without using the preprocessor or parser, find the #version, so we know what
|
||||
// symbol tables, processing rules, etc. to set up. This does not need the extra strings
|
||||
// outlined above, just the user shader, after the system and user preambles.
|
||||
@ -852,6 +851,7 @@ bool ProcessDeferred(
|
||||
: userInput.scanVersion(version, profile, versionNotFirstToken);
|
||||
bool versionNotFound = version == 0;
|
||||
if (forceDefaultVersionAndProfile && source == EShSourceGlsl) {
|
||||
#ifndef GLSLANG_WEB
|
||||
if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound &&
|
||||
(version != defaultVersion || profile != defaultProfile)) {
|
||||
compiler->infoSink.info << "Warning, (version, profile) forced to be ("
|
||||
@ -859,7 +859,7 @@ bool ProcessDeferred(
|
||||
<< "), while in source code it is ("
|
||||
<< version << ", " << ProfileName(profile) << ")\n";
|
||||
}
|
||||
|
||||
#endif
|
||||
if (versionNotFound) {
|
||||
versionNotFirstToken = false;
|
||||
versionNotFirst = false;
|
||||
@ -872,6 +872,7 @@ bool ProcessDeferred(
|
||||
bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
|
||||
versionNotFirst, defaultVersion, source, version, profile, spvVersion);
|
||||
bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
|
||||
#ifndef GLSLANG_WEB
|
||||
bool warnVersionNotFirst = false;
|
||||
if (! versionWillBeError && versionNotFirstToken) {
|
||||
if (messages & EShMsgRelaxedErrors)
|
||||
@ -879,6 +880,7 @@ bool ProcessDeferred(
|
||||
else
|
||||
versionWillBeError = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
intermediate.setSource(source);
|
||||
intermediate.setVersion(version);
|
||||
@ -887,8 +889,10 @@ bool ProcessDeferred(
|
||||
RecordProcesses(intermediate, messages, sourceEntryPointName);
|
||||
if (spvVersion.vulkan > 0)
|
||||
intermediate.setOriginUpperLeft();
|
||||
#ifdef ENABLE_HLSL
|
||||
if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl)
|
||||
intermediate.setHlslOffsets();
|
||||
#endif
|
||||
if (messages & EShMsgDebugInfo) {
|
||||
intermediate.setSourceFile(names[numPre]);
|
||||
for (int s = 0; s < numStrings; ++s) {
|
||||
@ -938,11 +942,13 @@ bool ProcessDeferred(
|
||||
parseContext->setLimits(*resources);
|
||||
if (! goodVersion)
|
||||
parseContext->addError();
|
||||
#ifndef GLSLANG_WEB
|
||||
if (warnVersionNotFirst) {
|
||||
TSourceLoc loc;
|
||||
loc.init();
|
||||
parseContext->warn(loc, "Illegal to have non-comment, non-whitespace tokens before #version", "#version", "");
|
||||
}
|
||||
#endif
|
||||
|
||||
parseContext->initializeExtensionBehavior();
|
||||
|
||||
@ -973,6 +979,8 @@ bool ProcessDeferred(
|
||||
return success;
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
// Responsible for keeping track of the most recent source string and line in
|
||||
// the preprocessor and outputting newlines appropriately if the source string
|
||||
// or line changes.
|
||||
@ -1169,6 +1177,8 @@ struct DoPreprocessing {
|
||||
std::string* outputString;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// DoFullParse is a valid ProcessingConext template argument for fully
|
||||
// parsing the shader. It populates the "intermediate" with the AST.
|
||||
struct DoFullParse{
|
||||
@ -1199,6 +1209,7 @@ struct DoFullParse{
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Take a single compilation unit, and run the preprocessor on it.
|
||||
// Return: True if there were no issues found in preprocessing,
|
||||
// False if during preprocessing any unknown version, pragmas or
|
||||
@ -1231,6 +1242,7 @@ bool PreprocessDeferred(
|
||||
forwardCompatible, messages, intermediate, parser,
|
||||
false, includer);
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// do a partial compile on the given strings for a single compilation unit
|
||||
@ -1749,6 +1761,11 @@ void TShader::addProcesses(const std::vector<std::string>& p)
|
||||
intermediate->addProcesses(p);
|
||||
}
|
||||
|
||||
void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); }
|
||||
void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); }
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
// Set binding base for given resource type
|
||||
void TShader::setShiftBinding(TResourceType res, unsigned int base) {
|
||||
intermediate->setShiftBinding(res, base);
|
||||
@ -1776,7 +1793,7 @@ void TShader::setShiftSsboBinding(unsigned int base) { setShiftBinding(EResSs
|
||||
// Enables binding automapping using TIoMapper
|
||||
void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); }
|
||||
// Enables position.Y output negation in vertex shader
|
||||
void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); }
|
||||
|
||||
// Fragile: currently within one stage: simple auto-assignment of location
|
||||
void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); }
|
||||
void TShader::addUniformLocationOverride(const char* name, int loc)
|
||||
@ -1787,13 +1804,16 @@ void TShader::setUniformLocationBase(int base)
|
||||
{
|
||||
intermediate->setUniformLocationBase(base);
|
||||
}
|
||||
void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
|
||||
void TShader::setResourceSetBinding(const std::vector<std::string>& base) { intermediate->setResourceSetBinding(base); }
|
||||
void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); }
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_HLSL
|
||||
// See comment above TDefaultHlslIoMapper in iomapper.cpp:
|
||||
void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); }
|
||||
void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); }
|
||||
void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
|
||||
void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); }
|
||||
void TShader::setResourceSetBinding(const std::vector<std::string>& base) { intermediate->setResourceSetBinding(base); }
|
||||
void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); }
|
||||
#endif
|
||||
|
||||
//
|
||||
// Turn the shader strings into a parse tree in the TIntermediate.
|
||||
@ -1817,6 +1837,7 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion
|
||||
&environment);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// Fill in a string with the result of preprocessing ShaderStrings
|
||||
// Returns true if all extensions, pragmas and version strings were valid.
|
||||
//
|
||||
@ -1841,6 +1862,7 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources,
|
||||
defaultProfile, forceDefaultVersionAndProfile,
|
||||
forwardCompatible, message, includer, *intermediate, output_string);
|
||||
}
|
||||
#endif
|
||||
|
||||
const char* TShader::getInfoLog()
|
||||
{
|
||||
@ -1852,7 +1874,11 @@ const char* TShader::getInfoDebugLog()
|
||||
return infoSink->debug.c_str();
|
||||
}
|
||||
|
||||
TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false)
|
||||
TProgram::TProgram() :
|
||||
#ifndef GLSLANG_WEB
|
||||
reflection(0),
|
||||
#endif
|
||||
linked(false)
|
||||
{
|
||||
pool = new TPoolAllocator;
|
||||
infoSink = new TInfoSink;
|
||||
@ -1864,9 +1890,10 @@ TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false)
|
||||
|
||||
TProgram::~TProgram()
|
||||
{
|
||||
delete ioMapper;
|
||||
delete infoSink;
|
||||
#ifndef GLSLANG_WEB
|
||||
delete reflection;
|
||||
#endif
|
||||
|
||||
for (int s = 0; s < EShLangCount; ++s)
|
||||
if (newedIntermediate[s])
|
||||
@ -1911,6 +1938,7 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
||||
if (stages[stage].size() == 0)
|
||||
return true;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
int numEsShaders = 0, numNonEsShaders = 0;
|
||||
for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) {
|
||||
if ((*it)->intermediate->getProfile() == EEsProfile) {
|
||||
@ -1959,7 +1987,9 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
||||
for (it = stages[stage].begin(); it != stages[stage].end(); ++it)
|
||||
intermediate[stage]->merge(*infoSink, *(*it)->intermediate);
|
||||
}
|
||||
|
||||
#else
|
||||
intermediate[stage] = stages[stage].front()->intermediate;
|
||||
#endif
|
||||
intermediate[stage]->finalCheck(*infoSink, (messages & EShMsgKeepUncalled) != 0);
|
||||
|
||||
if (messages & EShMsgAST)
|
||||
@ -1978,6 +2008,8 @@ const char* TProgram::getInfoDebugLog()
|
||||
return infoSink->debug.c_str();
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
//
|
||||
// Reflection implementation.
|
||||
//
|
||||
@ -2035,21 +2067,26 @@ void TProgram::dumpReflection() { if (reflection != nullptr) reflection->dump();
|
||||
//
|
||||
// I/O mapping implementation.
|
||||
//
|
||||
bool TProgram::mapIO(TIoMapResolver* resolver)
|
||||
bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper)
|
||||
{
|
||||
if (! linked || ioMapper)
|
||||
if (! linked)
|
||||
return false;
|
||||
|
||||
ioMapper = new TIoMapper;
|
||||
|
||||
TIoMapper* ioMapper = nullptr;
|
||||
TIoMapper defaultIOMapper;
|
||||
if (pIoMapper == nullptr)
|
||||
ioMapper = &defaultIOMapper;
|
||||
else
|
||||
ioMapper = pIoMapper;
|
||||
for (int s = 0; s < EShLangCount; ++s) {
|
||||
if (intermediate[s]) {
|
||||
if (! ioMapper->addStage((EShLanguage)s, *intermediate[s], *infoSink, resolver))
|
||||
if (! ioMapper->addStage((EShLanguage)s, *intermediate[s], *infoSink, pResolver))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return ioMapper->doMap(pResolver, *infoSink);
|
||||
}
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
|
||||
} // end namespace glslang
|
||||
|
@ -61,54 +61,56 @@ void TType::buildMangledName(TString& mangledName) const
|
||||
|
||||
switch (basicType) {
|
||||
case EbtFloat: mangledName += 'f'; break;
|
||||
case EbtDouble: mangledName += 'd'; break;
|
||||
case EbtFloat16: mangledName += "f16"; break;
|
||||
case EbtInt: mangledName += 'i'; break;
|
||||
case EbtUint: mangledName += 'u'; break;
|
||||
case EbtBool: mangledName += 'b'; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtDouble: mangledName += 'd'; break;
|
||||
case EbtFloat16: mangledName += "f16"; break;
|
||||
case EbtInt8: mangledName += "i8"; break;
|
||||
case EbtUint8: mangledName += "u8"; break;
|
||||
case EbtInt16: mangledName += "i16"; break;
|
||||
case EbtUint16: mangledName += "u16"; break;
|
||||
case EbtInt64: mangledName += "i64"; break;
|
||||
case EbtUint64: mangledName += "u64"; break;
|
||||
case EbtBool: mangledName += 'b'; break;
|
||||
case EbtAtomicUint: mangledName += "au"; break;
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EbtAccStructNV: mangledName += "asnv"; break;
|
||||
#endif
|
||||
case EbtSampler:
|
||||
switch (sampler.type) {
|
||||
#ifdef AMD_EXTENSIONS
|
||||
#ifndef GLSLANG_WEB
|
||||
case EbtFloat16: mangledName += "f16"; break;
|
||||
#endif
|
||||
case EbtInt: mangledName += "i"; break;
|
||||
case EbtUint: mangledName += "u"; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
if (sampler.image)
|
||||
mangledName += "I"; // a normal image
|
||||
else if (sampler.sampler)
|
||||
if (sampler.isImageClass())
|
||||
mangledName += "I"; // a normal image or subpass
|
||||
else if (sampler.isPureSampler())
|
||||
mangledName += "p"; // a "pure" sampler
|
||||
else if (!sampler.combined)
|
||||
else if (!sampler.isCombined())
|
||||
mangledName += "t"; // a "pure" texture
|
||||
else
|
||||
mangledName += "s"; // traditional combined sampler
|
||||
if (sampler.arrayed)
|
||||
if (sampler.isArrayed())
|
||||
mangledName += "A";
|
||||
if (sampler.shadow)
|
||||
if (sampler.isShadow())
|
||||
mangledName += "S";
|
||||
if (sampler.external)
|
||||
if (sampler.isExternal())
|
||||
mangledName += "E";
|
||||
if (sampler.yuv)
|
||||
if (sampler.isYuv())
|
||||
mangledName += "Y";
|
||||
switch (sampler.dim) {
|
||||
case Esd1D: mangledName += "1"; break;
|
||||
case Esd2D: mangledName += "2"; break;
|
||||
case Esd3D: mangledName += "3"; break;
|
||||
case EsdCube: mangledName += "C"; break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case Esd1D: mangledName += "1"; break;
|
||||
case EsdRect: mangledName += "R2"; break;
|
||||
case EsdBuffer: mangledName += "B"; break;
|
||||
case EsdSubpass: mangledName += "P"; break;
|
||||
#endif
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
|
||||
@ -117,7 +119,7 @@ void TType::buildMangledName(TString& mangledName) const
|
||||
mangledName += "-tx-struct";
|
||||
|
||||
char text[16]; // plenty enough space for the small integers.
|
||||
snprintf(text, sizeof(text), "%d-", sampler.structReturnIndex);
|
||||
snprintf(text, sizeof(text), "%d-", sampler.getStructReturnIndex());
|
||||
mangledName += text;
|
||||
} else {
|
||||
switch (sampler.getVectorSize()) {
|
||||
@ -128,7 +130,7 @@ void TType::buildMangledName(TString& mangledName) const
|
||||
}
|
||||
}
|
||||
|
||||
if (sampler.ms)
|
||||
if (sampler.isMultiSample())
|
||||
mangledName += "M";
|
||||
break;
|
||||
case EbtStruct:
|
||||
@ -172,6 +174,8 @@ void TType::buildMangledName(TString& mangledName) const
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
//
|
||||
// Dump functions.
|
||||
//
|
||||
@ -250,6 +254,8 @@ void TSymbolTable::dump(TInfoSink& infoSink, bool complete) const
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Functions have buried pointers to delete.
|
||||
//
|
||||
|
@ -116,8 +116,11 @@ public:
|
||||
}
|
||||
virtual int getNumExtensions() const { return extensions == nullptr ? 0 : (int)extensions->size(); }
|
||||
virtual const char** getExtensions() const { return extensions->data(); }
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const = 0;
|
||||
void dumpExtensions(TInfoSink& infoSink) const;
|
||||
#endif
|
||||
|
||||
virtual bool isReadOnly() const { return ! writable; }
|
||||
virtual void makeReadOnly() { writable = false; }
|
||||
@ -193,7 +196,9 @@ public:
|
||||
}
|
||||
virtual const char** getMemberExtensions(int member) const { return (*memberExtensions)[member].data(); }
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
explicit TVariable(const TVariable&);
|
||||
@ -314,7 +319,9 @@ public:
|
||||
virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; }
|
||||
virtual const TParameter& operator[](int i) const { return parameters[i]; }
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
explicit TFunction(const TFunction&);
|
||||
@ -374,7 +381,9 @@ public:
|
||||
virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); }
|
||||
|
||||
virtual int getAnonId() const { return anonId; }
|
||||
#ifndef GLSLANG_WEB
|
||||
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
explicit TAnonMember(const TAnonMember&);
|
||||
@ -542,7 +551,9 @@ public:
|
||||
|
||||
void relateToOperator(const char* name, TOperator op);
|
||||
void setFunctionExtensions(const char* name, int num, const char* const extensions[]);
|
||||
#ifndef GLSLANG_WEB
|
||||
void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||
#endif
|
||||
TSymbolTableLevel* clone() const;
|
||||
void readOnly();
|
||||
|
||||
@ -843,7 +854,9 @@ public:
|
||||
}
|
||||
|
||||
int getMaxSymbolId() { return uniqueId; }
|
||||
#ifndef GLSLANG_WEB
|
||||
void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||
#endif
|
||||
void copyTable(const TSymbolTable& copyOf);
|
||||
|
||||
void setPreviousDefaultPrecisions(TPrecisionQualifier *p) { table[currentLevel()]->setPreviousDefaultPrecisions(p); }
|
||||
|
@ -145,6 +145,8 @@
|
||||
|
||||
namespace glslang {
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
//
|
||||
// Initialize all extensions, almost always to 'disable', as once their features
|
||||
// are incorporated into a core version, their features are supported through allowing that
|
||||
@ -221,7 +223,6 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_GOOGLE_cpp_style_line_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;
|
||||
@ -232,9 +233,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable;
|
||||
extensionBehavior[E_GL_AMD_shader_fragment_mask] = EBhDisable;
|
||||
extensionBehavior[E_GL_AMD_gpu_shader_half_float_fetch] = EBhDisable;
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
extensionBehavior[E_GL_NV_sample_mask_override_coverage] = EBhDisable;
|
||||
extensionBehavior[E_SPV_NV_geometry_shader_passthrough] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_viewport_array2] = EBhDisable;
|
||||
@ -250,10 +249,10 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable;
|
||||
#endif
|
||||
|
||||
extensionBehavior[E_GL_NV_cooperative_matrix] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_shader_sm_builtins] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_integer_cooperative_matrix] = EBhDisable;
|
||||
|
||||
// AEP
|
||||
extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable;
|
||||
@ -302,15 +301,19 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float32] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_explicit_arithmetic_types_float64] = EBhDisable;
|
||||
}
|
||||
#endif // GLSLANG_WEB
|
||||
|
||||
// Get code that is not part of a shared symbol table, is specific to this shader,
|
||||
// or needed by the preprocessor (which does not use a shared symbol table).
|
||||
void TParseVersions::getPreamble(std::string& preamble)
|
||||
{
|
||||
if (profile == EEsProfile) {
|
||||
if (isEsProfile()) {
|
||||
preamble =
|
||||
"#define GL_ES 1\n"
|
||||
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"
|
||||
#ifdef GLSLANG_WEB
|
||||
;
|
||||
#else
|
||||
"#define GL_OES_texture_3D 1\n"
|
||||
"#define GL_OES_standard_derivatives 1\n"
|
||||
"#define GL_EXT_frag_depth 1\n"
|
||||
@ -350,11 +353,9 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
|
||||
;
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
if (profile == EEsProfile && version >= 300) {
|
||||
if (isEsProfile() && version >= 300) {
|
||||
preamble += "#define GL_NV_shader_noperspective_interpolation 1\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
preamble =
|
||||
@ -412,7 +413,6 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define E_GL_EXT_shader_atomic_int64 1\n"
|
||||
"#define E_GL_EXT_shader_realtime_clock 1\n"
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
"#define GL_AMD_shader_ballot 1\n"
|
||||
"#define GL_AMD_shader_trinary_minmax 1\n"
|
||||
"#define GL_AMD_shader_explicit_vertex_parameter 1\n"
|
||||
@ -423,9 +423,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_AMD_shader_image_load_store_lod 1\n"
|
||||
"#define GL_AMD_shader_fragment_mask 1\n"
|
||||
"#define GL_AMD_gpu_shader_half_float_fetch 1\n"
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
"#define GL_NV_sample_mask_override_coverage 1\n"
|
||||
"#define GL_NV_geometry_shader_passthrough 1\n"
|
||||
"#define GL_NV_viewport_array2 1\n"
|
||||
@ -438,8 +436,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_NV_compute_shader_derivatives 1\n"
|
||||
"#define GL_NV_shader_texture_footprint 1\n"
|
||||
"#define GL_NV_mesh_shader 1\n"
|
||||
#endif
|
||||
"#define GL_NV_cooperative_matrix 1\n"
|
||||
"#define GL_NV_integer_cooperative_matrix 1\n"
|
||||
|
||||
"#define GL_EXT_shader_explicit_arithmetic_types 1\n"
|
||||
"#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n"
|
||||
@ -458,10 +456,12 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
if (profile == ECompatibilityProfile)
|
||||
preamble += "#define GL_compatibility_profile 1\n";
|
||||
}
|
||||
#endif // GLSLANG_WEB
|
||||
}
|
||||
|
||||
if ((profile != EEsProfile && version >= 140) ||
|
||||
(profile == EEsProfile && version >= 310)) {
|
||||
#ifndef GLSLANG_WEB
|
||||
if ((!isEsProfile() && version >= 140) ||
|
||||
(isEsProfile() && version >= 310)) {
|
||||
preamble +=
|
||||
"#define GL_EXT_device_group 1\n"
|
||||
"#define GL_EXT_multiview 1\n"
|
||||
@ -481,6 +481,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_GOOGLE_cpp_style_line_directive 1\n"
|
||||
"#define GL_GOOGLE_include_directive 1\n"
|
||||
;
|
||||
#endif
|
||||
|
||||
// #define VULKAN XXXX
|
||||
const int numberBufSize = 12;
|
||||
@ -491,6 +492,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
preamble += numberBuf;
|
||||
preamble += "\n";
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
// #define GL_SPIRV XXXX
|
||||
if (spvVersion.openGl > 0) {
|
||||
preamble += "#define GL_SPIRV ";
|
||||
@ -498,22 +501,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
preamble += numberBuf;
|
||||
preamble += "\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// When to use requireProfile():
|
||||
//
|
||||
// Use if only some profiles support a feature. However, if within a profile the feature
|
||||
// is version or extension specific, follow this call with calls to profileRequires().
|
||||
//
|
||||
// Operation: If the current profile is not one of the profileMask,
|
||||
// give an error message.
|
||||
//
|
||||
void TParseVersions::requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc)
|
||||
{
|
||||
if (! (profile & profileMask))
|
||||
error(loc, "not supported with this profile:", featureDesc, ProfileName(profile));
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
@ -523,12 +511,12 @@ const char* StageName(EShLanguage stage)
|
||||
{
|
||||
switch(stage) {
|
||||
case EShLangVertex: return "vertex";
|
||||
case EShLangFragment: return "fragment";
|
||||
#ifndef GLSLANG_WEB
|
||||
case EShLangTessControl: return "tessellation control";
|
||||
case EShLangTessEvaluation: return "tessellation evaluation";
|
||||
case EShLangGeometry: return "geometry";
|
||||
case EShLangFragment: return "fragment";
|
||||
case EShLangCompute: return "compute";
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EShLangRayGenNV: return "ray-generation";
|
||||
case EShLangIntersectNV: return "intersection";
|
||||
case EShLangAnyHitNV: return "any-hit";
|
||||
@ -542,53 +530,6 @@ const char* StageName(EShLanguage stage)
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// When to use profileRequires():
|
||||
//
|
||||
// If a set of profiles have the same requirements for what version or extensions
|
||||
// are needed to support a feature.
|
||||
//
|
||||
// It must be called for each profile that needs protection. Use requireProfile() first
|
||||
// to reduce that set of profiles.
|
||||
//
|
||||
// Operation: Will issue warnings/errors based on the current profile, version, and extension
|
||||
// behaviors. It only checks extensions when the current profile is one of the profileMask.
|
||||
//
|
||||
// A minVersion of 0 means no version of the profileMask support this in core,
|
||||
// the extension must be present.
|
||||
//
|
||||
|
||||
// entry point that takes multiple extensions
|
||||
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions, const char* const extensions[], const char* featureDesc)
|
||||
{
|
||||
if (profile & profileMask) {
|
||||
bool okay = false;
|
||||
if (minVersion > 0 && version >= minVersion)
|
||||
okay = true;
|
||||
for (int i = 0; i < numExtensions; ++i) {
|
||||
switch (getExtensionBehavior(extensions[i])) {
|
||||
case EBhWarn:
|
||||
infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc);
|
||||
// fall through
|
||||
case EBhRequire:
|
||||
case EBhEnable:
|
||||
okay = true;
|
||||
break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
|
||||
if (! okay)
|
||||
error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
|
||||
}
|
||||
}
|
||||
|
||||
// entry point for the above that takes a single extension
|
||||
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension, const char* featureDesc)
|
||||
{
|
||||
profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc);
|
||||
}
|
||||
|
||||
//
|
||||
// When to use requireStage()
|
||||
//
|
||||
@ -609,6 +550,75 @@ void TParseVersions::requireStage(const TSourceLoc& loc, EShLanguage stage, cons
|
||||
requireStage(loc, static_cast<EShLanguageMask>(1 << stage), featureDesc);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
//
|
||||
// When to use requireProfile():
|
||||
//
|
||||
// Use if only some profiles support a feature. However, if within a profile the feature
|
||||
// is version or extension specific, follow this call with calls to profileRequires().
|
||||
//
|
||||
// Operation: If the current profile is not one of the profileMask,
|
||||
// give an error message.
|
||||
//
|
||||
void TParseVersions::requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc)
|
||||
{
|
||||
if (! (profile & profileMask))
|
||||
error(loc, "not supported with this profile:", featureDesc, ProfileName(profile));
|
||||
}
|
||||
|
||||
//
|
||||
// When to use profileRequires():
|
||||
//
|
||||
// If a set of profiles have the same requirements for what version or extensions
|
||||
// are needed to support a feature.
|
||||
//
|
||||
// It must be called for each profile that needs protection. Use requireProfile() first
|
||||
// to reduce that set of profiles.
|
||||
//
|
||||
// Operation: Will issue warnings/errors based on the current profile, version, and extension
|
||||
// behaviors. It only checks extensions when the current profile is one of the profileMask.
|
||||
//
|
||||
// A minVersion of 0 means no version of the profileMask support this in core,
|
||||
// the extension must be present.
|
||||
//
|
||||
|
||||
// entry point that takes multiple extensions
|
||||
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions,
|
||||
const char* const extensions[], const char* featureDesc)
|
||||
{
|
||||
if (profile & profileMask) {
|
||||
bool okay = minVersion > 0 && version >= minVersion;
|
||||
#ifndef GLSLANG_WEB
|
||||
for (int i = 0; i < numExtensions; ++i) {
|
||||
switch (getExtensionBehavior(extensions[i])) {
|
||||
case EBhWarn:
|
||||
infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc);
|
||||
// fall through
|
||||
case EBhRequire:
|
||||
case EBhEnable:
|
||||
okay = true;
|
||||
break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (! okay)
|
||||
error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
|
||||
}
|
||||
}
|
||||
|
||||
// entry point for the above that takes a single extension
|
||||
void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension,
|
||||
const char* featureDesc)
|
||||
{
|
||||
profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc);
|
||||
}
|
||||
|
||||
void TParseVersions::unimplemented(const TSourceLoc& loc, const char* featureDesc)
|
||||
{
|
||||
error(loc, "feature not yet implemented", featureDesc, "");
|
||||
}
|
||||
|
||||
//
|
||||
// Within a set of profiles, see if a feature is deprecated and give an error or warning based on whether
|
||||
// a future compatibility context is being use.
|
||||
@ -642,11 +652,6 @@ void TParseVersions::requireNotRemoved(const TSourceLoc& loc, int profileMask, i
|
||||
}
|
||||
}
|
||||
|
||||
void TParseVersions::unimplemented(const TSourceLoc& loc, const char* featureDesc)
|
||||
{
|
||||
error(loc, "feature not yet implemented", featureDesc, "");
|
||||
}
|
||||
|
||||
// Returns true if at least one of the extensions in the extensions parameter is requested. Otherwise, returns false.
|
||||
// Warns appropriately if the requested behavior of an extension is "warn".
|
||||
bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc)
|
||||
@ -815,12 +820,12 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co
|
||||
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
||||
else if (strcmp(extension, "GL_KHR_shader_subgroup_quad") == 0)
|
||||
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
||||
#ifdef NV_EXTENSIONS
|
||||
else if (strcmp(extension, "GL_NV_shader_subgroup_partitioned") == 0)
|
||||
updateExtensionBehavior(line, "GL_KHR_shader_subgroup_basic", behaviorString);
|
||||
#endif
|
||||
else if (strcmp(extension, "GL_EXT_buffer_reference2") == 0)
|
||||
updateExtensionBehavior(line, "GL_EXT_buffer_reference", behaviorString);
|
||||
else if (strcmp(extension, "GL_NV_integer_cooperative_matrix") == 0)
|
||||
updateExtensionBehavior(line, "GL_NV_cooperative_matrix", behaviorString);
|
||||
}
|
||||
|
||||
void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior)
|
||||
@ -866,7 +871,6 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe
|
||||
// Check if extension is used with correct shader stage.
|
||||
void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * const extension)
|
||||
{
|
||||
#ifdef NV_EXTENSIONS
|
||||
// GL_NV_mesh_shader extension is only allowed in task/mesh shaders
|
||||
if (strcmp(extension, "GL_NV_mesh_shader") == 0) {
|
||||
requireStage(loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask | EShLangFragmentMask),
|
||||
@ -874,7 +878,6 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con
|
||||
profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_NV_mesh_shader");
|
||||
profileRequires(loc, EEsProfile, 320, 0, "#extension GL_NV_mesh_shader");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Call for any operation needing full GLSL integer data-type support.
|
||||
@ -896,9 +899,7 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {
|
||||
#if AMD_EXTENSIONS
|
||||
E_GL_AMD_gpu_shader_half_float,
|
||||
#endif
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
@ -908,9 +909,7 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu
|
||||
bool TParseVersions::float16Arithmetic()
|
||||
{
|
||||
const char* const extensions[] = {
|
||||
#if AMD_EXTENSIONS
|
||||
E_GL_AMD_gpu_shader_half_float,
|
||||
#endif
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
||||
@ -919,9 +918,7 @@ bool TParseVersions::float16Arithmetic()
|
||||
bool TParseVersions::int16Arithmetic()
|
||||
{
|
||||
const char* const extensions[] = {
|
||||
#if AMD_EXTENSIONS
|
||||
E_GL_AMD_gpu_shader_int16,
|
||||
#endif
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
||||
@ -943,9 +940,7 @@ void TParseVersions::requireFloat16Arithmetic(const TSourceLoc& loc, const char*
|
||||
combined += featureDesc;
|
||||
|
||||
const char* const extensions[] = {
|
||||
#if AMD_EXTENSIONS
|
||||
E_GL_AMD_gpu_shader_half_float,
|
||||
#endif
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
||||
@ -959,9 +954,7 @@ void TParseVersions::requireInt16Arithmetic(const TSourceLoc& loc, const char* o
|
||||
combined += featureDesc;
|
||||
|
||||
const char* const extensions[] = {
|
||||
#if AMD_EXTENSIONS
|
||||
E_GL_AMD_gpu_shader_int16,
|
||||
#endif
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
||||
@ -984,9 +977,7 @@ void TParseVersions::float16ScalarVectorCheck(const TSourceLoc& loc, const char*
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {
|
||||
#if AMD_EXTENSIONS
|
||||
E_GL_AMD_gpu_shader_half_float,
|
||||
#endif
|
||||
E_GL_EXT_shader_16bit_storage,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||
@ -1026,7 +1017,6 @@ void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bo
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
// Call for any operation needing GLSL float16 opaque-type support
|
||||
void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
{
|
||||
@ -1036,16 +1026,13 @@ void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, b
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Call for any operation needing GLSL explicit int16 data-type support.
|
||||
void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
{
|
||||
if (! builtIn) {
|
||||
const char* const extensions[] = {
|
||||
#if AMD_EXTENSIONS
|
||||
E_GL_AMD_gpu_shader_int16,
|
||||
#endif
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
@ -1056,9 +1043,7 @@ void TParseVersions::int16ScalarVectorCheck(const TSourceLoc& loc, const char* o
|
||||
{
|
||||
if (! builtIn) {
|
||||
const char* const extensions[] = {
|
||||
#if AMD_EXTENSIONS
|
||||
E_GL_AMD_gpu_shader_int16,
|
||||
#endif
|
||||
E_GL_EXT_shader_16bit_storage,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||
@ -1108,6 +1093,14 @@ void TParseVersions::fcoopmatCheck(const TSourceLoc& loc, const char* op, bool b
|
||||
}
|
||||
}
|
||||
|
||||
void TParseVersions::intcoopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_NV_integer_cooperative_matrix};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
}
|
||||
}
|
||||
#endif // GLSLANG_WEB
|
||||
// Call for any operation removed because SPIR-V is in use.
|
||||
void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
|
||||
{
|
||||
@ -1125,15 +1118,19 @@ void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op)
|
||||
// Call for any operation that requires Vulkan.
|
||||
void TParseVersions::requireVulkan(const TSourceLoc& loc, const char* op)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if (spvVersion.vulkan == 0)
|
||||
error(loc, "only allowed when using GLSL for Vulkan", op, "");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Call for any operation that requires SPIR-V.
|
||||
void TParseVersions::requireSpv(const TSourceLoc& loc, const char* op)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
if (spvVersion.spv == 0)
|
||||
error(loc, "only allowed when generating SPIR-V", op, "");
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
@ -193,7 +193,6 @@ const int Num_OVR_multiview_EXTs = sizeof(OVR_multiview_EXTs) / sizeof(OVR_multi
|
||||
const char* const E_GL_GOOGLE_cpp_style_line_directive = "GL_GOOGLE_cpp_style_line_directive";
|
||||
const char* const E_GL_GOOGLE_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";
|
||||
@ -204,9 +203,6 @@ const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_sh
|
||||
const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod";
|
||||
const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask";
|
||||
const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch";
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
|
||||
const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage";
|
||||
const char* const E_SPV_NV_geometry_shader_passthrough = "GL_NV_geometry_shader_passthrough";
|
||||
@ -228,10 +224,10 @@ const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_sh
|
||||
|
||||
const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 };
|
||||
const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]);
|
||||
#endif
|
||||
|
||||
const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix";
|
||||
const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins";
|
||||
const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix";
|
||||
|
||||
// AEP
|
||||
const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a";
|
||||
|
@ -34,6 +34,8 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
#include "attribute.h"
|
||||
#include "../Include/intermediate.h"
|
||||
#include "ParseHelper.h"
|
||||
@ -339,5 +341,6 @@ void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermN
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
|
@ -78,7 +78,6 @@
|
||||
#define GL_DOUBLE_MAT4x2 0x8F4D
|
||||
#define GL_DOUBLE_MAT4x3 0x8F4E
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
// Those constants are borrowed from extension NV_gpu_shader5
|
||||
#define GL_FLOAT16_NV 0x8FF8
|
||||
#define GL_FLOAT16_VEC2_NV 0x8FF9
|
||||
@ -94,7 +93,6 @@
|
||||
#define GL_FLOAT16_MAT3x4_AMD 0x91CB
|
||||
#define GL_FLOAT16_MAT4x2_AMD 0x91CC
|
||||
#define GL_FLOAT16_MAT4x3_AMD 0x91CD
|
||||
#endif
|
||||
|
||||
#define GL_SAMPLER_1D 0x8B5D
|
||||
#define GL_SAMPLER_2D 0x8B5E
|
||||
@ -117,7 +115,6 @@
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
#define GL_FLOAT16_SAMPLER_1D_AMD 0x91CE
|
||||
#define GL_FLOAT16_SAMPLER_2D_AMD 0x91CF
|
||||
#define GL_FLOAT16_SAMPLER_3D_AMD 0x91D0
|
||||
@ -149,7 +146,6 @@
|
||||
#define GL_FLOAT16_IMAGE_BUFFER_AMD 0x91E8
|
||||
#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD 0x91E9
|
||||
#define GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD 0x91EA
|
||||
#endif
|
||||
|
||||
#define GL_INT_SAMPLER_1D 0x8DC9
|
||||
#define GL_INT_SAMPLER_2D 0x8DCA
|
||||
|
3799
glslang/MachineIndependent/glslang.m4
Normal file
3799
glslang/MachineIndependent/glslang.m4
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -45,412 +45,414 @@ extern int yydebug;
|
||||
# define YYTOKENTYPE
|
||||
enum yytokentype
|
||||
{
|
||||
ATTRIBUTE = 258,
|
||||
VARYING = 259,
|
||||
FLOAT16_T = 260,
|
||||
FLOAT = 261,
|
||||
FLOAT32_T = 262,
|
||||
DOUBLE = 263,
|
||||
FLOAT64_T = 264,
|
||||
CONST = 265,
|
||||
BOOL = 266,
|
||||
INT = 267,
|
||||
UINT = 268,
|
||||
INT64_T = 269,
|
||||
UINT64_T = 270,
|
||||
INT32_T = 271,
|
||||
UINT32_T = 272,
|
||||
INT16_T = 273,
|
||||
UINT16_T = 274,
|
||||
INT8_T = 275,
|
||||
UINT8_T = 276,
|
||||
BREAK = 277,
|
||||
CONTINUE = 278,
|
||||
DO = 279,
|
||||
ELSE = 280,
|
||||
FOR = 281,
|
||||
IF = 282,
|
||||
DISCARD = 283,
|
||||
RETURN = 284,
|
||||
SWITCH = 285,
|
||||
CASE = 286,
|
||||
DEFAULT = 287,
|
||||
SUBROUTINE = 288,
|
||||
DEMOTE = 289,
|
||||
BVEC2 = 290,
|
||||
BVEC3 = 291,
|
||||
BVEC4 = 292,
|
||||
IVEC2 = 293,
|
||||
IVEC3 = 294,
|
||||
IVEC4 = 295,
|
||||
UVEC2 = 296,
|
||||
UVEC3 = 297,
|
||||
UVEC4 = 298,
|
||||
I64VEC2 = 299,
|
||||
I64VEC3 = 300,
|
||||
I64VEC4 = 301,
|
||||
U64VEC2 = 302,
|
||||
U64VEC3 = 303,
|
||||
U64VEC4 = 304,
|
||||
I32VEC2 = 305,
|
||||
I32VEC3 = 306,
|
||||
I32VEC4 = 307,
|
||||
U32VEC2 = 308,
|
||||
U32VEC3 = 309,
|
||||
U32VEC4 = 310,
|
||||
I16VEC2 = 311,
|
||||
I16VEC3 = 312,
|
||||
I16VEC4 = 313,
|
||||
U16VEC2 = 314,
|
||||
U16VEC3 = 315,
|
||||
U16VEC4 = 316,
|
||||
I8VEC2 = 317,
|
||||
I8VEC3 = 318,
|
||||
I8VEC4 = 319,
|
||||
U8VEC2 = 320,
|
||||
U8VEC3 = 321,
|
||||
U8VEC4 = 322,
|
||||
VEC2 = 323,
|
||||
VEC3 = 324,
|
||||
VEC4 = 325,
|
||||
MAT2 = 326,
|
||||
MAT3 = 327,
|
||||
MAT4 = 328,
|
||||
CENTROID = 329,
|
||||
IN = 330,
|
||||
OUT = 331,
|
||||
INOUT = 332,
|
||||
UNIFORM = 333,
|
||||
PATCH = 334,
|
||||
SAMPLE = 335,
|
||||
BUFFER = 336,
|
||||
SHARED = 337,
|
||||
NONUNIFORM = 338,
|
||||
PAYLOADNV = 339,
|
||||
PAYLOADINNV = 340,
|
||||
HITATTRNV = 341,
|
||||
CALLDATANV = 342,
|
||||
CALLDATAINNV = 343,
|
||||
COHERENT = 344,
|
||||
VOLATILE = 345,
|
||||
RESTRICT = 346,
|
||||
READONLY = 347,
|
||||
WRITEONLY = 348,
|
||||
DEVICECOHERENT = 349,
|
||||
QUEUEFAMILYCOHERENT = 350,
|
||||
WORKGROUPCOHERENT = 351,
|
||||
SUBGROUPCOHERENT = 352,
|
||||
NONPRIVATE = 353,
|
||||
DVEC2 = 354,
|
||||
DVEC3 = 355,
|
||||
DVEC4 = 356,
|
||||
DMAT2 = 357,
|
||||
DMAT3 = 358,
|
||||
DMAT4 = 359,
|
||||
F16VEC2 = 360,
|
||||
F16VEC3 = 361,
|
||||
F16VEC4 = 362,
|
||||
F16MAT2 = 363,
|
||||
F16MAT3 = 364,
|
||||
F16MAT4 = 365,
|
||||
F32VEC2 = 366,
|
||||
F32VEC3 = 367,
|
||||
F32VEC4 = 368,
|
||||
F32MAT2 = 369,
|
||||
F32MAT3 = 370,
|
||||
F32MAT4 = 371,
|
||||
F64VEC2 = 372,
|
||||
F64VEC3 = 373,
|
||||
F64VEC4 = 374,
|
||||
F64MAT2 = 375,
|
||||
F64MAT3 = 376,
|
||||
F64MAT4 = 377,
|
||||
NOPERSPECTIVE = 378,
|
||||
FLAT = 379,
|
||||
SMOOTH = 380,
|
||||
LAYOUT = 381,
|
||||
EXPLICITINTERPAMD = 382,
|
||||
PERVERTEXNV = 383,
|
||||
PERPRIMITIVENV = 384,
|
||||
PERVIEWNV = 385,
|
||||
PERTASKNV = 386,
|
||||
MAT2X2 = 387,
|
||||
MAT2X3 = 388,
|
||||
MAT2X4 = 389,
|
||||
MAT3X2 = 390,
|
||||
MAT3X3 = 391,
|
||||
MAT3X4 = 392,
|
||||
MAT4X2 = 393,
|
||||
MAT4X3 = 394,
|
||||
MAT4X4 = 395,
|
||||
DMAT2X2 = 396,
|
||||
DMAT2X3 = 397,
|
||||
DMAT2X4 = 398,
|
||||
DMAT3X2 = 399,
|
||||
DMAT3X3 = 400,
|
||||
DMAT3X4 = 401,
|
||||
DMAT4X2 = 402,
|
||||
DMAT4X3 = 403,
|
||||
DMAT4X4 = 404,
|
||||
F16MAT2X2 = 405,
|
||||
F16MAT2X3 = 406,
|
||||
F16MAT2X4 = 407,
|
||||
F16MAT3X2 = 408,
|
||||
F16MAT3X3 = 409,
|
||||
F16MAT3X4 = 410,
|
||||
F16MAT4X2 = 411,
|
||||
F16MAT4X3 = 412,
|
||||
F16MAT4X4 = 413,
|
||||
F32MAT2X2 = 414,
|
||||
F32MAT2X3 = 415,
|
||||
F32MAT2X4 = 416,
|
||||
F32MAT3X2 = 417,
|
||||
F32MAT3X3 = 418,
|
||||
F32MAT3X4 = 419,
|
||||
F32MAT4X2 = 420,
|
||||
F32MAT4X3 = 421,
|
||||
F32MAT4X4 = 422,
|
||||
F64MAT2X2 = 423,
|
||||
F64MAT2X3 = 424,
|
||||
F64MAT2X4 = 425,
|
||||
F64MAT3X2 = 426,
|
||||
F64MAT3X3 = 427,
|
||||
F64MAT3X4 = 428,
|
||||
F64MAT4X2 = 429,
|
||||
F64MAT4X3 = 430,
|
||||
F64MAT4X4 = 431,
|
||||
ATOMIC_UINT = 432,
|
||||
ACCSTRUCTNV = 433,
|
||||
FCOOPMATNV = 434,
|
||||
SAMPLER1D = 435,
|
||||
SAMPLER2D = 436,
|
||||
SAMPLER3D = 437,
|
||||
SAMPLERCUBE = 438,
|
||||
SAMPLER1DSHADOW = 439,
|
||||
SAMPLER2DSHADOW = 440,
|
||||
SAMPLERCUBESHADOW = 441,
|
||||
SAMPLER1DARRAY = 442,
|
||||
SAMPLER2DARRAY = 443,
|
||||
SAMPLER1DARRAYSHADOW = 444,
|
||||
SAMPLER2DARRAYSHADOW = 445,
|
||||
ISAMPLER1D = 446,
|
||||
ISAMPLER2D = 447,
|
||||
ISAMPLER3D = 448,
|
||||
ISAMPLERCUBE = 449,
|
||||
ISAMPLER1DARRAY = 450,
|
||||
ISAMPLER2DARRAY = 451,
|
||||
USAMPLER1D = 452,
|
||||
USAMPLER2D = 453,
|
||||
USAMPLER3D = 454,
|
||||
USAMPLERCUBE = 455,
|
||||
USAMPLER1DARRAY = 456,
|
||||
USAMPLER2DARRAY = 457,
|
||||
SAMPLER2DRECT = 458,
|
||||
SAMPLER2DRECTSHADOW = 459,
|
||||
ISAMPLER2DRECT = 460,
|
||||
USAMPLER2DRECT = 461,
|
||||
SAMPLERBUFFER = 462,
|
||||
ISAMPLERBUFFER = 463,
|
||||
USAMPLERBUFFER = 464,
|
||||
SAMPLERCUBEARRAY = 465,
|
||||
SAMPLERCUBEARRAYSHADOW = 466,
|
||||
ISAMPLERCUBEARRAY = 467,
|
||||
USAMPLERCUBEARRAY = 468,
|
||||
SAMPLER2DMS = 469,
|
||||
ISAMPLER2DMS = 470,
|
||||
USAMPLER2DMS = 471,
|
||||
SAMPLER2DMSARRAY = 472,
|
||||
ISAMPLER2DMSARRAY = 473,
|
||||
USAMPLER2DMSARRAY = 474,
|
||||
SAMPLEREXTERNALOES = 475,
|
||||
SAMPLEREXTERNAL2DY2YEXT = 476,
|
||||
F16SAMPLER1D = 477,
|
||||
F16SAMPLER2D = 478,
|
||||
F16SAMPLER3D = 479,
|
||||
F16SAMPLER2DRECT = 480,
|
||||
F16SAMPLERCUBE = 481,
|
||||
F16SAMPLER1DARRAY = 482,
|
||||
F16SAMPLER2DARRAY = 483,
|
||||
F16SAMPLERCUBEARRAY = 484,
|
||||
F16SAMPLERBUFFER = 485,
|
||||
F16SAMPLER2DMS = 486,
|
||||
F16SAMPLER2DMSARRAY = 487,
|
||||
F16SAMPLER1DSHADOW = 488,
|
||||
F16SAMPLER2DSHADOW = 489,
|
||||
F16SAMPLER1DARRAYSHADOW = 490,
|
||||
F16SAMPLER2DARRAYSHADOW = 491,
|
||||
F16SAMPLER2DRECTSHADOW = 492,
|
||||
F16SAMPLERCUBESHADOW = 493,
|
||||
F16SAMPLERCUBEARRAYSHADOW = 494,
|
||||
SAMPLER = 495,
|
||||
SAMPLERSHADOW = 496,
|
||||
TEXTURE1D = 497,
|
||||
TEXTURE2D = 498,
|
||||
TEXTURE3D = 499,
|
||||
TEXTURECUBE = 500,
|
||||
TEXTURE1DARRAY = 501,
|
||||
TEXTURE2DARRAY = 502,
|
||||
ITEXTURE1D = 503,
|
||||
ITEXTURE2D = 504,
|
||||
ITEXTURE3D = 505,
|
||||
ITEXTURECUBE = 506,
|
||||
ITEXTURE1DARRAY = 507,
|
||||
ITEXTURE2DARRAY = 508,
|
||||
UTEXTURE1D = 509,
|
||||
UTEXTURE2D = 510,
|
||||
UTEXTURE3D = 511,
|
||||
UTEXTURECUBE = 512,
|
||||
UTEXTURE1DARRAY = 513,
|
||||
UTEXTURE2DARRAY = 514,
|
||||
TEXTURE2DRECT = 515,
|
||||
ITEXTURE2DRECT = 516,
|
||||
UTEXTURE2DRECT = 517,
|
||||
TEXTUREBUFFER = 518,
|
||||
ITEXTUREBUFFER = 519,
|
||||
UTEXTUREBUFFER = 520,
|
||||
TEXTURECUBEARRAY = 521,
|
||||
ITEXTURECUBEARRAY = 522,
|
||||
UTEXTURECUBEARRAY = 523,
|
||||
TEXTURE2DMS = 524,
|
||||
ITEXTURE2DMS = 525,
|
||||
UTEXTURE2DMS = 526,
|
||||
TEXTURE2DMSARRAY = 527,
|
||||
ITEXTURE2DMSARRAY = 528,
|
||||
UTEXTURE2DMSARRAY = 529,
|
||||
F16TEXTURE1D = 530,
|
||||
F16TEXTURE2D = 531,
|
||||
F16TEXTURE3D = 532,
|
||||
F16TEXTURE2DRECT = 533,
|
||||
F16TEXTURECUBE = 534,
|
||||
F16TEXTURE1DARRAY = 535,
|
||||
F16TEXTURE2DARRAY = 536,
|
||||
F16TEXTURECUBEARRAY = 537,
|
||||
F16TEXTUREBUFFER = 538,
|
||||
F16TEXTURE2DMS = 539,
|
||||
F16TEXTURE2DMSARRAY = 540,
|
||||
SUBPASSINPUT = 541,
|
||||
SUBPASSINPUTMS = 542,
|
||||
ISUBPASSINPUT = 543,
|
||||
ISUBPASSINPUTMS = 544,
|
||||
USUBPASSINPUT = 545,
|
||||
USUBPASSINPUTMS = 546,
|
||||
F16SUBPASSINPUT = 547,
|
||||
F16SUBPASSINPUTMS = 548,
|
||||
IMAGE1D = 549,
|
||||
IIMAGE1D = 550,
|
||||
UIMAGE1D = 551,
|
||||
IMAGE2D = 552,
|
||||
IIMAGE2D = 553,
|
||||
UIMAGE2D = 554,
|
||||
IMAGE3D = 555,
|
||||
IIMAGE3D = 556,
|
||||
UIMAGE3D = 557,
|
||||
IMAGE2DRECT = 558,
|
||||
IIMAGE2DRECT = 559,
|
||||
UIMAGE2DRECT = 560,
|
||||
IMAGECUBE = 561,
|
||||
IIMAGECUBE = 562,
|
||||
UIMAGECUBE = 563,
|
||||
IMAGEBUFFER = 564,
|
||||
IIMAGEBUFFER = 565,
|
||||
UIMAGEBUFFER = 566,
|
||||
IMAGE1DARRAY = 567,
|
||||
IIMAGE1DARRAY = 568,
|
||||
UIMAGE1DARRAY = 569,
|
||||
IMAGE2DARRAY = 570,
|
||||
IIMAGE2DARRAY = 571,
|
||||
UIMAGE2DARRAY = 572,
|
||||
IMAGECUBEARRAY = 573,
|
||||
IIMAGECUBEARRAY = 574,
|
||||
UIMAGECUBEARRAY = 575,
|
||||
IMAGE2DMS = 576,
|
||||
IIMAGE2DMS = 577,
|
||||
UIMAGE2DMS = 578,
|
||||
IMAGE2DMSARRAY = 579,
|
||||
IIMAGE2DMSARRAY = 580,
|
||||
UIMAGE2DMSARRAY = 581,
|
||||
F16IMAGE1D = 582,
|
||||
F16IMAGE2D = 583,
|
||||
F16IMAGE3D = 584,
|
||||
F16IMAGE2DRECT = 585,
|
||||
F16IMAGECUBE = 586,
|
||||
F16IMAGE1DARRAY = 587,
|
||||
F16IMAGE2DARRAY = 588,
|
||||
F16IMAGECUBEARRAY = 589,
|
||||
F16IMAGEBUFFER = 590,
|
||||
F16IMAGE2DMS = 591,
|
||||
F16IMAGE2DMSARRAY = 592,
|
||||
STRUCT = 593,
|
||||
VOID = 594,
|
||||
WHILE = 595,
|
||||
IDENTIFIER = 596,
|
||||
TYPE_NAME = 597,
|
||||
FLOATCONSTANT = 598,
|
||||
DOUBLECONSTANT = 599,
|
||||
INT16CONSTANT = 600,
|
||||
UINT16CONSTANT = 601,
|
||||
INT32CONSTANT = 602,
|
||||
UINT32CONSTANT = 603,
|
||||
INTCONSTANT = 604,
|
||||
UINTCONSTANT = 605,
|
||||
INT64CONSTANT = 606,
|
||||
UINT64CONSTANT = 607,
|
||||
BOOLCONSTANT = 608,
|
||||
FLOAT16CONSTANT = 609,
|
||||
LEFT_OP = 610,
|
||||
RIGHT_OP = 611,
|
||||
INC_OP = 612,
|
||||
DEC_OP = 613,
|
||||
LE_OP = 614,
|
||||
GE_OP = 615,
|
||||
EQ_OP = 616,
|
||||
NE_OP = 617,
|
||||
AND_OP = 618,
|
||||
OR_OP = 619,
|
||||
XOR_OP = 620,
|
||||
MUL_ASSIGN = 621,
|
||||
DIV_ASSIGN = 622,
|
||||
ADD_ASSIGN = 623,
|
||||
MOD_ASSIGN = 624,
|
||||
LEFT_ASSIGN = 625,
|
||||
RIGHT_ASSIGN = 626,
|
||||
AND_ASSIGN = 627,
|
||||
XOR_ASSIGN = 628,
|
||||
OR_ASSIGN = 629,
|
||||
SUB_ASSIGN = 630,
|
||||
LEFT_PAREN = 631,
|
||||
RIGHT_PAREN = 632,
|
||||
LEFT_BRACKET = 633,
|
||||
RIGHT_BRACKET = 634,
|
||||
LEFT_BRACE = 635,
|
||||
RIGHT_BRACE = 636,
|
||||
DOT = 637,
|
||||
COMMA = 638,
|
||||
COLON = 639,
|
||||
EQUAL = 640,
|
||||
SEMICOLON = 641,
|
||||
BANG = 642,
|
||||
DASH = 643,
|
||||
TILDE = 644,
|
||||
PLUS = 645,
|
||||
STAR = 646,
|
||||
SLASH = 647,
|
||||
PERCENT = 648,
|
||||
LEFT_ANGLE = 649,
|
||||
RIGHT_ANGLE = 650,
|
||||
VERTICAL_BAR = 651,
|
||||
CARET = 652,
|
||||
AMPERSAND = 653,
|
||||
QUESTION = 654,
|
||||
INVARIANT = 655,
|
||||
PRECISE = 656,
|
||||
HIGH_PRECISION = 657,
|
||||
MEDIUM_PRECISION = 658,
|
||||
LOW_PRECISION = 659,
|
||||
PRECISION = 660,
|
||||
PACKED = 661,
|
||||
RESOURCE = 662,
|
||||
SUPERP = 663
|
||||
CONST = 258,
|
||||
BOOL = 259,
|
||||
INT = 260,
|
||||
UINT = 261,
|
||||
FLOAT = 262,
|
||||
BVEC2 = 263,
|
||||
BVEC3 = 264,
|
||||
BVEC4 = 265,
|
||||
IVEC2 = 266,
|
||||
IVEC3 = 267,
|
||||
IVEC4 = 268,
|
||||
UVEC2 = 269,
|
||||
UVEC3 = 270,
|
||||
UVEC4 = 271,
|
||||
VEC2 = 272,
|
||||
VEC3 = 273,
|
||||
VEC4 = 274,
|
||||
MAT2 = 275,
|
||||
MAT3 = 276,
|
||||
MAT4 = 277,
|
||||
MAT2X2 = 278,
|
||||
MAT2X3 = 279,
|
||||
MAT2X4 = 280,
|
||||
MAT3X2 = 281,
|
||||
MAT3X3 = 282,
|
||||
MAT3X4 = 283,
|
||||
MAT4X2 = 284,
|
||||
MAT4X3 = 285,
|
||||
MAT4X4 = 286,
|
||||
SAMPLER2D = 287,
|
||||
SAMPLER3D = 288,
|
||||
SAMPLERCUBE = 289,
|
||||
SAMPLER2DSHADOW = 290,
|
||||
SAMPLERCUBESHADOW = 291,
|
||||
SAMPLER2DARRAY = 292,
|
||||
SAMPLER2DARRAYSHADOW = 293,
|
||||
ISAMPLER2D = 294,
|
||||
ISAMPLER3D = 295,
|
||||
ISAMPLERCUBE = 296,
|
||||
ISAMPLER2DARRAY = 297,
|
||||
USAMPLER2D = 298,
|
||||
USAMPLER3D = 299,
|
||||
USAMPLERCUBE = 300,
|
||||
USAMPLER2DARRAY = 301,
|
||||
SAMPLERCUBEARRAY = 302,
|
||||
SAMPLERCUBEARRAYSHADOW = 303,
|
||||
ISAMPLERCUBEARRAY = 304,
|
||||
USAMPLERCUBEARRAY = 305,
|
||||
ATTRIBUTE = 306,
|
||||
VARYING = 307,
|
||||
FLOAT16_T = 308,
|
||||
FLOAT32_T = 309,
|
||||
DOUBLE = 310,
|
||||
FLOAT64_T = 311,
|
||||
INT64_T = 312,
|
||||
UINT64_T = 313,
|
||||
INT32_T = 314,
|
||||
UINT32_T = 315,
|
||||
INT16_T = 316,
|
||||
UINT16_T = 317,
|
||||
INT8_T = 318,
|
||||
UINT8_T = 319,
|
||||
I64VEC2 = 320,
|
||||
I64VEC3 = 321,
|
||||
I64VEC4 = 322,
|
||||
U64VEC2 = 323,
|
||||
U64VEC3 = 324,
|
||||
U64VEC4 = 325,
|
||||
I32VEC2 = 326,
|
||||
I32VEC3 = 327,
|
||||
I32VEC4 = 328,
|
||||
U32VEC2 = 329,
|
||||
U32VEC3 = 330,
|
||||
U32VEC4 = 331,
|
||||
I16VEC2 = 332,
|
||||
I16VEC3 = 333,
|
||||
I16VEC4 = 334,
|
||||
U16VEC2 = 335,
|
||||
U16VEC3 = 336,
|
||||
U16VEC4 = 337,
|
||||
I8VEC2 = 338,
|
||||
I8VEC3 = 339,
|
||||
I8VEC4 = 340,
|
||||
U8VEC2 = 341,
|
||||
U8VEC3 = 342,
|
||||
U8VEC4 = 343,
|
||||
DVEC2 = 344,
|
||||
DVEC3 = 345,
|
||||
DVEC4 = 346,
|
||||
DMAT2 = 347,
|
||||
DMAT3 = 348,
|
||||
DMAT4 = 349,
|
||||
F16VEC2 = 350,
|
||||
F16VEC3 = 351,
|
||||
F16VEC4 = 352,
|
||||
F16MAT2 = 353,
|
||||
F16MAT3 = 354,
|
||||
F16MAT4 = 355,
|
||||
F32VEC2 = 356,
|
||||
F32VEC3 = 357,
|
||||
F32VEC4 = 358,
|
||||
F32MAT2 = 359,
|
||||
F32MAT3 = 360,
|
||||
F32MAT4 = 361,
|
||||
F64VEC2 = 362,
|
||||
F64VEC3 = 363,
|
||||
F64VEC4 = 364,
|
||||
F64MAT2 = 365,
|
||||
F64MAT3 = 366,
|
||||
F64MAT4 = 367,
|
||||
DMAT2X2 = 368,
|
||||
DMAT2X3 = 369,
|
||||
DMAT2X4 = 370,
|
||||
DMAT3X2 = 371,
|
||||
DMAT3X3 = 372,
|
||||
DMAT3X4 = 373,
|
||||
DMAT4X2 = 374,
|
||||
DMAT4X3 = 375,
|
||||
DMAT4X4 = 376,
|
||||
F16MAT2X2 = 377,
|
||||
F16MAT2X3 = 378,
|
||||
F16MAT2X4 = 379,
|
||||
F16MAT3X2 = 380,
|
||||
F16MAT3X3 = 381,
|
||||
F16MAT3X4 = 382,
|
||||
F16MAT4X2 = 383,
|
||||
F16MAT4X3 = 384,
|
||||
F16MAT4X4 = 385,
|
||||
F32MAT2X2 = 386,
|
||||
F32MAT2X3 = 387,
|
||||
F32MAT2X4 = 388,
|
||||
F32MAT3X2 = 389,
|
||||
F32MAT3X3 = 390,
|
||||
F32MAT3X4 = 391,
|
||||
F32MAT4X2 = 392,
|
||||
F32MAT4X3 = 393,
|
||||
F32MAT4X4 = 394,
|
||||
F64MAT2X2 = 395,
|
||||
F64MAT2X3 = 396,
|
||||
F64MAT2X4 = 397,
|
||||
F64MAT3X2 = 398,
|
||||
F64MAT3X3 = 399,
|
||||
F64MAT3X4 = 400,
|
||||
F64MAT4X2 = 401,
|
||||
F64MAT4X3 = 402,
|
||||
F64MAT4X4 = 403,
|
||||
ATOMIC_UINT = 404,
|
||||
ACCSTRUCTNV = 405,
|
||||
FCOOPMATNV = 406,
|
||||
ICOOPMATNV = 407,
|
||||
UCOOPMATNV = 408,
|
||||
SAMPLER1D = 409,
|
||||
SAMPLER1DARRAY = 410,
|
||||
SAMPLER1DARRAYSHADOW = 411,
|
||||
ISAMPLER1D = 412,
|
||||
SAMPLER1DSHADOW = 413,
|
||||
SAMPLER2DRECT = 414,
|
||||
SAMPLER2DRECTSHADOW = 415,
|
||||
ISAMPLER2DRECT = 416,
|
||||
USAMPLER2DRECT = 417,
|
||||
SAMPLERBUFFER = 418,
|
||||
ISAMPLERBUFFER = 419,
|
||||
USAMPLERBUFFER = 420,
|
||||
SAMPLER2DMS = 421,
|
||||
ISAMPLER2DMS = 422,
|
||||
USAMPLER2DMS = 423,
|
||||
SAMPLER2DMSARRAY = 424,
|
||||
ISAMPLER2DMSARRAY = 425,
|
||||
USAMPLER2DMSARRAY = 426,
|
||||
SAMPLEREXTERNALOES = 427,
|
||||
SAMPLEREXTERNAL2DY2YEXT = 428,
|
||||
ISAMPLER1DARRAY = 429,
|
||||
USAMPLER1D = 430,
|
||||
USAMPLER1DARRAY = 431,
|
||||
F16SAMPLER1D = 432,
|
||||
F16SAMPLER2D = 433,
|
||||
F16SAMPLER3D = 434,
|
||||
F16SAMPLER2DRECT = 435,
|
||||
F16SAMPLERCUBE = 436,
|
||||
F16SAMPLER1DARRAY = 437,
|
||||
F16SAMPLER2DARRAY = 438,
|
||||
F16SAMPLERCUBEARRAY = 439,
|
||||
F16SAMPLERBUFFER = 440,
|
||||
F16SAMPLER2DMS = 441,
|
||||
F16SAMPLER2DMSARRAY = 442,
|
||||
F16SAMPLER1DSHADOW = 443,
|
||||
F16SAMPLER2DSHADOW = 444,
|
||||
F16SAMPLER1DARRAYSHADOW = 445,
|
||||
F16SAMPLER2DARRAYSHADOW = 446,
|
||||
F16SAMPLER2DRECTSHADOW = 447,
|
||||
F16SAMPLERCUBESHADOW = 448,
|
||||
F16SAMPLERCUBEARRAYSHADOW = 449,
|
||||
IMAGE1D = 450,
|
||||
IIMAGE1D = 451,
|
||||
UIMAGE1D = 452,
|
||||
IMAGE2D = 453,
|
||||
IIMAGE2D = 454,
|
||||
UIMAGE2D = 455,
|
||||
IMAGE3D = 456,
|
||||
IIMAGE3D = 457,
|
||||
UIMAGE3D = 458,
|
||||
IMAGE2DRECT = 459,
|
||||
IIMAGE2DRECT = 460,
|
||||
UIMAGE2DRECT = 461,
|
||||
IMAGECUBE = 462,
|
||||
IIMAGECUBE = 463,
|
||||
UIMAGECUBE = 464,
|
||||
IMAGEBUFFER = 465,
|
||||
IIMAGEBUFFER = 466,
|
||||
UIMAGEBUFFER = 467,
|
||||
IMAGE1DARRAY = 468,
|
||||
IIMAGE1DARRAY = 469,
|
||||
UIMAGE1DARRAY = 470,
|
||||
IMAGE2DARRAY = 471,
|
||||
IIMAGE2DARRAY = 472,
|
||||
UIMAGE2DARRAY = 473,
|
||||
IMAGECUBEARRAY = 474,
|
||||
IIMAGECUBEARRAY = 475,
|
||||
UIMAGECUBEARRAY = 476,
|
||||
IMAGE2DMS = 477,
|
||||
IIMAGE2DMS = 478,
|
||||
UIMAGE2DMS = 479,
|
||||
IMAGE2DMSARRAY = 480,
|
||||
IIMAGE2DMSARRAY = 481,
|
||||
UIMAGE2DMSARRAY = 482,
|
||||
F16IMAGE1D = 483,
|
||||
F16IMAGE2D = 484,
|
||||
F16IMAGE3D = 485,
|
||||
F16IMAGE2DRECT = 486,
|
||||
F16IMAGECUBE = 487,
|
||||
F16IMAGE1DARRAY = 488,
|
||||
F16IMAGE2DARRAY = 489,
|
||||
F16IMAGECUBEARRAY = 490,
|
||||
F16IMAGEBUFFER = 491,
|
||||
F16IMAGE2DMS = 492,
|
||||
F16IMAGE2DMSARRAY = 493,
|
||||
SAMPLER = 494,
|
||||
SAMPLERSHADOW = 495,
|
||||
TEXTURE1D = 496,
|
||||
TEXTURE2D = 497,
|
||||
TEXTURE3D = 498,
|
||||
TEXTURECUBE = 499,
|
||||
TEXTURE1DARRAY = 500,
|
||||
TEXTURE2DARRAY = 501,
|
||||
ITEXTURE1D = 502,
|
||||
ITEXTURE2D = 503,
|
||||
ITEXTURE3D = 504,
|
||||
ITEXTURECUBE = 505,
|
||||
ITEXTURE1DARRAY = 506,
|
||||
ITEXTURE2DARRAY = 507,
|
||||
UTEXTURE1D = 508,
|
||||
UTEXTURE2D = 509,
|
||||
UTEXTURE3D = 510,
|
||||
UTEXTURECUBE = 511,
|
||||
UTEXTURE1DARRAY = 512,
|
||||
UTEXTURE2DARRAY = 513,
|
||||
TEXTURE2DRECT = 514,
|
||||
ITEXTURE2DRECT = 515,
|
||||
UTEXTURE2DRECT = 516,
|
||||
TEXTUREBUFFER = 517,
|
||||
ITEXTUREBUFFER = 518,
|
||||
UTEXTUREBUFFER = 519,
|
||||
TEXTURECUBEARRAY = 520,
|
||||
ITEXTURECUBEARRAY = 521,
|
||||
UTEXTURECUBEARRAY = 522,
|
||||
TEXTURE2DMS = 523,
|
||||
ITEXTURE2DMS = 524,
|
||||
UTEXTURE2DMS = 525,
|
||||
TEXTURE2DMSARRAY = 526,
|
||||
ITEXTURE2DMSARRAY = 527,
|
||||
UTEXTURE2DMSARRAY = 528,
|
||||
F16TEXTURE1D = 529,
|
||||
F16TEXTURE2D = 530,
|
||||
F16TEXTURE3D = 531,
|
||||
F16TEXTURE2DRECT = 532,
|
||||
F16TEXTURECUBE = 533,
|
||||
F16TEXTURE1DARRAY = 534,
|
||||
F16TEXTURE2DARRAY = 535,
|
||||
F16TEXTURECUBEARRAY = 536,
|
||||
F16TEXTUREBUFFER = 537,
|
||||
F16TEXTURE2DMS = 538,
|
||||
F16TEXTURE2DMSARRAY = 539,
|
||||
SUBPASSINPUT = 540,
|
||||
SUBPASSINPUTMS = 541,
|
||||
ISUBPASSINPUT = 542,
|
||||
ISUBPASSINPUTMS = 543,
|
||||
USUBPASSINPUT = 544,
|
||||
USUBPASSINPUTMS = 545,
|
||||
F16SUBPASSINPUT = 546,
|
||||
F16SUBPASSINPUTMS = 547,
|
||||
LEFT_OP = 548,
|
||||
RIGHT_OP = 549,
|
||||
INC_OP = 550,
|
||||
DEC_OP = 551,
|
||||
LE_OP = 552,
|
||||
GE_OP = 553,
|
||||
EQ_OP = 554,
|
||||
NE_OP = 555,
|
||||
AND_OP = 556,
|
||||
OR_OP = 557,
|
||||
XOR_OP = 558,
|
||||
MUL_ASSIGN = 559,
|
||||
DIV_ASSIGN = 560,
|
||||
ADD_ASSIGN = 561,
|
||||
MOD_ASSIGN = 562,
|
||||
LEFT_ASSIGN = 563,
|
||||
RIGHT_ASSIGN = 564,
|
||||
AND_ASSIGN = 565,
|
||||
XOR_ASSIGN = 566,
|
||||
OR_ASSIGN = 567,
|
||||
SUB_ASSIGN = 568,
|
||||
LEFT_PAREN = 569,
|
||||
RIGHT_PAREN = 570,
|
||||
LEFT_BRACKET = 571,
|
||||
RIGHT_BRACKET = 572,
|
||||
LEFT_BRACE = 573,
|
||||
RIGHT_BRACE = 574,
|
||||
DOT = 575,
|
||||
COMMA = 576,
|
||||
COLON = 577,
|
||||
EQUAL = 578,
|
||||
SEMICOLON = 579,
|
||||
BANG = 580,
|
||||
DASH = 581,
|
||||
TILDE = 582,
|
||||
PLUS = 583,
|
||||
STAR = 584,
|
||||
SLASH = 585,
|
||||
PERCENT = 586,
|
||||
LEFT_ANGLE = 587,
|
||||
RIGHT_ANGLE = 588,
|
||||
VERTICAL_BAR = 589,
|
||||
CARET = 590,
|
||||
AMPERSAND = 591,
|
||||
QUESTION = 592,
|
||||
INVARIANT = 593,
|
||||
HIGH_PRECISION = 594,
|
||||
MEDIUM_PRECISION = 595,
|
||||
LOW_PRECISION = 596,
|
||||
PRECISION = 597,
|
||||
PACKED = 598,
|
||||
RESOURCE = 599,
|
||||
SUPERP = 600,
|
||||
FLOATCONSTANT = 601,
|
||||
INTCONSTANT = 602,
|
||||
UINTCONSTANT = 603,
|
||||
BOOLCONSTANT = 604,
|
||||
IDENTIFIER = 605,
|
||||
TYPE_NAME = 606,
|
||||
CENTROID = 607,
|
||||
IN = 608,
|
||||
OUT = 609,
|
||||
INOUT = 610,
|
||||
STRUCT = 611,
|
||||
VOID = 612,
|
||||
WHILE = 613,
|
||||
BREAK = 614,
|
||||
CONTINUE = 615,
|
||||
DO = 616,
|
||||
ELSE = 617,
|
||||
FOR = 618,
|
||||
IF = 619,
|
||||
DISCARD = 620,
|
||||
RETURN = 621,
|
||||
SWITCH = 622,
|
||||
CASE = 623,
|
||||
DEFAULT = 624,
|
||||
UNIFORM = 625,
|
||||
SHARED = 626,
|
||||
FLAT = 627,
|
||||
SMOOTH = 628,
|
||||
LAYOUT = 629,
|
||||
DOUBLECONSTANT = 630,
|
||||
INT16CONSTANT = 631,
|
||||
UINT16CONSTANT = 632,
|
||||
FLOAT16CONSTANT = 633,
|
||||
INT32CONSTANT = 634,
|
||||
UINT32CONSTANT = 635,
|
||||
INT64CONSTANT = 636,
|
||||
UINT64CONSTANT = 637,
|
||||
SUBROUTINE = 638,
|
||||
DEMOTE = 639,
|
||||
PAYLOADNV = 640,
|
||||
PAYLOADINNV = 641,
|
||||
HITATTRNV = 642,
|
||||
CALLDATANV = 643,
|
||||
CALLDATAINNV = 644,
|
||||
PATCH = 645,
|
||||
SAMPLE = 646,
|
||||
BUFFER = 647,
|
||||
NONUNIFORM = 648,
|
||||
COHERENT = 649,
|
||||
VOLATILE = 650,
|
||||
RESTRICT = 651,
|
||||
READONLY = 652,
|
||||
WRITEONLY = 653,
|
||||
DEVICECOHERENT = 654,
|
||||
QUEUEFAMILYCOHERENT = 655,
|
||||
WORKGROUPCOHERENT = 656,
|
||||
SUBGROUPCOHERENT = 657,
|
||||
NONPRIVATE = 658,
|
||||
NOPERSPECTIVE = 659,
|
||||
EXPLICITINTERPAMD = 660,
|
||||
PERVERTEXNV = 661,
|
||||
PERPRIMITIVENV = 662,
|
||||
PERVIEWNV = 663,
|
||||
PERTASKNV = 664,
|
||||
PRECISE = 665
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -459,7 +461,7 @@ extern int yydebug;
|
||||
|
||||
union YYSTYPE
|
||||
{
|
||||
#line 71 "MachineIndependent/glslang.y" /* yacc.c:1909 */
|
||||
#line 96 "MachineIndependent/glslang.y" /* yacc.c:1909 */
|
||||
|
||||
struct {
|
||||
glslang::TSourceLoc loc;
|
||||
@ -495,7 +497,7 @@ union YYSTYPE
|
||||
glslang::TArraySizes* typeParameters;
|
||||
} interm;
|
||||
|
||||
#line 499 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
|
||||
#line 501 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
@ -35,6 +35,8 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
#include "localintermediate.h"
|
||||
#include "../Include/InfoSink.h"
|
||||
|
||||
@ -174,7 +176,7 @@ bool TOutputTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node)
|
||||
case EOpIndexIndirect: out.debug << "indirect index"; break;
|
||||
case EOpIndexDirectStruct:
|
||||
{
|
||||
bool reference = node->getLeft()->getType().getBasicType() == EbtReference;
|
||||
bool reference = node->getLeft()->getType().isReference();
|
||||
const TTypeList *members = reference ? node->getLeft()->getType().getReferentType()->getStruct() : node->getLeft()->getType().getStruct();
|
||||
out.debug << (*members)[node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst()].type->getFieldName();
|
||||
out.debug << ": direct index for structure"; break;
|
||||
@ -615,7 +617,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break;
|
||||
case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break;
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break;
|
||||
case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break;
|
||||
case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break;
|
||||
@ -638,7 +639,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break;
|
||||
case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break;
|
||||
case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break;
|
||||
#endif
|
||||
|
||||
case EOpClip: out.debug << "clip"; break;
|
||||
case EOpIsFinite: out.debug << "isfinite"; break;
|
||||
@ -648,7 +648,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
|
||||
case EOpSparseTexelsResident: out.debug << "sparseTexelsResident"; break;
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EOpMinInvocations: out.debug << "minInvocations"; break;
|
||||
case EOpMaxInvocations: out.debug << "maxInvocations"; break;
|
||||
case EOpAddInvocations: out.debug << "addInvocations"; break;
|
||||
@ -677,7 +676,6 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
|
||||
case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break;
|
||||
case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break;
|
||||
#endif
|
||||
|
||||
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
|
||||
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
||||
@ -863,7 +861,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
|
||||
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;
|
||||
@ -871,9 +868,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
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 EOpAtomicMin: out.debug << "AtomicMin"; break;
|
||||
@ -910,10 +905,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpImageAtomicCompSwap: out.debug << "imageAtomicCompSwap"; break;
|
||||
case EOpImageAtomicLoad: out.debug << "imageAtomicLoad"; break;
|
||||
case EOpImageAtomicStore: out.debug << "imageAtomicStore"; break;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EOpImageLoadLod: out.debug << "imageLoadLod"; break;
|
||||
case EOpImageStoreLod: out.debug << "imageStoreLod"; break;
|
||||
#endif
|
||||
|
||||
case EOpTextureQuerySize: out.debug << "textureSize"; break;
|
||||
case EOpTextureQueryLod: out.debug << "textureQueryLod"; break;
|
||||
@ -940,11 +933,9 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpTextureOffsetClamp: out.debug << "textureOffsetClamp"; break;
|
||||
case EOpTextureGradClamp: out.debug << "textureGradClamp"; break;
|
||||
case EOpTextureGradOffsetClamp: out.debug << "textureGradOffsetClamp"; break;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EOpTextureGatherLod: out.debug << "textureGatherLod"; break;
|
||||
case EOpTextureGatherLodOffset: out.debug << "textureGatherLodOffset"; break;
|
||||
case EOpTextureGatherLodOffsets: out.debug << "textureGatherLodOffsets"; break;
|
||||
#endif
|
||||
|
||||
case EOpSparseTexture: out.debug << "sparseTexture"; break;
|
||||
case EOpSparseTextureOffset: out.debug << "sparseTextureOffset"; break;
|
||||
@ -962,19 +953,15 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpSparseTextureOffsetClamp: out.debug << "sparseTextureOffsetClamp"; break;
|
||||
case EOpSparseTextureGradClamp: out.debug << "sparseTextureGradClamp"; break;
|
||||
case EOpSparseTextureGradOffsetClamp: out.debug << "sparseTextureGradOffsetClam"; break;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EOpSparseTextureGatherLod: out.debug << "sparseTextureGatherLod"; break;
|
||||
case EOpSparseTextureGatherLodOffset: out.debug << "sparseTextureGatherLodOffset"; break;
|
||||
case EOpSparseTextureGatherLodOffsets: out.debug << "sparseTextureGatherLodOffsets"; break;
|
||||
case EOpSparseImageLoadLod: out.debug << "sparseImageLoadLod"; break;
|
||||
#endif
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EOpImageSampleFootprintNV: out.debug << "imageSampleFootprintNV"; break;
|
||||
case EOpImageSampleFootprintClampNV: out.debug << "imageSampleFootprintClampNV"; break;
|
||||
case EOpImageSampleFootprintLodNV: out.debug << "imageSampleFootprintLodNV"; break;
|
||||
case EOpImageSampleFootprintGradNV: out.debug << "imageSampleFootprintGradNV"; break;
|
||||
case EOpImageSampleFootprintGradClampNV: out.debug << "mageSampleFootprintGradClampNV"; break;
|
||||
#endif
|
||||
case EOpAddCarry: out.debug << "addCarry"; break;
|
||||
case EOpSubBorrow: out.debug << "subBorrow"; break;
|
||||
case EOpUMulExtended: out.debug << "uMulExtended"; break;
|
||||
@ -988,9 +975,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
|
||||
case EOpInterpolateAtSample: out.debug << "interpolateAtSample"; break;
|
||||
case EOpInterpolateAtOffset: out.debug << "interpolateAtOffset"; break;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
case EOpInterpolateAtVertex: out.debug << "interpolateAtVertex"; break;
|
||||
#endif
|
||||
|
||||
case EOpSinCos: out.debug << "sincos"; break;
|
||||
case EOpGenMul: out.debug << "mul"; break;
|
||||
@ -1057,7 +1042,6 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpSubgroupQuadSwapVertical: out.debug << "subgroupQuadSwapVertical"; break;
|
||||
case EOpSubgroupQuadSwapDiagonal: out.debug << "subgroupQuadSwapDiagonal"; break;
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EOpSubgroupPartition: out.debug << "subgroupPartitionNV"; break;
|
||||
case EOpSubgroupPartitionedAdd: out.debug << "subgroupPartitionedAddNV"; break;
|
||||
case EOpSubgroupPartitionedMul: out.debug << "subgroupPartitionedMulNV"; break;
|
||||
@ -1080,19 +1064,16 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpSubgroupPartitionedExclusiveAnd: out.debug << "subgroupPartitionedExclusiveAndNV"; break;
|
||||
case EOpSubgroupPartitionedExclusiveOr: out.debug << "subgroupPartitionedExclusiveOrNV"; break;
|
||||
case EOpSubgroupPartitionedExclusiveXor: out.debug << "subgroupPartitionedExclusiveXorNV"; break;
|
||||
#endif
|
||||
|
||||
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
|
||||
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EOpTraceNV: out.debug << "traceNV"; break;
|
||||
case EOpReportIntersectionNV: out.debug << "reportIntersectionNV"; break;
|
||||
case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNV"; break;
|
||||
case EOpTerminateRayNV: out.debug << "terminateRayNV"; break;
|
||||
case EOpExecuteCallableNV: out.debug << "executeCallableNV"; break;
|
||||
case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break;
|
||||
#endif
|
||||
|
||||
case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix"; break;
|
||||
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break;
|
||||
@ -1509,16 +1490,13 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
|
||||
infoSink.debug << "interlock ordering = " << TQualifier::getInterlockOrderingString(interlockOrdering) << "\n";
|
||||
break;
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
case EShLangMeshNV:
|
||||
infoSink.debug << "max_vertices = " << vertices << "\n";
|
||||
infoSink.debug << "max_primitives = " << primitives << "\n";
|
||||
infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n";
|
||||
// Fall through
|
||||
|
||||
case EShLangTaskNV:
|
||||
// Fall through
|
||||
#endif
|
||||
case EShLangCompute:
|
||||
infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n";
|
||||
{
|
||||
@ -1547,3 +1525,5 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // not GLSLANG_WEB
|
File diff suppressed because it is too large
Load Diff
@ -33,11 +33,15 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
#ifndef _IOMAPPER_INCLUDED
|
||||
#define _IOMAPPER_INCLUDED
|
||||
|
||||
#include "../Public/ShaderLang.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include "LiveTraverser.h"
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
//
|
||||
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
|
||||
//
|
||||
@ -47,17 +51,249 @@ class TInfoSink;
|
||||
namespace glslang {
|
||||
|
||||
class TIntermediate;
|
||||
struct TVarEntryInfo {
|
||||
int id;
|
||||
TIntermSymbol* symbol;
|
||||
bool live;
|
||||
int newBinding;
|
||||
int newSet;
|
||||
int newLocation;
|
||||
int newComponent;
|
||||
int newIndex;
|
||||
EShLanguage stage;
|
||||
struct TOrderById {
|
||||
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { return l.id < r.id; }
|
||||
};
|
||||
|
||||
struct TOrderByPriority {
|
||||
// ordering:
|
||||
// 1) has both binding and set
|
||||
// 2) has binding but no set
|
||||
// 3) has no binding but set
|
||||
// 4) has no binding and no set
|
||||
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) {
|
||||
const TQualifier& lq = l.symbol->getQualifier();
|
||||
const TQualifier& rq = r.symbol->getQualifier();
|
||||
|
||||
// simple rules:
|
||||
// has binding gives 2 points
|
||||
// has set gives 1 point
|
||||
// who has the most points is more important.
|
||||
int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0);
|
||||
int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0);
|
||||
|
||||
if (lPoints == rPoints)
|
||||
return l.id < r.id;
|
||||
return lPoints > rPoints;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// Base class for shared TIoMapResolver services, used by several derivations.
|
||||
struct TDefaultIoResolverBase : public glslang::TIoMapResolver {
|
||||
public:
|
||||
TDefaultIoResolverBase(const TIntermediate& intermediate);
|
||||
typedef std::vector<int> TSlotSet;
|
||||
typedef std::unordered_map<int, TSlotSet> TSlotSetMap;
|
||||
|
||||
// grow the reflection stage by stage
|
||||
void notifyBinding(EShLanguage, TVarEntryInfo& /*ent*/) override {}
|
||||
void notifyInOut(EShLanguage, TVarEntryInfo& /*ent*/) override {}
|
||||
void beginNotifications(EShLanguage) override {}
|
||||
void endNotifications(EShLanguage) override {}
|
||||
void beginResolve(EShLanguage) override {}
|
||||
void endResolve(EShLanguage) override {}
|
||||
void beginCollect(EShLanguage) override {}
|
||||
void endCollect(EShLanguage) override {}
|
||||
void reserverResourceSlot(TVarEntryInfo& /*ent*/, TInfoSink& /*infoSink*/) override {}
|
||||
void reserverStorageSlot(TVarEntryInfo& /*ent*/, TInfoSink& /*infoSink*/) override {}
|
||||
int getBaseBinding(TResourceType res, unsigned int set) const;
|
||||
const std::vector<std::string>& getResourceSetBinding() const;
|
||||
virtual TResourceType getResourceType(const glslang::TType& type) = 0;
|
||||
bool doAutoBindingMapping() const;
|
||||
bool doAutoLocationMapping() const;
|
||||
TSlotSet::iterator findSlot(int set, int slot);
|
||||
bool checkEmpty(int set, int slot);
|
||||
bool validateInOut(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; };
|
||||
int reserveSlot(int set, int slot, int size = 1);
|
||||
int getFreeSlot(int set, int base, int size = 1);
|
||||
int resolveSet(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||
int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||
int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override;
|
||||
int resolveInOutComponent(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||
int resolveInOutIndex(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||
void addStage(EShLanguage stage) override {
|
||||
if (stage < EShLangCount)
|
||||
stageMask[stage] = true;
|
||||
};
|
||||
uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage);
|
||||
|
||||
TSlotSetMap slots;
|
||||
|
||||
protected:
|
||||
TDefaultIoResolverBase(TDefaultIoResolverBase&);
|
||||
TDefaultIoResolverBase& operator=(TDefaultIoResolverBase&);
|
||||
const TIntermediate& intermediate;
|
||||
int nextUniformLocation;
|
||||
int nextInputLocation;
|
||||
int nextOutputLocation;
|
||||
bool stageMask[EShLangCount + 1];
|
||||
// Return descriptor set specific base if there is one, and the generic base otherwise.
|
||||
int selectBaseBinding(int base, int descriptorSetBase) const {
|
||||
return descriptorSetBase != -1 ? descriptorSetBase : base;
|
||||
}
|
||||
|
||||
static int getLayoutSet(const glslang::TType& type) {
|
||||
if (type.getQualifier().hasSet())
|
||||
return type.getQualifier().layoutSet;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool isSamplerType(const glslang::TType& type) {
|
||||
return type.getBasicType() == glslang::EbtSampler && type.getSampler().isPureSampler();
|
||||
}
|
||||
|
||||
static bool isTextureType(const glslang::TType& type) {
|
||||
return (type.getBasicType() == glslang::EbtSampler &&
|
||||
(type.getSampler().isTexture() || type.getSampler().isSubpass()));
|
||||
}
|
||||
|
||||
static bool isUboType(const glslang::TType& type) {
|
||||
return type.getQualifier().storage == EvqUniform;
|
||||
}
|
||||
|
||||
static bool isImageType(const glslang::TType& type) {
|
||||
return type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage();
|
||||
}
|
||||
|
||||
static bool isSsboType(const glslang::TType& type) {
|
||||
return type.getQualifier().storage == EvqBuffer;
|
||||
}
|
||||
|
||||
// Return true if this is a SRV (shader resource view) type:
|
||||
static bool isSrvType(const glslang::TType& type) {
|
||||
return isTextureType(type) || type.getQualifier().storage == EvqBuffer;
|
||||
}
|
||||
|
||||
// Return true if this is a UAV (unordered access view) type:
|
||||
static bool isUavType(const glslang::TType& type) {
|
||||
if (type.getQualifier().isReadOnly())
|
||||
return false;
|
||||
return (type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage()) ||
|
||||
(type.getQualifier().storage == EvqBuffer);
|
||||
}
|
||||
};
|
||||
|
||||
// Defaulf I/O resolver for OpenGL
|
||||
struct TDefaultGlslIoResolver : public TDefaultIoResolverBase {
|
||||
public:
|
||||
typedef std::map<TString, int> TVarSlotMap; // <resourceName, location/binding>
|
||||
typedef std::map<int, TVarSlotMap> TSlotMap; // <resourceKey, TVarSlotMap>
|
||||
TDefaultGlslIoResolver(const TIntermediate& intermediate);
|
||||
bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; };
|
||||
TResourceType getResourceType(const glslang::TType& type) override;
|
||||
int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override;
|
||||
int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||
int resolveBinding(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||
void beginResolve(EShLanguage /*stage*/) override;
|
||||
void endResolve(EShLanguage stage) override;
|
||||
void beginCollect(EShLanguage) override;
|
||||
void endCollect(EShLanguage) override;
|
||||
void reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) override;
|
||||
void reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) override;
|
||||
// in/out symbol and uniform symbol are stored in the same resourceSlotMap, the storage key is used to identify each type of symbol.
|
||||
// We use stage and storage qualifier to construct a storage key. it can help us identify the same storage resource used in different stage.
|
||||
// if a resource is a program resource and we don't need know it usage stage, we can use same stage to build storage key.
|
||||
// Note: both stage and type must less then 0xffff.
|
||||
int buildStorageKey(EShLanguage stage, TStorageQualifier type) {
|
||||
assert(static_cast<uint32_t>(stage) <= 0x0000ffff && static_cast<uint32_t>(type) <= 0x0000ffff);
|
||||
return (stage << 16) | type;
|
||||
};
|
||||
|
||||
protected:
|
||||
// Use for mark pre stage, to get more interface symbol information.
|
||||
EShLanguage preStage;
|
||||
// Use for mark current shader stage for resolver
|
||||
EShLanguage currentStage;
|
||||
// Slot map for storage resource(location of uniform and interface symbol) It's a program share slot
|
||||
TSlotMap resourceSlotMap;
|
||||
// Slot map for other resource(image, ubo, ssbo), It's a program share slot.
|
||||
TSlotMap storageSlotMap;
|
||||
};
|
||||
|
||||
typedef std::map<TString, TVarEntryInfo> TVarLiveMap;
|
||||
|
||||
// override function "operator=", if a vector<const _Kty, _Ty> being sort,
|
||||
// when use vc++, the sort function will call :
|
||||
// pair& operator=(const pair<_Other1, _Other2>& _Right)
|
||||
// {
|
||||
// first = _Right.first;
|
||||
// second = _Right.second;
|
||||
// return (*this);
|
||||
// }
|
||||
// that will make a const type handing on left.
|
||||
// override this function can avoid a compiler error.
|
||||
// In the future, if the vc++ compiler can handle such a situation,
|
||||
// this part of the code will be removed.
|
||||
struct TVarLivePair : std::pair<const TString, TVarEntryInfo> {
|
||||
TVarLivePair(std::pair<const TString, TVarEntryInfo>& _Right) : pair(_Right.first, _Right.second) {}
|
||||
TVarLivePair& operator=(const TVarLivePair& _Right) {
|
||||
const_cast<TString&>(first) = _Right.first;
|
||||
second = _Right.second;
|
||||
return (*this);
|
||||
};
|
||||
};
|
||||
typedef std::vector<TVarLivePair> TVarLiveVector;
|
||||
|
||||
// I/O mapper
|
||||
class TIoMapper {
|
||||
public:
|
||||
TIoMapper() {}
|
||||
virtual ~TIoMapper() {}
|
||||
|
||||
// grow the reflection stage by stage
|
||||
bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*);
|
||||
bool virtual addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*);
|
||||
bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; };
|
||||
};
|
||||
|
||||
// I/O mapper for OpenGL
|
||||
class TGlslIoMapper : public TIoMapper {
|
||||
public:
|
||||
TGlslIoMapper() {
|
||||
memset(inVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
||||
memset(outVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
||||
memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
||||
memset(intermediates, 0, sizeof(TIntermediate*) * (EShLangCount + 1));
|
||||
}
|
||||
virtual ~TGlslIoMapper() {
|
||||
for (size_t stage = 0; stage < EShLangCount; stage++) {
|
||||
if (inVarMaps[stage] != nullptr) {
|
||||
delete inVarMaps[stage];
|
||||
inVarMaps[stage] = nullptr;
|
||||
}
|
||||
if (outVarMaps[stage] != nullptr) {
|
||||
delete outVarMaps[stage];
|
||||
outVarMaps[stage] = nullptr;
|
||||
}
|
||||
if (uniformVarMap[stage] != nullptr) {
|
||||
delete uniformVarMap[stage];
|
||||
uniformVarMap[stage] = nullptr;
|
||||
}
|
||||
if (intermediates[stage] != nullptr)
|
||||
intermediates[stage] = nullptr;
|
||||
}
|
||||
}
|
||||
// grow the reflection stage by stage
|
||||
bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*) override;
|
||||
bool doMap(TIoMapResolver*, TInfoSink&) override;
|
||||
TVarLiveMap *inVarMaps[EShLangCount], *outVarMaps[EShLangCount],
|
||||
*uniformVarMap[EShLangCount];
|
||||
TIntermediate* intermediates[EShLangCount];
|
||||
bool hadError = false;
|
||||
};
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // _IOMAPPER_INCLUDED
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
|
@ -187,12 +187,14 @@ bool TIndexTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
|
||||
//
|
||||
void TParseContext::constantIndexExpressionCheck(TIntermNode* index)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
TIndexTraverser it(inductiveLoopIds);
|
||||
|
||||
index->traverse(&it);
|
||||
|
||||
if (it.bad)
|
||||
error(it.badLoc, "Non-constant-index-expression", "limitations", "");
|
||||
#endif
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user