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

C++ piglit_probe_rect_rgba函数代码示例

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

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



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

示例1: test_rgba

static void
test_rgba(EGLDisplay dpy, EGLContext ctx)
{
	const float color1[4] = { 0.0, 1.0, 0.0, 1.0 };
	const float color2[4] = { 0.0, 0.0, 1.0, 1.0 };

	bool pass = true;
	GLuint fb1, fb2;

	create_framebuffers(dpy, ctx, &fb1, &fb2, GL_RGBA);

	/* Clear rb1 to color1. Check that rb2 has color1. */
	glBindFramebuffer(GL_FRAMEBUFFER, fb1);
	glClearBufferfv(GL_COLOR, 0, color1);
	glBindFramebuffer(GL_FRAMEBUFFER, fb2);
	pass &= piglit_probe_rect_rgba(0, 0, width, height, color1);
	pass &= piglit_check_gl_error(GL_NO_ERROR);

	/* Clear rb2 to color2. Check that rb1 has color2. */
	glBindFramebuffer(GL_FRAMEBUFFER, fb2);
	glClearBufferfv(GL_COLOR, 0, color2);
	glBindFramebuffer(GL_FRAMEBUFFER, fb1);
	pass &= piglit_probe_rect_rgba(0, 0, width, height, color2);
	pass &= piglit_check_gl_error(GL_NO_ERROR);

	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:chadversary,项目名称:piglit,代码行数:27,代码来源:egl_khr_gl_renderbuffer_image-clear-shared-image.c


示例2: piglit_display

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

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

	glFogfv(GL_FOG_COLOR, green);
	piglit_draw_rect(-1, -1, 1, 2);

	glFogfv(GL_FOG_COLOR, blue);
	piglit_draw_rect(0, -1, 1, 2);

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

	glutSwapBuffers();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:blaztinn,项目名称:piglit,代码行数:27,代码来源:glsl-fs-fogcolor-statechange.c


示例3: piglit_display

enum piglit_result
piglit_display(void)
{
	GLsync fence;
	bool pass = true;

	glViewport(0, 0, piglit_width, piglit_height);
	glClearColor(0.2, 0.2, 0.2, 0.2);
	glClear(GL_COLOR_BUFFER_BIT);

	memcpy(map, red, sizeof(red));
	glDrawArrays(GL_TRIANGLE_FAN, 0, 4);

	/* Wait for any previous rendering to finish before updating
	 * the texture buffer
	 */
	fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
	glClientWaitSync(fence, GL_SYNC_FLUSH_COMMANDS_BIT,
			 GL_TIMEOUT_IGNORED);

	memcpy(map, green, sizeof(green));
	glDrawArrays(GL_TRIANGLE_FAN, 4, 4);

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

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:chemecse,项目名称:piglit,代码行数:33,代码来源:bufferstorage.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);
	/* Make the buffer bigger than the data to trigger the driver
	 * code path we want.
	 */
	glBufferData(GL_TEXTURE_BUFFER, 4096, NULL, GL_STREAM_DRAW);
	glBufferSubData(GL_TEXTURE_BUFFER, 0, sizeof(g_rgba8), g_rgba8);

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

	piglit_draw_rect(-1, -1, 1, 2);
	glBufferSubData(GL_TEXTURE_BUFFER, 0, sizeof(b_rgba8), b_rgba8);
	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,代码行数:59,代码来源:subdata-sync.c


示例5: draw

enum piglit_result
draw(Display *dpy)
{
	GLboolean pass = GL_TRUE;
	float green[] = {0.0, 1.0, 0.0, 1.0};
	float blue[] = {0.0, 0.0, 1.0, 1.0};
	float gray[] = {0.5, 0.5, 0.5, 1.0};
	pthread_t thread1, thread2;
	void *retval;
	int ret;
	int x1 = 10, x2 = 30;

	ctx = piglit_get_glx_context(dpy, visinfo);
	glXMakeCurrent(dpy, win, ctx);
	glewInit();

	piglit_require_glx_extension(dpy, "MESA_multithread_makecurrent");

	/* Clear background to gray */
	glClearColor(0.5, 0.5, 0.5, 1.0);
	glClear(GL_COLOR_BUFFER_BIT);

	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	pthread_mutex_init(&mutex, NULL);

	/* Now, spawn some threads that do some drawing, both with this
	 * context
	 */
	pthread_create(&thread1, NULL, thread1_func, &x1);
	pthread_create(&thread2, NULL, thread2_func, &x2);

	ret = pthread_join(thread1, &retval);
	assert(ret == 0);
	ret = pthread_join(thread2, &retval);
	assert(ret == 0);

	pthread_mutex_destroy(&mutex);

	glColor4f(0.0, 1.0, 0.0, 0.0);
	piglit_draw_rect(50, 10, 10, 10);

	pass &= piglit_probe_rect_rgba( 0, 10, 10, 10, gray);
	pass &= piglit_probe_rect_rgba(10, 10, 10, 10, green);
	pass &= piglit_probe_rect_rgba(20, 10, 10, 10, gray);
	pass &= piglit_probe_rect_rgba(30, 10, 10, 10, blue);
	pass &= piglit_probe_rect_rgba(40, 10, 10, 10, gray);
	pass &= piglit_probe_rect_rgba(50, 10, 10, 10, green);
	pass &= piglit_probe_rect_rgba(60, 10, 10, 10, gray);

	pass &= piglit_probe_rect_rgba(0, 0, piglit_width, 10, gray);
	pass &= piglit_probe_rect_rgba(0, 20, piglit_width, 10, gray);

	glXSwapBuffers(dpy, win);

	glXMakeCurrent(dpy, None, None);
	glXDestroyContext(dpy, ctx);

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:blaztinn,项目名称:piglit,代码行数:60,代码来源:glx-multithread-makecurrent-1.c


示例6: piglit_display

enum piglit_result
piglit_display(void)
{
    float color[4][4] = {
        {1, 0, 0, 1},
        {0, 1, 0, 1},
        {0, 0, 1, 1},
        {1, 1, 1, 1},
    };
    bool pass = true;

    glViewport(0, 0, piglit_width, piglit_height);
    glClearColor(0.5, 0.5, 0.5, 0.5);
    glClear(GL_COLOR_BUFFER_BIT);

    glVertexAttrib1fv(attr, color[0]);
    glViewport(0, 0, piglit_width/2, piglit_height/2);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

    glVertexAttrib2fv(attr, color[1]);
    glViewport(0, piglit_height/2, piglit_width/2, piglit_height/2);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

    glVertexAttrib3fv(attr, color[2]);
    glViewport(piglit_width/2, 0, piglit_width/2, piglit_height/2);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

    glVertexAttrib4fv(attr, color[3]);
    glViewport(piglit_width/2, piglit_height/2,
               piglit_width/2, piglit_height/2);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

    pass &= piglit_probe_rect_rgba(0, 0,
                                   piglit_width / 2, piglit_height / 2,
                                   color[0]);
    pass &= piglit_probe_rect_rgba(0, piglit_height / 2,
                                   piglit_width / 2, piglit_height / 2,
                                   color[1]);
    pass &= piglit_probe_rect_rgba(piglit_width / 2, 0,
                                   piglit_width / 2, piglit_height / 2,
                                   color[2]);
    pass &= piglit_probe_rect_rgba(piglit_width / 2, piglit_height / 2,
                                   piglit_width / 2, piglit_height / 2,
                                   color[3]);

    piglit_present_results();

    return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:krnowak,项目名称:piglit,代码行数:49,代码来源:vertex-const-attr.c


示例7: piglit_display

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	float green[4] = {0.0, 1.0, 0.0, 0.0};
	float *buf;
	int i;
	GLuint q;

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

	buf = malloc(sizeof(float) * 4 * piglit_width * piglit_height);

	glGenQueries(1, &q);

	/* Generate query pass: draw top half of screen. */
	glColor4f(0.0, 1.0, 0.0, 0.0);
	glBeginQuery(GL_SAMPLES_PASSED, q);
	piglit_draw_rect(-1, 0, 2, 1);
	glEndQuery(GL_SAMPLES_PASSED);

	/* Conditional render that should draw bottom half of screen. */
	for (i = 0; i < piglit_width * piglit_height / 2; i++) {
		buf[i * 4 + 0] = 0.0;
		buf[i * 4 + 1] = 1.0;
		buf[i * 4 + 2] = 0.0;
		buf[i * 4 + 3] = 0.0;
	}
	glBeginConditionalRenderNV(q, GL_QUERY_WAIT_NV);
	glRasterPos2i(-1, -1);
	glDrawPixels(piglit_width, piglit_height / 2, GL_RGBA, GL_FLOAT, buf);
	glEndConditionalRenderNV();

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

	/* Conditional render that should not draw full screen. */
	for (i = 0; i < piglit_width * piglit_height; i++) {
		buf[i * 4 + 0] = 1.0;
		buf[i * 4 + 1] = 0.0;
		buf[i * 4 + 2] = 0.0;
		buf[i * 4 + 3] = 0.0;
	}
	glBeginConditionalRenderNV(q, GL_QUERY_WAIT_NV);
	glRasterPos2i(-1, -1);
	glDrawPixels(piglit_width, piglit_height, GL_RGBA, GL_FLOAT, buf);
	glEndConditionalRenderNV();

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

	glutSwapBuffers();

	glDeleteQueries(1, &q);
	free(buf);

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


示例8: piglit_display

enum piglit_result
piglit_display(void)
{
	GLboolean pass = GL_TRUE;
	float white[] = {1.0, 1.0, 1.0, 1.0};
	int i;

	glClear(GL_COLOR_BUFFER_BIT);

	glBindVertexArray(vao);
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);

	for (i = 0; i < NUM_QUADS; ++i)
		glDrawElementsBaseVertexOES(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, NULL, i * 4);

	for (i = 0; i < NUM_QUADS; ++i)
	{
		GLfloat xoffset[2], yoffset[2];

		xoffset[0] = inc_amount * i / 2.0 * window_width;
		xoffset[1] = inc_amount * (i + 1) / 2.0 * window_width;
		yoffset[0] = (i % 2 ? 0.0 : 0.5) * window_height;
		yoffset[1] = yoffset[0] + window_height / 2;

		pass = piglit_probe_rect_rgba(xoffset[0], yoffset[0],
			xoffset[1] - xoffset[0], yoffset[1] - yoffset[0], white) && pass;
	}

	piglit_present_results();

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


示例9: piglit_display

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	int layer;

	glClear(GL_COLOR_BUFFER_BIT);

	piglit_ortho_projection(piglit_width, piglit_height, false);

	for (layer = 0; layer < max_layers; layer++) {
		int x = layer % piglit_width;
		int y = layer / piglit_width;

		glUniform1i(layer_loc, layer);
		piglit_draw_rect(x, y, 1, 1);
	}


	for (layer = 0; layer < max_layers; layer++) {
		int x = layer % piglit_width;
		int y = layer / piglit_width;
		float *color = colors[layer % ARRAY_SIZE(colors)];

		pass = pass &&
			piglit_probe_rect_rgba(x, y, 1, 1, color);
	}

	piglit_present_results();

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


示例10: piglit_display

enum piglit_result
piglit_display()
{
	bool pass;
	float vertex_array[] = {
		-1, -1,
		1, -1,
		1, 1,
		-1, 1,
	};
	float color_array[] = {
		0.5, 0.0, 0.5, 0.5,
		0.5, 1.0, 0.5, 0.5,
		0.5, 2.0, 0.5, 0.5,
		0.5, 3.0, 0.5, 0.5,
	};
	float green[] = {0, 1, 0, 0};

	glVertexPointer(2, GL_FLOAT, 0, vertex_array);
	glEnableClientState(GL_VERTEX_ARRAY);
	glColorPointer(4, GL_FLOAT, 0, color_array);
	glEnableClientState(GL_COLOR_ARRAY);
	glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
	glDisableClientState(GL_COLOR_ARRAY);
	glDisableClientState(GL_VERTEX_ARRAY);

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

	piglit_present_results();

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


示例11: piglit_display

PIGLIT_GL_TEST_CONFIG_END

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

    /* Clear red. */
    glClearColor(1.0, 0.0, 0.0, 0.0);
    glClear(GL_COLOR_BUFFER_BIT);

    /* Draw top half of screen green. */
    glColor4f(0.0, 1.0, 0.0, 0.0);
    piglit_draw_rect(-1, 0, 2, 1);

    /* Discard a copy over the bottom red over the top green. */
    glEnable(GL_RASTERIZER_DISCARD);
    glRasterPos2i(-1, 0);
    glCopyPixels(0, 0, piglit_width, piglit_height / 2, GL_COLOR);

    /* Don't discard a copy of the green over the remaining red. */
    glDisable(GL_RASTERIZER_DISCARD);
    glRasterPos2i(-1, -1);
    glCopyPixels(0, piglit_height / 2, piglit_width, piglit_height / 2,
                 GL_COLOR);

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

    piglit_present_results();

    return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:kphillisjr,项目名称:piglit,代码行数:33,代码来源:discard-copypixels.c


示例12: piglit_display

enum piglit_result
piglit_display()
{
	int i;
	bool pass = true;
	float expected[3][4] = {
		{0.0, 1.0, 0.0, 1.0}, /* green */
		{0.0, 0.0, 1.0, 1.0}, /* blue */
		{1.0, 1.0, 0.0, 1.0}}; /* yellow */

	glUseProgram(prog);

	for(i = 0; i < 3; i++) {
		glUniform1i(glGetUniformLocation(prog, "x"), i);

		/* Setup VertexAttribPointer for location=1. There should be
		 * only one active attribute pointer set to the shared location
		 * '1' at a time.
		 */
		glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 11*sizeof(float),
				      (void *) ((2 + 3*i) * sizeof(float)));

		glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, (void *) 0);
		pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height,
					      expected[i]) && pass;
		piglit_present_results();
	}
	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:chemecse,项目名称:piglit,代码行数:29,代码来源:overlapping-locations-input-attribs.c


示例13: draw

enum piglit_result
draw(Display *dpy)
{
	bool pass = true;
	float green[] = {0.0, 1.0, 0.0, 0.0};
	GLXContext ctx;

	ctx = piglit_get_glx_context(dpy, visinfo);
	glXMakeCurrent(dpy, win, ctx);
	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);

	/* Clear to green */
	glClearColor(0.0, 1.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT);

	/* Noop */
	glXSwapBuffers(dpy, win);

	/* We want to actually catch any X error that leaks through as
	 * a result of glXSwapBuffers() before we go saying "pass" or
	 * "fail".
	 */
	XSync(dpy, False);

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

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


示例14: piglit_display

enum piglit_result
piglit_display(void) {
	int i;
	int chunk_size = 24 * sizeof(float);
	bool pass = true;

	glClearColor(0.2, 0.2, 0.2, 0.2);
	glClear(GL_COLOR_BUFFER_BIT);

	for (i = 0; i < sizeof(data) / chunk_size; i++) {
		glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA32F,
				 tbo, i * chunk_size, chunk_size);
		glDrawArrays(GL_TRIANGLES, 0, 6);
	}

	for (i = 0; i < sizeof(data) / chunk_size; i++) {
		float c[4] = {
			data[i * 24 + 2],
			data[i * 24 + 3],
			0,
			1
		};

		pass = piglit_probe_rect_rgba(
			piglit_width * 0.5 * (1 + data[i * 24 + 0]),
			piglit_height * 0.5 * (1 + data[i * 24 + 1]),
			piglit_width/2,
			piglit_height/2, c) && pass;
	}

	piglit_present_results();

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


示例15: draw_check_pixels

/**
 * Helper  function to draw a quad and check the results for divX*divY areas
 * on the screen.
 */
static bool
draw_check_pixels(void)
{
	bool pass = true;
	int i, j;
	GLfloat w = (GLfloat) piglit_width / (GLfloat) divX;
	GLfloat h = (GLfloat) piglit_height / (GLfloat) divY;

	/* draw single quad, expanded to divX*divY quads via geometry shader */
	piglit_draw_rect(-1, -1, 2, 2);
	piglit_present_results();

	/* check rendering results: greyscale RGB == 1.0 / (index +1)*/
	for (i = 0; i < divX; i++) {
		for (j = 0; j < divY; j++) {
			GLfloat expected[4];
			int p;
			expected[0] =
			expected[1] =
			expected[2] = 1.0 / (GLfloat) (1 + j + i*divY);
			expected[3] = 1.0;
			p = piglit_probe_rect_rgba(i * w + 1, j * h + 1,
						   w-2, h-2, expected);
			if (!p) {
				printf("Wrong color for viewport i,j %d %d\n",
				       i, j);
				pass = false;
			}
		}
	}
	return pass;
}
开发者ID:rib,项目名称:piglit,代码行数:36,代码来源:render_scissor.c


示例16: piglit_init

void
piglit_init(int argc, char **argv)
{
	enum piglit_result result;
	GLuint render_program;
	int i;
	float green[4] = { 0.0, 1.0, 0.0, 1.0 };

	cs_ids_common_init();
	cs_ids_set_local_id_test();
	cs_ids_set_local_size(4, 4, 4);
	cs_ids_set_global_size(4, 4, 4);

	render_program =
		piglit_build_simple_program(passthrough_vs_src,
					    green_fs_src);
	glClearColor(0.0, 0.0, 0.0, 0.0);

	for (i = 0; i < 2; i++) {
		result = cs_ids_run_test();
		if (result != PIGLIT_PASS)
			piglit_report_result(result);

		glUseProgram(render_program);
		glClear(GL_COLOR_BUFFER_BIT);
		piglit_draw_rect(-1, -1, 2, 2);
		result = piglit_probe_rect_rgba(0, 0, piglit_width,
						piglit_height, green)
			? PIGLIT_PASS : PIGLIT_FAIL;
	}

	cs_ids_common_destroy();

	piglit_report_result(result);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:35,代码来源:render-and-compute.c


示例17: piglit_display

enum piglit_result
piglit_display()
{
	bool pass;
	float green[] = {0, 1, 0, 0};

	glBegin(GL_TRIANGLE_FAN);
		glColor4f(0.5, 0.0, 0.5, 0.5);
		glVertex2f(-1, -1);

		glColor4f(0.5, 1.0, 0.5, 0.5);
		glVertex2f(1, -1);

		glColor4f(0.5, 2.0, 0.5, 0.5);
		glVertex2f(1, 1);

		glColor4f(0.5, 3.0, 0.5, 0.5);
		glVertex2f(-1, 1);
	glEnd();

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

	piglit_present_results();

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


示例18: piglit_display

enum piglit_result
piglit_display(void)
{
   GLfloat expected[4] = { 0.0, 0.0, 1.0, 1.0 };

   glClear(GL_COLOR_BUFFER_BIT);

   glViewport(0, 0, piglit_width, piglit_height);

   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();

   glColor4f(0.0f, 0.0f, 1.0f, 1.0);
   glBegin(GL_QUADS);
      glVertex2f(-1.0f, -1.0f);
      glVertex2f( 1.0f, -1.0f);
      glVertex2f( 1.0f,  1.0f);
      glVertex2f(-1.0f,  1.0f);
   glEnd();

   glFlush();

   /* The test checks that the fill face of the quad is all blue without
    * noise artifacts
    */
   if (piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, expected))
      return PIGLIT_PASS;
   else
      return PIGLIT_FAIL;
}
开发者ID:chemecse,项目名称:piglit,代码行数:30,代码来源:polygon-line-aa.c


示例19: piglit_display

PIGLIT_GL_TEST_CONFIG_END

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	float green[4] = {0.0, 1.0, 0.0, 0.0};
	float vertex_data[] = {
		-0.5, -0.5,
		0.5, -0.5,
		0.0, 0.5,
		0.0, 0.0
	};

	glDisable(GL_RASTERIZER_DISCARD);
	glColor4f(0.0, 1.0, 0.0, 0.0);
	piglit_draw_rect(-1, -1, 2, 2);

	glEnable(GL_RASTERIZER_DISCARD);
	glColor4f(1.0, 0.0, 0.0, 0.0);
	piglit_draw_rect(-1, -1, 2, 2);
	glVertexPointer(2, GL_FLOAT, 0, vertex_data);
	glEnableClientState(GL_VERTEX_ARRAY);
	glDrawArrays(GL_LINE_LOOP, 0, 3);
	glDrawArrays(GL_POINTS, 3, 1);

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

	piglit_present_results();

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


示例20: piglit_display

enum piglit_result
piglit_display(void)
{
	int l, q;
	bool pass = true;
	float red[4]   = {1.0, 0.0, 0.0, 1.0};
	float green[4]   = {0.0, 1.0, 0.0, 1.0};
	float blue[4]  = {0.0, 0.0, 1.0, 1.0};
	float white[4]  = {1.0, 1.0, 1.0, 1.0};
	float undefined[4] = {0.0, 0.0, 0.0, 0.0};

	piglit_ortho_projection(piglit_width, piglit_height, false);

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

	/* TODO: test other wrap modes */	
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

	for (l = 0; (tex_size >> l) > 0; l++) {
		const int width = tex_size >> l;
		const int height = max(width / 2, 1);
		const int y = 10 + 20 * l;

		glUniform1f(lod_location, (float)l);

		/* Draw 4 squares with a color sample for each quad */
		for (q = 0; q < 4; q++) {
			const float tex_x = (q / 2) * 0.5f + 0.25f;
			const float tex_y = (q % 2) * 0.5f + 0.25f;
			float *c = undefined;
			const int x = 10+20*q;

			if (((q / 2) * 0.5f + 0.25f) * width + (-2.0f) < 0.5f * width) {
				if (((q % 2) * 0.5f + 0.25f) * height + (+2.0f) < 0.5f * height)
					c = red;
				else
					c = blue;
			}
			else {
				if (((q % 2) * 0.5f + 0.25f) * height + (+2.0f) < 0.5f * height)
					c = green;
				else
					c = white;
			}
				
			glUniform2f(pos_location, tex_x, tex_y);
			piglit_draw_rect(x, y, 10, 10);

			if (width > 2 && c != undefined) /* below 1 wide no test */
				pass &= piglit_probe_rect_rgba(x, y, 10, 10, c);
		}
	}

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:RAOF,项目名称:piglit,代码行数:59,代码来源:fs-textureOffset-2D.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ piglit_report_result函数代码示例发布时间:2022-05-30
下一篇:
C++ piglit_probe_pixel_rgb函数代码示例发布时间: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