OLD | NEW |
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" | |
21 | |
22 static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc, | 20 static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc, |
23 const GrGLSLCaps& caps) { | 21 const GrGLSLCaps& caps) { |
24 int numTextures = proc.numTextures(); | 22 int numTextures = proc.numTextures(); |
25 SkASSERT(0 == proc.numBuffers()); | 23 SkASSERT(0 == proc.numBuffers()); |
26 // Need two bytes per key (swizzle, sampler type, and precision). | 24 // Need two bytes per key (swizzle, sampler type, and precision). |
27 int word32Count = (proc.numTextures() + 1) / 2; | 25 int word32Count = (proc.numTextures() + 1) / 2; |
28 if (0 == word32Count) { | 26 if (0 == word32Count) { |
29 return; | 27 return; |
30 } | 28 } |
31 uint16_t* k16 = SkTCast<uint16_t*>(b->add32n(word32Count)); | 29 uint16_t* k16 = SkTCast<uint16_t*>(b->add32n(word32Count)); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } else { | 159 } else { |
162 header->fIgnoresCoverage = 0; | 160 header->fIgnoresCoverage = 0; |
163 } | 161 } |
164 | 162 |
165 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); | 163 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); |
166 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); | 164 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); |
167 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); | 165 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); |
168 vkDesc->finalize(); | 166 vkDesc->finalize(); |
169 return true; | 167 return true; |
170 } | 168 } |
OLD | NEW |