Best Practices
- General
- Shaders
- General
- Use built-ins
- Use the appropriate data type
- Reduce type casting
- Pack scalar constants
- Keep shader length reasonable
- Sample textures in an efficient way
- Threads in flight/dynamic branching
- Pack shader interpolators
- Minimize usage of shader GPRs
- Minimize shader instruction count
- Avoid uber-shaders
- Avoid math on shader constants
- Avoid discarding pixels in the fragment shader
- Avoid modifying depth in fragment shaders
- Avoid texture fetches in vertex shaders
- Break up draw calls
- Use medium precision where possible
- Favor vertex shader calculations over fragment shader calculations
- Measure, test, and verify results
- Prefer uniform buffers over shader storage buffers
- Eliminate subpixel triangles during tessellation
- Do back-face culling during tessellation
- Disable tessellation whenever it is not needed
- Keep UBOs as small as possible
- OpenGL ES Specific
- General
- Texture
- Tiling Architecture
- Vertex Processing