diff options
author | cdalton <cdalton@nvidia.com> | 2016-02-26 12:22:02 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-26 12:22:02 -0800 |
commit | 87332103c605dc3e0f76c0d1250a76c4ff71fddc (patch) | |
tree | 691623aee5f5b4953ecfcb69dcd79f9f6f0b0937 /src/gpu/gl/GrGLProgramDesc.cpp | |
parent | e5824b90da4568544ecbf71ba5d690095b31307e (diff) |
Replace fWillReadFragmentPosition with a bitfield
Replaces fWillReadFragmentPosition on GrProcessor with a
"RequiredFeatures" bitfield. This will allow us to add additional
built-in features. Completely removes information about reading the
fragment position from GrPipeline and GrProcOptInfo.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1734163002
Review URL: https://codereview.chromium.org/1734163002
Diffstat (limited to 'src/gpu/gl/GrGLProgramDesc.cpp')
-rw-r--r-- | src/gpu/gl/GrGLProgramDesc.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp index a2dea87392..789eb62336 100644 --- a/src/gpu/gl/GrGLProgramDesc.cpp +++ b/src/gpu/gl/GrGLProgramDesc.cpp @@ -120,6 +120,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, glDesc->key().reset(); return false; } + GrProcessor::RequiredFeatures requiredFeatures = primProc.requiredFeatures(); for (int i = 0; i < pipeline.numFragmentProcessors(); ++i) { const GrFragmentProcessor& fp = pipeline.getFragmentProcessor(i); @@ -127,6 +128,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, glDesc->key().reset(); return false; } + requiredFeatures |= fp.requiredFeatures(); } const GrXferProcessor& xp = pipeline.getXferProcessor(); @@ -135,6 +137,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, glDesc->key().reset(); return false; } + requiredFeatures |= xp.requiredFeatures(); // --------DO NOT MOVE HEADER ABOVE THIS LINE-------------------------------------------------- // Because header is a pointer into the dynamic array, we can't push any new data into the key @@ -144,7 +147,7 @@ bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, // make sure any padding in the header is zeroed. memset(header, 0, kHeaderSize); - if (pipeline.readsFragPosition()) { + if (requiredFeatures & GrProcessor::kFragmentPosition_RequiredFeature) { header->fFragPosKey = GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRenderTarget()); } else { |