gallium: add missing zero-init for resource templates
authorRob Clark <robdclark@gmail.com>
Fri, 7 Oct 2016 15:58:16 +0000 (11:58 -0400)
committerRob Clark <robdclark@gmail.com>
Fri, 7 Oct 2016 19:50:46 +0000 (15:50 -0400)
Mostly test code, plus one spot I noticed in r600.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_texture.c
src/gallium/tests/graw/clear.c
src/gallium/tests/graw/fs-test.c
src/gallium/tests/graw/graw_util.h
src/gallium/tests/graw/gs-test.c
src/gallium/tests/graw/quad-sample.c
src/gallium/tests/graw/shader-leak.c
src/gallium/tests/graw/tri-gs.c
src/gallium/tests/graw/tri-instanced.c
src/gallium/tests/graw/vs-test.c

index 6ad5f85ee0cdf514aeb909ee7dca1ebc07a9a56d..57cdbcf615d9cfeb0660e21ce03bac3a1305ee97 100644 (file)
@@ -1361,6 +1361,7 @@ bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
                }
        }
 
+       memset(&resource, 0, sizeof(resource));
        resource.target = texture->target;
        resource.format = pipe_format;
        resource.width0 = texture->width0;
index 533ce9f58d07082889283d8f259b4d663a271942..45b0cc069bdd86e34b7412b6e5133c89a2ac5a64 100644 (file)
@@ -65,6 +65,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;
index b23769259ec980d3c9721e56d2e0bff4e4092e54..e2e7ac80a4baaa0523f590984befc8df558f791d 100644 (file)
@@ -293,6 +293,7 @@ static void init_tex( void )
    tex2d[1][1][3] = 255;
 #endif
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = PIPE_FORMAT_B8G8R8A8_UNORM;
    templat.width0 = SIZE;
@@ -402,6 +403,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;
index f6033855aa065a9bc1b2d60c767e7d3a21f0965e..36064e18a2597bb8591be3d5aa85408466e77098 100644 (file)
@@ -43,6 +43,7 @@ graw_util_create_window(struct graw_info *info,
    int i;
 
    memset(info, 0, sizeof(*info));
+   memset(&resource_temp, 0, sizeof(resource_temp));
 
    /* It's hard to say whether window or screen should be created
     * first.  Different environments would prefer one or the other.
@@ -224,6 +225,7 @@ graw_util_create_tex2d(const struct graw_info *info,
    struct pipe_resource temp, *tex;
    struct pipe_box box;
 
+   memset(&temp, 0, sizeof(temp));
    temp.target = PIPE_TEXTURE_2D;
    temp.format = format;
    temp.width0 = width;
index 00fb59161a8a2c60fcf5fb4b3423961b45ebfef2..46042c68a26445630a4faa0776d490cac3c39076 100644 (file)
@@ -150,6 +150,7 @@ static void init_fs_constbuf( void )
 {
    struct pipe_resource templat;
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_BUFFER;
    templat.format = PIPE_FORMAT_R8_UNORM;
    templat.width0 = sizeof(constants1);
@@ -383,6 +384,7 @@ static void init_tex( void )
    tex2d[1][1][3] = 255;
 #endif
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = PIPE_FORMAT_B8G8R8A8_UNORM;
    templat.width0 = SIZE;
@@ -492,6 +494,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;
index d1bee359261e077fd29bba937a66c0560a18d9f6..03f51fc955431dfa650279eb9d88e81edfa06193 100644 (file)
@@ -209,6 +209,7 @@ static void init_tex( void )
    tex2d[1][1][3] = 255;
 #endif
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = PIPE_FORMAT_B8G8R8A8_UNORM;
    templat.width0 = SIZE;
@@ -317,6 +318,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;
index a4502afff6497bb67d60233d0a80f375e64497de..dddb69c794675dbb3486de2dd23b410c984a4448 100644 (file)
@@ -192,6 +192,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;
index 6aad51c94a0b7d9a52fecd76d152c6862047f609..6d9e41ddb3a5b157f38b0ebaa59191607f71c455 100644 (file)
@@ -199,6 +199,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;
index 2065c11f68de7155e7c8d5dacd94d6945987f7f1..b1fa21dc3f4376c11d1a9f7c85f3eb1c39f12bbb 100644 (file)
@@ -250,6 +250,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;
index 48f06f461d873e945e75702bcfcc4f60ce90133e..14e63cdef52a1ddf584a24af094d2576da363001 100644 (file)
@@ -82,6 +82,7 @@ static void init_fs_constbuf( void )
    struct pipe_resource templat;
    struct pipe_box box;
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_BUFFER;
    templat.format = PIPE_FORMAT_R8_UNORM;
    templat.width0 = sizeof(constants);
@@ -281,6 +282,7 @@ static void init_tex( void )
    tex2d[1][1][3] = 255;
 #endif
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = PIPE_FORMAT_B8G8R8A8_UNORM;
    templat.width0 = SIZE;
@@ -390,6 +392,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;