Learn about combining rendering and compute operations into a single render pass while sharing local memory.
Many rendering techniques require a mixture of drawing and compute commands. Traditionally, rendering and compute commands were separated into distinct passes. These passes couldn’t communicate directly with each other; results from one pass were copied into device memory, only to be copied back into local memory by the next pass. In a multiphase rendering algorithm, intermediate data might be copied to device memory multiple times, as shown in Figure 1.
Tile shaders are compute or fragment functions that execute as part of a render pass, allowing for midrender compute with persistent memory between rendering phases. Figure 2 shows that the tile memory that tile shaders work within remains in the on-chip memory of the graphics processing unit (GPU). As a result, you avoid having to store intermediate results out to device memory. Tile memory from one phase is available to any subsequent fragment phases.