Skip to content

Commit

Permalink
Fix for Jetson
Browse files Browse the repository at this point in the history
  • Loading branch information
shg8 committed Apr 10, 2024
1 parent 3dfa8f7 commit fe59044
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 9,312 deletions.
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ cmake_minimum_required(VERSION 3.26)
add_subdirectory(viewer)
add_subdirectory(vr_viewer)
add_subdirectory(apple)
add_subdirectory(common)
add_subdirectory(common)
9,306 changes: 0 additions & 9,306 deletions apps/common/third_party/vk_enum_string_helper.h

This file was deleted.

2 changes: 1 addition & 1 deletion apps/vr_viewer/src/oxr/Layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "Utils.h"
#include "spdlog/spdlog.h"
#include "vk_enum_string_helper.h"
#include <vulkan/vk_enum_string_helper.h>

namespace OXR {
Layer::Layer(std::shared_ptr<OXRContext> context, XrCompositionLayerFlags flags, bool depth_enabled) : depthEnabled(
Expand Down
1 change: 1 addition & 0 deletions apps/vr_viewer/src/oxr/Layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <cstdint>
#include <memory>
#include <vector>
#include <optional>

#include "OXRContext.h"
#include <openxr/openxr_platform.h>
Expand Down
4 changes: 4 additions & 0 deletions src/3dgs.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "3dgs.h"
#include "Renderer.h"
#ifdef VKGS_ENABLE_OPENXR
#include "vulkan/targets/OpenXRStereo.h"
#endif

#ifdef VKGS_ENABLE_GLFW
#include "vulkan/targets/GLFWWindow.h"
Expand All @@ -25,10 +27,12 @@ std::shared_ptr<RenderTarget> VulkanSplatting::createMetalWindow(void *caMetalLa
}
#endif

#ifdef VKGS_ENABLE_OPENXR
std::shared_ptr<RenderTarget> VulkanSplatting::createOpenXRRenderTarget(OpenXRConfiguration configuration) {
auto target = std::make_shared<OpenXRStereo>(configuration);
return target;
}
#endif

void VulkanSplatting::start() {
// Create the renderer
Expand Down
4 changes: 4 additions & 0 deletions src/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#include <spdlog/spdlog.h>

#include "vulkan/targets/ManagedSwapchain.h"
#ifdef VKGS_ENABLE_OPENXR
#include "vulkan/targets/OpenXRStereo.h"
#endif

void Renderer::initialize() {
initializeCsvWriter();
Expand Down Expand Up @@ -168,11 +170,13 @@ void Renderer::initializeVulkan() {
renderFinishedSemaphores[i] = context->device->createSemaphoreUnique(vk::SemaphoreCreateInfo());
}

#ifdef VKGS_ENABLE_OPENXR
if (auto openXRBackend = std::dynamic_pointer_cast<OpenXRStereo>(renderTarget)) {
openXRBackend->postVulkanInit(context->instance.get(), context->physicalDevice, context->device.get(),
context->queues[VulkanContext::Queue::GRAPHICS].queueFamily,
context->queues[VulkanContext::Queue::GRAPHICS].queueIndex);
}
#endif
}

void Renderer::loadSceneToGPU() {
Expand Down
4 changes: 2 additions & 2 deletions src/vulkan/ImguiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ void ImguiManager::init() {
init_info.ImageCount = window->imageCount + 1;
init_info.UseDynamicRendering = true;
init_info.MSAASamples = VK_SAMPLE_COUNT_1_BIT;
init_info.PipelineRenderingCreateInfo = vk::PipelineRenderingCreateInfo{
init_info.PipelineRenderingCreateInfo = static_cast<VkPipelineRenderingCreateInfoKHR>(vk::PipelineRenderingCreateInfoKHR {
{}, 1, &window->swapchainFormat
};
});

ImGui_ImplVulkan_Init(&init_info);

Expand Down
2 changes: 1 addition & 1 deletion src/vulkan/VulkanContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ VulkanContext::VulkanContext(const std::vector<std::string>& instance_extensions
}

#ifndef VKGS_ENABLE_METAL
VULKAN_HPP_DEFAULT_DISPATCHER.init();
VULKAN_HPP_DEFAULT_DISPATCHER.init(&vkGetInstanceProcAddr);
#else
void *libvulkan = dlopen("MoltenVK.framework/MoltenVK", RTLD_NOW | RTLD_LOCAL);
if (!libvulkan) {
Expand Down
2 changes: 1 addition & 1 deletion src/vulkan/targets/ManagedSwapchain.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ManagedSwapchain.h"

#include <vk_enum_string_helper.h>
#include <vulkan/vk_enum_string_helper.h>
#include <spdlog/spdlog.h>

ManagedSwapchain::ManagedSwapchain(bool immediate) : immediate(immediate){
Expand Down

0 comments on commit fe59044

Please sign in to comment.