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

Side by Side Diff: src/gpu/gl/builders/GrGLNvprProgramBuilder.cpp

Issue 671023002: Added varying struct (Closed) Base URL: https://skia.googlesource.com/skia.git@gp_emit_struct
Patch Set: cleanup Created 6 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 2014 Google Inc. 2 * Copyright 2014 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 "GrGLNvprProgramBuilder.h" 8 #include "GrGLNvprProgramBuilder.h"
9 #include "../GrGpuGL.h" 9 #include "../GrGpuGL.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, 48 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords,
49 (SkString(fsVaryingName), varyingType)); 49 (SkString(fsVaryingName), varyingType));
50 } 50 }
51 } 51 }
52 52
53 GrGLInstalledFragProc::ShaderVarHandle 53 GrGLInstalledFragProc::ShaderVarHandle
54 GrGLNvprProgramBuilder::addSeparableVarying(GrSLType type, 54 GrGLNvprProgramBuilder::addSeparableVarying(GrSLType type,
55 const char* name, 55 const char* name,
56 const char** vsOutName, 56 const char** vsOutName,
57 const char** fsInName) { 57 const char** fsInName) {
58 addVarying(type, name, vsOutName, fsInName);
59 SeparableVaryingInfo& varying = fSeparableVaryingInfos.push_back(); 58 SeparableVaryingInfo& varying = fSeparableVaryingInfos.push_back();
60 varying.fVariable = fFS.fInputs.back(); 59 varying.fVariable = fFS.fInputs.back();
61 return GrGLInstalledFragProc::ShaderVarHandle(fSeparableVaryingInfos.count() - 1); 60 return GrGLInstalledFragProc::ShaderVarHandle(fSeparableVaryingInfos.count() - 1);
62 } 61 }
63 62
64 void GrGLNvprProgramBuilder::resolveSeparableVaryings(GrGLuint programId) { 63 void GrGLNvprProgramBuilder::resolveSeparableVaryings(GrGLuint programId) {
65 int count = fSeparableVaryingInfos.count(); 64 int count = fSeparableVaryingInfos.count();
66 for (int i = 0; i < count; ++i) { 65 for (int i = 0; i < count; ++i) {
67 GrGLint location; 66 GrGLint location;
68 GL_CALL_RET(location, 67 GL_CALL_RET(location,
69 GetProgramResourceLocation(programId, 68 GetProgramResourceLocation(programId,
70 GR_GL_FRAGMENT_INPUT, 69 GR_GL_FRAGMENT_INPUT,
71 fSeparableVaryingInfos[i].fVariab le.c_str())); 70 fSeparableVaryingInfos[i].fVariab le.c_str()));
72 fSeparableVaryingInfos[i].fLocation = location; 71 fSeparableVaryingInfos[i].fLocation = location;
73 } 72 }
74 } 73 }
75 74
76 GrGLProgram* GrGLNvprProgramBuilder::createProgram(GrGLuint programID) { 75 GrGLProgram* GrGLNvprProgramBuilder::createProgram(GrGLuint programID) {
77 // this is just for nvpr es, which has separable varyings that are plugged i n after 76 // this is just for nvpr es, which has separable varyings that are plugged i n after
78 // building 77 // building
79 this->resolveSeparableVaryings(programID); 78 this->resolveSeparableVaryings(programID);
80 return SkNEW_ARGS(GrGLNvprProgram, (fGpu, fDesc, fUniformHandles, programID, fUniforms, 79 return SkNEW_ARGS(GrGLNvprProgram, (fGpu, fDesc, fUniformHandles, programID, fUniforms,
81 fFragmentProcessors.get(), fSeparableVar yingInfos)); 80 fFragmentProcessors.get(), fSeparableVar yingInfos));
82 } 81 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698