[Piglit] [PATCH] khr_texture_compression_astc: change the subtest array declaration to prevent the crash coming from Visual Studio's optimisation

Sandra Koroniewska sandra.koroniewska at gmail.com
Tue Jun 6 13:01:24 UTC 2017


This fixes
spec/khr_texture_compression_astc/khr_compressed_astc-array_gl on
Intel Windows driver.
---
 .../khr_compressed_astc-miptree-array.c            | 37 +++++++++++-----------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c
index 0cc0ec819..b15ab0b37 100644
--- a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c
+++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c
@@ -57,26 +57,27 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.window_width = 2 * level0_width;
 	config.window_height = level0_height + (level0_height >> 1);
 	config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
-	static bool is_odd[2] = {true, false};
-
-	config.subtests = (struct piglit_subtest[]) {
-		{
-			"5x5 Block Dim",
-			"odd",
-			test_miptrees,
-			&is_odd[0]
-		},
-		{
-			"12x12 Block Dim",
-			"even",
-			test_miptrees,
-			&is_odd[1]
-		},
-		{NULL},
-	};
 
 PIGLIT_GL_TEST_CONFIG_END
 
+static bool is_odd[2] = { true, false };
+
+const struct piglit_subtest subtests[] = {
+	{
+		"5x5 Block Dim",
+		"odd",
+		test_miptrees,
+		&is_odd[0]
+	},
+	{
+		"12x12 Block Dim",
+		"even",
+		test_miptrees,
+		&is_odd[1]
+	},
+	{ NULL },
+};
+
 /**
  * The \a filename is relative to the current test's source directory.
  *
@@ -293,7 +294,7 @@ piglit_init(int argc, char **argv)
 enum piglit_result
 piglit_display(void)
 {
-	return piglit_run_selected_subtests(piglit_config->subtests,
+	return piglit_run_selected_subtests(subtests,
 				      piglit_config->selected_subtests,
 				      piglit_config->num_selected_subtests,
 				      PIGLIT_SKIP);
-- 
2.11.0.windows.1



More information about the Piglit mailing list