From 943c605ace6b849004dba7d1bbf0273064985bf2 Mon Sep 17 00:00:00 2001 From: Ben Widawsky Date: Thu, 29 Oct 2015 16:24:11 -0700 Subject: [PATCH] some debug --- .../sampling-2d-array-as-2d-layer.c | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/tests/spec/arb_texture_view/sampling-2d-array-as-2d-layer.c b/tests/spec/arb_texture_view/sampling-2d-array-as-2d-layer.c index 8189044..b11f22f 100644 --- a/tests/spec/arb_texture_view/sampling-2d-array-as-2d-layer.c +++ b/tests/spec/arb_texture_view/sampling-2d-array-as-2d-layer.c @@ -51,7 +51,8 @@ typedef struct Params { /* test a few size combinations that tend to require particular alignment requirements by the hardware */ static const Params testparams[] = { - { 8, 1, 1, "1x1" }, + { 2, 1, 1, "1x1" }, +#if 0 { 3, 2, 1, "2x1" }, { 3, 8, 1, "8x1" }, { 1, 16, 1, "16x1" }, @@ -60,6 +61,7 @@ static const Params testparams[] = { { 2, 64, 64, "64x64" }, { 4, 128, 64, "128x64" }, { 3, 35, 67, "35x67" } +#endif }; static float *makesolidimage(int w, int h, const float color[4]) @@ -136,18 +138,14 @@ piglit_display(void) { GLboolean pass = GL_TRUE; size_t n; - int layer; glViewport(0, 0, piglit_width, piglit_height); glClearColor(0.0, 0.0, 1.0, 1.0); for (n = 0; n < ARRAY_SIZE(testparams); n++) { GLboolean subtest_pass = GL_TRUE; - for (layer = 0; layer < testparams[n].num_layers; layer++) { - glClear(GL_COLOR_BUFFER_BIT); - subtest_pass &= test_single_layer(&testparams[n], layer); - } + subtest_pass &= test_single_layer(&testparams[n], 1); piglit_report_subtest_result(subtest_pass ? PIGLIT_PASS : PIGLIT_FAIL, "%s", testparams[n].desc); pass &= subtest_pass; @@ -167,6 +165,7 @@ piglit_init(int argc, char **argv) piglit_require_extension("GL_ARB_texture_view"); piglit_require_extension("GL_ARB_texture_storage"); + piglit_require_extension("GL_ARB_pipeline_statistics_query"); /* setup shaders and program object for texture rendering */ vsCode = @@ -175,17 +174,31 @@ piglit_init(int argc, char **argv) "{\n" " gl_Position = gl_Vertex;\n" "}\n"; +#if 1 fsCode = "#version 130\n" "uniform sampler2D tex;\n" "void main()\n" "{\n" - " ivec2 size = textureSize(tex, 0);\n" + " vec4 color = texture(tex, vec2(0.0))\n;" + " gl_FragColor = vec4(color.xyz, 1.0);\n" + "}\n"; +#else + fsCode = + "#version 130\n" + "uniform sampler2DArray tex;\n" + "uniform sampler2D texview;\n" + "void main()\n" + "{\n" + " ivec3 size = textureSize(tex, 0);\n" /* texel in (0,0) should be the only green texel in the entire texture */ " vec2 offset = vec2(0.5/float(size.x), 0.5/float(size.y));\n" - " vec4 color = texture(tex, offset);\n" - " gl_FragColor = vec4(color.xyz, 1.0);\n" + " vec4 color = texture(tex, vec3(offset, 0.0));\n" +// " vec4 color2 = texture(tex, vec3(offset, 1.0));\n" + " vec4 color2 = texture(texview, offset.xy)\n;" + " gl_FragColor = vec4(1.0, 1.0, color2.xy);\n" "}\n"; +#endif prog_view = piglit_build_simple_program(vsCode, fsCode); tex_loc_view = glGetUniformLocation(prog_view, "tex"); -- 2.6.1