• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ piglit_present_results函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中piglit_present_results函数的典型用法代码示例。如果您正苦于以下问题:C++ piglit_present_results函数的具体用法?C++ piglit_present_results怎么用?C++ piglit_present_results使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了piglit_present_results函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: piglit_display

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	GLfloat *v;
	int i;
	GLuint q, num_prims;

	glClear(GL_COLOR_BUFFER_BIT);

	glGenQueries(1, &q);
	glBeginQuery(GL_PRIMITIVES_GENERATED_EXT, q);

	glBeginTransformFeedback(GL_POINTS);
	glBindBuffer(GL_ARRAY_BUFFER, vert_buf);
	glVertexPointer(3, GL_FLOAT, 0, 0);
	glEnable(GL_VERTEX_ARRAY);
	glDrawArrays(GL_POINTS, 0, 3);
	glEndTransformFeedback();

	glEndQuery(GL_PRIMITIVES_GENERATED);

	glGetQueryObjectuiv(q, GL_QUERY_RESULT, &num_prims);
	glDeleteQueries(1, &q);
	printf("%u primitives generated:\n", num_prims);

	if (num_prims != NUM_VERTS) {
		printf("Incorrect number of prims generated.\n");
		printf("Found %u, expected %u\n", num_prims, NUM_VERTS);
		pass = false;
	}

	glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, xfb_buf);
	v = glMapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT, GL_READ_ONLY);
	for (i = 0; i < num_prims; i++) {
		printf("vertex %2d: pos %5.2g, %5.2g, %5.2g, %5.2g   "
		       "color %5.2g, %5.2g, %5.2g, %5.2g\n", i,
		       v[i*8+0], v[i*8+1], v[i*8+2], v[i*8+3],
		       v[i*8+4], v[i*8+5], v[i*8+6], v[i*8+7]);
		/* spot-check results */
		if (!equal(v[i*8+1], 0.1)) {
			printf("Incorrect Y coord for point %d: %f\n",
			       i, v[i*8+1]);
			pass = false;
		}
		if (!equal(v[i*8+4], 0.9)) {
			printf("Incorrect red value for point %d: %f\n",
			       i, v[i*8+4]);
			pass = false;
		}
	}
	glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER_EXT);

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:57,代码来源:points.c


示例2: piglit_display

enum piglit_result
piglit_display()
{
	enum piglit_result result = test->run() ? PIGLIT_PASS : PIGLIT_FAIL;

	piglit_present_results();

	return result;
}
开发者ID:dervishxgit,项目名称:piglit,代码行数:9,代码来源:accuracy.cpp


示例3: piglit_display

enum piglit_result
piglit_display(void)
{
	enum piglit_result ret = do_query(queries, ARRAY_SIZE(queries));
#ifdef DISPLAY
	piglit_present_results();
#endif
	return ret;
}
开发者ID:chemecse,项目名称:piglit,代码行数:9,代码来源:pipeline_stats_clip.c


示例4: piglit_display

PIGLIT_GL_TEST_CONFIG_END

enum piglit_result
piglit_display(void)
{
	static const char *vs_source =
		"#version 140\n"
		"in vec4 piglit_vertex;\n"
		"void main()\n"
		"{\n"
		"	gl_Position = piglit_vertex;\n"
		"}\n";

	static const char *fs_source =
		"#version 140\n"
		"uniform samplerBuffer s;\n"
		"void main()\n"
		"{\n"
		"	gl_FragColor = texelFetch(s, 0);\n"
		"}\n";

	bool pass = true;
	GLuint tex, bo;
	GLuint prog;
	float green[] = {0, 1, 0, 0};
	float blue[] =  {0, 0, 1, 0};
	uint8_t g_rgba8[] = {0x00, 0xff, 0x00, 0x00};
	uint8_t b_rgba8[] = {0x00, 0x00, 0xff, 0x00};

	prog = piglit_build_simple_program(vs_source, fs_source);
	glUseProgram(prog);

	glGenBuffers(1, &bo);
	glBindBuffer(GL_TEXTURE_BUFFER, bo);
	glBufferData(GL_TEXTURE_BUFFER, sizeof(g_rgba8), g_rgba8,
		     GL_STREAM_DRAW);

	glGenTextures(1, &tex);
	glBindTexture(GL_TEXTURE_BUFFER, tex);
	glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA8, bo);

	piglit_draw_rect(-1, -1, 1, 2);
	glBufferData(GL_TEXTURE_BUFFER, sizeof(b_rgba8), b_rgba8,
		     GL_STREAM_DRAW);
	piglit_draw_rect(0, -1, 1, 2);

	pass = pass && piglit_probe_rect_rgba(0, 0,
					      piglit_width / 2, piglit_height,
					      green);
	pass = pass && piglit_probe_rect_rgba(piglit_width / 2, 0,
					      piglit_width / 2, piglit_height,
					      blue);

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:chemecse,项目名称:piglit,代码行数:57,代码来源:data-sync.c


示例5: piglit_display

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	GLint max_vs, max_fs, max_combined;

	piglit_require_extension("GL_ARB_uniform_buffer_object");

	glGetIntegerv(GL_MAX_VERTEX_UNIFORM_BLOCKS, &max_vs);
	glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, &max_fs);
	glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &max_combined);
	printf("Max VS uniform blocks: %d\n", max_vs);
	printf("Max FS uniform blocks: %d\n", max_fs);
	printf("Max combined uniform blocks: %d\n", max_combined);

	glClearColor(0.5, 0.5, 0.5, 0.5);
	glClear(GL_COLOR_BUFFER_BIT);

	pass = fail_link_test("vs", max_vs + 1,
			      "vs", 0) && pass;
	pass = fail_link_test("fs", 0,
			      "fs", max_fs + 1) && pass;
	if (max_vs + max_fs > max_combined) {
		pass = fail_link_test("vs",
				      max_vs,
				      "fs",
				      max_combined + 1 - max_vs) && pass;

		pass = fail_link_test("shared",
				      max_vs,
				      "shared",
				      max_combined + 1 - max_vs) && pass;
	}

	pass = pass_link_test(0,

			      "vs", max_vs,
			      "vs", 0) && pass;

	pass = pass_link_test(1,
			      "fs", 0,
			      "fs", max_fs) && pass;

	pass = pass_link_test(2,
			      "vs", max_vs,
			      "fs", MIN2(max_fs,
					 max_combined - max_vs)) && pass;

	pass = pass_link_test(3,
			      "shared", max_vs,
			      "shared", MIN2(max_fs,
					     max_combined - max_vs)) && pass;

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:ThirteenFish,项目名称:piglit,代码行数:57,代码来源:maxblocks.c


示例6: piglit_display

PIGLIT_GL_TEST_CONFIG_END

enum piglit_result
piglit_display(void)
{
	GLboolean pass = GL_TRUE;
	static float red[] = {1.0, 0.0, 0.0, 0.0};
	static float green[] = {0.0, 1.0, 0.0, 0.0};
	static float blue[]  = {0.0, 0.0, 1.0, 0.0};
	float *pixels;
	GLuint pbo, tex;

	glClearColor(0.5, 0.5, 0.5, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);

	glGenBuffersARB(1, &pbo);
	glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, pbo);
	glBufferDataARB(GL_PIXEL_UNPACK_BUFFER, 4 * 4 * sizeof(float),
			NULL, GL_STREAM_DRAW_ARB);
	pixels = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY_ARB);

	memcpy(pixels + 0,  red, sizeof(red));
	memcpy(pixels + 4,  green, sizeof(green));
	memcpy(pixels + 8,  blue, sizeof(blue));
	memcpy(pixels + 12, red, sizeof(red));

	glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER);
	glGenTextures(1, &tex);
	glBindTexture(GL_TEXTURE_2D, tex);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexImage2D(GL_TEXTURE_2D, 0,
		     GL_RGBA,
		     2, 2, 0,
		     GL_RGBA, GL_FLOAT, 0);
	glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, 0);
	glDeleteBuffersARB(1, &pbo);

	glEnable(GL_TEXTURE_2D);
	glBegin(GL_TRIANGLE_FAN);
	glTexCoord2f(0.0, 0.0); glVertex2f(10, 10);
	glTexCoord2f(1.0, 0.0); glVertex2f(20, 10);
	glTexCoord2f(1.0, 1.0); glVertex2f(20, 20);
	glTexCoord2f(0.0, 1.0); glVertex2f(10, 20);
	glEnd();

	glDeleteTextures(1, &tex);

	pass &= piglit_probe_pixel_rgb(12, 12, red);
	pass &= piglit_probe_pixel_rgb(18, 12, green);
	pass &= piglit_probe_pixel_rgb(12, 18, blue);
	pass &= piglit_probe_pixel_rgb(18, 18, red);

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:RAOF,项目名称:piglit,代码行数:57,代码来源:pbo-teximage.c


示例7: piglit_display

PIGLIT_GL_TEST_CONFIG_END

enum piglit_result
piglit_display(void)
{
	GLboolean pass = GL_TRUE;
	static float red[]   = {1.0, 0.0, 0.0, 0.0};
	static float green[] = {0.0, 1.0, 0.0, 0.0};
	static float blue[]  = {0.0, 0.0, 1.0, 0.0};

	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	glClearColor(0.5, 0.0, 0.0, 0.0);
	glColor4fv(red);

	/* Make a list containing a clear and a rectangle.  It'll draw
	 * colors we don't expect to see, due to COMPILE_AND_EXECUTE.
	 */
	glNewList(1, GL_COMPILE_AND_EXECUTE);
	/* Even though we don't use depth, GL_DEPTH_BUFFER_BIT is what
	 * triggered the metaops clear path which messed up the display list.
	 */
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glBegin(GL_QUADS);
		glVertex2f(10, 10);
		glVertex2f(20, 10);
		glVertex2f(20, 20);
		glVertex2f(10, 20);
	glEnd();
	glEndList();

	/* Now, set up our expected colors, translate the dlist's rectangle
	 * over a little, and do the draw we actually expect to see.
	 */
	glClearColor(0.0, 1.0, 0.0, 0.0);
	glColor4fv(blue);

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	glTranslatef(20, 0, 0);

	glCallList(1);

	pass &= piglit_probe_rect_rgb(0, 0, piglit_width, 10, green);

	pass &= piglit_probe_rect_rgb(0, 10, 30, 10, green);
	pass &= piglit_probe_rect_rgb(30, 10, 10, 10, blue);
	pass &= piglit_probe_rect_rgb(40, 10, piglit_width-40, 10, green);

	pass &= piglit_probe_rect_rgb(0, 20, piglit_width, piglit_height - 20,
				      green);

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:RAOF,项目名称:piglit,代码行数:56,代码来源:dlist-clear.c


示例8: piglit_display

enum piglit_result
piglit_display(void)
{
	int x0 = piglit_width * 1 / 4;
	int x1 = piglit_width * 3 / 4;
	int y0 = piglit_height * 1 / 4;
	int y1 = piglit_height * 3 / 4;
	GLboolean pass = GL_TRUE;

	glClear(GL_COLOR_BUFFER_BIT);

	glFrontFace(GL_CCW);  /* the default winding */

	glBegin(GL_QUADS);
	/* counter-clockwise / front-facing */
	glNormal3f(0, 0, 1);
	glVertex2f(-1.0, -1.0);
	glVertex2f( 0.0, -1.0);
	glVertex2f( 0.0,  0.0);
	glVertex2f(-1.0,  0.0);

	/* clockwise / back-facing */
	glNormal3f(0, 0, -1);
	glVertex2f( 0.0, -1.0);
	glVertex2f( 0.0,  0.0);
	glVertex2f( 1.0,  0.0);
	glVertex2f( 1.0, -1.0);
	glEnd();

	glFrontFace(GL_CW);  /* reverse winding */

	glBegin(GL_QUADS);
	/* counter-clockwise / back-facing */
	glNormal3f(0, 0, -1);
	glVertex2f(-1.0, 0.0);
	glVertex2f( 0.0, 0.0);
	glVertex2f( 0.0, 1.0);
	glVertex2f(-1.0, 1.0);

	/* clockwise / front-facing */
	glNormal3f(0, 0, 1);
	glVertex2f( 0.0, 0.0);
	glVertex2f( 0.0, 1.0);
	glVertex2f( 1.0, 1.0);
	glVertex2f( 1.0, 0.0);
	glEnd();

	pass = piglit_probe_pixel_rgb(x0, y0, green) && pass;
	pass = piglit_probe_pixel_rgb(x1, y0, blue) && pass;
	pass = piglit_probe_pixel_rgb(x0, y1, blue) && pass;
	pass = piglit_probe_pixel_rgb(x1, y1, green) && pass;

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:RAOF,项目名称:piglit,代码行数:56,代码来源:two-sided-lighting.c


示例9: piglit_display

enum piglit_result
piglit_display(void)
{
	GLuint vs, fs;
	bool pass = true;
	GLuint prog;
	float green[] = {0.0, 1.0, 0.0, 0.0};
	GLint status;

	/* Initial buffer clear. */
	glClearColor(1.0, 0.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);

	vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_source);
	fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_source);
	prog = piglit_link_simple_program(vs, fs);

	if (!vs || !fs || !prog)
		piglit_report_result(PIGLIT_FAIL);

	piglit_DeleteShader(vs);
	piglit_DeleteShader(fs);
	piglit_UseProgram(prog);
	piglit_DeleteProgram(prog);

	/* Try to blow out the refcount */
	piglit_DeleteProgram(prog);
	piglit_DeleteProgram(prog);
	piglit_DeleteProgram(prog);

	/* Sanity check: deleting didn't already unbind our shader program. */
	piglit_draw_rect(-1, -1, 2, 2);
	pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height,
				      green) && pass;

	/* The program should still report being deleted. */
	piglit_GetProgramiv(prog, GL_DELETE_STATUS, &status);
	if (!piglit_check_gl_error(0))
		piglit_report_result(PIGLIT_FAIL);
	if (status != GL_TRUE) {
		fprintf(stderr,
			"GL_DELETE_STATUS after a clear reported non-true %d\n",
			status);
		pass = false;
	}

	/* Now, disable the program and it should be finally deleted. */
	piglit_UseProgram(0);

	piglit_GetProgramiv(prog, GL_DELETE_STATUS, &status);
	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:nobled,项目名称:piglit,代码行数:56,代码来源:delete-repeat.c


示例10: piglit_display

enum piglit_result
piglit_display(void)
{
	int x, y;
	bool pass = true;
	float expected[64 * 64 * 4];

	glClearColor(0.0, 1.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);

	for (x = 0; x < 8; x++) {
		for (y = 0; y < 8; y++) {
			piglit_Uniform2i(coord1_location, x * 9, y * 9);
			piglit_Uniform2i(coord2_location, x * 9, y * 9);
			piglit_draw_rect(-1.0 + 0.25 * x,
					 -1.0 + 0.25 * y,
					 0.25,
					 0.25);
		}
	}

	for (x = 0; x < 64; x++) {
		for (y = 0; y < 64; y++) {
			int sx = x % 8;
			int sy = y % 8;
			int dx = fabs(sx - x / 8);
			int dy = fabs(sy - y / 8);
			float pixel[4];

			if (dx == 0 && dy == 0) {
				pixel[0] = 0.0;
				pixel[1] = 1.0;
				pixel[2] = 0.0;
				pixel[3] = 0.0;
			} else {
				int i;

				pixel[0] = 0.0;
				pixel[1] = 0.0;
				pixel[2] = 0.0;
				pixel[3] = 0.0;

				for (i = 0; i < 10; i += (dx + dy))
					pixel[2] += 0.1;
			}

			memcpy(expected + (y * 64 + x) * 4, pixel, 4 * 4);
		}
	}

	pass = piglit_probe_image_rgba(0, 0, 64, 64, expected);

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:blaztinn,项目名称:piglit,代码行数:56,代码来源:fs-discard-exit-2.c


示例11: piglit_display

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	const float clearColor[3] = { 1, 1, 0 };

	/* Clear Defualt Framebuffer */
	glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo);
	glClearColor(1,1,0,1);
	glClear(GL_COLOR_BUFFER_BIT);

	/* Clear texture[0] with glClear() */
	glBindFramebuffer(GL_FRAMEBUFFER, fbo[0]);
	glClearColor(clearColor[0], clearColor[1], clearColor[2], 1);
	glClear(GL_COLOR_BUFFER_BIT);

	/* Clear texture[1] with glClearBuffer() */
	glBindFramebuffer(GL_FRAMEBUFFER, fbo[1]);
	glClearBufferfv(GL_COLOR, 0, clearColor);

	/* Display glClear texture */
	if(!display_layered_texture(0, 0, piglit_width/2, piglit_height,
				    piglit_width, piglit_height, GL_TEXTURE_2D_ARRAY,
				    texture[0], layers)) {
		printf("Failed to display layered texture for glClear\n");
		pass = false;
	}

	/* Display glClearBuffer texture */
	if(!display_layered_texture(piglit_width/2, 0, piglit_width/2,
				    piglit_height, piglit_width, piglit_height,
				    GL_TEXTURE_2D_ARRAY, texture[1], layers)) {
		printf("Failed to display layered texture for glClearBuffer\n");
		pass = false;
	}

	/* Check for passing conditions for glClear*/
	if(!piglit_probe_rect_rgb(0, 0, piglit_width/2, piglit_height,
				  clearColor)) {
		printf("Incorrect probe value for glClear test.\n");
		pass = false;
	}

	/* Check for passing conditions for glClearBuffer*/
	if(!piglit_probe_rect_rgb(piglit_width/2, 0, piglit_width/2,
				  piglit_height, clearColor)) {
		printf("Incorrect probe value for glClearBuffer test.\n");
		pass = false;
	}

	if(!piglit_check_gl_error(GL_NO_ERROR))
		pass = false;

	piglit_present_results();
	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:ThirteenFish,项目名称:piglit,代码行数:56,代码来源:clear-color.c


