summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderVertex.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...)
2026-01-17Merge pull request #14289 from Sintendo/typosJMC47
Fix various typos and spelling mistakes
2026-01-17Fix various typos and spelling mistakesSintendo
2026-01-09c++23: Replace Common::ToUnderlying with std::to_underlyingJoshua Vandaële
Requires at least GCC 11, Clang 13, MSVC 19.30 (VS2022 17.0), or AppleClang 13.1.6 (XCode 13.3).
2024-10-12Cache normals in addition to binormals and tangentsPokechu22
Fixes LIT (https://bugs.dolphin-emu.org/issues/13635). The text does not include normals, but has lighting enabled. With the previous default of (0, 0, 0), lighting was always black (as dot(X, (0, 0, 0)) is always 0). It seems like the normal from the map in the background (0, 0, 1) is re-used. LIT also has the vertex color enabled while vertex color is not specified, the same as SMS's debug cubes; the default MissingColorValue GameINI value of solid white seems to work correctly in this case.
2023-10-24VideoCommon: Fix VS point/line on older GLSLTellowKrinkle
2023-10-06VideoBackends / VideoCommon: add new uniform buffer object for custom shader ↵iwubcode
materials (slot 3, geometry shader buffer moves to slot 4 if available)
2023-06-17EnumUtils: Add Common::ToUnderlyingget
Mirrors the C++23 <utility> function, std::to_underlying
2022-11-23Fix build errors related to formatting non-scoped enumsPokechu22
2022-10-22VideoCommon: Move repeated point/line expansion code to ShaderGenCommonTellowKrinkle
2022-10-22VideoCommon: Add vertex shader point and line expansionTellowKrinkle
2022-09-19VideoBackends:D3D12: Dynamic vertex loader supportTellowKrinkle
2022-09-19VideoCommon: Add dynamic vertex loader to ubershadersTellowKrinkle
2022-06-24D3D / VideoCommon: generate HLSL from SPIRViwubcode
2022-06-16VideoCommon: Name ubershadersTellowKrinkle
2022-04-22VideoCommon: Add comment explaining why only the first normal gets normalizedPokechu22
Co-authored-by: Scott Mansell <phiren@gmail.com>
2022-04-22VideoCommon: Handle emboss texgen with only a single normalPokechu22
Fixes a large number of effects in Rogue Squadron 2 and 3.
2022-04-22VideoCommon: Rename norm0/norm1/norm2 to normal/tangent/binormalPokechu22
2022-04-22VertexShaderGen: Simplify normal calculationPokechu22
This is a readability change; there should be no functional or performance differences.
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-09-09Merge pull request #10012 from Pokechu22/thps4-green-skyJMC47
UberShaderVertex: Fix Tony Hawk Pro Skater 4
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-08-18UberShaderVertex: Simplify color channel logicPokechu22
2021-08-18UberShaderVertex: Fix Tony Hawk Pro Skater 4Pokechu22
Fixes https://bugs.dolphin-emu.org/issues/12620 The changed code did not match the corresponding code in VertexShaderGen. Some parts of the sky have 2 color channels in each vertex, while others only have 1, despite only color channel 0 being used and XFMEM_SETNUMCHAN being set to 1 for both of them. The old code (from #4601) caused channel 0 to be set to channel 1 if the vertex contained both color channels but the number of channels was set to 1, which is wrong.
2021-07-24Convert NaN to 1 when generating texture coordinatesPokechu22
This fixes eyelids in Shadow the Hedgehog during cutscenes (https://bugs.dolphin-emu.org/issues/11458)
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-09Hack to hide debug cubes in Super Mario SunshinePokechu22
... while not breaking other games.
2021-05-07Change BitfieldExtract to use a pointer to the bitfield memberPokechu22
2021-03-06Convert XFMemory to BitField and enum classPokechu22
Additionally a new ClipDisable union has been added (though it is not currently used by Dolphin).
2020-11-23Fix vertex ubershader GLES compile errorsJosJuice
Regression from 51724c1.
2020-11-20LightingShaderGen: Always calculate lighting for both color channelsStenzek
Cel-damage depends on lighting being calculated for the first channel even though there is no color in the vertex format (defaults to the material color). If lighting for the channel is not enabled, the vertex will use the default color as before. The default value of the color is determined by the number of elements in the vertex format. This fixes the grey cubes in Super Mario Sunshine. If the color channel count is zero, we set the color to black before the end of the vertex shader. It's possible that this would be undefined behavior on hardware if a vertex color index that was greater than the channel count was used within TEV.
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-20UberShaderVertex: Migrate over to fmtLioncash
Continues migration of the shader generators over to fmt. With this, all that's left to move over are the pixel shaders (regular and ubershader variants)
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-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.
2017-11-22LightingShaderGen: Always calculate lighting for both color channelsStenzek
Cel-damage uses the color from the lighting stage of the vertex pipeline as texture coordinates, but sets numColorChans to zero. We now calculate the colors in all cases, but override the color before writing it from the vertex shader if numColorChans is set to a lower value.
2017-07-30Ubershaders: Support per-pixel lightingStenzek
2017-07-30ShaderGen: Use consistent variable names for texture coordinatesStenzek
2017-07-30ShaderGen: Implement vertex ubershadersStenzek