From 094e165415bb7b58145389e82928639a954d11f1 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 20 Jan 2014 17:00:17 -0800 Subject: [PATCH] Fixing copy. --- src/xenia/gpu/d3d11/d3d11_graphics_driver.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xenia/gpu/d3d11/d3d11_graphics_driver.cc b/src/xenia/gpu/d3d11/d3d11_graphics_driver.cc index 98d92c9ff..64959922b 100644 --- a/src/xenia/gpu/d3d11/d3d11_graphics_driver.cc +++ b/src/xenia/gpu/d3d11/d3d11_graphics_driver.cc @@ -1063,7 +1063,7 @@ D3D11GraphicsDriver::TextureInfo D3D11GraphicsDriver::GetTextureInfo( info.block_height = 0; switch (fetch.format) { case FMT_8_8_8_8: - info.format = DXGI_FORMAT_R8G8B8A8_UNORM; + info.format = DXGI_FORMAT_B8G8R8A8_UNORM; info.bpp = 4; break; case FMT_4_4_4_4: @@ -1204,8 +1204,12 @@ int D3D11GraphicsDriver::FetchTexture2D( } const uint8_t* src = memory_->Translate(address); uint8_t* dest = (uint8_t*)res.pData; - for (size_t n = 0; n < data_size; n++) { - dest[n] = src[n]; + for (size_t y = 0; y < height; y++) { + for (size_t x = 0; x < width * info.bpp; x++) { + dest[x] = src[x]; + } + src += data_pitch * info.bpp; + dest += res.RowPitch; } context_->Unmap(*out_texture, 0);