diff options
Diffstat (limited to 'gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp')
-rwxr-xr-x | gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp | 50 |
1 files changed, 10 insertions, 40 deletions
diff --git a/gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp b/gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp index 188321115..4647fe589 100755 --- a/gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp +++ b/gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp @@ -14,15 +14,12 @@ #include "libANGLE/Surface.h" #include "libANGLE/renderer/gl/RendererGL.h" #include "libANGLE/renderer/gl/renderergl_utils.h" -#include "libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h" #include "libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.h" #include "libANGLE/renderer/gl/wgl/FunctionsWGL.h" #include "libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.h" #include "libANGLE/renderer/gl/wgl/WindowSurfaceWGL.h" #include "libANGLE/renderer/gl/wgl/wgl_utils.h" -#include "platform/Platform.h" - #include <EGL/eglext.h> #include <string> #include <sstream> @@ -63,7 +60,7 @@ DisplayWGL::DisplayWGL() mOpenGLModule(nullptr), mFunctionsWGL(nullptr), mFunctionsGL(nullptr), - mHasRobustness(false), + mHasARBCreateContextRobustness(false), mWindowClass(0), mWindow(nullptr), mDeviceContext(nullptr), @@ -178,7 +175,7 @@ egl::Error DisplayWGL::initialize(egl::Display *display) // Reinitialize the wgl functions to grab the extensions mFunctionsWGL->initialize(mOpenGLModule, dummyDeviceContext); - bool hasWGLCreateContextRobustness = + mHasARBCreateContextRobustness = mFunctionsWGL->hasExtension("WGL_ARB_create_context_robustness"); // Destroy the dummy window and context @@ -267,7 +264,7 @@ egl::Error DisplayWGL::initialize(egl::Display *display) std::vector<int> contextCreationAttributes; - if (hasWGLCreateContextRobustness) + if (mHasARBCreateContextRobustness) { contextCreationAttributes.push_back(WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB); contextCreationAttributes.push_back(WGL_LOSE_CONTEXT_ON_RESET_ARB); @@ -343,17 +340,9 @@ egl::Error DisplayWGL::initialize(egl::Display *display) mFunctionsGL = new FunctionsGLWindows(mOpenGLModule, mFunctionsWGL->getProcAddress); mFunctionsGL->initialize(); - mHasRobustness = mFunctionsGL->getGraphicsResetStatus != nullptr; - if (hasWGLCreateContextRobustness != mHasRobustness) - { - ANGLEPlatformCurrent()->logWarning( - "WGL_ARB_create_context_robustness exists but unable to OpenGL context with " - "robustness."); - } - // Intel OpenGL ES drivers are not currently supported due to bugs in the driver and ANGLE VendorID vendor = GetVendorID(mFunctionsGL); - if (requestedDisplayType == EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE && IsIntel(vendor)) + if (requestedDisplayType == EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE && vendor == VENDOR_ID_INTEL) { return egl::Error(EGL_NOT_INITIALIZED, "Intel OpenGL ES drivers are not supported."); } @@ -369,7 +358,7 @@ egl::Error DisplayWGL::initialize(egl::Display *display) GetWindowThreadProcessId(nativeWindow, &windowProcessId); // AMD drivers advertise the WGL_NV_DX_interop and WGL_NV_DX_interop2 extensions but fail - mUseDXGISwapChains = !IsAMD(vendor) && (currentProcessId != windowProcessId); + mUseDXGISwapChains = vendor != VENDOR_ID_AMD && (currentProcessId != windowProcessId); } else { @@ -465,13 +454,11 @@ SurfaceImpl *DisplayWGL::createPbufferSurface(const egl::SurfaceState &state, SurfaceImpl *DisplayWGL::createPbufferFromClientBuffer(const egl::SurfaceState &state, const egl::Config *configuration, - EGLenum buftype, - EGLClientBuffer clientBuffer, + EGLClientBuffer shareHandle, const egl::AttributeMap &attribs) { - ASSERT(buftype == EGL_D3D_TEXTURE_ANGLE); - return new D3DTextureSurfaceWGL(state, getRenderer(), clientBuffer, this, mWGLContext, - mDeviceContext, mFunctionsGL, mFunctionsWGL); + UNIMPLEMENTED(); + return nullptr; } SurfaceImpl *DisplayWGL::createPixmapSurface(const egl::SurfaceState &state, @@ -566,7 +553,7 @@ egl::ConfigSet DisplayWGL::generateConfigs() bool DisplayWGL::testDeviceLost() { - if (mHasRobustness) + if (mHasARBCreateContextRobustness) { return getRenderer()->getResetStatus() != GL_NO_ERROR; } @@ -584,21 +571,6 @@ bool DisplayWGL::isValidNativeWindow(EGLNativeWindowType window) const return (IsWindow(window) == TRUE); } -egl::Error DisplayWGL::validateClientBuffer(const egl::Config *configuration, - EGLenum buftype, - EGLClientBuffer clientBuffer, - const egl::AttributeMap &attribs) const -{ - switch (buftype) - { - case EGL_D3D_TEXTURE_ANGLE: - return D3DTextureSurfaceWGL::ValidateD3DTextureClientBuffer(clientBuffer); - - default: - return DisplayGL::validateClientBuffer(configuration, buftype, clientBuffer, attribs); - } -} - std::string DisplayWGL::getVendorString() const { //UNIMPLEMENTED(); @@ -661,9 +633,7 @@ void DisplayWGL::generateExtensions(egl::DisplayExtensions *outExtensions) const outExtensions->postSubBuffer = mUseDXGISwapChains; outExtensions->surfaceOrientation = mUseDXGISwapChains; - outExtensions->createContextRobustness = mHasRobustness; - - outExtensions->d3dTextureClientBuffer = mFunctionsWGL->hasExtension("WGL_NV_DX_interop2"); + outExtensions->createContextRobustness = mHasARBCreateContextRobustness; } void DisplayWGL::generateCaps(egl::Caps *outCaps) const |