[Mesa-dev] [PATCH] mesa: Define helper function to get the number of texture layers.

Francisco Jerez currojerez at riseup.net
Tue Dec 10 08:42:04 PST 2013


Brian Paul <brianp at vmware.com> writes:

> On 12/07/2013 06:17 PM, Francisco Jerez wrote:
>>[...]
>> +   default:
>> +      unreachable();
>
> I think I'd like to see an assertion or _mesa_problem() call to catch 
> unhandled cases if new texture targets are added in the future.
>
>
How about having the unreachable() macro print out an error and abort if
it's ever reached?  See the attached patch.

>> +   }
>> +}
>> +
>> +
>> +/**
>> + * Return the number of layers present in the given level of an array,
>> + * cubemap or 3D texture.  If the texture is not layered return zero.
>> + */
>> +GLuint
>> +_mesa_get_texture_layers(struct gl_texture_object *texObj, GLint level)
>
> The pointer could be const-qualifed and level could be GLuint.
>

I made level a signed integer deriberately, because texture levels seem
to be declared as GLint everywhere else.

Thanks.

>[...]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mesa-Make-the-unreachable-macro-abort-when-reached-i.patch
Type: text/x-diff
Size: 1659 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131210/612b4a58/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131210/612b4a58/attachment.pgp>


More information about the mesa-dev mailing list