We'll use it to query the min/mag filter in the shader.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19422>
/* Don't use the waterfall loop when returning a descriptor. */
tex_fetch_ptrs(ctx, instr, wctx, &args.resource, &args.sampler, &fmask_ptr,
- instr->op != nir_texop_descriptor_amd);
+ instr->op != nir_texop_descriptor_amd &&
+ instr->op != nir_texop_sampler_descriptor_amd);
if (instr->op == nir_texop_descriptor_amd) {
result = args.resource;
goto write_result;
}
+ if (instr->op == nir_texop_sampler_descriptor_amd) {
+ result = args.sampler;
+ goto write_result;
+ }
+
for (unsigned i = 0; i < instr->num_srcs; i++) {
switch (instr->src[i].src_type) {
case nir_tex_src_coord: {
case nir_texop_descriptor_amd:
return instr->sampler_dim == GLSL_SAMPLER_DIM_BUF ? 4 : 8;
+ case nir_texop_sampler_descriptor_amd:
+ return 4;
+
default:
if (instr->is_shadow && instr->is_new_style_shadow)
return 1;
case nir_texop_texture_samples:
case nir_texop_query_levels:
case nir_texop_descriptor_amd:
+ case nir_texop_sampler_descriptor_amd:
return true;
case nir_texop_tex:
case nir_texop_txb:
nir_texop_fragment_fetch_amd, /**< Multisample fragment color texture fetch */
nir_texop_fragment_mask_fetch_amd, /**< Multisample fragment mask texture fetch */
nir_texop_descriptor_amd, /**< Returns a buffer or image descriptor. */
+ nir_texop_sampler_descriptor_amd, /**< Returns a sampler descriptor. */
} nir_texop;
/** Represents a texture instruction */
case nir_texop_descriptor_amd:
fprintf(fp, "descriptor_amd ");
break;
+ case nir_texop_sampler_descriptor_amd:
+ fprintf(fp, "sampler_descriptor_amd ");
+ break;
default:
unreachable("Invalid texture operation");
break;
glsl_type_is_sampler(deref->type));
switch (instr->op) {
case nir_texop_descriptor_amd:
+ case nir_texop_sampler_descriptor_amd:
break;
case nir_texop_lod:
validate_assert(state, nir_alu_type_get_base_type(instr->dest_type) == nir_type_float);
vtn_fail("unexpected nir_texop_tex_prefetch");
break;
case nir_texop_descriptor_amd:
- vtn_fail("unexpected nir_texop_descriptor_amd");
+ case nir_texop_sampler_descriptor_amd:
+ vtn_fail("unexpected nir_texop_*descriptor_amd");
break;
}