Commit 2c07eb21 by Qin Jiajia Committed by Commit Bot

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 <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 7ffdda9a
...@@ -80,6 +80,11 @@ struct WorkaroundsD3D ...@@ -80,6 +80,11 @@ struct WorkaroundsD3D
// We can work around this bug by doing an internal blit to a temporary single-channel texture // We can work around this bug by doing an internal blit to a temporary single-channel texture
// before we sample. // before we sample.
bool emulateTinyStencilTextures = false; 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 } // namespace rx
......
...@@ -896,11 +896,19 @@ void Renderer11::populateRenderer11DeviceCaps() ...@@ -896,11 +896,19 @@ void Renderer11::populateRenderer11DeviceCaps()
} }
} }
hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B5G6R5_UNORM, &(mRenderer11DeviceCaps.B5G6R5support)); if (getWorkarounds().disableB5G6R5Support)
{
mRenderer11DeviceCaps.B5G6R5support = 0;
}
else
{
hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B5G6R5_UNORM,
&(mRenderer11DeviceCaps.B5G6R5support));
if (FAILED(hr)) if (FAILED(hr))
{ {
mRenderer11DeviceCaps.B5G6R5support = 0; mRenderer11DeviceCaps.B5G6R5support = 0;
} }
}
hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B4G4R4A4_UNORM, &(mRenderer11DeviceCaps.B4G4R4A4support)); hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B4G4R4A4_UNORM, &(mRenderer11DeviceCaps.B4G4R4A4support));
if (FAILED(hr)) if (FAILED(hr))
......
...@@ -1541,6 +1541,7 @@ WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps, ...@@ -1541,6 +1541,7 @@ WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps,
workarounds.getDimensionsIgnoresBaseLevel = (adapterDesc.VendorId == VENDOR_ID_NVIDIA); workarounds.getDimensionsIgnoresBaseLevel = (adapterDesc.VendorId == VENDOR_ID_NVIDIA);
workarounds.preAddTexelFetchOffsets = (adapterDesc.VendorId == VENDOR_ID_INTEL); workarounds.preAddTexelFetchOffsets = (adapterDesc.VendorId == VENDOR_ID_INTEL);
workarounds.disableB5G6R5Support = (adapterDesc.VendorId == VENDOR_ID_INTEL);
// TODO(jmadill): Disable when we have a fixed driver version. // TODO(jmadill): Disable when we have a fixed driver version.
workarounds.emulateTinyStencilTextures = (adapterDesc.VendorId == VENDOR_ID_AMD); workarounds.emulateTinyStencilTextures = (adapterDesc.VendorId == VENDOR_ID_AMD);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment