i965/draw: Properly handle rounding when dividing by InstanceDivisor
The old code always divided rounded down and then subtracted 1. What we wanted was to divide rounded up and then subtract 1 which is equivalent to subtracting 1 and then dividing rounded down. Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
ad42ab473c
commit
d5b4ab2c5f
|
@ -474,8 +474,8 @@ brw_prepare_vertices(struct brw_context *brw)
|
|||
if (glarray->InstanceDivisor) {
|
||||
if (brw->num_instances) {
|
||||
start = offset + glarray->StrideB * brw->baseinstance;
|
||||
range = (glarray->StrideB * ((brw->num_instances /
|
||||
glarray->InstanceDivisor) - 1) +
|
||||
range = (glarray->StrideB * ((brw->num_instances - 1) /
|
||||
glarray->InstanceDivisor) +
|
||||
glarray->_ElementSize);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue