intel/fs: Fix IsHelperInvocation for the case no discard/demote are used

Use emit_predicate_on_sample_mask() helper that does check where to
get the correct mask depending on whether discard/demote was used or
not.

Fixes: 45f5db5a84 ("intel/fs: Implement "demote to helper invocation"")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15400>
This commit is contained in:
Caio Oliveira
2022-03-15 17:04:04 -07:00
committed by Marge Bot
parent bb311c22df
commit f82731d0d7
3 changed files with 30 additions and 15 deletions
+2 -15
View File
@@ -3458,22 +3458,9 @@ fs_visitor::nir_emit_fs_intrinsic(const fs_builder &bld,
bld.MOV(dest, fetch_render_target_array_index(bld));
break;
case nir_intrinsic_is_helper_invocation: {
/* Unlike the regular gl_HelperInvocation, that is defined at dispatch,
* the helperInvocationEXT() (aka SpvOpIsHelperInvocationEXT) takes into
* consideration demoted invocations. That information is stored in
* f0.1.
*/
dest.type = BRW_REGISTER_TYPE_UD;
bld.MOV(dest, brw_imm_ud(0));
fs_inst *mov = bld.MOV(dest, brw_imm_ud(~0));
mov->predicate = BRW_PREDICATE_NORMAL;
mov->predicate_inverse = true;
mov->flag_subreg = sample_mask_flag_subreg(this);
case nir_intrinsic_is_helper_invocation:
emit_is_helper_invocation(dest);
break;
}
case nir_intrinsic_load_helper_invocation:
case nir_intrinsic_load_sample_mask_in: