mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
glslang: Disable warnings and allow unbundling
This commit is contained in:
parent
7458a601ce
commit
65ad12e79a
4 changed files with 65 additions and 60 deletions
|
@ -140,6 +140,7 @@ opts.Add(BoolVariable('builtin_bullet', "Use the built-in Bullet library", True)
|
||||||
opts.Add(BoolVariable('builtin_certs', "Bundle default SSL certificates to be used if you don't specify an override in the project settings", True))
|
opts.Add(BoolVariable('builtin_certs', "Bundle default SSL certificates to be used if you don't specify an override in the project settings", True))
|
||||||
opts.Add(BoolVariable('builtin_enet', "Use the built-in ENet library", True))
|
opts.Add(BoolVariable('builtin_enet', "Use the built-in ENet library", True))
|
||||||
opts.Add(BoolVariable('builtin_freetype', "Use the built-in FreeType library", True))
|
opts.Add(BoolVariable('builtin_freetype', "Use the built-in FreeType library", True))
|
||||||
|
opts.Add(BoolVariable('builtin_glslang', "Use the built-in glslang library", True))
|
||||||
opts.Add(BoolVariable('builtin_libogg', "Use the built-in libogg library", True))
|
opts.Add(BoolVariable('builtin_libogg', "Use the built-in libogg library", True))
|
||||||
opts.Add(BoolVariable('builtin_libpng', "Use the built-in libpng library", True))
|
opts.Add(BoolVariable('builtin_libpng', "Use the built-in libpng library", True))
|
||||||
opts.Add(BoolVariable('builtin_libtheora', "Use the built-in libtheora library", True))
|
opts.Add(BoolVariable('builtin_libtheora', "Use the built-in libtheora library", True))
|
||||||
|
|
|
@ -6,7 +6,7 @@ Import('env_modules')
|
||||||
env_glslang = env_modules.Clone()
|
env_glslang = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
# Not unbundled so far since not widespread as shared library
|
if env['builtin_glslang']:
|
||||||
thirdparty_dir = "#thirdparty/glslang/"
|
thirdparty_dir = "#thirdparty/glslang/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
"glslang/MachineIndependent/RemoveTree.cpp",
|
"glslang/MachineIndependent/RemoveTree.cpp",
|
||||||
|
@ -58,9 +58,11 @@ else:
|
||||||
|
|
||||||
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
||||||
|
|
||||||
|
env_glslang.Prepend(CPPPATH=[thirdparty_dir])
|
||||||
|
|
||||||
|
env_thirdparty = env_glslang.Clone()
|
||||||
|
env_thirdparty.disable_warnings()
|
||||||
|
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
|
||||||
|
|
||||||
env_glslang.add_source_files(env.modules_sources, thirdparty_sources)
|
|
||||||
# Godot's own source files
|
# Godot's own source files
|
||||||
env_glslang.add_source_files(env.modules_sources, "*.cpp")
|
env_glslang.add_source_files(env.modules_sources, "*.cpp")
|
||||||
env.Prepend(CPPPATH=[thirdparty_dir])
|
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,12 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "register_types.h"
|
#include "register_types.h"
|
||||||
|
|
||||||
#include "servers/visual/rendering_device.h"
|
#include "servers/visual/rendering_device.h"
|
||||||
|
|
||||||
#include "thirdparty/glslang/SPIRV/GlslangToSpv.h"
|
#include <SPIRV/GlslangToSpv.h>
|
||||||
#include "thirdparty/glslang/glslang/Include/Types.h"
|
#include <glslang/Include/Types.h>
|
||||||
#include "thirdparty/glslang/glslang/Public/ShaderLang.h"
|
#include <glslang/Public/ShaderLang.h>
|
||||||
|
|
||||||
static const TBuiltInResource default_builtin_resource = {
|
static const TBuiltInResource default_builtin_resource = {
|
||||||
/*maxLights*/ 32,
|
/*maxLights*/ 32,
|
||||||
|
@ -216,13 +217,11 @@ static PoolVector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_s
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::vector<uint32_t> SpirV;
|
std::vector<uint32_t> SpirV;
|
||||||
spv::SpvBuildLogger logger;
|
spv::SpvBuildLogger logger;
|
||||||
glslang::SpvOptions spvOptions;
|
glslang::SpvOptions spvOptions;
|
||||||
glslang::GlslangToSpv(*program.getIntermediate(stages[p_stage]), SpirV, &logger, &spvOptions);
|
glslang::GlslangToSpv(*program.getIntermediate(stages[p_stage]), SpirV, &logger, &spvOptions);
|
||||||
|
|
||||||
|
|
||||||
ret.resize(SpirV.size() * sizeof(uint32_t));
|
ret.resize(SpirV.size() * sizeof(uint32_t));
|
||||||
{
|
{
|
||||||
PoolVector<uint8_t>::Write w = ret.write();
|
PoolVector<uint8_t>::Write w = ret.write();
|
||||||
|
|
|
@ -323,6 +323,9 @@ def configure(env):
|
||||||
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
|
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
|
||||||
if not env['builtin_vulkan']:
|
if not env['builtin_vulkan']:
|
||||||
env.ParseConfig('pkg-config vulkan --cflags --libs')
|
env.ParseConfig('pkg-config vulkan --cflags --libs')
|
||||||
|
if not env['builtin_glslang']:
|
||||||
|
# No pkgconfig file for glslang so far
|
||||||
|
env.Append(LIBS=['glslang', 'SPIRV'])
|
||||||
|
|
||||||
#env.Append(CPPDEFINES=['OPENGL_ENABLED'])
|
#env.Append(CPPDEFINES=['OPENGL_ENABLED'])
|
||||||
env.Append(LIBS=['GL'])
|
env.Append(LIBS=['GL'])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue