[Mesa-dev] [PATCH] intel: Kill intel_mipmap_level::nr_images

Chad Versace chad at chad-versace.us
Mon Oct 24 11:27:44 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/24/2011 10:12 AM, Roland Scheidegger wrote:
> Am 23.10.2011 02:25, schrieb Kenneth Graunke:
>> On 10/21/2011 08:45 PM, Chad Versace wrote:
>>> For all texture targets except GL_TEXTURE_CUBE_MAP, the 'nr_images' and
>>> 'depth' fields of intel_mipmap_level were identical.  In the exceptional
>>> case, nr_images == 6 and depth == 1.
>>>
>>> It is simple to determine if a texture is a cube or not, so the presence
>>> of two fields here was not helpful. Worse, it was confusing.
>>>
>>> This patch removes 'nr_images' and assigns to 'depth' a consistent
>>> meaning: depth is the number of two-dimensional slices at each miplevel.
>>> The exact semantics of depth varies according to the texture target:
>>>    - For GL_TEXTURE_CUBE_MAP, depth is 6.
>>>    - For GL_TEXTURE_2D_ARRAY, depth is the number of array slices. It is
>>>      identical for all miplevels in the texture.
>>>    - For GL_TEXTURE_3D, it is the texture's depth at each miplevel. It's
>>>      value, like width and height, varies with miplevel.
>>>    - For other texture types, depth is 1.
>>
>> I'm not sure I like this.  What about Cube Arrays?
>> http://www.opengl.org/registry/specs/ARB/texture_cube_map_array.txt
>>
>> Admittedly it's not core until 4.0 (AFAICT), but there's nothing
>> preventing us from doing it earlier...
> 
> Not really commenting on the patch itself, but what's the problem with
> cube map arrays? You simply would have a depth which is
> 6*nr_array_slices (and can figure out an individual face likewise).
> The only thing which wouldn't work is 3d arrays, but I've not yet seen
> that anywhere...
> 
> Roland

Roland, I concur. Eliminating intel_mipmap_level::nr_images, and using just ::depth,
actually more closely matches how the ARB_texture_cube_map_array API works. When
calling glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY_ARB), one no longer specifies the
face, but only the depth. In other words, this refactor does not hinder us in
implementing the extension.

    The command

      void TexImage3D( enum target, int level, int internalformat,
                       sizei width, sizei height, sizei depth, int border,
                       enum format, enum type, void *data );

    is used to specify a three-dimensional texture image. <target> must
    be one of TEXTURE_3D for a three-dimensional texture or
    TEXTURE_2D_ARRAY for an two-dimensional array texture or
    TEXTURE_CUBE_MAP_ARRAY_ARB. [...]
    If target is TEXTURE_CUBE_MAP_ARRAY_ARB or
    PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB, specifying a depth value that is
    not a multiple of six results in an error of INVALID_VALUE.
    INVALID_VALUE is also generated if the width and the height
    parameters are not equal. ...

- -- 
Chad Versace
chad at chad-versace.us
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOpa4eAAoJEAIvNt057x8iOEEP/1MEOkHgyTtOlsV40qvHVtxc
mWyftYXTD7WW2m16+vZrWrRmVPbKkwq84REow/cdE+3mw8ewPbsqjs3NLoZH1/nR
fD1giM2eez34x14wgtI9WMscoXFAPAnJzROGjazzs53VTF+HvPd/h89QaYBL3QPA
78BnEcQd537Dno+9WaypkU5MsBkuQ0D45ixOoRvhMTpS2Y9xP5mmHMpokMsUz6Xf
wyrRxQiOtHsNkhANvSDCK6iN5JsGDZYHMZu5wuH4lwfAFmKjEhI/hLcJiAYJdcxh
6HmDf8Tf99IRX84i2sBnAL+jVqisBp6Z4JiSGU+lQnCVRqfZQg5D5D0z2s9A4QBW
LCRBlTSH7de6FHIhtCjzqDqseC3/ST5CZqLfuTyq1K9IqKuPhYnSnin203dOjjg9
a8MGPaAJF3IGNwE2rV8W0bwRNhn8/cEomNRV5htXLzFmCEN5QZMmSdCyRzcD/au6
Tb0S+Ydm8/fWPMpJZWLBj4UcHYDAXnMTCWE4kYbaHL8JadbtsaIipRYD4YuUF4hU
Z6cn1qtMMphQs3qpkRXqJKc9ctiF6MINQk2ia+DzMLB3kODcq8MoZUA0LWrJQ2lR
NcwuKRbM4qIiWcHhdKQffS+wS9QUMyUTEbQHyCQO9YNPpZJbmhdtWzLmhvx7/lpe
d5R1ymBkPX90PVVXFyF9
=3x/I
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list