cpp * 2,
ALIGN(width, 64),
ALIGN((height + 1) / 2, 64),
- GL_TRUE);
+ true);
if (!irb->region)
return false;
} else {
irb->region = intel_region_alloc(intel->intelScreen, tiling, cpp,
- width, height, GL_TRUE);
+ width, height, true);
if (!irb->region)
return false;
irb->region->cpp,
irb->region->width,
irb->region->height,
- GL_TRUE);
+ true);
if (!irb->hiz_region) {
intel_region_release(&irb->region);
return false;
}
}
- return GL_TRUE;
+ return true;
}
rb->Height = height;
rb->InternalFormat = internalFormat;
- return GL_TRUE;
+ return true;
}
_mesa_resize_framebuffer(ctx, fb, width, height);
- fb->Initialized = GL_TRUE; /* XXX remove someday */
+ fb->Initialized = true; /* XXX remove someday */
if (fb->Name != 0) {
return;
GLenum internalFormat, GLuint width, GLuint height)
{
_mesa_problem(ctx, "intel_op_alloc_storage should never be called.");
- return GL_FALSE;
+ return false;
}
/**
struct intel_renderbuffer *irb,
struct intel_texture_image *intel_image);
-static GLboolean
+static bool
intel_update_wrapper(struct gl_context *ctx, struct intel_renderbuffer *irb,
struct gl_texture_image *texImage)
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_image *intel_image = intel_texture_image(texImage);
+ int width, height, depth;
if (!intel_span_supports_format(texImage->TexFormat)) {
DBG("Render to texture BAD FORMAT %s\n",
_mesa_get_format_name(texImage->TexFormat));
- return GL_FALSE;
+ return false;
} else {
DBG("Render to texture %s\n", _mesa_get_format_name(texImage->TexFormat));
}
+ intel_miptree_get_dimensions_for_image(texImage, &width, &height, &depth);
+
irb->Base.Format = texImage->TexFormat;
irb->Base.DataType = intel_mesa_format_to_rb_datatype(texImage->TexFormat);
irb->Base.InternalFormat = texImage->InternalFormat;
irb->Base._BaseFormat = _mesa_base_tex_format(ctx, irb->Base.InternalFormat);
- irb->Base.Width = texImage->Width;
- irb->Base.Height = texImage->Height;
+ irb->Base.Width = width;
+ irb->Base.Height = height;
irb->Base.Delete = intel_delete_renderbuffer;
irb->Base.AllocStorage = intel_nop_alloc_storage;
/* The tex image shares its embedded depth and stencil renderbuffers with
* the renderbuffer wrapper. */
- if (irb->wrapped_depth != intel_image->depth_rb) {
- _mesa_reference_renderbuffer(&irb->wrapped_depth,
- intel_image->depth_rb);
- }
- if (irb->wrapped_stencil != intel_image->stencil_rb) {
- _mesa_reference_renderbuffer(&irb->wrapped_stencil,
- intel_image->stencil_rb);
- }
+ _mesa_reference_renderbuffer(&irb->wrapped_depth,
+ intel_image->depth_rb);
+ _mesa_reference_renderbuffer(&irb->wrapped_stencil,
+ intel_image->stencil_rb);
return true;
-
} else {
return intel_update_tex_wrapper_regions(intel, irb, intel_image);
}
_mesa_get_format_bytes(rb->Format),
rb->Width,
rb->Height,
- GL_TRUE);
+ true);
if (!intel_image->mt->hiz_region)
- return GL_FALSE;
+ return false;
}
/* Point the renderbuffer's hiz region to the texture's hiz region. */
intel_region_reference(&irb->hiz_region, intel_image->mt->hiz_region);
}
- return GL_TRUE;
+ return true;
}
/* compute offset of the particular 2D image within the texture region */
intel_miptree_get_image_offset(intel_image->mt,
- intel_image->base.Level,
- intel_image->base.Face,
+ intel_image->base.Base.Level,
+ intel_image->base.Base.Face,
zoffset,
&dst_x, &dst_y);
irb->Base.RefCount);
intel_renderbuffer_set_draw_offset(irb, intel_image, att->Zoffset);
- intel_image->used_as_render_target = GL_TRUE;
+ intel_image->used_as_render_target = true;
#ifndef I915
if (need_tile_offset_workaround(brw_context(ctx), irb)) {
* into that.
*/
struct intel_context *intel = intel_context(ctx);
- struct intel_mipmap_tree *old_mt = intel_image->mt;
struct intel_mipmap_tree *new_mt;
+ int width, height, depth;
+
+ intel_miptree_get_dimensions_for_image(image, &width, &height, &depth);
new_mt = intel_miptree_create(intel, image->TexObject->Target,
- intel_image->base.TexFormat,
- intel_image->base.Level,
- intel_image->base.Level,
- intel_image->base.Width,
- intel_image->base.Height,
- intel_image->base.Depth,
- GL_TRUE);
-
- intel_miptree_image_copy(intel,
- new_mt,
- intel_image->base.Face,
- intel_image->base.Level,
- old_mt);
-
- intel_miptree_release(intel, &intel_image->mt);
- intel_image->mt = new_mt;
+ intel_image->base.Base.TexFormat,
+ intel_image->base.Base.Level,
+ intel_image->base.Base.Level,
+ width, height, depth,
+ true);
+
+ intel_miptree_copy_teximage(intel, intel_image, new_mt);
intel_renderbuffer_set_draw_offset(irb, intel_image, att->Zoffset);
intel_region_reference(&irb->region, intel_image->mt->region);
+ intel_miptree_release(&new_mt);
}
#endif
/* update drawing region, etc */
/* Flag that this image may now be validated into the object's miptree. */
if (intel_image)
- intel_image->used_as_render_target = GL_FALSE;
+ intel_image->used_as_render_target = false;
/* Since we've (probably) rendered to the texture and will (likely) use
* it in the texture domain later on in this batchbuffer, flush the
struct gl_texture_image *texImage =
_mesa_select_tex_image(ctx, texObj, target, dstLevel);
- GLenum internalFormat = texImage->InternalFormat;
- if (intel_copy_texsubimage(intel_context(ctx), target,
+ if (intel_copy_texsubimage(intel_context(ctx),
intel_texture_image(texImage),
- internalFormat,
dstX0, dstY0,
srcX0, srcY0,
srcX1 - srcX0, /* width */