当前位置: 首页>>代码示例>>C++>>正文


C++ piglit_get_gl_version函数代码示例

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


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

示例1: 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

示例2: piglit_init

void
piglit_init(int argc, char **argv)
{
	int vuniforms = 0, vblocks = 0;
	int guniforms = 0, gblocks = 0;
	int funiforms = 0, fblocks = 0;
	int blocksize = 0;
	bool gs = piglit_is_extension_supported("GL_ARB_geometry_shader4");

	piglit_require_extension("GL_ARB_uniform_buffer_object");

	piglit_print_minmax_header();

	piglit_test_min_int(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, 1024);

	piglit_test_min_int(GL_MAX_VERTEX_UNIFORM_BLOCKS, 12);
	piglit_test_min_int(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, 12);
	if (gs)
		piglit_test_min_int(GL_MAX_GEOMETRY_UNIFORM_BLOCKS, 12);

	piglit_test_min_int(GL_MAX_COMBINED_UNIFORM_BLOCKS, gs ? 36 : 24);
	piglit_test_min_int(GL_MAX_UNIFORM_BUFFER_BINDINGS, gs ? 36 : 24);
	piglit_test_min_int(GL_MAX_UNIFORM_BLOCK_SIZE, 16384);

	/* Minimum value for OpenGL 3.1 is
	 * (MAX_<stage>_UNIFORM_BLOCKS * MAX_UNIFORM_BLOCK_SIZE) +
	 * MAX_<stage>_UNIFORM_COMPONENTS. Minimum value prior to
	 * OpenGL 3.1 is MAX_<stage>_UNIFORM_COMPONENTS.
	 */
	if (piglit_get_gl_version() >= 31) {
		glGetIntegerv(GL_MAX_VERTEX_UNIFORM_BLOCKS, &vblocks);
		glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, &fblocks);
	}
	glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, &vuniforms);
	glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &funiforms);
	glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &blocksize);
	piglit_test_min_int(GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,
			 vblocks * blocksize + vuniforms);
	piglit_test_min_int(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,
			 fblocks * blocksize + funiforms);
	if (gs) {
		if (piglit_get_gl_version() >= 31) {
			glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_BLOCKS, &gblocks);
		}
		glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, &guniforms);

		piglit_test_min_int(GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS,
				    gblocks * blocksize + guniforms);
	}

	piglit_test_min_int(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, 1);

	if (!piglit_check_gl_error(GL_NO_ERROR))
		piglit_report_result(PIGLIT_FAIL);

	piglit_report_result(piglit_minmax_pass ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:blaztinn,项目名称:piglit,代码行数:57,代码来源:minmax.c

示例3: piglit_init

void
piglit_init(int argc, char **argv)
{
	if (!piglit_is_extension_supported("GL_ATI_separate_stencil") && piglit_get_gl_version() < 20) {
		printf("Sorry, this program requires either "
		       "GL_ATI_separate_stencil or OpenGL 2.0.\n");
		piglit_report_result(PIGLIT_SKIP);
	}

	if (piglit_get_gl_version() < 20) {
		use20syntax = 0;
	}

	printf("\nAll 5 (or 6) squares should be the same color.\n");
}
开发者ID:nobled,项目名称:piglit,代码行数:15,代码来源:stencil-twoside.c

示例4: supported_target

static bool
supported_target(unsigned i)
{
	/* Array targets are only supported if GLSL is available.
	 */
	if ((target[i].target == GL_TEXTURE_1D_ARRAY
	     || target[i].target == GL_TEXTURE_2D_ARRAY)
	    && (piglit_get_gl_version() < 20
		&& !piglit_is_extension_supported("GL_ARB_fragment_shader")))
		return false;

	return piglit_get_gl_version() >= target[i].gl_version ||
		(target[i].extension &&
		 piglit_is_extension_supported(target[i].extension));
}
开发者ID:aphogat,项目名称:piglit,代码行数:15,代码来源:copyteximage.c

示例5: piglit_init

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

	if (piglit_get_gl_version() < 20) {
		printf("Requires OpenGL 2.0\n");
		piglit_report_result(PIGLIT_SKIP);
	}

	piglit_require_extension("GL_ARB_explicit_attrib_location");

	vert[0] =
		piglit_compile_shader(GL_VERTEX_SHADER,
				      "shaders/glsl-explicit-location-03a.vert");
	vert[1] =
		piglit_compile_shader(GL_VERTEX_SHADER,
				      "shaders/glsl-explicit-location-03b.vert");
	prog = glCreateProgram();
	glAttachShader(prog, vert[0]);
	glAttachShader(prog, vert[1]);
	glLinkProgram(prog);

	ok = piglit_link_check_status_quiet(prog);
	if (ok)
		fprintf(stderr,
			"Linking with conflicting explicit locations "
			"succeeded when it should have failed.\n");

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

示例6: piglit_init

void piglit_init(int argc, char **argv)
{
    if (piglit_get_gl_version() < 20) {
        printf("Requires OpenGL 2.0\n");
        piglit_report_result(PIGLIT_SKIP);
    }
}
开发者ID:blaztinn,项目名称:piglit,代码行数:7,代码来源:glsl-sin.c

示例7: piglit_init

PIGLIT_GL_TEST_CONFIG_END

void
piglit_init(int argc, char **argv)
{
    bool pass = true;
    GLuint textures[3];

    if(piglit_get_gl_version() < 32) {
        piglit_require_extension("GL_ARB_texture_multisample");
    }

    glGenTextures(3, textures);

    /* Pass a Texture 2D Multisample */
    glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textures[0]);
    glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGB,
                            1024, 1024, GL_FALSE);
    pass = piglit_check_gl_error(GL_NO_ERROR) && pass;

    /* Pass a Proxy Texture 2d Multisample */
    glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textures[1]);
    glTexImage2DMultisample(GL_PROXY_TEXTURE_2D_MULTISAMPLE, 4, GL_RGB,
                            1024, 1024, GL_FALSE);
    pass = piglit_check_gl_error(GL_NO_ERROR) && pass;

    /* Pass an Invalid Enum */
    glBindTexture(GL_TEXTURE_2D, textures[2]);
    glTexImage2DMultisample(GL_TEXTURE_2D, 4, GL_RGB,
                            1024, 1024, GL_FALSE);
    pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

    piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:janesma,项目名称:piglit,代码行数:34,代码来源:teximage-2d-multisample.c

示例8: piglit_init

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

	if (piglit_get_gl_version() < 32) {
		piglit_require_extension("GL_ARB_sync");
	}

	valid_sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);

	/* test that valid parameters passed results in NO_ERROR */
	glWaitSync(valid_sync, 0, GL_TIMEOUT_IGNORED);
	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;

	/* test that invalid sync results in INVALID_VALUE */
	glWaitSync(invalid_sync, 0, GL_TIMEOUT_IGNORED);
	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;

	/* test that invalid flag value results in INVALID_VALUE */
	glWaitSync(valid_sync, 3, GL_TIMEOUT_IGNORED);
	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;

	glDeleteSync(valid_sync);

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

示例9: piglit_init

void
piglit_init(int argc, char **argv)
{
	GLint ok;
	GLuint prog;
	GLuint fs[2];

	if (piglit_get_gl_version() < 20) {
		printf("Requires OpenGL 2.0\n");
		piglit_report_result(PIGLIT_SKIP);
	}

	piglit_require_extension("GL_AMD_conservative_depth");

	fs[0] = piglit_compile_shader_text(GL_FRAGMENT_SHADER, layout_greater);
	fs[1] = piglit_compile_shader_text(GL_FRAGMENT_SHADER, layout_less);
	prog = glCreateProgram();
	glAttachShader(prog, fs[0]);
	glAttachShader(prog, fs[1]);
	glLinkProgram(prog);
	glDeleteShader(fs[0]);
	glDeleteShader(fs[1]);

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

	piglit_report_result(PIGLIT_PASS);
}
开发者ID:nobled,项目名称:piglit,代码行数:33,代码来源:link-mismatch-layout-02.c

示例10: piglit_init

void
piglit_init(int argc, char **argv)
{
   Have_NV = piglit_is_extension_supported("GL_NV_primitive_restart");
   Have_31 = piglit_get_gl_version() >= 31;

   if (argc >= 2) {
      VBO_CFG vbo_cfg;
      for (vbo_cfg = 0; vbo_cfg < ARRAY_SIZE(vbo_cfg_names); vbo_cfg++) {
         if (strcmp(argv[1], vbo_cfg_names[vbo_cfg]) == 0) {
            vbo_init_cfg = vbo_cfg;
            break;
         }
      }
   }

   /* Debug */
   /* NOTE!  glew 1.5.2's OpenGL 3.1 detection is broken.  You'll need
    * to upgrade to a newer version if you want to test the GL 3.1
    * primitive restart feature!
    */
   if (0) {
      printf("Have NV: %d\n", Have_NV);
      printf("Have 31: %d\n", Have_31);
   }

   if (!Have_NV && !Have_31) {
      piglit_report_result(PIGLIT_SKIP);
      exit(1);
   }

   glClearColor(0, 0, 0, 0);
}
开发者ID:blaztinn,项目名称:piglit,代码行数:33,代码来源:primitive-restart.c

