zink: hook up nir_texop_query_levels

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9275>
This commit is contained in:
Mike Blumenkrantz 2020-10-20 15:20:40 -04:00 committed by Marge Bot
parent 7fe5937906
commit 9af40b824d
1 changed files with 9 additions and 1 deletions

View File

@ -2937,7 +2937,8 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
tex->op == nir_texop_txs ||
tex->op == nir_texop_lod ||
tex->op == nir_texop_tg4 ||
tex->op == nir_texop_texture_samples);
tex->op == nir_texop_texture_samples ||
tex->op == nir_texop_query_levels);
assert(tex->texture_index == tex->sampler_index);
SpvId coord = 0, proj = 0, bias = 0, lod = 0, dref = 0, dx = 0, dy = 0,
@ -3066,6 +3067,13 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
store_dest(ctx, &tex->dest, result, tex->dest_type);
return;
}
if (tex->op == nir_texop_query_levels) {
SpvId image = spirv_builder_emit_image(&ctx->builder, image_type, load);
SpvId result = spirv_builder_emit_image_query_levels(&ctx->builder,
dest_type, image);
store_dest(ctx, &tex->dest, result, tex->dest_type);
return;
}
if (tex->op == nir_texop_texture_samples) {
SpvId image = spirv_builder_emit_image(&ctx->builder, image_type, load);
SpvId result = spirv_builder_emit_unop(&ctx->builder, SpvOpImageQuerySamples,