mirror of
https://github.com/utmapp/angle.git
synced 2026-12-01 22:13:25 -10:00
Add workaround for B5G6R5 format in Intel driver
In Intel driver, the data with format DXGI_FORMAT_B5G6R5_UNORM will be parsed incorrectly. According to https://msdn.microsoft.com/en-us/library/windows/desktop/ff471324(v=vs.85).aspx DXGI_FORMAT_B5G6R5_UNORM should be equivalent to D3DFMT_R5G6B5. However, the data will be treated as B5G6R5 not R5G6B5. This workaroud will disable B5G6R5 support when it's Intel driver. By default, it will use R8G8B8A8 format. BUG=chromium:644610 TEST=dEQP-GLES3.functional.fbo.blit.default_framebuffer.rgb565* Change-Id: I9d64a9bcedf9247de6950d345ed2d3fb00170d30 Reviewed-on: https://chromium-review.googlesource.com/380421 Commit-Queue: Jamie Madill <[email protected]> Reviewed-by: Jamie Madill <[email protected]>
This commit is contained in:
1 parent
7ffdda9aa9
commit
2c07eb2188
3 files changed
+16
-2
No files matched your search
@@ -80,6 +80,11 @@ struct WorkaroundsD3D
|
||||
// We can work around this bug by doing an internal blit to a temporary single-channel texture
|
||||
// before we sample.
|
||||
bool emulateTinyStencilTextures = false;
|
||||
|
||||
// In Intel driver, the data with format DXGI_FORMAT_B5G6R5_UNORM will be parsed incorrectly.
|
||||
// This workaroud will disable B5G6R5 support when it's Intel driver. By default, it will use
|
||||
// R8G8B8A8 format.
|
||||
bool disableB5G6R5Support = false;
|
||||
};
|
||||
|
||||
} // namespace rx
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
// TODO(jmadill): Disable when we have a fixed driver version.
|
||||
workarounds.emulateTinyStencilTextures = (adapterDesc.VendorId == VENDOR_ID_AMD);
|
||||
|
||||
Reference in new issue
Block a user