summaryrefslogtreecommitdiff
path: root/modules/glslang
diff options
context:
space:
mode:
Diffstat (limited to 'modules/glslang')
-rw-r--r--modules/glslang/SCsub86
-rw-r--r--modules/glslang/register_types.cpp197
2 files changed, 144 insertions, 139 deletions
diff --git a/modules/glslang/SCsub b/modules/glslang/SCsub
index 484036dc94..7e401ff52c 100644
--- a/modules/glslang/SCsub
+++ b/modules/glslang/SCsub
@@ -9,52 +9,52 @@ env_glslang = env_modules.Clone()
# Not unbundled so far since not widespread as shared library
thirdparty_dir = "#thirdparty/glslang/"
thirdparty_sources = [
-"glslang/MachineIndependent/RemoveTree.cpp",
-"glslang/MachineIndependent/ParseHelper.cpp",
-"glslang/MachineIndependent/iomapper.cpp",
-"glslang/MachineIndependent/propagateNoContraction.cpp",
-"glslang/MachineIndependent/Intermediate.cpp",
-"glslang/MachineIndependent/linkValidate.cpp",
-"glslang/MachineIndependent/attribute.cpp",
-"glslang/MachineIndependent/Scan.cpp",
-"glslang/MachineIndependent/Initialize.cpp",
-"glslang/MachineIndependent/Constant.cpp",
-"glslang/MachineIndependent/reflection.cpp",
-"glslang/MachineIndependent/limits.cpp",
-"glslang/MachineIndependent/preprocessor/PpScanner.cpp",
-"glslang/MachineIndependent/preprocessor/PpTokens.cpp",
-"glslang/MachineIndependent/preprocessor/PpAtom.cpp",
-"glslang/MachineIndependent/preprocessor/PpContext.cpp",
-"glslang/MachineIndependent/preprocessor/Pp.cpp",
-"glslang/MachineIndependent/InfoSink.cpp",
-"glslang/MachineIndependent/intermOut.cpp",
-"glslang/MachineIndependent/SymbolTable.cpp",
-"glslang/MachineIndependent/glslang_tab.cpp",
-"glslang/MachineIndependent/pch.cpp",
-"glslang/MachineIndependent/Versions.cpp",
-"glslang/MachineIndependent/ShaderLang.cpp",
-"glslang/MachineIndependent/parseConst.cpp",
-"glslang/MachineIndependent/PoolAlloc.cpp",
-"glslang/MachineIndependent/ParseContextBase.cpp",
-"glslang/MachineIndependent/IntermTraverse.cpp",
-"glslang/GenericCodeGen/Link.cpp",
-"glslang/GenericCodeGen/CodeGen.cpp",
-"OGLCompilersDLL/InitializeDll.cpp",
-"SPIRV/InReadableOrder.cpp",
-"SPIRV/GlslangToSpv.cpp",
-"SPIRV/SpvBuilder.cpp",
-"SPIRV/SpvTools.cpp",
-"SPIRV/disassemble.cpp",
-"SPIRV/doc.cpp",
-"SPIRV/SPVRemapper.cpp",
-"SPIRV/SpvPostProcess.cpp",
-"SPIRV/Logger.cpp"
+ "glslang/MachineIndependent/RemoveTree.cpp",
+ "glslang/MachineIndependent/ParseHelper.cpp",
+ "glslang/MachineIndependent/iomapper.cpp",
+ "glslang/MachineIndependent/propagateNoContraction.cpp",
+ "glslang/MachineIndependent/Intermediate.cpp",
+ "glslang/MachineIndependent/linkValidate.cpp",
+ "glslang/MachineIndependent/attribute.cpp",
+ "glslang/MachineIndependent/Scan.cpp",
+ "glslang/MachineIndependent/Initialize.cpp",
+ "glslang/MachineIndependent/Constant.cpp",
+ "glslang/MachineIndependent/reflection.cpp",
+ "glslang/MachineIndependent/limits.cpp",
+ "glslang/MachineIndependent/preprocessor/PpScanner.cpp",
+ "glslang/MachineIndependent/preprocessor/PpTokens.cpp",
+ "glslang/MachineIndependent/preprocessor/PpAtom.cpp",
+ "glslang/MachineIndependent/preprocessor/PpContext.cpp",
+ "glslang/MachineIndependent/preprocessor/Pp.cpp",
+ "glslang/MachineIndependent/InfoSink.cpp",
+ "glslang/MachineIndependent/intermOut.cpp",
+ "glslang/MachineIndependent/SymbolTable.cpp",
+ "glslang/MachineIndependent/glslang_tab.cpp",
+ "glslang/MachineIndependent/pch.cpp",
+ "glslang/MachineIndependent/Versions.cpp",
+ "glslang/MachineIndependent/ShaderLang.cpp",
+ "glslang/MachineIndependent/parseConst.cpp",
+ "glslang/MachineIndependent/PoolAlloc.cpp",
+ "glslang/MachineIndependent/ParseContextBase.cpp",
+ "glslang/MachineIndependent/IntermTraverse.cpp",
+ "glslang/GenericCodeGen/Link.cpp",
+ "glslang/GenericCodeGen/CodeGen.cpp",
+ "OGLCompilersDLL/InitializeDll.cpp",
+ "SPIRV/InReadableOrder.cpp",
+ "SPIRV/GlslangToSpv.cpp",
+ "SPIRV/SpvBuilder.cpp",
+ "SPIRV/SpvTools.cpp",
+ "SPIRV/disassemble.cpp",
+ "SPIRV/doc.cpp",
+ "SPIRV/SPVRemapper.cpp",
+ "SPIRV/SpvPostProcess.cpp",
+ "SPIRV/Logger.cpp"
]
if (env["platform"]=="windows"):
- thirdparty_sources.append("glslang/OSDependent/Windows/ossource.cpp")
+ thirdparty_sources.append("glslang/OSDependent/Windows/ossource.cpp")
else:
- thirdparty_sources.append("glslang/OSDependent/Unix/ossource.cpp")
+ thirdparty_sources.append("glslang/OSDependent/Unix/ossource.cpp")
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
@@ -64,5 +64,3 @@ env_glslang.add_source_files(env.modules_sources, thirdparty_sources)
env_glslang.add_source_files(env.modules_sources, "*.cpp")
env.Prepend(CPPPATH=[thirdparty_dir])
-
-
diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp
index ef159e743d..fffddcc94a 100644
--- a/modules/glslang/register_types.cpp
+++ b/modules/glslang/register_types.cpp
@@ -36,104 +36,111 @@
#include "thirdparty/glslang/glslang/Public/ShaderLang.h"
static const TBuiltInResource default_builtin_resource = {
- .maxLights = 32,
- .maxClipPlanes = 6,
- .maxTextureUnits = 32,
- .maxTextureCoords = 32,
- .maxVertexAttribs = 64,
- .maxVertexUniformComponents = 4096,
- .maxVaryingFloats = 64,
- .maxVertexTextureImageUnits = 32,
- .maxCombinedTextureImageUnits = 80,
- .maxTextureImageUnits = 32,
- .maxFragmentUniformComponents = 4096,
- .maxDrawBuffers = 32,
- .maxVertexUniformVectors = 128,
- .maxVaryingVectors = 8,
- .maxFragmentUniformVectors = 16,
- .maxVertexOutputVectors = 16,
- .maxFragmentInputVectors = 15,
- .minProgramTexelOffset = -8,
- .maxProgramTexelOffset = 7,
- .maxClipDistances = 8,
- .maxComputeWorkGroupCountX = 65535,
- .maxComputeWorkGroupCountY = 65535,
- .maxComputeWorkGroupCountZ = 65535,
- .maxComputeWorkGroupSizeX = 1024,
- .maxComputeWorkGroupSizeY = 1024,
- .maxComputeWorkGroupSizeZ = 64,
- .maxComputeUniformComponents = 1024,
- .maxComputeTextureImageUnits = 16,
- .maxComputeImageUniforms = 8,
- .maxComputeAtomicCounters = 8,
- .maxComputeAtomicCounterBuffers = 1,
- .maxVaryingComponents = 60,
- .maxVertexOutputComponents = 64,
- .maxGeometryInputComponents = 64,
- .maxGeometryOutputComponents = 128,
- .maxFragmentInputComponents = 128,
- .maxImageUnits = 8,
- .maxCombinedImageUnitsAndFragmentOutputs = 8,
- .maxCombinedShaderOutputResources = 8,
- .maxImageSamples = 0,
- .maxVertexImageUniforms = 0,
- .maxTessControlImageUniforms = 0,
- .maxTessEvaluationImageUniforms = 0,
- .maxGeometryImageUniforms = 0,
- .maxFragmentImageUniforms = 8,
- .maxCombinedImageUniforms = 8,
- .maxGeometryTextureImageUnits = 16,
- .maxGeometryOutputVertices = 256,
- .maxGeometryTotalOutputComponents = 1024,
- .maxGeometryUniformComponents = 1024,
- .maxGeometryVaryingComponents = 64,
- .maxTessControlInputComponents = 128,
- .maxTessControlOutputComponents = 128,
- .maxTessControlTextureImageUnits = 16,
- .maxTessControlUniformComponents = 1024,
- .maxTessControlTotalOutputComponents = 4096,
- .maxTessEvaluationInputComponents = 128,
- .maxTessEvaluationOutputComponents = 128,
- .maxTessEvaluationTextureImageUnits = 16,
- .maxTessEvaluationUniformComponents = 1024,
- .maxTessPatchComponents = 120,
- .maxPatchVertices = 32,
- .maxTessGenLevel = 64,
- .maxViewports = 16,
- .maxVertexAtomicCounters = 0,
- .maxTessControlAtomicCounters = 0,
- .maxTessEvaluationAtomicCounters = 0,
- .maxGeometryAtomicCounters = 0,
- .maxFragmentAtomicCounters = 8,
- .maxCombinedAtomicCounters = 8,
- .maxAtomicCounterBindings = 1,
- .maxVertexAtomicCounterBuffers = 0,
- .maxTessControlAtomicCounterBuffers = 0,
- .maxTessEvaluationAtomicCounterBuffers = 0,
- .maxGeometryAtomicCounterBuffers = 0,
- .maxFragmentAtomicCounterBuffers = 1,
- .maxCombinedAtomicCounterBuffers = 1,
- .maxAtomicCounterBufferSize = 16384,
- .maxTransformFeedbackBuffers = 4,
- .maxTransformFeedbackInterleavedComponents = 64,
- .maxCullDistances = 8,
- .maxCombinedClipAndCullDistances = 8,
- .maxSamples = 4,
- .limits = {
- .nonInductiveForLoops = 1,
- .whileLoops = 1,
- .doWhileLoops = 1,
- .generalUniformIndexing = 1,
- .generalAttributeMatrixVectorIndexing = 1,
- .generalVaryingIndexing = 1,
- .generalSamplerIndexing = 1,
- .generalVariableIndexing = 1,
- .generalConstantMatrixVectorIndexing = 1,
+ /*maxLights*/ 32,
+ /*maxClipPlanes*/ 6,
+ /*maxTextureUnits*/ 32,
+ /*maxTextureCoords*/ 32,
+ /*maxVertexAttribs*/ 64,
+ /*maxVertexUniformComponents*/ 4096,
+ /*maxVaryingFloats*/ 64,
+ /*maxVertexTextureImageUnits*/ 32,
+ /*maxCombinedTextureImageUnits*/ 80,
+ /*maxTextureImageUnits*/ 32,
+ /*maxFragmentUniformComponents*/ 4096,
+ /*maxDrawBuffers*/ 32,
+ /*maxVertexUniformVectors*/ 128,
+ /*maxVaryingVectors*/ 8,
+ /*maxFragmentUniformVectors*/ 16,
+ /*maxVertexOutputVectors*/ 16,
+ /*maxFragmentInputVectors*/ 15,
+ /*minProgramTexelOffset*/ -8,
+ /*maxProgramTexelOffset*/ 7,
+ /*maxClipDistances*/ 8,
+ /*maxComputeWorkGroupCountX*/ 65535,
+ /*maxComputeWorkGroupCountY*/ 65535,
+ /*maxComputeWorkGroupCountZ*/ 65535,
+ /*maxComputeWorkGroupSizeX*/ 1024,
+ /*maxComputeWorkGroupSizeY*/ 1024,
+ /*maxComputeWorkGroupSizeZ*/ 64,
+ /*maxComputeUniformComponents*/ 1024,
+ /*maxComputeTextureImageUnits*/ 16,
+ /*maxComputeImageUniforms*/ 8,
+ /*maxComputeAtomicCounters*/ 8,
+ /*maxComputeAtomicCounterBuffers*/ 1,
+ /*maxVaryingComponents*/ 60,
+ /*maxVertexOutputComponents*/ 64,
+ /*maxGeometryInputComponents*/ 64,
+ /*maxGeometryOutputComponents*/ 128,
+ /*maxFragmentInputComponents*/ 128,
+ /*maxImageUnits*/ 8,
+ /*maxCombinedImageUnitsAndFragmentOutputs*/ 8,
+ /*maxCombinedShaderOutputResources*/ 8,
+ /*maxImageSamples*/ 0,
+ /*maxVertexImageUniforms*/ 0,
+ /*maxTessControlImageUniforms*/ 0,
+ /*maxTessEvaluationImageUniforms*/ 0,
+ /*maxGeometryImageUniforms*/ 0,
+ /*maxFragmentImageUniforms*/ 8,
+ /*maxCombinedImageUniforms*/ 8,
+ /*maxGeometryTextureImageUnits*/ 16,
+ /*maxGeometryOutputVertices*/ 256,
+ /*maxGeometryTotalOutputComponents*/ 1024,
+ /*maxGeometryUniformComponents*/ 1024,
+ /*maxGeometryVaryingComponents*/ 64,
+ /*maxTessControlInputComponents*/ 128,
+ /*maxTessControlOutputComponents*/ 128,
+ /*maxTessControlTextureImageUnits*/ 16,
+ /*maxTessControlUniformComponents*/ 1024,
+ /*maxTessControlTotalOutputComponents*/ 4096,
+ /*maxTessEvaluationInputComponents*/ 128,
+ /*maxTessEvaluationOutputComponents*/ 128,
+ /*maxTessEvaluationTextureImageUnits*/ 16,
+ /*maxTessEvaluationUniformComponents*/ 1024,
+ /*maxTessPatchComponents*/ 120,
+ /*maxPatchVertices*/ 32,
+ /*maxTessGenLevel*/ 64,
+ /*maxViewports*/ 16,
+ /*maxVertexAtomicCounters*/ 0,
+ /*maxTessControlAtomicCounters*/ 0,
+ /*maxTessEvaluationAtomicCounters*/ 0,
+ /*maxGeometryAtomicCounters*/ 0,
+ /*maxFragmentAtomicCounters*/ 8,
+ /*maxCombinedAtomicCounters*/ 8,
+ /*maxAtomicCounterBindings*/ 1,
+ /*maxVertexAtomicCounterBuffers*/ 0,
+ /*maxTessControlAtomicCounterBuffers*/ 0,
+ /*maxTessEvaluationAtomicCounterBuffers*/ 0,
+ /*maxGeometryAtomicCounterBuffers*/ 0,
+ /*maxFragmentAtomicCounterBuffers*/ 1,
+ /*maxCombinedAtomicCounterBuffers*/ 1,
+ /*maxAtomicCounterBufferSize*/ 16384,
+ /*maxTransformFeedbackBuffers*/ 4,
+ /*maxTransformFeedbackInterleavedComponents*/ 64,
+ /*maxCullDistances*/ 8,
+ /*maxCombinedClipAndCullDistances*/ 8,
+ /*maxSamples*/ 4,
+ /*maxMeshOutputVerticesNV*/ 0,
+ /*maxMeshOutputPrimitivesNV*/ 0,
+ /*maxMeshWorkGroupSizeX_NV*/ 0,
+ /*maxMeshWorkGroupSizeY_NV*/ 0,
+ /*maxMeshWorkGroupSizeZ_NV*/ 0,
+ /*maxTaskWorkGroupSizeX_NV*/ 0,
+ /*maxTaskWorkGroupSizeY_NV*/ 0,
+ /*maxTaskWorkGroupSizeZ_NV*/ 0,
+ /*maxMeshViewCountNV*/ 0,
+ /*limits*/ {
+ /*nonInductiveForLoops*/ 1,
+ /*whileLoops*/ 1,
+ /*doWhileLoops*/ 1,
+ /*generalUniformIndexing*/ 1,
+ /*generalAttributeMatrixVectorIndexing*/ 1,
+ /*generalVaryingIndexing*/ 1,
+ /*generalSamplerIndexing*/ 1,
+ /*generalVariableIndexing*/ 1,
+ /*generalConstantMatrixVectorIndexing*/ 1,
}
};
-
-
static PoolVector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage, const String &p_source_code, RenderingDevice::ShaderLanguage p_language, String *r_error) {
PoolVector<uint8_t> ret;