[D3D12] Remove gamma from source_is_64bpp calculation

When gamma_render_target_as_unorm16_ is enabled gamma render targets
are stored as R16G16B16A16_UNORM. However true 64bpp formats store TWO
32bpp pixels packed together in memory. Gamma as R16G16B16A16 stores
ONE pixel with 4 components at higher precision. It's 64bpp in memory
size but represents a single pixel, not two packed pixels.

The transfer shader code assumes 64bpp means "two 32bpp halves packed
together" and applies coordinate transformations accordingly (halving X
coordinates, selecting high/low halves). This is wrong for gamma - it
has a 1:1 pixel mapping, just with more precision per pixel.

Marking gamma as 64bpp for dest is fine because the shader writes the
correct number of bytes. But marking it for source triggers incorrect
coordinate math that cuts the image in half (as seen in Just Cause 2).
This commit is contained in:
Herman S.
2026-01-26 14:49:42 +09:00
parent 272ca791e7
commit fbe70c60ae
@@ -2172,10 +2172,7 @@ D3D12RenderTargetCache::GetOrCreateTransferPipelines(TransferShaderKey key) {
assert_zero(rs & kTransferUsedRootParameterDepthSRVBit);
assert_zero(rs & kTransferUsedRootParameterStencilSRVBit);
source_is_64bpp =
xenos::IsColorRenderTargetFormat64bpp(source_color_format) ||
(source_color_format ==
xenos::ColorRenderTargetFormat::k_8_8_8_8_GAMMA &&
gamma_render_target_as_unorm16_);
xenos::IsColorRenderTargetFormat64bpp(source_color_format);
source_color_format_component_count =
xenos::GetColorRenderTargetFormatComponentCount(source_color_format);
if (dest_is_stencil_bit) {