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

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

Issue 1451683002: Initial version of external_oes texture support and unit test (Closed) Base URL: https://skia.googlesource.com/skia.git@target
Patch Set: update Created 5 years, 1 month 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 SkDEBUGCODE( 55 SkDEBUGCODE(
56 separableVarying.fArrayCount = builderSeparableVarying.fVariable.get ArrayCount(); 56 separableVarying.fArrayCount = builderSeparableVarying.fVariable.get ArrayCount();
57 separableVarying.fType = builderSeparableVarying.fVariable.getType() ; 57 separableVarying.fType = builderSeparableVarying.fVariable.getType() ;
58 ); 58 );
59 separableVarying.fLocation = builderSeparableVarying.fLocation; 59 separableVarying.fLocation = builderSeparableVarying.fLocation;
60 } 60 }
61 } 61 }
62 62
63 void GrGLProgramDataManager::setSampler(UniformHandle u, int texUnit) const { 63 void GrGLProgramDataManager::setSampler(UniformHandle u, int texUnit) const {
64 const Uniform& uni = fUniforms[u.toIndex()]; 64 const Uniform& uni = fUniforms[u.toIndex()];
65 SkASSERT(uni.fType == kSampler2D_GrSLType); 65 SkASSERT(uni.fType == kSampler2D_GrSLType || uni.fType == kSamplerExternal_G rSLType);
66 SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount); 66 SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
67 // FIXME: We still insert a single sampler uniform for every stage. If the s hader does not 67 // FIXME: We still insert a single sampler uniform for every stage. If the s hader does not
68 // reference the sampler then the compiler may have optimized it out. Uncomm ent this assert 68 // reference the sampler then the compiler may have optimized it out. Uncomm ent this assert
69 // once stages insert their own samplers. 69 // once stages insert their own samplers.
70 // this->printUnused(uni); 70 // this->printUnused(uni);
71 if (kUnusedUniform != uni.fFSLocation) { 71 if (kUnusedUniform != uni.fFSLocation) {
72 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fFSLocation, texUnit)); 72 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fFSLocation, texUnit));
73 } 73 }
74 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) { 74 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
75 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fVSLocation, texUnit)); 75 GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fVSLocation, texUnit));
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 matrix); 292 matrix);
293 } 293 }
294 294
295 #ifdef SK_DEBUG 295 #ifdef SK_DEBUG
296 void GrGLProgramDataManager::printUnused(const Uniform& uni) const { 296 void GrGLProgramDataManager::printUnused(const Uniform& uni) const {
297 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) { 297 if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) {
298 GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n"); 298 GrCapsDebugf(fGpu->caps(), "Unused uniform in shader\n");
299 } 299 }
300 } 300 }
301 #endif 301 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698