Skip to content

Commit

Permalink
3rdParty: pain to rt64
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed May 27, 2024
1 parent 33d93e2 commit 38a1d3e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
10 changes: 10 additions & 0 deletions Source/3rdParty/rt64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,16 @@ if (RT64_BUILD_PLUGIN)
"${PROJECT_SOURCE_DIR}/src/api/rt64_api_common.cpp"
"${PROJECT_SOURCE_DIR}/src/api/rt64_api_plugin.cpp"
)
if (WIN32)
target_sources(rt64 PRIVATE
"${PROJECT_SOURCE_DIR}/src/contrib/imgui/backends/imgui_impl_win32.cpp"
)
target_link_libraries(rt64
delayimp.lib
Shcore.lib
Dwmapi.lib
)
endif()
endif(RT64_BUILD_PLUGIN)

target_link_directories(rt64 PRIVATE ${PROJECT_SOURCE_DIR}/src/contrib/dxc)
Expand Down
2 changes: 1 addition & 1 deletion Source/3rdParty/rt64/examples/rhi_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace RT64 {
int main(int argc, char** argv) {
std::unique_ptr<RT64::RenderInterface> renderInterface = RT64::CreateVulkanInterface();

#ifdef _WIN32
#if defined(_WIN32)
// Windows only: Can also use D3D12.
const bool useVulkan = true;
if (!useVulkan) {
Expand Down
8 changes: 4 additions & 4 deletions Source/3rdParty/rt64/src/gui/rt64_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace RT64 {

switch (graphicsAPI) {
case UserConfiguration::GraphicsAPI::D3D12: {
# ifdef _WIN32
# ifdef _WIN32 && !defined(RT64_BUILD_PLUGIN)
D3D12Device *interfaceDevice = static_cast<D3D12Device *>(device);
RenderDescriptorRange descriptorRange(RenderDescriptorRangeType::TEXTURE, 0, 1);
descriptorSet = interfaceDevice->createDescriptorSet(RenderDescriptorSetDesc(&descriptorRange, 1));
Expand Down Expand Up @@ -136,7 +136,7 @@ namespace RT64 {
Inspector::~Inspector() {
switch (graphicsAPI) {
case UserConfiguration::GraphicsAPI::D3D12: {
# ifdef _WIN32
# if defined(_WIN32) && !defined(RT64_BUILD_PLUGIN)
ImGui_ImplDX12_Shutdown();
# else
assert(false && "Unsupported Graphics API.");
Expand Down Expand Up @@ -182,7 +182,7 @@ namespace RT64 {

switch (graphicsAPI) {
case UserConfiguration::GraphicsAPI::D3D12: {
# ifdef _WIN32
# if defined(_WIN32) && !defined(RT64_BUILD_PLUGIN)
ImGui_ImplDX12_NewFrame();
# else
assert(false && "Unsupported Graphics API.");
Expand Down Expand Up @@ -214,7 +214,7 @@ namespace RT64 {
if (drawData != nullptr) {
switch (graphicsAPI) {
case UserConfiguration::GraphicsAPI::D3D12: {
# ifdef _WIN32
# if defined(_WIN32) && !defined(RT64_BUILD_PLUGIN)
D3D12CommandList *interfaceCommandList = static_cast<D3D12CommandList *>(commandList);
interfaceCommandList->checkDescriptorHeaps();
ImGui_ImplDX12_RenderDrawData(drawData, interfaceCommandList->d3d);
Expand Down
2 changes: 1 addition & 1 deletion Source/3rdParty/rt64/src/hle/rt64_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace RT64 {
// Create a render interface with the preferred backend.
switch (userConfig.graphicsAPI) {
case UserConfiguration::GraphicsAPI::D3D12:
# ifdef _WIN64
# if defined(_WIN64) && !defined(RT64_BUILD_PLUGIN)
renderInterface = CreateD3D12Interface();
break;
# else
Expand Down
4 changes: 2 additions & 2 deletions Source/3rdParty/rt64/src/render/rt64_raster_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace RT64 {
specConstants.emplace_back(4, desc.flags.value);
}
else {
# if defined(_WIN32)
# if defined(_WIN32) && !defined(RT64_BUILD_PLUGIN) // TODO.....
if (useBytes) {
vertexShader = device->createShader(vsBytes->data(), vsBytes->size(), "VSMain", shaderFormat);
pixelShader = device->createShader(psBytes->data(), psBytes->size(), "PSMain", shaderFormat);
Expand Down Expand Up @@ -378,7 +378,7 @@ namespace RT64 {
uint32_t PSBlobSize = 0;
const bool useMSAA = (multisampling.sampleCount > 1);
switch (shaderFormat) {
# ifdef _WIN32
# if defined(_WIN32) && !defined(RT64_BUILD_PLUGIN)
case RenderShaderFormat::DXIL:
VSBlob = RasterVSDynamicBlobDXIL;
PSBlob = useMSAA ? RasterPSDynamicMSBlobDXIL : RasterPSDynamicBlobDXIL;
Expand Down

0 comments on commit 38a1d3e

Please sign in to comment.