mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 07:21:25 +12:00
d3d12: Fix texture loading for fw_fog.ppu.elf
Color are wrong though
This commit is contained in:
parent
7b571aab70
commit
68a62f897d
1 changed files with 4 additions and 2 deletions
|
@ -169,6 +169,8 @@ size_t D3D12GSRender::UploadTextures()
|
||||||
// Upload with correct rowpitch
|
// Upload with correct rowpitch
|
||||||
for (unsigned row = 0; row < heightInBlocks; row++)
|
for (unsigned row = 0; row < heightInBlocks; row++)
|
||||||
{
|
{
|
||||||
|
size_t m_texture_pitch = m_textures[i].m_pitch;
|
||||||
|
if (!m_texture_pitch) m_texture_pitch = rowPitch;
|
||||||
if (format == CELL_GCM_TEXTURE_A8R8G8B8 && is_swizzled)
|
if (format == CELL_GCM_TEXTURE_A8R8G8B8 && is_swizzled)
|
||||||
{
|
{
|
||||||
u32 *src, *dst;
|
u32 *src, *dst;
|
||||||
|
@ -186,7 +188,7 @@ size_t D3D12GSRender::UploadTextures()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
streamToBuffer((char*)textureData + row * rowPitch, (char*)pixels + row * m_textures[i].m_pitch, m_textures[i].m_pitch);
|
streamToBuffer((char*)textureData + row * rowPitch, (char*)pixels + row * m_texture_pitch, m_texture_pitch);
|
||||||
}
|
}
|
||||||
Texture->Unmap(0, nullptr);
|
Texture->Unmap(0, nullptr);
|
||||||
|
|
||||||
|
@ -229,7 +231,7 @@ size_t D3D12GSRender::UploadTextures()
|
||||||
srvDesc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
|
srvDesc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
|
||||||
srvDesc.Format = dxgiFormat;
|
srvDesc.Format = dxgiFormat;
|
||||||
srvDesc.Texture2D.MipLevels = 1;
|
srvDesc.Texture2D.MipLevels = 1;
|
||||||
static const int RemapValue[4] =
|
const int RemapValue[4] =
|
||||||
{
|
{
|
||||||
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1,
|
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1,
|
||||||
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2,
|
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue