{
struct st_renderbuffer *strb;
struct gl_renderbuffer *rb;
- struct pipe_texture *pt;
+ struct pipe_texture *pt = st_get_texobj_texture(att->Texture);
struct st_texture_object *stObj;
const struct gl_texture_image *texImage =
att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+ if (!pt) return;
+
assert(!att->Renderbuffer);
/* create new renderbuffer which wraps the texture image */
rb->Height = texImage->Height2;
/*printf("***** render to texture level %d: %d x %d\n", att->TextureLevel, rb->Width, rb->Height);*/
- pt = st_get_texobj_texture(att->Texture);
+ /*printf("***** pipe texture %d x %d\n", pt->width[0], pt->height[0]);*/
pipe_texture_reference( &strb->texture, pt );
/* the new surface will be created during framebuffer validation */
- if (pt) {
- /*printf("***** pipe texture %d x %d\n", pt->width[0], pt->height[0]);*/
- init_renderbuffer_bits(strb, pt->format);
- }
+ init_renderbuffer_bits(strb, pt->format);
/*
printf("RENDER TO TEXTURE obj=%p pt=%p surf=%p %d x %d\n",