mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #15979 from unknownbrackets/d3d-tex16
d3d9: Correct decode of 16-bit textures
This commit is contained in:
commit
c438230204
2 changed files with 18 additions and 2 deletions
|
@ -59,7 +59,15 @@ static const D3D11_INPUT_ELEMENT_DESC g_QuadVertexElements[] = {
|
|||
|
||||
Draw::DataFormat FromD3D11Format(u32 fmt) {
|
||||
switch (fmt) {
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM: default: return Draw::DataFormat::R8G8B8A8_UNORM;
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
return Draw::DataFormat::A4R4G4B4_UNORM_PACK16;
|
||||
case DXGI_FORMAT_B5G5R5A1_UNORM:
|
||||
return Draw::DataFormat::A1R5G5B5_UNORM_PACK16;
|
||||
case DXGI_FORMAT_B5G6R5_UNORM:
|
||||
return Draw::DataFormat::R5G6B5_UNORM_PACK16;
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
default:
|
||||
return Draw::DataFormat::R8G8B8A8_UNORM;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,15 @@
|
|||
|
||||
Draw::DataFormat FromD3D9Format(u32 fmt) {
|
||||
switch (fmt) {
|
||||
case D3DFMT_A8R8G8B8: default: return Draw::DataFormat::R8G8B8A8_UNORM;
|
||||
case D3DFMT_A4R4G4B4:
|
||||
return Draw::DataFormat::B4G4R4A4_UNORM_PACK16;
|
||||
case D3DFMT_A1R5G5B5:
|
||||
return Draw::DataFormat::A1R5G5B5_UNORM_PACK16;
|
||||
case D3DFMT_R5G6B5:
|
||||
return Draw::DataFormat::R5G6B5_UNORM_PACK16;
|
||||
case D3DFMT_A8R8G8B8:
|
||||
default:
|
||||
return Draw::DataFormat::R8G8B8A8_UNORM;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue