mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 22:29:16 +01:00
[dxvk] Use custom border colors if available
This commit is contained in:
parent
0648314451
commit
1fc6e3adbe
@ -7,6 +7,12 @@ namespace dxvk {
|
|||||||
DxvkDevice* device,
|
DxvkDevice* device,
|
||||||
const DxvkSamplerCreateInfo& info)
|
const DxvkSamplerCreateInfo& info)
|
||||||
: m_vkd(device->vkd()) {
|
: m_vkd(device->vkd()) {
|
||||||
|
VkSamplerCustomBorderColorCreateInfoEXT borderColorInfo;
|
||||||
|
borderColorInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT;
|
||||||
|
borderColorInfo.pNext = nullptr;
|
||||||
|
borderColorInfo.customBorderColor = info.borderColor;
|
||||||
|
borderColorInfo.format = VK_FORMAT_UNDEFINED;
|
||||||
|
|
||||||
VkSamplerCreateInfo samplerInfo;
|
VkSamplerCreateInfo samplerInfo;
|
||||||
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
||||||
samplerInfo.pNext = nullptr;
|
samplerInfo.pNext = nullptr;
|
||||||
@ -32,6 +38,9 @@ namespace dxvk {
|
|||||||
|| samplerInfo.addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER)
|
|| samplerInfo.addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER)
|
||||||
samplerInfo.borderColor = getBorderColor(device, info);
|
samplerInfo.borderColor = getBorderColor(device, info);
|
||||||
|
|
||||||
|
if (samplerInfo.borderColor == VK_BORDER_COLOR_FLOAT_CUSTOM_EXT)
|
||||||
|
samplerInfo.pNext = &borderColorInfo;
|
||||||
|
|
||||||
if (m_vkd->vkCreateSampler(m_vkd->device(),
|
if (m_vkd->vkCreateSampler(m_vkd->device(),
|
||||||
&samplerInfo, nullptr, &m_sampler) != VK_SUCCESS)
|
&samplerInfo, nullptr, &m_sampler) != VK_SUCCESS)
|
||||||
throw DxvkError("DxvkSampler::DxvkSampler: Failed to create sampler");
|
throw DxvkError("DxvkSampler::DxvkSampler: Failed to create sampler");
|
||||||
@ -61,11 +70,12 @@ namespace dxvk {
|
|||||||
return e.second;
|
return e.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::warn(str::format(
|
if (!device->features().extCustomBorderColor.customBorderColorWithoutFormat) {
|
||||||
"DXVK: No matching border color found for (",
|
Logger::warn("DXVK: Custom border colors not supported");
|
||||||
info.borderColor.float32[0], ",", info.borderColor.float32[1], ",",
|
|
||||||
info.borderColor.float32[2], ",", info.borderColor.float32[3], ")"));
|
|
||||||
return VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
|
return VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return VK_BORDER_COLOR_FLOAT_CUSTOM_EXT;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user