radv: adjust num_records when offset>stride

If an attribute's offset is larger than the stride, the compiler will
increase the vertex index and use offset%stride instead as the offset.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5007
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11642>
This commit is contained in:
Rhys Perry
2021-06-29 16:30:00 +01:00
committed by Marge Bot
parent e4fbb200fc
commit a2ac660eb7
3 changed files with 13 additions and 3 deletions

View File

@@ -5316,6 +5316,9 @@ radv_pipeline_init_vertex_input_state(struct radv_pipeline *pipeline,
uint32_t end = desc->offset + vk_format_get_blocksize(desc->format);
pipeline->attrib_ends[desc->location] = end;
if (pipeline->binding_stride[desc->binding])
pipeline->attrib_index_offset[desc->location] =
desc->offset / pipeline->binding_stride[desc->binding];
pipeline->attrib_bindings[desc->location] = desc->binding;
}