return 0;
}
-static LLVMValueRef adjust_sample_index_using_fmask(struct ac_llvm_context *ctx,
- LLVMValueRef coord_x, LLVMValueRef coord_y,
- LLVMValueRef coord_z, LLVMValueRef sample_index,
- LLVMValueRef fmask_desc_ptr)
-{
- if (!fmask_desc_ptr)
- return sample_index;
-
- unsigned sample_chan = coord_z ? 3 : 2;
- LLVMValueRef addr[4] = {coord_x, coord_y, coord_z};
- addr[sample_chan] = sample_index;
-
- ac_apply_fmask_to_sample(ctx, fmask_desc_ptr, addr, coord_z != NULL);
- return addr[sample_chan];
-}
-
static nir_deref_instr *get_image_deref(const nir_intrinsic_instr *instr)
{
assert(instr->src[0].is_ssa);
static void tex_fetch_ptrs(struct ac_nir_context *ctx, nir_tex_instr *instr,
struct waterfall_context *wctx, LLVMValueRef *res_ptr,
- LLVMValueRef *samp_ptr, LLVMValueRef *fmask_ptr)
+ LLVMValueRef *samp_ptr)
{
bool texture_handle_divergent = false;
bool sampler_handle_divergent = false;
*res_ptr = NULL;
*samp_ptr = NULL;
- *fmask_ptr = NULL;
for (unsigned i = 0; i < instr->num_srcs; i++) {
switch (instr->src[i].src_type) {
case nir_tex_src_texture_deref:
if (instr->sampler_dim < GLSL_SAMPLER_DIM_RECT)
*samp_ptr = sici_fix_sampler_aniso(ctx, *res_ptr, *samp_ptr);
}
- if (ctx->ac.gfx_level < GFX11 &&
- fmask_ptr && (instr->op == nir_texop_txf_ms || instr->op == nir_texop_samples_identical))
- *fmask_ptr = get_sampler_desc(ctx, texture_deref_instr, AC_DESC_FMASK, &instr->instr,
- texture_dynamic_index, false, false);
}
static LLVMValueRef apply_round_slice(struct ac_llvm_context *ctx, LLVMValueRef coord)
{
LLVMValueRef result = NULL;
struct ac_image_args args = {0};
- LLVMValueRef fmask_ptr = NULL, sample_index = NULL;
+ LLVMValueRef sample_index = NULL;
LLVMValueRef ddx = NULL, ddy = NULL;
unsigned offset_src = 0;
struct waterfall_context wctx[2] = {{{0}}};
- tex_fetch_ptrs(ctx, instr, wctx, &args.resource, &args.sampler, &fmask_ptr);
+ tex_fetch_ptrs(ctx, instr, wctx, &args.resource, &args.sampler);
for (unsigned i = 0; i < instr->num_srcs; i++) {
switch (instr->src[i].src_type) {
goto write_result;
}
- if (ctx->ac.gfx_level < GFX11 &&
- (instr->sampler_dim == GLSL_SAMPLER_DIM_SUBPASS_MS ||
- instr->sampler_dim == GLSL_SAMPLER_DIM_MS) &&
- instr->op != nir_texop_fragment_fetch_amd &&
- instr->op != nir_texop_fragment_mask_fetch_amd) {
- unsigned sample_chan = instr->is_array ? 3 : 2;
- args.coords[sample_chan] = adjust_sample_index_using_fmask(
- &ctx->ac, args.coords[0], args.coords[1], instr->is_array ? args.coords[2] : NULL,
- args.coords[sample_chan], fmask_ptr);
- }
-
if (args.offset && (instr->op == nir_texop_txf || instr->op == nir_texop_txf_ms)) {
int num_offsets = instr->src[offset_src].src.ssa->num_components;
num_offsets = MIN2(num_offsets, instr->coord_components);