Mesa (10.1): st/mesa: fix crash when a shader uses a TBO and it' s not bound
Ian Romanick
idr at kemper.freedesktop.org
Sat Feb 8 01:10:20 UTC 2014
Module: Mesa
Branch: 10.1
Commit: 61219adb3d759bc20a2e9f39ab865b27bb2eff3f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=61219adb3d759bc20a2e9f39ab865b27bb2eff3f
Author: Marek Olšák <marek.olsak at amd.com>
Date: Thu Feb 6 02:16:50 2014 +0100
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 at lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit c6dbcf10dff1f8343a26081f5489ef732ebb5460)
---
src/mesa/state_tracker/st_cb_texture.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 81a5d9b..824a13e 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);
More information about the mesa-commit
mailing list