mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 23:50:11 +01:00
nak/nir: Return one sample for gl_SampleMaskIn[0] when sample shading
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
parent
0e393f0d58
commit
6da06bf7d7
1 changed files with 16 additions and 0 deletions
|
|
@ -422,6 +422,22 @@ lower_fs_input_intrin(nir_builder *b, nir_intrinsic_instr *intrin, void *data)
|
|||
return true;
|
||||
}
|
||||
|
||||
case nir_intrinsic_load_sample_mask_in: {
|
||||
if (!b->shader->info.fs.uses_sample_shading &&
|
||||
!(fs_key && fs_key->force_sample_shading))
|
||||
return false;
|
||||
|
||||
b->cursor = nir_after_instr(&intrin->instr);
|
||||
|
||||
/* Mask off just the current sample */
|
||||
nir_def *sample = nir_load_sample_id(b);
|
||||
nir_def *mask = nir_ishl(b, nir_imm_int(b, 1), sample);
|
||||
mask = nir_iand(b, &intrin->def, mask);
|
||||
nir_def_rewrite_uses_after(&intrin->def, mask, mask->parent_instr);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue