dolphin/Source/Core/VideoCommon
Scott Mansell 7128befb39 Fix copy filter clamping regression in Spyro
This fixes horizontal lines in the bloom effect of Spyro: A Hero's Tail,
which is a regression caused by PR #10204

Screenshot of regression:
https://user-images.githubusercontent.com/138484/142030503-90fcd8d5-63d3-4820-874a-72e9be0c4768.png

Fixed:
https://user-images.githubusercontent.com/138484/142031598-b85ff55c-1302-4e4d-bcb2-57848974056b.png

Spyro uses an 640x80 pixel sub-buffer within the EFB to calculate
it's bloom effects, which it places below the main 640x448 buffer.

EFB layout:
https://user-images.githubusercontent.com/138484/142030573-e933b6ae-c37e-4be6-86d4-0bc779b92535.png
Note: Colors are wrong because the main color buffer uses RGBA6,
      while the bloom is calculated in RGB8

This allows it to do bloom without backing up part of the EFB to
main memory, as most games do.

But, since some of the sub-buffers used in the bloom effect are taller
than 80 pixels, they need to be sliced up into smaller sub, sub buffers
which get combined later when copied to main memory.

At one point, a 320x224 buffer is broken up into 320x80, 320x64 and
320x80 slices. These are copied out with the copy filter set to a
vertical blur.

Because there was an off-by-one errror in the clamping coordinates,
the bottom line of the color buffer would be blurred into
the top of each slice.

Final combined EFB copy:
https://user-images.githubusercontent.com/138484/142031360-2c076839-7c96-4b3b-a093-d899d0a2c7ae.png

Fixed version:
https://user-images.githubusercontent.com/138484/142031370-72e41a35-3b3e-4662-a483-79203e357ecc.png

Before #10204 the copy filter wasn't enabled for efb copies, and most
other games don't do this type of slicing.

FIFO CI shows that a few other games are effected, it's always just a minor difference to the top line where there was previously a slight hint of garbage.
2021-11-17 06:12:46 +13:00
..
AbstractFramebuffer.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AbstractFramebuffer.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AbstractPipeline.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AbstractShader.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AbstractStagingTexture.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AbstractStagingTexture.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AbstractTexture.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AbstractTexture.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AsyncRequests.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AsyncRequests.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AsyncShaderCompiler.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
AsyncShaderCompiler.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
BPFunctions.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
BPFunctions.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
BPMemory.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
BPMemory.h BPMemory: Refactor/consolidate TexUnit Addressing 2021-10-10 09:09:43 +13:00
BPStructs.cpp VideoCommon: Use the copy filter for EFB copies as well as XFB copies 2021-11-11 17:22:50 -08:00
BPStructs.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
BoundingBox.cpp VideoCommon: Add missing algorithm include for std::none_of 2021-11-02 13:50:21 +01:00
BoundingBox.h VideoCommon: Abstract bounding box 2021-10-04 15:51:24 -04:00
CMakeLists.txt Extend TMEM cache implementation 2021-10-12 15:51:24 +13:00
CPMemory.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
CPMemory.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
CommandProcessor.cpp VideoCommon: Fix a -Wclass-memaccess in gcc 11 2021-11-02 13:50:21 +01:00
CommandProcessor.h VideoCommon: Fix a -Wclass-memaccess in gcc 11 2021-11-02 13:50:21 +01:00
ConstantManager.h BPMemory: Make ZTexOp enum an enum class 2021-09-01 18:23:22 -04:00
DataReader.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
DriverDetails.cpp DriverDetails: Add broken dual source blending bug to MoltenVK on Intel GPUs 2021-09-20 19:14:41 -04:00
DriverDetails.h DriverDetails: Add broken dual source blending bug to MoltenVK on Intel GPUs 2021-09-20 19:14:41 -04:00
FPSCounter.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
FPSCounter.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
Fifo.cpp VI: Implement post-scanout XFB output 2021-08-03 23:37:50 -04:00
Fifo.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
FrameDump.cpp Merge pull request #10169 from leoetlino/fmt-localtime 2021-11-07 00:08:14 -04:00
FrameDump.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
FramebufferManager.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
FramebufferManager.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
FramebufferShaderGen.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
FramebufferShaderGen.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
FreeLookCamera.cpp VideoCommon: update Free Look camera's 'FieldOfView' function to 'FieldOfViewMultiplier' to better reflect usage 2021-10-08 18:17:20 -05:00
FreeLookCamera.h VideoCommon: update Free Look camera's 'FieldOfView' function to 'FieldOfViewMultiplier' to better reflect usage 2021-10-08 18:17:20 -05:00
GXPipelineTypes.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
GeometryShaderGen.cpp GeometryShaderGen: Rename ApiType to api_type 2021-08-01 15:17:21 -07:00
GeometryShaderGen.h GeometryShaderGen: Rename ApiType to api_type 2021-08-01 15:17:21 -07:00
GeometryShaderManager.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
GeometryShaderManager.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
HiresTextures.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
HiresTextures.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
HiresTextures_DDSLoader.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
IndexGenerator.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
IndexGenerator.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
LightingShaderGen.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
LightingShaderGen.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
LookUpTables.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
NativeVertexFormat.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
NetPlayChatUI.cpp Externals: Update imgui to 1.85 2021-10-26 15:07:57 -07:00
NetPlayChatUI.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
NetPlayGolfUI.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
NetPlayGolfUI.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
OnScreenDisplay.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
OnScreenDisplay.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
OpcodeDecoding.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
OpcodeDecoding.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
PerfQueryBase.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
PerfQueryBase.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
PixelEngine.cpp VideoCommon: Abstract bounding box 2021-10-04 15:51:24 -04:00
PixelEngine.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
PixelShaderGen.cpp VideoCommon: Fix color channel logic when per-pixel lighting is in use 2021-10-13 20:43:32 -07:00
PixelShaderGen.h BPMemory: Make ZTexOp enum an enum class 2021-09-01 18:23:22 -04:00
PixelShaderManager.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
PixelShaderManager.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
PostProcessing.cpp PostProcessing: fix link error when switching shaders 2021-07-18 04:08:48 +01:00
PostProcessing.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
RenderBase.cpp Externals: Update imgui to 1.85 2021-10-26 15:07:57 -07:00
RenderBase.h VideoCommon: Abstract bounding box 2021-10-04 15:51:24 -04:00
RenderState.cpp BPMemory: Refactor/consolidate TexUnit Addressing 2021-10-10 09:09:43 +13:00
RenderState.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
SamplerCommon.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
ShaderCache.cpp Externals: Update imgui to 1.85 2021-10-26 15:07:57 -07:00
ShaderCache.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
ShaderGenCommon.cpp Use custom isnan implementation to avoid HLSL optimizer issues 2021-09-07 19:04:40 -07:00
ShaderGenCommon.h Use custom isnan implementation to avoid HLSL optimizer issues 2021-09-07 19:04:40 -07:00
Statistics.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
Statistics.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TMEM.cpp TMEM: Add some helpful comments 2021-10-12 15:51:24 +13:00
TMEM.h TMEM: Handle savestate and init 2021-10-12 15:51:24 +13:00
TextureCacheBase.cpp Fix copy filter clamping regression in Spyro 2021-11-17 06:12:46 +13:00
TextureCacheBase.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
TextureConfig.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureConfig.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureConversionShader.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureConversionShader.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureConverterShaderGen.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureConverterShaderGen.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureDecoder.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureDecoder_Common.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureDecoder_Generic.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureDecoder_Util.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureDecoder_x64.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
TextureInfo.cpp BPMemory: Refactor/consolidate TexUnit Addressing 2021-10-10 09:09:43 +13:00
TextureInfo.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
UberShaderCommon.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
UberShaderCommon.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
UberShaderPixel.cpp VideoCommon: Fix color channel logic when per-pixel lighting is in use 2021-10-13 20:43:32 -07:00
UberShaderPixel.h UberShaderPixel: Rename ApiType to api_type 2021-08-01 15:09:20 -07:00
UberShaderVertex.cpp VideoCommon: Fix color channel logic when per-pixel lighting is in use 2021-10-13 20:43:32 -07:00
UberShaderVertex.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoaderARM64.cpp fix unused variable warning 2021-09-30 14:27:53 -04:00
VertexLoaderARM64.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoaderBase.cpp VideoCommon: fix generic build 2021-07-12 04:30:43 +02:00
VertexLoaderBase.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
VertexLoaderManager.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoaderManager.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoaderUtils.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoaderX64.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoaderX64.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader_Color.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader_Color.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader_Normal.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader_Normal.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader_Position.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader_Position.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader_TextCoord.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexLoader_TextCoord.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexManagerBase.cpp Extend TMEM cache implementation 2021-10-12 15:51:24 +13:00
VertexManagerBase.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexShaderGen.cpp VideoCommon: Fix color channel logic when per-pixel lighting is in use 2021-10-13 20:43:32 -07:00
VertexShaderGen.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VertexShaderManager.cpp VideoCommon: update Free Look camera's 'FieldOfView' function to 'FieldOfViewMultiplier' to better reflect usage 2021-10-08 18:17:20 -05:00
VertexShaderManager.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VideoBackendBase.cpp TMEM: Handle savestate and init 2021-10-12 15:51:24 +13:00
VideoBackendBase.h VI: Implement post-scanout XFB output 2021-08-03 23:37:50 -04:00
VideoCommon.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
VideoConfig.cpp Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
VideoConfig.h Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
VideoState.cpp TMEM: Handle savestate and init 2021-10-12 15:51:24 +13:00
VideoState.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
XFMemory.cpp treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
XFMemory.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
XFStructs.cpp VideoCommon: report games that set bits in XFMEM_CLIPDISABLE 2021-08-15 04:41:49 +01:00
XFStructs.h treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
sfont.inc treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00