Fix compilation with latest plume.

This commit is contained in:
Dario 2025-03-12 22:31:21 -03:00
parent 4413921aa3
commit f0d9f83e3c
7 changed files with 30 additions and 25 deletions

View File

@ -413,7 +413,6 @@ include_directories(
"${PROJECT_SOURCE_DIR}/src/contrib/plume"
"${PROJECT_SOURCE_DIR}/src/contrib/volk"
"${PROJECT_SOURCE_DIR}/src/contrib/D3D12MemoryAllocator/include"
"${PROJECT_SOURCE_DIR}/src/contrib/D3D12MemoryAllocator/src"
"${PROJECT_SOURCE_DIR}/src/contrib/imgui"
"${PROJECT_SOURCE_DIR}/src/contrib/hlslpp/include"
"${PROJECT_SOURCE_DIR}/src/contrib/Vulkan-Headers/include"
@ -464,6 +463,7 @@ if (WIN32)
"${PROJECT_SOURCE_DIR}/src/contrib/plume/plume_d3d12.cpp"
"${PROJECT_SOURCE_DIR}/src/contrib/imgui/backends/imgui_impl_dx12.cpp"
"${PROJECT_SOURCE_DIR}/src/contrib/imgui/backends/imgui_impl_win32.cpp"
"${PROJECT_SOURCE_DIR}/src/contrib/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp"
)
target_link_libraries(rt64
delayimp.lib
@ -553,7 +553,7 @@ build_pixel_shader( rt64 "src/shaders/PostProcessPS.hlsl")
target_include_directories(rt64 PRIVATE ${CMAKE_BINARY_DIR}/src)
if (RT64_BUILD_EXAMPLES)
add_executable(rhi_test "examples/rt64_render_interface.cpp" "examples/rhi_test.cpp")
add_executable(rhi_test "examples/plume_render_interface.cpp" "examples/rhi_test.cpp")
target_link_libraries(rhi_test rt64)
build_pixel_shader( rhi_test "examples/shaders/RenderInterfaceTestSpecPS.hlsl")

View File

@ -1,8 +1,8 @@
//
// RT64
// plume
//
#include "rhi/rt64_render_interface.h"
#include "plume_render_interface.h"
#include <cassert>
#include <cstring>
@ -53,7 +53,7 @@
#include "shaders/RenderInterfaceTestSpecPS.hlsl.metal.h"
#endif
namespace RT64 {
namespace plume {
static const uint32_t BufferCount = 2;
static const RenderFormat SwapchainFormat = RenderFormat::B8G8R8A8_UNORM;
static const uint32_t MSAACount = 4;
@ -365,7 +365,7 @@ namespace RT64 {
break;
case ShaderType::TEXTURE_BINDFUL_PIXEL:
data.blob = RenderInterfaceTestTextureBindfulPSBlobDXIL;
data.size = sizeof(RenderInterfaceTestTextureindfulPSBlobDXIL);
data.size = sizeof(RenderInterfaceTestTextureBindfulPSBlobDXIL);
break;
case ShaderType::TEXTURE_BINDLESS_PIXEL:
data.blob = RenderInterfaceTestTextureBindlessPSBlobDXIL;
@ -505,11 +505,11 @@ namespace RT64 {
ctx.window = window;
ctx.device = renderInterface->createDevice();
ctx.commandQueue = ctx.device->createCommandQueue(RenderCommandListType::DIRECT);
ctx.commandList = ctx.commandQueue->createCommandList(RenderCommandListType::DIRECT);
ctx.commandList = ctx.commandQueue->createCommandList();
ctx.acquireSemaphore = ctx.device->createCommandSemaphore();
ctx.drawSemaphore = ctx.device->createCommandSemaphore();
ctx.commandFence = ctx.device->createCommandFence();
ctx.swapChain = ctx.commandQueue->createSwapChain(window, BufferCount, SwapchainFormat);
ctx.swapChain = ctx.commandQueue->createSwapChain(window, BufferCount, SwapchainFormat, 2);
ctx.linearSampler = ctx.device->createSampler(RenderSamplerDesc());
}
@ -1293,7 +1293,7 @@ namespace RT64 {
void initialize(TestContext &ctx) override {
device = ctx.device.get();
asyncCommandQueue = ctx.device->createCommandQueue(RenderCommandListType::COMPUTE);
asyncCommandList = asyncCommandQueue->createCommandList(RenderCommandListType::COMPUTE);
asyncCommandList = asyncCommandQueue->createCommandList();
asyncCommandFence = ctx.device->createCommandFence();
// Update descriptor set builder to include two structured buffer views

View File

@ -1,33 +1,33 @@
#include "rhi/rt64_render_interface.h"
#include "plume_render_interface.h"
namespace RT64 {
namespace plume {
extern std::unique_ptr<RenderInterface> CreateD3D12Interface();
extern std::unique_ptr<RenderInterface> CreateVulkanInterface();
extern std::unique_ptr<RenderInterface> CreateMetalInterface();
}
std::unique_ptr<RT64::RenderInterface> CreateRenderInterface() {
std::unique_ptr<plume::RenderInterface> CreateRenderInterface() {
#if defined(_WIN32)
const bool useVulkan = true; // Or derive this from configuration or runtime check.
const bool useVulkan = false; // Or derive this from configuration or runtime check.
if (!useVulkan) {
return RT64::CreateD3D12Interface();
return plume::CreateD3D12Interface();
}
// Fallback to Vulkan if D3D12 is not chosen or available.
return RT64::CreateVulkanInterface();
return plume::CreateVulkanInterface();
#elif defined(__APPLE__)
const bool useMVK = false; // Or derive this from configuration or runtime check.
if (useMVK) {
return RT64::CreateVulkanInterface();
return plume::CreateVulkanInterface();
}
return RT64::CreateMetalInterface();
return plume::CreateMetalInterface();
#else
return RT64::CreateVulkanInterface();
return plume::CreateVulkanInterface();
#endif
}
int main(int argc, char** argv) {
auto renderInterface = CreateRenderInterface();
// Execute a blocking test that creates a window and draws some geometry to test the render interface.
RT64::RenderInterfaceTest(renderInterface.get());
plume::RenderInterfaceTest(renderInterface.get());
}

View File

@ -1,3 +1,6 @@
//
// RT64
//
[[vk::constant_id(0)]] const uint useRed = 0;

@ -1 +1 @@
Subproject commit 7c89c8084382d9aec21e0f3dea4828055dfdaba4
Subproject commit 20368b866423d0b48a505fa3e4b770b05d08fe9d

View File

@ -25,7 +25,7 @@
#endif
#if defined(_WIN32)
# include "d3d12/rt64_d3d12.h"
# include "plume_d3d12.h"
#endif
static std::string IniFilenameUTF8;
@ -95,9 +95,9 @@ namespace RT64 {
D3D12DescriptorSet *interfaceDescriptorSet = static_cast<D3D12DescriptorSet *>(descriptorSet.get());
const D3D12SwapChain *interfaceSwapChain = static_cast<const D3D12SwapChain *>(swapChain);
const D3D12_CPU_DESCRIPTOR_HANDLE cpuHandle = interfaceDevice->viewHeapAllocator->getShaderCPUHandleAt(interfaceDescriptorSet->viewAllocation.offset);
const D3D12_GPU_DESCRIPTOR_HANDLE gpuHandle = interfaceDevice->viewHeapAllocator->getShaderGPUHandleAt(interfaceDescriptorSet->viewAllocation.offset);
ImGui_ImplDX12_Init(interfaceDevice->d3d, 2, interfaceSwapChain->nativeFormat, interfaceDevice->viewHeapAllocator->shaderHeap, cpuHandle, gpuHandle);
const D3D12_CPU_DESCRIPTOR_HANDLE cpuHandle = interfaceDevice->viewHeapAllocator->getCPUHandleAt(interfaceDescriptorSet->viewAllocation.offset);
const D3D12_GPU_DESCRIPTOR_HANDLE gpuHandle = interfaceDevice->viewHeapAllocator->getGPUHandleAt(interfaceDescriptorSet->viewAllocation.offset);
ImGui_ImplDX12_Init(interfaceDevice->d3d, 2, interfaceSwapChain->nativeFormat, interfaceDevice->viewHeapAllocator->heap, cpuHandle, gpuHandle);
# else
assert(false && "Unsupported Graphics API.");
return;

View File

@ -11,7 +11,9 @@
#include <string>
#include "rhi/rt64_render_interface.h"
#include "plume_render_interface.h"
using namespace plume;
namespace RT64 {
struct ShaderCompiler {