| Age | Commit message (Collapse) | Author |
|
We don't use explicit locations in OpenGL currently, so this breaks
when we use alternative names in the geometry shaders.
|
|
|
|
D3D has no mix() equivalent with a bool parameter. Compilers should be
able to optimize the ternary into a select anyway.
|
|
|
|
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.
|
|
TextureConversionShader: Don't sample from adjacent rows when not needed
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
Round values in swizzlers
|
|
|
|
|
|
|
|
display of PAL games that run in 50hz mode.
|
|
|
|
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.
|
|
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.
|
|
|
|
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;
```
|
|
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.
|
|
|
|
|
|
|
|
|
|
This also shifts the SSBO index from index 3 to index 0.
|
|
|
|
Allows for forward declarations in most places, which prevents dumping
unrelated VideoCommon.h contents directly into headers.
|
|
|
|
|
|
Also remedies places where the video backends and core rely on things
being indirectly included.
|
|
encode depth.
|
|
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.
|
|
VideoCommon: Remove unused parameters
|
|
|
|
This reverts commit 0f2c72f0f844c219e168faa7de8dd515f8723fdc.
|
|
Credits go to Galop1n for designing this technique and to BhaaLseN for cleaning up the commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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).
|
|
|
|
|
|
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.
|