[dxvk] Clean up sampler creation code

This commit is contained in:
Philip Rebohle 2022-07-18 14:36:08 +02:00
parent 6276d5503c
commit 04f43f0d2c
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 3 additions and 8 deletions

View File

@ -7,15 +7,10 @@ namespace dxvk {
DxvkDevice* device,
const DxvkSamplerCreateInfo& info)
: m_vkd(device->vkd()) {
VkSamplerCustomBorderColorCreateInfoEXT borderColorInfo;
borderColorInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT;
borderColorInfo.pNext = nullptr;
VkSamplerCustomBorderColorCreateInfoEXT borderColorInfo = { VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT };
borderColorInfo.customBorderColor = info.borderColor;
borderColorInfo.format = VK_FORMAT_UNDEFINED;
VkSamplerCreateInfo samplerInfo;
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr;
VkSamplerCreateInfo samplerInfo = { VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO };
samplerInfo.flags = info.nonSeamless ? VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT : 0;
samplerInfo.magFilter = info.magFilter;
samplerInfo.minFilter = info.minFilter;
@ -42,7 +37,7 @@ namespace dxvk {
samplerInfo.borderColor = getBorderColor(device, info);
if (samplerInfo.borderColor == VK_BORDER_COLOR_FLOAT_CUSTOM_EXT)
samplerInfo.pNext = &borderColorInfo;
borderColorInfo.pNext = std::exchange(samplerInfo.pNext, &borderColorInfo);
if (m_vkd->vkCreateSampler(m_vkd->device(),
&samplerInfo, nullptr, &m_sampler) != VK_SUCCESS)