Skip to content

Commit

Permalink
fix(mods::swapchain): fix swapchain compatibility mode detection
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Dec 31, 2024
1 parent cbf7095 commit b331b1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mods/swapchain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ static bool UsingSwapchainProxy() {
return !swap_chain_proxy_pixel_shader.empty();
}

static bool UsingSwapchainCompatibilityMode() {
return swapchain_proxy_compatibility_mode && (target_format == swap_chain_proxy_format);
}

static void CheckSwapchainSize(
reshade::api::swapchain* swapchain,
reshade::api::resource_desc buffer_desc) {
Expand Down Expand Up @@ -563,7 +567,7 @@ static void SetupSwapchainProxy(
swap_chain_proxy_upgrade_target.view_upgrades = swap_chain_proxy_upgrade_target.VIEW_UPGRADES_R10G10B10A2_UNORM;
}
auto buffer = swapchain->get_back_buffer(index);
if (!swapchain_proxy_compatibility_mode) {
if (!UsingSwapchainCompatibilityMode()) {
{
std::stringstream s;
s << "mods::swapchain::SetupSwapchainProxy(Marking swapchain buffer for cloning: ";
Expand Down Expand Up @@ -827,7 +831,7 @@ static void DrawSwapChainProxy(reshade::api::swapchain* swapchain, reshade::api:

reshade::api::resource swapchain_clone;

if (swapchain_proxy_compatibility_mode) {
if (UsingSwapchainCompatibilityMode()) {
auto& handle = data.resource_clones[current_back_buffer.handle];
if (handle == 0) {
handle = CloneResource(device, &data, current_back_buffer).handle;
Expand Down

0 comments on commit b331b1a

Please sign in to comment.