diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-11 23:20:45 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-11 23:20:45 +0200 |
commit | 43da1468793c6a22024bc90290234fa1dcf09b14 (patch) | |
tree | 3f012200ef3c934f33db1a4ef2b790fae3141860 /gfx | |
parent | 59b5c39245be0f4acab479c2d6f610991a6ee8d5 (diff) | |
download | aura-central-43da1468793c6a22024bc90290234fa1dcf09b14.tar.gz |
Ad workaround for broken B5G6R5 format in Intel driver.
Diffstat (limited to 'gfx')
3 files changed, 16 insertions, 2 deletions
diff --git a/gfx/angle/src/libANGLE/renderer/d3d/WorkaroundsD3D.h b/gfx/angle/src/libANGLE/renderer/d3d/WorkaroundsD3D.h index 83abab81e..a2faf71d9 100755 --- a/gfx/angle/src/libANGLE/renderer/d3d/WorkaroundsD3D.h +++ b/gfx/angle/src/libANGLE/renderer/d3d/WorkaroundsD3D.h @@ -67,6 +67,11 @@ struct WorkaroundsD3D // Some drivers (NVIDIA) do not take into account the base level of the texture in the results // of the HLSL GetDimensions builtin. bool getDimensionsIgnoresBaseLevel = false; + + // In the Intel driver, data with format DXGI_FORMAT_B5G6R5_UNORM will be parsed incorrectly. + // This workaroud will disable B5G6R5 support when it's Intel's driver. By default, we will + // use R8G8B8A8 as format. + bool disableB5G6R5Support = false; // On some Intel drivers, HLSL's function texture.Load returns 0 when the parameter Location // is negative, even if the sum of Offset and Location is in range. This may cause errors when diff --git a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp index dcc2233fc..d03347d25 100755 --- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp +++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp @@ -896,11 +896,19 @@ void Renderer11::populateRenderer11DeviceCaps() } } - hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B5G6R5_UNORM, &(mRenderer11DeviceCaps.B5G6R5support)); - if (FAILED(hr)) + if (getWorkarounds().disableB5G6R5Support) { mRenderer11DeviceCaps.B5G6R5support = 0; } + else + { + hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B5G6R5_UNORM, + &(mRenderer11DeviceCaps.B5G6R5support)); + if (FAILED(hr)) + { + mRenderer11DeviceCaps.B5G6R5support = 0; + } + } hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B4G4R4A4_UNORM, &(mRenderer11DeviceCaps.B4G4R4A4support)); if (FAILED(hr)) diff --git a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp index 6bad7b2ec..f7548c4ee 100755 --- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp +++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp @@ -1541,6 +1541,7 @@ WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps, workarounds.getDimensionsIgnoresBaseLevel = (adapterDesc.VendorId == VENDOR_ID_NVIDIA); workarounds.preAddTexelFetchOffsets = (adapterDesc.VendorId == VENDOR_ID_INTEL); + workarounds.disableB5G6R5Support = (adapterDesc.VendorId == VENDOR_ID_INTEL); return workarounds; } |