示例11: piglit_init

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

	if (piglit_get_gl_version() < 20) {
		printf("Requires OpenGL 2.0\n");
		piglit_report_result(PIGLIT_SKIP);
	}

	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:nobled,项目名称:piglit,代码行数:28,代码来源:glsl-fs-flat-color.c

示例12: piglit_init

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

	/* Parse params */
	if (argc != 2)
		print_usage_and_exit(argv[0]);
	for (i = 0; i < ARRAY_SIZE(tests); i++) {
		if (strcmp(argv[1], tests[i].name) == 0) {
			test = &tests[i];
			break;
		}
	}
	if (test == NULL)
		print_usage_and_exit(argv[0]);

	piglit_require_GLSL_version(110);
	if (!piglit_is_extension_supported("GL_NV_primitive_restart") &&
	    piglit_get_gl_version() < 31) {
		printf("GL_NV_primitive_restart or GL 3.1 required\n");
		piglit_report_result(PIGLIT_SKIP);
	}

	vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_text);
	prog = piglit_link_simple_program(vs, 0);
	if (!prog)
		piglit_report_result(PIGLIT_FAIL);
	glDeleteShader(vs);
	vertex_attr = glGetAttribLocation(prog, "vertex");
	window_size_loc = glGetUniformLocation(prog, "window_size");
	offset_loc = glGetUniformLocation(prog, "offset");
	color_loc = glGetUniformLocation(prog, "color");
}
开发者ID:ThirteenFish,项目名称:piglit,代码行数:35,代码来源:primitive-restart-draw-mode.c

示例13: piglit_init

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

	if (piglit_get_gl_version() < 20) {
		printf("Requires OpenGL 2.0\n");
		piglit_report_result(PIGLIT_SKIP);
	}

	piglit_require_extension("GL_EXT_framebuffer_object");

	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 (!prog) {
		piglit_report_result(PIGLIT_SKIP);
	}

	color_location = glGetUniformLocation(prog, "color");
	if (color_location == -1) {
		fprintf(stderr, "Failed to get uniform location");
		piglit_report_result(PIGLIT_FAIL);
	}
}
开发者ID:blaztinn,项目名称:piglit,代码行数:25,代码来源:fbo-alphatest-nocolor.c

示例14: piglit_init

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

	/* Set up projection matrix so we can just draw using window
	 * coordinates.
	 */
	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

	if (piglit_get_gl_version() < 20) {
		printf("Requires OpenGL 2.0\n");
		piglit_report_result(PIGLIT_SKIP);
	}

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

	prog = piglit_link_simple_program(vs, fs);

	glUseProgram(prog);

	color_location = glGetUniformLocation(prog, "color");
}
开发者ID:nobled,项目名称:piglit,代码行数:26,代码来源:glsl-fs-loop-nested.c

示例15: piglit_init

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

	piglit_require_extension("GL_ARB_texture_storage");
	piglit_require_extension("GL_ARB_texture_view");
	piglit_require_extension("GL_EXT_texture_integer");
	piglit_require_extension("GL_ARB_texture_float");
	if (piglit_get_gl_version() < 31)
	    piglit_require_extension("GL_ARB_texture_cube_map");

	X(test_format_errors(GL_VIEW_CLASS_128_BITS), "Format 128 bits validity");
	X(test_format_errors(GL_VIEW_CLASS_96_BITS), "Format 96 bits validity");
	X(test_format_errors(GL_VIEW_CLASS_64_BITS), "Format 64 bits validity");
	X(test_format_errors(GL_VIEW_CLASS_48_BITS), "Format 48 bits validity");
	X(test_format_errors(GL_VIEW_CLASS_32_BITS), "Format 32 bits validity");
	X(test_format_errors(GL_VIEW_CLASS_24_BITS), "Format 24 bits validity");
	X(test_format_errors(GL_VIEW_CLASS_16_BITS), "Format 16 bits validity");
	X(test_format_errors(GL_VIEW_CLASS_8_BITS), "Format 8 bits validity");
	X(test_format_errors(VIEW_CLASS_NOT_IN_TABLE), "Format misc validity");
#undef X
	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);

}
开发者ID:freedesktop-unofficial-mirror,项目名称:piglit-test,代码行数:26,代码来源:formats.c


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