mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
Ad workaround for broken B5G6R5 format in Intel driver.
This commit is contained in:
parent
bdf323b915
commit
801ed9ce01
3 changed files with 16 additions and 2 deletions
|
|
@ -68,6 +68,11 @@ struct WorkaroundsD3D
|
||||||
// of the HLSL GetDimensions builtin.
|
// of the HLSL GetDimensions builtin.
|
||||||
bool getDimensionsIgnoresBaseLevel = false;
|
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
|
// 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
|
// is negative, even if the sum of Offset and Location is in range. This may cause errors when
|
||||||
// translating GLSL's function texelFetchOffset into texture.Load, as it is valid for
|
// translating GLSL's function texelFetchOffset into texture.Load, as it is valid for
|
||||||
|
|
|
||||||
|
|
@ -896,11 +896,19 @@ void Renderer11::populateRenderer11DeviceCaps()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B5G6R5_UNORM, &(mRenderer11DeviceCaps.B5G6R5support));
|
if (getWorkarounds().disableB5G6R5Support)
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
{
|
||||||
mRenderer11DeviceCaps.B5G6R5support = 0;
|
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));
|
hr = mDevice->CheckFormatSupport(DXGI_FORMAT_B4G4R4A4_UNORM, &(mRenderer11DeviceCaps.B4G4R4A4support));
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
return workarounds;
|
return workarounds;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue