diff --git a/intern/ghost/intern/GHOST_ContextVK.cc b/intern/ghost/intern/GHOST_ContextVK.cc index 5517e8df474..210e5439581 100644 --- a/intern/ghost/intern/GHOST_ContextVK.cc +++ b/intern/ghost/intern/GHOST_ContextVK.cc @@ -233,6 +233,7 @@ class GHOST_DeviceVK { #endif device_features.drawIndirectFirstInstance = VK_TRUE; device_features.fragmentStoresAndAtomics = VK_TRUE; + device_features.samplerAnisotropy = features.features.samplerAnisotropy; VkDeviceCreateInfo device_create_info = {}; device_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; diff --git a/source/blender/gpu/vulkan/vk_sampler.cc b/source/blender/gpu/vulkan/vk_sampler.cc index f89e72d405c..79813a62ada 100644 --- a/source/blender/gpu/vulkan/vk_sampler.cc +++ b/source/blender/gpu/vulkan/vk_sampler.cc @@ -24,6 +24,8 @@ void VKSampler::create(const GPUSamplerState &sampler_state) BLI_assert(sampler_state.type != GPU_SAMPLER_STATE_TYPE_INTERNAL); BLI_assert(vk_sampler_ == VK_NULL_HANDLE); + const VKDevice &device = VKBackend::get().device_get(); + VkSamplerCreateInfo sampler_info = {}; sampler_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; @@ -36,7 +38,9 @@ void VKSampler::create(const GPUSamplerState &sampler_state) if (sampler_state.filtering & GPU_SAMPLER_FILTERING_MIPMAP) { sampler_info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; } - if (sampler_state.filtering & GPU_SAMPLER_FILTERING_ANISOTROPIC) { + if (device.physical_device_features_get().samplerAnisotropy == VK_TRUE && + sampler_state.filtering & GPU_SAMPLER_FILTERING_ANISOTROPIC) + { sampler_info.anisotropyEnable = VK_TRUE; sampler_info.maxAnisotropy = min_ff(1.0f, U.anisotropic_filter); } @@ -65,7 +69,6 @@ void VKSampler::create(const GPUSamplerState &sampler_state) } VK_ALLOCATION_CALLBACKS - const VKDevice &device = VKBackend::get().device_get(); vkCreateSampler(device.device_get(), &sampler_info, vk_allocation_callbacks, &vk_sampler_); debug::object_label(vk_sampler_, sampler_state.to_string().c_str()); }