diff --git a/src/asahi/lib/agx_helpers.h b/src/asahi/lib/agx_helpers.h index d7a711a2b39..fbb9b3dd4f6 100644 --- a/src/asahi/lib/agx_helpers.h +++ b/src/asahi/lib/agx_helpers.h @@ -8,6 +8,7 @@ #include #include "asahi/compiler/agx_compile.h" #include "asahi/layout/layout.h" +#include "agx_abi.h" #include "agx_pack.h" #include "agx_ppp.h" #include "libagx_shaders.h" @@ -219,8 +220,8 @@ agx_set_null_pbe(struct agx_pbe_packed *pbe, uint64_t sink) * i <= floor((size - src_offset - elsize_B) / stride) */ static inline uint32_t -agx_calculate_vbo_clamp(uint64_t vbuf, uint64_t sink, enum pipe_format format, - uint32_t size_B, uint32_t stride_B, uint32_t offset_B, +agx_calculate_vbo_clamp(uint64_t vbuf, enum pipe_format format, uint32_t size_B, + uint32_t stride_B, uint32_t offset_B, uint64_t *vbuf_out) { unsigned elsize_B = util_format_get_blocksize(format); @@ -238,7 +239,7 @@ agx_calculate_vbo_clamp(uint64_t vbuf, uint64_t sink, enum pipe_format format, else return UINT32_MAX; } else { - *vbuf_out = sink; + *vbuf_out = AGX_ZERO_PAGE_ADDRESS; return 0; } } diff --git a/src/asahi/vulkan/hk_cmd_draw.c b/src/asahi/vulkan/hk_cmd_draw.c index a4b871bd867..72e92e17493 100644 --- a/src/asahi/vulkan/hk_cmd_draw.c +++ b/src/asahi/vulkan/hk_cmd_draw.c @@ -5,6 +5,7 @@ * SPDX-License-Identifier: MIT */ #include +#include "agx_abi.h" #include "agx_bg_eot.h" #include "agx_bo.h" #include "agx_compile.h" @@ -2611,8 +2612,6 @@ hk_flush_dynamic_state(struct hk_cmd_buffer *cmd, struct hk_cs *cs, if (IS_DIRTY(VI) || IS_DIRTY(VI_BINDINGS_VALID) || vgt_dirty || (gfx->dirty & HK_DIRTY_VB)) { - uint64_t sink = dev->rodata.zero_sink; - unsigned slot = 0; u_foreach_bit(a, sw_vs->info.vs.attribs_read) { if (dyn->vi->attributes_valid & BITFIELD_BIT(a)) { @@ -2620,11 +2619,11 @@ hk_flush_dynamic_state(struct hk_cmd_buffer *cmd, struct hk_cs *cs, struct hk_addr_range vb = gfx->vb[attr.binding]; desc->root.draw.attrib_clamps[slot] = agx_calculate_vbo_clamp( - vb.addr, sink, hk_format_to_pipe_format(attr.format), vb.range, + vb.addr, hk_format_to_pipe_format(attr.format), vb.range, dyn->vi_binding_strides[attr.binding], attr.offset, &desc->root.draw.attrib_base[slot]); } else { - desc->root.draw.attrib_base[slot] = sink; + desc->root.draw.attrib_base[slot] = AGX_ZERO_PAGE_ADDRESS; desc->root.draw.attrib_clamps[slot] = 0; } diff --git a/src/gallium/drivers/asahi/agx_uniforms.c b/src/gallium/drivers/asahi/agx_uniforms.c index 0095f27582b..bbe9a0571a0 100644 --- a/src/gallium/drivers/asahi/agx_uniforms.c +++ b/src/gallium/drivers/asahi/agx_uniforms.c @@ -8,6 +8,7 @@ #include "util/format/u_format.h" #include "util/half_float.h" #include "util/macros.h" +#include "agx_abi.h" #include "agx_device.h" #include "agx_state.h" #include "pool.h" @@ -30,7 +31,6 @@ agx_upload_vbos(struct agx_batch *batch) { struct agx_context *ctx = batch->ctx; struct agx_vertex_elements *attribs = ctx->attributes; - struct agx_device *dev = agx_device(ctx->base.screen); uint64_t buffers[PIPE_MAX_ATTRIBS] = {0}; size_t buf_sizes[PIPE_MAX_ATTRIBS] = {0}; @@ -47,22 +47,12 @@ agx_upload_vbos(struct agx_batch *batch) } } - /* NULL vertex buffers read zeroes from NULL. This depends on soft fault. - * Without soft fault, we just upload zeroes to read from. - */ - uint64_t sink = 0; - - if (!agx_has_soft_fault(dev)) { - uint32_t zeroes[4] = {0}; - sink = agx_pool_upload_aligned(&batch->pool, &zeroes, 16, 16); - } - for (unsigned i = 0; i < PIPE_MAX_ATTRIBS; ++i) { unsigned buf = attribs->buffers[i]; uint64_t addr; batch->uniforms.attrib_clamp[i] = agx_calculate_vbo_clamp( - buffers[buf], sink, attribs->key[i].format, buf_sizes[buf], + buffers[buf], attribs->key[i].format, buf_sizes[buf], attribs->key[i].stride, attribs->src_offsets[i], &addr); batch->uniforms.attrib_base[i] = addr;