summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureConverterShaderGen.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-09VideoCommon: Move backend_info out of VideoConfig struct.Jordan Woyak
2023-12-20VideoCommon: apply "force 24-bit color" to EFB-to-VRAM copies as wellTillmann Karras
2022-07-17Fix OpenGL error on M1 Mac.Joon Park
Followup to #10466. Resolves the following error: ERROR: 0:85: '&' does not operate on 'uvec3' and 'int'
2022-07-16Rework TextureConverterShaderGen for hardware accuracy and simplicityPokechu22
2022-07-16Restructure parameters to TetxureConverterShaderGen/TextureConversionShaderPokechu22
This will be used for later refactoring for increased accuracy.
2022-07-15Remove casts to integers for texture and EFB formatsPokechu22
The only remaining casts for these types that I know of are in TextureInfo (where format_name is set to the int version of the format, and since that affects filenames and probably would break resource packs, I'm not changing it) and in TextureDecoder_Common's TexDecoder_DrawOverlay, which will be handled separately.
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 X3571 (negative base for pow())Dentomologist
Add abs() to fix "pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them".
2022-06-24D3D / VideoCommon: generate HLSL from SPIRViwubcode
2022-01-25TextureConverterShaderGen: Add missing newlinePokechu22
2021-12-20TextureConverterShaderGen: Set alpha to 1 on intensity formats if EFB lacks ↵Pokechu22
alpha We were already doing this for non-intensity formats, but it seems like the same applies to intensity formats.
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-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-17VideoCommon: Migrate over to fmtLioncash
Migrates off the printf-based formatting where applicable.
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.
2019-12-03VideoCommon/TextureConverterShaderGen: Convert over to fmtLioncash
Easily the most straightforward to convert over, given the lack of significant formatting arguments.
2019-07-18EFB2Tex: Set alpha channel of Z24X8 copies to 1Stenzek
Matches EFB2RAM.
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-04-20ShaderGen: Use interface blocks when geometry shaders are supportedStenzek
We don't use explicit locations in OpenGL currently, so this breaks when we use alternative names in the geometry shaders.
2019-02-19Move most backend functionality to VideoCommonStenzek
2019-02-17TextureConverterShader: Write EFB2Tex XFB copies with alpha value of 1Stenzek
This way we don't end up with artifacts of the EFB's alpha values in frame dumps. XFB copies loaded from RAM also set the alpha to 1, so this will match.
2018-05-22EFB2RAM: Apply copy filter as a float coefficient after samplingStenzek
Using 8-bit integer math here lead to precision loss for depth copies, which broke various effects in games, e.g. lens flare in MK:DD. It's unlikely the console implements this as a floating-point multiply (fixed-point perhaps), but since we have the float round trip in our EFB2RAM shaders anyway, it's not going to make things any worse. If we do rewrite our shaders to use integer math completely, then it might be worth switching this conversion back to integers. However, the range of the values (format) should be known, or we should expand all values out to 24-bits first.
2018-05-03TextureConversionShader: Don't sample from adjacent rows when not neededStenzek
2018-05-02TextureConversionShader: Fix compile errors in OpenGL ESStenzek
2018-04-29Implement EFB copy filter and gamma in hardware backendsStenzek
Also makes y_scale a dynamic parameter for EFB copies, as it doesn't make sense to keep it as part of the uid, otherwise we're generating redundant shaders.
2017-12-19Reimplement EFB copy for intensity formatsEmmanuel Gil Peyrot
This is the direct continuation of #5887, and removes the last usage of the colmat matrix in EFB copy conversion shaders.
2017-12-12Fix GLES GPU texture conversion shaderJonathan Hamilton
GLES doesn't support C-style array initialisers, so stuff like: Type var[2] = { VALUE_A, VALUE_B }; isn't supported in GLES (it was added in GL_ARB_shading_language_420pack). The texture conversion shader used this, so would fail to compile on GLES.
2017-12-06TextureConverterShaderGen: Make generated shaders HLSL-compatibleStenzek
2017-12-02VideoCommon: Reimplement texture format conversionEmmanuel Gil Peyrot
This fixes the rendering of the scan visor in Metroid Prime 2: Echoes, as seen in https://fifoci.dolphin-emu.org/dff/mp2-scanner/ The alpha channel was off-by-one on Ivy Bridge due to the rounding after multiplication with colmat. This commit removes this matrix altogether in most cases, making them simple GLSL swizzles.
2017-12-02VideoCommon: Create a namespace for TextureConversionShaderGen.degasus
2017-12-02VideoBackends: Use VideoCommon shader generators for efb2tex copies.Markus Wick
This will generate one shader per copy format. For now, it is the same shader with the colmat hard coded. So it should already improve the GPU performance a bit, but a rewrite of the shader generator is suggested. Half of the patch is done by linkmauve1: VideoCommon: Reorganise the shader writes.