Add static Vulkan loader.

Initial Vulkan support for Windows.
Initial Vulkan support for macOS.
This commit is contained in:
bruvzg
2020-02-11 11:57:11 +01:00
parent 4fe3ee1730
commit eb48be51db
120 changed files with 142158 additions and 357 deletions
@@ -286,7 +286,9 @@ void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_re
screen_rect.size.x /= 2.0;
screen_rect.position.x += screen_rect.size.x;
}
#ifndef _MSC_VER
#warning this needs to be redone
#endif
#if 0
VSG::rasterizer->blit_render_target_to_screen(*render_target, screen_rect, 0);
#endif
@@ -298,7 +300,9 @@ godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target) {
RID *render_target = (RID *)p_render_target;
RID eye_texture = VSG::storage->render_target_get_texture(*render_target);
#ifndef _MSC_VER
#warning need to obtain this ID again
#endif
uint32_t texid = 0; //VS::get_singleton()->texture_get_texid(eye_texture);
return texid;
+42 -44
View File
@@ -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])
+102 -95
View File
@@ -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;