Commit graph

115 commits

Author SHA1 Message Date
Henrik Rydgård
8194bb73a1 Turn on logic ops in shader when shader bitmasking is used. 2022-09-04 11:43:36 +02:00
Henrik Rydgård
3d2e78fbf4 spaces->tabs 2022-09-04 00:11:22 +02:00
Henrik Rydgård
ec173559f8 Additional cleanup 2022-09-04 00:10:55 +02:00
Henrik Rydgård
ceda7aef49 Add log functions to state structs 2022-09-04 00:10:55 +02:00
Henrik Rydgård
d35749bfc8 Move the computation of simulate-logic shader type earlier 2022-09-04 00:10:55 +02:00
Henrik Rydgård
87b14fe1c2 Some more renaming and refactoring, extracted from a future PR 2022-09-04 00:10:55 +02:00
Henrik Rydgård
8e39018b95 Channel mask refactor 2022-09-04 00:10:54 +02:00
Henrik Rydgård
5f1ffeae70 Correct LogicOp API support detection 2022-09-04 00:08:40 +02:00
Henrik Rydgård
c846c2dfa8 Remove confusing resetFramebufferRead flag from secondary framebuffer binding 2022-09-03 14:48:07 +02:00
Henrik Rydgård
8c56abd3dc Remove setting "Disable slower framebuffer effects" 2022-09-03 11:06:43 +02:00
Henrik Rydgård
68d88726ae Remove unused function 2022-09-03 11:06:43 +02:00
Henrik Rydgård
fd6ab4c495 Avoid recomputing the shaderblend setup in ComputeFragmentShaderID. 2022-09-02 23:06:41 +02:00
Henrik Rydgård
0fe064d970 Small steps 2022-09-02 22:43:58 +02:00
Henrik Rydgård
de712b7804 More renaming 2022-09-02 22:20:11 +02:00
Henrik Rydgård
c784c0e94b Some renaming. Store the BlendState/MaskState. 2022-09-02 21:07:29 +02:00
Henrik Rydgård
d99e4b6714 Quicker way to update the through projection matrix with the split framebuffer offset 2022-08-31 08:44:15 +02:00
Henrik Rydgård
7186fc2c17 Offset the draws properly. Now just some texel clamping left to fix 2022-08-31 01:40:53 +02:00
Unknown W. Brackets
b5a4843c1f GPU: Purify ConvertViewportAndScissor().
This makes it harder to misuse.  See #15856.
2022-08-20 14:21:11 -07:00
Henrik Rydgård
886679c7ec Remove the color-to-depth mode 2022-08-20 08:29:33 +02:00
Unknown W. Brackets
a321aba68c GPU: Avoid stencil force pass when writing depth.
There's a risk if the stencil test failed, it might cause a depth write
unless it's also masked.  Hunter x Hunter doesn't in this case.
2022-08-10 23:11:16 -07:00
Henrik Rydgård
f80dd088b8
Merge pull request #15822 from unknownbrackets/gpu-stencil
GPU: Write stencil fail to alpha is RGB masked
2022-08-10 14:59:53 +02:00
Unknown W. Brackets
710abcc288 GPU: Write stencil fail to alpha is RGB masked.
See #15813 (Hunter x Hunter) which does this for shadows.
2022-08-09 18:45:49 -07:00
Henrik Rydgård
131098c4d4 Some enum renaming, move RasterChannel to GPU.h. 2022-08-09 19:58:48 +02:00
Henrik Rydgård
90a44579bf Implement color-to-depth for Vulkan, start implementing for D3D11 2022-08-01 11:30:36 +02:00
Henrik Rydgård
a44bee6f85 Fix bug in blue-to-alpha - alpha blending could be on when it shouldn't be.
Fixes #15732. (Split/Second environment mapping problem in the menu).
2022-07-27 10:59:39 +02:00
Henrik Rydgård
c9a37ec6b9 Remove bool that was always true in state mapping. 2022-07-24 21:04:54 +02:00
Henrik Rydgård
04a85b1da0 Allows "merging" render targets that overlap on the Y access. Fixes #7295 (Juiced 2)
To be safe, gating this behind the related AllowLargeFBTextureOffsets,
which is also required for the effect to work.

Additionally, fixes the offset check for X offsets, which I guess is a
very small risk.
2022-07-24 11:58:07 +02:00
Henrik Rydgård
6b2dec91b5 Finish BlueToAlpha functionality 2022-04-30 18:17:17 +02:00
Henrik Rydgård
462972f7ea Add option to redirect blue to alpha if 565 mode is rendered and mask is 0x0FFFFF.
This is used by several games to render to the alpha channel of RGBA4444
images, which cannot normally be done directly on the PSP.

