mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
various texture tweaks
This commit is contained in:
parent
89a2ea6fd3
commit
64bc9caa1c
3 changed files with 19 additions and 14 deletions
|
|
@ -164,10 +164,10 @@ GLboolean intel_miptree_match_image( struct intel_mipmap_tree *mt,
|
|||
image->IsCompressed != mt->compressed)
|
||||
return GL_FALSE;
|
||||
|
||||
_mesa_printf("%s: %d/%d %d/%d %d/%d\n", __FUNCTION__,
|
||||
image->Width, mt->level[level].width,
|
||||
image->Height, mt->level[level].height,
|
||||
image->Depth, mt->level[level].depth);
|
||||
DBG("%s: %d/%d %d/%d %d/%d\n", __FUNCTION__,
|
||||
image->Width, mt->level[level].width,
|
||||
image->Height, mt->level[level].height,
|
||||
image->Depth, mt->level[level].depth);
|
||||
|
||||
/* Test image dimensions against the base level image adjusted for
|
||||
* minification. This will also catch images not present in the
|
||||
|
|
@ -197,8 +197,8 @@ void intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
|
|||
mt->level[level].level_offset = (x + y * mt->pitch) * mt->cpp;
|
||||
mt->level[level].nr_images = nr_images;
|
||||
|
||||
_mesa_printf("%s level %d img size: %d,%d level_offset 0x%x\n", __FUNCTION__, level, w, h,
|
||||
mt->level[level].level_offset);
|
||||
DBG("%s level %d size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__, level, w, h, d,
|
||||
x, y, mt->level[level].level_offset);
|
||||
|
||||
/* Not sure when this would happen, but anyway:
|
||||
*/
|
||||
|
|
@ -220,13 +220,16 @@ void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
|
|||
GLuint img,
|
||||
GLuint x, GLuint y)
|
||||
{
|
||||
_mesa_printf("%s level %d img %d pos %d,%d\n", __FUNCTION__, level, img, x, y);
|
||||
|
||||
if (img == 0)
|
||||
if (img == 0 && level == 0)
|
||||
assert(x == 0 && y == 0);
|
||||
|
||||
assert(img < mt->level[level].nr_images);
|
||||
|
||||
if (img > 0)
|
||||
mt->level[level].image_offset[img] = (x + y * mt->pitch) * mt->cpp;
|
||||
mt->level[level].image_offset[img] = (x + y * mt->pitch);
|
||||
|
||||
DBG("%s level %d img %d pos %d,%d image_offset %x\n",
|
||||
__FUNCTION__, level, img, x, y,
|
||||
mt->level[level].image_offset[img]);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -255,7 +258,7 @@ GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt,
|
|||
{
|
||||
if (mt->target == GL_TEXTURE_CUBE_MAP_ARB)
|
||||
return (mt->level[level].level_offset +
|
||||
mt->level[level].image_offset[face]);
|
||||
mt->level[level].image_offset[face] * mt->cpp);
|
||||
else
|
||||
return mt->level[level].level_offset;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ intelChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
|
|||
case GL_RGBA:
|
||||
case GL_COMPRESSED_RGBA:
|
||||
if ( format == GL_BGRA ) {
|
||||
if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
|
||||
if ( type == GL_UNSIGNED_BYTE ||
|
||||
type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
|
||||
return &_mesa_texformat_argb8888;
|
||||
}
|
||||
else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
|
||||
|
|
|
|||
|
|
@ -159,7 +159,8 @@ static GLboolean check_pbo_blit( GLint internalFormat,
|
|||
case 4:
|
||||
case GL_RGBA:
|
||||
return (format == GL_BGRA &&
|
||||
type == GL_UNSIGNED_INT_8_8_8_8_REV &&
|
||||
(type == GL_UNSIGNED_BYTE ||
|
||||
type == GL_UNSIGNED_INT_8_8_8_8_REV) &&
|
||||
mesa_format == &_mesa_texformat_argb8888);
|
||||
case 3:
|
||||
case GL_RGB:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue