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

C++ piglit_require_gl_version函数代码示例

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

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



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

示例1: require_GL_features

/**
 * Ensures the driver supports the required extensions, GL, and GLSL versions.
 * If it doesn't, report PIGLIT_SKIP and exit the test.
 */
void
require_GL_features(enum shader_target test_stage)
{
	int tex_units;

	piglit_require_GLSL_version(shader_version);

	if (swizzling)
		piglit_require_extension("GL_EXT_texture_swizzle");

	switch (sampler.internal_format) {
	case GL_RGBA32I:
	case GL_RGBA16I:
		piglit_require_extension("GL_EXT_texture_integer");
		break;
	case GL_RGBA32UI:
	case GL_RGBA16UI:
		if (piglit_is_extension_supported("GL_EXT_gpu_shader4"))
			piglit_require_gl_version(21);
		else
			piglit_require_gl_version(30);
		break;
	case GL_RGBA32F:
	case GL_RGBA16F:
		piglit_require_extension("GL_ARB_texture_float");
		break;
	}

	switch (sampler.target) {
	case GL_TEXTURE_CUBE_MAP_ARRAY:
		piglit_require_extension("GL_ARB_texture_cube_map_array");
		break;
	case GL_TEXTURE_1D_ARRAY:
	case GL_TEXTURE_2D_ARRAY:
		piglit_require_extension("GL_EXT_texture_array");
		break;
	case GL_TEXTURE_CUBE_MAP:
		if (is_shadow_sampler()) {
			if (piglit_is_extension_supported("GL_EXT_gpu_shader4"))
				piglit_require_gl_version(21);
			else
				piglit_require_gl_version(30);
		}
		break;
	case GL_TEXTURE_RECTANGLE:
		piglit_require_extension("GL_ARB_texture_rectangle");
		break;
	case GL_TEXTURE_BUFFER:
		piglit_require_extension("GL_ARB_texture_buffer_object");
		break;
	case GL_TEXTURE_2D_MULTISAMPLE:
	case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
		piglit_require_extension("GL_ARB_texture_multisample");
	}

	/* If testing in the VS, check for VS texture units */
	glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &tex_units);
	if (test_stage == VS && tex_units <= 0)
		piglit_report_result(PIGLIT_SKIP);
}
开发者ID:RAOF,项目名称:piglit,代码行数:64,代码来源:common.c


示例2: piglit_init

void piglit_init(int argc, char **argv)
{
	int a,i;

	piglit_require_gl_version(20);
	piglit_require_extension("GL_ARB_explicit_attrib_location");
	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	snorm_equation_23 = piglit_get_gl_version() >= 42;

	glClearColor(0.2, 0.2, 0.2, 1.0);

	for (a = 1; a < argc; a++) {
		for (i = 0; i < ARRAY_SIZE(test_sets); i++) {
			if (strcmp(argv[a], test_sets[i].name) == 0) {
				if (test_sets[i].gl_version)
					piglit_require_gl_version(test_sets[i].gl_version);
				if (test_sets[i].extension)
					piglit_require_extension(test_sets[i].extension);

				test_set = &test_sets[i];
				return;
			}
		}
	}
}
开发者ID:aphogat,项目名称:piglit,代码行数:26,代码来源:attribs.c


示例3: piglit_init

void
piglit_init(int argc, char **argv)
{
	piglit_require_gl_version(20);

	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
}
开发者ID:RAOF,项目名称:piglit,代码行数:7,代码来源:glsl-dlist-getattriblocation.c


示例4: piglit_init

void
piglit_init(int argc, char **argv)
{
	int num_samples;
	if (argc < 2)
		print_usage_and_exit(argv[0]);
	{
		char *endptr = NULL;
		num_samples = strtol(argv[1], &endptr, 0);
		if (endptr != argv[1] + strlen(argv[1]))
			print_usage_and_exit(argv[0]);
	}

	piglit_require_gl_version(30);
	glClear(GL_COLOR_BUFFER_BIT);

	/* Skip the test if num_samples > GL_MAX_SAMPLES */
	GLint max_samples;
	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
	if (num_samples > max_samples)
		piglit_report_result(PIGLIT_SKIP);

	buffer_to_test = GL_COLOR_BUFFER_BIT;
	test_pattern = new Lines();
	test_pattern->compile();

	test_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));

	glEnable (GL_BLEND);
	glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
}
开发者ID:blaztinn,项目名称:piglit,代码行数:31,代码来源:line-smooth.cpp


示例5: piglit_init