Can be used as a far more efficient replacement for
ReinterpretFramebuffers/ShaderColorBitmask
2022-04-30 18:17:16 +02:00
Henrik Rydgård
7be86264d0 Move framebufFormat to gstate_c, so we can override it 2022-04-30 18:16:09 +02:00
Henrik Rydgård
32df78a2cc Make the existing ReinterpretFramebuffers/ShaderColorBitmask path work for Split/Second
It took writing and debugging #15500 for me to understand what the issue with the old path was..

Much simpler alternative to #15500, or we could merge both but disable Split/Second
for this one. Needs some benchmarks I guess...
2022-04-25 00:11:09 +02:00
Henrik Rydgård
69ae3f4c02 Better protection against broken viewports.
It's ok if this emits a single pixel sized viewport, since the cause of
this is generally the viewport being specified outside the scissor
rectangle.

Fixes #13921
2021-07-12 21:19:26 +02:00
Henrik Rydgård
7359c8f083 Revert "Make sure we don't try to set a negative viewport size."
This reverts commit 0386cafe53.
2021-07-12 21:03:29 +02:00
Unknown W. Brackets
9857e8d1b1 GPU: Respect stencil write mask for 5551 buffers.
If the mask is 0x7F on 5551, that's equivalent to allowing the clear
entirely.  See #13391.
2021-01-24 15:54:13 -08:00
Henrik Rydgård
0386cafe53 Make sure we don't try to set a negative viewport size.
Should help #13921.
2021-01-16 09:45:21 +01:00
Henrik Rydgård
d5fe6154b5 Enable color reinterpret for Ultimate Ghosts & Goblins
The game uses it by accident probably, but whatever - it's a clean fix.

Fixes, but only for "modern" APIs, #13717.
2020-11-27 23:52:33 +01:00
Henrik Rydgård
c61f9bfd09 Fix bug in the new color writemask code, failing to limit it to Outrun properly. Fixes #13650. 2020-11-10 22:07:20 +01:00
Henrik Rydgård
6310af25fa Get shader color write masking going on all backends. 2020-11-08 23:45:47 +01:00
Henrik Rydgård
793e89d2e3 Fix some comments, rename a function. 2020-11-08 14:34:04 +01:00
Henrik Rydgård
3d289594f9 ShaderBlend and FramebufferRead are separate concepts. Reflect that in naming.
The former has forms that don't need to read the framebuffer.

This exposes that some logic is wrong...
2020-11-08 12:54:05 +01:00
Henrik Rydgård
b7edf75437 Move Display.cpp/h to Common. 2020-10-04 11:42:16 +02:00
Unknown W. Brackets
3055deeba6 GPU: Fix some case warnings.
Better to avoid the warnings.
2020-08-19 21:18:44 -07:00
Henrik Rydgård
ba0d04a142 Vulkan: Implement depth texturing through depal. 2020-08-09 20:31:04 +02:00
Henrik Rydgård
e6dfb55d3d Optimize value conversion in (unused) depth readback.
This also exposes factors we can feed into shaders to do the conversion
on the GPU.
2020-08-09 10:47:01 +02:00
Henrik Rydgård
fd3a9d4202 Expand the viewport to cover the scissor region, if it doesn't. Fixes #4845 (bloom in Dante's Inferno). 2020-08-05 19:19:30 +02:00
Henrik Rydgård
1b2d4dd75d Viewport state conversion: Move the pixel scaling to after the overage clipping. 2020-08-05 19:04:12 +02:00
Henrik Rydgård
eadd3c5785 Remove the LARGE_VIEWPORTS separate path. The fewer paths the better, all need to work anyway.
Required fixing a bug in ShaderUniforms.cpp (used by D3D11 and Vulkan,
the two backends that previously exposed LARGE_VIEWPORTS).
2020-08-05 19:03:08 +02:00
Henrik Rydgård
d57edfbdac Rename FramebufferCommon.cpp/h to FramebufferManagerCommon.cpp/h for consistency 2020-08-03 23:17:22 +02:00
Henrik Rydgård
73046239e3 Android: Add option to ignore camera notches when sizing the display.
This is generally what you want, at least on phones with small notches.

Not sure about the most intuitive polarity and name of the setting.. bit
of a shame to create another setting with a negation. But most people
should probably ignore this.
2020-07-05 22:46:25 +02:00
Henrik Rydgård
c8d48a8777 Handle insets correctly for the in-game final screen blit.
Should help #12982 in case of phones with inset cameras.
2020-05-31 20:14:40 +02:00