v3dv: use pSizes paramater in vkCmdBindVertexBuffers2
We can use this to specify the maximum vertex index that can be accessed, which the hardware will use to detect and prevent out-of-bounds accesses to vertex buffers. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29425>
This commit is contained in:
@@ -2620,7 +2620,9 @@ v3dX(cmd_buffer_emit_gl_shader_state)(struct v3dv_cmd_buffer *cmd_buffer)
|
||||
|
||||
attr.stride =
|
||||
cmd_buffer->vk.dynamic_graphics_state.vi_binding_strides[binding];
|
||||
attr.maximum_index = 0xffffff;
|
||||
|
||||
attr.maximum_index = attr.stride == 0 ?
|
||||
1u : MIN2(0xffffffu, c_vb->size / attr.stride);
|
||||
}
|
||||
|
||||
emitted_va_count++;
|
||||
|
||||
Reference in New Issue
Block a user