sultim-t / RayTracedGL1

MIT License
128 stars 29 forks source link

[linux] testing build for prboom-plus-rt. needs troubleshooting #8

Closed arrowgent closed 2 years ago

arrowgent commented 2 years ago

cmake -DRG_WITH_NVIDIA_DLSS=OFF ..

-- The CXX compiler identification is GNU 9.3.0
-- The C compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Adding Vulkan. VulkanSDK: 
-- Found Vulkan: /usr/lib/x86_64-linux-gnu/libvulkan.so (found version "1.3.204") 
-- RG_WITH_EXPORTS enabled. RTGL1 functions are exported.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/build

cmake --build .

[  1%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RTGL1.cpp.o
In file included from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/SectorVisibility.h:26,
                 from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/TriangleInfoManager.h:25,
                 from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/VertexCollector.h:30,
                 from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/ASManager.h:29,
                 from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/Scene.h:25,
                 from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/VulkanDevice.h:31,
                 from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/RTGL1.cpp:23:
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:55:20: error: ‘is_pod_v’ is not a member of ‘std’; did you mean ‘is_pod’?
   55 | static_assert(std::is_pod_v<LightArrayIndex>, "");
      |                    ^~~~~~~~
      |                    is_pod
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:55:44: error: expected primary-expression before ‘>’ token
   55 | static_assert(std::is_pod_v<LightArrayIndex>, "");
      |                                            ^
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:55:45: error: expected primary-expression before ‘,’ token
   55 | static_assert(std::is_pod_v<LightArrayIndex>, "");
      |                                             ^
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:77:20: error: ‘is_pod_v’ is not a member of ‘std’; did you mean ‘is_pod’?
   77 | static_assert(std::is_pod_v<SectorID>, "");
      |                    ^~~~~~~~
      |                    is_pod
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:77:37: error: expected primary-expression before ‘>’ token
   77 | static_assert(std::is_pod_v<SectorID>, "");
      |                                     ^
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:77:38: error: expected primary-expression before ‘,’ token
   77 | static_assert(std::is_pod_v<SectorID>, "");
      |                                      ^
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:100:20: error: ‘is_pod_v’ is not a member of ‘std’; did you mean ‘is_pod’?
  100 | static_assert(std::is_pod_v<SectorArrayIndex>, "");
      |                    ^~~~~~~~
      |                    is_pod
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:100:45: error: expected primary-expression before ‘>’ token
  100 | static_assert(std::is_pod_v<SectorArrayIndex>, "");
      |                                             ^
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/LightDefs.h:100:46: error: expected primary-expression before ‘,’ token
  100 | static_assert(std::is_pod_v<SectorArrayIndex>, "");
      |                                              ^
In file included from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/VulkanDevice.h:50,
                 from /home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/RTGL1.cpp:23:
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/RenderResolutionHelper.h: In member function ‘float RTGL1::RenderResolutionHelper::GetMipLodBias(float) const’:
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/RenderResolutionHelper.h:148:36: error: ‘log2f’ was not declared in this scope
  148 |         float bias =  nativeBias + log2f(std::max(0.01f, ratio)) - 1.0f;
      |                                    ^~~~~
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/RTGL1.cpp: In function ‘RgResult rgCreateInstance(const RgInstanceCreateInfo*, RgInstance_T**)’:
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/RTGL1.cpp:88:38: error: ‘make_unique’ is not a member of ‘std’
   88 |         G_DEVICES[rgInstance] = std::make_unique<VulkanDevice>(pInfo);
      |                                      ^~~~~~~~~~~
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/RTGL1.cpp:88:38: note: ‘std::make_unique’ is only available from C++14 onwards
/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/Source/RTGL1.cpp:88:62: error: expected primary-expression before ‘>’ token
   88 |         G_DEVICES[rgInstance] = std::make_unique<VulkanDevice>(pInfo);
      |                                                              ^
make[2]: *** [CMakeFiles/RayTracedGL1.dir/build.make:76: CMakeFiles/RayTracedGL1.dir/Source/RTGL1.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/RayTracedGL1.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
trathborne commented 2 years ago

I got a lot further with set(CMAKE_CXX_STANDARD 17) in CmakeLists.txt ... still hacking ☺

trathborne commented 2 years ago

Including algorithm, cmath, math.h, cstring in various places has whittled it down to: Source/LensFlares.cpp:53:12: error: a reinterpret_cast is not a constant expression ... return (RTGL1::ShIndirectDrawCommand *)((uint8_t*)pCullingInputBuffer + GetIndirectDrawCommandsOffset());

trathborne commented 2 years ago

https://github.com/MusicPlayerDaemon/MPD/commit/37b54179d882fef38ca6735b53e322027414b62e had the solution for that!

If this works for others, I'll make a PR: (or the author can just pull it!) https://github.com/trathborne/RayTracedGL1/tree/compile-on-ubuntu-20.04

arrowgent commented 2 years ago

alright let me give this a test

arrowgent commented 2 years ago

yep compiles without errors (dlss off because i dont have RTX card)

ubuntu 18.04

cmake -DRG_WITH_NVIDIA_DLSS=OFF ..

-- The CXX compiler identification is GNU 9.3.0
-- The C compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Adding Vulkan. VulkanSDK: 
-- Found Vulkan: /usr/lib/x86_64-linux-gnu/libvulkan.so (found version "1.3.204") 
-- RG_WITH_EXPORTS enabled. RTGL1 functions are exported.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/build/prboom-RTX/RayTracedGL1-compile-on-ubuntu-20.04/build

cmake --build .

[  1%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RTGL1.cpp.o
[  2%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RTGL1A.cpp.o
[  3%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/VulkanDevice.cpp.o
[  5%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Buffer.cpp.o
[  6%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Scene.cpp.o
[  7%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/PhysicalDevice.cpp.o
[  8%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Queues.cpp.o
[ 10%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Swapchain.cpp.o
[ 11%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/GlobalUniform.cpp.o
[ 12%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/CommandBufferManager.cpp.o
[ 14%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/ShaderManager.cpp.o
[ 15%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RayTracingPipeline.cpp.o
[ 16%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/VertexCollector.cpp.o
[ 17%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/ASManager.cpp.o
[ 19%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/VertexCollectorFilter.cpp.o
[ 20%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/ASBuilder.cpp.o
[ 21%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/ScratchBuffer.cpp.o
[ 23%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Utils.cpp.o
[ 24%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/PathTracer.cpp.o
[ 25%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Common.cpp.o
[ 26%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Matrix.cpp.o
[ 28%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Rasterizer.cpp.o
[ 29%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RasterizedDataCollector.cpp.o
[ 30%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Vma/vk_mem_alloc_imp.cpp.o
[ 32%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/ImageLoader.cpp.o
[ 33%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/TextureManager.cpp.o
[ 34%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/MemoryAllocator.cpp.o
[ 35%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/SamplerManager.cpp.o
[ 37%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/TextureOverrides.cpp.o
[ 38%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/TextureDescriptors.cpp.o
[ 39%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/TextureUploader.cpp.o
[ 41%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/VertexCollectorFilterType.cpp.o
[ 42%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Generated/ShaderCommonCFramebuf.cpp.o
[ 43%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Framebuffers.cpp.o
[ 44%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/BlueNoise.cpp.o
[ 46%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/ImageComposition.cpp.o
[ 47%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Tonemapping.cpp.o
[ 48%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/LightManager.cpp.o
[ 50%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/AutoBuffer.cpp.o
[ 51%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/ASComponent.cpp.o
[ 52%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/CubemapManager.cpp.o
[ 53%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/CubemapUploader.cpp.o
[ 55%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/GeomInfoManager.cpp.o
[ 56%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/VertexPreprocessing.cpp.o
[ 57%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Denoiser.cpp.o
[ 58%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RasterizerPipelines.cpp.o
[ 60%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RenderCubemap.cpp.o
[ 61%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/DepthCopying.cpp.o
[ 62%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RasterPass.cpp.o
[ 64%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/SwapchainPass.cpp.o
[ 65%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/UserFunction.cpp.o
[ 66%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/RgException.cpp.o
[ 67%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Bloom.cpp.o
[ 69%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/SuperResolution.cpp.o
[ 70%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/Sharpening.cpp.o
[ 71%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/DLSS.cpp.o
[ 73%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/HaltonSequence.cpp.o
[ 74%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/LightLists.cpp.o
[ 75%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/SectorVisibility.cpp.o
[ 76%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/TriangleInfoManager.cpp.o
[ 78%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/LensFlares.cpp.o
[ 79%] Building CXX object CMakeFiles/RayTracedGL1.dir/Source/DecalManager.cpp.o
[ 80%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/texture.c.o
[ 82%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/texture1.c.o
[ 83%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/texture2.c.o
[ 84%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/hashlist.c.o
[ 85%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/checkheader.c.o
[ 87%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/swap.c.o
[ 88%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/memstream.c.o
[ 89%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/filestream.c.o
[ 91%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/vkloader.c.o
[ 92%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/vk_funcs.c.o
[ 93%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/basisu/zstd/zstd.c.o
[ 94%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/dfdutils/createdfd.c.o
[ 96%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/dfdutils/interpretdfd.c.o
[ 97%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/dfdutils/queries.c.o
[ 98%] Building C object CMakeFiles/RayTracedGL1.dir/Source/KTX/lib/dfdutils/vk2dfd.c.o
[100%] Linking CXX shared library libRayTracedGL1.so
[100%] Built target RayTracedGL1
arrowgent commented 2 years ago

If this works for others, I'll make a PR: (or the author can just pull it!) https://github.com/trathborne/RayTracedGL1/tree/compile-on-ubuntu-20.04

just go ahead and make a PR. @trathborne good job

arrowgent commented 2 years ago

this PR would also close this: https://github.com/sultim-t/RayTracedGL1/issues/7

arrowgent commented 2 years ago

would have to be tested on a windows compiler also so that your changes doesnt break the windows end

sultim-t commented 2 years ago

That's nice :) First steps for Linux support, hehe (I will start looking next week)

Civil commented 2 years ago

would have to be tested on a windows compiler also so that your changes doesnt break the windows end

Here it's actually easier. Most of the changes that were done in the PR referenced are to make code conform with C++20 and they were either casting fixes or header fixes (adding missing headers that were indirectly included by MSVC). Most of the time they are safe. But of course this should be eventually tested under whatever MSVC version author uses.

arrowgent commented 2 years ago

current build https://github.com/sultim-t/RayTracedGL1/commit/fdca400fc055b90a1bb6aa3165230e57c16e81ca

compiled on linux with no complaints

Jackfritt commented 2 years ago

Ok i got it to compile. But when it runs I get a short window open then sound crack and exit. thats all... Any suggestions? I also added to file ~/.prboom-plus/prboom-plus.cfg exclusive_fullscreen=1

Then InitScreenResolution gets set to 640x480...

./prboom-plus M_LoadDefaults: Load system defaults. default file: /home/kvm/.prboom-plus/prboom-plus.cfg found prboom-plus.wad

PrBoom-Plus-RT v2.6.1um (https://github.com/coelckers/prboom-plus) I_SetAffinityMask: manual affinity mask is 1 found doom1.wad IWAD found: doom1.wad PrBoom-Plus-RT (built Apr 19 2022 16:08:15), playing: DOOM Shareware PrBoom-Plus-RT is released under the GNU General Public license v2.0. You are welcome to redistribute it under certain conditions. It comes with ABSOLUTELY NO WARRANTY. See the file COPYING for details. V_Init: allocate screens. V_InitMode: using RT video mode I_InitScreenResolution: Using resolution 640x480 found prboom-plus.wad D_InitNetGame: Checking for network game. W_Init: Init WADfiles. adding doom1.wad adding prboom-plus.wad W_InitCache

M_Init: Init miscellaneous info. SetRatio: width/height parameters 640x480 SetRatio: storage aspect ratio 4:3 SetRatio: assuming square pixels SetRatio: display aspect ratio 4:3 SetRatio: gl_ratio 1.600000 SetRatio: multiplier 1/1 R_Init: Init DOOM refresh daemon - R_LoadTrigTables: Endianness...ok. R_InitData: Textures Flats Sprites R_Init: R_InitPlanes R_InitLightTables R_InitSkyMap R_InitTranslationsTables R_InitPatches P_Init: Init Playloop state. I_Init: Setting up machine state. I_InitSound: configured audio device with 2048 samples/slice I_InitMusic: Was compiled without SDL_Mixer support. You should enable experimental music. I_InitSound: sound module ready S_Init: Setting up sound. S_Init: default sfx volume 8 HU_Init: Setting up heads up display. I_InitGraphics: 640x480 SetRatio: width/height parameters 640x480 SetRatio: storage aspect ratio 4:3 SetRatio: assuming square pixels SetRatio: display aspect ratio 4:3 SetRatio: gl_ratio 1.600000 SetRatio: multiplier 1/1 prboom-plus: /home/kvm/src/prboom-plus-rt/RayTracedGL1/Source/Common.h:73: void RTGL1::VK_CHECKERROR(VkResult): Assertion `r == VK_SUCCESS' failed. I_SignalHandler: Exiting on signal: Aborted I_ShutdownSound: