diff options
author | 2017-12-04 11:45:51 -0700 | |
---|---|---|
committer | 2017-12-05 21:12:48 +0000 | |
commit | a3e9271ec41db6c3b6886e50053f37d345ab1d5c (patch) | |
tree | 97772078cf13d954ac4ba135fcd20feda6bb22e1 /src/gpu/ccpr/GrCCPRCoverageOp.h | |
parent | 60691a5127852631b03250f15fa6cda9a504befc (diff) |
CCPR: Eliminate texel buffers
Points cost 8 bytes and indices cost 4. If a point is accessed twice,
it's a wash whether we duplicate it or index. This change eliminates
texel buffers by duplicating points across instance arrays. This
reduces our dependence on extensions as well as getting rid of our
indirect memory access pattern in vertex shaders.
As a result of this change, memory usage by GPU buffers will only be a
fraction larger at worst, and slightly better at best.
Bug: skia:
Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD
Change-Id: I3c7f03772edd4f850d5fdd7b55552647335c1b52
Reviewed-on: https://skia-review.googlesource.com/79185
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/ccpr/GrCCPRCoverageOp.h')
-rw-r--r-- | src/gpu/ccpr/GrCCPRCoverageOp.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gpu/ccpr/GrCCPRCoverageOp.h b/src/gpu/ccpr/GrCCPRCoverageOp.h index ba818a1b12..571e29a8cf 100644 --- a/src/gpu/ccpr/GrCCPRCoverageOp.h +++ b/src/gpu/ccpr/GrCCPRCoverageOp.h @@ -91,7 +91,7 @@ private: // Every kBeginPath verb has a corresponding PathInfo entry. struct PathInfo { ScissorMode fScissorMode; - int32_t fPackedAtlasOffset; // (offsetY << 16) | (offsetX & 0xffff) + int16_t fAtlasOffsetX, fAtlasOffsetY; std::unique_ptr<GrCCPRCoverageOp> fTerminatingOp; }; @@ -154,15 +154,14 @@ private: GrOp::HasAABloat::kNo, GrOp::IsZeroArea::kNo); } - void setBuffers(sk_sp<GrBuffer> pointsBuffer, sk_sp<GrBuffer> instanceBuffer, - const PrimitiveTallies baseInstances[kNumScissorModes], - const PrimitiveTallies endInstances[kNumScissorModes]); + void setInstanceBuffer(sk_sp<GrBuffer> instanceBuffer, + const PrimitiveTallies baseInstances[kNumScissorModes], + const PrimitiveTallies endInstances[kNumScissorModes]); void drawMaskPrimitives(GrOpFlushState*, const GrPipeline&, const GrCCPRCoverageProcessor::RenderPass, GrPrimitiveType, int vertexCount, int PrimitiveTallies::* instanceType) const; - sk_sp<GrBuffer> fPointsBuffer; sk_sp<GrBuffer> fInstanceBuffer; PrimitiveTallies fBaseInstances[kNumScissorModes]; PrimitiveTallies fInstanceCounts[kNumScissorModes]; |