Skip to content

d3d12: Reuse sampler tables inside of a batch

Giancarlo Devich requested to merge gdevi/mesa:d3d12_samplertable_reuse into main

If a shader's sampler state is dirty often, the sampler descriptor heap can get used up quickly, forcing flushing. If that happens quickly, we run out of batches and have to wait for batches to finish on the GPU.

When this happens, it is often because the sampler state is switching, not because it's truly unique. This change hashes and saves sampler descriptor tables that can be reused in subsequent draws in the same batch, instead of re-copying the same descriptors and consuming the heap.

Merge request reports