diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index a1b7d7020b5..19d25412a21 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -431,7 +431,8 @@ get_bufferview_for_binding(struct zink_context *ctx, enum pipe_shader_type stage static void update_descriptor_state(struct zink_context *ctx, enum pipe_shader_type shader, enum zink_descriptor_type type, unsigned slot) { - bool have_null_descriptors = zink_screen(ctx->base.screen)->info.rb2_feats.nullDescriptor; + struct zink_screen *screen = zink_screen(ctx->base.screen); + bool have_null_descriptors = screen->info.rb2_feats.nullDescriptor; VkBuffer null_buffer = zink_resource(ctx->dummy_vertex_buffer)->obj->buffer; struct zink_surface *null_surface = zink_surface(ctx->dummy_surface); struct zink_buffer_view *null_bufferview = ctx->dummy_bufferview; @@ -443,6 +444,7 @@ update_descriptor_state(struct zink_context *ctx, enum pipe_shader_type shader, if (res) { ctx->di.ubos[shader][slot].buffer = res->obj->buffer; ctx->di.ubos[shader][slot].range = ctx->ubos[shader][slot].buffer_size; + assert(ctx->di.ubos[shader][slot].range <= screen->info.props.limits.maxUniformBufferRange); } else { ctx->di.ubos[shader][slot].buffer = have_null_descriptors ? VK_NULL_HANDLE : null_buffer; ctx->di.ubos[shader][slot].range = VK_WHOLE_SIZE; diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index 10f3169974a..6c25face168 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -1141,7 +1141,6 @@ update_ubo_descriptors(struct zink_context *ctx, struct zink_descriptor_set *zds bool is_compute, bool cache_hit) { struct zink_program *pg = is_compute ? (struct zink_program *)ctx->curr_compute : (struct zink_program *)ctx->curr_program; - struct zink_screen *screen = zink_screen(ctx->base.screen); unsigned num_descriptors = pg->dd->pool[ZINK_DESCRIPTOR_TYPE_UBO]->key.layout->num_descriptors; unsigned num_bindings = zds->pool->num_resources; VkWriteDescriptorSet wds[num_descriptors]; @@ -1168,7 +1167,6 @@ update_ubo_descriptors(struct zink_context *ctx, struct zink_descriptor_set *zds if (!index) continue; assert(shader->bindings[ZINK_DESCRIPTOR_TYPE_UBO][j].type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER); - assert(ctx->ubos[stage][index].buffer_size <= screen->info.props.limits.maxUniformBufferRange); struct zink_resource *res = zink_get_resource_for_descriptor(ctx, ZINK_DESCRIPTOR_TYPE_UBO, stage, index); assert(!res || info->range > 0); assert(!res || info->buffer);