Open Rosentti opened 1 year ago
I got it to compile with the following, but it seems 32-bit build is even more fun
diff --git a/Source/GltfExporter.cpp b/Source/GltfExporter.cpp
index 86073c7..4e3f350 100644
--- a/Source/GltfExporter.cpp
+++ b/Source/GltfExporter.cpp
@@ -40,6 +40,10 @@
#include <span>
#include <type_traits>
+#ifndef M_PI
+#define M_PI RTGL1::Utils::M_PI
+#endif
+
namespace
{
template< class T >
@@ -901,7 +905,7 @@ private:
static float LuminousFluxToCandela( float lumens )
{
// to lumens per steradian
- return lumens / ( 4 * float( RTGL1::Utils::M_PI ) );
+ return lumens / ( 4 * (float)( M_PI ) );
}
static cgltf_light MakeLight( const RgDirectionalLightUploadInfo& sun )
diff --git a/Source/GltfImporter.cpp b/Source/GltfImporter.cpp
index b3658f4..59438c7 100644
--- a/Source/GltfImporter.cpp
+++ b/Source/GltfImporter.cpp
@@ -32,6 +32,10 @@
#include <format>
+#ifndef M_PI
+#define M_PI Utils::M_PI
+#endif
+
namespace RTGL1
{
namespace
@@ -910,7 +914,7 @@ void RTGL1::GltfImporter::UploadToScene( VkCommandBuffer cmd,
constexpr auto candelaToLuminousFlux = []( float lumensPerSteradian ) {
// to lumens
- return lumensPerSteradian * ( 4 * float( Utils::M_PI ) );
+ return lumensPerSteradian * ( 4 * (float)( M_PI ) );
};
auto makeExtras = []( const char* extradata ) {
diff --git a/Source/VulkanDevice_Init.cpp b/Source/VulkanDevice_Init.cpp
index d01a449..ce4cba4 100644
--- a/Source/VulkanDevice_Init.cpp
+++ b/Source/VulkanDevice_Init.cpp
@@ -96,7 +96,7 @@ VkSurfaceKHR GetSurfaceFromUser( VkInstance instance, const RgInstanceCreateInfo
wlInfo.display = info.pWaylandSurfaceCreateInfo->display;
wlInfo.surface = info.pWaylandSurfaceCreateInfo->surface;
- r = ( instance, &wlInfo, nullptr, &surface );
+ r = vkCreateWaylandSurfaceKHR( instance, &wlInfo, nullptr, &surface );
VK_CHECKERROR( r );
return surface;
ok, the following was needed for 32bit build, but who knows if it will work
diff --git a/Source/DebugWindows.cpp b/Source/DebugWindows.cpp
index 68a3360..bcee72a 100644
--- a/Source/DebugWindows.cpp
+++ b/Source/DebugWindows.cpp
@@ -254,7 +254,7 @@ RTGL1::DebugWindows::DebugWindows( VkInstance _ins
.Device = _device,
.QueueFamily = _queueFamiy,
.Queue = _queue,
- .PipelineCache = nullptr,
+ .PipelineCache = (VkPipelineCache)nullptr,
.DescriptorPool = descPool,
.Subpass = 0,
.MinImageCount = swapchainImageCount,
diff --git a/Source/DepthCopying.cpp b/Source/DepthCopying.cpp
index 5ff0731..9df03fd 100644
--- a/Source/DepthCopying.cpp
+++ b/Source/DepthCopying.cpp
@@ -359,7 +359,7 @@ void RTGL1::DepthCopying::CreatePipeline( const ShaderManager* shaderManager )
.basePipelineHandle = VK_NULL_HANDLE,
};
- VkResult r = vkCreateGraphicsPipelines( device, nullptr, 1, &plInfo, nullptr, &pipeline );
+ VkResult r = vkCreateGraphicsPipelines( device, (VkPipelineCache)nullptr, 1, &plInfo, nullptr, &pipeline );
VK_CHECKERROR( r );
SET_DEBUG_NAME( device, pipeline, VK_OBJECT_TYPE_PIPELINE, "Rasterizer raster draw pipeline" );
diff --git a/Source/DrawFrameInfo.h b/Source/DrawFrameInfo.h
index 6a92784..33017b4 100644
--- a/Source/DrawFrameInfo.h
+++ b/Source/DrawFrameInfo.h
@@ -248,7 +248,7 @@ namespace detail
inline void* ReadPNext( void* params )
{
- constexpr size_t pNextOffset = 8;
+ constexpr size_t pNextOffset = sizeof(void *);
// clang-format off
static_assert( offsetof( RgDrawFrameRenderResolutionParams, pNext ) == pNextOffset );
diff --git a/Source/LensFlares.cpp b/Source/LensFlares.cpp
index 932c96d..8b8ac66 100644
--- a/Source/LensFlares.cpp
+++ b/Source/LensFlares.cpp
@@ -554,13 +554,13 @@ void RTGL1::LensFlares::CreatePipelines( const ShaderManager* shaderManager )
};
info.stage.pSpecializationInfo = &spec;
- VkResult r = vkCreateComputePipelines( device, nullptr, 1, &info, nullptr, &cullPipeline );
+ VkResult r = vkCreateComputePipelines( device, (VkPipelineCache)nullptr, 1, &info, nullptr, &cullPipeline );
VK_CHECKERROR( r );
}
void RTGL1::LensFlares::DestroyPipelines()
{
- if( cullPipeline != nullptr )
+ if( cullPipeline != (VkPipeline)nullptr )
{
vkDestroyPipeline( device, cullPipeline, nullptr );
}
diff --git a/Source/RTGL1.cpp b/Source/RTGL1.cpp
index bd6629e..6b570e7 100644
--- a/Source/RTGL1.cpp
+++ b/Source/RTGL1.cpp
@@ -25,10 +25,10 @@
namespace
{
-#define INITIALIZED_RGINSTANCE ( reinterpret_cast< RgInstance >( 1024 ) )
+#define INITIALIZED_RGINSTANCE ( reinterpret_cast< RgInstance >( (RgInstance)1024 ) )
-RgInstance g_deviceRgInstance{ nullptr };
+RgInstance g_deviceRgInstance{ (RgInstance)nullptr };
std::unique_ptr< RTGL1::VulkanDevice > g_device{};
RTGL1::VulkanDevice* TryGetDevice( RgInstance rgInstance )
@@ -63,7 +63,7 @@ RgMessageSeverityFlags g_printSeverity{ 0 };
RgResult rgCreateInstance( const RgInstanceCreateInfo* pInfo, RgInstance* pResult )
{
- *pResult = nullptr;
+ *pResult = (RgInstance)nullptr;
if( TryGetDevice( g_deviceRgInstance ) )
{
@@ -130,7 +130,7 @@ RgResult rgDestroyInstance( RgInstance rgInstance )
try
{
g_device.reset();
- g_deviceRgInstance = nullptr;
+ g_deviceRgInstance = (RgInstance)nullptr;
}
catch( RTGL1::RgException& e )
{
Oof, sorry, but ray tracing doesn't work in 32-bit :(
are you sure? it didn't even compile in 32bit without the patch... I get the menu to display now, but when I try to launch New Game, the whole system locks up... is there some way to load a specific (ideally small) map directly from cmdline?
There's no support for 32-bit applications on the driver side for technical reasons, I assume. That is why applications need to be translated to 64-bit :(
sounds like a windows-only problem, and this issue is specifically about Linux
well, maybe for Nvidia proprietary drivers it would be an issue on Linux as well, but not for Mesa
Kind of a shame, wanted to try out some HL1 raytraced. Arch Linux, RTX 2080.
Forced CLANG for the build. (Tried to) build with:
cmake -DRG_WITH_NVIDIA_DLSS=OFF -DRG_WITH_SURFACE_WAYLAND=ON -DRG_WITH_SURFACE_XCB=OFF -DRG_WITH_SURFACE_XLIB=OFF -DRG_WITH_SURFACE_WIN32=OFF ..
Getting errors like:And some files reference, which doesn't actually seem to be a valid header (even on clang 15, where it should apparently exist).
Also, is the build 32-bit as that might explain some of these issues.