d3d12: Support surface format R5G6B5

This commit is contained in:
Vincent Lejeune 2015-12-08 00:35:22 +01:00
parent 27807f3a61
commit d7b4b2fd49
2 changed files with 12 additions and 1 deletions

View File

@ -332,7 +332,7 @@ DXGI_FORMAT get_color_surface_format(u8 format) noexcept
{
switch (format)
{
case CELL_GCM_SURFACE_R5G6B5: return DXGI_FORMAT_R8G8B8A8_UNORM;
case CELL_GCM_SURFACE_R5G6B5: return DXGI_FORMAT_B5G6R5_UNORM;
case CELL_GCM_SURFACE_A8R8G8B8: return DXGI_FORMAT_R8G8B8A8_UNORM;
case CELL_GCM_SURFACE_F_W16Z16Y16X16: return DXGI_FORMAT_R16G16B16A16_FLOAT;
case CELL_GCM_SURFACE_F_X32: return DXGI_FORMAT_R32_FLOAT;

View File

@ -375,6 +375,9 @@ namespace
size_t row_pitch;
switch (color_surface_format)
{
case CELL_GCM_SURFACE_R5G6B5:
row_pitch = align(clip_w * 2, 256);
break;
case CELL_GCM_SURFACE_A8R8G8B8:
row_pitch = align(clip_w * 4, 256);
break;
@ -571,6 +574,10 @@ void D3D12GSRender::copy_render_target_to_dma_location()
size_t srcPitch, dstPitch;
switch (m_surface.color_format)
{
case CELL_GCM_SURFACE_R5G6B5:
srcPitch = align(clip_w * 2, 256);
dstPitch = clip_w * 2;
break;
case CELL_GCM_SURFACE_A8R8G8B8:
srcPitch = align(clip_w * 4, 256);
dstPitch = clip_w * 4;
@ -617,6 +624,10 @@ void D3D12GSRender::copy_render_targets_to_memory(void *buffer, u8 rtt)
size_t srcPitch, dstPitch;
switch (m_surface.color_format)
{
case CELL_GCM_SURFACE_R5G6B5:
srcPitch = align(clip_w * 2, 256);
dstPitch = clip_w * 2;
break;
case CELL_GCM_SURFACE_A8R8G8B8:
srcPitch = align(clip_w * 4, 256);
dstPitch = clip_w * 4;