diff options
author | Anuj Phogat <[email protected]> | 2015-08-13 11:19:47 -0700 |
---|---|---|
committer | Anuj Phogat <[email protected]> | 2015-10-20 13:26:25 -0700 |
commit | 876d07d8377bb61417ba2f443afa8b7a30b9de81 (patch) | |
tree | 51cdf1270e9bb4ad9c50806d3292896895265c51 /src/mesa/drivers/dri | |
parent | 06ec19bca4a8d9c714769c658aeb401697ab6bba (diff) |
i965/gen9: Remove temporary variable 'bpp' in tr_mode_..._texture_alignment()
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_tex_layout.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index c7e35410210..a2948293a62 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 bpp = _mesa_get_format_bytes(mt->format) * 8; unsigned ret_align, divisor, multiplier_ys; /* Values in below tables specifiy the horizontal alignment requirement @@ -54,14 +53,13 @@ tr_mode_horizontal_texture_alignment(const struct intel_mipmap_tree *mt) const unsigned align_1d_yf[] = {4096, 2048, 1024, 512, 256}; const unsigned align_2d_yf[] = {64, 64, 32, 32, 16}; const unsigned align_3d_yf[] = {16, 8, 8, 8, 4}; - int i = 0; assert(mt->tr_mode != INTEL_MIPTREE_TRMODE_NONE); - /* Alignment computations below assume bpp >= 8 and a power of 2. */ - assert (bpp >= 8 && bpp <= 128 && _mesa_is_pow_two(bpp)); + /* Alignment computations below assume a power of 2 cpp. */ + assert (mt->cpp >= 1 && mt->cpp <= 16 && _mesa_is_pow_two(mt->cpp)); /* Compute array index. */ - i = ffs(bpp/8) - 1; + const int i = ffs(mt->cpp) - 1; switch(mt->target) { case GL_TEXTURE_1D: @@ -145,20 +143,18 @@ 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 bpp = _mesa_get_format_bytes(mt->format) * 8; unsigned ret_align, divisor, multiplier_ys; /* Vertical alignment tables for TRMODE_YF */ const unsigned align_2d_yf[] = {64, 32, 32, 16, 16}; const unsigned align_3d_yf[] = {16, 16, 16, 8, 8}; - int i = 0; assert(mt->tr_mode != INTEL_MIPTREE_TRMODE_NONE); - /* Alignment computations below assume bpp >= 8 and a power of 2. */ - assert (bpp >= 8 && bpp <= 128 && _mesa_is_pow_two(bpp)) ; + /* Alignment computations below assume a power of 2 cpp. */ + assert (mt->cpp >= 1 && mt->cpp <= 16 && _mesa_is_pow_two(mt->cpp)) ; /* Compute array index. */ - i = ffs(bpp / 8) - 1; + const int i = ffs(mt->cpp) - 1; switch(mt->target) { case GL_TEXTURE_2D: |