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


C++ piglit_report_subtest_result函数代码示例

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


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

示例1: piglit_display

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

	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);

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

	glEnable(GL_LINE_STIPPLE);

	glPushMatrix();
	glTranslatef(basex, basey, 0.0);

	for (i = 0; i < ARRAY_SIZE(Lines); ++i) {
		printf("Testing %s:\n", Lines[i].name);
		if (test_line(&Lines[i])) {
			piglit_report_subtest_result(PIGLIT_PASS, "%s", Lines[i].name);
		} else {
			piglit_report_subtest_result(PIGLIT_FAIL, "%s", Lines[i].name);
			pass = false;
		}
	}
	glPopMatrix();

	piglit_present_results();

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

示例2: test_subroutine_stages_vs_fs_gs

/* Test subroutine uniform location query with vs, fs and gs. */
static bool
test_subroutine_stages_vs_fs_gs()
{
	GLuint prog, i;

	if (!piglit_is_extension_supported("GL_ARB_shader_subroutine")) {
		piglit_report_subtest_result(PIGLIT_SKIP, __func__);
		return true;
	}

        prog = piglit_build_simple_program_multiple_shaders(
                     GL_VERTEX_SHADER, vs_subroutine_text,
                     GL_GEOMETRY_SHADER, gs_subroutine_text,
                     GL_FRAGMENT_SHADER, fs_subroutine_text,
                     0);

	glUseProgram(prog);

	/* Iterate through all valid subroutine enums passing invalid name. */
	for (i = 0; i < (sizeof(valid_enums_sub)/sizeof(GLenum)); i++) {
		glGetProgramResourceLocation(prog, valid_enums_sub[i], "name");
			if (!piglit_check_gl_error(GL_NO_ERROR))
				piglit_report_result(PIGLIT_FAIL);
	}

	CHECK_SUB(VERTEX);
	CHECK_SUB(FRAGMENT);
	CHECK_SUB(GEOMETRY);

	piglit_report_subtest_result(PIGLIT_PASS, __func__);
	return true;
}
开发者ID:Jul13t,项目名称:piglit,代码行数:33,代码来源:resource-location.c

示例3: piglit_display

enum piglit_result
piglit_display(void)
{
	bool pass = true;
	float buffer[2 +
		     ARRAY_SIZE(vertex_array) +
		     ARRAY_SIZE(color_array) +
		     ARRAY_SIZE(texcoord_array)];
	int i, j;

	piglit_ortho_projection(piglit_width, piglit_height, false);

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

	glVertexPointer(4, GL_FLOAT, 0, vertex_array);
	glColorPointer(4, GL_FLOAT, 0, color_array);
	glTexCoordPointer(4, GL_FLOAT, 0, texcoord_array);
	glEnableClientState(GL_VERTEX_ARRAY);
	glEnableClientState(GL_COLOR_ARRAY);
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);

	for (i = 0; i < ARRAY_SIZE(types); i++) {
		bool case_pass = true;
		int returned_count;

		printf("Testing %s\n", types[i].name);

		for (j = 0; j < ARRAY_SIZE(buffer); j++)
			buffer[j] = -1.0;

		glFeedbackBuffer(ARRAY_SIZE(buffer), types[i].type, buffer);
		glRenderMode(GL_FEEDBACK);
		glDrawArrays(GL_TRIANGLES, 0, 4);
		returned_count = glRenderMode(GL_RENDER);

		if (returned_count != types[i].count) {
			case_pass = false;
		} else {
			for (j = 0; j < types[i].count; j++) {
				if (fabs(buffer[j] - types[i].values[j]) > .01)
					case_pass = false;
			}
		}

		if (!case_pass) {
			pass = false;
			report_failure(&types[i], buffer, returned_count);
			piglit_report_subtest_result(PIGLIT_FAIL,
						     types[i].name);
		} else {
			piglit_report_subtest_result(PIGLIT_PASS,
						     types[i].name);
		}
	}

	piglit_present_results();

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

