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

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

Issue 1870893002: Implement texel buffers (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_texelfetch
Patch Set: GrBuffer(Access) into include/gpu Created 4 years, 8 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/glsl/GrGLSLXferProcessor.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 2015 Google Inc. 2 * Copyright 2015 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 #include "GrVkProgramDesc.h" 7 #include "GrVkProgramDesc.h"
8 8
9 //#include "GrVkProcessor.h" 9 //#include "GrVkProcessor.h"
10 #include "GrProcessor.h" 10 #include "GrProcessor.h"
11 #include "GrPipeline.h" 11 #include "GrPipeline.h"
12 #include "GrRenderTargetPriv.h" 12 #include "GrRenderTargetPriv.h"
13 #include "GrVkGpu.h" 13 #include "GrVkGpu.h"
14 #include "GrVkUtil.h" 14 #include "GrVkUtil.h"
15 #include "SkChecksum.h" 15 #include "SkChecksum.h"
16 #include "glsl/GrGLSLFragmentProcessor.h" 16 #include "glsl/GrGLSLFragmentProcessor.h"
17 #include "glsl/GrGLSLFragmentShaderBuilder.h" 17 #include "glsl/GrGLSLFragmentShaderBuilder.h"
18 #include "glsl/GrGLSLCaps.h" 18 #include "glsl/GrGLSLCaps.h"
19 19
20 #include "shaderc/shaderc.h" 20 #include "shaderc/shaderc.h"
21 21
22 static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc, 22 static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc,
23 const GrGLSLCaps& caps) { 23 const GrGLSLCaps& caps) {
24 int numTextures = proc.numTextures(); 24 int numTextures = proc.numTextures();
25 SkASSERT(0 == proc.numBuffers());
25 // Need two bytes per key (swizzle, sampler type, and precision). 26 // Need two bytes per key (swizzle, sampler type, and precision).
26 int word32Count = (proc.numTextures() + 1) / 2; 27 int word32Count = (proc.numTextures() + 1) / 2;
27 if (0 == word32Count) { 28 if (0 == word32Count) {
28 return; 29 return;
29 } 30 }
30 uint16_t* k16 = SkTCast<uint16_t*>(b->add32n(word32Count)); 31 uint16_t* k16 = SkTCast<uint16_t*>(b->add32n(word32Count));
31 for (int i = 0; i < numTextures; ++i) { 32 for (int i = 0; i < numTextures; ++i) {
32 const GrTextureAccess& access = proc.textureAccess(i); 33 const GrTextureAccess& access = proc.textureAccess(i);
33 GrTexture* texture = access.getTexture(); 34 GrTexture* texture = access.getTexture();
34 k16[i] = SkToU16(caps.configTextureSwizzle(texture->config()).asKey() | 35 k16[i] = SkToU16(caps.configTextureSwizzle(texture->config()).asKey() |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } else { 161 } else {
161 header->fIgnoresCoverage = 0; 162 header->fIgnoresCoverage = 0;
162 } 163 }
163 164
164 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); 165 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters();
165 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); 166 header->fColorEffectCnt = pipeline.numColorFragmentProcessors();
166 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); 167 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors();
167 vkDesc->finalize(); 168 vkDesc->finalize();
168 return true; 169 return true;
169 } 170 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLXferProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698