[Mesa-dev] [PATCH 4/5] texstore: Add a generic implementation of GL_ARB_clear_texture

Neil Roberts neil at linux.intel.com
Tue Jul 1 11:06:08 PDT 2014


Jason Ekstrand <jason at jlekstrand.net> writes:

>> +static void
>> +clear_image_to_zero(GLubyte *dstMap, GLint dstRowStride,
>> +                    GLsizei width, GLsizei height,
>> +                    GLsizei clearValueSize)
>> +{
>> +   while (height-- > 0) {
>> +      memset(dstMap, 0, clearValueSize * width);
>> +      dstMap += dstRowStride;
>> +   }
>> +}
>>
>
> Technically, this should always work, but you might want to throw in a
> comment about floating-point textures.

I'm not sure what you mean here. Are you saying that hypothetically
floating-point textures might not represent 0 as zero bytes?

> Other than that, looks good to me. (I'll second Ilia's MS comment
> though.)

Does that count as ‘reviewed-by’? (Yes, in the github branch I've made
the two changes that Ilia suggested.)

Thanks for the review.

- Neil


More information about the mesa-dev mailing list