1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

d3d9: Use a different rvalue for depth bias on NV

This commit is contained in:
Christopher Egert 2022-11-08 23:47:01 +01:00 committed by Joshie
parent ecc2302389
commit e30b783505
2 changed files with 5 additions and 4 deletions

View File

@ -1382,7 +1382,8 @@ namespace dxvk {
m_flags.set(D3D9DeviceFlag::DirtyFramebuffer);
if (ds != nullptr) {
float rValue = GetDepthBufferRValue(ds->GetCommonTexture()->GetFormatMapping().FormatColor);
const int32_t vendorId = m_dxvkDevice->adapter()->deviceProperties().vendorID;
float rValue = GetDepthBufferRValue(ds->GetCommonTexture()->GetFormatMapping().FormatColor, vendorId);
if (m_depthBiasScale != rValue) {
m_depthBiasScale = rValue;
m_flags.set(D3D9DeviceFlag::DirtyDepthBias);

View File

@ -176,14 +176,14 @@ namespace dxvk {
void ConvertRect(RECT rect, VkOffset2D& offset, VkExtent2D& extent);
inline float GetDepthBufferRValue(VkFormat Format) {
inline float GetDepthBufferRValue(VkFormat Format, int32_t vendorId) {
switch (Format) {
case VK_FORMAT_D16_UNORM_S8_UINT:
case VK_FORMAT_D16_UNORM:
return float(1 << 16);
return vendorId == 0x10de ? float(1 << 15) : float(1 << 16);
case VK_FORMAT_D24_UNORM_S8_UINT:
return float(1 << 24);
return vendorId == 0x10de ? float(1 << 23) : float(1 << 24);
default:
case VK_FORMAT_D32_SFLOAT_S8_UINT: