st/mesa: fix crash when a shader uses a TBO and it's not bound

This binds a NULL sampler view in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74251

Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c6dbcf10df)
This commit is contained in:
Marek Olšák 2014-02-06 02:16:50 +01:00 committed by Carl Worth
parent 1b6aec4b5a
commit cfd8aed240

View file

@ -1485,6 +1485,12 @@ st_finalize_texture(struct gl_context *ctx,
if (tObj->Target == GL_TEXTURE_BUFFER) {
struct st_buffer_object *st_obj = st_buffer_object(tObj->BufferObject);
if (!st_obj) {
pipe_resource_reference(&stObj->pt, NULL);
pipe_sampler_view_reference(&stObj->sampler_view, NULL);
return GL_TRUE;
}
if (st_obj->buffer != stObj->pt) {
pipe_resource_reference(&stObj->pt, st_obj->buffer);
pipe_sampler_view_release(st->pipe, &stObj->sampler_view);