summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2015-08-12 16:39:05 -0700
committerAnuj Phogat <[email protected]>2015-10-20 13:26:25 -0700
commit06ec19bca4a8d9c714769c658aeb401697ab6bba (patch)
tree546926837242eca2d2e8eb3394d79b0263048b9a
parent8f8c450bc7c1652b8c76f7e716273f0f784d30c0 (diff)
i965/gen9: Remove temporary variable 'align_yf' in tr_mode_..._texture_alignment()
Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex_layout.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index f1aeae9d12a..c7e35410210 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -42,7 +42,6 @@
static unsigned int
tr_mode_horizontal_texture_alignment(const struct intel_mipmap_tree *mt)
{
- const unsigned *align_yf;
const unsigned bpp = _mesa_get_format_bytes(mt->format) * 8;
unsigned ret_align, divisor, multiplier_ys;
@@ -61,11 +60,13 @@ tr_mode_horizontal_texture_alignment(const struct intel_mipmap_tree *mt)
/* Alignment computations below assume bpp >= 8 and a power of 2. */
assert (bpp >= 8 && bpp <= 128 && _mesa_is_pow_two(bpp));
+ /* Compute array index. */
+ i = ffs(bpp/8) - 1;
switch(mt->target) {
case GL_TEXTURE_1D:
case GL_TEXTURE_1D_ARRAY:
- align_yf = align_1d_yf;
+ ret_align = align_1d_yf[i];
multiplier_ys = 16;
break;
case GL_TEXTURE_2D:
@@ -75,22 +76,17 @@ tr_mode_horizontal_texture_alignment(const struct intel_mipmap_tree *mt)
case GL_TEXTURE_CUBE_MAP_ARRAY:
case GL_TEXTURE_2D_MULTISAMPLE:
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
- align_yf = align_2d_yf;
+ ret_align = align_2d_yf[i];
multiplier_ys = 4;
break;
case GL_TEXTURE_3D:
- align_yf = align_3d_yf;
+ ret_align = align_3d_yf[i];
multiplier_ys = 4;
break;
default:
unreachable("not reached");
}
- /* Compute array index. */
- i = ffs(bpp/8) - 1;
-
- ret_align = align_yf[i];
-
if (mt->tr_mode == INTEL_MIPTREE_TRMODE_YS)
ret_align *= multiplier_ys;
@@ -149,7 +145,6 @@ intel_horizontal_texture_alignment_unit(struct brw_context *brw,
static unsigned int
tr_mode_vertical_texture_alignment(const struct intel_mipmap_tree *mt)
{
- const unsigned *align_yf;
const unsigned bpp = _mesa_get_format_bytes(mt->format) * 8;
unsigned ret_align, divisor, multiplier_ys;
@@ -162,6 +157,8 @@ tr_mode_vertical_texture_alignment(const struct intel_mipmap_tree *mt)
/* Alignment computations below assume bpp >= 8 and a power of 2. */
assert (bpp >= 8 && bpp <= 128 && _mesa_is_pow_two(bpp)) ;
+ /* Compute array index. */
+ i = ffs(bpp / 8) - 1;
switch(mt->target) {
case GL_TEXTURE_2D:
@@ -171,11 +168,11 @@ tr_mode_vertical_texture_alignment(const struct intel_mipmap_tree *mt)
case GL_TEXTURE_CUBE_MAP_ARRAY:
case GL_TEXTURE_2D_MULTISAMPLE:
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
- align_yf = align_2d_yf;
+ ret_align = align_2d_yf[i];
multiplier_ys = 4;
break;
case GL_TEXTURE_3D:
- align_yf = align_3d_yf;
+ ret_align = align_3d_yf[i];
multiplier_ys = 2;
break;
case GL_TEXTURE_1D:
@@ -184,11 +181,6 @@ tr_mode_vertical_texture_alignment(const struct intel_mipmap_tree *mt)
unreachable("Unexpected miptree target");
}
- /* Compute array index. */
- i = ffs(bpp / 8) - 1;
-
- ret_align = align_yf[i];
-
if (mt->tr_mode == INTEL_MIPTREE_TRMODE_YS)
ret_align *= multiplier_ys;