mirror of
https://github.com/izzy2lost/xenia-edge.git
synced 2026-07-06 00:20:26 -07:00
[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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user