From: Jordan Justen Date: Wed, 1 Sep 2021 00:45:06 +0000 (-0700) Subject: blorp/clear: Simplify rbg-as-red channel packing X-Git-Tag: upstream/22.3.5~17253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00ea664cb6c1817d92cccd8f48c05fa93ddd3160;p=platform%2Fupstream%2Fmesa.git blorp/clear: Simplify rbg-as-red channel packing Suggested-by: Jason Ekstrand Signed-off-by: Jordan Justen Reviewed-by: Kenneth Graunke Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c index 5ad2f37..f2d004ef 100644 --- a/src/intel/blorp/blorp_clear.c +++ b/src/intel/blorp/blorp_clear.c @@ -75,15 +75,7 @@ blorp_params_get_clear_kernel(struct blorp_batch *batch, nir_ssa_def *pos = nir_f2i32(&b, nir_load_frag_coord(&b)); nir_ssa_def *comp = nir_umod(&b, nir_channel(&b, pos, 0), nir_imm_int(&b, 3)); - nir_ssa_def *color_component = - nir_bcsel(&b, nir_ieq_imm(&b, comp, 0), - nir_channel(&b, color, 0), - nir_bcsel(&b, nir_ieq_imm(&b, comp, 1), - nir_channel(&b, color, 1), - nir_channel(&b, color, 2))); - - nir_ssa_def *u = nir_ssa_undef(&b, 1, 32); - color = nir_vec4(&b, color_component, u, u, u); + color = nir_pad_vec4(&b, nir_vector_extract(&b, color, comp)); } nir_variable *frag_color = nir_variable_create(b.shader, nir_var_shader_out,