mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 14:50:11 +01:00
blorp/clear: Simplify rbg-as-red channel packing
Suggested-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11564>
This commit is contained in:
parent
44ba094b1d
commit
00ea664cb6
1 changed files with 1 additions and 9 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue