zink: handle nir_texop_texture_samples

this is just a SpvOpImageQuerySamples

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8947>
This commit is contained in:
Mike Blumenkrantz 2020-08-18 17:00:48 -04:00 committed by Marge Bot
parent efbd3584e3
commit 802c1afe9c
1 changed files with 9 additions and 1 deletions

View File

@ -2895,7 +2895,8 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
tex->op == nir_texop_txf_ms ||
tex->op == nir_texop_txs ||
tex->op == nir_texop_lod ||
tex->op == nir_texop_tg4);
tex->op == nir_texop_tg4 ||
tex->op == nir_texop_texture_samples);
assert(tex->texture_index == tex->sampler_index);
SpvId coord = 0, proj = 0, bias = 0, lod = 0, dref = 0, dx = 0, dy = 0,
@ -3024,6 +3025,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_texture_samples) {
SpvId image = spirv_builder_emit_image(&ctx->builder, image_type, load);
SpvId result = spirv_builder_emit_unop(&ctx->builder, SpvOpImageQuerySamples,
dest_type, image);
store_dest(ctx, &tex->dest, result, tex->dest_type);
return;
}
if (proj && coord_components > 0) {
SpvId constituents[coord_components + 1];