svga: fix buffer binding flags initialization
authorBrian Paul <brianp@vmware.com>
Fri, 30 Jun 2017 21:02:20 +0000 (14:02 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 3 Jul 2017 16:10:11 +0000 (10:10 -0600)
commit9bd047aa268a7be1222edb10ee448886fcdc9a68
treeb8a47ccefd70667fdacf384460f45b148f22f9c2
parent8e4559b3fc1c5bac55a0918ddf0c304d6ec970fc
svga: fix buffer binding flags initialization

If a buffer is created/initialized with glNamedBufferData we will
have no target (GL_ARRAY_BUFFER, GL_UNIFORM_BUFFER, etc) so the
svga_buffer::bind_flags will be zero until we try to get the buffer
handle.

This patch initializes the svga_buffer::bind_flags field when it's
zero.

This fixes the Piglit arb_uniform_buffer_object-rendering-dsa test.

Note that there's still issues in this area that'll have to be
addressed in the future.  For example, creating a buffer object
as GL_UNIFORM_BUFFER and later using it as a vertex buffer will
fail.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_resource_buffer_upload.c