mesa: handle some cases of 0x0 render targets
This commit is contained in:
@@ -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++) {
|
||||
|
@@ -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",
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user