nir,spirv: add sparse texture fetches

Like SPIR-V and GL_ARB_sparse_texture2, these return a residency code. It
is placed in the destination after the rest of the result. If it's zero,
then the texel is resident. Otherwise, it's not resident.

Besides the larger destination and the residency code, sparse fetches
work the same as normal fetches.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7774>
This commit is contained in:
Rhys Perry
2020-11-20 15:10:42 +00:00
committed by Marge Bot
parent 95819663b7
commit 3a7972f72a
5 changed files with 83 additions and 6 deletions

View File

@@ -1218,6 +1218,10 @@ print_tex_instr(nir_tex_instr *instr, print_state *state)
if (instr->sampler_non_uniform) {
fprintf(fp, ", sampler non-uniform");
}
if (instr->is_sparse) {
fprintf(fp, ", sparse");
}
}
static void