mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
radeonsi: use load_pixel_coord for polygon stipple lowering
We will get shader_info from NIR after this and before si_init_shader_args, so we need to use system values. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32910>
This commit is contained in:
parent
f156abd2a7
commit
c5d8100d10
1 changed files with 3 additions and 4 deletions
|
|
@ -2205,14 +2205,13 @@ static void si_nir_emit_polygon_stipple(nir_shader *nir, struct si_shader_args *
|
|||
* Since the stipple pattern is 32x32 and it repeats, just get 5 bits
|
||||
* per coordinate to get the repeating effect.
|
||||
*/
|
||||
nir_def *pos_x = ac_nir_unpack_arg(b, &args->ac, args->ac.pos_fixed_pt, 0, 5);
|
||||
nir_def *pos_y = ac_nir_unpack_arg(b, &args->ac, args->ac.pos_fixed_pt, 16, 5);
|
||||
nir_def *pixel_coord = nir_u2u32(b, nir_iand_imm(b, nir_load_pixel_coord(b), 0x1f));
|
||||
|
||||
nir_def *zero = nir_imm_int(b, 0);
|
||||
/* The stipple pattern is 32x32, each row has 32 bits. */
|
||||
nir_def *offset = nir_ishl_imm(b, pos_y, 2);
|
||||
nir_def *offset = nir_ishl_imm(b, nir_channel(b, pixel_coord, 1), 2);
|
||||
nir_def *row = nir_load_buffer_amd(b, 1, 32, desc, offset, zero, zero);
|
||||
nir_def *bit = nir_ubfe(b, row, pos_x, nir_imm_int(b, 1));
|
||||
nir_def *bit = nir_ubfe(b, row, nir_channel(b, pixel_coord, 0), nir_imm_int(b, 1));
|
||||
|
||||
nir_def *pass = nir_i2b(b, bit);
|
||||
nir_discard_if(b, nir_inot(b, pass));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue