summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureConversionShader.cpp
AgeCommit message (Collapse)Author
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-17Merge pull request #6743 from stenzek/faster-disabled-copy-filterMarkus Wick
TextureConversionShader: Don't sample from adjacent rows when not needed
2018-05-03TextureConversionShader: Don't sample from adjacent rows when not neededStenzek
2018-05-03TextureConversionShader: Fix more implicit conversion errorsStenzek
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.
2018-01-11Some more implicit uint/float conversions in the texture decode shadersJonathan Hamilton
2018-01-11GLSL-ES doesn't allow implicit int/uint conversionsJonathan Hamilton
2017-12-06TextureConversionShader: Use round() instead of roundEven() in HLSLStenzek
HLSL does not define roundEven(), only round(). This means that the output may differ slightly for OpenGL vs Direct3D. However, it ensures consistency across OpenGL drivers, as round() in GLSL can go either way.
2017-12-02Merge pull request #5903 from linkmauve/fix-mp2eMarkus Wick
Round values in swizzlers
2017-12-02VideoCommon: Rename TextureConversionShader namespace.degasus
2017-11-17HybridXFB: Fix lint errorsiwubcode
2017-11-17Video Common: Add XFB decoding via the GPUiwubcode
2017-11-17Video Backends: Implement vertical scaling for xfb copies. This fixes theiwubcode
display of PAL games that run in 50hz mode.
2017-11-17Add support for hybrid XFBiwubcode
2017-08-07VideoCommon: Round values in swizzlers.Emmanuel Gil Peyrot
This was breaking Metroid Prime 2: Echoes’s scanner in some rooms, such as the one in https://fifoci.dolphin-emu.org/dff/mp2-scanner/ It was found on Ivy Bridge on Mesa, the alpha value read back from the EFB was off-by-4 in multiple objects, which was a conversion error because int4() is equivalent to floor() and the value wasn’t always higher.
2017-08-03Video: Clearly separate Texture and EFB Copy formatsN.E.C
Improve bookkeeping around formats. Hopefully make code less confusing. - Rename TlutFormat -> TLUTFormat to follow conventions. - Use enum classes to prevent using a Texture format where an EFB Copy format is expected or vice-versa. - Use common EFBCopyFormat names regardless of depth and YUV configurations.
2017-06-17TextureConversionShader: Use integer math for truncating EFB formatStenzek
2017-04-12TextureConversionShader: fix syntax errorMichael Maltese
Fixes a situation where the following invalid GLSL code is generated: ```glsl float3 texSample0 = texture(samp0, float3(uv0 + float2(0, 0) * sample_offset, 0.0)).rgb; float3 texSample0 = floor(float3 texSample0 * 63.0) / 63.0; float3 texSample1 = texture(samp0, float3(uv0 + float2(1, 0) * sample_offset, 0.0)).rgb; float3 texSample1 = floor(float3 texSample1 * 63.0) / 63.0; ```
2017-04-12TextureConversionShader: Consider source format of EFB for EFB2RAMStenzek
Currently, we use the alpha channel from the EFB even if the current format does not include an alpha channel. Now, the alpha channel is set to 1 if the format does not have an alpha channel, as well as truncating to 5/6 bits per channel. This matches the EFB-to-texture behavior.
2017-04-06TextureConversionShader: Add missing swap for index of C14X2 texturesStenzek
2017-04-06TextureConversionShader: Fix compile error in C14X2 decoderStenzek
2017-04-01VideoCommon: Add texture decoding shader generatorsStenzek
2016-10-01VideoCommon: Add APIType entry for VulkanStenzek
2016-10-01ShaderGen: Specify attribute/output locations/bindings explicitlyStenzek
This also shifts the SSBO index from index 3 to index 0.
2016-08-24TextureConversionShader: Don't use the float specifier in shader code.Jules Blok
2016-07-29VideoCommon: Make API_TYPE an enum classLioncash
Allows for forward declarations in most places, which prevents dumping unrelated VideoCommon.h contents directly into headers.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-02-22TextureConversionShader: Invert depth for Z24 encoder with D3DStenzek
2016-01-17VideoCommon: Header cleanupLioncash
Also remedies places where the video backends and core rely on things being indirectly included.
2016-01-13TextureConversionShader: Also invert color encoders if they're used to ↵Jules Blok
encode depth.
2015-09-06Move common EFB copy code into VideoCommonScott Mansell
Addded a few duplicated depth copy texture formats to the enum in TextureDecoder.h. These texture formats were already implemented in TextureCacheBase and the ogl/dx11 texture cache implementations.
2015-08-17Merge pull request #2861 from lioncash/paramMarkus Wick
VideoCommon: Remove unused parameters
2015-08-16TextureConversionShader: Remove an unused parameterLioncash
2015-08-15Revert "VideoCommon: Clamp integer conversions."Jules Blok
This reverts commit 0f2c72f0f844c219e168faa7de8dd515f8723fdc.
2015-05-26D3D: Depth range inversion.galop1n
Credits go to Galop1n for designing this technique and to BhaaLseN for cleaning up the commit.
2015-05-25Set copyright year to when a file was createdTillmann Karras
2015-05-25Update license headers to GPLv2+Tillmann Karras
2015-05-08TextureConversionShader: Use floating point values in clamp().Jules Blok
2015-05-08VideoCommon: Clamp integer conversions.Jules Blok
2015-05-08VideoBackends: Use proper floating point depth precision.Jules Blok
2015-02-21TextureConversionShader: Use a Texture2DArray to match the shader resource view.Jules Blok
2015-02-03Fix regression for D3D EFB depth copies.magumagu
On D3D, we read from the depth buffer using the format DXGI_FORMAT_R24_UNORM_X8_TYPELESS (essentially, the "r" component contains the depth, and the other components contain nothing).
2015-01-25Don't use boolean negation.magumagu
2015-01-25Fix RGBA8 encoding.magumagu
2015-01-25Fix shader so it's possible to use with D3D Map().magumagu
Well, that's not strictly true, but trying to memcpy between two buffers using different row lengths and different strides is at minimum extremely unintuitive.
2015-01-25More work.magumagu
2015-01-25WIP.magumagu
2014-12-05Common: Remove locale based functions from CommonFuncs.Lioncash
Since %f isn't used anymore in the shader generators, these can go.
2014-11-23use GL_TEXTURE_2D_ARRAY for most of our texturesdegasus