joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 8 | #include "GrGLProgramBuilder.h" |
joshualitt | 8072caa | 2015-02-12 14:20:52 -0800 | [diff] [blame] | 9 | |
bsalomon | 6f7f201 | 2015-03-16 14:00:52 -0700 | [diff] [blame] | 10 | #include "GrAutoLocaleSetter.h" |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 11 | #include "GrCoordTransform.h" |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 12 | #include "GrGLProgramBuilder.h" |
egdaniel | 5d8f69f | 2016-09-07 07:24:12 -0700 | [diff] [blame] | 13 | #include "GrProgramDesc.h" |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 14 | #include "GrShaderCaps.h" |
bsalomon | 7f9b2e4 | 2016-01-12 13:29:26 -0800 | [diff] [blame] | 15 | #include "GrSwizzle.h" |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 16 | #include "GrTexture.h" |
Hal Canary | 95e3c05 | 2017-01-11 12:44:43 -0500 | [diff] [blame] | 17 | #include "SkAutoMalloc.h" |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 18 | #include "SkTraceEvent.h" |
joshualitt | e7afc2d | 2015-09-11 10:44:13 -0700 | [diff] [blame] | 19 | #include "gl/GrGLGpu.h" |
joshualitt | e7afc2d | 2015-09-11 10:44:13 -0700 | [diff] [blame] | 20 | #include "gl/GrGLProgram.h" |
| 21 | #include "gl/GrGLSLPrettyPrint.h" |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 22 | #include "gl/builders/GrGLShaderStringBuilder.h" |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 23 | #include "glsl/GrGLSLFragmentProcessor.h" |
egdaniel | e659a58 | 2015-11-13 09:55:43 -0800 | [diff] [blame] | 24 | #include "glsl/GrGLSLGeometryProcessor.h" |
egdaniel | 018fb62 | 2015-10-28 07:26:40 -0700 | [diff] [blame] | 25 | #include "glsl/GrGLSLProgramDataManager.h" |
egdaniel | fa4cc8b | 2015-11-13 08:34:52 -0800 | [diff] [blame] | 26 | #include "glsl/GrGLSLXferProcessor.h" |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 27 | |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 28 | #define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X) |
| 29 | #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X) |
| 30 | |
egdaniel | 0e1853c | 2016-03-17 11:35:45 -0700 | [diff] [blame] | 31 | GrGLProgram* GrGLProgramBuilder::CreateProgram(const GrPipeline& pipeline, |
| 32 | const GrPrimitiveProcessor& primProc, |
Ethan Nicholas | cae3a4c | 2017-02-02 10:43:58 -0500 | [diff] [blame^] | 33 | const GrProgramDesc& desc, |
egdaniel | 0e1853c | 2016-03-17 11:35:45 -0700 | [diff] [blame] | 34 | GrGLGpu* gpu) { |
bsalomon | 3318ee7 | 2015-03-16 11:56:29 -0700 | [diff] [blame] | 35 | GrAutoLocaleSetter als("C"); |
| 36 | |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 37 | // create a builder. This will be handed off to effects so they can use it to add |
| 38 | // uniforms, varyings, textures, etc |
egdaniel | 0e1853c | 2016-03-17 11:35:45 -0700 | [diff] [blame] | 39 | GrGLProgramBuilder builder(gpu, pipeline, primProc, desc); |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 40 | |
egdaniel | 37b4d86 | 2014-11-03 10:07:07 -0800 | [diff] [blame] | 41 | // TODO: Once all stages can handle taking a float or vec4 and correctly handling them we can |
joshualitt | 9b98932 | 2014-12-15 14:16:27 -0800 | [diff] [blame] | 42 | // seed correctly here |
| 43 | GrGLSLExpr4 inputColor; |
| 44 | GrGLSLExpr4 inputCoverage; |
egdaniel | 37b4d86 | 2014-11-03 10:07:07 -0800 | [diff] [blame] | 45 | |
cdalton | 9c3f143 | 2016-03-11 10:07:37 -0800 | [diff] [blame] | 46 | if (!builder.emitAndInstallProcs(&inputColor, &inputCoverage)) { |
egdaniel | c1e7101 | 2016-01-20 07:53:51 -0800 | [diff] [blame] | 47 | builder.cleanupFragmentProcessors(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 48 | return nullptr; |
joshualitt | 6c89110 | 2015-05-13 08:51:49 -0700 | [diff] [blame] | 49 | } |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 50 | |
egdaniel | c1e7101 | 2016-01-20 07:53:51 -0800 | [diff] [blame] | 51 | return builder.finalize(); |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 52 | } |
| 53 | |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 54 | ///////////////////////////////////////////////////////////////////////////// |
| 55 | |
egdaniel | 0e1853c | 2016-03-17 11:35:45 -0700 | [diff] [blame] | 56 | GrGLProgramBuilder::GrGLProgramBuilder(GrGLGpu* gpu, |
| 57 | const GrPipeline& pipeline, |
| 58 | const GrPrimitiveProcessor& primProc, |
Ethan Nicholas | cae3a4c | 2017-02-02 10:43:58 -0500 | [diff] [blame^] | 59 | const GrProgramDesc& desc) |
egdaniel | 0e1853c | 2016-03-17 11:35:45 -0700 | [diff] [blame] | 60 | : INHERITED(pipeline, primProc, desc) |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 61 | , fGpu(gpu) |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 62 | , fVaryingHandler(this) |
| 63 | , fUniformHandler(this) { |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 64 | } |
| 65 | |
egdaniel | fa89632 | 2016-01-13 12:19:30 -0800 | [diff] [blame] | 66 | const GrCaps* GrGLProgramBuilder::caps() const { |
| 67 | return fGpu->caps(); |
| 68 | } |
| 69 | |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 70 | bool GrGLProgramBuilder::compileAndAttachShaders(GrGLSLShaderBuilder& shader, |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 71 | GrGLuint programId, |
| 72 | GrGLenum type, |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 73 | SkTDArray<GrGLuint>* shaderIds, |
| 74 | const SkSL::Program::Settings& settings, |
| 75 | SkSL::Program::Inputs* outInputs) { |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 76 | GrGLGpu* gpu = this->gpu(); |
| 77 | GrGLuint shaderId = GrGLCompileAndAttachShader(gpu->glContext(), |
| 78 | programId, |
| 79 | type, |
| 80 | shader.fCompilerStrings.begin(), |
| 81 | shader.fCompilerStringLengths.begin(), |
| 82 | shader.fCompilerStrings.count(), |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 83 | gpu->stats(), |
| 84 | settings, |
| 85 | outInputs); |
egdaniel | 574a4c1 | 2015-11-02 06:22:44 -0800 | [diff] [blame] | 86 | |
| 87 | if (!shaderId) { |
| 88 | return false; |
| 89 | } |
| 90 | |
| 91 | *shaderIds->append() = shaderId; |
| 92 | |
| 93 | return true; |
| 94 | } |
| 95 | |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 96 | GrGLProgram* GrGLProgramBuilder::finalize() { |
| 97 | // verify we can get a program id |
| 98 | GrGLuint programID; |
| 99 | GL_CALL_RET(programID, CreateProgram()); |
| 100 | if (0 == programID) { |
egdaniel | fa89632 | 2016-01-13 12:19:30 -0800 | [diff] [blame] | 101 | this->cleanupFragmentProcessors(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 102 | return nullptr; |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 103 | } |
| 104 | |
egdaniel | 9f1d415 | 2016-02-10 09:50:38 -0800 | [diff] [blame] | 105 | this->finalizeShaders(); |
| 106 | |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 107 | // compile shaders and bind attributes / uniforms |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 108 | SkSL::Program::Settings settings; |
| 109 | settings.fCaps = this->gpu()->glCaps().shaderCaps(); |
| 110 | settings.fFlipY = this->pipeline().getRenderTarget()->origin() != kTopLeft_GrSurfaceOrigin; |
| 111 | SkSL::Program::Inputs inputs; |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 112 | SkTDArray<GrGLuint> shadersToDelete; |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 113 | if (!this->compileAndAttachShaders(fVS, programID, GR_GL_VERTEX_SHADER, &shadersToDelete, |
| 114 | settings, &inputs)) { |
jvanverth | 5053063 | 2015-04-27 10:36:27 -0700 | [diff] [blame] | 115 | this->cleanupProgram(programID, shadersToDelete); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 116 | return nullptr; |
jvanverth | 5053063 | 2015-04-27 10:36:27 -0700 | [diff] [blame] | 117 | } |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame] | 118 | |
jvanverth | 5053063 | 2015-04-27 10:36:27 -0700 | [diff] [blame] | 119 | // NVPR actually requires a vertex shader to compile |
csmartdalton | 276cc41 | 2016-11-21 11:55:00 -0700 | [diff] [blame] | 120 | const GrPrimitiveProcessor& primProc = this->primitiveProcessor(); |
| 121 | bool useNvpr = primProc.isPathRendering(); |
jvanverth | 5053063 | 2015-04-27 10:36:27 -0700 | [diff] [blame] | 122 | if (!useNvpr) { |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 123 | int vaCount = primProc.numAttribs(); |
| 124 | for (int i = 0; i < vaCount; i++) { |
| 125 | GL_CALL(BindAttribLocation(programID, i, primProc.getAttrib(i).fName)); |
| 126 | } |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 127 | } |
joshualitt | 9b98932 | 2014-12-15 14:16:27 -0800 | [diff] [blame] | 128 | |
csmartdalton | 276cc41 | 2016-11-21 11:55:00 -0700 | [diff] [blame] | 129 | if (primProc.willUseGeoShader() && |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 130 | !this->compileAndAttachShaders(fGS, programID, GR_GL_GEOMETRY_SHADER, &shadersToDelete, |
| 131 | settings, &inputs)) { |
csmartdalton | 276cc41 | 2016-11-21 11:55:00 -0700 | [diff] [blame] | 132 | this->cleanupProgram(programID, shadersToDelete); |
| 133 | return nullptr; |
| 134 | } |
| 135 | |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 136 | if (!this->compileAndAttachShaders(fFS, programID, GR_GL_FRAGMENT_SHADER, &shadersToDelete, |
| 137 | settings, &inputs)) { |
joshualitt | 9b98932 | 2014-12-15 14:16:27 -0800 | [diff] [blame] | 138 | this->cleanupProgram(programID, shadersToDelete); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 139 | return nullptr; |
joshualitt | 9b98932 | 2014-12-15 14:16:27 -0800 | [diff] [blame] | 140 | } |
| 141 | |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 142 | if (inputs.fRTHeight) { |
| 143 | this->addRTHeightUniform(SKSL_RTHEIGHT_NAME); |
| 144 | } |
| 145 | |
kkinnunen | 7aedda5 | 2015-06-29 23:01:28 -0700 | [diff] [blame] | 146 | this->bindProgramResourceLocations(programID); |
| 147 | |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 148 | GL_CALL(LinkProgram(programID)); |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 149 | |
| 150 | // Calling GetProgramiv is expensive in Chromium. Assume success in release builds. |
cdalton | 1acea86 | 2015-06-02 13:05:52 -0700 | [diff] [blame] | 151 | bool checkLinked = kChromium_GrGLDriver != fGpu->ctxInfo().driver(); |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 152 | #ifdef SK_DEBUG |
| 153 | checkLinked = true; |
| 154 | #endif |
| 155 | if (checkLinked) { |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 156 | checkLinkStatus(programID); |
joshualitt | fe1233c | 2014-10-07 12:16:35 -0700 | [diff] [blame] | 157 | } |
kkinnunen | 7aedda5 | 2015-06-29 23:01:28 -0700 | [diff] [blame] | 158 | this->resolveProgramResourceLocations(programID); |
joshualitt | db0d3ca | 2014-10-07 12:42:26 -0700 | [diff] [blame] | 159 | |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 160 | this->cleanupShaders(shadersToDelete); |
| 161 | |
| 162 | return this->createProgram(programID); |
| 163 | } |
| 164 | |
kkinnunen | 7aedda5 | 2015-06-29 23:01:28 -0700 | [diff] [blame] | 165 | void GrGLProgramBuilder::bindProgramResourceLocations(GrGLuint programID) { |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 166 | fUniformHandler.bindUniformLocations(programID, fGpu->glCaps()); |
kkinnunen | 7aedda5 | 2015-06-29 23:01:28 -0700 | [diff] [blame] | 167 | |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 168 | const GrGLCaps& caps = this->gpu()->glCaps(); |
| 169 | if (fFS.hasCustomColorOutput() && caps.bindFragDataLocationSupport()) { |
| 170 | GL_CALL(BindFragDataLocation(programID, 0, |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 171 | GrGLSLFragmentShaderBuilder::DeclaredColorOutputName())); |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 172 | } |
Brian Salomon | 1edc5b9 | 2016-11-29 13:43:46 -0500 | [diff] [blame] | 173 | if (fFS.hasSecondaryOutput() && caps.shaderCaps()->mustDeclareFragmentShaderOutput()) { |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 174 | GL_CALL(BindFragDataLocationIndexed(programID, 0, 1, |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 175 | GrGLSLFragmentShaderBuilder::DeclaredSecondaryColorOutputName())); |
egdaniel | 8dcdedc | 2015-11-11 06:27:20 -0800 | [diff] [blame] | 176 | } |
joshualitt | d8dd47b | 2015-09-11 11:45:01 -0700 | [diff] [blame] | 177 | |
| 178 | // handle NVPR separable varyings |
| 179 | if (!fGpu->glCaps().shaderCaps()->pathRenderingSupport() || |
| 180 | !fGpu->glPathRendering()->shouldBindFragmentInputs()) { |
| 181 | return; |
| 182 | } |
egdaniel | 0eafe79 | 2015-11-20 14:01:22 -0800 | [diff] [blame] | 183 | int count = fVaryingHandler.fPathProcVaryingInfos.count(); |
joshualitt | d8dd47b | 2015-09-11 11:45:01 -0700 | [diff] [blame] | 184 | for (int i = 0; i < count; ++i) { |
egdaniel | 0eafe79 | 2015-11-20 14:01:22 -0800 | [diff] [blame] | 185 | GL_CALL(BindFragmentInputLocation(programID, i, |
| 186 | fVaryingHandler.fPathProcVaryingInfos[i].fVariable.c_str())); |
| 187 | fVaryingHandler.fPathProcVaryingInfos[i].fLocation = i; |
joshualitt | d8dd47b | 2015-09-11 11:45:01 -0700 | [diff] [blame] | 188 | } |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | bool GrGLProgramBuilder::checkLinkStatus(GrGLuint programID) { |
| 192 | GrGLint linked = GR_GL_INIT_ZERO; |
| 193 | GL_CALL(GetProgramiv(programID, GR_GL_LINK_STATUS, &linked)); |
| 194 | if (!linked) { |
| 195 | GrGLint infoLen = GR_GL_INIT_ZERO; |
| 196 | GL_CALL(GetProgramiv(programID, GR_GL_INFO_LOG_LENGTH, &infoLen)); |
| 197 | SkAutoMalloc log(sizeof(char)*(infoLen+1)); // outside if for debugger |
| 198 | if (infoLen > 0) { |
| 199 | // retrieve length even though we don't need it to workaround |
| 200 | // bug in chrome cmd buffer param validation. |
| 201 | GrGLsizei length = GR_GL_INIT_ZERO; |
| 202 | GL_CALL(GetProgramInfoLog(programID, |
| 203 | infoLen+1, |
| 204 | &length, |
| 205 | (char*)log.get())); |
kkinnunen | 297aaf9 | 2015-02-19 06:32:12 -0800 | [diff] [blame] | 206 | SkDebugf("%s", (char*)log.get()); |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 207 | } |
| 208 | SkDEBUGFAIL("Error linking program"); |
| 209 | GL_CALL(DeleteProgram(programID)); |
| 210 | programID = 0; |
| 211 | } |
| 212 | return SkToBool(linked); |
| 213 | } |
| 214 | |
kkinnunen | 7aedda5 | 2015-06-29 23:01:28 -0700 | [diff] [blame] | 215 | void GrGLProgramBuilder::resolveProgramResourceLocations(GrGLuint programID) { |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 216 | fUniformHandler.getUniformLocations(programID, fGpu->glCaps()); |
joshualitt | d8dd47b | 2015-09-11 11:45:01 -0700 | [diff] [blame] | 217 | |
| 218 | // handle NVPR separable varyings |
| 219 | if (!fGpu->glCaps().shaderCaps()->pathRenderingSupport() || |
kkinnunen | 7bdb05d | 2016-01-25 00:47:23 -0800 | [diff] [blame] | 220 | fGpu->glPathRendering()->shouldBindFragmentInputs()) { |
joshualitt | d8dd47b | 2015-09-11 11:45:01 -0700 | [diff] [blame] | 221 | return; |
| 222 | } |
egdaniel | 0eafe79 | 2015-11-20 14:01:22 -0800 | [diff] [blame] | 223 | int count = fVaryingHandler.fPathProcVaryingInfos.count(); |
joshualitt | d8dd47b | 2015-09-11 11:45:01 -0700 | [diff] [blame] | 224 | for (int i = 0; i < count; ++i) { |
| 225 | GrGLint location; |
egdaniel | 0eafe79 | 2015-11-20 14:01:22 -0800 | [diff] [blame] | 226 | GL_CALL_RET(location, GetProgramResourceLocation( |
| 227 | programID, |
| 228 | GR_GL_FRAGMENT_INPUT, |
| 229 | fVaryingHandler.fPathProcVaryingInfos[i].fVariable.c_str())); |
| 230 | fVaryingHandler.fPathProcVaryingInfos[i].fLocation = location; |
joshualitt | d8dd47b | 2015-09-11 11:45:01 -0700 | [diff] [blame] | 231 | } |
joshualitt | 30ba436 | 2014-08-21 20:18:45 -0700 | [diff] [blame] | 232 | } |
| 233 | |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 234 | void GrGLProgramBuilder::cleanupProgram(GrGLuint programID, const SkTDArray<GrGLuint>& shaderIDs) { |
| 235 | GL_CALL(DeleteProgram(programID)); |
egdaniel | fa89632 | 2016-01-13 12:19:30 -0800 | [diff] [blame] | 236 | this->cleanupShaders(shaderIDs); |
| 237 | this->cleanupFragmentProcessors(); |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 238 | } |
| 239 | void GrGLProgramBuilder::cleanupShaders(const SkTDArray<GrGLuint>& shaderIDs) { |
| 240 | for (int i = 0; i < shaderIDs.count(); ++i) { |
| 241 | GL_CALL(DeleteShader(shaderIDs[i])); |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | GrGLProgram* GrGLProgramBuilder::createProgram(GrGLuint programID) { |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 246 | return new GrGLProgram(fGpu, |
Ethan Nicholas | cae3a4c | 2017-02-02 10:43:58 -0500 | [diff] [blame^] | 247 | this->desc(), |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 248 | fUniformHandles, |
| 249 | programID, |
| 250 | fUniformHandler.fUniforms, |
egdaniel | 09aa1fc | 2016-04-20 07:09:46 -0700 | [diff] [blame] | 251 | fUniformHandler.fSamplers, |
Brian Salomon | f9f4512 | 2016-11-29 11:59:17 -0500 | [diff] [blame] | 252 | fUniformHandler.fImageStorages, |
egdaniel | 0eafe79 | 2015-11-20 14:01:22 -0800 | [diff] [blame] | 253 | fVaryingHandler.fPathProcVaryingInfos, |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 254 | fGeometryProcessor, |
| 255 | fXferProcessor, |
egdaniel | 09aa1fc | 2016-04-20 07:09:46 -0700 | [diff] [blame] | 256 | fFragmentProcessors); |
joshualitt | 47bb382 | 2014-10-07 16:43:25 -0700 | [diff] [blame] | 257 | } |