Skip to content

mesa: handle atomic counter lowering for drivers with big ssbo offset aligns

Mike Blumenkrantz requested to merge zmike/mesa:counter into main

according to the spec, atomic counters can be bound at any offset divisible by 4, which means that any driver that uses the ssbo lowering pass and doesn't have a min offset align of 4 is potentially broken

to handle this, use a statevar to inject the misaligned remainder of the offset into the shader as a uniform. for well-aligned counter binds, the uniform offset will be 0

fixes (freedreno, zink+turnip): KHR-GL46.shader_atomic_counters.advanced-usage-multi-stage

Merge request reports