diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 4b69dffe..37e3dea9 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -36,7 +36,7 @@ _______________________________ - Added Steel Storm 2 Engine render demo fixes - Merged LordHavoc's image compression progress bar which shows up in the map loading screen - when loading new images from mods + when loading and compressing new images from mods - Added instructions how to use these Doom 3 port with the GOG installer diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 82667025..ad221c0a 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -1518,6 +1518,25 @@ else() ${STUBAUDIO_SOURCES} ${DOOMCLASSIC_STUBAUDIO_SOURCES}) endif() + + if(USE_VULKAN) + list(APPEND RBDOOM3_INCLUDES ${RENDERER_VULKAN_INCLUDES}) + list(APPEND RBDOOM3_SOURCES ${RENDERER_VULKAN_SOURCES}) + + set(Vulkan_LIBRARIES + ${Vulkan_LIBRARY} + glslang + SPIRV + ) + + if(ENABLE_GLSLANG_BINARIES) + list(APPEND Vulkan_LIBRARIES glslang-default-resource-limits) + endif() + + else() + list(APPEND RBDOOM3_INCLUDES ${RENDERER_OPENGL_INCLUDES}) + list(APPEND RBDOOM3_SOURCES ${RENDERER_OPENGL_SOURCES}) + endif() endif() diff --git a/neo/cmake-linux-debug.sh b/neo/cmake-linux-debug.sh index 6eef6f45..fc0586d2 100755 --- a/neo/cmake-linux-debug.sh +++ b/neo/cmake-linux-debug.sh @@ -2,4 +2,4 @@ cd .. rm -rf build mkdir build cd build -cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DSDL2=ON ../neo +cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DSDL2=ON -DOpenGL_GL_PREFERENCE=GLVND ../neo diff --git a/neo/renderer/BufferObject.cpp b/neo/renderer/BufferObject.cpp index 53f84756..e265fd58 100644 --- a/neo/renderer/BufferObject.cpp +++ b/neo/renderer/BufferObject.cpp @@ -33,6 +33,7 @@ If you have questions concerning this license or the applicable additional terms idCVar r_showBuffers( "r_showBuffers", "0", CVAR_INTEGER, "" ); +#ifdef _WIN32 /* ================== IsWriteCombined @@ -51,7 +52,7 @@ bool IsWriteCombined( void* base ) bool isWriteCombined = ( ( info.AllocationProtect & PAGE_WRITECOMBINE ) != 0 ); return isWriteCombined; } - +#endif #if defined(USE_INTRINSICS) @@ -329,4 +330,4 @@ void idUniformBuffer::Reference( const idUniformBuffer& other, int refOffset, in allocation = other.allocation; #endif assert( OwnsBuffer() == false ); -} \ No newline at end of file +} diff --git a/neo/renderer/OpenGL/BufferObject_GL.cpp b/neo/renderer/OpenGL/BufferObject_GL.cpp index 10cb8eee..a1d28dd6 100644 --- a/neo/renderer/OpenGL/BufferObject_GL.cpp +++ b/neo/renderer/OpenGL/BufferObject_GL.cpp @@ -126,7 +126,7 @@ bool idVertexBuffer::AllocBufferObject( const void* data, int allocSize, bufferU if( r_showBuffers.GetBool() ) { - idLib::Printf( "vertex buffer alloc %p, api %p (%i bytes)\n", this, GetAPIObject(), GetSize() ); + idLib::Printf( "vertex buffer alloc %p, api %p (%i bytes)\n", this, ( GLuint* )&apiObject, GetSize() ); } // copy the data @@ -164,7 +164,7 @@ void idVertexBuffer::FreeBufferObject() if( r_showBuffers.GetBool() ) { - idLib::Printf( "vertex buffer free %p, api %p (%i bytes)\n", this, GetAPIObject(), GetSize() ); + idLib::Printf( "vertex buffer free %p, api %p (%i bytes)\n", this, ( GLuint* )&apiObject, GetSize() ); } glDeleteBuffers( 1, ( GLuint* )&apiObject ); @@ -344,7 +344,7 @@ bool idIndexBuffer::AllocBufferObject( const void* data, int allocSize, bufferUs if( r_showBuffers.GetBool() ) { - idLib::Printf( "index buffer alloc %p, api %p (%i bytes)\n", this, GetAPIObject(), GetSize() ); + idLib::Printf( "index buffer alloc %p, api %p (%i bytes)\n", this, ( GLuint* )&apiObject, GetSize() ); } // copy the data @@ -382,7 +382,7 @@ void idIndexBuffer::FreeBufferObject() if( r_showBuffers.GetBool() ) { - idLib::Printf( "index buffer free %p, api %p (%i bytes)\n", this, GetAPIObject(), GetSize() ); + idLib::Printf( "index buffer free %p, api %p (%i bytes)\n", this, ( GLuint* )&apiObject, GetSize() ); } glDeleteBuffers( 1, ( GLuint* )&apiObject ); @@ -550,7 +550,7 @@ bool idUniformBuffer::AllocBufferObject( const void* data, int allocSize, buffer if( r_showBuffers.GetBool() ) { - idLib::Printf( "joint buffer alloc %p, api %p (%i joints)\n", this, GetAPIObject(), GetSize() ); + idLib::Printf( "joint buffer alloc %p, api %p (%i joints)\n", this, ( GLuint* )&apiObject, GetSize() ); } // copy the data @@ -588,7 +588,7 @@ void idUniformBuffer::FreeBufferObject() if( r_showBuffers.GetBool() ) { - idLib::Printf( "joint buffer free %p, api %p (%i size)\n", this, GetAPIObject(), GetSize() ); + idLib::Printf( "joint buffer free %p, api %p (%i size)\n", this, ( GLuint* )&apiObject, GetSize() ); } glBindBuffer( GL_UNIFORM_BUFFER, 0 ); @@ -692,4 +692,4 @@ void idUniformBuffer::ClearWithoutFreeing() size = 0; offsetInOtherBuffer = OWNS_BUFFER_FLAG; apiObject = 0xFFFF; -} \ No newline at end of file +} diff --git a/neo/renderer/OpenGL/RenderProgs_GL.cpp b/neo/renderer/OpenGL/RenderProgs_GL.cpp index ad1f1372..80660ee8 100644 --- a/neo/renderer/OpenGL/RenderProgs_GL.cpp +++ b/neo/renderer/OpenGL/RenderProgs_GL.cpp @@ -99,7 +99,6 @@ idRenderProgManager::LoadGLSLShader */ void idRenderProgManager::LoadShader( shader_t& shader ) { - idStr inFile; idStr outFileHLSL; idStr outFileGLSL; @@ -200,9 +199,21 @@ void idRenderProgManager::LoadShader( shader_t& shader ) } } + // FIXME: we should really scan the program source code for using rpEnableSkinning but at this + // point we directly load a binary and the program source code is not available on the consoles + bool hasGPUSkinning = false; + + if( idStr::Icmp( shader.name.c_str(), "heatHaze" ) == 0 || + idStr::Icmp( shader.name.c_str(), "heatHazeWithMask" ) == 0 || + idStr::Icmp( shader.name.c_str(), "heatHazeWithMaskAndVertex" ) == 0 || + ( BIT( USE_GPU_SKINNING ) & shader.shaderFeatures ) ) + { + hasGPUSkinning = true; + } + idStr hlslCode( hlslFileBuffer ); idStr programHLSL = StripDeadCode( hlslCode, inFile, compileMacros, shader.builtin ); - programGLSL = ConvertCG2GLSL( programHLSL, inFile, shader.stage == SHADER_STAGE_VERTEX, programUniforms, glConfig.driverType == GLDRV_VULKAN ); + programGLSL = ConvertCG2GLSL( programHLSL, inFile.c_str(), shader.stage, programUniforms, false, hasGPUSkinning ); fileSystem->WriteFile( outFileHLSL, programHLSL.c_str(), programHLSL.Length(), "fs_savepath" ); fileSystem->WriteFile( outFileGLSL, programGLSL.c_str(), programGLSL.Length(), "fs_savepath" ); @@ -566,4 +577,4 @@ idRenderBackend::ResizeImages void idRenderBackend::ResizeImages() { // TODO resize framebuffers here -} \ No newline at end of file +} diff --git a/neo/renderer/RenderBackend.h b/neo/renderer/RenderBackend.h index accce4e4..bdfa27dd 100644 --- a/neo/renderer/RenderBackend.h +++ b/neo/renderer/RenderBackend.h @@ -123,9 +123,9 @@ struct debugPolygon_t void RB_SetMVP( const idRenderMatrix& mvp ); void RB_SetVertexColorParms( stageVertexColor_t svc ); -void RB_GetShaderTextureMatrix( const float* shaderRegisters, const textureStage_t* texture, float matrix[16] ); -void RB_LoadShaderTextureMatrix( const float* shaderRegisters, const textureStage_t* texture ); -void RB_BakeTextureMatrixIntoTexgen( idPlane lightProject[3], const float* textureMatrix ); +//void RB_GetShaderTextureMatrix( const float* shaderRegisters, const textureStage_t* texture, float matrix[16] ); +//void RB_LoadShaderTextureMatrix( const float* shaderRegisters, const textureStage_t* texture ); +//void RB_BakeTextureMatrixIntoTexgen( idPlane lightProject[3], const float* textureMatrix ); //bool ChangeDisplaySettingsIfNeeded( gfxImpParms_t parms ); //bool CreateGameWindow( gfxImpParms_t parms ); @@ -486,4 +486,4 @@ public: #endif // !defined( USE_VULKAN ) }; -#endif \ No newline at end of file +#endif diff --git a/neo/sys/sdl/sdl_events.cpp b/neo/sys/sdl/sdl_events.cpp index ed2894c7..c3f1d5bc 100644 --- a/neo/sys/sdl/sdl_events.cpp +++ b/neo/sys/sdl/sdl_events.cpp @@ -40,7 +40,7 @@ If you have questions concerning this license or the applicable additional terms #include -#include "renderer/tr_local.h" +#include "renderer/RenderCommon.h" #include "sdl_local.h" #include "../posix/posix_public.h" diff --git a/neo/sys/sdl/sdl_glimp.cpp b/neo/sys/sdl/sdl_glimp.cpp index 0c1041e3..7c7967d2 100644 --- a/neo/sys/sdl/sdl_glimp.cpp +++ b/neo/sys/sdl/sdl_glimp.cpp @@ -40,7 +40,7 @@ If you have questions concerning this license or the applicable additional terms #include -#include "renderer/tr_local.h" +#include "renderer/RenderCommon.h" #include "sdl_local.h" idCVar in_nograb( "in_nograb", "0", CVAR_SYSTEM | CVAR_NOCHEAT, "prevents input grabbing" );