void
piglit_init(int argc, char **argv)
{
	static const char intel_id[] = "Intel Open Source Technology Center";
	const char *vendor_str;
	EGLDisplay egl_dpy = eglGetCurrentDisplay();

	piglit_require_egl_extension(egl_dpy, "EGL_EXT_image_dma_buf_import");
	piglit_require_egl_extension(egl_dpy, "EGL_KHR_image_base");
	piglit_require_extension("GL_OES_EGL_image");
	piglit_require_extension("GL_OES_framebuffer_object");
	
	piglit_glGenRenderbuffersOES =
		(PFNGLGENRENDERBUFFERSOESPROC)
		eglGetProcAddress("glGenRenderbuffersOES");
	piglit_glBindRenderbufferOES =
		(PFNGLBINDRENDERBUFFEROESPROC)
		eglGetProcAddress("glBindRenderbufferOES");
	piglit_glDeleteRenderbuffersOES =
		(PFNGLDELETERENDERBUFFERSOESPROC)
		eglGetProcAddress("glDeleteRenderbuffersOES");
	if (!piglit_glGenRenderbuffersOES ||
	    !piglit_glBindRenderbufferOES ||
	    !piglit_glDeleteRenderbuffersOES)
		piglit_report_result(PIGLIT_FAIL);

	vendor_str = (const char *)glGetString(GL_VENDOR);
	if (strncmp(vendor_str, intel_id, sizeof(intel_id) - 1) != 0) {
		printf("Test requires intel gpu\n");
		piglit_report_result(PIGLIT_SKIP);
	}
}
void
piglit_init(int argc, char **argv)
{
	EGLDisplay dpy = eglGetCurrentDisplay();

	piglit_require_egl_extension(dpy, "EGL_EXT_image_dma_buf_import");
	piglit_require_egl_extension(dpy, "EGL_KHR_image_base");
	piglit_require_extension("GL_OES_EGL_image");
}
void
piglit_init(int argc, char **argv)
{
	static const char intel_id[] = "Intel Open Source Technology Center";
	const char *vendor_str;

	piglit_require_egl_extension("EGL_EXT_image_dma_buf_import");
	piglit_require_egl_extension("EGL_KHR_image_base");

	vendor_str = (const char *)glGetString(GL_VENDOR);
	if (strncmp(vendor_str, intel_id, sizeof(intel_id) - 1) != 0) {
		printf("Test requires intel gpu\n");
		piglit_report_result(PIGLIT_SKIP);
	}
}
static void
test_setup(EGLDisplay *dpy)
{
	EGLint egl_major, egl_minor;

	piglit_require_egl_extension(EGL_NO_DISPLAY, "EGL_MESA_platform_surfaceless");

	*dpy = piglit_egl_get_default_display(EGL_PLATFORM_SURFACELESS_MESA);
	if (*dpy == EGL_NO_DISPLAY) {
		printf("failed to get EGLDisplay\n");
		piglit_report_result(PIGLIT_SKIP);
	}

	if (!eglInitialize(*dpy, &egl_major, &egl_minor)) {
		printf("eglInitialize failed\n");
		piglit_report_result(PIGLIT_FAIL);
	}
}
예제 #5
0
/**
 * Verify that eglCreateSyncKHR() emits correct error when given a display that
 * does not match the display of the bound context.
 *
 * From the EGL_KHR_fence_sync spec:
 *
 *      * If <type> is EGL_SYNC_FENCE_KHR and <dpy> does not match the
 *        EGLDisplay of the currently bound context for the currently
 *        bound client API (the EGLDisplay returned by
 *        eglGetCurrentDisplay()) then EGL_NO_SYNC_KHR is returned and an
 *        EGL_BAD_MATCH error is generated.
 *
 * This test verifies a simple case for the above error. It binds a context and
 * display to the main thread, creates a second display on the same threads but
 * does not bind it, then gives the second display to eglCreateSyncKHR().
 */
static enum piglit_result
test_eglCreateSyncKHR_wrong_display_same_thread(void *test_data)
{
	enum piglit_result result = PIGLIT_PASS;
	EGLDisplay wrong_dpy = 0;
	EGLSyncKHR sync = 0;

	result = test_setup();
	if (result != PIGLIT_PASS) {
		return result;
	}

	piglit_logi("create second EGLDisplay");
	result = init_other_display(&wrong_dpy, g_dpy);
	if (result != PIGLIT_PASS) {
		goto cleanup;
	}

	piglit_require_egl_extension(wrong_dpy, "EGL_KHR_fence_sync");

	piglit_logi("try to create sync with second display");
	sync = peglCreateSyncKHR(wrong_dpy, EGL_SYNC_FENCE_KHR, NULL);
	if (sync) {
		piglit_loge("eglCreateSyncKHR() incorrectly succeeded");
		result = PIGLIT_FAIL;
		goto cleanup;
	}
	if (!piglit_check_egl_error(EGL_BAD_MATCH)) {
		piglit_loge("eglCreateSyncKHR emitted wrong error");
		result = PIGLIT_FAIL;
		goto cleanup;
	}

cleanup:
	if (wrong_dpy) {
		eglTerminate(wrong_dpy);
	}
	test_cleanup(EGL_NO_SYNC_KHR, &result);
	return result;
}
예제 #6
0
void
piglit_init(int argc, char **argv)
{
	EGLDisplay egl_dpy = eglGetCurrentDisplay();
	piglit_require_egl_extension(egl_dpy, "EGL_EXT_image_dma_buf_import");
}
void
piglit_init(int argc, char **argv)
{
	piglit_require_egl_extension("EGL_EXT_image_dma_buf_import");
}
예제 #8
0
파일: common.c 프로젝트: dumbbell/piglit
static void
check_extensions(void)
{
	piglit_require_egl_extension(egl_dpy, "EGL_KHR_create_context");
	piglit_require_egl_extension(egl_dpy, "EGL_KHR_surfaceless_context");
}