Пример #1
0
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);

}
Пример #2
0
void
piglit_init(int argc, char **argv)
{
    if (argc != 3)
        print_usage_and_exit(argv[0]);

    /* 1st arg: num_samples */
    char *endptr = NULL;
    int num_samples = strtol(argv[1], &endptr, 0);
    if (endptr != argv[1] + strlen(argv[1]))
        print_usage_and_exit(argv[0]);

    /* 2nd arg: flip_direction */
    if (strcmp(argv[2], "x") == 0) {
        srcX0 = pattern_width;
        srcX1 = 0;
        srcY0 = 0;
        srcY1 = pattern_height;
    } else if (strcmp(argv[2], "y") == 0) {
        srcX0 = 0;
        srcX1 = pattern_width;
        srcY0 = pattern_height;
        srcY1 = 0;
    } else {
        print_usage_and_exit(argv[0]);
    }

    piglit_require_gl_version(21);
    piglit_require_extension("GL_ARB_framebuffer_object");
    piglit_require_extension("GL_ARB_vertex_array_object");

    /* 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);

    singlesampled_fbo.setup(FboConfig(0,
                                      pattern_width,
                                      pattern_height));

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

    test_pattern = new Triangles();
    test_pattern->compile();

    if (!piglit_check_gl_error(GL_NO_ERROR)) {
        piglit_report_result(PIGLIT_FAIL);
    }
}
Пример #3
0
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);
}
Пример #4
0
void
piglit_init(int argc, char **argv)
{
    int num_samples;
    if (argc < 3)
        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(21);
    piglit_require_extension("GL_ARB_framebuffer_object");
    piglit_require_extension("GL_ARB_vertex_array_object");

    /* 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);

    if (strcmp(argv[2], "color") == 0) {
        test_pattern = new Triangles();
        buffer_to_test = GL_COLOR_BUFFER_BIT;
    } else if (strcmp(argv[2], "depth") == 0) {
        test_pattern = new DepthSunburst();
        manifest_program = new ManifestDepth();
        buffer_to_test = GL_DEPTH_BUFFER_BIT;
    } else if (strcmp(argv[2], "stencil") == 0) {
        test_pattern = new StencilSunburst();
        manifest_program = new ManifestStencil();
        buffer_to_test = GL_STENCIL_BUFFER_BIT;
    } else {
        print_usage_and_exit(argv[0]);
    }
    test_pattern->compile();
    if (manifest_program)
        manifest_program->compile();

    multisample_fbo.setup(FboConfig(num_samples, pattern_width,
                                    pattern_height));
}