summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderPixel.cpp
AgeCommit message (Collapse)Author
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.
2019-01-23ShaderGen: Omit some unused varyings when possibleStenzek
Removes the clipPos varying unless slow-depth is used, and the clipDistance varyings if geometry shaders are not used.
2018-11-07PixelShaderGen: Split bbox into seperate variablesStenzek
The Metal shader compiler fails to compile the atomic instructions when operating on individual components of a vector. Spltting it into four variables shouldn't make any difference for other platforms, as they are accessed independently.
2018-10-09VideoCommon: remove unnecessary floor()Tillmann Karras
floatindex is clamped to the range [0, 9]. For non-negative numbers floor() is equivalent to trunc(). Truncation happens implicitly when converting to uint, so the floor() is unnecessary.
2018-09-01Revert "ShaderGen: Drop broken fragment shader index workaround for Vulkan"Pierre Bourdon
2018-08-28ShaderGen: Drop broken fragment shader index workaround for VulkanStenzek
AMD appears to have since fixed this in their driver, and it makes shadergen ever so slightly less messy.
2018-05-26ShaderGen: Don't emit integer outputs when logic op is unsupportedStenzek
This may have been causing issues for D3D10 hardware, where logic op was not supported.
2018-05-26ShaderCache: Remove unused UID bits before inserting into shader mapStenzek
2018-04-12Reformat all the things!spycrab
2018-03-23PixelShaderGen/UberShaderPixel: Silence -Wmissing-braces warningsLioncash
2018-02-15PixelShaderGen: Implement table-based fog range as in software rendererStenzek
2018-01-05Enable shader_framebuffer_fetch blend path on ubershadersJonathan Hamilton
Tested on a linux Intel Skylake integrated graphics with blend_func_extended force-disabled, as it's the only platform I have that doesn't crash with ubershaders and supports fb_fetch
2017-11-25UberShaderPixel: Fix the interpolation qualifier for interface blocks.Jules Blok
Fixes MSAA on MacOS with ubershaders enabled.
2017-09-05VideoBackends: Clear uid bits that are unused for the current backendStenzek
Currently, this is only the logic op bit, but this will be extended to the framebuffer fetch/blend modes. In the future, when/if we move to VideoCommon pipelines, this state will be part of the pipeline UID anyway, and we can mask it out in the backend by using a two-level map, so the shaders/programs are shared.
2017-09-05ShaderGen: Output uint when logic op is enabled for D3D ubershadersStenzek
2017-09-03Merge pull request #6013 from stenzek/d3d-logic-opAnthony
D3D: Implement logic op support
2017-09-03ShaderGen: Support writing integer colors when logic op is enabledStenzek
This is required for D3D to support logic op.
2017-08-20UberShaderPixel: Fix sampling of EFB copies in stereo modesStenzek
2017-08-12UberShaderPixel: Use an if trees instead of switch statements on GLStenzek
The switch statements in these functions appear to get transformed into an if..else chain on NVIDIA's OpenGL/Vulkan drivers, resulting in lower performance than the D3D counterparts. Transforming the switch into a binary tree of ifs can increase performance by up to 20%.
2017-08-01Ubershaders: Fix 6-bit color truncation not being appliedStenzek
2017-07-30Ubershaders: Support per-pixel lightingStenzek
2017-07-30ShaderGen: Implement pixel ubershadersStenzek