summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderPixel.cpp
AgeCommit message (Collapse)Author
2022-08-29UberShaderPixel: Fix typoPokechu22
2022-08-29BPMemory: Make TevKSel more clearPokechu22
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-29BPMemory: Use even/odd in TwoTevStageOrders instead of 0/1Pokechu22
2022-07-21VideoBackends: Add Metal rendererTellowKrinkle
2022-07-17Merge pull request #10747 from tellowkrinkle/LateUIDFixupJMC47
Add a post-cache shader UID fixup pass
2022-07-15VideoCommon: Always use fbfetch in ubershaders if availableTellowKrinkle
Reduce the number of different pipelines needed. Also works around drivers that break when you combine fbfetch with dual source blending
2022-07-13VideoCommon: Better driver bug handlingTellowKrinkle
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-13VideoCommon: Properly mask fbfetch logic op emulationTellowKrinkle
2022-07-10Merge pull request #10749 from tellowkrinkle/IntelUbershadersJMC47
VideoCommon: Fix ubershaders on MoltenVK Intel
2022-07-08Merge pull request #10819 from Dentomologist/fix_shader_compilation_warningsJMC47
VideoCommon: Fix D3D shader compilation warnings
2022-07-08VideoCommon: Fix D3D shader warning X4000 (uninitialized variables)Dentomologist
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-06-24VideoCommon: fix support of stereoscopic rendering after moving d3d to SPIRV ↵iwubcode
generation
2022-06-24VideoCommon: update UberShaderPixel to properly support logic ops, matching ↵iwubcode
the specialized shader
2022-06-24D3D / VideoCommon: generate HLSL from SPIRViwubcode
2022-06-16VideoCommon: Name ubershadersTellowKrinkle
2022-06-14VideoCommon: Don't pass State by inoutTellowKrinkle
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-04-20DriverDetails: Add broken discard with early-Z bug on Apple Silicon GPUsOatmealDome
2022-04-19UberShaderPixel: Add support for non-dual source shader blendingOatmealDome
2022-04-10MoltenVK: Fix pixel shader typoJosJuice
2022-02-28Shadergen: Use real_ocol0 workaround for shader logic opsJosJuice
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-08Treat alpha as 0 if alpha is 1 for blendingPokechu22
This removes the white box in fortune street again, without causing Mario Kart Wii to regress.
2022-02-08Use the same logic for lerp bias for color and alphaPokechu22
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 5aaa5141ed76acc3fffc70561a6b6e7fe3b9b470 (and several other matching changes elsewhere).
2022-01-26UberShaderPixel: Fix typo in fog calculationPokechu22
2021-12-22Merge pull request #10215 from OatmealDome/shader-logic-opsJMC47
VideoCommon: Support shader logic ops on Metal (Apple GPUs) and OpenGL ES
2021-12-18UberShaderPixel: Convert to EnumMapPokechu22
2021-12-06UberShaderPixel: Add shader logic ops support on OpenGL ESOatmealDome
2021-12-06UberShaderPixel: Add shader logic ops support on MetalOatmealDome
2021-11-17VideoCommon: Manually handle texture wrapping and samplingPokechu22
2021-11-17VideoCommon: Provide raw texdims to shadersPokechu22
2021-11-17VideoCommon: Allow BitfieldExtract in specialized shadersPokechu22
2021-10-13VideoCommon: Fix color channel logic when per-pixel lighting is in usePokechu22
This was broken in #10012 (specifically by 06579e4d53844e5a45ae18f8eda6c4ee69ebad2c and c3dec343918ff44e90886daf71a6bf0c49033de1).
2021-08-01UberShaderPixel: Rename ApiType to api_typePokechu22
2021-07-08Fix indirect textures when format is not ITF_8Pokechu22
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
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-06-21UberShaderPixel: always set tevcoord, even if the stage has no texturePokechu22
This fixes NES game graphics when UberShaders are in use.
2021-05-27Skip indirect operation for out of bounds indirect stagesPokechu22
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-07UberShaderPixel: always run indirect stage logicPokechu22
Hardware testing has confirmed that fb_addprev and wrapping both run even when the indirect stage is disabled.
2021-05-07UberShaderPixel: Fix OOB tex coord indicesPokechu22
Previously we set the texture coordinate to zero, now we set the texture coordinate *index* to zero. This fixes the ripple effect of the Mario painting in Luigi's Mansion.
2021-05-07UberShaderPixel: Return fixed-point values from selectTexCoordPokechu22
This change should have no behavioral differences itself, but allows for changing the behavior of out of bounds tex coord indices more easily in the next commit. Without this change, returning tex0 for out of bounds cases and then applying the fixed-point logic would use the wrong tex dimension info (tex0 with I_TEXDIMS[1] or such), which is inaccurate.
2021-05-07PixelShaderGen: Remove unused num_texgens argumentPokechu22
It became unused in f039149198657c1891e1c6462ed30c31ed4b8486.
2021-05-07Split TevStageIndirect::mid into matrix_index and matrix_idPokechu22
2021-05-07Change BitfieldExtract to use a pointer to the bitfield memberPokechu22
2021-03-06Convert BPMemory to BitField and enum classPokechu22
Additional changes: - For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare. (Shift has also been renamed to scale) - In TexMode0, min_filter has been split into min_mip and min_filter. - In TexImage1, image_type is now cache_manually_managed. - The unused bit in GenMode is now exposed. - LPSize's lineaspect is now named adjust_for_aspect_ratio.
2020-11-09ShaderGenCommon: Rename WriteFmt() to Write()Lioncash
Now that we've converted all of the shader generators over to using fmt, we can drop the old Write() member function and perform a rename operation on the WriteFmt() to turn it into the new Write() function. All changes within this are the removal of a <cstdarg> header, since the previous printf-based Write() required it, and renaming. No functional changes are made at all.
2020-10-27UberShaderPixel: Migrate over to fmtLioncash
Completes the migration over to using the fmt-formatting WriteFmt function. The next PR will rename all usages of WriteFmt, while simultaneously getting rid of the old printf code.
2020-05-25VideoCommon/ShaderGenCommon: Make template functions regular functionsLioncash
These are only ever used with ShaderCode instances and nothing else. Given that, we can convert these helper functions to expect that type of object as an argument and remove the need for templates, improving compiler throughput a marginal amount, as the template instantiation process doesn't need to be performed. We can also move the definitions of these functions into the cpp file, which allows us to remove a few inclusions from the ShaderGenCommon header. This uncovered a few instances of indirect inclusions being relied upon in other source files. One other benefit is this allows changes to be made to the definitions of the functions without needing to recompile all translation units that make use of these functions, making change testing a little quicker. Moving the definitions into the cpp file also allows us to completely hide DefineOutputMember() from external view, given it's only ever used inside of GenerateVSOutputMembers().
2019-05-30VideoCommon: Remove unnecessary memset on ShaderUid instances.Lioncash
Zero-initialization zeroes out all members and padding bits, so this is safe to do. While we're at it, also add static assertions that enforce the necessary requirements of a UID type explicitly within the ShaderUid class. This way, we can remove several memset calls around the shader generation code that makes sure the underlying UID data is zeroed out. Now our ShaderUid class enforces this for us, so we don't need to care about it at the usage sites.
2019-03-25VideoBackends: Scale bounding box rectangle in the pixel shaderStenzek
2019-02-19Move most backend functionality to VideoCommonStenzek
2019-01-24ShaderGen: Don't use interface blocks on Vulkan without GSStenzek
Doing so causes the Adreno driver to choke and spew errors about too many output locations/components, when clearly we're under the limit.