void piglit_init(int argc, char **argv)
{
	GLint vert[3];
	GLint prog_a;
	GLint prog_b;
	GLint prog_c;
	GLint prog_d;

	piglit_require_gl_version(20);

	vert[0] =
		piglit_compile_shader(GL_VERTEX_SHADER,
				      "shaders/glsl-link-initializer-01a.vert");
	vert[1] =
		piglit_compile_shader(GL_VERTEX_SHADER,
				      "shaders/glsl-link-initializer-01b.vert");
	vert[2] =
		piglit_compile_shader(GL_VERTEX_SHADER,
				      "shaders/glsl-link-initializer-01c.vert");
	prog_a = piglit_link_simple_program(vert[0], vert[1]);
	prog_b = piglit_link_simple_program(vert[1], vert[0]);
	prog_c = piglit_link_simple_program(vert[0], vert[2]);
	prog_d = piglit_link_simple_program(vert[2], vert[0]);

	/* piglit_link_simple_program() returns 0 on link failure.  So
	 * verify that there was no link failure by simply checking
	 * that two programs were returned.
	 */
	piglit_report_result((prog_a && prog_b && prog_c && prog_d)
			     ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:RAOF,项目名称:piglit,代码行数:31,代码来源:glsl-link-initializer-03.c


示例6: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLint max_attachments;

	printf("The result should be increasing lengths of rows of green\n"
	       "boxes as the test increases the number of drawbuffers \n"
	       "targets used.\n");

	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	piglit_require_gl_version(20);

	piglit_require_extension("GL_EXT_framebuffer_object");
	piglit_require_extension("GL_ARB_draw_buffers");

	glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_targets);
	if (max_targets < 2)
		piglit_report_result(PIGLIT_SKIP);

	glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_attachments);
	if (max_targets > max_attachments)
		max_targets = max_attachments;

	if (max_targets > 16)
		max_targets = 16;
}
开发者ID:ThirteenFish,项目名称:piglit,代码行数:27,代码来源:fbo-drawbuffers-fragcolor.c


示例7: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLubyte pixels[TEX_SIZE][TEX_SIZE][4];
	GLuint tex;
	int i, j;

	piglit_require_gl_version(13);

	/* solid red texture */
	for (i = 0; i < TEX_SIZE; i++) {
		for (j = 0; j < TEX_SIZE; j++) {
			pixels[i][j][0] = 255;
			pixels[i][j][1] = 0;
			pixels[i][j][2] = 0;
			pixels[i][j][3] = 255;
		}
	}

	glGenTextures(1, &tex);
	glBindTexture(GL_TEXTURE_3D, tex);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
	glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_BORDER);
	glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, green);

	glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, TEX_SIZE, TEX_SIZE, 1,
		     0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);

	glEnable(GL_TEXTURE_3D);
}
开发者ID:RAOF,项目名称:piglit,代码行数:33,代码来源:tex3d-depth1.c


示例8: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLuint id;

	piglit_require_gl_version(15);
	piglit_require_GLSL();
	piglit_require_extension("GL_EXT_transform_feedback");
	piglit_require_extension("GL_ARB_transform_feedback2");

	glGenTransformFeedbacks(1, &id);

	if (glIsTransformFeedback(id)) {
		fprintf(stderr, "id recognized incorrectly as a transform feedback object.\n");
		piglit_report_result(PIGLIT_FAIL);
	}

	glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, id);

	if (!glIsTransformFeedback(id)) {
		fprintf(stderr, "id not recognized correctly as a transform feedback object.\n");
		piglit_report_result(PIGLIT_FAIL);
	}

	piglit_report_result(PIGLIT_PASS);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:26,代码来源:istransformfeedback.c


示例9: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLboolean pass = GL_TRUE;
	GLint count;
	GLuint prog;
	GLenum err;

	piglit_require_gl_version(20);

	piglit_require_extension("GL_EXT_separate_shader_objects");

	prog = glCreateShaderProgramEXT(GL_VERTEX_SHADER, vs_text);

	err = glGetError();
	if (err != 0) {
		printf("Unexpected OpenGL error state 0x%04x for "
		       "glCreateShaderProgramEXT\n", err);
		pass = GL_FALSE;
	}

	count = -1;
	glGetProgramiv(prog, GL_ATTACHED_SHADERS, &count);
	if (count != 0) {
		printf("Expected attached shader count of 0, got %d.\n", count);
		pass = GL_FALSE;
	}

	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:RAOF,项目名称:piglit,代码行数:30,代码来源:createshaderprogram-attached-shaders.c


