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.h | |
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.h')
-rw-r--r-- | src/gpu/GrProgramDesc.h | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/gpu/GrProgramDesc.h b/src/gpu/GrProgramDesc.h index 1f5a5819f5..f304ec53e1 100644 --- a/src/gpu/GrProgramDesc.h +++ b/src/gpu/GrProgramDesc.h @@ -28,6 +28,7 @@ public: * on the returned GrProgramDesc. * * @param GrPrimitiveProcessor The geometry + * @param hasPointSize Controls whether the shader will output a point size. * @param GrPipeline The optimized drawstate. The descriptor will represent a program * which this optstate can use to draw with. The optstate contains * general draw information, as well as the specific color, geometry, @@ -38,6 +39,7 @@ public: **/ static bool Build(GrProgramDesc*, const GrPrimitiveProcessor&, + bool hasPointSize, const GrPipeline&, const GrGLSLCaps&); @@ -92,28 +94,21 @@ public: } struct KeyHeader { - // Set to uniquely identify the rt's origin, or 0 if the shader does not require this info. - uint8_t fSurfaceOriginKey; // Set to uniquely identify the sample pattern, or 0 if the shader doesn't use sample // locations. uint8_t fSamplePatternKey; // Set to uniquely idenitify any swizzling of the shader's output color(s). uint8_t fOutputSwizzle; - uint8_t fSnapVerticesToPixelCenters; - int8_t fColorEffectCnt; - int8_t fCoverageEffectCnt; - uint8_t fIgnoresCoverage; + uint8_t fColorFragmentProcessorCnt : 4; + uint8_t fCoverageFragmentProcessorCnt : 4; + // Set to uniquely identify the rt's origin, or 0 if the shader does not require this info. + uint8_t fSurfaceOriginKey : 2; + uint8_t fIgnoresCoverage : 1; + uint8_t fSnapVerticesToPixelCenters : 1; + uint8_t fHasPointSize : 1; + uint8_t fPad : 3; }; - - int numColorEffects() const { - return this->header().fColorEffectCnt; - } - - int numCoverageEffects() const { - return this->header().fCoverageEffectCnt; - } - - int numTotalEffects() const { return this->numColorEffects() + this->numCoverageEffects(); } + GR_STATIC_ASSERT(sizeof(KeyHeader) == 4); // This should really only be used internally, base classes should return their own headers const KeyHeader& header() const { return *this->atOffset<KeyHeader, kHeaderOffset>(); } |