mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 06:35:39 +00:00
Merge pull request #10222 from phire/fix-copy-filter-clamping
Fix copy filter clamping
This commit is contained in:
commit
dbaebdc585
@ -593,8 +593,8 @@ void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const MathUtil::Rectangle<int>
|
||||
// In our implementation, the garbage just so happens to be the top or bottom row.
|
||||
// Statistically, that could happen.
|
||||
const u16 y_prev = static_cast<u16>(std::max(clamp_top ? source_rect.top : 0, y - 1));
|
||||
const u16 y_next =
|
||||
static_cast<u16>(std::min<int>(clamp_bottom ? source_rect.bottom : EFB_HEIGHT, y + 1));
|
||||
const u16 y_next = static_cast<u16>(
|
||||
std::min<int>((clamp_bottom ? source_rect.bottom : EFB_HEIGHT) - 1, y + 1));
|
||||
|
||||
// Get a scanline of YUV pixels in 4:4:4 format
|
||||
for (int i = 1, x = left; x < right; i++, x++)
|
||||
|
@ -2696,7 +2696,8 @@ void TextureCacheBase::CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_cop
|
||||
uniforms.filter_coefficients[2] = filter_coefficients.lower;
|
||||
uniforms.gamma_rcp = 1.0f / gamma;
|
||||
uniforms.clamp_top = clamp_top ? framebuffer_rect.top * rcp_efb_height : 0.0f;
|
||||
uniforms.clamp_bottom = clamp_bottom ? framebuffer_rect.bottom * rcp_efb_height : 1.0f;
|
||||
int bottom_coord = framebuffer_rect.bottom - 1;
|
||||
uniforms.clamp_bottom = clamp_bottom ? bottom_coord * rcp_efb_height : 1.0f;
|
||||
uniforms.pixel_height = g_ActiveConfig.bCopyEFBScaled ? rcp_efb_height : 1.0f / EFB_HEIGHT;
|
||||
uniforms.padding = 0;
|
||||
g_vertex_manager->UploadUtilityUniforms(&uniforms, sizeof(uniforms));
|
||||
@ -2761,7 +2762,8 @@ void TextureCacheBase::CopyEFB(AbstractStagingTexture* dst, const EFBCopyParams&
|
||||
encoder_params.y_scale = y_scale;
|
||||
encoder_params.gamma_rcp = 1.0f / gamma;
|
||||
encoder_params.clamp_top = clamp_top ? framebuffer_rect.top * rcp_efb_height : 0.0f;
|
||||
encoder_params.clamp_bottom = clamp_bottom ? framebuffer_rect.bottom * rcp_efb_height : 1.0f;
|
||||
int bottom_coord = framebuffer_rect.bottom - 1;
|
||||
encoder_params.clamp_bottom = clamp_bottom ? bottom_coord * rcp_efb_height : 1.0f;
|
||||
encoder_params.filter_coefficients[0] = filter_coefficients.upper;
|
||||
encoder_params.filter_coefficients[1] = filter_coefficients.middle;
|
||||
encoder_params.filter_coefficients[2] = filter_coefficients.lower;
|
||||
|
Loading…
x
Reference in New Issue
Block a user