intel: Drop the cpp argument to intel_miptree_create().

This commit is contained in:
Eric Anholt
2011-06-09 10:23:17 -07:00
parent 6dcc398ac0
commit f94fef83db
5 changed files with 5 additions and 22 deletions

View File

@@ -633,9 +633,6 @@ intel_render_texture(struct gl_context * ctx,
struct intel_context *intel = intel_context(ctx); struct intel_context *intel = intel_context(ctx);
struct intel_mipmap_tree *old_mt = intel_image->mt; struct intel_mipmap_tree *old_mt = intel_image->mt;
struct intel_mipmap_tree *new_mt; struct intel_mipmap_tree *new_mt;
int texel_bytes;
texel_bytes = _mesa_get_format_bytes(intel_image->base.TexFormat);
new_mt = intel_miptree_create(intel, image->TexObject->Target, new_mt = intel_miptree_create(intel, image->TexObject->Target,
intel_image->base.TexFormat, intel_image->base.TexFormat,
@@ -644,7 +641,7 @@ intel_render_texture(struct gl_context * ctx,
intel_image->base.Width, intel_image->base.Width,
intel_image->base.Height, intel_image->base.Height,
intel_image->base.Depth, intel_image->base.Depth,
texel_bytes, GL_TRUE); GL_TRUE);
intel_miptree_image_copy(intel, intel_miptree_image_copy(intel,
new_mt, new_mt,

View File

@@ -61,7 +61,7 @@ intel_miptree_create_internal(struct intel_context *intel,
GLuint last_level, GLuint last_level,
GLuint width0, GLuint width0,
GLuint height0, GLuint height0,
GLuint depth0, GLuint cpp, GLuint depth0,
uint32_t tiling) uint32_t tiling)
{ {
GLboolean ok; GLboolean ok;
@@ -83,7 +83,7 @@ intel_miptree_create_internal(struct intel_context *intel,
mt->width0 = width0; mt->width0 = width0;
mt->height0 = height0; mt->height0 = height0;
mt->depth0 = depth0; mt->depth0 = depth0;
mt->cpp = compress_byte ? compress_byte : cpp; mt->cpp = compress_byte ? compress_byte : _mesa_get_format_bytes(mt->format);
mt->compressed = compress_byte ? 1 : 0; mt->compressed = compress_byte ? 1 : 0;
mt->refcount = 1; mt->refcount = 1;
@@ -114,7 +114,7 @@ intel_miptree_create(struct intel_context *intel,
GLuint last_level, GLuint last_level,
GLuint width0, GLuint width0,
GLuint height0, GLuint height0,
GLuint depth0, GLuint cpp, GLuint depth0,
GLboolean expect_accelerated_upload) GLboolean expect_accelerated_upload)
{ {
struct intel_mipmap_tree *mt; struct intel_mipmap_tree *mt;
@@ -132,7 +132,7 @@ intel_miptree_create(struct intel_context *intel,
mt = intel_miptree_create_internal(intel, target, format, mt = intel_miptree_create_internal(intel, target, format,
first_level, last_level, width0, first_level, last_level, width0,
height0, depth0, cpp, height0, depth0,
tiling); tiling);
/* /*
* pitch == 0 || height == 0 indicates the null texture * pitch == 0 || height == 0 indicates the null texture
@@ -170,7 +170,6 @@ intel_miptree_create_for_region(struct intel_context *intel,
mt = intel_miptree_create_internal(intel, target, format, mt = intel_miptree_create_internal(intel, target, format,
0, 0, 0, 0,
region->width, region->height, 1, region->width, region->height, 1,
region->cpp,
I915_TILING_NONE); I915_TILING_NONE);
if (!mt) if (!mt)
return mt; return mt;

View File

@@ -142,7 +142,6 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
GLuint width0, GLuint width0,
GLuint height0, GLuint height0,
GLuint depth0, GLuint depth0,
GLuint cpp,
GLboolean expect_accelerated_upload); GLboolean expect_accelerated_upload);
struct intel_mipmap_tree * struct intel_mipmap_tree *

View File

@@ -55,7 +55,6 @@ intel_miptree_create_for_teximage(struct intel_context *intel,
GLuint height = intelImage->base.Height; GLuint height = intelImage->base.Height;
GLuint depth = intelImage->base.Depth; GLuint depth = intelImage->base.Depth;
GLuint i; GLuint i;
GLuint texelBytes;
DBG("%s\n", __FUNCTION__); DBG("%s\n", __FUNCTION__);
@@ -108,8 +107,6 @@ intel_miptree_create_for_teximage(struct intel_context *intel,
} }
} }
texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat);
return intel_miptree_create(intel, return intel_miptree_create(intel,
intelObj->base.Target, intelObj->base.Target,
intelImage->base.TexFormat, intelImage->base.TexFormat,
@@ -118,7 +115,6 @@ intel_miptree_create_for_teximage(struct intel_context *intel,
width, width,
height, height,
depth, depth,
texelBytes,
expect_accelerated_upload); expect_accelerated_upload);
} }

View File

@@ -77,7 +77,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current; struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current;
struct intel_texture_object *intelObj = intel_texture_object(tObj); struct intel_texture_object *intelObj = intel_texture_object(tObj);
struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit); struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
int cpp;
GLuint face, i; GLuint face, i;
GLuint nr_faces = 0; GLuint nr_faces = 0;
struct intel_texture_image *firstImage; struct intel_texture_image *firstImage;
@@ -100,12 +99,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
return GL_FALSE; return GL_FALSE;
} }
if (_mesa_is_format_compressed(firstImage->base.TexFormat)) {
cpp = intel_compressed_num_bytes(firstImage->base.TexFormat);
}
else
cpp = _mesa_get_format_bytes(firstImage->base.TexFormat);
/* Check tree can hold all active levels. Check tree matches /* Check tree can hold all active levels. Check tree matches
* target, imageFormat, etc. * target, imageFormat, etc.
* *
@@ -137,7 +130,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
firstImage->base.Width, firstImage->base.Width,
firstImage->base.Height, firstImage->base.Height,
firstImage->base.Depth, firstImage->base.Depth,
cpp,
GL_TRUE); GL_TRUE);
if (!intelObj->mt) if (!intelObj->mt)
return GL_FALSE; return GL_FALSE;