zink: limited uniform buffer size so the limits is not exceeded.
authorDuncan Hopkins <duncan@thefoundry.co.uk>
Thu, 26 Sep 2019 11:25:26 +0000 (12:25 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:48 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c

index f5fefa7bbbb1aa589231c25df91604b95f99402e..773bc092bc15bc8bf69e376122adf30103bfcd84 100644 (file)
@@ -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 {