diff options
author | Marek Olšák <[email protected]> | 2014-02-06 02:16:50 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-02-06 17:29:59 +0100 |
commit | c6dbcf10dff1f8343a26081f5489ef732ebb5460 (patch) | |
tree | b1ead7d9e8f4f30ad559f252b43ccf2458e5f474 /src/mesa/state_tracker | |
parent | b862cc23f203f1fd87edf44a32312491dce8bb91 (diff) |
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" <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 81a5d9b4dfb..824a13e205d 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1483,6 +1483,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); |