v3dv: implement nir_texop_texture_samples

Fixes:
dEQP-VK.glsl.texture_functions.query.texturesamples.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Iago Toral Quiroga
2020-08-04 11:21:14 +02:00
committed by Marge Bot
parent 6ee88f0acd
commit 644a15e69e
3 changed files with 9 additions and 1 deletions

View File

@@ -609,6 +609,10 @@ ntq_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
ntq_store_dest(c, &instr->dest, 0,
vir_uniform(c, QUNIFORM_TEXTURE_LEVELS, unit));
return;
case nir_texop_texture_samples:
ntq_store_dest(c, &instr->dest, 0,
vir_uniform(c, QUNIFORM_TEXTURE_SAMPLES, unit));
return;
case nir_texop_txs:
ntq_emit_txs(c, instr);
return;
@@ -3022,7 +3026,6 @@ vir_check_payload_w(struct v3d_compile *c)
}
}
}
}
void

View File

@@ -241,6 +241,7 @@ enum quniform_contents {
QUNIFORM_TEXTURE_DEPTH,
QUNIFORM_TEXTURE_ARRAY_SIZE,
QUNIFORM_TEXTURE_LEVELS,
QUNIFORM_TEXTURE_SAMPLES,
QUNIFORM_UBO_ADDR,

View File

@@ -254,6 +254,9 @@ get_texture_size_from_image_view(struct v3dv_image_view *image_view,
}
case QUNIFORM_TEXTURE_LEVELS:
return image_view->max_level - image_view->base_level + 1;
case QUNIFORM_TEXTURE_SAMPLES:
assert(image_view->image);
return image_view->image->samples;
default:
unreachable("Bad texture size field");
}
@@ -395,6 +398,7 @@ v3dv_write_uniforms_wg_offsets(struct v3dv_cmd_buffer *cmd_buffer,
case QUNIFORM_TEXTURE_DEPTH:
case QUNIFORM_TEXTURE_ARRAY_SIZE:
case QUNIFORM_TEXTURE_LEVELS:
case QUNIFORM_TEXTURE_SAMPLES:
cl_aligned_u32(&uniforms,
get_texture_size(cmd_buffer,
pipeline,