Module: Mesa
Branch: main
Commit: 71980739a10d44eec5f5d9e5b2b9a4e7d9989cca
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=71980739a10d44eec5f5d9e5b2b9a4e7d9989cca

Author: James Glanville <[email protected]>
Date:   Fri Apr 28 09:21:50 2023 +0100

pvr: Fix vtxin special var allocation count

When pvr_graphics_pipeline_alloc_vertex_special_vars() was
allocating vtxin regs for special vars, it wasn't returning back
the updated amount of allocated regs so when the PDS was filling
them in, it would try to write out of bounds.

Signed-off-by: James Glanville <[email protected]>
Signed-off-by: Karmjit Mahil <[email protected]>
Reviewed-by: Frank Binns <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22750>

---

 src/imagination/vulkan/pvr_pipeline.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/imagination/vulkan/pvr_pipeline.c 
b/src/imagination/vulkan/pvr_pipeline.c
index 9c3b9574b74..39af8a4589e 100644
--- a/src/imagination/vulkan/pvr_pipeline.c
+++ b/src/imagination/vulkan/pvr_pipeline.c
@@ -1863,6 +1863,7 @@ static void 
pvr_graphics_pipeline_alloc_vertex_special_vars(
    layout.instance_id_offset = (int16_t)next_free_reg;
    next_free_reg++;
 
+   *num_vertex_input_regs = next_free_reg;
    *special_vars_layout_out = layout;
 }
 

Reply via email to