Skip to content
  • Zack Rusin's avatar
    draw/translate: fix instancing · 1c2e5c22
    Zack Rusin authored
    
    
    We were incorrectly computing the buffer offset when using the
    instances. The buffer offset is always equal to:
    start_instance * stride + (instance_num / instance_divisor) *
    stride
    We were completely ignoring the start instance quite
    often producing instances that completely wrong, e.g. if
    start instance = 5, instance divisor = 2, then on the first
    iteration it should be:
    5 * stride, not (5/2) * stride as we'd have currently, and if
    start instance = 1, instance divisor = 3, then on the first
    iteration it should be:
    1 * stride, not 0 as we'd have.
    This fixes it and adjusts all the code to the changes.
    
    Signed-off-by: default avatarZack Rusin <zackr@vmware.com>
    1c2e5c22