mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
asahi: Guard against encoder overflows
We don't seem to hit this yet, but it's possible so add an assert to rule it out for failing tests. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16512>
This commit is contained in:
parent
1d0d27aac7
commit
d814711155
1 changed files with 3 additions and 0 deletions
|
|
@ -1626,6 +1626,9 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
|
|||
(info->mode == PIPE_PRIM_LINE_STRIP) ||
|
||||
(info->mode == PIPE_PRIM_LINE_LOOP);
|
||||
|
||||
ptrdiff_t encoder_use = batch->encoder_current - (uint8_t *) batch->encoder->ptr.cpu;
|
||||
assert((encoder_use + 1024) < batch->encoder->size && "todo: how to expand encoder?");
|
||||
|
||||
uint8_t *out = agx_encode_state(ctx, batch->encoder_current,
|
||||
agx_build_pipeline(ctx, ctx->vs, PIPE_SHADER_VERTEX),
|
||||
agx_build_pipeline(ctx, ctx->fs, PIPE_SHADER_FRAGMENT),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue