aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProgramDesc.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-09-21 10:53:24 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-21 10:53:24 -0700
commit2eda5b3a65f54105ae3776160373eed5500c515f (patch)
treeace0d82e04790bdbad3f8e061f03e2cfbdea4482 /src/gpu/GrProgramDesc.cpp
parent7d05f32a1dec990321ffd8165d5f253ab99de3e5 (diff)
Conditionally insert gl_PointSize into shaders.
Diffstat (limited to 'src/gpu/GrProgramDesc.cpp')
-rw-r--r--src/gpu/GrProgramDesc.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gpu/GrProgramDesc.cpp b/src/gpu/GrProgramDesc.cpp
index c452d34900..cfcdbb59c1 100644
--- a/src/gpu/GrProgramDesc.cpp
+++ b/src/gpu/GrProgramDesc.cpp
@@ -106,6 +106,7 @@ static bool gen_frag_proc_and_meta_keys(const GrPrimitiveProcessor& primProc,
bool GrProgramDesc::Build(GrProgramDesc* desc,
const GrPrimitiveProcessor& primProc,
+ bool hasPointSize,
const GrPipeline& pipeline,
const GrGLSLCaps& glslCaps) {
// The descriptor is used as a cache key. Thus when a field of the
@@ -171,14 +172,16 @@ bool GrProgramDesc::Build(GrProgramDesc* desc,
header->fOutputSwizzle = glslCaps.configOutputSwizzle(rt->config()).asKey();
- if (pipeline.ignoresCoverage()) {
- header->fIgnoresCoverage = 1;
- } else {
- header->fIgnoresCoverage = 0;
- }
+ header->fIgnoresCoverage = pipeline.ignoresCoverage() ? 1 : 0;
header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters();
- header->fColorEffectCnt = pipeline.numColorFragmentProcessors();
- header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors();
+ header->fColorFragmentProcessorCnt = pipeline.numColorFragmentProcessors();
+ header->fCoverageFragmentProcessorCnt = pipeline.numCoverageFragmentProcessors();
+ // Fail if the client requested more processors than the key can fit.
+ if (header->fColorFragmentProcessorCnt != pipeline.numColorFragmentProcessors() ||
+ header->fCoverageFragmentProcessorCnt != pipeline.numCoverageFragmentProcessors()) {
+ return false;
+ }
+ header->fHasPointSize = hasPointSize ? 1 : 0;
return true;
}