Rename the RHI.

This commit is contained in:
Skyth 2024-11-30 18:03:30 +03:00
parent 63b8a1e130
commit 1a53a3b463
11 changed files with 70 additions and 28 deletions

View file

@ -51,8 +51,8 @@ set(SWA_CPU_CXX_SOURCES
set(SWA_GPU_CXX_SOURCES
"gpu/video.cpp"
"gpu/imgui_snapshot.cpp"
"gpu/rhi/rt64_d3d12.cpp"
"gpu/rhi/rt64_vulkan.cpp"
"gpu/rhi/plume_d3d12.cpp"
"gpu/rhi/plume_vulkan.cpp"
)
set(SWA_APU_CXX_SOURCES

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 renderbag and contributors
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.

View file

@ -1,8 +1,11 @@
//
// RT64
// plume
//
// Copyright (c) 2024 renderbag and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file for details.
//
#include "rt64_d3d12.h"
#include "plume_d3d12.h"
#include <unordered_set>
@ -34,7 +37,7 @@ extern "C" {
__declspec(dllexport) extern const char* D3D12SDKPath = ".\\D3D12\\";
}
namespace RT64 {
namespace plume {
static const uint32_t ShaderDescriptorHeapSize = 65536;
static const uint32_t SamplerDescriptorHeapSize = 1024;
static const uint32_t TargetDescriptorHeapSize = 16384;

View file

@ -1,10 +1,13 @@
//
// RT64
// plume
//
// Copyright (c) 2024 renderbag and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file for details.
//
#pragma once
#include "rt64_render_interface.h"
#include "plume_render_interface.h"
#include <map>
#include <mutex>
@ -15,7 +18,7 @@
#include "D3D12MemAlloc.h"
namespace RT64 {
namespace plume {
struct D3D12Buffer;
struct D3D12CommandQueue;
struct D3D12Device;

View file

@ -1,14 +1,17 @@
//
// RT64
// plume
//
// Copyright (c) 2024 renderbag and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file for details.
//
#pragma once
#include <climits>
#include "rt64_render_interface_types.h"
#include "plume_render_interface_types.h"
namespace RT64 {
namespace plume {
// Interfaces.
struct RenderBufferFormattedView {
@ -243,4 +246,4 @@ namespace RT64 {
extern void TestShutdown();
};
#include "rt64_render_interface_builders.h"
#include "plume_render_interface_builders.h"

View file

@ -1,12 +1,15 @@
//
// RT64
// plume
//
// Copyright (c) 2024 renderbag and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file for details.
//
#pragma once
#include <unordered_set>
namespace RT64 {
namespace plume {
struct RenderDescriptorSetBuilder {
std::list<std::vector<const RenderSampler *>> samplerPointerVectorList;
std::vector<RenderDescriptorRange> descriptorRanges;

View file

@ -1,5 +1,8 @@
//
// RT64
// plume
//
// Copyright (c) 2024 renderbag and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file for details.
//
#pragma once
@ -26,7 +29,7 @@
typedef struct _NSWindow NSWindow;
#endif
namespace RT64 {
namespace plume {
#if defined(_WIN64)
// Native HWND handle to the target window.
typedef HWND RenderWindow;

View file

@ -1,11 +1,14 @@
//
// RT64
// plume
//
// Copyright (c) 2024 renderbag and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file for details.
//
#define VMA_IMPLEMENTATION
#define VOLK_IMPLEMENTATION
#include "rt64_vulkan.h"
#include "plume_vulkan.h"
#include <algorithm>
#include <cmath>
@ -13,7 +16,7 @@
#include <unordered_map>
#if DLSS_ENABLED
# include "render/rt64_dlss.h"
# include "render/plume_dlss.h"
#endif
#ifndef NDEBUG
@ -24,7 +27,7 @@
// TODO:
// - Fix resource pools.
namespace RT64 {
namespace plume {
// Backend constants.
// Required buffer alignment for acceleration structures.
@ -4063,9 +4066,9 @@ namespace RT64 {
}
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
appInfo.pApplicationName = "RT64";
appInfo.pApplicationName = "plume";
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
appInfo.pEngineName = "RT64";
appInfo.pEngineName = "plume";
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
appInfo.apiVersion = VK_API_VERSION_1_2;

View file

@ -1,10 +1,13 @@
//
// RT64
// plume
//
// Copyright (c) 2024 renderbag and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file for details.
//
#pragma once
#include "rt64_render_interface.h"
#include "plume_render_interface.h"
#include <mutex>
#include <set>
@ -23,7 +26,7 @@
#include "vk_mem_alloc.h"
namespace RT64 {
namespace plume {
struct VulkanCommandQueue;
struct VulkanDevice;
struct VulkanInterface;

View file

@ -46,7 +46,7 @@ extern "C"
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
namespace RT64
namespace plume
{
extern std::unique_ptr<RenderInterface> CreateD3D12Interface();
extern std::unique_ptr<RenderInterface> CreateVulkanInterface();

View file

@ -3,12 +3,12 @@
//#define ASYNC_PSO_DEBUG
#define PSO_CACHING
#include "rhi/rt64_render_interface.h"
#include "rhi/plume_render_interface.h"
#define D3DCLEAR_TARGET 0x1
#define D3DCLEAR_ZBUFFER 0x10
using namespace RT64;
using namespace plume;
struct GuestSamplerState
{