diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-11 18:11:13 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-11 18:11:13 +0200 |
commit | 4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 (patch) | |
tree | f000dd831240707a03b8c806db292c2a15cde3ce /gfx/angle/src/libANGLE/validationEGL.cpp | |
parent | 3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff) | |
download | UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.gz UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.lz UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.xz UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.zip |
Roll back to ANGLE/2845
Diffstat (limited to 'gfx/angle/src/libANGLE/validationEGL.cpp')
-rwxr-xr-x | gfx/angle/src/libANGLE/validationEGL.cpp | 97 |
1 files changed, 15 insertions, 82 deletions
diff --git a/gfx/angle/src/libANGLE/validationEGL.cpp b/gfx/angle/src/libANGLE/validationEGL.cpp index 7ee92e83e..6b6893b37 100755 --- a/gfx/angle/src/libANGLE/validationEGL.cpp +++ b/gfx/angle/src/libANGLE/validationEGL.cpp @@ -182,7 +182,7 @@ Error ValidateDisplay(const Display *display) return Error(EGL_SUCCESS); } -Error ValidateSurface(const Display *display, const Surface *surface) +Error ValidateSurface(const Display *display, Surface *surface) { ANGLE_TRY(ValidateDisplay(display)); @@ -206,7 +206,7 @@ Error ValidateConfig(const Display *display, const Config *config) return Error(EGL_SUCCESS); } -Error ValidateContext(const Display *display, const gl::Context *context) +Error ValidateContext(const Display *display, gl::Context *context) { ANGLE_TRY(ValidateDisplay(display)); @@ -258,6 +258,7 @@ Error ValidateCreateContext(Display *display, Config *configuration, gl::Context EGLAttrib clientMinorVersion = 0; EGLAttrib contextFlags = 0; bool resetNotification = false; + bool robustAccess = false; for (AttributeMap::const_iterator attributeIter = attributes.begin(); attributeIter != attributes.end(); attributeIter++) { EGLAttrib attribute = attributeIter->first; @@ -293,6 +294,7 @@ Error ValidateCreateContext(Display *display, Config *configuration, gl::Context { return Error(EGL_BAD_ATTRIBUTE); } + robustAccess = (value == EGL_TRUE); break; case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR: @@ -325,36 +327,6 @@ Error ValidateCreateContext(Display *display, Config *configuration, gl::Context } break; - case EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE: - if (!display->getExtensions().createContextWebGLCompatibility) - { - return Error(EGL_BAD_ATTRIBUTE, - "Attribute EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE requires " - "EGL_ANGLE_create_context_webgl_compatibility."); - } - if (value != EGL_TRUE && value != EGL_FALSE) - { - return Error( - EGL_BAD_ATTRIBUTE, - "EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE must be EGL_TRUE or EGL_FALSE."); - } - break; - - case EGL_CONTEXT_BIND_GENERATES_RESOURCE_CHROMIUM: - if (!display->getExtensions().createContextBindGeneratesResource) - { - return Error(EGL_BAD_ATTRIBUTE, - "Attribute EGL_CONTEXT_BIND_GENERATES_RESOURCE_CHROMIUM requires " - "EGL_CHROMIUM_create_context_bind_generates_resource."); - } - if (value != EGL_TRUE && value != EGL_FALSE) - { - return Error(EGL_BAD_ATTRIBUTE, - "EGL_CONTEXT_BIND_GENERATES_RESOURCE_CHROMIUM must be EGL_TRUE or " - "EGL_FALSE."); - } - break; - default: return Error(EGL_BAD_ATTRIBUTE); } @@ -397,6 +369,17 @@ Error ValidateCreateContext(Display *display, Config *configuration, gl::Context return Error(EGL_BAD_ATTRIBUTE); } + if ((contextFlags & EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR) > 0) + { + robustAccess = true; + } + + if (robustAccess) + { + // Unimplemented + return Error(EGL_BAD_CONFIG); + } + if (shareContext) { // Shared context is invalid or is owned by another display @@ -640,17 +623,6 @@ Error ValidateCreatePbufferFromClientBuffer(Display *display, EGLenum buftype, E } break; - case EGL_D3D_TEXTURE_ANGLE: - if (!displayExtensions.d3dTextureClientBuffer) - { - return Error(EGL_BAD_PARAMETER); - } - if (buffer == nullptr) - { - return Error(EGL_BAD_PARAMETER); - } - break; - default: return Error(EGL_BAD_PARAMETER); } @@ -751,8 +723,6 @@ Error ValidateCreatePbufferFromClientBuffer(Display *display, EGLenum buftype, E } } - ANGLE_TRY(display->validateClientBuffer(config, buftype, buffer, attributes)); - return Error(EGL_SUCCESS); } @@ -1576,41 +1546,4 @@ Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display, return stream->validateD3D11NV12Texture(texture); } - -Error ValidateSwapBuffersWithDamageEXT(const Display *display, - const Surface *surface, - EGLint *rects, - EGLint n_rects) -{ - Error error = ValidateSurface(display, surface); - if (error.isError()) - { - return error; - } - - if (!display->getExtensions().swapBuffersWithDamage) - { - // It is out of spec what happens when calling an extension function when the extension is - // not available. EGL_BAD_DISPLAY seems like a reasonable error. - return Error(EGL_BAD_DISPLAY, "EGL_EXT_swap_buffers_with_damage is not available."); - } - - if (surface == EGL_NO_SURFACE) - { - return Error(EGL_BAD_SURFACE, "Swap surface cannot be EGL_NO_SURFACE."); - } - - if (n_rects < 0) - { - return Error(EGL_BAD_PARAMETER, "n_rects cannot be negative."); - } - - if (n_rects > 0 && rects == nullptr) - { - return Error(EGL_BAD_PARAMETER, "n_rects cannot be greater than zero when rects is NULL."); - } - - return Error(EGL_SUCCESS); -} - } // namespace gl |