Merge pull request #7832 from stenzek/xfb-decoding-regression

TextureCache: Fix GPU decoding of XFB copies
This commit is contained in:
Tilka 2019-02-28 11:03:25 +00:00 committed by GitHub
commit 6be35422e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 10 deletions

View File

@ -108,7 +108,7 @@ bool VertexManager::Initialize()
format_mapping = {{ format_mapping = {{
{TEXEL_BUFFER_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT}, {TEXEL_BUFFER_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT},
{TEXEL_BUFFER_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT}, {TEXEL_BUFFER_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT},
{TEXEL_BUFFER_FORMAT_RGBA8_UINT, DXGI_FORMAT_R8G8B8A8_UNORM}, {TEXEL_BUFFER_FORMAT_RGBA8_UINT, DXGI_FORMAT_R8G8B8A8_UINT},
{TEXEL_BUFFER_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT}, {TEXEL_BUFFER_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT},
}}; }};
for (const auto& it : format_mapping) for (const auto& it : format_mapping)

View File

@ -75,7 +75,7 @@ bool VertexManager::Initialize()
format_mapping = {{ format_mapping = {{
{TEXEL_BUFFER_FORMAT_R8_UINT, GL_R8UI}, {TEXEL_BUFFER_FORMAT_R8_UINT, GL_R8UI},
{TEXEL_BUFFER_FORMAT_R16_UINT, GL_R16UI}, {TEXEL_BUFFER_FORMAT_R16_UINT, GL_R16UI},
{TEXEL_BUFFER_FORMAT_RGBA8_UINT, GL_RGBA8}, {TEXEL_BUFFER_FORMAT_RGBA8_UINT, GL_RGBA8UI},
{TEXEL_BUFFER_FORMAT_R32G32_UINT, GL_RG32UI}, {TEXEL_BUFFER_FORMAT_R32G32_UINT, GL_RG32UI},
}}; }};
glGenTextures(static_cast<GLsizei>(m_texel_buffer_views.size()), m_texel_buffer_views.data()); glGenTextures(static_cast<GLsizei>(m_texel_buffer_views.size()), m_texel_buffer_views.data());

View File

@ -101,7 +101,7 @@ bool VertexManager::Initialize()
format_mapping = {{ format_mapping = {{
{TEXEL_BUFFER_FORMAT_R8_UINT, VK_FORMAT_R8_UINT}, {TEXEL_BUFFER_FORMAT_R8_UINT, VK_FORMAT_R8_UINT},
{TEXEL_BUFFER_FORMAT_R16_UINT, VK_FORMAT_R16_UINT}, {TEXEL_BUFFER_FORMAT_R16_UINT, VK_FORMAT_R16_UINT},
{TEXEL_BUFFER_FORMAT_RGBA8_UINT, VK_FORMAT_R8G8B8A8_UNORM}, {TEXEL_BUFFER_FORMAT_RGBA8_UINT, VK_FORMAT_R8G8B8A8_UINT},
{TEXEL_BUFFER_FORMAT_R32G32_UINT, VK_FORMAT_R32G32_UINT}, {TEXEL_BUFFER_FORMAT_R32G32_UINT, VK_FORMAT_R32G32_UINT},
}}; }};
for (const auto& it : format_mapping) for (const auto& it : format_mapping)

View File

@ -1593,9 +1593,9 @@ void TextureCacheBase::LoadTextureLevelZeroFromMemory(TCacheEntry* entry_to_upda
const u8* tlut = &texMem[tex_info.tlut_address]; const u8* tlut = &texMem[tex_info.tlut_address];
if (!decode_on_gpu || if (!decode_on_gpu ||
DecodeTextureOnGPU(entry_to_update, 0, tex_info.src_data, tex_info.total_bytes, !DecodeTextureOnGPU(entry_to_update, 0, tex_info.src_data, tex_info.total_bytes,
tex_info.full_format.texfmt, tex_info.native_width, tex_info.native_height, tex_info.full_format.texfmt, tex_info.native_width,
tex_info.expanded_width, tex_info.expanded_height, tex_info.native_height, tex_info.expanded_width, tex_info.expanded_height,
tex_info.bytes_per_block * tex_info.bytes_per_block *
(tex_info.expanded_width / tex_info.block_width), (tex_info.expanded_width / tex_info.block_width),
tlut, tex_info.full_format.tlutfmt)) tlut, tex_info.full_format.tlutfmt))

View File

@ -1345,7 +1345,7 @@ static const std::map<TextureFormat, DecodingShaderInfo> s_decoding_shader_info{
int buffer_pos = int(u_src_offset + (uv.y * u_src_row_stride) + (uv.x / 2u)); int buffer_pos = int(u_src_offset + (uv.y * u_src_row_stride) + (uv.x / 2u));
float4 yuyv = float4(texelFetch(s_input_buffer, buffer_pos)); float4 yuyv = float4(texelFetch(s_input_buffer, buffer_pos));
float y = mix(yuyv.r, yuyv.b, (uv.x & 1u) == 1u); float y = (uv.x & 1u) != 0u ? yuyv.r : yuyv.g;
float yComp = 1.164 * (y - 16.0); float yComp = 1.164 * (y - 16.0);
float uComp = yuyv.g - 128.0; float uComp = yuyv.g - 128.0;