| Index: src/gpu/gl/GrGLProgramDesc.cpp
|
| diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
|
| index 2522f7a24f0480ba0adf7a01a4f10d59441cc099..5365ffbf043aac5c102f60f542ffdd1758784c4d 100644
|
| --- a/src/gpu/gl/GrGLProgramDesc.cpp
|
| +++ b/src/gpu/gl/GrGLProgramDesc.cpp
|
| @@ -61,6 +61,8 @@ static uint32_t gen_texture_key(const GrProcessor& proc, const GrGLCaps& caps) {
|
| * which must be different for every GrProcessor subclass. It can fail if an effect uses too many
|
| * textures, transforms, etc, for the space allotted in the meta-key. NOTE, both FPs and GPs share
|
| * this function because it is hairy, though FPs do not have attribs, and GPs do not have transforms
|
| + *
|
| + * TODO: A better name for this function would be "compute" instead of "get".
|
| */
|
| static bool get_meta_key(const GrProcessor& proc,
|
| const GrGLCaps& caps,
|
| @@ -86,6 +88,26 @@ static bool get_meta_key(const GrProcessor& proc,
|
| return true;
|
| }
|
|
|
| +/*
|
| + * TODO: A better name for this function would be "compute" instead of "get".
|
| + */
|
| +static bool get_frag_proc_and_meta_keys(const GrPrimitiveProcessor& primProc,
|
| + const GrFragmentProcessor& fp,
|
| + const GrGLCaps& caps,
|
| + GrProcessorKeyBuilder* b) {
|
| + for (int i = 0; i < fp.numChildProcessors(); ++i) {
|
| + if (!get_frag_proc_and_meta_keys(primProc, fp.childProcessor(i), caps, b)) {
|
| + return false;
|
| + }
|
| + }
|
| +
|
| + fp.getGLProcessorKey(*caps.glslCaps(), b);
|
| +
|
| + //**** use glslCaps here?
|
| + return get_meta_key(fp, caps, primProc.getTransformKey(fp.coordTransforms(),
|
| + fp.numTransformsExclChildren()), b);
|
| +}
|
| +
|
| bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
|
| const GrPrimitiveProcessor& primProc,
|
| const GrPipeline& pipeline,
|
| @@ -115,11 +137,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
|
| for (int s = 0; s < pipeline.numFragmentStages(); ++s) {
|
| const GrPendingFragmentStage& fps = pipeline.getFragmentStage(s);
|
| const GrFragmentProcessor& fp = *fps.processor();
|
| -
|
| - fp.getGLProcessorKey(*gpu->glCaps().glslCaps(), &b);
|
| -
|
| - //**** use glslCaps here?
|
| - if (!get_meta_key(fp, gpu->glCaps(), primProc.getTransformKey(fp.coordTransforms()), &b)) {
|
| + if (!get_frag_proc_and_meta_keys(primProc, fp, gpu->glCaps(), &b)) {
|
| glDesc->key().reset();
|
| return false;
|
| }
|
|
|