Skip to content

Commit

Permalink
Added initial support for SDL3 in CMakeLists.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismile committed Jan 23, 2025
1 parent 9f795ff commit c8dabf7
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 18 deletions.
22 changes: 13 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ if ((UNIX OR MSYS OR MINGW) AND (NOT APPLE OR NOT VCPKG_TOOLCHAIN))
endif()

set(FPHSA_NAME_MISMATCHED TRUE)
if(VCPKG_TOOLCHAIN)
find_package(SDL2 CONFIG REQUIRED)
else()
find_package(SDL2 REQUIRED)
endif()

find_package(sgl QUIET)
if(NOT sgl_FOUND)
Expand Down Expand Up @@ -522,10 +517,19 @@ if(MSYS OR MINGW OR (${CMAKE_GENERATOR} STREQUAL "MinGW Makefiles") OR (${CMAKE_
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows")
target_link_libraries(CloudRendering PUBLIC mingw32)
endif()
if(VCPKG_TOOLCHAIN)
target_link_libraries(CloudRendering PUBLIC SDL2::SDL2main)
else()
target_link_libraries(CloudRendering PUBLIC SDL2::Main)
if ("SUPPORT_SDL2" IN_LIST SGL_INTERFACE_COMPILE_DEFINITIONS)
if (VCPKG_TOOLCHAIN)
target_link_libraries(CloudRendering PUBLIC SDL2::SDL2main)
else()
target_link_libraries(CloudRendering PUBLIC SDL2::Main)
endif()
endif()
if ("SUPPORT_SDL3" IN_LIST SGL_INTERFACE_COMPILE_DEFINITIONS)
if(TARGET SDL3::SDL3-static)
target_link_libraries(CloudRendering PRIVATE SDL3::SDL3-static)
else()
target_link_libraries(CloudRendering PRIVATE SDL3::SDL3)
endif()
endif()

# sgl provides Vulkan headers in its interface, which are provided if Vulkan was not found during its build.
Expand Down
32 changes: 30 additions & 2 deletions docs/license-libraries/graphics/LICENSE-sgl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ https://github.com/aiekick/ImGuiFileDialog

MIT License

Copyright (c) 2018-2023 Stephane Cuillerdier (aka Aiekick)
Copyright (c) 2019-2024 Stephane Cuillerdier (aka aiekick)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -781,7 +781,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

----------------------------------------------------------------------------

The following license applies to src/Graphics/WebGPU/libs/{sdl2,glfw3}webgpu.{h,c}.
The following license applies to src/Graphics/WebGPU/libs/{sdl2,sdl3,glfw3}webgpu.{h,c}.

MIT License
Copyright (c) 2022-2024 Elie Michel
Expand Down Expand Up @@ -847,3 +847,31 @@ This software uses code from:
Modifications made by Matias N. Goldberg to adapt it as a compute shader
* ETC2 P very loosely based on [etc2_encoder](https://github.com/titilambert/packaging-efl/blob/master/src/static_libs/rg_etc/etc2_encoder.c),
Copyright (C) 2014 Jean-Philippe ANDRE, 2-clause BSD license. Considerable rewrite by Matias N. Goldberg to enhance its quality.SOFTWARE.


----------------------------------------------------------------------------

The following license applies to code in src/Graphics/Vulkan/libs/level-zero/*
obtained from the oneAPI Level Zero repository (https://github.com/oneapi-src/level-zero).

MIT License

Copyright (C) 2019-2021 Intel Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion src/MainApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ void MainApp::renderGui() {
}

if (useDockSpaceMode) {
ImGuiID dockSpaceId = ImGui::DockSpaceOverViewport(ImGui::GetMainViewport());
ImGuiID dockSpaceId = ImGui::DockSpaceOverViewport(0, ImGui::GetMainViewport());
ImGuiDockNode* centralNode = ImGui::DockBuilderGetNode(dockSpaceId);
static bool isProgramStartup = true;
if (isProgramStartup && centralNode->IsEmpty()) {
Expand Down
12 changes: 6 additions & 6 deletions src/PyTorch/VolumetricPathTracingModuleRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
#endif
#endif

#ifdef SUPPORT_HIP_INTEROP
#if __has_include(<c10/hip/HIPStream.h>)
#define PYTORCH_HIP_AVAILABLE
#include <c10/hip/HIPStream.h>
#endif
#endif
//#ifdef SUPPORT_HIP_INTEROP
//#if __has_include(<c10/hip/HIPStream.h>)
//#define PYTORCH_HIP_AVAILABLE
//#include <c10/hip/HIPStream.h>
//#endif
//#endif

#ifdef SUPPORT_OPTIX
#include "Denoiser/OptixVptDenoiser.hpp"
Expand Down

0 comments on commit c8dabf7

Please sign in to comment.