diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-04-02 09:30:07 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-04-02 09:30:07 +0000 |
commit | f54e142455cb3c9d1662dae7e096a32a47e5409b (patch) | |
tree | 440ecd46269f0eac25e349e1ed58f246490c5e26 /lib/mesa/src/gallium/drivers/vc4 | |
parent | 36d8503c27530f68d655d3ef77a6eaa4dfd8ad65 (diff) |
Import Mesa 23.3.6
Diffstat (limited to 'lib/mesa/src/gallium/drivers/vc4')
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c | 78 | ||||
-rw-r--r-- | lib/mesa/src/gallium/drivers/vc4/vc4_query.c | 4 |
2 files changed, 36 insertions, 46 deletions
diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c b/lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c index 57a3fda1d..56d492993 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c @@ -35,7 +35,7 @@ * and do the math in the shader. */ -static nir_ssa_def * +static nir_def * vc4_nir_lower_txf_ms_instr(nir_builder *b, nir_instr *instr, void *data) { nir_tex_instr *txf_ms = nir_instr_as_tex(instr); @@ -49,10 +49,8 @@ vc4_nir_lower_txf_ms_instr(nir_builder *b, nir_instr *instr, void *data) txf->is_new_style_shadow = txf_ms->is_new_style_shadow; txf->dest_type = txf_ms->dest_type; - nir_ssa_def *coord = NULL, *sample_index = NULL; + nir_def *coord = NULL, *sample_index = NULL; for (int i = 0; i < txf_ms->num_srcs; i++) { - assert(txf_ms->src[i].src.is_ssa); - switch (txf_ms->src[i].src_type) { case nir_tex_src_coord: coord = txf_ms->src[i].src.ssa; @@ -67,8 +65,8 @@ vc4_nir_lower_txf_ms_instr(nir_builder *b, nir_instr *instr, void *data) assert(coord); assert(sample_index); - nir_ssa_def *x = nir_channel(b, coord, 0); - nir_ssa_def *y = nir_channel(b, coord, 1); + nir_def *x = nir_channel(b, coord, 0); + nir_def *y = nir_channel(b, coord, 1); uint32_t tile_w = 32; uint32_t tile_h = 32; @@ -80,49 +78,41 @@ vc4_nir_lower_txf_ms_instr(nir_builder *b, nir_instr *instr, void *data) uint32_t w = align(c->key->tex[unit].msaa_width, tile_w); uint32_t w_tiles = w / tile_w; - nir_ssa_def *x_tile = nir_ushr(b, x, nir_imm_int(b, tile_w_shift)); - nir_ssa_def *y_tile = nir_ushr(b, y, nir_imm_int(b, tile_h_shift)); - nir_ssa_def *tile_addr = nir_iadd(b, - nir_imul(b, x_tile, - nir_imm_int(b, tile_size)), - nir_imul(b, y_tile, - nir_imm_int(b, (w_tiles * - tile_size)))); - nir_ssa_def *x_subspan = nir_iand(b, x, - nir_imm_int(b, (tile_w - 1) & ~1)); - nir_ssa_def *y_subspan = nir_iand(b, y, - nir_imm_int(b, (tile_h - 1) & ~1)); - nir_ssa_def *subspan_addr = nir_iadd(b, - nir_imul(b, x_subspan, - nir_imm_int(b, 2 * VC4_MAX_SAMPLES * sizeof(uint32_t))), - nir_imul(b, y_subspan, - nir_imm_int(b, - tile_w * - VC4_MAX_SAMPLES * - sizeof(uint32_t)))); - - nir_ssa_def *pixel_addr = nir_ior(b, - nir_iand(b, - nir_ishl(b, x, - nir_imm_int(b, 2)), - nir_imm_int(b, (1 << 2))), - nir_iand(b, - nir_ishl(b, y, - nir_imm_int(b, 3)), - nir_imm_int(b, (1 << 3)))); - - nir_ssa_def *sample_addr = nir_ishl(b, sample_index, nir_imm_int(b, 4)); - - nir_ssa_def *addr = nir_iadd(b, + nir_def *x_tile = nir_ushr_imm(b, x, tile_w_shift); + nir_def *y_tile = nir_ushr_imm(b, y, tile_h_shift); + nir_def *tile_addr = nir_iadd(b, + nir_imul_imm(b, x_tile, tile_size), + nir_imul_imm(b, y_tile, w_tiles * + tile_size)); + nir_def *x_subspan = nir_iand_imm(b, x, (tile_w - 1) & ~1); + nir_def *y_subspan = nir_iand_imm(b, y, (tile_h - 1) & ~1); + nir_def *subspan_addr = nir_iadd(b, + nir_imul_imm(b, x_subspan, + 2 * VC4_MAX_SAMPLES * sizeof(uint32_t)), + nir_imul_imm(b, y_subspan, + tile_w * VC4_MAX_SAMPLES * + sizeof(uint32_t))); + + nir_def *pixel_addr = nir_ior(b, + nir_iand_imm(b, + nir_ishl_imm(b, x, 2), + 1 << 2), + nir_iand_imm(b, + nir_ishl_imm(b, y, 3), + 1 << 3)); + + nir_def *sample_addr = nir_ishl_imm(b, sample_index, 4); + + nir_def *addr = nir_iadd(b, nir_ior(b, sample_addr, pixel_addr), nir_iadd(b, subspan_addr, tile_addr)); - txf->src[0].src_type = nir_tex_src_coord; - txf->src[0].src = nir_src_for_ssa(nir_vec2(b, addr, nir_imm_int(b, 0))); - nir_ssa_dest_init(&txf->instr, &txf->dest, 4, 32, NULL); + txf->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_vec2(b, addr, nir_imm_int(b, 0))); + nir_def_init(&txf->instr, &txf->def, 4, 32); nir_builder_instr_insert(b, &txf->instr); - return &txf->dest.ssa; + return &txf->def; } static bool diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_query.c b/lib/mesa/src/gallium/drivers/vc4/vc4_query.c index 94ec13817..6a7fd2b69 100644 --- a/lib/mesa/src/gallium/drivers/vc4/vc4_query.c +++ b/lib/mesa/src/gallium/drivers/vc4/vc4_query.c @@ -50,7 +50,7 @@ static const char *v3d_counter_names[] = { "TLB-quads-written-to-color-buffer", "PTB-primitives-discarded-outside-viewport", "PTB-primitives-need-clipping", - "PTB-primitives-discared-reversed", + "PTB-primitives-discarded-reversed", "QPU-total-idle-clk-cycles", "QPU-total-clk-cycles-vertex-coord-shading", "QPU-total-clk-cycles-fragment-shading", @@ -262,7 +262,7 @@ vc4_get_query_result(struct pipe_context *pctx, struct pipe_query *pquery, } if (!vc4_wait_seqno(ctx->screen, query->hwperfmon->last_seqno, - wait ? PIPE_TIMEOUT_INFINITE : 0, "perfmon")) + wait ? OS_TIMEOUT_INFINITE : 0, "perfmon")) return false; req.id = query->hwperfmon->id; |