示例4: test_subroutine_stages_compute

/* Test subroutine uniform location query with compute. */
static bool
test_subroutine_stages_compute()
{
	GLuint prog, i;

	if (!piglit_is_extension_supported("GL_ARB_shader_subroutine")) {
		piglit_report_subtest_result(PIGLIT_SKIP, __func__);
		return true;
	}

	if (!piglit_is_extension_supported("GL_ARB_compute_shader")) {
		piglit_report_subtest_result(PIGLIT_SKIP, __func__);
		return true;
	}

        prog = piglit_build_simple_program_multiple_shaders(
                     GL_COMPUTE_SHADER, compute_subroutine_text,
                     0);

	glUseProgram(prog);

	/* Iterate through all valid subroutine enums passing invalid name. */
	for (i = 0; i < (sizeof(valid_enums_sub_com)/sizeof(GLenum)); i++) {
		glGetProgramResourceLocation(prog, valid_enums_sub_com[i],
                                             "name");
			if (!piglit_check_gl_error(GL_NO_ERROR))
				piglit_report_result(PIGLIT_FAIL);
	}

	CHECK_SUB(COMPUTE);

	piglit_report_subtest_result(PIGLIT_PASS, __func__);
	return true;
}
开发者ID:Jul13t,项目名称:piglit,代码行数:35,代码来源:resource-location.c

示例5: piglit_display

enum piglit_result
piglit_display(void)
{
	GLboolean pass = GL_TRUE;
	size_t n;
	int layer;

	glViewport(0, 0, piglit_width, piglit_height);
	glClearColor(0.0, 0.0, 1.0, 1.0);

	for (n = 0; n < ARRAY_SIZE(testparams); n++) {
		GLboolean subtest_pass = GL_TRUE;
		for (layer = 0; layer < testparams[n].num_layers; layer++) {
			glClear(GL_COLOR_BUFFER_BIT);

			subtest_pass &= test_single_layer(&testparams[n], layer);
		}
		piglit_report_subtest_result(subtest_pass ? PIGLIT_PASS : PIGLIT_FAIL,
			"%s", testparams[n].desc);
		pass &= subtest_pass;
	}

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:chemecse,项目名称:piglit,代码行数:26,代码来源:sampling-2d-array-as-2d-layer.c

示例6: test_pname

static bool
test_pname(void)
{
	GLuint name;
	const static GLfloat f = 1.0;
	const static GLuint u = 1;
	const static GLint i = -5;
	bool pass = true;

	/* Setup dsa. */
	glCreateTextures(GL_TEXTURE_2D, 1, &name);
	glBindTextureUnit(0, name);	/* Since next command isn't bindless. */

	glTextureParameterfv(name, GL_TEXTURE_1D, &f);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	glTextureParameteriv(name, GL_TEXTURE_1D, &i);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	glTextureParameterIiv(name, GL_TEXTURE_1D, &i);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	glTextureParameterIuiv(name, GL_TEXTURE_1D, &u);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
				     "glTextureParameter: GL_INVALID_ENUM on "
				     "bad pname");
	return pass;
}
开发者ID:krnowak,项目名称:piglit,代码行数:30,代码来源:texture-errors.c

示例7: test_getter_target_name

/* same as test_target_name, but for the getter functions */
static bool
test_getter_target_name(void)
{
	static const GLuint badname = 250;
	GLfloat f;
	GLuint u;
	GLint i;
	bool pass = true;

	glGetTextureParameterfv(badname, GL_TEXTURE_MAX_LEVEL, &f);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	glGetTextureParameteriv(badname, GL_TEXTURE_MAX_LEVEL, &i);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	glGetTextureParameterIiv(badname, GL_TEXTURE_MAX_LEVEL, &i);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	glGetTextureParameterIuiv(badname, GL_TEXTURE_MAX_LEVEL, &u);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
				     "glGetTextureParameter: "
				     "GL_INVALID_OPERATION on bad texture");
	return pass;
}
开发者ID:krnowak,项目名称:piglit,代码行数:27,代码来源:texture-errors.c

示例8: test_target_name

/*
 * The texture parameter must be an existing texture object as returned
 * by glCreateTextures
 */
static bool
test_target_name(void)
{
	static const GLuint badname = 250;
	static const GLfloat fvec[2] = { 1.0, 1.0 };
	static const GLint ivec[2] = { -1, 1 };
	static const GLuint uvec[2] = { 1, 1 };
	bool pass = true;

	glTextureParameteri(badname, GL_TEXTURE_MAX_LEVEL, 4);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	glTextureParameterf(badname, GL_TEXTURE_MAX_LEVEL, 4.0);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	glTextureParameterfv(badname, GL_TEXTURE_MAX_LEVEL, fvec);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	glTextureParameteriv(badname, GL_TEXTURE_MAX_LEVEL, ivec);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	glTextureParameterIiv(badname, GL_TEXTURE_MAX_LEVEL, ivec);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	glTextureParameterIuiv(badname, GL_TEXTURE_MAX_LEVEL, uvec);
	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;

	piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
				     "glTextureParameter: GL_INVALID_OPERATION "
				     "on bad texture");
	return pass;
}
开发者ID:krnowak,项目名称:piglit,代码行数:36,代码来源:texture-errors.c

示例9: check_textures_type

static bool
check_textures_type(void)
{
        bool check_pass = true;
        test_data *data = test_data_new(0, 1);
        unsigned i;
        int testing64;

        for (i = 0; i < ARRAY_SIZE(pnames); i++) {
                bool pass = true;

                for (testing64 = 0; testing64 <= 1; testing64++) {
                        test_data_set_testing64(data, testing64);

                        pass = try_textures_type(texture_targets, ARRAY_SIZE(texture_targets),
                                                 valid_internalformats, ARRAY_SIZE(valid_internalformats),
                                                 pnames[i], equivalent_pnames[i],
                                                 data)
                                && pass;
                }
                piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
                                             "%s", piglit_get_gl_enum_name(pnames[i]));

                check_pass = check_pass && pass;
        }

        test_data_clear(&data);

        return check_pass;
}
开发者ID:fabe3k,项目名称:piglit,代码行数:30,代码来源:internalformat-type-checks.c

示例10: test_texture_rec

/* GL_INVALID_ENUM is generated if the effective target is GL_TEXTURE_RECTANGLE
 * and either of pnames GL_TEXTURE_WRAP_S or GL_TEXTURE_WRAP_T is set to either
 * GL_MIRROR_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT or GL_REPEAT.
 */
static bool
test_texture_rec(void)
{
	bool pass = true;
	GLuint name;

	/* GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
	glCreateTextures(GL_TEXTURE_RECTANGLE, 1, &name);
	glBindTextureUnit(0, name);	/* Since next command isn't bindless. */

	glTextureParameteri(name, GL_TEXTURE_WRAP_S, GL_MIRROR_CLAMP_TO_EDGE);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	glTextureParameteri(name, GL_TEXTURE_WRAP_T, GL_MIRROR_CLAMP_TO_EDGE);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	glTextureParameteri(name, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	glTextureParameteri(name, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	glTextureParameteri(name, GL_TEXTURE_WRAP_S, GL_REPEAT);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	glTextureParameteri(name, GL_TEXTURE_WRAP_T, GL_REPEAT);
	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;

	piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
				     "glTextureParameter: GL_INVALID_ENUM in "
				     "texture_rectangle case");
	return pass;
}
开发者ID:krnowak,项目名称:piglit,代码行数:37,代码来源:texture-errors.c

示例11: verify_contents

static bool
verify_contents(const struct fmt_test *test)
{
	bool result = true;
	unsigned amount = piglit_width * piglit_height;
	void *pix = malloc(amount * 4);
	glReadPixels(0, 0, piglit_width, piglit_height, GL_RGBA, GL_BYTE, pix);

	char value[4] = { 0, 0, 0, SCHAR_MAX };
	value_for_format(test, value);

	char *p = pix;
	for (unsigned i = 0; i < amount; i++, p += 4) {
		if (memcmp(p, value, sizeof(value)) == 0)
			continue;

                fprintf(stderr, "value:\n%d % d %d %d\nexpect:\n%d %d %d %d",
                        p[0], p[1], p[2], p[3],
                        value[0], value[1], value[2], value[3]);

		piglit_report_subtest_result(PIGLIT_FAIL,
					     "format 0x%x read fail",
					     test->iformat);
		result = false;
		break;
	}

	free(pix);
	return result;
}
开发者ID:dumbbell,项目名称:piglit,代码行数:30,代码来源:render.c

示例12: piglit_display

enum piglit_result
piglit_display(void)
{
	glEnableVertexAttribArray(0);
	glEnableVertexAttribArray(1);

	glActiveTexture(GL_TEXTURE0);

	glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float),
			      vertex_data);
	glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float),
			      (void*) (vertex_data + (2 * sizeof(float))));

	bool pass = true;

	const struct fmt_test *test = tests;

	/* Loop over each format. */
	for (unsigned i = 0; i < ARRAY_SIZE(tests); i++, test++) {
		bool fmt_pass = test_format(test);
		piglit_report_subtest_result(PIGLIT_RESULT(fmt_pass),
					     "format 0x%x",
					     test->iformat);
		pass &= fmt_pass;
	}

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

	return PIGLIT_RESULT(pass);
}
开发者ID:dumbbell,项目名称:piglit,代码行数:31,代码来源:render.c

示例13: piglit_init

void
piglit_init(int argc, char **argv)
{
	bool test1;
	bool test2;

	test1 = run_subtest(gs_tmpl, varyings, ARRAY_SIZE(varyings));
	piglit_report_subtest_result(test1 ? PIGLIT_PASS : PIGLIT_FAIL,
				     "arb_gpu_shader5-xfb-streams");

	test2 = run_subtest(gs_tmpl_blocks, varyings_blocks,
			    ARRAY_SIZE(varyings_blocks));
	piglit_report_subtest_result(test2 ? PIGLIT_PASS : PIGLIT_FAIL,
				     "arb_gpu_shader5-xfb-streams-blocks");

	piglit_report_result(test1 && test2 ? PIGLIT_PASS : PIGLIT_FAIL);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:17,代码来源:xfb-streams.c

示例14: validate_pipe

static void
validate_pipe(GLuint pipe, bool expected, const char *test_name)
{
	GLint status;

	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;

	status = piglit_program_pipeline_check_status_quiet(pipe);

	if (status != expected) {
		fprintf(stderr,
			"Wrong pipeline validation status. Got %d, but "
			"expected %d\n",
			status, expected);
		piglit_report_subtest_result(PIGLIT_FAIL, "%s", test_name);
		pass = false;
	} else {
		piglit_report_subtest_result(PIGLIT_PASS, "%s", test_name);
	}
}
开发者ID:RAOF,项目名称:piglit,代码行数:20,代码来源:ValidateProgramPipeline.c

示例15: test_copy_image

static bool
test_copy_image(const struct fmt_test *test, GLuint src, GLuint *texture)
{
	bool result = true;
	GLuint tex = create_texture(test);
	*texture = tex;
	glCopyImageSubData(src, GL_TEXTURE_2D, 0, 0, 0, 0, tex, GL_TEXTURE_2D,
			   0, 0, 0, 0, piglit_width, piglit_height, 0);

	if (!piglit_check_gl_error(GL_NO_ERROR)) {
		piglit_report_subtest_result(PIGLIT_FAIL,
					     "format 0x%x copyimage fail",
					     test->iformat);
		result = false;
	}
	return result;
}
开发者ID:dumbbell,项目名称:piglit,代码行数:17,代码来源:render.c


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