Пример #1
0
int main(int argc, char **argv)
{
	static const int bad_attributes[] = {
		0xffff0000,
		GLX_SAMPLE_BUFFERS
	};
	bool pass = true;
	unsigned i;

	GLX_ARB_create_context_setup();

	for (i = 0; i < ARRAY_SIZE(bad_attributes); i++) {
		pass = try_attribute(bad_attributes[i]) && pass;
	}

	/* The GLX_ARB_create_context spec says:
	 *
	 *     "If GLX_ARB_create_context_profile is not supported, then the
	 *     GLX_CONTEXT_PROFILE_MASK_ARB attribute [is] not defined, and
	 *     specifying the attribute in <attribList> attribute will
	 *     generate BadValue."
	 */
	if (!piglit_is_glx_extension_supported(dpy, "GLX_ARB_create_context_profile")) {
		pass = try_attribute(GLX_CONTEXT_PROFILE_MASK_ARB)
			&& pass;
	}

	GLX_ARB_create_context_teardown();

	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
	return 0;
}
Пример #2
0
void
piglit_require_glx_extension(Display *dpy, const char *name)
{
	if (!piglit_is_glx_extension_supported(dpy, name)) {
		fprintf(stderr, "Test requires %s\n", name);
		piglit_report_result(PIGLIT_SKIP);
	}
}
Пример #3
0
int main(int argc, char **argv)
{
	bool pass = true;
	GLXContext ctx;

	GLX_EXT_import_context_setup();

	/* Try the simple stuff.
	 */
	pass = try_query(indirectCtx,
			 GLX_SHARE_CONTEXT_EXT, "GLX_SHARE_CONTEXT_EXT",
			 Success, 0)
		&& pass;
	pass = try_query(indirectCtx,
			 GLX_SCREEN_EXT, "GLX_SCREEN_EXT",
			 Success, DefaultScreen(dpy))
		&& pass;
	pass = try_query(indirectCtx,
			 GLX_VISUAL_ID_EXT, "GLX_VISUAL_ID_EXT",
			 Success, visinfo->visualid)
		&& pass;
	pass = try_query(indirectCtx,
			 0xffff0000, "0xffff0000 (invalid)",
			 GLX_BAD_ATTRIBUTE, 0)
		&& pass;

	/* Create a second indirect-rendering context, and have it share the
	 * first indirect-rendering context.  The XID of the share conext for
	 * the original context should be unchanged.
	 */
	ctx = glXCreateContext(dpy, visinfo, indirectCtx, False);
	assert(ctx != NULL);

	pass = try_query(indirectCtx,
			 GLX_SHARE_CONTEXT_EXT, "GLX_SHARE_CONTEXT_EXT",
			 Success, 0)
		&& pass;
	pass = try_query(ctx,
			 GLX_SHARE_CONTEXT_EXT, "GLX_SHARE_CONTEXT_EXT",
			 Success, glXGetContextIDEXT(indirectCtx))
		&& pass;

	if (piglit_is_glx_extension_supported(dpy, "GLX_SGIX_fbconfig")) {
		pass = try_query(indirectCtx,
				 GLX_FBCONFIG_ID_SGIX, "GLX_FBCONFIG_ID_SGIX",
				 Success, 0)
			&& pass;
	}

	GLX_EXT_import_context_teardown();

	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
	return 0;
}
Пример #4
0
int main(int argc, char **argv)
{
	static const int invalid_render_types[] = {
		GLX_COLOR_INDEX_BIT,
		GLX_RGBA_BIT,
		GLX_RGBA_FLOAT_BIT_ARB,
		GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT,
		0,
		-1,
		~GLX_RGBA_TYPE,
		~GLX_COLOR_INDEX_TYPE
	};
	bool pass = true;
	unsigned i;

	GLX_ARB_create_context_setup();

	for (i = 0; i < ARRAY_SIZE(invalid_render_types); i++) {
		pass = try_render_type(invalid_render_types[i])
			&& pass;
	}

	if (!piglit_is_glx_extension_supported(dpy, "GLX_ARB_fbconfig_float")) {
		pass = try_render_type(GLX_RGBA_FLOAT_TYPE_ARB)
			&& pass;
	}

	if (!piglit_is_glx_extension_supported(dpy, "GLX_EXT_fbconfig_packed_float")) {
		pass = try_render_type(GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT)
			&& pass;
	}

	GLX_ARB_create_context_teardown();

	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
	return 0;
}
Пример #5
0
int main(int argc, char **argv)
{
    bool pass = true;
    uint32_t i;

    GLX_ARB_create_context_setup();
    piglit_require_glx_extension(dpy, "GLX_ARB_create_context_profile");

    /* The GLX_ARB_create_context_profile spec says:
     *
     *     "* If attribute GLX_CONTEXT_PROFILE_MASK_ARB has no bits set;
     *        has any bits set other than GLX_CONTEXT_CORE_PROFILE_BIT_ARB
     *        and GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; has more than
     *        one of these bits set...then GLXBadProfileARB is generated."
     */
    pass = try_profile(0)
           && pass;

    pass = try_profile(GLX_CONTEXT_CORE_PROFILE_BIT_ARB
                       | GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB)
           && pass;

    /* This loop will need to be modified as new profiles are defined by
     * the GLX spec.  The conditional code below for
     * GLX_EXT_create_context_es2_profile is an example of how this should
     * be handled.
     */
    for (i = 0x00000008; i != 0; i <<= 1) {
        pass = try_profile(i)
               && pass;
    }

    if (!piglit_is_glx_extension_supported(dpy, "GLX_EXT_create_context_es2_profile")) {
        pass = try_profile(GLX_CONTEXT_ES2_PROFILE_BIT_EXT)
               && pass;
    }

    GLX_ARB_create_context_teardown();

    piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
    return 0;
}