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

Unified Diff: src/gpu/GrProgramDesc.cpp

Issue 2358843002: Conditionally insert gl_PointSize into shaders. (Closed)
Patch Set: minor Created 4 years, 3 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/GrProgramDesc.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrProgramDesc.cpp
diff --git a/src/gpu/GrProgramDesc.cpp b/src/gpu/GrProgramDesc.cpp
index c452d349007394522a474e633dc8670750b4ee66..cfcdbb59c1de45e466afbdcbac1fbe20a0670bfd 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;
}
« no previous file with comments | « src/gpu/GrProgramDesc.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698