[Mesa-dev] [PATCH] gallium/util: initialize pipe_framebuffer_state to zeros

Brian Paul brianp at vmware.com
Fri Apr 15 18:24:16 UTC 2016


According to the p_state.h file,

    unsigned samples; /**< Number of samples in a no-attachment 
framebuffer */
    unsigned layers;  /**< Number of layers  in a no-attachment 
framebuffer */

so since the fb has attachments here, I think those fields are unused.

Cc'ing Edward since he added the fields.

-Brian

On 04/15/2016 12:17 PM, Ilia Mirkin wrote:
> Should it instead properly initialize fb->samples/layers?
>
> On Fri, Apr 15, 2016 at 2:15 PM, Brian Paul <brianp at vmware.com> wrote:
>> To silence a valgrind uninitialized memory warning.
>>
>> Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D94955&d=BQIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=ENh7vzYd5uTs9OYrYJZzwyttPIjXp3MLVA2TFrK1oro&s=541R5XzwWaQCKpQN6dLJgPq8pgKtq6IX5FzUYseZGr4&e=
>> Cc: "11.1 11.2" <mesa-stable at lists.freedesktop.org>
>> ---
>>   src/gallium/auxiliary/util/u_blitter.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
>> index 3ca2c48..5b22abf 100644
>> --- a/src/gallium/auxiliary/util/u_blitter.c
>> +++ b/src/gallium/auxiliary/util/u_blitter.c
>> @@ -1525,7 +1525,7 @@ void util_blitter_blit_generic(struct blitter_context *blitter,
>>   {
>>      struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
>>      struct pipe_context *pipe = ctx->base.pipe;
>> -   struct pipe_framebuffer_state fb_state;
>> +   struct pipe_framebuffer_state fb_state = {0};
>>      enum pipe_texture_target src_target = src->texture->target;
>>      unsigned src_samples = src->texture->nr_samples;
>>      unsigned dst_samples = dst->texture->nr_samples;
>> --
>> 1.9.1
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=BQIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=ENh7vzYd5uTs9OYrYJZzwyttPIjXp3MLVA2TFrK1oro&s=i31aM952Cdj3_QIkw7aaA_ofAcvb7YY3HpUQ-dvVero&e=



More information about the mesa-dev mailing list