softpipe/buffer: load only as many components as the the buffer resource type provides
authorGert Wollny <gert.wollny@collabora.com>
Mon, 13 May 2019 12:02:24 +0000 (14:02 +0200)
committerGert Wollny <gw.fossdev@gmail.com>
Tue, 14 May 2019 06:49:43 +0000 (06:49 +0000)
commit865b9ddae4874186182e529b5fd154ab04a61f79
treeccb2c32cd2907790742312a7b1d61e2627d2e0dc
parent10502730948f6b725a608eeab0651b39d7d98be1
softpipe/buffer: load only as many components as the the buffer resource type provides

Otherwise we risk to read past the end of the buffer.

In addition, change the loop counters to unsigned to be consistent
with the types.

Fixes: afa8707ba93a7d226a76319acda2a8dd89524db7
    softpipe: add SSBO/shader atomics support.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/softpipe/sp_buffer.c