Commit Graph

3492 Commits

Author SHA1 Message Date
8bcc392d5d Merge pull request #5887 from linkmauve/alpha-fix
Simplify EFB copy shaders
2017-12-03 11:21:08 +01:00
67ba326ff6 VideoCommon: Fix -Wformat warnings 2017-12-02 21:48:01 +01:00
85bb1d7bb0 VideoCommon: Reimplement texture format conversion
This fixes the rendering of the scan visor in Metroid Prime 2: Echoes,
as seen in https://fifoci.dolphin-emu.org/dff/mp2-scanner/

The alpha channel was off-by-one on Ivy Bridge due to the rounding
after multiplication with colmat.  This commit removes this matrix
altogether in most cases, making them simple GLSL swizzles.
2017-12-02 19:29:01 +01:00
76fbdbb06e Merge pull request #5903 from linkmauve/fix-mp2e
Round values in swizzlers
2017-12-02 17:38:21 +01:00
e2a9ee384f VideoCommon: Rename TextureConversionShader namespace. 2017-12-02 15:17:39 +01:00
e8febd0cef VideoCommon: Create a namespace for TextureConversionShaderGen. 2017-12-02 15:17:39 +01:00
491c10ec96 VideoBackends: Use VideoCommon shader generators for efb2tex copies.
This will generate one shader per copy format. For now, it is the same
shader with the colmat hard coded. So it should already improve the GPU
performance a bit, but a rewrite of the shader generator is suggested.

Half of the patch is done by linkmauve1:
VideoCommon: Reorganise the shader writes.
2017-12-02 15:17:39 +01:00
cd68b3606c Merge pull request #6193 from stenzek/readbacks
Abstract Staging Textures - VideoCommon interface for texture readbacks/uploads
2017-12-01 14:24:06 +10:00
96e094e127 Merge pull request #6216 from stenzek/headless-frame-dumping
OGL: Fix headless frame dumping
2017-11-26 11:36:10 +01:00
7dd207931d UberShaderPixel: Fix the interpolation qualifier for interface blocks.
Fixes MSAA on MacOS with ubershaders enabled.
2017-11-25 21:51:14 +01:00
32125cf181 OGL: Fix headless frame dumping
Also skips swapping the window system buffers in headless mode, as there
may not be a surface which can be swapped in the first place. Instead,
we call glFlush() at the end of a frame in this case.
2017-11-23 16:53:55 +10:00
db1d9de933 AbstractTexture: Drop slow map readback path 2017-11-22 18:49:33 +10:00
193763ca3a TextureCacheBase: Don't crop last row/column of XFB copies
Unsure why this was happening in the first place.
2017-11-22 18:49:33 +10:00
6577365851 VideoCommon: Re-implement asynchronous frame dumping
This was lost as a result of hybrid XFB, now it is back, and ~10%
faster in very brief testing.
2017-11-22 18:49:33 +10:00
c2cc128f1b AbstractTexture: Implement Save using new common methods 2017-11-22 18:47:04 +10:00
56afebeb44 AbstractTexture: Seperate CopyRectangleFromTexture to two methods
ScaleRectangleFromTexture, which does a draw, and
CopyRectangleFromTexture, which where possible, does a bit-for-bit copy.
2017-11-22 18:47:04 +10:00
f43d85921d VideoBackends: Add AbstractStagingTexture class
Can be used for asynchronous readback or upload of textures.
2017-11-22 18:47:04 +10:00
a584ccc7d8 AbstractTexture: Support BGRA8 formats
Used for some driver's swap chains, and EFB to RAM.
2017-11-22 18:47:04 +10:00
49a9c33bd7 VideoCommon: Move abstract texture creation function to Renderer 2017-11-22 18:47:04 +10:00
73a67aa413 Merge pull request #6204 from stenzek/downscaled-screenshots
Frame Dumping: Fix window-size framedumping
2017-11-22 07:53:23 +01:00
efb9759862 LightingShaderGen: Always calculate lighting for both color channels
Cel-damage uses the color from the lighting stage of the vertex pipeline
as texture coordinates, but sets numColorChans to zero.

We now calculate the colors in all cases, but override the color before
writing it from the vertex shader if numColorChans is set to a lower value.
2017-11-22 01:52:18 +10:00
8985cb2f0b Renderer: Re-implement window size frame dumping
This was broken by hybrid XFB, and all frame dumping/screenshots occured
at the full internal resolution.
2017-11-21 17:19:43 +10:00
39559f6358 VideoConfig: Remove bSupportsInternalResolutionFrameDumps
Field is unused as of Hybrid XFB.
2017-11-21 17:19:43 +10:00
18c1bf19ca VideoCommon: Use constant for number of color channels in XFMemory 2017-11-20 23:18:44 +10:00
80bcc0d58d Merge pull request #6186 from lioncash/enum-class
VideoConfig: Make AspectMode and StereoMode enum classes
2017-11-19 15:08:16 +01:00
2ead31c769 Merge pull request #6203 from lioncash/missing-braces-warn
VideoCommon: Resolve -Wmissing-brace warnings
2017-11-19 08:45:13 +01:00
2385a03c2b Merge pull request #6201 from lioncash/headers
VideoBackends: Remove header inclusions made unnecessary with Hybrid XFB
2017-11-19 08:44:48 +01:00
518f6a3624 VideoCommon: Resolve -Wmissing-brace warnings
Resolves around 5 -Wmissing-brace warnings on macOS.
2017-11-19 01:49:39 -05:00
2bd88bdb9f AbstractTexture: Remove a redundant constructor initializer list entry
This is already initialized in the class definition. This would
previously cause a -Wreorder warning on macOS, as m_config is
defined after m_currently_mapped.
2017-11-19 01:25:55 -05:00
364eaadfe5 VideoBackends: Remove header inclusions made unnecessary with Hybrid XFB
Just some inclusions that weren't removed in the initial Hybrid XFB PR.
2017-11-19 00:53:10 -05:00
5337e58284 VideoConfig: Make StereoMode an enum class
Makes for more strongly-typed identifiers (and doesn't pollute
surrounding namespaces)
2017-11-18 23:19:53 -05:00
10697bcbe3 VideoConfig: Make AspectMode an enum class
Makes for more strongly-typed identifiers (and doesn't pollute
surrounding namespaces)
2017-11-18 23:17:56 -05:00
dd54617a08 TextureCacheBase: Set uninitialized XFB memory to fuchsia color 2017-11-17 22:11:34 -06:00
8d1cbeb25e Hybrid XFB: Fix lint errors 2017-11-17 22:11:34 -06:00
61541ab243 Enhance xfb dumping to distinguish between the xfbs created from memory and the xfbs created from overlapping copies 2017-11-17 22:11:34 -06:00
8678e8ddd3 Texture Cache Base: Optimization to allow stitched or memory xfb textures to be looked up from cache directly if they were defined previously and their hash hasn't changed 2017-11-17 22:11:33 -06:00
332af8aa49 TextureCacheBase: Fix issue in Rogue Squadron 2 where overlapping textures caused a hash change which would cause us to do a lookup from memory that gave us an incorrect result in XFB2Ram 2017-11-17 22:11:33 -06:00
ada37ec642 TextureCacheBase: Remove vertical scaling from EFB path and have copy checks only check EFBs 2017-11-17 22:11:33 -06:00
7248dd47d5 Hybrid XFB: Fix lint errors 2017-11-17 22:11:32 -06:00
2c87a53f11 TextureCacheBase: make sure stitching rectangle bounds don't exceed the
texture size they are meant to represent
2017-11-17 22:11:32 -06:00
74610646ce TextureCacheBase: Add XFB specific functions 2017-11-17 22:11:32 -06:00
4964fc87ae Video Backends: Remove the right of the xfb region for games where the
VI stride does not match the VI width
2017-11-17 22:11:32 -06:00
a129a53e56 Video Common: Improve texture dumping to work with fifoci and
fifo_comparer
2017-11-17 22:11:32 -06:00
53684701fa HybridXFB: Fix lint errors 2017-11-17 22:11:31 -06:00
65418a76f5 Video Common: Use correct aspect ratio when saving screenshots / video 2017-11-17 22:11:31 -06:00
1090549552 Software Backend: Force EFB/XFB to copy to ram 2017-11-17 22:11:31 -06:00
e6d85b0915 Video Common: Avoid 'presenting' duplicate frames by detecting when swap
hasn't changed since the last frame
2017-11-17 22:11:31 -06:00
2295d60fdc VideoCommon: Output gamma now comes from the xfb copy 2017-11-17 22:11:30 -06:00
7f0834c919 Add 'immediate xfb' which reduces xfb latency at the cost of graphical errors 2017-11-17 22:11:30 -06:00
e33ab4117d Video Common: Make auto IR work with HybridXFB 2017-11-17 22:11:30 -06:00