aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2009-01-14 16:53:22 +0000
committerAlan Hourihane <[email protected]>2009-01-14 16:53:22 +0000
commit85dfed93fe2a6aace7dd2e08f97760e7062e6eb3 (patch)
tree9b942ba4709979049a40f7214c7213805f651e98 /src/mesa
parent1d376ae7c93fb4bb929942e56425c4be6401dff7 (diff)
mesa: handle some cases of 0x0 render targets
Diffstat (limited to 'src/mesa')
-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 ca1a719a9ac..e14f55681cd 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 eece7dee112..45a05421f8e 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 a15faf732ca..9e5c35072a1 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);
}