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

Side by Side Diff: src/gpu/vk/GrVkSampler.cpp

Issue 2112693003: Remove support for GL discards (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpuCommandBuffer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrVkSampler.h" 8 #include "GrVkSampler.h"
9 9
10 #include "GrTextureAccess.h" 10 #include "GrTextureAccess.h"
11 #include "GrVkGpu.h" 11 #include "GrVkGpu.h"
12 12
13 static inline VkSamplerAddressMode tile_to_vk_sampler_address(SkShader::TileMode tm) { 13 static inline VkSamplerAddressMode tile_to_vk_sampler_address(SkShader::TileMode tm) {
14 static const VkSamplerAddressMode gWrapModes[] = { 14 static const VkSamplerAddressMode gWrapModes[] = {
15 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, 15 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
16 VK_SAMPLER_ADDRESS_MODE_REPEAT, 16 VK_SAMPLER_ADDRESS_MODE_REPEAT,
17 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT 17 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT
18 }; 18 };
19 GR_STATIC_ASSERT(SkShader::kTileModeCount == SK_ARRAY_COUNT(gWrapModes)); 19 GR_STATIC_ASSERT(SkShader::kTileModeCount == SK_ARRAY_COUNT(gWrapModes));
20 GR_STATIC_ASSERT(0 == SkShader::kClamp_TileMode); 20 GR_STATIC_ASSERT(0 == SkShader::kClamp_TileMode);
21 GR_STATIC_ASSERT(1 == SkShader::kRepeat_TileMode); 21 GR_STATIC_ASSERT(1 == SkShader::kRepeat_TileMode);
22 GR_STATIC_ASSERT(2 == SkShader::kMirror_TileMode); 22 GR_STATIC_ASSERT(2 == SkShader::kMirror_TileMode);
23 return gWrapModes[tm]; 23 return gWrapModes[tm];
24 } 24 }
25 25
26 GrVkSampler* GrVkSampler::Create(const GrVkGpu* gpu, const GrTextureParams& para ms, 26 GrVkSampler* GrVkSampler::Create(const GrVkGpu* gpu, const GrTextureParams& para ms,
27 uint32_t mipLevels) { 27 uint32_t mipLevels) {
28 28
29 static VkFilter vkMinFilterModes[] = { 29 static VkFilter vkMinFilterModes[] = {
30 VK_FILTER_NEAREST, 30 VK_FILTER_NEAREST,
31 VK_FILTER_LINEAR, 31 VK_FILTER_LINEAR,
32 VK_FILTER_LINEAR 32 VK_FILTER_LINEAR
33 }; 33 };
34 static VkFilter vkMagFilterModes[] = { 34 static VkFilter vkMagFilterModes[] = {
35 VK_FILTER_NEAREST, 35 VK_FILTER_NEAREST,
36 VK_FILTER_LINEAR, 36 VK_FILTER_LINEAR,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 key |= (params.getTileModeX() << kTileModeXShift); 88 key |= (params.getTileModeX() << kTileModeXShift);
89 89
90 GR_STATIC_ASSERT(SkShader::kTileModeCount <= 4); 90 GR_STATIC_ASSERT(SkShader::kTileModeCount <= 4);
91 key |= (params.getTileModeY() << kTileModeYShift); 91 key |= (params.getTileModeY() << kTileModeYShift);
92 92
93 SkASSERT(mipLevels < 1024); 93 SkASSERT(mipLevels < 1024);
94 key |= (mipLevels << kMipLevelShift); 94 key |= (mipLevels << kMipLevelShift);
95 95
96 return key; 96 return key;
97 } 97 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpuCommandBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698