diff options
author | bsalomon <bsalomon@google.com> | 2016-09-21 10:53:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-21 10:53:24 -0700 |
commit | 2eda5b3a65f54105ae3776160373eed5500c515f (patch) | |
tree | ace0d82e04790bdbad3f8e061f03e2cfbdea4482 /src/gpu/GrProgramDesc.cpp | |
parent | 7d05f32a1dec990321ffd8165d5f253ab99de3e5 (diff) |
Conditionally insert gl_PointSize into shaders.
BUG=chromium:648816
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2358843002
Review-Url: https://codereview.chromium.org/2358843002
Diffstat (limited to 'src/gpu/GrProgramDesc.cpp')
-rw-r--r-- | src/gpu/GrProgramDesc.cpp | 17 |
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; } |