Skip to content

Commit

Permalink
VRenderPath_Psx: tweak output blit area for classic render path.
Browse files Browse the repository at this point in the history
Round up to the next pixel size if dealing fractional pixel output areas. This makes the behavior consistent with the SDL/software-only video backend. Also addresses #102.
  • Loading branch information
BodbDearg committed Sep 24, 2024
1 parent a859730 commit 086e572
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions game/PsyDoom/Vulkan/VRenderPath_Psx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "VRenderer.h"

#include <algorithm>
#include <cmath>

//------------------------------------------------------------------------------------------------------------------------------------------
// Sets the render path to a default uninitialized state
Expand Down Expand Up @@ -219,8 +220,8 @@ void VRenderPath_Psx::endFrame(vgl::Swapchain& swapchain, vgl::CmdBufferRecorder
blitRegion.srcOffsets[1].z = 1;
blitRegion.dstOffsets[0].x = std::clamp<int32_t>((int32_t) blitDstX, 0, screenWidth);
blitRegion.dstOffsets[0].y = std::clamp<int32_t>((int32_t) blitDstY, 0, screenHeight);
blitRegion.dstOffsets[1].x = std::clamp<int32_t>((int32_t)(blitDstX + blitDstW), 0, screenWidth);
blitRegion.dstOffsets[1].y = std::clamp<int32_t>((int32_t)(blitDstY + blitDstH), 0, screenHeight);
blitRegion.dstOffsets[1].x = std::clamp<int32_t>((int32_t)(blitDstX + std::ceil(blitDstW)), 0, screenWidth);
blitRegion.dstOffsets[1].y = std::clamp<int32_t>((int32_t)(blitDstY + std::ceil(blitDstH)), 0, screenHeight);
blitRegion.dstOffsets[1].z = 1;

cmdRec.blitImage(
Expand Down

0 comments on commit 086e572

Please sign in to comment.