From: Alyssa Rosenzweig Date: Tue, 7 Jan 2020 01:39:58 +0000 (-0500) Subject: panfrost: Respect constant buffer_offset X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b714f3fa377be681f9031c5884e96b277eac102;p=mesa.git panfrost: Respect constant buffer_offset Fixes dEQP-GLES3.functional.ubo.multi_basic_types.single_buffer.* among others Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso --- diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 9c51f423f86..33340cd566c 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -797,9 +797,11 @@ panfrost_map_constant_buffer_gpu( PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_READ | panfrost_bo_access_for_stage(st)); - return rsrc->bo->gpu; + + /* Alignment gauranteed by PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT */ + return rsrc->bo->gpu + cb->buffer_offset; } else if (cb->user_buffer) { - return panfrost_upload_transient(batch, cb->user_buffer, cb->buffer_size); + return panfrost_upload_transient(batch, cb->user_buffer + cb->buffer_offset, cb->buffer_size); } else { unreachable("No constant buffer"); }