mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
DX11: Prefer DXGI_FORMAT_R8G8B8A8 to DXGI_FORMAT_B8G8R8A8 wherever appropriate.
Slightly modify the way we're doing screenshots once again, thanks to Orphis this time ;) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5743 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -38,6 +38,8 @@ D3D_FEATURE_LEVEL featlevel;
|
||||
D3DTexture2D* backbuf = NULL;
|
||||
HWND hWnd;
|
||||
|
||||
bool bgra_textures_supported;
|
||||
|
||||
#define NUM_SUPPORTED_FEATURE_LEVELS 3
|
||||
const D3D_FEATURE_LEVEL supported_feature_levels[NUM_SUPPORTED_FEATURE_LEVELS] = {
|
||||
D3D_FEATURE_LEVEL_11_0,
|
||||
@ -145,6 +147,11 @@ HRESULT Create(HWND wnd)
|
||||
|
||||
context->OMSetRenderTargets(1, &backbuf->GetRTV(), NULL);
|
||||
|
||||
// BGRA textures are easier to deal with in TextureCache, but might not be supported by the hardware
|
||||
UINT format_support;
|
||||
device->CheckFormatSupport(DXGI_FORMAT_B8G8R8A8_UNORM, &format_support);
|
||||
bgra_textures_supported = (format_support & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0;
|
||||
|
||||
gfxstate = new EmuGfxState;
|
||||
stateman = new StateManager;
|
||||
return S_OK;
|
||||
@ -181,6 +188,8 @@ D3DTexture2D* &GetBackBuffer() { return backbuf; }
|
||||
unsigned int GetBackBufferWidth() { return xres; }
|
||||
unsigned int GetBackBufferHeight() { return yres; }
|
||||
|
||||
bool BGRATexturesSupported() { return bgra_textures_supported; }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
// release all back buffer references
|
||||
|
Reference in New Issue
Block a user