示例10: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLuint vs, fs;

	piglit_require_gl_version(20);

	vs = piglit_compile_shader(GL_VERTEX_SHADER,
				   "shaders/glsl-color-mvp.vert");
	fs = piglit_compile_shader(GL_FRAGMENT_SHADER,
				   "shaders/glsl-color.frag");

	prog = piglit_link_simple_program(vs, fs);

	glDeleteShader(vs);
	glDeleteShader(fs);

	/* Don't try to render if the program failed to link, and linking
	 * had better succeed!
	 */
	if (!piglit_link_check_status(prog))
		piglit_report_result(PIGLIT_FAIL);

	glUseProgram(prog);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:25,代码来源:glsl-fs-flat-color.c


示例11: piglit_init

void
piglit_init(int argc, char **argv)
{
	if (argc < 2)
		print_usage_and_exit(argv[0]);
	{
		char *endptr = NULL;
		num_samples = strtol(argv[1], &endptr, 0);
		if (endptr != argv[1] + strlen(argv[1]))
			print_usage_and_exit(argv[0]);
	}

	piglit_require_gl_version(30);
	piglit_ortho_projection(pattern_width, pattern_height, GL_TRUE);

	/* Skip the test if num_samples > GL_MAX_SAMPLES */
	GLint max_samples;
	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
	if (num_samples > max_samples)
		piglit_report_result(PIGLIT_SKIP);

	ms_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));
	resolve_fbo.setup(FboConfig(0, pattern_width, pattern_height));

	buffer_to_test = GL_COLOR_BUFFER_BIT;
	shader_compile();
	glEnable(GL_POLYGON_STIPPLE);
	glPolygonStipple(stipple_pattern);

}
开发者ID:blaztinn,项目名称:piglit,代码行数:30,代码来源:polygon-stipple.cpp


示例12: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLint ok;
	GLuint prog;
	GLuint vs;

	piglit_require_gl_version(20);

	vs = piglit_compile_shader_text(GL_VERTEX_SHADER, bad_vs_text);
	prog = glCreateProgram();
	glAttachShader(prog, vs);
	glLinkProgram(prog);
	glDeleteShader(vs);

	ok = piglit_link_check_status_quiet(prog);
	if (ok) {
		fprintf(stderr,
			"Linking with unresolved symbol succeeded when it "
			"should have failed.\n");
		piglit_report_result(PIGLIT_FAIL);
	}

	piglit_report_result(PIGLIT_PASS);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:25,代码来源:link-unresolved-function.c


示例13: piglit_init

PIGLIT_GL_TEST_CONFIG_END

void
piglit_init(int argc, char **argv)
{
	piglit_require_gl_version(14);
}
开发者ID:chadversary,项目名称:piglit,代码行数:7,代码来源:draw-batch.c


示例14: piglit_init

void
piglit_init(int argc, char *argv[])
{
	GLuint vs, gs, prog;

	piglit_require_gl_version(15);
	piglit_require_GLSL();

	do_query_init(queries, ARRAY_SIZE(queries));

	prog = glCreateProgram();

	vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_src);
	gs = piglit_compile_shader_text(GL_GEOMETRY_SHADER, gs_src);

#ifndef DISPLAY
	glEnable(GL_RASTERIZER_DISCARD);
#else
	glAttachShader(prog,
			piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_src));
#endif

	glAttachShader(prog, vs);
	glAttachShader(prog, gs);
	glLinkProgram(prog);

	if (!piglit_link_check_status(prog)) {
		glDeleteProgram(prog);
		piglit_report_result(PIGLIT_FAIL);
	}

	glUseProgram(prog);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:33,代码来源:pipeline_stats_geom.c


示例15: piglit_init

