Anv: Add support for VK_EXT_shader_image_atomic_int64
Our current HW is not capable of doing atomic operations on image of VK_FORMAT_R64_UINT
and VK_FORMAT_R64_SINT
,
But we can support atomic operations on A64 addresses pointing to 64bit values.
So we should be able to support those image operations by pulling the surface state information in the shader, do the address computation and emit an A64 atomic operation instead.
This can all be implemented in a NIR pass, using the genX_bits.h
header, you can find the location of various fields on the RENDER_SURFACE_STATE
for each platform.
There is just one caveat to this approach : we cannot promote surfaces to the binding table if we're going to apply this optimization.
We should be able to determine this with shader inspect and avoid the promotion in anv_nir_apply_pipeline_layout
.