summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorDuncan Hopkins <[email protected]>2019-09-26 12:25:26 +0100
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:48 +0000
commitc4446098cf587f0cd7259dd0cca0b227a17bb82c (patch)
tree8e56fea25dceb99cc9ea15762478157db396c093 /src/gallium/drivers
parent4ef088f241837d64ec7362acf24ca794de24102d (diff)
zink: limited uniform buffer size so the limits is not exceeded.
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/zink/zink_context.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index f5fefa7bbbb..773bc092bc1 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1010,11 +1010,12 @@ zink_draw_vbo(struct pipe_context *pctx,
int index = shader->bindings[j].index;
if (shader->bindings[j].type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) {
assert(ctx->ubos[i][index].buffer_size > 0);
+ assert(ctx->ubos[i][index].buffer_size <= screen->props.limits.maxUniformBufferRange);
assert(ctx->ubos[i][index].buffer);
struct zink_resource *res = zink_resource(ctx->ubos[i][index].buffer);
buffer_infos[num_buffer_info].buffer = res->buffer;
buffer_infos[num_buffer_info].offset = ctx->ubos[i][index].buffer_offset;
- buffer_infos[num_buffer_info].range = VK_WHOLE_SIZE;
+ buffer_infos[num_buffer_info].range = ctx->ubos[i][index].buffer_size;
wds[num_wds].pBufferInfo = buffer_infos + num_buffer_info;
++num_buffer_info;
} else {