mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
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:
parent
1b6aec4b5a
commit
cfd8aed240
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue