Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: src/gpu/vk/GrVkSampler.cpp

Issue 2118733005: Fix vulkan image sampling (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove debug Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/gpu/vk/GrVkGpu.cpp ('K') | « src/gpu/vk/GrVkGpuCommandBuffer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkSampler.cpp
diff --git a/src/gpu/vk/GrVkSampler.cpp b/src/gpu/vk/GrVkSampler.cpp
index cd41fd0f3ef6e2fb70b59390cd58fbab59175b0c..1d4e7066a6fad7c8063d82658a2622b1d399be02 100644
--- a/src/gpu/vk/GrVkSampler.cpp
+++ b/src/gpu/vk/GrVkSampler.cpp
@@ -25,7 +25,6 @@ static inline VkSamplerAddressMode tile_to_vk_sampler_address(SkShader::TileMode
GrVkSampler* GrVkSampler::Create(const GrVkGpu* gpu, const GrTextureParams& params,
uint32_t mipLevels) {
-
static VkFilter vkMinFilterModes[] = {
VK_FILTER_NEAREST,
VK_FILTER_LINEAR,
@@ -59,7 +58,8 @@ GrVkSampler* GrVkSampler::Create(const GrVkGpu* gpu, const GrTextureParams& para
// 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 = (mipLevels == 1) ? 0.0f : (float)(mipLevels);
+ bool useMipMaps = GrTextureParams::kMipMap_FilterMode == params.filterMode() && mipLevels > 1;
+ createInfo.maxLod = !useMipMaps ? 0.0f : (float)(mipLevels);
createInfo.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
createInfo.unnormalizedCoordinates = VK_FALSE;
« src/gpu/vk/GrVkGpu.cpp ('K') | « src/gpu/vk/GrVkGpuCommandBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698