summaryrefslogtreecommitdiffstats
path: root/src/gallium/tests
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-10-07 11:58:16 -0400
committerRob Clark <robdclark@gmail.com>2016-10-07 15:50:46 -0400
commit495ba8884ad5047abc7e408b68165c0465a81ac0 (patch)
tree0d9328470726c425d5697553b395d06fc4deb085 /src/gallium/tests
parent3ebfc44b4231cfa131e17076b10140fcd70ccd8c (diff)
downloadexternal_mesa3d-495ba8884ad5047abc7e408b68165c0465a81ac0.zip
external_mesa3d-495ba8884ad5047abc7e408b68165c0465a81ac0.tar.gz
external_mesa3d-495ba8884ad5047abc7e408b68165c0465a81ac0.tar.bz2
gallium: add missing zero-init for resource templates
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>
Diffstat (limited to 'src/gallium/tests')
-rw-r--r--src/gallium/tests/graw/clear.c1
-rw-r--r--src/gallium/tests/graw/fs-test.c2
-rw-r--r--src/gallium/tests/graw/graw_util.h2
-rw-r--r--src/gallium/tests/graw/gs-test.c3
-rw-r--r--src/gallium/tests/graw/quad-sample.c2
-rw-r--r--src/gallium/tests/graw/shader-leak.c1
-rw-r--r--src/gallium/tests/graw/tri-gs.c1
-rw-r--r--src/gallium/tests/graw/tri-instanced.c1
-rw-r--r--src/gallium/tests/graw/vs-test.c3
9 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c
index 533ce9f..45b0cc0 100644
--- a/src/gallium/tests/graw/clear.c
+++ b/src/gallium/tests/graw/clear.c
@@ -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;
diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c
index b237692..e2e7ac8 100644
--- a/src/gallium/tests/graw/fs-test.c
+++ b/src/gallium/tests/graw/fs-test.c
@@ -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;
diff --git a/src/gallium/tests/graw/graw_util.h b/src/gallium/tests/graw/graw_util.h
index f603385..36064e1 100644
--- a/src/gallium/tests/graw/graw_util.h
+++ b/src/gallium/tests/graw/graw_util.h
@@ -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;
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index 00fb591..46042c6 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -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;
diff --git a/src/gallium/tests/graw/quad-sample.c b/src/gallium/tests/graw/quad-sample.c
index d1bee35..03f51fc 100644
--- a/src/gallium/tests/graw/quad-sample.c
+++ b/src/gallium/tests/graw/quad-sample.c
@@ -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;
diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c
index a4502af..dddb69c 100644
--- a/src/gallium/tests/graw/shader-leak.c
+++ b/src/gallium/tests/graw/shader-leak.c
@@ -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;
diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c
index 6aad51c..6d9e41d 100644
--- a/src/gallium/tests/graw/tri-gs.c
+++ b/src/gallium/tests/graw/tri-gs.c
@@ -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;
diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c
index 2065c11..b1fa21d 100644
--- a/src/gallium/tests/graw/tri-instanced.c
+++ b/src/gallium/tests/graw/tri-instanced.c
@@ -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;
diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c
index 48f06f4..14e63cd 100644
--- a/src/gallium/tests/graw/vs-test.c
+++ b/src/gallium/tests/graw/vs-test.c
@@ -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;