From 12ce6a78fe6569abc93caf5897d81c57daee07e9 Mon Sep 17 00:00:00 2001 From: pogokeen Date: Sun, 14 Jul 2019 01:48:23 +0000 Subject: [PATCH] Fix parallel build by switching to generating .obj files from .glsl files and treat the shader source as an externed global resolved at link time. Additionally, remove the no longer necessary shader generated headers folder from .gitignore git-svn-id: https://svn.eduke32.com/eduke32@7793 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # .gitignore # source/build/src/polymost.cpp --- .gitignore | 1 - GNUmakefile | 14 ++++---- platform/Windows/build.vcxproj | 60 +++++++++++++++++++++++++++------- source/build/src/empty.cpp | 0 source/build/src/polymost.cpp | 5 ++- 5 files changed, 57 insertions(+), 23 deletions(-) delete mode 100644 source/build/src/empty.cpp diff --git a/.gitignore b/.gitignore index 12438be7f..935850c46 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,6 @@ project.xcworkspace/ .DS_Store ._* -/source/build/src/generated/ Platform/Windows/Build Platform/Windows/Win32 Platform/Windows/x64 diff --git a/GNUmakefile b/GNUmakefile index 746bf8bad..495706e8c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1012,12 +1012,12 @@ $$($1_obj)/%.$$o: $$($1_obj)/%.c | $$($1_obj) $$(COMPILE_STATUS) $$(RECIPE_IF) $$(COMPILER_C) $$($1_cflags) -c $$< -o $$@ $$(RECIPE_RESULT_COMPILE) -$$($1_obj)/%.$$o: $$($1_src)/%.glsl | $$($1_obj) $$($1_src)/generated - @echo Creating $$( $$(> $$(> $$( $$($1_obj)/$$(> $$($1_obj)/$$(> $$($1_obj)/$$( Document - mkdir %(RelativeDir)generated -echo char const *%(Filename) = R^"shader( > %(RelativeDir)generated\%(Filename)%(Extension).h -type %(Identity) >> %(RelativeDir)generated\%(Filename)%(Extension).h -echo )shader^"; >> %(RelativeDir)generated\%(Filename)%(Extension).h - Creating header from %(Identity) - %(RelativeDir)\generated\%(Filename)%(Extension).h + echo char const *%(Filename) = R^"shader( > $(IntermediateOutputPath)%(Filename)%(Extension).cpp +type %(Identity) >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +echo )shader^"; >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +cl /c /MP /GS /GL /analyze- /W3 /wd"4996" /wd"4244" /wd"4018" /wd"4267" /Gy /Zc:wchar_t /I"./include" /I"./include/vpx/" /I"./include/sdl2/" /I"../../source/build/include" /I"../../source/mact/include" /I"../../source/audiolib/include" /I"../../source/enet/include" /I"../../source/glad/include" /I"../../source/libxmp-lite/include" /I"../../source/libxmp-lite/include/libxmp-lite" /Gm- /O2 /Fd"Win32\Build\build\Release\build.pdb" /Zc:inline /fp:precise /D "NDEBUG" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "RENDERTYPESDL=1" /D "MIXERTYPEWIN=1" /D "SDL_USEFOLDER" /D "SDL_TARGET=2" /D "USE_OPENGL=1" /D "POLYMER=1" /D "STARTUP_WINDOW" /D "USE_LIBVPX" /D "HAVE_VORBIS" /D "HAVE_XMP" /errorReport:prompt /WX- /Zc:forScope /arch:SSE2 /Gd /Oy /Oi /MD /Fa"Win32\Build\build\Release\\" /EHs /nologo /Fo"Win32\Build\build\Release\\" /Ot /Fp"Win32\Build\build\Release\build.pch" "$(IntermediateOutputPath)%(Filename)%(Extension).cpp" + echo char const *%(Filename) = R^"shader( > $(IntermediateOutputPath)%(Filename)%(Extension).cpp +type %(Identity) >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +echo )shader^"; >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +cl /c /MP /GS- /analyze- /W3 /wd"4996" /wd"4244" /wd"4018" /wd"4267" /Gy /Zc:wchar_t /I"./include" /I"./include/vpx/" /I"./include/sdl2/" /I"../../source/build/include" /I"../../source/mact/include" /I"../../source/audiolib/include" /I"../../source/enet/include" /I"../../source/glad/include" /I"../../source/libxmp-lite/include" /I"../../source/libxmp-lite/include/libxmp-lite" /Zi /Gm /Od /Fd"Win32\Build\build\Debug\build.pdb" /Zc:inline /fp:precise /D "_DEBUG" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "RENDERTYPESDL=1" /D "MIXERTYPEWIN=1" /D "SDL_USEFOLDER" /D "SDL_TARGET=2" /D "USE_OPENGL=1" /D "POLYMER=1" /D "STARTUP_WINDOW" /D "USE_LIBVPX" /D "HAVE_VORBIS" /D "HAVE_XMP" /errorReport:prompt /WX- /Zc:forScope /RTC1 /arch:SSE2 /Gd /Oy- /MDd /Fa"Win32\Build\build\Debug\\" /EHs /nologo /Fo"Win32\Build\build\Debug\\" /Fp"Win32\Build\build\Debug\build.pch" $(IntermediateOutputPath)%(Filename)%(Extension).cpp + Compiling shader to %(Identity).obj + Compiling shader to %(Identity).obj + echo char const *%(Filename) = R^"shader( > $(IntermediateOutputPath)%(Filename)%(Extension).cpp +type %(Identity) >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +echo )shader^"; >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +cl /c /MP /GS /GL /W3 /wd"4996" /wd"4244" /wd"4018" /wd"4267" /Gy /Zc:wchar_t /I"./include" /I"./include/vpx/" /I"./include/sdl2/" /I"../../source/build/include" /I"../../source/mact/include" /I"../../source/audiolib/include" /I"../../source/enet/include" /I"../../source/glad/include" /I"../../source/libxmp-lite/include" /I"../../source/libxmp-lite/include/libxmp-lite" /Gm- /O2 /Fd"x64\Build\build\Release\build.pdb" /Zc:inline /fp:precise /D "NDEBUG" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "RENDERTYPESDL=1" /D "MIXERTYPEWIN=1" /D "SDL_USEFOLDER" /D "SDL_TARGET=2" /D "USE_OPENGL=1" /D "POLYMER=1" /D "STARTUP_WINDOW" /D "USE_LIBVPX" /D "HAVE_VORBIS" /D "HAVE_XMP" /D "NOASM=1" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy /Oi /MD /Fa"x64\Build\build\Release\\" /EHs /nologo /Fo"x64\Build\build\Release\\" /Ot /Fp"x64\Build\build\Release\build.pch" $(IntermediateOutputPath)%(Filename)%(Extension).cpp + echo char const *%(Filename) = R^"shader( > $(IntermediateOutputPath)%(Filename)%(Extension).cpp +type %(Identity) >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +echo )shader^"; >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +cl /c /MP /GS- /W3 /wd"4996" /wd"4244" /wd"4018" /wd"4267" /Gy /Zc:wchar_t /I"./include" /I"./include/vpx/" /I"./include/sdl2/" /I"../../source/build/include" /I"../../source/mact/include" /I"../../source/audiolib/include" /I"../../source/enet/include" /I"../../source/glad/include" /I"../../source/libxmp-lite/include" /I"../../source/libxmp-lite/include/libxmp-lite" /Zi /Gm /Od /Fd"x64\Build\build\Debug\build.pdb" /Zc:inline /fp:precise /D "_DEBUG" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "RENDERTYPESDL=1" /D "MIXERTYPEWIN=1" /D "SDL_USEFOLDER" /D "SDL_TARGET=2" /D "USE_OPENGL=1" /D "POLYMER=1" /D "STARTUP_WINDOW" /D "USE_LIBVPX" /D "HAVE_VORBIS" /D "HAVE_XMP" /D "NOASM=1" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MDd /Fa"x64\Build\build\Debug\\" /EHs /nologo /Fo"x64\Build\build\Debug\\" /Fp"x64\Build\build\Debug\build.pch" $(IntermediateOutputPath)%(Filename)%(Extension).cpp + Compiling shader to %(Identity).obj + Compiling shader to %(Identity).obj + $(IntermediateOutputPath)%(Filename)%(Extension).obj;$(IntermediateOutputPath)%(Filename)%(Extension).cpp + $(IntermediateOutputPath)%(Filename)%(Extension).obj;$(IntermediateOutputPath)%(Filename)%(Extension).cpp + $(IntermediateOutputPath)%(Filename)%(Extension).obj;$(IntermediateOutputPath)%(Filename)%(Extension).cpp + $(IntermediateOutputPath)%(Filename)%(Extension).obj;$(IntermediateOutputPath)%(Filename)%(Extension).cpp Document - mkdir %(RelativeDir)generated -echo char const *%(Filename) = R^"shader( > %(RelativeDir)generated\%(Filename)%(Extension).h -type %(Identity) >> %(RelativeDir)generated\%(Filename)%(Extension).h -echo )shader^"; >> %(RelativeDir)generated\%(Filename)%(Extension).h - Creating header from %(Identity) - %(RelativeDir)\generated\%(Filename)%(Extension).h + echo char const *%(Filename) = R^"shader( > $(IntermediateOutputPath)%(Filename)%(Extension).cpp +type %(Identity) >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +echo )shader^"; >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +cl /c /MP /GS /GL /analyze- /W3 /wd"4996" /wd"4244" /wd"4018" /wd"4267" /Gy /Zc:wchar_t /I"./include" /I"./include/vpx/" /I"./include/sdl2/" /I"../../source/build/include" /I"../../source/mact/include" /I"../../source/audiolib/include" /I"../../source/enet/include" /I"../../source/glad/include" /I"../../source/libxmp-lite/include" /I"../../source/libxmp-lite/include/libxmp-lite" /Gm- /O2 /Fd"Win32\Build\build\Release\build.pdb" /Zc:inline /fp:precise /D "NDEBUG" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "RENDERTYPESDL=1" /D "MIXERTYPEWIN=1" /D "SDL_USEFOLDER" /D "SDL_TARGET=2" /D "USE_OPENGL=1" /D "POLYMER=1" /D "STARTUP_WINDOW" /D "USE_LIBVPX" /D "HAVE_VORBIS" /D "HAVE_XMP" /errorReport:prompt /WX- /Zc:forScope /arch:SSE2 /Gd /Oy /Oi /MD /Fa"Win32\Build\build\Release\\" /EHs /nologo /Fo"Win32\Build\build\Release\\" /Ot /Fp"Win32\Build\build\Release\build.pch" "$(IntermediateOutputPath)%(Filename)%(Extension).cpp" + echo char const *%(Filename) = R^"shader( > $(IntermediateOutputPath)%(Filename)%(Extension).cpp +type %(Identity) >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +echo )shader^"; >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +cl /c /MP /GS- /analyze- /W3 /wd"4996" /wd"4244" /wd"4018" /wd"4267" /Gy /Zc:wchar_t /I"./include" /I"./include/vpx/" /I"./include/sdl2/" /I"../../source/build/include" /I"../../source/mact/include" /I"../../source/audiolib/include" /I"../../source/enet/include" /I"../../source/glad/include" /I"../../source/libxmp-lite/include" /I"../../source/libxmp-lite/include/libxmp-lite" /Zi /Gm /Od /Fd"Win32\Build\build\Debug\build.pdb" /Zc:inline /fp:precise /D "_DEBUG" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "RENDERTYPESDL=1" /D "MIXERTYPEWIN=1" /D "SDL_USEFOLDER" /D "SDL_TARGET=2" /D "USE_OPENGL=1" /D "POLYMER=1" /D "STARTUP_WINDOW" /D "USE_LIBVPX" /D "HAVE_VORBIS" /D "HAVE_XMP" /errorReport:prompt /WX- /Zc:forScope /RTC1 /arch:SSE2 /Gd /Oy- /MDd /Fa"Win32\Build\build\Debug\\" /EHs /nologo /Fo"Win32\Build\build\Debug\\" /Fp"Win32\Build\build\Debug\build.pch" $(IntermediateOutputPath)%(Filename)%(Extension).cpp + Compiling shader to %(Identity).obj + Compiling shader to %(Identity).obj + echo char const *%(Filename) = R^"shader( > $(IntermediateOutputPath)%(Filename)%(Extension).cpp +type %(Identity) >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +echo )shader^"; >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +cl /c /MP /GS /GL /W3 /wd"4996" /wd"4244" /wd"4018" /wd"4267" /Gy /Zc:wchar_t /I"./include" /I"./include/vpx/" /I"./include/sdl2/" /I"../../source/build/include" /I"../../source/mact/include" /I"../../source/audiolib/include" /I"../../source/enet/include" /I"../../source/glad/include" /I"../../source/libxmp-lite/include" /I"../../source/libxmp-lite/include/libxmp-lite" /Gm- /O2 /Fd"x64\Build\build\Release\build.pdb" /Zc:inline /fp:precise /D "NDEBUG" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "RENDERTYPESDL=1" /D "MIXERTYPEWIN=1" /D "SDL_USEFOLDER" /D "SDL_TARGET=2" /D "USE_OPENGL=1" /D "POLYMER=1" /D "STARTUP_WINDOW" /D "USE_LIBVPX" /D "HAVE_VORBIS" /D "HAVE_XMP" /D "NOASM=1" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy /Oi /MD /Fa"x64\Build\build\Release\\" /EHs /nologo /Fo"x64\Build\build\Release\\" /Ot /Fp"x64\Build\build\Release\build.pch" $(IntermediateOutputPath)%(Filename)%(Extension).cpp + echo char const *%(Filename) = R^"shader( > $(IntermediateOutputPath)%(Filename)%(Extension).cpp +type %(Identity) >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +echo )shader^"; >> $(IntermediateOutputPath)%(Filename)%(Extension).cpp +cl /c /MP /GS- /W3 /wd"4996" /wd"4244" /wd"4018" /wd"4267" /Gy /Zc:wchar_t /I"./include" /I"./include/vpx/" /I"./include/sdl2/" /I"../../source/build/include" /I"../../source/mact/include" /I"../../source/audiolib/include" /I"../../source/enet/include" /I"../../source/glad/include" /I"../../source/libxmp-lite/include" /I"../../source/libxmp-lite/include/libxmp-lite" /Zi /Gm /Od /Fd"x64\Build\build\Debug\build.pdb" /Zc:inline /fp:precise /D "_DEBUG" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "RENDERTYPESDL=1" /D "MIXERTYPEWIN=1" /D "SDL_USEFOLDER" /D "SDL_TARGET=2" /D "USE_OPENGL=1" /D "POLYMER=1" /D "STARTUP_WINDOW" /D "USE_LIBVPX" /D "HAVE_VORBIS" /D "HAVE_XMP" /D "NOASM=1" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MDd /Fa"x64\Build\build\Debug\\" /EHs /nologo /Fo"x64\Build\build\Debug\\" /Fp"x64\Build\build\Debug\build.pch" $(IntermediateOutputPath)%(Filename)%(Extension).cpp + Compiling shader to %(Identity).obj + Compiling shader to %(Identity).obj + $(IntermediateOutputPath)%(Filename)%(Extension).obj;$(IntermediateOutputPath)%(Filename)%(Extension).cpp + $(IntermediateOutputPath)%(Filename)%(Extension).obj;$(IntermediateOutputPath)%(Filename)%(Extension).cpp + $(IntermediateOutputPath)%(Filename)%(Extension).obj;$(IntermediateOutputPath)%(Filename)%(Extension).cpp + $(IntermediateOutputPath)%(Filename)%(Extension).obj;$(IntermediateOutputPath)%(Filename)%(Extension).cpp diff --git a/source/build/src/empty.cpp b/source/build/src/empty.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 9b7673698..7d283b908 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -154,6 +154,8 @@ static vec2f_t tilesheetHalfTexelSize = { 0.f, 0.f }; static int32_t lastbasepal = -1; static FHardwareTexture *paletteTextureIDs[MAXBASEPALS]; static FHardwareTexture *palswapTextureID = nullptr; +extern char const *polymost1Frag; +extern char const *polymost1Vert; static GLuint polymost1CurrentShaderProgramID = 0; static GLuint polymost1BasicShaderProgramID = 0; static GLuint polymost1ExtendedShaderProgramID = 0; @@ -891,9 +893,6 @@ void polymost_glinit() fogRangeLoc = glGetUniformLocation(polymost2BasicShaderProgramID, "u_fogRange"); fogColorLoc = glGetUniformLocation(polymost2BasicShaderProgramID, "u_fogColor"); -#include "generated/polymost1Vert.glsl.h" -#include "generated/polymost1Frag.glsl.h" - polymost1ExtendedShaderProgramID = glCreateProgram(); GLuint polymost1BasicVertexShaderID = polymost2_compileShader(GL_VERTEX_SHADER, polymost1Vert); GLuint polymost1ExtendedFragmentShaderID = polymost2_compileShader(GL_FRAGMENT_SHADER, polymost1Frag);