[Mesa-dev] [PATCH 07/13] mesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack code
Brian Paul
brianp at vmware.com
Mon Feb 13 08:46:40 PST 2012
On 02/13/2012 09:44 AM, Jose Fonseca wrote:
>
>
> ----- Original Message -----
>> Added in _mesa_pack_uint_24_8_depth_stencil_row(). This could be hit
>> by something like glDrawPixels(GL_DEPTH_STENCIL,
>> GL_UNSIGNED_INT_24_8)
>> into a MESA_FORMAT_Z32_FLOAT_X24S8 buffer.
>> ---
>> src/mesa/main/format_pack.c | 13 +++++++++++++
>> 1 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/mesa/main/format_pack.c
>> b/src/mesa/main/format_pack.c
>> index ea1d95e..e20e361 100644
>> --- a/src/mesa/main/format_pack.c
>> +++ b/src/mesa/main/format_pack.c
>> @@ -2530,6 +2530,19 @@
>> _mesa_pack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
>> }
>> }
>> break;
>> + case MESA_FORMAT_Z32_FLOAT_X24S8:
>> + {
>> + const GLdouble scale = 1.0 / (GLdouble) 0xffffff;
>> + GLuint *destu = (GLuint *) dst;
>> + GLfloat *destf = (GLfloat *) dst;
>
> This is fine, but if there's a lot of similar code for MESA_FORMAT_Z32_FLOAT_X24S8, then a
>
> struct z32f_x24s8 {
> float z;
> unsigned s;
> };
>
> would make the code easier to read.
Yeah, I see that a similar struct is already used in
pack_uint_z_Z32_FLOAT_X24S8().
I'll fix this in a follow-on patch. Thanks.
-Brian
More information about the mesa-dev
mailing list