#include "libANGLE/validationEGL_autogen.h"
#include "common/utilities.h"
#include "libANGLE/Config.h"
#include "libANGLE/Context.h"
#include "libANGLE/Device.h"
#include "libANGLE/Display.h"
#include "libANGLE/EGLSync.h"
#include "libANGLE/Image.h"
#include "libANGLE/Stream.h"
#include "libANGLE/Surface.h"
#include "libANGLE/Texture.h"
#include "libANGLE/Thread.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/DisplayImpl.h"
#include <EGL/eglext.h>
namespace egl
{
namespace
{
size_t GetMaximumMipLevel(const gl::Context *context, gl::TextureType type)
{ … }
bool TextureHasNonZeroMipLevelsSpecified(const gl::Context *context, const gl::Texture *texture)
{ … }
bool CubeTextureHasUnspecifiedLevel0Face(const gl::Texture *texture)
{ … }
bool ValidateStreamAttribute(const ValidationContext *val,
const EGLAttrib attribute,
const EGLAttrib value,
const DisplayExtensions &extensions)
{ … }
bool ValidateCreateImageMipLevelCommon(const ValidationContext *val,
const gl::Context *context,
const gl::Texture *texture,
EGLAttrib level)
{ … }
bool ValidateConfigAttribute(const ValidationContext *val,
const Display *display,
EGLAttrib attribute)
{ … }
bool ValidateConfigAttributeValue(const ValidationContext *val,
const Display *display,
EGLAttrib attribute,
EGLAttrib value)
{ … }
bool ValidateConfigAttributes(const ValidationContext *val,
const Display *display,
const AttributeMap &attributes)
{ … }
bool ValidateColorspaceAttribute(const ValidationContext *val,
const DisplayExtensions &displayExtensions,
EGLAttrib colorSpace)
{ … }
bool ValidatePlatformType(const ValidationContext *val,
const ClientExtensions &clientExtensions,
EGLAttrib platformType)
{ … }
bool ValidateGetPlatformDisplayCommon(const ValidationContext *val,
EGLenum platform,
const void *native_display,
const AttributeMap &attribMap)
{ … }
bool ValidateStream(const ValidationContext *val, const Display *display, const Stream *stream)
{ … }
bool ValidateLabeledObject(const ValidationContext *val,
const Display *display,
ObjectType objectType,
EGLObjectKHR object,
const LabeledObject **outLabeledObject)
{ … }
bool ValidateLabeledObject(const ValidationContext *val,
Display *display,
ObjectType objectType,
EGLObjectKHR object,
LabeledObject **outLabeledObject)
{ … }
bool ValidateDisplayPointer(const ValidationContext *val, const Display *display)
{ … }
bool ValidCompositorTimingName(CompositorTiming name)
{ … }
bool ValidTimestampType(Timestamp timestamp)
{ … }
bool ValidateCompatibleSurface(const ValidationContext *val,
const Display *display,
const gl::Context *context,
const Surface *surface)
{ … }
bool ValidateSurfaceBadAccess(const ValidationContext *val,
const gl::Context *previousContext,
const Surface *surface)
{ … }
bool ValidateCreateSyncBase(const ValidationContext *val,
const Display *display,
EGLenum type,
const AttributeMap &attribs,
bool isExt)
{ … }
bool ValidateGetSyncAttribBase(const ValidationContext *val,
const Display *display,
SyncID sync,
EGLint attribute)
{ … }
bool ValidateQueryDisplayAttribBase(const ValidationContext *val,
const Display *display,
const EGLint attribute)
{ … }
bool ValidateCreateContextAttribute(const ValidationContext *val,
const Display *display,
EGLAttrib attribute)
{ … }
bool ValidateCreateContextAttributeValue(const ValidationContext *val,
const Display *display,
const gl::Context *shareContext,
EGLAttrib attribute,
EGLAttrib value)
{ … }
bool ValidateCreatePbufferSurfaceAttribute(const ValidationContext *val,
const Display *display,
EGLAttrib attribute)
{ … }
bool ValidateCreatePbufferSurfaceAttributeValue(const ValidationContext *val,
const Display *display,
EGLAttrib attribute,
EGLAttrib value)
{ … }
}
void ValidationContext::setError(EGLint error) const
{ … }
void ValidationContext::setError(EGLint error, const char *message...) const
{ … }
bool ValidateDisplay(const ValidationContext *val, const Display *display)
{ … }
bool ValidateSurface(const ValidationContext *val, const Display *display, SurfaceID surfaceID)
{ … }
bool ValidateConfig(const ValidationContext *val, const Display *display, const Config *config)
{ … }
bool ValidateThreadContext(const ValidationContext *val,
const Display *display,
EGLenum noContextError)
{ … }
bool ValidateContext(const ValidationContext *val, const Display *display, gl::ContextID contextID)
{ … }
bool ValidateImage(const ValidationContext *val, const Display *display, ImageID imageID)
{ … }
bool ValidateDevice(const ValidationContext *val, const Device *device)
{ … }
bool ValidateSync(const ValidationContext *val, const Display *display, SyncID sync)
{ … }
const Thread *GetThreadIfValid(const Thread *thread)
{ … }
const Display *GetDisplayIfValid(const Display *display)
{ … }
const Surface *GetSurfaceIfValid(const Display *display, SurfaceID surfaceID)
{ … }
const Image *GetImageIfValid(const Display *display, ImageID imageID)
{ … }
const Stream *GetStreamIfValid(const Display *display, const Stream *stream)
{ … }
const gl::Context *GetContextIfValid(const Display *display, gl::ContextID contextID)
{ … }
gl::Context *GetContextIfValid(Display *display, gl::ContextID contextID)
{ … }
const Device *GetDeviceIfValid(const Device *device)
{ … }
const Sync *GetSyncIfValid(const Display *display, SyncID syncID)
{ … }
const LabeledObject *GetLabeledObjectIfValid(Thread *thread,
const Display *display,
ObjectType objectType,
EGLObjectKHR object)
{ … }
LabeledObject *GetLabeledObjectIfValid(Thread *thread,
Display *display,
ObjectType objectType,
EGLObjectKHR object)
{ … }
bool ValidateInitialize(const ValidationContext *val,
const Display *display,
const EGLint *major,
const EGLint *minor)
{ … }
bool ValidateTerminate(const ValidationContext *val, const Display *display)
{ … }
bool ValidateCreateContext(const ValidationContext *val,
const Display *display,
const Config *configuration,
gl::ContextID shareContextID,
const AttributeMap &attributes)
{ … }
bool ValidateCreateWindowSurface(const ValidationContext *val,
const Display *display,
const Config *config,
EGLNativeWindowType window,
const AttributeMap &attributes)
{ … }
bool ValidateCreatePbufferSurface(const ValidationContext *val,
const Display *display,
const Config *config,
const AttributeMap &attributes)
{ … }
bool ValidateCreatePbufferFromClientBuffer(const ValidationContext *val,
const Display *display,
EGLenum buftype,
EGLClientBuffer buffer,
const Config *config,
const AttributeMap &attributes)
{ … }
bool ValidateCreatePixmapSurface(const ValidationContext *val,
const Display *display,
const Config *config,
EGLNativePixmapType pixmap,
const AttributeMap &attributes)
{ … }
bool ValidateMakeCurrent(const ValidationContext *val,
const Display *display,
SurfaceID drawSurfaceID,
SurfaceID readSurfaceID,
gl::ContextID contextID)
{ … }
bool ValidateCreateImage(const ValidationContext *val,
const Display *display,
gl::ContextID contextID,
EGLenum target,
EGLClientBuffer buffer,
const AttributeMap &attributes)
{ … }
bool ValidateDestroyImage(const ValidationContext *val, const Display *display, ImageID imageID)
{ … }
bool ValidateCreateImageKHR(const ValidationContext *val,
const Display *display,
gl::ContextID contextID,
EGLenum target,
EGLClientBuffer buffer,
const AttributeMap &attributes)
{ … }
bool ValidateDestroyImageKHR(const ValidationContext *val, const Display *display, ImageID imageID)
{ … }
bool ValidateCreateDeviceANGLE(const ValidationContext *val,
EGLint device_type,
const void *native_device,
const EGLAttrib *attrib_list)
{ … }
bool ValidateReleaseDeviceANGLE(const ValidationContext *val, const Device *device)
{ … }
bool ValidateCreateSync(const ValidationContext *val,
const Display *display,
EGLenum type,
const AttributeMap &attribs)
{ … }
bool ValidateCreateSyncKHR(const ValidationContext *val,
const Display *display,
EGLenum type,
const AttributeMap &attribs)
{ … }
bool ValidateDestroySync(const ValidationContext *val, const Display *display, SyncID sync)
{ … }
bool ValidateDestroySyncKHR(const ValidationContext *val,
const Display *dpyPacked,
SyncID syncPacked)
{ … }
bool ValidateClientWaitSync(const ValidationContext *val,
const Display *display,
SyncID sync,
EGLint flags,
EGLTime timeout)
{ … }
bool ValidateClientWaitSyncKHR(const ValidationContext *val,
const Display *dpyPacked,
SyncID syncPacked,
EGLint flags,
EGLTimeKHR timeout)
{ … }
bool ValidateWaitSync(const ValidationContext *val,
const Display *display,
SyncID sync,
EGLint flags)
{ … }
bool ValidateWaitSyncKHR(const ValidationContext *val,
const Display *dpyPacked,
SyncID syncPacked,
EGLint flags)
{ … }
bool ValidateGetSyncAttrib(const ValidationContext *val,
const Display *display,
SyncID sync,
EGLint attribute,
const EGLAttrib *value)
{ … }
bool ValidateGetSyncAttribKHR(const ValidationContext *val,
const Display *display,
SyncID sync,
EGLint attribute,
const EGLint *value)
{ … }
bool ValidateCreateStreamKHR(const ValidationContext *val,
const Display *display,
const AttributeMap &attributes)
{ … }
bool ValidateDestroyStreamKHR(const ValidationContext *val,
const Display *display,
const Stream *stream)
{ … }
bool ValidateStreamAttribKHR(const ValidationContext *val,
const Display *display,
const Stream *stream,
EGLenum attribute,
EGLint value)
{ … }
bool ValidateQueryStreamKHR(const ValidationContext *val,
const Display *display,
const Stream *stream,
EGLenum attribute,
const EGLint *value)
{ … }
bool ValidateQueryStreamu64KHR(const ValidationContext *val,
const Display *display,
const Stream *stream,
EGLenum attribute,
const EGLuint64KHR *value)
{ … }
bool ValidateStreamConsumerGLTextureExternalKHR(const ValidationContext *val,
const Display *display,
const Stream *stream)
{ … }
bool ValidateStreamConsumerAcquireKHR(const ValidationContext *val,
const Display *display,
const Stream *stream)
{ … }
bool ValidateStreamConsumerReleaseKHR(const ValidationContext *val,
const Display *display,
const Stream *stream)
{ … }
bool ValidateStreamConsumerGLTextureExternalAttribsNV(const ValidationContext *val,
const Display *display,
const Stream *stream,
const AttributeMap &attribs)
{ … }
bool ValidateCreateStreamProducerD3DTextureANGLE(const ValidationContext *val,
const Display *display,
const Stream *stream,
const AttributeMap &attribs)
{ … }
bool ValidateStreamPostD3DTextureANGLE(const ValidationContext *val,
const Display *display,
const Stream *stream,
const void *texture,
const AttributeMap &attribs)
{ … }
bool ValidateSyncControlCHROMIUM(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID)
{ … }
bool ValidateSyncControlRateANGLE(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID)
{ … }
bool ValidateGetMscRateANGLE(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
const EGLint *numerator,
const EGLint *denominator)
{ … }
bool ValidateGetSyncValuesCHROMIUM(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
const EGLuint64KHR *ust,
const EGLuint64KHR *msc,
const EGLuint64KHR *sbc)
{ … }
bool ValidateDestroySurface(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID)
{ … }
bool ValidateDestroyContext(const ValidationContext *val,
const Display *display,
gl::ContextID contextID)
{ … }
bool ValidateSwapBuffers(const ValidationContext *val, const Display *display, SurfaceID surfaceID)
{ … }
bool ValidateSwapBuffersWithDamageKHR(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
const EGLint *rects,
EGLint n_rects)
{ … }
bool ValidateWaitNative(const ValidationContext *val, const EGLint engine)
{ … }
bool ValidateCopyBuffers(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLNativePixmapType target)
{ … }
bool ValidateBindTexImage(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
const EGLint buffer)
{ … }
bool ValidateReleaseTexImage(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
const EGLint buffer)
{ … }
bool ValidateSwapInterval(const ValidationContext *val, const Display *display, EGLint interval)
{ … }
bool ValidateBindAPI(const ValidationContext *val, const EGLenum api)
{ … }
bool ValidatePresentationTimeANDROID(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLnsecsANDROID time)
{ … }
bool ValidateSetBlobCacheFuncsANDROID(const ValidationContext *val,
const Display *display,
EGLSetBlobFuncANDROID set,
EGLGetBlobFuncANDROID get)
{ … }
bool ValidateGetConfigAttrib(const ValidationContext *val,
const Display *display,
const Config *config,
EGLint attribute,
const EGLint *value)
{ … }
bool ValidateChooseConfig(const ValidationContext *val,
const Display *display,
const AttributeMap &attribs,
const EGLConfig *configs,
EGLint configSize,
const EGLint *numConfig)
{ … }
bool ValidateGetConfigs(const ValidationContext *val,
const Display *display,
const EGLConfig *configs,
EGLint configSize,
const EGLint *numConfig)
{ … }
bool ValidateGetPlatformDisplay(const ValidationContext *val,
EGLenum platform,
const void *native_display,
const AttributeMap &attribMap)
{ … }
bool ValidateGetPlatformDisplayEXT(const ValidationContext *val,
EGLenum platform,
const void *native_display,
const AttributeMap &attribMap)
{ … }
bool ValidateCreatePlatformWindowSurfaceEXT(const ValidationContext *val,
const Display *display,
const Config *configuration,
const void *nativeWindow,
const AttributeMap &attributes)
{ … }
bool ValidateCreatePlatformPixmapSurfaceEXT(const ValidationContext *val,
const Display *display,
const Config *configuration,
const void *nativePixmap,
const AttributeMap &attributes)
{ … }
bool ValidateProgramCacheGetAttribANGLE(const ValidationContext *val,
const Display *display,
EGLenum attrib)
{ … }
bool ValidateProgramCacheQueryANGLE(const ValidationContext *val,
const Display *display,
EGLint index,
const void *key,
const EGLint *keysize,
const void *binary,
const EGLint *binarysize)
{ … }
bool ValidateProgramCachePopulateANGLE(const ValidationContext *val,
const Display *display,
const void *key,
EGLint keysize,
const void *binary,
EGLint binarysize)
{ … }
bool ValidateProgramCacheResizeANGLE(const ValidationContext *val,
const Display *display,
EGLint limit,
EGLint mode)
{ … }
bool ValidateSurfaceAttrib(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLint attribute,
EGLint value)
{ … }
bool ValidateQuerySurface(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLint attribute,
const EGLint *value)
{ … }
bool ValidateQueryContext(const ValidationContext *val,
const Display *display,
gl::ContextID contextID,
EGLint attribute,
const EGLint *value)
{ … }
bool ValidateDebugMessageControlKHR(const ValidationContext *val,
EGLDEBUGPROCKHR callback,
const AttributeMap &attribs)
{ … }
bool ValidateQueryDebugKHR(const ValidationContext *val, EGLint attribute, const EGLAttrib *value)
{ … }
bool ValidateLabelObjectKHR(const ValidationContext *val,
const Display *display,
ObjectType objectType,
EGLObjectKHR object,
EGLLabelKHR label)
{ … }
bool ValidateGetCompositorTimingSupportedANDROID(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
CompositorTiming name)
{ … }
bool ValidateGetCompositorTimingANDROID(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLint numTimestamps,
const EGLint *names,
const EGLnsecsANDROID *values)
{ … }
bool ValidateGetNextFrameIdANDROID(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
const EGLuint64KHR *frameId)
{ … }
bool ValidateGetFrameTimestampSupportedANDROID(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
Timestamp timestamp)
{ … }
bool ValidateGetFrameTimestampsANDROID(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLuint64KHR frameId,
EGLint numTimestamps,
const EGLint *timestamps,
const EGLnsecsANDROID *values)
{ … }
bool ValidateQueryStringiANGLE(const ValidationContext *val,
const Display *display,
EGLint name,
EGLint index)
{ … }
bool ValidateQueryDisplayAttribEXT(const ValidationContext *val,
const Display *display,
const EGLint attribute,
const EGLAttrib *value)
{ … }
bool ValidateQueryDisplayAttribANGLE(const ValidationContext *val,
const Display *display,
const EGLint attribute,
const EGLAttrib *value)
{ … }
bool ValidateGetNativeClientBufferANDROID(const ValidationContext *val,
const AHardwareBuffer *buffer)
{ … }
bool ValidateCreateNativeClientBufferANDROID(const ValidationContext *val,
const egl::AttributeMap &attribMap)
{ … }
bool ValidateCopyMetalSharedEventANGLE(const ValidationContext *val,
const Display *display,
SyncID sync)
{ … }
bool ValidateDupNativeFenceFDANDROID(const ValidationContext *val,
const Display *display,
SyncID sync)
{ … }
bool ValidateSwapBuffersWithFrameTokenANGLE(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLFrameTokenANGLE frametoken)
{ … }
bool ValidatePrepareSwapBuffersANGLE(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID)
{ … }
bool ValidateSignalSyncKHR(const ValidationContext *val,
const Display *display,
SyncID sync,
EGLenum mode)
{ … }
bool ValidateQuerySurfacePointerANGLE(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLint attribute,
void *const *value)
{ … }
bool ValidatePostSubBufferNV(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
EGLint x,
EGLint y,
EGLint width,
EGLint height)
{ … }
bool ValidateQueryDeviceAttribEXT(const ValidationContext *val,
const Device *device,
EGLint attribute,
const EGLAttrib *value)
{ … }
bool ValidateQueryDeviceStringEXT(const ValidationContext *val, const Device *device, EGLint name)
{ … }
bool ValidateReleaseHighPowerGPUANGLE(const ValidationContext *val,
const Display *display,
gl::ContextID contextID)
{ … }
bool ValidateReacquireHighPowerGPUANGLE(const ValidationContext *val,
const Display *display,
gl::ContextID contextID)
{ … }
bool ValidateHandleGPUSwitchANGLE(const ValidationContext *val, const Display *display)
{ … }
bool ValidateForceGPUSwitchANGLE(const ValidationContext *val,
const Display *display,
EGLint gpuIDHigh,
EGLint gpuIDLow)
{ … }
bool ValidateWaitUntilWorkScheduledANGLE(const ValidationContext *val, const Display *display)
{ … }
bool ValidateGetCurrentDisplay(const ValidationContext *val)
{ … }
bool ValidateGetCurrentSurface(const ValidationContext *val, EGLint readdraw)
{ … }
bool ValidateGetDisplay(const ValidationContext *val, EGLNativeDisplayType display_id)
{ … }
bool ValidateGetError(const ValidationContext *val)
{ … }
bool ValidateGetProcAddress(const ValidationContext *val, const char *procname)
{ … }
bool ValidateQueryString(const ValidationContext *val, const Display *dpyPacked, EGLint name)
{ … }
bool ValidateWaitGL(const ValidationContext *val)
{ … }
bool ValidateQueryAPI(const ValidationContext *val)
{ … }
bool ValidateReleaseThread(const ValidationContext *val)
{ … }
bool ValidateWaitClient(const ValidationContext *val)
{ … }
bool ValidateGetCurrentContext(const ValidationContext *val)
{ … }
bool ValidateCreatePlatformPixmapSurface(const ValidationContext *val,
const Display *dpyPacked,
const Config *configPacked,
const void *native_pixmap,
const AttributeMap &attrib_listPacked)
{ … }
bool ValidateCreatePlatformWindowSurface(const ValidationContext *val,
const Display *dpyPacked,
const Config *configPacked,
const void *native_window,
const AttributeMap &attrib_listPacked)
{ … }
bool ValidateLockSurfaceKHR(const ValidationContext *val,
const egl::Display *dpy,
SurfaceID surfaceID,
const AttributeMap &attributes)
{ … }
bool ValidateQuerySurface64KHR(const ValidationContext *val,
const egl::Display *dpy,
SurfaceID surfaceID,
EGLint attribute,
const EGLAttribKHR *value)
{ … }
bool ValidateUnlockSurfaceKHR(const ValidationContext *val,
const egl::Display *dpy,
SurfaceID surfaceID)
{ … }
bool ValidateExportVkImageANGLE(const ValidationContext *val,
const Display *dpy,
ImageID imageID,
const void *vkImage,
const void *vkImageCreateInfo)
{ … }
bool ValidateSetDamageRegionKHR(const ValidationContext *val,
const Display *display,
SurfaceID surfaceID,
const EGLint *rects,
EGLint n_rects)
{ … }
bool ValidateQueryDmaBufFormatsEXT(ValidationContext const *val,
Display const *dpy,
EGLint max_formats,
const EGLint *formats,
const EGLint *num_formats)
{ … }
bool ValidateQueryDmaBufModifiersEXT(ValidationContext const *val,
Display const *dpy,
EGLint format,
EGLint max_modifiers,
const EGLuint64KHR *modifiers,
const EGLBoolean *external_only,
const EGLint *num_modifiers)
{ … }
bool ValidateAcquireExternalContextANGLE(const ValidationContext *val,
const egl::Display *display,
SurfaceID drawAndReadPacked)
{ … }
bool ValidateReleaseExternalContextANGLE(const ValidationContext *val, const egl::Display *display)
{ … }
bool ValidateSetValidationEnabledANGLE(const ValidationContext *val, EGLBoolean validationState)
{ … }
}