示例12: piglit_display

enum piglit_result
piglit_display(void)
{
	GLboolean pass = GL_TRUE;
	int x, y;
	GLuint fb, tex;

	/* Draw the shader to the fbo. */
	fb = create_fbo(WIDTH, HEIGHT, &tex);
	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
	glViewport(0, 0, WIDTH, HEIGHT);

	glClearColor(1.0, 0.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);

	glUseProgram(prog);
	piglit_draw_rect(-1, -1, 2, 2);

	/* Draw the FBO to the screen. */
	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
	glViewport(0, 0, piglit_width, piglit_height);

	glClearColor(0.0, 0.0, 1.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);

	glBindTexture(GL_TEXTURE_2D, tex);
	glEnable(GL_TEXTURE_2D);
	glUseProgram(0);
	piglit_draw_rect_tex(-1, -1, 2, 2,
			     0, 0, 1, 1);

	glDisable(GL_TEXTURE_2D);
	glDeleteTextures(1, &tex);
	glDeleteFramebuffersEXT(1, &fb);

	assert(glGetError() == 0);

	for (y = 0; y < piglit_height; y++) {
		for (x = 0; x < piglit_width; x++) {
			float color[3];

			color[0] = x / 256.0;
			color[1] = y / 256.0;
			color[2] = 0;

			pass &= piglit_probe_pixel_rgb(x, y, color);
			if (!pass)
				break;
		}
	}

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:aphogat,项目名称:piglit,代码行数:55,代码来源:fbo-fragcoord.c


示例13: piglit_display

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	float red[4] = {1.0, 0.0, 0.0, 0.0};
	float green[4] = {0.0, 1.0, 0.0, 0.0};
	GLuint q, texture;

	glClearColor(0.5, 0.5, 0.5, 0.5);
	glClear(GL_COLOR_BUFFER_BIT);

	/* Draw bottom half of window to green. */
	glColor4fv(green);
	piglit_draw_rect(-1, -1, 2, 1);
	glColor4f(1, 1, 1, 1);

	/* Set up a red texture. */
	glGenTextures(1, &texture);
	glBindTexture(GL_TEXTURE_2D, texture);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
			GL_LINEAR_MIPMAP_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);

	fill_tex(0, piglit_width, piglit_height / 2, red);

	glGenQueries(1, &q);

	/* Generate query fail. */
	glBeginQuery(GL_SAMPLES_PASSED, q);
	glEndQuery(GL_SAMPLES_PASSED);

	/* This should not be affected by conditional rendering. */
	glBeginConditionalRenderNV(q, GL_QUERY_WAIT_NV);
	glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, piglit_width, piglit_height / 2, 0);
	glEndConditionalRenderNV();

	/* Draw the texture. */
	glEnable(GL_TEXTURE_2D);
	piglit_draw_rect_tex(-1, 0, 2, 1,
			     0, 0, 1, 1);
	glDisable(GL_TEXTURE_2D);

	pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height,
				      green);

	piglit_present_results();

	glDeleteQueries(1, &q);

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:55,代码来源:copyteximage.c