void piglit_init(int argc, char **argv)
{
	GLint vert;
	GLint prog;
	GLboolean ok;

	piglit_require_gl_version(20);

	piglit_require_extension("GL_ARB_explicit_attrib_location");

	vert = piglit_compile_shader(GL_VERTEX_SHADER,
				     "shaders/glsl-explicit-location-01.vert");
	prog = glCreateProgram();
	glAttachShader(prog, vert);
	glLinkProgram(prog);

	ok = piglit_link_check_status(prog);
	if (ok) {
		GLint loc = glGetAttribLocation(prog, "vertex");

		if (loc != 0) {
			fprintf(stderr,
				"Expected location of 'vertex' to be 0, got "
				"%d instead.\n", loc);
			ok = GL_FALSE;
		}

	}

	piglit_report_result(ok ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:31,代码来源:glsl-explicit-location-01.c


示例16: piglit_init

void
piglit_init(int argc, char **argv)
{
    GLuint buf;
    GLint vertex;

    piglit_require_gl_version(20);

    prog = piglit_build_simple_program(vs, fs);
    if (!prog) {
        printf("Failed to compile/link program\n");
        piglit_report_result(PIGLIT_FAIL);
    }

    glUseProgram(prog);

    attr = glGetAttribLocation(prog, "attr");
    vertex = glGetAttribLocation(prog, "vertex");

    glGenBuffers(1, &buf);
    glBindBuffer(GL_ARRAY_BUFFER, buf);
    glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW);
    glVertexAttribPointer(vertex,
                          2, GL_FLOAT, GL_FALSE, 0, 0);

    glEnableVertexAttribArray(vertex);
}
开发者ID:krnowak,项目名称:piglit,代码行数:27,代码来源:vertex-const-attr.c


示例17: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLboolean try_to_render;
	GLuint vs;
	GLuint fs;

	piglit_require_gl_version(20);

	piglit_require_extension("GL_EXT_separate_shader_objects");

	glClearColor(0.3, 0.3, 0.3, 0.0);
	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_text);
	fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_text);

	prog[0] = piglit_link_simple_program(vs, 0);
	prog[1] = piglit_link_simple_program(0,  fs);

	glDeleteShader(vs);
	glDeleteShader(fs);

	/* Don't try to render if either program failed to link, and linking
	 * had better succeed!
	 */
	try_to_render = piglit_link_check_status(prog[0]);
	try_to_render = piglit_link_check_status(prog[1])
		&& try_to_render;

	if (!try_to_render)
		piglit_report_result(PIGLIT_FAIL);
}
开发者ID:RAOF,项目名称:piglit,代码行数:33,代码来源:sso-user-varying-01.c


示例18: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLboolean try_to_render;

	piglit_require_gl_version(20);

	piglit_require_extension("GL_EXT_separate_shader_objects");

	glClearColor(0.3, 0.3, 0.3, 0.0);
	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	prog[0] = glCreateShaderProgramEXT(GL_VERTEX_SHADER, vs_text);
	prog[1] = glCreateShaderProgramEXT(GL_FRAGMENT_SHADER, fs_text);

	/* Don't try to render if either program failed to link.  The
	 * GL_EXT_separate_shader_obejcts spec is really vague about whether
	 * or not linking will fail here.
	 */
	printf("Checking link result for vertex shader...\n");
	try_to_render = piglit_link_check_status_quiet(prog[0]);

	printf("Checking link result for fragment shader...\n");
	try_to_render = piglit_link_check_status_quiet(prog[1])
		&& try_to_render;

	if (!try_to_render)
		piglit_report_result(PIGLIT_PASS);
}
开发者ID:RAOF,项目名称:piglit,代码行数:29,代码来源:sso-user-varying-02.c


示例19: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLint max_attachments;

	assert(ARRAY_SIZE(colors) == MAX_TARGETS);

	printf("Each row tests a different number of drawing buffers.\n");
	printf("Each column tests a different color for a different buffer.\n");

	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	piglit_require_gl_version(20);

	piglit_require_extension("GL_EXT_framebuffer_object");
	piglit_require_extension("GL_ARB_draw_buffers");

	glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_targets);
	printf("GL_MAX_DRAW_BUFFERS_ARB = %d\n", max_targets);

	if (max_targets < 2)
		piglit_report_result(PIGLIT_SKIP);
	if (max_targets > MAX_TARGETS) {
		printf("Warning: clamping GL_MAX_DRAW_BUFFERS to %d\n",
		       MAX_TARGETS);
		max_targets = MAX_TARGETS;
	}

	glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_attachments);
	printf("GL_MAX_COLOR_ATTACHMENTS_EXT = %d\n", max_attachments);
	if (max_targets > max_attachments)
		max_targets = max_attachments;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:33,代码来源:fbo-drawbuffers-maxtargets.c


示例20: piglit_init

void piglit_init(int argc, char **argv)
{
	bool pass = true;

	ObjectPtrLabel = GET_FUNC(glObjectPtrLabel);
	GetObjectPtrLabel = GET_FUNC(glGetObjectPtrLabel);
	ObjectLabel = GET_FUNC(glObjectLabel);
	GetObjectLabel = GET_FUNC(glGetObjectLabel);

#ifdef PIGLIT_USE_OPENGL
	piglit_require_gl_version(15);
#endif
	piglit_require_extension("GL_KHR_debug");

	pass = test_object_label_types() && pass;
	pass = test_object_label() && pass;
	pass = test_get_object_label() && pass;

	/* Test only if is GLES 3.0 or GL 3.2 or has ARB_sync */
	if ((piglit_is_gles() && piglit_get_gl_version() >= 30) ||
	    piglit_get_gl_version() >= 32 ||
	    piglit_is_extension_supported("GL_ARB_sync"))
		pass = test_object_ptr_label() && pass;

	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:ThirteenFish,项目名称:piglit,代码行数:26,代码来源:debug-object-label.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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