Index: src/gpu/vk/GrVkSampler.cpp |
diff --git a/src/gpu/vk/GrVkSampler.cpp b/src/gpu/vk/GrVkSampler.cpp |
index fb8dacae878ecfea1b153920393bdb6006c4a235..75c2ee80d6bd7e1993ac406d8375a9510753e76c 100644 |
--- a/src/gpu/vk/GrVkSampler.cpp |
+++ b/src/gpu/vk/GrVkSampler.cpp |
@@ -52,6 +52,11 @@ GrVkSampler* GrVkSampler::Create(const GrVkGpu* gpu, const GrTextureParams& para |
createInfo.maxAnisotropy = 1.0f; |
createInfo.compareEnable = VK_FALSE; |
createInfo.compareOp = VK_COMPARE_OP_NEVER; |
+ // Vulkan doesn't have a direct mapping of GL's nearest or linear filters for minFilter since |
+ // there is always a mipmapMode. To get the same effect as GL we can set minLod = maxLod = 0.0. |
+ // This works since our min and mag filters are the same (this forces us to use mag on the 0 |
+ // level mip). If the filters weren't the same we could set min = 0 and max = 0.25 to force |
+ // the minFilter on mip level 0. |
createInfo.minLod = 0.0f; |
createInfo.maxLod = 0.0f; |
createInfo.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; |