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

Side by Side Diff: src/gpu/gl/GrGLProgramDataManager.cpp

Issue 1684063006: Add GrShaderFlags enum (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Bit->Flag Created 4 years, 10 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/effects/GrYUVEffect.cpp ('k') | src/gpu/gl/GrGLUniformHandler.h » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 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 "SkMatrix.h" 8 #include "SkMatrix.h"
9 #include "gl/GrGLProgramDataManager.h" 9 #include "gl/GrGLProgramDataManager.h"
10 #include "gl/GrGLGpu.h" 10 #include "gl/GrGLGpu.h"
(...skipping 14 matching lines...) Expand all
25 Uniform& uniform = fUniforms[i]; 25 Uniform& uniform = fUniforms[i];
26 const UniformInfo& builderUniform = uniforms[i]; 26 const UniformInfo& builderUniform = uniforms[i];
27 SkASSERT(GrGLSLShaderVar::kNonArray == builderUniform.fVariable.getArray Count() || 27 SkASSERT(GrGLSLShaderVar::kNonArray == builderUniform.fVariable.getArray Count() ||
28 builderUniform.fVariable.getArrayCount() > 0); 28 builderUniform.fVariable.getArrayCount() > 0);
29 SkDEBUGCODE( 29 SkDEBUGCODE(
30 uniform.fArrayCount = builderUniform.fVariable.getArrayCount(); 30 uniform.fArrayCount = builderUniform.fVariable.getArrayCount();
31 uniform.fType = builderUniform.fVariable.getType(); 31 uniform.fType = builderUniform.fVariable.getType();
32 ); 32 );
33 // TODO: Move the Xoom uniform array in both FS and VS bug workaround he re. 33 // TODO: Move the Xoom uniform array in both FS and VS bug workaround he re.
34 34
35 if (GrGLSLUniformHandler::kVertex_Visibility & builderUniform.fVisibilit y) { 35 if (kVertex_GrShaderFlag & builderUniform.fVisibility) {
36 uniform.fVSLocation = builderUniform.fLocation; 36 uniform.fVSLocation = builderUniform.fLocation;
37 } else { 37 } else {
38 uniform.fVSLocation = kUnusedUniform; 38 uniform.fVSLocation = kUnusedUniform;
39 } 39 }
40 if (GrGLSLUniformHandler::kFragment_Visibility & builderUniform.fVisibil ity) { 40 if (kFragment_GrShaderFlag & builderUniform.fVisibility) {
41 uniform.fFSLocation = builderUniform.fLocation; 41 uniform.fFSLocation = builderUniform.fLocation;
42 } else { 42 } else {
43 uniform.fFSLocation = kUnusedUniform; 43 uniform.fFSLocation = kUnusedUniform;
44 } 44 }
45 } 45 }
46 46
47 // NVPR programs have separable varyings 47 // NVPR programs have separable varyings
48 count = pathProcVaryings.count(); 48 count = pathProcVaryings.count();
49 fPathProcVaryings.push_back_n(count); 49 fPathProcVaryings.push_back_n(count);
50 for (int i = 0; i < count; i++) { 50 for (int i = 0; i < count; i++) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 matrix); 279 matrix);
280 } 280 }
281 281
282 #ifdef SK_DEBUG 282 #ifdef SK_DEBUG
283 void GrGLProgramDataManager::printUnused(const Uniform& uni) const { 283 void GrGLProgramDataManager::printUnused(const Uniform& uni) const {
284 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) { 284 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) {
285 GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n"); 285 GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n");
286 } 286 }
287 } 287 }
288 #endif 288 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrYUVEffect.cpp ('k') | src/gpu/gl/GrGLUniformHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698