llvmpipe: integrate memory allocation into llvmpipe_texture_layout
authorRoland Scheidegger <sroland@vmware.com>
Fri, 1 Aug 2014 01:08:11 +0000 (03:08 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 1 Aug 2014 21:31:11 +0000 (23:31 +0200)
commit7e7aebbbd0a811f4406fb41b13e6f7050d5a13f4
tree5cdf3aefcbc6b62092b37ccbf674d7551503b360
parent47096fbb5d1c0ba57df642c67b34754e649778c3
llvmpipe: integrate memory allocation into llvmpipe_texture_layout

Seems pointless to just duplicate some of the calculations (the calculation
of actual memory used compared to what was predicted in llvmpipe_texture_layout
actually could have differed slightly in some cases due to different alignment
rules used though this should have been of no consequence).

v2: keep the previous mip alignment of MAX2(64, cacheline). This was added for
ARB_map_buffer_alignment - I'm not convinced it's needed for textures, but
it was supposed to be cleanup without functional change. Also replace div
with 64bit mul / comparison.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/llvmpipe/lp_texture.c