mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
i965: Avoid division by zero.
Fixes regression introduced byaf5ca43f26Cc: "12.0 11.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95419 (cherry picked from commit01c89ccc5d)
This commit is contained in:
parent
1e8fb90f19
commit
133d0f0882
1 changed files with 14 additions and 10 deletions
|
|
@ -300,17 +300,21 @@ gen7_upload_urb(struct brw_context *brw)
|
|||
remaining_space -= vs_additional;
|
||||
total_wants -= vs_wants;
|
||||
|
||||
unsigned hs_additional = (unsigned)
|
||||
round(hs_wants * (((double) remaining_space) / total_wants));
|
||||
hs_chunks += hs_additional;
|
||||
remaining_space -= hs_additional;
|
||||
total_wants -= hs_wants;
|
||||
if (total_wants > 0) {
|
||||
unsigned hs_additional = (unsigned)
|
||||
round(hs_wants * (((double) remaining_space) / total_wants));
|
||||
hs_chunks += hs_additional;
|
||||
remaining_space -= hs_additional;
|
||||
total_wants -= hs_wants;
|
||||
}
|
||||
|
||||
unsigned ds_additional = (unsigned)
|
||||
round(ds_wants * (((double) remaining_space) / total_wants));
|
||||
ds_chunks += ds_additional;
|
||||
remaining_space -= ds_additional;
|
||||
total_wants -= ds_wants;
|
||||
if (total_wants > 0) {
|
||||
unsigned ds_additional = (unsigned)
|
||||
round(ds_wants * (((double) remaining_space) / total_wants));
|
||||
ds_chunks += ds_additional;
|
||||
remaining_space -= ds_additional;
|
||||
total_wants -= ds_wants;
|
||||
}
|
||||
|
||||
gs_chunks += remaining_space;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue