Vulkan: Very minor chnages after checking Best Practices with new validation layer

This commit is contained in:
Henrik Rydgård 2022-08-23 23:55:53 +02:00
parent 9db9574f0d
commit fc81b76b98
4 changed files with 4 additions and 2 deletions

View file

@ -648,6 +648,7 @@ VkResult VulkanContext::CreateDevice() {
} }
_dbg_assert_(found); _dbg_assert_(found);
// TODO: A lot of these are on by default in later Vulkan versions, should check for that, technically.
extensionsLookup_.KHR_maintenance1 = EnableDeviceExtension(VK_KHR_MAINTENANCE1_EXTENSION_NAME); extensionsLookup_.KHR_maintenance1 = EnableDeviceExtension(VK_KHR_MAINTENANCE1_EXTENSION_NAME);
extensionsLookup_.KHR_maintenance2 = EnableDeviceExtension(VK_KHR_MAINTENANCE2_EXTENSION_NAME); extensionsLookup_.KHR_maintenance2 = EnableDeviceExtension(VK_KHR_MAINTENANCE2_EXTENSION_NAME);
extensionsLookup_.KHR_maintenance3 = EnableDeviceExtension(VK_KHR_MAINTENANCE3_EXTENSION_NAME); extensionsLookup_.KHR_maintenance3 = EnableDeviceExtension(VK_KHR_MAINTENANCE3_EXTENSION_NAME);

View file

@ -667,7 +667,7 @@ public:
s.magFilter = desc.magFilter == TextureFilter::LINEAR ? VK_FILTER_LINEAR : VK_FILTER_NEAREST; s.magFilter = desc.magFilter == TextureFilter::LINEAR ? VK_FILTER_LINEAR : VK_FILTER_NEAREST;
s.minFilter = desc.minFilter == TextureFilter::LINEAR ? VK_FILTER_LINEAR : VK_FILTER_NEAREST; s.minFilter = desc.minFilter == TextureFilter::LINEAR ? VK_FILTER_LINEAR : VK_FILTER_NEAREST;
s.mipmapMode = desc.mipFilter == TextureFilter::LINEAR ? VK_SAMPLER_MIPMAP_MODE_LINEAR : VK_SAMPLER_MIPMAP_MODE_NEAREST; s.mipmapMode = desc.mipFilter == TextureFilter::LINEAR ? VK_SAMPLER_MIPMAP_MODE_LINEAR : VK_SAMPLER_MIPMAP_MODE_NEAREST;
s.maxLod = desc.maxLod; s.maxLod = VK_LOD_CLAMP_NONE;
VkResult res = vkCreateSampler(vulkan_->GetDevice(), &s, nullptr, &sampler_); VkResult res = vkCreateSampler(vulkan_->GetDevice(), &s, nullptr, &sampler_);
_assert_(VK_SUCCESS == res); _assert_(VK_SUCCESS == res);
} }

View file

@ -494,7 +494,6 @@ struct SamplerStateDesc {
TextureAddressMode wrapU; TextureAddressMode wrapU;
TextureAddressMode wrapV; TextureAddressMode wrapV;
TextureAddressMode wrapW; TextureAddressMode wrapW;
float maxLod;
bool shadowCompareEnabled; bool shadowCompareEnabled;
Comparison shadowCompareFunc; Comparison shadowCompareFunc;
BorderColor borderColor; BorderColor borderColor;

View file

@ -171,6 +171,7 @@ void Draw2D::Ensure2DResources() {
descLinear.mipFilter = TextureFilter::LINEAR; descLinear.mipFilter = TextureFilter::LINEAR;
descLinear.wrapU = TextureAddressMode::CLAMP_TO_EDGE; descLinear.wrapU = TextureAddressMode::CLAMP_TO_EDGE;
descLinear.wrapV = TextureAddressMode::CLAMP_TO_EDGE; descLinear.wrapV = TextureAddressMode::CLAMP_TO_EDGE;
descLinear.wrapW = TextureAddressMode::CLAMP_TO_EDGE;
draw2DSamplerLinear_ = draw_->CreateSamplerState(descLinear); draw2DSamplerLinear_ = draw_->CreateSamplerState(descLinear);
} }
@ -181,6 +182,7 @@ void Draw2D::Ensure2DResources() {
descNearest.mipFilter = TextureFilter::NEAREST; descNearest.mipFilter = TextureFilter::NEAREST;
descNearest.wrapU = TextureAddressMode::CLAMP_TO_EDGE; descNearest.wrapU = TextureAddressMode::CLAMP_TO_EDGE;
descNearest.wrapV = TextureAddressMode::CLAMP_TO_EDGE; descNearest.wrapV = TextureAddressMode::CLAMP_TO_EDGE;
descNearest.wrapW = TextureAddressMode::CLAMP_TO_EDGE;
draw2DSamplerNearest_ = draw_->CreateSamplerState(descNearest); draw2DSamplerNearest_ = draw_->CreateSamplerState(descNearest);
} }
} }