Пример #1
0
/**
 * Generated code calls this function to retrieve the address of a
 * core function.
 */
static piglit_dispatch_function_ptr
get_wfl_ext_proc(const char *name)
{
	piglit_dispatch_function_ptr func;

	func = (piglit_dispatch_function_ptr)waffle_get_proc_address(name);
	if (!func)
		wfl_log_error(__FUNCTION__);

	return func;
}
Пример #2
0
/**
 * Generated code calls this function to retrieve the address of a
 * core function.
 */
static piglit_dispatch_function_ptr
get_wfl_core_proc(const char *name, int gl_10x_version)
{
	piglit_dispatch_function_ptr func;

	func = (piglit_dispatch_function_ptr)waffle_dl_sym(piglit_waffle_dl,
							   name);
	if (!func)
		wfl_log_error(__FUNCTION__);

	return func;
}
Пример #3
0
void
wfl_fatal_error(const char *func_name)
{
	const struct waffle_error_info *info = waffle_error_get_info();

	assert(info->code != WAFFLE_NO_ERROR);

	wfl_log_error(func_name);

	if (info->code == WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM)
		piglit_report_result(PIGLIT_SKIP);
	else
		piglit_report_result(PIGLIT_FAIL);
}
Пример #4
0
static bool
make_context_current_singlepass(struct piglit_wfl_framework *wfl_fw,
                                const struct piglit_gl_test_config *test_config,
                                enum context_flavor flavor,
                                const int32_t partial_config_attrib_list[])
{
	bool ok;
	int32_t *attrib_list = NULL;
	char ctx_desc[1024];

	assert(wfl_fw->config == NULL);
	assert(wfl_fw->context == NULL);
	assert(wfl_fw->window == NULL);

	parse_test_config(test_config, flavor, ctx_desc, sizeof(ctx_desc),
			  partial_config_attrib_list, &attrib_list);
	assert(attrib_list);
	wfl_fw->config = waffle_config_choose(wfl_fw->display, attrib_list);
	free(attrib_list);
	if (!wfl_fw->config) {
		wfl_log_error("waffle_config_choose");
		fprintf(stderr, "piglit: error: Failed to create "
			"waffle_config for %s\n", ctx_desc);
		goto fail;
	}

	wfl_fw->context = waffle_context_create(wfl_fw->config, NULL);
	if (!wfl_fw->context) {
		wfl_log_error("waffle_context_create");
		fprintf(stderr, "piglit: error: Failed to create "
			"waffle_context for %s\n", ctx_desc);
		goto fail;
	}

	wfl_fw->window = wfl_checked_window_create(wfl_fw->config,
	                                           test_config->window_width,
	                                           test_config->window_height);

	wfl_checked_make_current(wfl_fw->display,
	                         wfl_fw->window,
	                         wfl_fw->context);

#ifdef PIGLIT_USE_OPENGL
	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
#elif defined(PIGLIT_USE_OPENGL_ES1)
	piglit_dispatch_default_init(PIGLIT_DISPATCH_ES1);
#elif defined(PIGLIT_USE_OPENGL_ES2) || defined(PIGLIT_USE_OPENGL_ES3)
	piglit_dispatch_default_init(PIGLIT_DISPATCH_ES2);
#else
#	error
#endif

	ok = check_gl_version(test_config, flavor, ctx_desc);
	if (!ok)
	   goto fail;

	ok = special_case_gl31(wfl_fw, test_config, flavor, ctx_desc,
			       partial_config_attrib_list);
	if (!ok)
		goto fail;

	return true;

fail:
	waffle_make_current(wfl_fw->display, NULL, NULL);
	waffle_window_destroy(wfl_fw->window);
	waffle_context_destroy(wfl_fw->context);
	waffle_config_destroy(wfl_fw->config);

	wfl_fw->window = NULL;
	wfl_fw->context = NULL;
	wfl_fw->config = NULL;

	piglit_gl_reinitialize_extensions();

	return false;
}