Download Revisiting the Vertex Cache: Understanding and Optimizing Vertex Processing on Modern GPUs and more Summaries Computer Graphics in PDF only on Docsity!
2018
Revisiting The Vertex Cache
Understanding and Optimizing
Vertex Processing on the modern GPU
Bernhard Kerbl
Michael Kenzel
Elena Ivanchenko
Dieter Schmalstieg
Markus Steinberger
Reuse in Triangle Meshes
- Exploit high vertex valence
- Ex.: Triangle strips, fans…
- Index list can cause ≪ 1. 0 shaded vertex per triangle
Post-transform Vertex Cache
- Classic approach [Hoppe 1999]:
- Caches the last 𝑁 shaded vertices
(hence “post-transform”)
- FIFO or LRU
- During primitive processing:
- Vertex needed ⇨ check cache
- Cache miss ⇨ rerun vertex processing
Michael Kenzel Vertex Reuse 5
Vertex
Processing
Primitive
Processing
Aspects of Vertex Reuse
Vertex Reuse
processing to
vertex references
Mesh Optimization
stream to
vertex references
Michael Kenzel Vertex Reuse 7
Mesh Optimization Algorithms
- Exploit existence of cache and reorder vertices to
minimize Average Cache Miss Rate (ACMR)
- Greedy algorithms: add new triangles to reordered
list based on a score function
- Usually build triangle strips to reduce run time
Cache Optimizer Performance
overall ACMR
with cache size
cache gets bigger
Images used from Pedro V. Sander, Diego Nehab,
and Joshua Barczak. Fast Triangle Reordering for
Vertex Locality and Reduced Overdraw. ACM
Transactions on Graphics (Proc. SIGGRAPH) 26(3),
August 2007.
Mission Statements
- Assess caching for massively parallel devices
- Identify actual GPU workload distribution scheme
- Optimize vertex input order for the modern GPU
Counting Vertex Shader Calls
- Use atomic counter for vertex indices (0,1,2|0,1,2|...)
- Atomically increment counter in each shader call
AMD Nvidia
384
96
In-depth analysis
- Shader Model 6.0 supports wave communication
- Enables us to see the mapping of vertex indices to
individual wavefronts for processing
- On AMD we see large portions of reused range
- On Nvidia corresponds to full set of reusable vertices
0, 1, 4, 6, 3, 7, 5 0, 1, 2, 3, 4, 5
6, 7, 8, 2, 5, 3 4, 6, 7, 5, 9, 1, 2
GPU Batching
- Hardware tries to consolidate idea of vertex reuse
and massively parallel independent processing
- Solution: reuse should not be detected after vertex
transformation, but before
- Analyze input stream and make explicit choices on
how to split to enable reuse and load balancing
Mission Statements
- Assess caching for massively parallel devices
- Identify actual GPU workload distribution scheme
- Optimize vertex input order for the modern GPU
Outlining the Batch Predictor
Input: {0, 1, 2|3, 2, 4|2, 5, 1|6, 7, 8|…}
0, 1, 2, 3, 2, 4, 2, 5, 1, 6 ------
0, 1, 2, 3, 4, 5, 6
Retention Model
Batch Indices
Shader Calls
Start at triangle: 0
End at triangle: 3
0 1 2 3
Nvidia Batches and Reuse
- Max. indices in batch: 96 (or 1 triangle per thread )
- Max. shader calls: 32 (or 1 shader per thread )
- No caching required for retention model: simple
look back at last 𝑁 indices, those are remembered
- Q: How long can Nvidia remember vertex indices?
- A: 42 (approximately, depending on order in triangle)