summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c9
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c7
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c7
3 files changed, 15 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index ca1a719a9a..e14f55681c 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -55,10 +55,11 @@ update_renderbuffer_surface(struct st_context *st,
int rtt_width = strb->Base.Width;
int rtt_height = strb->Base.Height;
- if (!strb->surface ||
- strb->surface->texture != texture ||
- strb->surface->width != rtt_width ||
- strb->surface->height != rtt_height) {
+ if (texture &&
+ (!strb->surface ||
+ strb->surface->texture != texture ||
+ strb->surface->width != rtt_width ||
+ strb->surface->height != rtt_height)) {
GLuint level;
/* find matching mipmap level size */
for (level = 0; level <= texture->last_level; level++) {
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index eece7dee11..45a05421f8 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -388,8 +388,6 @@ st_render_texture(GLcontext *ctx,
/*printf("***** render to texture level %d: %d x %d\n", att->TextureLevel, rb->Width, rb->Height);*/
pt = st_get_texobj_texture(att->Texture);
- assert(pt);
- /*printf("***** pipe texture %d x %d\n", pt->width[0], pt->height[0]);*/
pipe_texture_reference( &strb->texture, pt );
@@ -397,7 +395,10 @@ st_render_texture(GLcontext *ctx,
/* the new surface will be created during framebuffer validation */
- init_renderbuffer_bits(strb, pt->format);
+ if (pt) {
+ /*printf("***** pipe texture %d x %d\n", pt->width[0], pt->height[0]);*/
+ init_renderbuffer_bits(strb, pt->format);
+ }
/*
printf("RENDER TO TEXTURE obj=%p pt=%p surf=%p %d x %d\n",
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index a15faf732c..9e5c35072a 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -160,9 +160,14 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
struct st_context *st = ctx->st;
struct pipe_texture *pt = st_get_texobj_texture(texObj);
const uint baseLevel = texObj->BaseLevel;
- const uint lastLevel = pt->last_level;
+ uint lastLevel;
uint dstLevel;
+ if (!pt)
+ return;
+
+ lastLevel = pt->last_level;
+
if (!st_render_mipmap(st, target, pt, baseLevel, lastLevel)) {
fallback_generate_mipmap(ctx, target, texObj);
}