}
else
region = intel_region_alloc_for_handle(intel, buffers[i].cpp,
- buffers[i].pitch / buffers[i].cpp,
+ drawable->w,
drawable->h,
+ buffers[i].pitch / buffers[i].cpp,
buffers[i].name,
region_name);
DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width,
height, pitch);
- irb->region = intel_region_alloc(intel, cpp, pitch, height);
+ irb->region = intel_region_alloc(intel, cpp, width, height, pitch);
if (!irb->region)
return GL_FALSE; /* out of memory? */
return NULL;
mt->region = intel_region_alloc(intel,
- mt->cpp, mt->pitch, mt->total_height);
+ mt->cpp,
+ mt->pitch,
+ mt->total_height,
+ mt->pitch);
if (!mt->region) {
free(mt);
mt = intel_miptree_create_internal(intel, target, internal_format,
first_level, last_level,
- region->pitch, region->height, depth0,
+ region->width, region->height, 1,
region->cpp, compress_byte);
if (!mt)
return mt;
static struct intel_region *
intel_region_alloc_internal(struct intel_context *intel,
- GLuint cpp, GLuint pitch, GLuint height,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
dri_bo *buffer)
{
struct intel_region *region;
region = calloc(sizeof(*region), 1);
region->cpp = cpp;
+ region->width = width;
+ region->height = height;
region->pitch = pitch;
- region->height = height; /* needed? */
region->refcount = 1;
region->buffer = buffer;
struct intel_region *
intel_region_alloc(struct intel_context *intel,
- GLuint cpp, GLuint pitch, GLuint height)
+ GLuint cpp, GLuint width, GLuint height, GLuint pitch)
{
dri_bo *buffer;
buffer = dri_bo_alloc(intel->bufmgr, "region",
pitch * cpp * height, 64);
- return intel_region_alloc_internal(intel, cpp, pitch, height, buffer);
+ return intel_region_alloc_internal(intel, cpp, width, height, pitch, buffer);
}
struct intel_region *
intel_region_alloc_for_handle(struct intel_context *intel,
- GLuint cpp, GLuint pitch, GLuint height,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
GLuint handle, const char *name)
{
struct intel_region *region;
buffer = intel_bo_gem_create_from_name(intel->bufmgr, name, handle);
- region = intel_region_alloc_internal(intel, cpp, pitch, height, buffer);
+ region = intel_region_alloc_internal(intel, cpp,
+ width, height, pitch, buffer);
if (region == NULL)
return region;
dri_bo *buffer; /**< buffer manager's buffer */
GLuint refcount; /**< Reference count for region */
GLuint cpp; /**< bytes per pixel */
- GLuint pitch; /**< in pixels */
+ GLuint width; /**< in pixels */
GLuint height; /**< in pixels */
+ GLuint pitch; /**< in pixels */
GLubyte *map; /**< only non-NULL when region is actually mapped */
GLuint map_refcount; /**< Reference count for mapping */
* copied by calling intel_reference_region().
*/
struct intel_region *intel_region_alloc(struct intel_context *intel,
- GLuint cpp,
- GLuint pitch, GLuint height);
+ GLuint cpp, GLuint width,
+ GLuint height, GLuint pitch);
struct intel_region *
intel_region_alloc_for_handle(struct intel_context *intel,
- GLuint cpp, GLuint pitch, GLuint height,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
unsigned int handle, const char *name);
void intel_region_reference(struct intel_region **dst,
intelObj->mt = mt;
texImage = _mesa_get_tex_image(&intel->ctx, texObj, target, level);
_mesa_init_teximage_fields(&intel->ctx, target, texImage,
- rb->region->pitch, rb->region->height, 1,
+ rb->region->width, rb->region->height, 1,
0, internalFormat);
intelImage = intel_texture_image(texImage);