Closed arrowgent closed 2 years ago
I got a lot further with set(CMAKE_CXX_STANDARD 17)
in CmakeLists.txt ... still hacking ☺
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());
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
alright let me give this a test
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
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
this PR would also close this: https://github.com/sultim-t/RayTracedGL1/issues/7
would have to be tested on a windows compiler also so that your changes doesnt break the windows end
That's nice :) First steps for Linux support, hehe (I will start looking next week)
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.
current build https://github.com/sultim-t/RayTracedGL1/commit/fdca400fc055b90a1bb6aa3165230e57c16e81ca
compiled on linux with no complaints
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:
cmake -DRG_WITH_NVIDIA_DLSS=OFF ..
cmake --build .