Fill Rate
What is Fill Rate
Fill Rate is the number of pixels that a graphics processing unit (GPU) can render to the screen per second, typically measured in millions of pixels per second (MP/s) or billions of pixels per second (GP/s). It is an important indicator of GPU performance, especially when dealing with high-resolution rendering and complex fragment shading.
Fill rate can be divided into **pixel fill rate** and **texture fill rate**:
- **Pixel fill rate**: The number of pixels the GPU can write to the frame buffer per second, determined by the number of Raster Operations Pipelines (ROPs) and clock speed.
- **Texture fill rate**: The number of texels the GPU can sample per second, determined by the number of Texture Mapping Units (TMUs) and clock speed.
Importance of Fill Rate
Fill rate directly affects rendering performance. When a scene requires processing a large number of pixels (e.g., high resolution, multiple layers, complex post-processing), fill rate can become a bottleneck. If the GPU's fill rate is insufficient, frame rate drops and stuttering occurs.
Mobile devices are particularly sensitive to fill rate due to high screen resolutions but relatively low GPU fill rates.
Factors Influencing Fill Rate
- **Resolution**: Higher resolution means more pixels to render, increasing fill rate demand.
- **Overdraw**: Multiple draws of the same pixel increase fill rate pressure.
- **Fragment shader complexity**: While complex shaders primarily consume ALU, multiple texture samples per pixel also consume texture fill rate.
- **Blending operations**: Alpha blending requires reading and writing the frame buffer, consuming extra bandwidth.
- **Post-processing**: Full-screen post-processing effects (like blur, bloom) process all pixels multiple times, greatly increasing fill rate requirements.
Relationship between Fill Rate and Overdraw
Overdraw is a major source of fill rate consumption. For example, if a pixel is drawn 3 times, the fill rate demand effectively triples. Reducing overdraw can significantly lower fill rate pressure.
How to Optimize Fill Rate
1. Reduce Render Resolution
Use dynamic resolution or lower the render target resolution, e.g., render at a lower internal resolution and then upscale on mobile.
2. Reduce Overdraw
- Optimize rendering order and use depth testing to cull occluded pixels.
- Reduce the number of transparent layers.
- Use occlusion culling.
3. Simplify Fragment Shaders
- Reduce texture sampling count.
- Use simplified lighting models.
- Avoid complex math functions.
4. Optimize Post-processing
- Combine post-processing effects to reduce full-screen passes.
- Use lower resolution for post-processing (e.g., half-resolution blur).
- Consider using compute shaders for asynchronous processing.
5. Use Mipmaps
Proper use of mipmaps can reduce bandwidth consumption during texture sampling, improving texture sampling efficiency by reducing cache misses.
Measuring Fill Rate
GPU specifications often provide theoretical fill rates, but actual performance is affected by many factors. Use performance analysis tools (such as GPUView, Nsight) to measure actual fill rate utilization.
Summary
Fill rate is the GPU's capability to render pixels. High resolution, overdraw, and complex post-processing can quickly consume fill rate. By optimizing the rendering pipeline and reducing pixel processing workload, overall performance can be improved.
FAQ
What is the relationship between fill rate and frame rate?
Insufficient fill rate means the GPU cannot complete all pixel processing within the frame time, reducing frame rate. Increasing fill rate or reducing pixel processing requirements can improve frame rate.
How to determine if fill rate is the bottleneck?
Use GPU performance analysis tools to check ROP utilization and pixel processing time. If performance improves significantly after lowering resolution, fill rate may be limited.
Why are mobile devices sensitive to fill rate?
Mobile devices have high screen resolutions but relatively low GPU fill rates and limited bandwidth. High overdraw and complex post-processing can quickly exhaust fill rate, leading to heating and throttling.
What is the difference between texture fill rate and pixel fill rate?
Pixel fill rate is the capability to write pixels, while texture fill rate is the capability to sample textures. They can differ; complex texture sampling may make texture fill rate the bottleneck.
How does post-processing affect fill rate?
Each post-processing effect traverses all screen pixels, executes shaders, and may sample textures multiple times. Stacking multiple post-processing effects multiplies fill rate demand.