Skip to content

Commit

Permalink
DX12: fix DRGB8 texture format (#2480)
Browse files Browse the repository at this point in the history
* DX12: set native sampler format to BGRA8

* DX12: fix DRGB8 texture format
  • Loading branch information
raven02 committed Mar 7, 2017
1 parent 87fe93e commit a168aa2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ DXGI_FORMAT get_texture_format(u8 format)
case CELL_GCM_TEXTURE_W16_Z16_Y16_X16_FLOAT: return DXGI_FORMAT_R16G16B16A16_FLOAT;
case CELL_GCM_TEXTURE_W32_Z32_Y32_X32_FLOAT: return DXGI_FORMAT_R32G32B32A32_FLOAT;
case CELL_GCM_TEXTURE_D1R5G5B5: return DXGI_FORMAT_B5G5R5A1_UNORM;
case CELL_GCM_TEXTURE_D8R8G8B8: return DXGI_FORMAT_R8G8B8A8_UNORM;
case CELL_GCM_TEXTURE_D8R8G8B8: return DXGI_FORMAT_B8G8R8A8_UNORM;
case CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8: return DXGI_FORMAT_G8R8_G8B8_UNORM;
case CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8: return DXGI_FORMAT_R8G8_B8G8_UNORM;
case CELL_GCM_TEXTURE_COMPRESSED_HILO8: return DXGI_FORMAT_G8R8_G8B8_UNORM;
Expand Down
9 changes: 8 additions & 1 deletion rpcs3/Emu/RSX/D3D12/D3D12Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,16 @@ void D3D12GSRender::upload_textures(ID3D12GraphicsCommandList *command_list, siz
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0,
D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0);
break;

case CELL_GCM_TEXTURE_D8R8G8B8:
shared_resource_view_desc.Shader4ComponentMapping = D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1,
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0,
D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_3,
D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1);
break;

case CELL_GCM_TEXTURE_A8R8G8B8:
case CELL_GCM_TEXTURE_D8R8G8B8:
{
u8 remap_a = rsx::method_registers.fragment_textures[i].remap() & 0x3;
u8 remap_r = (rsx::method_registers.fragment_textures[i].remap() >> 2) & 0x3;
Expand Down

0 comments on commit a168aa2

Please sign in to comment.