Path: blob/21.2-virgl/src/egl/generate/eglFunctionList.py
4560 views
"""1Contains a list of EGL functions to generate dispatch functions for.23This is used from gen_egl_dispatch.py.45EGL_FUNCTIONS is a sequence of (name, eglData) pairs, where name is the name6of the function, and eglData is a dictionary containing data about that7function.89The values in the eglData dictionary are:10- method (string):11How to select a vendor library. See "Method values" below.1213- prefix (string):14This string is prepended to the name of the dispatch function. If15unspecified, the default is "" (an empty string).1617- static (boolean)18If True, this function should be declared static.1920- "public" (boolean)21If True, the function should be exported from the library. Vendor libraries22generally should not use this.2324- extension (string):25If specified, this is the name of a macro to check for before defining a26function. Used for checking for extension macros and such.2728- retval (string):29If specified, this is a C expression with the default value to return if we30can't find a function to call. By default, it will try to guess from the31return type: EGL_NO_whatever for the various handle types, NULL for32pointers, and zero for everything else.3334method values:35- "custom"36The dispatch stub will be hand-written instead of generated.3738- "none"39No dispatch function exists at all, but the function should still have an40entry in the index array. This is for other functions that a stub may need41to call that are implemented in libEGL itself.4243- "display"44Select a vendor from an EGLDisplay argument.4546- "device"47Select a vendor from an EGLDeviceEXT argument.4849- "current"50Select the vendor that owns the current context.51"""5253def _eglFunc(name, method, static=None, public=False, inheader=None, prefix="dispatch_", extension=None, retval=None):54"""55A convenience function to define an entry in the EGL function list.56"""57if static is None:58static = (not public and method != "custom")59if inheader is None:60inheader = (not static)61values = {62"method" : method,63"prefix" : prefix,64"extension" : extension,65"retval" : retval,66"static" : static,67"public" : public,68"inheader" : inheader,69}70return (name, values)7172EGL_FUNCTIONS = (73# EGL_VERSION_1_074_eglFunc("eglChooseConfig", "none"),75_eglFunc("eglCopyBuffers", "none"),76_eglFunc("eglCreateContext", "none"),77_eglFunc("eglCreatePbufferSurface", "none"),78_eglFunc("eglCreatePixmapSurface", "none"),79_eglFunc("eglCreateWindowSurface", "none"),80_eglFunc("eglDestroyContext", "none"),81_eglFunc("eglDestroySurface", "none"),82_eglFunc("eglGetConfigAttrib", "none"),83_eglFunc("eglGetConfigs", "none"),84_eglFunc("eglQueryContext", "none"),85_eglFunc("eglQuerySurface", "none"),86_eglFunc("eglSwapBuffers", "none"),87_eglFunc("eglWaitGL", "none"),88_eglFunc("eglWaitNative", "none"),89_eglFunc("eglTerminate", "none"),90_eglFunc("eglInitialize", "none"),9192_eglFunc("eglGetCurrentDisplay", "none"),93_eglFunc("eglGetCurrentSurface", "none"),94_eglFunc("eglGetDisplay", "none"),95_eglFunc("eglGetError", "none"),96_eglFunc("eglGetProcAddress", "none"),97_eglFunc("eglMakeCurrent", "none"),98_eglFunc("eglQueryString", "none"),99100# EGL_VERSION_1_1101_eglFunc("eglBindTexImage", "none"),102_eglFunc("eglReleaseTexImage", "none"),103_eglFunc("eglSurfaceAttrib", "none"),104_eglFunc("eglSwapInterval", "none"),105106# EGL_VERSION_1_2107_eglFunc("eglCreatePbufferFromClientBuffer", "none"),108_eglFunc("eglWaitClient", "none"),109_eglFunc("eglBindAPI", "none"),110_eglFunc("eglQueryAPI", "none"),111_eglFunc("eglReleaseThread", "none"),112113# EGL_VERSION_1_4114_eglFunc("eglGetCurrentContext", "none"),115116# EGL_VERSION_1_5117_eglFunc("eglCreateSync", "none"),118_eglFunc("eglDestroySync", "none"),119_eglFunc("eglClientWaitSync", "none"),120_eglFunc("eglGetSyncAttrib", "none"),121_eglFunc("eglCreateImage", "none"),122_eglFunc("eglDestroyImage", "none"),123_eglFunc("eglCreatePlatformWindowSurface", "none"),124_eglFunc("eglCreatePlatformPixmapSurface", "none"),125_eglFunc("eglWaitSync", "none"),126_eglFunc("eglGetPlatformDisplay", "none"),127128# EGL_EXT_platform_base129_eglFunc("eglCreatePlatformWindowSurfaceEXT", "display"),130_eglFunc("eglCreatePlatformPixmapSurfaceEXT", "display"),131_eglFunc("eglGetPlatformDisplayEXT", "none"),132133# TODO: Most of these extensions should be provided by the vendor134# libraries, not by libEGL. They're here now to make testing everything135# else easier.136137# EGL_EXT_swap_buffers_with_damage138_eglFunc("eglSwapBuffersWithDamageEXT", "display"),139140# KHR_EXT_swap_buffers_with_damage141_eglFunc("eglSwapBuffersWithDamageKHR", "display"),142143# EGL_KHR_cl_event2144_eglFunc("eglCreateSync64KHR", "display"),145146# EGL_KHR_fence_sync147_eglFunc("eglCreateSyncKHR", "display"),148_eglFunc("eglDestroySyncKHR", "display"),149_eglFunc("eglClientWaitSyncKHR", "display"),150_eglFunc("eglGetSyncAttribKHR", "display"),151152# EGL_KHR_image153_eglFunc("eglCreateImageKHR", "display"),154_eglFunc("eglDestroyImageKHR", "display"),155156# EGL_KHR_image_base157# eglCreateImageKHR already defined in EGL_KHR_image158# eglDestroyImageKHR already defined in EGL_KHR_image159160# EGL_KHR_reusable_sync161_eglFunc("eglSignalSyncKHR", "display"),162# eglCreateSyncKHR already defined in EGL_KHR_fence_sync163# eglDestroySyncKHR already defined in EGL_KHR_fence_sync164# eglClientWaitSyncKHR already defined in EGL_KHR_fence_sync165# eglGetSyncAttribKHR already defined in EGL_KHR_fence_sync166167# EGL_KHR_wait_sync168_eglFunc("eglWaitSyncKHR", "display"),169170# EGL_MESA_drm_image171_eglFunc("eglCreateDRMImageMESA", "display"),172_eglFunc("eglExportDRMImageMESA", "display"),173174# EGL_MESA_image_dma_buf_export175_eglFunc("eglExportDMABUFImageQueryMESA", "display"),176_eglFunc("eglExportDMABUFImageMESA", "display"),177178# EGL_NOK_swap_region179_eglFunc("eglSwapBuffersRegionNOK", "display"),180181# EGL_NV_post_sub_buffer182_eglFunc("eglPostSubBufferNV", "display"),183184# EGL_WL_bind_wayland_display185_eglFunc("eglCreateWaylandBufferFromImageWL", "display"),186_eglFunc("eglUnbindWaylandDisplayWL", "display"),187_eglFunc("eglQueryWaylandBufferWL", "display"),188_eglFunc("eglBindWaylandDisplayWL", "display"),189190# EGL_CHROMIUM_get_sync_values191_eglFunc("eglGetSyncValuesCHROMIUM", "display"),192193# EGL_ANDROID_native_fence_sync194_eglFunc("eglDupNativeFenceFDANDROID", "display"),195196# EGL_ANDROID_blob_cache197_eglFunc("eglSetBlobCacheFuncsANDROID", "display"),198199# EGL_EXT_image_dma_buf_import_modifiers200_eglFunc("eglQueryDmaBufFormatsEXT", "display"),201_eglFunc("eglQueryDmaBufModifiersEXT", "display"),202203# EGL_EXT_device_base204_eglFunc("eglQueryDeviceAttribEXT", "device"),205_eglFunc("eglQueryDeviceStringEXT", "device"),206_eglFunc("eglQueryDevicesEXT", "none"),207_eglFunc("eglQueryDisplayAttribEXT", "display"),208209# EGL_MESA_query_driver210_eglFunc("eglGetDisplayDriverName", "display"),211_eglFunc("eglGetDisplayDriverConfig", "display"),212213# EGL_KHR_partial_update214_eglFunc("eglSetDamageRegionKHR", "display"),215216)217218219220