OSDN Git Service

i965: Separate miptree creation from auxiliary buffer setup
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Sat, 5 Dec 2015 09:30:39 +0000 (11:30 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 12 Feb 2016 07:13:07 +0000 (09:13 +0200)
commit422b1386d7680f626211a1374075ae74a6ff3e2d
tree1055edd5e005b7fd187a55be0e454f2291f4d633
parentd089f2d9328582fa05e692b5957dc7dfe05c80be
i965: Separate miptree creation from auxiliary buffer setup

Currently the logic allocating and setting up miptrees is closely
combined with decision making when to re-allocate buffers in
X-tiled layout and when to associate colors with auxiliary buffers.

These auxiliary buffers are in turn also represented as miptrees
and are created by the same miptree creation logic calling itself
recursively. This means considering in vain if the auxiliary buffers
should be represented in X-tiled layout or if they should be
associated with auxiliary buffers again.
While this is somewhat unnecessary, this doesn't impose any problems
currently. Miptrees for auxiliary buffers are created as simgle-sampled
fusing the consideration for multi-sampled compression auxiliary
buffers. The format in turn is such that is not applicable for
single-sampled fast clears (that would require accompaning auxiliary
buffer).
But once the driver starts to support lossless compression of color
buffers the auxiliary buffer will have a format that would itself
be applicable for lossless compression. This would be rather
difficult and ugly to detect in the current miptree creation logic,
and therefore this patch seeks to separate the association logic
from the general allocation and setup steps.

v2 (Ben):
   - Do not reconsider for X-tiling in intel_miptree_create()
     as it was just forced to Y-tiling in miptree_create().
   - Do not drop checks for allocation failures.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c