mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
i965: fix whitespace in brw_tex_layout.c
The broken indentation was driving me crazy, so fix other stuff while I'm here.
This commit is contained in:
parent
3a521d84ec
commit
bd0861e274
1 changed files with 30 additions and 31 deletions
|
|
@ -28,7 +28,6 @@
|
|||
* Authors:
|
||||
* Keith Whitwell <keith@tungstengraphics.com>
|
||||
*/
|
||||
|
||||
|
||||
/* Code to layout images in a mipmap tree for i965.
|
||||
*/
|
||||
|
|
@ -40,14 +39,14 @@
|
|||
|
||||
#define FILE_DEBUG_FLAG DEBUG_MIPTREE
|
||||
|
||||
GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_tree *mt )
|
||||
GLboolean brw_miptree_layout(struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt)
|
||||
{
|
||||
/* XXX: these vary depending on image format:
|
||||
*/
|
||||
/* GLint align_w = 4; */
|
||||
/* XXX: these vary depending on image format: */
|
||||
/* GLint align_w = 4; */
|
||||
|
||||
switch (mt->target) {
|
||||
case GL_TEXTURE_CUBE_MAP:
|
||||
case GL_TEXTURE_CUBE_MAP:
|
||||
case GL_TEXTURE_3D: {
|
||||
GLuint width = mt->width0;
|
||||
GLuint height = mt->height0;
|
||||
|
|
@ -59,7 +58,7 @@ GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_t
|
|||
GLuint align_w = 4;
|
||||
|
||||
mt->total_height = 0;
|
||||
|
||||
|
||||
if (mt->compressed) {
|
||||
align_w = intel_compressed_alignment(mt->internal_format);
|
||||
mt->pitch = ALIGN(width, align_w);
|
||||
|
|
@ -72,12 +71,12 @@ GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_t
|
|||
pack_x_pitch = mt->pitch;
|
||||
pack_x_nr = 1;
|
||||
|
||||
for ( level = mt->first_level ; level <= mt->last_level ; level++ ) {
|
||||
for (level = mt->first_level ; level <= mt->last_level ; level++) {
|
||||
GLuint nr_images = mt->target == GL_TEXTURE_3D ? depth : 6;
|
||||
GLint x = 0;
|
||||
GLint y = 0;
|
||||
GLint q, j;
|
||||
|
||||
|
||||
intel_miptree_set_level_info(mt, level, nr_images,
|
||||
0, mt->total_height,
|
||||
width, height, depth);
|
||||
|
|
@ -89,7 +88,7 @@ GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_t
|
|||
}
|
||||
|
||||
x = 0;
|
||||
y += pack_y_pitch;
|
||||
y += pack_y_pitch;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -98,25 +97,25 @@ GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_t
|
|||
height = minify(height);
|
||||
depth = minify(depth);
|
||||
|
||||
if (mt->compressed) {
|
||||
pack_y_pitch = (height + 3) / 4;
|
||||
|
||||
if (pack_x_pitch > ALIGN(width, align_w)) {
|
||||
pack_x_pitch = ALIGN(width, align_w);
|
||||
pack_x_nr <<= 1;
|
||||
}
|
||||
} else {
|
||||
if (pack_x_pitch > 4) {
|
||||
pack_x_pitch >>= 1;
|
||||
pack_x_nr <<= 1;
|
||||
assert(pack_x_pitch * pack_x_nr <= mt->pitch);
|
||||
}
|
||||
if (mt->compressed) {
|
||||
pack_y_pitch = (height + 3) / 4;
|
||||
|
||||
if (pack_y_pitch > 2) {
|
||||
pack_y_pitch >>= 1;
|
||||
pack_y_pitch = ALIGN(pack_y_pitch, align_h);
|
||||
}
|
||||
}
|
||||
if (pack_x_pitch > ALIGN(width, align_w)) {
|
||||
pack_x_pitch = ALIGN(width, align_w);
|
||||
pack_x_nr <<= 1;
|
||||
}
|
||||
} else {
|
||||
if (pack_x_pitch > 4) {
|
||||
pack_x_pitch >>= 1;
|
||||
pack_x_nr <<= 1;
|
||||
assert(pack_x_pitch * pack_x_nr <= mt->pitch);
|
||||
}
|
||||
|
||||
if (pack_y_pitch > 2) {
|
||||
pack_y_pitch >>= 1;
|
||||
pack_y_pitch = ALIGN(pack_y_pitch, align_h);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
|
@ -126,12 +125,12 @@ GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_t
|
|||
i945_miptree_layout_2d(intel, mt);
|
||||
break;
|
||||
}
|
||||
DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
|
||||
mt->pitch,
|
||||
DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
|
||||
mt->pitch,
|
||||
mt->total_height,
|
||||
mt->cpp,
|
||||
mt->pitch * mt->total_height * mt->cpp );
|
||||
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue