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

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 1297503007: Generating gl processor key is now recursive (Closed) Base URL: https://skia.googlesource.com/skia@cs3_numExclChildren
Patch Set: rebased Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrPrimitiveProcessor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/gpu/GrPrimitiveProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698