summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/ShaderGenCommon.cpp
AgeCommit message (Collapse)Author
2026-01-25Remove unused importsMartino Fontana
Yellow squiggly lines begone! Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes. If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed. The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports. Not everything is removed, but the cleanup should be substantial enough. Because this done on Linux, code that isn't used on it is mostly untouched. (Hopefully no open PR is depending on these imports...)
2025-03-22VideoCommon: move to a 'process_fragment()' function to simplify custom ↵iwubcode
shaders and provide a direct override of the tev stage logic
2025-03-09VideoCommon: Move backend_info out of VideoConfig struct.Jordan Woyak
2024-04-28VideoCommon: allow custom shaders to set the alpha value for use when ↵iwubcode
blending is enabled
2023-08-22VideoCommon: Fix custom shader constants on GLESJosJuice
2023-08-20VideoCommon: add milliseconds elapsed time value to pixel shaders as a ↵iwubcode
uniform to be able to support animation effects in custom shaders
2023-08-20VideoCommon: add custom pixel shader definition and custom shader header to ↵iwubcode
shadergen common as it will be used by both the special and uber shader variant of pixel shaders
2023-02-25D3D: Restore workaround for erroneous NaN optimizationDentomologist
The HLSL compiler incorrectly decides isnan can't be true, so this workaround was originally added in 52c82733 but lost during the conversion to SPIR-V.
2023-02-14VideoCommon: Fix stereoscopic 3D on OpenGL < 4.3 (macOS)TellowKrinkle
2022-12-27PixelShaderGen: Clamp texture layer when using manual texture sampling with ↵Pokechu22
stereoscopic 3D Otherwise, texelFetch() will use an out-of-bounds layer for game textures (that have 1 layer; EFB copies have 2 layers in stereoscopic 3D mode), which is undefined behavior (often resulting in a black image). The fast texture sampling path uses texture(), which always clamps (see https://www.khronos.org/opengl/wiki/Array_Texture#Access_in_shaders), so it was unaffected by this difference.
2022-10-22VideoCommon: Move repeated point/line expansion code to ShaderGenCommonTellowKrinkle
2022-10-22VideoCommon: Add vertex shader point and line expansionTellowKrinkle
2022-09-19VideoCommon: Add dynamic vertex loader to ubershadersTellowKrinkle
2022-07-21VideoBackends: Add Metal rendererTellowKrinkle
2022-06-24D3D / VideoCommon: generate HLSL from SPIRViwubcode
2021-12-28ShaderGenCommon: Add bit for LOD biasOatmealDome
2021-11-17VideoCommon: Handle custom texture sizes correctlyPokechu22
Specifically, when using Manual Texture Sampling, if textures sizes don't match the size the game specifies, things previously broke. That can happen with custom textures, and also with scaled EFB copies at non-native IRs. It breaks most obviously by not scaling the texture coordinates (so only part of the texture shows up), but the hardware wrapping functionality also assumes texture sizes are a power of 2 (or else it will behave weirdly in a way that matches how hardware behaves weirdly). The fix is to provide alternative texture wrapping logic when custom texture sizes are possible.
2021-11-17VideoCommon: Add option to use old behavior (Fast Texture Sampling)Pokechu22
Co-authored-by: JosJuice <josjuice@gmail.com>
2021-11-17VideoCommon: Add signed version of BitfieldExtractPokechu22
2021-11-17VideoCommon: Allow BitfieldExtract in specialized shadersPokechu22
2021-09-07Use custom isnan implementation to avoid HLSL optimizer issuesPokechu22
This adjusts the NaN replacement logic introduced in #9928 to work around the HLSL compiler optimizing away calls to isnan, which caused that functionality to not work with ubershaders on D3D11 and D3D12 (it did work with specialized shaders, despite a warning being logged for both; that warning is also now gone). Note that the `D3DCOMPILE_IEEE_STRICTNESS` flag did not solve this issue, despite the warning suggesting that it might. Suggested by @kayru and @jamiehayes.
2021-07-28Recompile shaders when 'Enable API Validation Layers' is toggledPokechu22
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.
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-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-11-23VideoCommon: Make use of fmt outside of shader generatorsLioncash
Migrates most of VideoCommon over to using fmt, with the exception being the shader generator code. The shader generators are quite large and have more corner cases to deal with in terms of conversion (shaders have braces in them, so we need to make sure to escape them). Because of the large amount of code that would need to be converted, the conversion of VideoCommon will be in two parts: - This change (which converts over the general case string formatting), - A follow up change that will specifically deal with converting over the shader generators.
2019-02-19Move most backend functionality to VideoCommonStenzek
2018-05-26VideoConfig: Add a field for indicating logic op support in the backendStenzek
2018-03-10Move shader caches to VideoCommonStenzek
2018-01-05Implement dual-source blending in shaderJonathan Hamilton
For some GLES drivers that don't support dual-source blending, but do support GL_EXT_shader_framebuffer_fetch, this might be useful.
2017-11-18VideoConfig: Make StereoMode an enum classLioncash
Makes for more strongly-typed identifiers (and doesn't pollute surrounding namespaces)
2017-07-30ShaderGen: Implement pixel ubershadersStenzek
2017-07-20ShaderGen: Pass host config to shader generation functionsStenzek
Also moves the host config checks to common.