summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarmjit Mahil <Karmjit.Mahil@imgtec.com>2022-05-17 16:27:37 +0100
committerMarge Bot <emma+marge@anholt.net>2022-06-24 09:15:53 +0000
commit6e6e1e84067fa8ed5044198d5d656d0e318ceb27 (patch)
tree1e94889712ac4a920f37552eb1ec94b3c4aace62
parent4240c83960b049d2b18f6912c51ece5df506fd0c (diff)
pvr: Fix off by 1 error in buffer_id for ubo pds program.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17206>
-rw-r--r--src/imagination/vulkan/pvr_pipeline.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/imagination/vulkan/pvr_pipeline.c b/src/imagination/vulkan/pvr_pipeline.c
index 2cf02104a8b..976b0addeaa 100644
--- a/src/imagination/vulkan/pvr_pipeline.c
+++ b/src/imagination/vulkan/pvr_pipeline.c
@@ -571,10 +571,10 @@ static void pvr_pds_uniform_program_setup_buffers(
uint32_t buffer_count = 0;
for (size_t u = 0; u < ubo_data->num_ubo_entries; ++u) {
- struct pvr_pds_buffer *current_buffer = &buffers[buffer_count++];
+ struct pvr_pds_buffer *current_buffer = &buffers[buffer_count];
/* This is fine since buffers_out_ptr is a pointer to an array. */
- assert(buffer_count <= ARRAY_SIZE(*buffers_out_ptr));
+ assert(buffer_count < ARRAY_SIZE(*buffers_out_ptr));
current_buffer->type = PVR_BUFFER_TYPE_UBO;
current_buffer->size_in_dwords = ubo_data->size[u];
@@ -587,6 +587,8 @@ static void pvr_pds_uniform_program_setup_buffers(
* E.g. can multiple UBOs have the same base buffer?
*/
current_buffer->source_offset = 0;
+
+ buffer_count++;
}
*buffer_count_out = buffer_count;