[Mesa-dev] [PATCH 03/17] swrast: Factor out texture slice counting.

Eric Anholt eric at anholt.net
Mon Apr 22 11:53:08 PDT 2013


Patrick Baggett <baggett.patrick at gmail.com> writes:

> On Mon, Apr 22, 2013 at 11:14 AM, Eric Anholt <eric at anholt.net> wrote:
>
>> This function going to get used a lot more in upcoming patches.
>> ---
>>  src/mesa/swrast/s_texture.c |   16 ++++++++++++----
>>  1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
>> index 51048be..36a90dd 100644
>> --- a/src/mesa/swrast/s_texture.c
>> +++ b/src/mesa/swrast/s_texture.c
>> @@ -58,6 +58,14 @@ _swrast_delete_texture_image(struct gl_context *ctx,
>>     _mesa_delete_texture_image(ctx, texImage);
>>  }
>>
>> +static unsigned int
>> +texture_slices(struct gl_texture_image *texImage)
>> +{
>> +   if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY)
>> +      return texImage->Height;
>> +   else
>> +      return texImage->Depth;
>> +}
>>
>>
> I think you can const-qualify 'texImage'.

Given that const-qualification does nothing for generated code and just
consumes developer time, I don't do it unless someone blocks review on
it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130422/4647e07d/attachment.pgp>


More information about the mesa-dev mailing list