aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorDuncan Hopkins <[email protected]>2019-07-11 11:51:08 +0100
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:48 +0000
commit5cf93985a00b80b27ea19a8dae0d77e6dae3331a (patch)
tree91c3ee3dfda34f2dbb1a6cd21e7618dbfe62f5b1 /src/gallium/drivers
parent108ba81c959021ba894553b2c409593c7c51b7bd (diff)
zink: respect ubo buffer alignment requirement
The driver can report a minimum alignment for UBOs, and that can be larger than 64, which we've currently been using. Let's play ball, and use the reported value instead. Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/zink/zink_context.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index a320f86067f..f5fefa7bbbb 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -428,9 +428,12 @@ zink_set_constant_buffer(struct pipe_context *pctx,
if (cb) {
struct pipe_resource *buffer = cb->buffer;
unsigned offset = cb->buffer_offset;
- if (cb->user_buffer)
- u_upload_data(ctx->base.const_uploader, 0, cb->buffer_size, 64,
+ if (cb->user_buffer) {
+ struct zink_screen *screen = zink_screen(pctx->screen);
+ u_upload_data(ctx->base.const_uploader, 0, cb->buffer_size,
+ screen->props.limits.minUniformBufferOffsetAlignment,
cb->user_buffer, &offset, &buffer);
+ }
pipe_resource_reference(&ctx->ubos[shader][index].buffer, buffer);
ctx->ubos[shader][index].buffer_offset = offset;