Skip to content

Commit

Permalink
feat(mods::swapchain): create swapchain proxy pipeline on-the-fly
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Dec 9, 2024
1 parent 08452d5 commit 77a39a2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/mods/swapchain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2321,9 +2321,20 @@ static void OnPresent(
s << ", layout: " << reinterpret_cast<void*>(data.swapchain_proxy_layout.handle);

if (data.swapchain_proxy_pipeline.handle == 0) {
reshade::log::message(reshade::log::level::warning, "No pipeline handle.");
cmd_list->copy_resource(swapchain_clone, current_back_buffer);
return;
reshade::log::message(reshade::log::level::warning, "No pipeline handle. Creating...");
data.swapchain_proxy_pipeline = renodx::utils::pipeline::CreateRenderPipeline(
device,
data.swapchain_proxy_layout,
{
{reshade::api::pipeline_subobject_type::vertex_shader, swapchain_proxy_vertex_shader},
{reshade::api::pipeline_subobject_type::pixel_shader, swapchain_proxy_pixel_shader},
},
target_format);
if (data.swapchain_proxy_pipeline == 0u) {
reshade::log::message(reshade::log::level::error, "No pipeline handle. Creating failed.");
cmd_list->copy_resource(swapchain_clone, current_back_buffer);
return;
}
}
s << ", pipeline: " << reinterpret_cast<void*>(data.swapchain_proxy_pipeline.handle);

Expand Down

0 comments on commit 77a39a2

Please sign in to comment.