diff options
author | Eric Anholt <[email protected]> | 2019-06-26 16:47:10 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-07-17 16:20:12 -0700 |
commit | bc50ecfa7af9976ce7543aeecef9337d5c874083 (patch) | |
tree | d19d9efc843f625688bfbcc1d9c4262f830f6fd4 /src | |
parent | b9f7f3e4972bd758e903adbdb6bdc2152413de73 (diff) |
freedreno: Fix more constlen overflows.
Fixes constlen overflow in
dEQP-GLES31.functional.shaders.builtin_var.compute.num_work_groups and
dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_32
and probably others.
Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_gallium.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c index ad74c8b1b66..eb0e866dd54 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c @@ -333,10 +333,11 @@ emit_image_dims(struct fd_context *ctx, const struct ir3_shader_variant *v, dims[off + 1] = ffs(dims[off + 0]) - 1; } } + uint32_t size = MIN2(ARRAY_SIZE(dims), v->constlen * 4 - offset * 4); ring_wfi(ctx->batch, ring); ctx->emit_const(ring, v->type, offset * 4, - 0, ARRAY_SIZE(dims), dims, NULL); + 0, size, dims, NULL); } } @@ -635,9 +636,11 @@ ir3_emit_cs_consts(const struct ir3_shader_variant *v, struct fd_ringbuffer *rin [IR3_DP_LOCAL_GROUP_SIZE_Y] = info->block[1], [IR3_DP_LOCAL_GROUP_SIZE_Z] = info->block[2], }; + uint32_t size = MIN2(ARRAY_SIZE(compute_params), + v->constlen * 4 - offset * 4); ctx->emit_const(ring, MESA_SHADER_COMPUTE, offset * 4, 0, - ARRAY_SIZE(compute_params), compute_params, NULL); + size, compute_params, NULL); } } } |