Commit Graph

84 Commits

Author SHA1 Message Date
iwubcode 9d28c371e7 VideoCommon: allow custom shaders to set the alpha value for use when blending is enabled 2024-04-28 18:15:27 -05:00
TellowKrinkle 5949911a5a VideoCommon: Don't use indexed output for fbfetch
A nonzero index makes no sense, and Mesa doesn't like it when you supply an index
2024-02-07 03:52:31 +01:00
iwubcode a8d45b8e55 VideoCommon: fix compilation error in uber pixel shaders when pixel shader lighting isn't set for custom shaders 2024-01-23 21:50:42 -06:00
iwubcode a37fd83218 VideoCommon: fix uber shader pixel compilation error that happens when uint output is defined 2024-01-23 21:50:41 -06:00
iwubcode b1d9e13d75 VideoCommon: prepare graphics mods for custom shader material data 2023-12-12 17:56:26 -06:00
JosJuice 5b112dbf2c VideoCommon: Fix GLSL uint handling in UberShaderPixel 2023-08-28 21:17:01 +02:00
iwubcode 931a8aa413 VideoCommon: add milliseconds elapsed time value to pixel shaders as a uniform to be able to support animation effects in custom shaders 2023-08-20 18:53:27 -05:00
iwubcode 4283d76718 VideoCommon: uber pixel shader gen changes needed to support custom pixel shaders in graphics mods 2023-08-20 18:53:27 -05:00
takayhan-AMD b969282b72 Remove out-dated hack of AMD driver issue WRT dual-source blending output index. 2023-08-15 23:58:29 -04:00
TellowKrinkle f25a0b43b6 VideoCommon: Fix stereoscopic 3D on OpenGL < 4.3 (macOS) 2023-02-14 18:25:33 +01:00
TellowKrinkle 600ad5f498 VideoCommon: Better logic op invert approximation 2023-01-30 14:04:37 -06:00
JMC47 9aece1810c
Merge pull request #10836 from iwubcode/d3d_uint_fix
VideoCommon: fix uint shader compiler error when using d3d
2022-10-18 12:12:08 -04:00
Pokechu22 546f9952a2 UberShaderPixel: Fix typo 2022-08-29 11:10:05 -07:00
Pokechu22 5ef8a7973e BPMemory: Make TevKSel more clear
It stores both the konst selection value for alpha and color channels (for two tev stages per ksel), and half of a swap table row (there are 4 total swap tables, which can be used for swizzling the rasterized color and the texture color, and indices selecting which tables to use are stored per tev stage in the alpha combiner).  Since these are indexed very differently, the old code was hard to follow.
2022-08-29 11:10:05 -07:00
Pokechu22 f21798b9b6 BPMemory: Use even/odd in TwoTevStageOrders instead of 0/1 2022-08-29 11:10:05 -07:00
iwubcode 637dca680c VideoCommon: update ubershader pixel to not enforce d3d when writing color output that has been defined as uints 2022-08-06 16:08:58 -05:00
TellowKrinkle 716c0980d7 VideoBackends: Add Metal renderer 2022-07-21 20:44:19 -05:00
JMC47 70b0b03c3c
Merge pull request #10747 from tellowkrinkle/LateUIDFixup
Add a post-cache shader UID fixup pass
2022-07-17 00:43:16 -04:00
TellowKrinkle 991024173e VideoCommon: Always use fbfetch in ubershaders if available
Reduce the number of different pipelines needed.  Also works around drivers that break when you combine fbfetch with dual source blending
2022-07-15 15:31:47 -05:00
TellowKrinkle 6ab24e6c17 VideoCommon: Better driver bug handling
Adds a pass to process driver deficiencies between UID caching and use, allowing a full view of the whole pipeline, since some bugs/workarounds involve interactions between blend modes and the pixel shader
2022-07-13 21:51:24 -05:00
TellowKrinkle 6bd0fc86ba VideoCommon: Properly mask fbfetch logic op emulation 2022-07-13 02:27:45 -05:00
JMC47 cce6133ef6
Merge pull request #10749 from tellowkrinkle/IntelUbershaders
VideoCommon: Fix ubershaders on MoltenVK Intel
2022-07-10 19:35:55 -04:00
JMC47 fac66897af
Merge pull request #10819 from Dentomologist/fix_shader_compilation_warnings
VideoCommon: Fix D3D shader compilation warnings
2022-07-08 18:46:29 -04:00
Dentomologist 71541c1324 VideoCommon: Fix D3D shader warning X4000 (uninitialized variables)
Initialize alpha_A and alpha_B. They were previously only initialized in
cases where they were used, but D3D isn't able to figure that out.
2022-07-08 00:25:14 -07:00
iwubcode cad1d6ce90 VideoCommon: fix support of stereoscopic rendering after moving d3d to SPIRV generation 2022-06-24 18:09:53 -05:00
iwubcode 993fa3bf94 VideoCommon: update UberShaderPixel to properly support logic ops, matching the specialized shader 2022-06-24 18:09:53 -05:00
iwubcode 5dd2704416 D3D / VideoCommon: generate HLSL from SPIRV 2022-06-24 18:09:53 -05:00
TellowKrinkle c7892d7371 VideoCommon: Name ubershaders 2022-06-16 02:08:45 -05:00
TellowKrinkle 25929789c1 VideoCommon: Don't pass State by inout
Spirv-cross's MSL codegen makes the amazing choice of compiling calls to inout functions as `State temp = s; call_function(temp); s = temp`.  Not all Metal backends handle this mess well.  In particular, it causes register spills on Intel, losing about 5% in performance.
2022-06-14 00:48:47 -05:00
OatmealDome 259a5fc7c0 DriverDetails: Add broken discard with early-Z bug on Apple Silicon GPUs 2022-04-20 14:56:34 -04:00
OatmealDome 80dfefb32e UberShaderPixel: Add support for non-dual source shader blending 2022-04-19 10:55:26 -04:00
JosJuice abffa93a72 MoltenVK: Fix pixel shader typo 2022-04-10 20:51:20 +02:00
JosJuice bbb64ff993 Shadergen: Use real_ocol0 workaround for shader logic ops
Previously we were using this workaround when using framebuffer fetch
to emulate dual source blending, but it seems like we also need to use
it when using framebuffer fetch to emulate logic ops, otherwise some
Adreno devices get a crash when compiling OpenGL ES ubershaders.

Using the workaround in specialized shaders doesn't seem to be
necessary, but I've made the same change there for consistency.

This gets us closer to fixing https://bugs.dolphin-emu.org/issues/12791
but doesn't actually fix it.
2022-02-28 18:32:19 +01:00
Pokechu22 444f6fd0cb Treat alpha as 0 if alpha is 1 for blending
This removes the white box in fortune street again, without causing Mario Kart Wii to regress.
2022-02-08 15:15:15 -08:00
Pokechu22 0327e6acb4 Use the same logic for lerp bias for color and alpha
It doesn't make sense for alpha to add the bias ONLY when dividing by 2, while color doesn't apply the bias for divide by 2 only; hardware testing indicates that alpha should have the bias.

This fixes the menus in Mario Kart Wii (https://bugs.dolphin-emu.org/issues/11909) but reintroduces the white rectangle in Fortune Street.

This reverts commit 5aaa5141ed (and several other matching changes elsewhere).
2022-02-08 15:15:15 -08:00
Pokechu22 cc9ed4815d UberShaderPixel: Fix typo in fog calculation 2022-01-26 20:23:35 -08:00
JMC47 b1f79d9ecf
Merge pull request #10215 from OatmealDome/shader-logic-ops
VideoCommon: Support shader logic ops on Metal (Apple GPUs) and OpenGL ES
2021-12-22 16:39:54 -05:00
Pokechu22 f53dc6564f UberShaderPixel: Convert to EnumMap 2021-12-18 12:51:55 -08:00
OatmealDome 74a979db09 UberShaderPixel: Add shader logic ops support on OpenGL ES 2021-12-06 22:36:40 -05:00
OatmealDome a77ae14d94 UberShaderPixel: Add shader logic ops support on Metal 2021-12-06 22:36:40 -05:00
Pokechu22 ddf2691395 VideoCommon: Manually handle texture wrapping and sampling 2021-11-17 20:04:34 -08:00
Pokechu22 9ef228503a VideoCommon: Provide raw texdims to shaders 2021-11-17 20:04:34 -08:00
Pokechu22 555a93057c VideoCommon: Allow BitfieldExtract in specialized shaders 2021-11-17 20:04:33 -08:00
Pokechu22 a372a5947b VideoCommon: Fix color channel logic when per-pixel lighting is in use
This was broken in #10012 (specifically by 06579e4d53 and c3dec34391).
2021-10-13 20:43:32 -07:00
Pokechu22 3b752c4d5d UberShaderPixel: Rename ApiType to api_type 2021-08-01 15:09:20 -07:00
Pokechu22 2feced2e33 Fix indirect textures when format is not ITF_8 2021-07-08 15:48:14 -07:00
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Pokechu22 2f1726e3f3 UberShaderPixel: always set tevcoord, even if the stage has no texture
This fixes NES game graphics when UberShaders are in use.
2021-06-21 13:01:25 -07:00
Pokechu22 5928182a4c Skip indirect operation for out of bounds indirect stages
This fixes rendering issues in Viewtiful Joe (https://bugs.dolphin-emu.org/issues/12525), but it is not entirely hardware accurate, as hardware testing showed other, more complex behavior in this case.  However, it should be good enough for our purposes.
2021-05-27 22:13:42 -07:00
Pokechu22 e1d45e9ba6 UberShaderPixel: always run indirect stage logic
Hardware testing has confirmed that fb_addprev and wrapping both run even when the indirect stage is disabled.
2021-05-07 16:37:47 -07:00