struct intel_context *intel = intel_context(ctx);
struct intel_mipmap_tree *old_mt = intel_image->mt;
struct intel_mipmap_tree *new_mt;
- int comp_byte = 0, texel_bytes;
-
- if (_mesa_is_format_compressed(intel_image->base.TexFormat))
- comp_byte = intel_compressed_num_bytes(intel_image->base.TexFormat);
+ int texel_bytes;
texel_bytes = _mesa_get_format_bytes(intel_image->base.TexFormat);
intel_image->base.Width,
intel_image->base.Height,
intel_image->base.Depth,
- texel_bytes, comp_byte, GL_TRUE);
+ texel_bytes, GL_TRUE);
intel_miptree_image_copy(intel,
new_mt,
#include "intel_mipmap_tree.h"
#include "intel_regions.h"
#include "intel_tex_layout.h"
+#include "intel_tex.h"
#include "main/enums.h"
#include "main/formats.h"
GLuint last_level,
GLuint width0,
GLuint height0,
- GLuint depth0, GLuint cpp, GLuint compress_byte,
+ GLuint depth0, GLuint cpp,
uint32_t tiling)
{
GLboolean ok;
struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
+ int compress_byte = 0;
DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(target),
_mesa_get_format_name(format),
first_level, last_level, mt);
+ if (_mesa_is_format_compressed(format))
+ compress_byte = intel_compressed_num_bytes(format);
+
mt->target = target_to_target(target);
mt->format = format;
mt->first_level = first_level;
GLuint last_level,
GLuint width0,
GLuint height0,
- GLuint depth0, GLuint cpp, GLuint compress_byte,
+ GLuint depth0, GLuint cpp,
GLboolean expect_accelerated_upload)
{
struct intel_mipmap_tree *mt;
uint32_t tiling = I915_TILING_NONE;
GLenum base_format = _mesa_get_format_base_format(format);
- if (intel->use_texture_tiling && compress_byte == 0) {
+ if (intel->use_texture_tiling && !_mesa_is_format_compressed(format)) {
if (intel->gen >= 4 &&
(base_format == GL_DEPTH_COMPONENT ||
base_format == GL_DEPTH_STENCIL_EXT))
mt = intel_miptree_create_internal(intel, target, format,
first_level, last_level, width0,
- height0, depth0, cpp, compress_byte,
+ height0, depth0, cpp,
tiling);
/*
* pitch == 0 || height == 0 indicates the null texture
GLenum target,
gl_format format,
struct intel_region *region,
- GLuint depth0,
- GLuint compress_byte)
+ GLuint depth0)
{
struct intel_mipmap_tree *mt;
mt = intel_miptree_create_internal(intel, target, format,
0, 0,
region->width, region->height, 1,
- region->cpp, compress_byte,
+ region->cpp,
I915_TILING_NONE);
if (!mt)
return mt;
GLuint width = intelImage->base.Width;
GLuint height = intelImage->base.Height;
GLuint depth = intelImage->base.Depth;
- GLuint i, comp_byte = 0;
+ GLuint i;
GLuint texelBytes;
DBG("%s\n", __FUNCTION__);
}
}
- if (_mesa_is_format_compressed(intelImage->base.TexFormat))
- comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat);
-
texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat);
return intel_miptree_create(intel,
height,
depth,
texelBytes,
- comp_byte,
expect_accelerated_upload);
}
}
mt = intel_miptree_create_for_region(intel, target, texFormat,
- rb->region, 1, 0);
+ rb->region, 1);
if (mt == NULL)
return;
return;
mt = intel_miptree_create_for_region(intel, target, image->format,
- image->region, 1, 0);
+ image->region, 1);
if (mt == NULL)
return;