libagx: specify heap size explicitly
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30051>
This commit is contained in:

committed by
Marge Bot

parent
a82c0211e7
commit
cc9b815efa
@@ -476,7 +476,7 @@ libagx_build_gs_draw(global struct agx_geometry_params *p, uint vertices,
|
|||||||
descriptor[3] = 0; /* index bias */
|
descriptor[3] = 0; /* index bias */
|
||||||
descriptor[4] = 0; /* start instance */
|
descriptor[4] = 0; /* start instance */
|
||||||
|
|
||||||
if (state->heap_bottom > 1024 * 1024 * 128) {
|
if (state->heap_bottom > state->heap_size) {
|
||||||
global uint *foo = (global uint *)(uintptr_t)0xdeadbeef;
|
global uint *foo = (global uint *)(uintptr_t)0xdeadbeef;
|
||||||
*foo = 0x1234;
|
*foo = 0x1234;
|
||||||
}
|
}
|
||||||
@@ -535,7 +535,7 @@ libagx_gs_setup_indirect(global struct agx_gs_setup_indirect_params *gsi,
|
|||||||
*(gsi->vertex_buffer) = (uintptr_t)(state->heap + state->heap_bottom);
|
*(gsi->vertex_buffer) = (uintptr_t)(state->heap + state->heap_bottom);
|
||||||
state->heap_bottom += align(vertex_buffer_size, 4);
|
state->heap_bottom += align(vertex_buffer_size, 4);
|
||||||
|
|
||||||
if (state->heap_bottom > 1024 * 1024 * 128) {
|
if (state->heap_bottom > state->heap_size) {
|
||||||
global uint *foo = (global uint *)(uintptr_t)0x1deadbeef;
|
global uint *foo = (global uint *)(uintptr_t)0x1deadbeef;
|
||||||
*foo = 0x1234;
|
*foo = 0x1234;
|
||||||
}
|
}
|
||||||
|
@@ -3929,13 +3929,16 @@ agx_batch_geometry_state(struct agx_batch *batch)
|
|||||||
struct agx_context *ctx = batch->ctx;
|
struct agx_context *ctx = batch->ctx;
|
||||||
|
|
||||||
if (!batch->geometry_state) {
|
if (!batch->geometry_state) {
|
||||||
|
uint32_t size = 128 * 1024 * 1024;
|
||||||
|
|
||||||
if (!ctx->heap) {
|
if (!ctx->heap) {
|
||||||
ctx->heap = pipe_buffer_create(ctx->base.screen, PIPE_BIND_GLOBAL,
|
ctx->heap = pipe_buffer_create(ctx->base.screen, PIPE_BIND_GLOBAL,
|
||||||
PIPE_USAGE_DEFAULT, 1024 * 1024 * 128);
|
PIPE_USAGE_DEFAULT, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct agx_geometry_state state = {
|
struct agx_geometry_state state = {
|
||||||
.heap = agx_resource(ctx->heap)->bo->ptr.gpu,
|
.heap = agx_resource(ctx->heap)->bo->ptr.gpu,
|
||||||
|
.heap_size = size,
|
||||||
};
|
};
|
||||||
|
|
||||||
agx_batch_writes(batch, agx_resource(ctx->heap), 0);
|
agx_batch_writes(batch, agx_resource(ctx->heap), 0);
|
||||||
|
Reference in New Issue
Block a user