mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[dxvk] Clean up sampler creation code
This commit is contained in:
parent
6276d5503c
commit
04f43f0d2c
@ -7,15 +7,10 @@ namespace dxvk {
|
|||||||
DxvkDevice* device,
|
DxvkDevice* device,
|
||||||
const DxvkSamplerCreateInfo& info)
|
const DxvkSamplerCreateInfo& info)
|
||||||
: m_vkd(device->vkd()) {
|
: m_vkd(device->vkd()) {
|
||||||
VkSamplerCustomBorderColorCreateInfoEXT borderColorInfo;
|
VkSamplerCustomBorderColorCreateInfoEXT borderColorInfo = { VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT };
|
||||||
borderColorInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT;
|
|
||||||
borderColorInfo.pNext = nullptr;
|
|
||||||
borderColorInfo.customBorderColor = info.borderColor;
|
borderColorInfo.customBorderColor = info.borderColor;
|
||||||
borderColorInfo.format = VK_FORMAT_UNDEFINED;
|
|
||||||
|
|
||||||
VkSamplerCreateInfo samplerInfo;
|
VkSamplerCreateInfo samplerInfo = { VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO };
|
||||||
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
|
||||||
samplerInfo.pNext = nullptr;
|
|
||||||
samplerInfo.flags = info.nonSeamless ? VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT : 0;
|
samplerInfo.flags = info.nonSeamless ? VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT : 0;
|
||||||
samplerInfo.magFilter = info.magFilter;
|
samplerInfo.magFilter = info.magFilter;
|
||||||
samplerInfo.minFilter = info.minFilter;
|
samplerInfo.minFilter = info.minFilter;
|
||||||
@ -42,7 +37,7 @@ namespace dxvk {
|
|||||||
samplerInfo.borderColor = getBorderColor(device, info);
|
samplerInfo.borderColor = getBorderColor(device, info);
|
||||||
|
|
||||||
if (samplerInfo.borderColor == VK_BORDER_COLOR_FLOAT_CUSTOM_EXT)
|
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(),
|
if (m_vkd->vkCreateSampler(m_vkd->device(),
|
||||||
&samplerInfo, nullptr, &m_sampler) != VK_SUCCESS)
|
&samplerInfo, nullptr, &m_sampler) != VK_SUCCESS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user