Skip to content
Snippets Groups Projects

piglit hacks

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Erik Faye-Lund
    diff.patch 2.63 KiB
    diff --git a/tests/spec/arb_texture_view/rendering-formats.c b/tests/spec/arb_texture_view/rendering-formats.c
    index ecd76f399..17d515e84 100644
    --- a/tests/spec/arb_texture_view/rendering-formats.c
    +++ b/tests/spec/arb_texture_view/rendering-formats.c
    @@ -1905,7 +1905,11 @@ create_test_clear_program(const struct format_info *base,
     		 "	    value == expected[1]) {\n"
     		 "		color = vec4(0,1,0,0);\n"
     		 "	} else {\n"
    -		 "		color = vec4(1,0,0,0);\n"
    +		 "		color = vec4(\n"
    +		 "			float(value.x & 255u) / 255.0,\n"
    +		 "			float((value.x >> 8) & 255u) / 255.0,\n"
    +		 "			float((value.x >> 16) & 255u) / 255.0,\n"
    +		 "			float((value.x >> 24) & 255u) / 255.0);\n"
     		 "	}\n"
     		 "}\n",
     		 sampler, sampler, conv);
    @@ -1914,6 +1918,7 @@ create_test_clear_program(const struct format_info *base,
     	glUseProgram(prog);
     	glUniform1i(glGetUniformLocation(prog, "s"), 0);
     	glUniform4uiv(glGetUniformLocation(prog, "expected"), 2, expected);
    +	printf("expected: %08x\n", expected[0]);
     	return prog;
     }
     
    @@ -1931,7 +1936,13 @@ test_clear_by_sampling(const char *test_name,
     
     	/* Draw only one pixel. We don't need more. */
     	piglit_draw_rect(-1, -1, 2.0/TEX_SIZE, 2.0/TEX_SIZE);
    -	pass = piglit_probe_pixel_rgba_silent(0, 0, green, NULL);
    +	float output[4];
    +	pass = piglit_probe_pixel_rgba_silent(0, 0, green, output);
    +	printf("output: %02x%02x%02x%02x\n",
    +	       (int)(output[3] * 255),
    +	       (int)(output[2] * 255),
    +	       (int)(output[1] * 255),
    +	       (int)(output[0] * 255));
     
     	one_result = pass ? PIGLIT_PASS : PIGLIT_FAIL;
     	piglit_report_subtest_result(one_result, "%s", test_name);
    @@ -2050,7 +2061,7 @@ piglit_display(void)
     	int classi;
     
     	glClear(GL_COLOR_BUFFER_BIT);
    -
    +#if 0
     	/* Reinterpret sampler formats. */
     	for (classi = 0; classi < ARRAY_SIZE(classes); classi++) {
     		const struct view_class *vclass = &classes[classi];
    @@ -2090,7 +2101,7 @@ piglit_display(void)
     			glDeleteTextures(1, &tex);
     		}
     	}
    -
    +#endif
     	/* Reinterpret color buffer formats. */
     	for (classi = 0; classi < ARRAY_SIZE(classes); classi++) {
     		const struct view_class *vclass = &classes[classi];
    @@ -2103,6 +2114,9 @@ piglit_display(void)
     			if (!format_supported(base))
     				continue;
     
    +			if (base->internalformat != GL_R32F)
    +				continue;
    +
     			for (j = 0; vclass->formats[j].fs; j++) {
     				const struct format_info *vformat = &vclass->formats[j];
     				char test_name[128];
    @@ -2111,6 +2125,10 @@ piglit_display(void)
     				if (!format_supported(vformat))
     					continue;
     
    +				if (vformat->internalformat != GL_R32UI &&
    +				    vformat->internalformat != GL_R32I)
    +					continue;
    +
     				tex = create_texture(vclass, base, true);
     				glBindTexture(GL_TEXTURE_2D, 0);
     
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment