radv: don't ever convert num_records to bytes if it's zero

If num_records==0, this conversion doesn't work. We should just keep it at
zero.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Gitlab: 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:18:55 +01:00 committed by Marge Bot
parent b7302ecf11
commit e4fbb200fc
1 changed files with 4 additions and 1 deletions

View File

@ -2911,7 +2911,10 @@ radv_flush_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer, bool pipeline_
else
num_records = (num_records - attrib_end) / stride + 1;
if ((chip == GFX8 && num_records) || (chip >= GFX10 && !stride))
/* GFX10 uses OOB_SELECT_RAW if stride==0, so convert num_records from elements into
* into bytes in that case. GFX8 always uses bytes.
*/
if (num_records && (chip == GFX8 || (chip >= GFX10 && !stride)))
num_records = (num_records - 1) * stride + attrib_end;
} else {
if (chip != GFX8 && stride)