Mesa (gallium-array-textures): gallium: separate depth0 and array_size in the resource itself.

Roland Scheidegger sroland at kemper.freedesktop.org
Wed Jun 16 11:42:38 PDT 2010


Module: Mesa
Branch: gallium-array-textures
Commit: dcae4f586f0d0885b72674a355e5d56d47afe77d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dcae4f586f0d0885b72674a355e5d56d47afe77d

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Wed Jun 16 19:42:05 2010 +0100

gallium: separate depth0 and array_size in the resource itself.

These fields are still mutually exclusive (since no 3d array textures exist)
but it ultimately seemed to error-prone to adapt all code accept the new
meaning of depth0 (drivers stick that into hardware regs, calculate mipmap
sizes etc.). And it isn't really cleaner anyway.
So, array textures will have depth0 of 1, but instead use array_size,
3D textures will continue to use depth0 (and have array_size of 1). Cube
maps also will use array_size to indicate their 6 faces, but since all drivers
should just be fine by inferring this themselves from the fact it's a cube map
as they always used to nothing should break.

---

 src/gallium/include/pipe/p_state.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 5123948..aa82113 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -356,6 +356,7 @@ struct pipe_resource
    unsigned width0;
    unsigned height0;
    unsigned depth0;
+   unsigned array_size;
 
    unsigned last_level:8;    /**< Index of last mipmap level present/defined */
    unsigned nr_samples:8;    /**< for multisampled surfaces, nr of samples */



More information about the mesa-commit mailing list