示例14: piglit_display

enum piglit_result
piglit_display(void)
{
	static const float black[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
	bool pass = true;

	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
	glViewport(0, 0, TEX_WIDTH, TEX_HEIGHT);

	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glClearDepth(0.0f);
	glClearStencil(0);
	glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

	glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo_copy);

	/* This blit is there on purpose to trigger a bug in stencil decompress
	 * on Radeon. The blit destination is not used.
	 */
	glBlitFramebuffer(0, 0, TEX_WIDTH, TEX_WIDTH, 0, 0, TEX_WIDTH, TEX_WIDTH, GL_STENCIL_BUFFER_BIT, GL_NEAREST);
	glBindFramebuffer(GL_FRAMEBUFFER, fbo);

	glEnable(GL_STENCIL_TEST);
	glStencilMask(255);
	glStencilFunc(GL_LEQUAL, 1, 255);
	glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);

	glColor4f(1.0, 1.0, 1.0, 1.0);
	glBegin(GL_TRIANGLE_FAN);
		glVertex3f( 0.0174f, -0.00413f, 1.0f);
		glVertex3f(-1.0f, -1.0f,  1.0f);
		glVertex3f( 1.0f, -1.0f, -1.0f);
		glVertex3f( 1.0f,  1.0f,  1.0f);
		glVertex3f(-1.0f,  1.0f, -1.0f);
		glVertex3f(-1.0f, -1.0f, -1.0f);
	glEnd();

	glDisable(GL_STENCIL_TEST);

	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
	glClearColor(1.0, 0.0, 1.0, 1.0);
	glClear(GL_COLOR_BUFFER_BIT);

	glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
	glBlitFramebuffer(0, 0, TEX_WIDTH, TEX_HEIGHT, 0, 0, TEX_WIDTH, TEX_HEIGHT,
			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);

	pass = piglit_probe_rect_rgb(0, 0, TEX_WIDTH, TEX_HEIGHT, black) && pass;

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:dcbaker,项目名称:piglit,代码行数:55,代码来源:stencil-clear.c


示例15: piglit_display

PIGLIT_GL_TEST_CONFIG_END

enum piglit_result
piglit_display(void)
{
	GLboolean pass = GL_TRUE;
	GLuint tex, fb;
	GLenum status;
	float green[] = {0, 1, 0, 0};

	glGenTextures(1, &tex);
	glBindTexture(GL_TEXTURE_2D, tex);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
		     piglit_width, piglit_height, 0,
		     GL_RGBA, GL_UNSIGNED_BYTE, NULL);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

	glGenFramebuffersEXT(1, &fb);
	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
				  GL_COLOR_ATTACHMENT0_EXT,
				  GL_TEXTURE_2D,
				  tex,
				  0);
	assert(glGetError() == 0);

	status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
		fprintf(stderr, "fbo incomplete (status = 0x%04x)\n", status);
		piglit_report_result(PIGLIT_SKIP);
	}

	glClearColor(1.0, 0.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_NEVER);
	glColor4fv(green);
	piglit_draw_rect(0, 0, piglit_width, piglit_height);

	pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, green);

	glDisable(GL_DEPTH_TEST);
	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
	glEnable(GL_TEXTURE_2D);
	glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	piglit_draw_rect_tex(0, 0, piglit_width, piglit_height,
			     0, 0, 1, 1);
	glDisable(GL_TEXTURE_2D);

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:Zoxc,项目名称:piglit,代码行数:55,代码来源:fbo-nodepth-test.c


示例16: run_test

PIGLIT_GL_TEST_CONFIG_END


static bool
run_test(bool scissor_clear)
{
	GLuint query;
	GLint result = -1;

	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	glClearColor(0.0, 1.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);

	glGenQueries(1, &query);

	glBeginQuery(GL_SAMPLES_PASSED, query);

	/* Render 64 pixels. This should affect the query */
	piglit_draw_rect(0, 0, 8, 8);

	/* Clear the framebuffer. This shouldn't affect the query */
	glClearColor(0.0, 0.0, 1.0, 0.0);
	if (scissor_clear) {
		glScissor(0, 0, piglit_width / 2, piglit_height / 2);
		glEnable(GL_SCISSOR_TEST);
	}
	glClear(GL_COLOR_BUFFER_BIT);
	if (scissor_clear) {
		glDisable(GL_SCISSOR_TEST);
	}

	/* Render another 64 pixels. This should continue adding to
	 * the query */
	piglit_draw_rect(4, 0, 8, 8);

	glEndQuery(GL_SAMPLES_PASSED);

	glGetQueryObjectiv(query, GL_QUERY_RESULT, &result);

	glDeleteQueries(1, &query);

	piglit_present_results();

	if (result != 128) {
		printf("Failure: \n");
		printf("  Occlusion query resulted in %d samples "
		       "(expected 128)\n",
		       result);
		printf("  Scissor enabled? %s\n", scissor_clear ? "yes" : "no");
		return false;
	} else {
		return true;
	}
}
开发者ID:chemecse,项目名称:piglit,代码行数:55,代码来源:occlusion_query_meta_save.c


示例17: piglit_display

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	GLint w = pattern_width, h = pattern_height;
	GLfloat *color_buffer = NULL;

	test->draw_to_default_framebuffer();

	/* Read color buffer */
	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
	color_buffer = (GLfloat *) malloc(w * h * 4 * sizeof(float));
	glReadPixels(0, 0, w, h, GL_RGBA, GL_FLOAT, color_buffer);

	/* Draw the test pattern in to test_fbo with num_samples = 0. This
	 * is to verify if glRenderbufferStorageMultisample() with zero sample
	 * count turns off MSAA.
	 */
	test->test_fbo.set_samples(0);
	test->draw_test_image(&test->test_fbo);

	/* Compare rendered scene with color_buffer */
	glBindFramebuffer(GL_READ_FRAMEBUFFER, test->test_fbo.handle);
	pass = piglit_probe_image_rgba(0, 0, w, h, color_buffer)
	       && pass;

	/* Switch ON MSAA in this FBO by passing num_samples > 0 */
	test->test_fbo.set_samples(num_samples);

	/* Draw test image in multisample FBO */
	test->draw_test_image(&test->test_fbo);

	/* Draw a reference image for MSAA */
	test->draw_reference_image();

	/* Measure the accuracy of MSAA in multisample FBO by comparing the
	 * test image to reference image. This varifies if MSAA is actually
	 * switched on.
	 */
	pass = test->measure_accuracy() && pass;

	/* Switch OFF MSAA again in this FBO */
	test->test_fbo.set_samples(0);
	test->draw_test_image(&test->test_fbo);

	/* Compare rendered scene with color_buffer */
	glBindFramebuffer(GL_READ_FRAMEBUFFER, test->test_fbo.handle);
	pass = piglit_probe_image_rgba(0, 0, w, h, color_buffer)
	       && pass;

	if (!piglit_automatic)
		piglit_present_results();
	return (pass ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:dervishxgit,项目名称:piglit,代码行数:54,代码来源:turn-on-off.cpp


示例18: piglit_display

enum piglit_result
piglit_display(void)
{
#define NUM_QUERIES 5
	GLuint queries[NUM_QUERIES], available;
	bool test_pass = true;
	GLint result;
	int i;

	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	glClearColor(1.0, 0.0, 0.0, 1.0);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glGenQueries(NUM_QUERIES, queries);

	glColor4f(0.0f, 1.0f, 0.0f, 1.0f);

	/* Queue up a bunch of drawing with several queries. */
	for (i = 0; i < NUM_QUERIES - 1;  i++)
	{
		glBeginQuery(GL_SAMPLES_PASSED, queries[i]);

		draw_some_things((double)i / (NUM_QUERIES - 1));

		glEndQuery(GL_SAMPLES_PASSED);
	}

	/* Now fire off a query with no drawing. */
	glBeginQuery(GL_SAMPLES_PASSED, queries[NUM_QUERIES - 1]);
	glEndQuery(GL_SAMPLES_PASSED);

	/* Get the result for the final query. */
	glGetQueryObjectiv(queries[NUM_QUERIES - 1], GL_QUERY_RESULT, &result);

	/* At this point, the results of all the previous queries
	 * should be available.
	 */
	for (i = 0; i < NUM_QUERIES - 1; i++)
	{
		glGetQueryObjectuiv(queries[i], GL_QUERY_RESULT_AVAILABLE,
				    &available);
		if (available != 1) {
			printf("Query #%d result not available (expected in-order processing)\n", i);
			test_pass = false;
		}
	}

	glDeleteQueries(NUM_QUERIES, queries);

	piglit_present_results();

	return test_pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:RAOF,项目名称:piglit,代码行数:54,代码来源:occlusion_query_order.c


示例19: piglit_display

enum piglit_result
piglit_display(void)
{
	int succ;

	DoFrame();
	succ = DoTest();
	piglit_present_results();

	return succ ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:11,代码来源:trinity-fp1.c


示例20: piglit_display

enum piglit_result
piglit_display(void)
{
    GLboolean pass = GL_TRUE;
    int i;
    GLenum funcs[] = {
        GL_NEVER,
        GL_LESS,
        GL_EQUAL,
        GL_LEQUAL,
        GL_GREATER,
        GL_NOTEQUAL,
        GL_GEQUAL,
        GL_ALWAYS,
    };
    const float green[4] = {0, 1, 0, 0};
    const float blue[4] =  {0, 0, 1, 0};

    piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
    /* Clear gray. */
    glClearColor(0.5, 0.5, 0.5, 0.0);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glColor4f(0.0, 1.0, 0.0, 0.0);
    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_ALWAYS);
    for (i = 0; i < ARRAY_SIZE(funcs); i++) {
        draw_rect_depth(10, 10 + 20 * i, 10, 10, 0.0);
        draw_rect_depth(30, 10 + 20 * i, 10, 10, 0.0);
        draw_rect_depth(50, 10 + 20 * i, 10, 10, 0.0);
    }

    glColor4f(0.0, 0.0, 1.0, 0.0);
    for (i = 0; i < ARRAY_SIZE(funcs); i++) {
        glDepthFunc(funcs[i]);
        draw_rect_depth(10, 10 + 20 * i, 10, 10, 0.5);
        draw_rect_depth(30, 10 + 20 * i, 10, 10, 0.0);
        draw_rect_depth(50, 10 + 20 * i, 10, 10, -0.5);
    }

    for (i = 0; i < ARRAY_SIZE(funcs); i++) {
        glDepthFunc(funcs[i]);
        pass = pass && piglit_probe_pixel_rgb(15, 15 + 20 * i,
                                              i & 1 ? blue : green);
        pass = pass && piglit_probe_pixel_rgb(35, 15 + 20 * i,
                                              i & 2 ? blue : green);
        pass = pass && piglit_probe_pixel_rgb(55, 15 + 20 * i,
                                              i & 4 ? blue : green);
    }

    piglit_present_results();

    return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:janesma,项目名称:piglit,代码行数:54,代码来源:depthfunc.c



注:本文中的piglit_present_results函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ piglit_probe_pixel_rgb函数代码示例发布时间:2022-05-30
下一篇:
C++ piglit_ortho_projection函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap