summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/libANGLE/renderer/gl/wgl
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
commit4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 (patch)
treef000dd831240707a03b8c806db292c2a15cde3ce /gfx/angle/src/libANGLE/renderer/gl/wgl
parent3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff)
downloadUXP-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/renderer/gl/wgl')
-rw-r--r--gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp384
-rw-r--r--gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h86
-rwxr-xr-xgfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp4
-rwxr-xr-xgfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.h1
-rwxr-xr-xgfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp50
-rwxr-xr-xgfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.h9
6 files changed, 13 insertions, 521 deletions
diff --git a/gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp b/gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp
deleted file mode 100644
index f19e8fdf3..000000000
--- a/gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-//
-// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// D3DTextureSurfaceWGL.cpp: WGL implementation of egl::Surface for D3D texture interop.
-
-#include "libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h"
-
-#include "libANGLE/renderer/gl/FramebufferGL.h"
-#include "libANGLE/renderer/gl/TextureGL.h"
-#include "libANGLE/renderer/gl/RendererGL.h"
-#include "libANGLE/renderer/gl/StateManagerGL.h"
-#include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
-#include "libANGLE/renderer/gl/wgl/FunctionsWGL.h"
-
-namespace rx
-{
-
-namespace
-{
-
-egl::Error GetD3DTextureInfo(EGLClientBuffer clientBuffer,
- size_t *width,
- size_t *height,
- IUnknown **object,
- IUnknown **device)
-{
- IUnknown *buffer = static_cast<IUnknown *>(clientBuffer);
-
- IDirect3DTexture9 *texture9 = nullptr;
- ID3D11Texture2D *texture11 = nullptr;
- if (SUCCEEDED(buffer->QueryInterface<ID3D11Texture2D>(&texture11)))
- {
- D3D11_TEXTURE2D_DESC textureDesc;
- texture11->GetDesc(&textureDesc);
-
- // From table egl.restrictions in EGL_ANGLE_d3d_texture_client_buffer.
- switch (textureDesc.Format)
- {
- case DXGI_FORMAT_R8G8B8A8_UNORM:
- case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
- case DXGI_FORMAT_B8G8R8A8_UNORM:
- case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
- case DXGI_FORMAT_R16G16B16A16_FLOAT:
- case DXGI_FORMAT_R32G32B32A32_FLOAT:
- break;
-
- default:
- SafeRelease(texture11);
- return egl::Error(EGL_BAD_PARAMETER, "Unknown client buffer texture format: %u.",
- textureDesc.Format);
- }
-
- ID3D11Device *d3d11Device = nullptr;
- texture11->GetDevice(&d3d11Device);
- if (d3d11Device == nullptr)
- {
- SafeRelease(texture11);
- return egl::Error(EGL_BAD_PARAMETER,
- "Could not query the D3D11 device from the client buffer.");
- }
-
- if (width)
- {
- *width = textureDesc.Width;
- }
- if (height)
- {
- *height = textureDesc.Height;
- }
-
- if (device)
- {
- *device = d3d11Device;
- }
- else
- {
- SafeRelease(d3d11Device);
- }
-
- if (object)
- {
- *object = texture11;
- }
- else
- {
- SafeRelease(texture11);
- }
-
- return egl::Error(EGL_SUCCESS);
- }
- else if (SUCCEEDED(buffer->QueryInterface<IDirect3DTexture9>(&texture9)))
- {
- D3DSURFACE_DESC surfaceDesc;
- if (FAILED(texture9->GetLevelDesc(0, &surfaceDesc)))
- {
- SafeRelease(texture9);
- return egl::Error(EGL_BAD_PARAMETER,
- "Could not query description of the D3D9 surface.");
- }
-
- // From table egl.restrictions in EGL_ANGLE_d3d_texture_client_buffer.
- switch (surfaceDesc.Format)
- {
- case D3DFMT_R8G8B8:
- case D3DFMT_A8R8G8B8:
- case D3DFMT_A16B16G16R16F:
- case D3DFMT_A32B32G32R32F:
- break;
-
- default:
- SafeRelease(texture9);
- return egl::Error(EGL_BAD_PARAMETER, "Unknown client buffer texture format: %u.",
- surfaceDesc.Format);
- }
-
- if (width)
- {
- *width = surfaceDesc.Width;
- }
- if (height)
- {
- *height = surfaceDesc.Height;
- }
-
- IDirect3DDevice9 *d3d9Device = nullptr;
- HRESULT result = texture9->GetDevice(&d3d9Device);
- if (FAILED(result))
- {
- SafeRelease(texture9);
- return egl::Error(EGL_BAD_PARAMETER,
- "Could not query the D3D9 device from the client buffer.");
- }
-
- if (device)
- {
- *device = d3d9Device;
- }
- else
- {
- SafeRelease(d3d9Device);
- }
-
- if (object)
- {
- *object = texture9;
- }
- else
- {
- SafeRelease(texture9);
- }
-
- return egl::Error(EGL_SUCCESS);
- }
- else
- {
- return egl::Error(EGL_BAD_PARAMETER,
- "Provided buffer is not a IDirect3DTexture9 or ID3D11Texture2D.");
- }
-}
-
-} // anonymous namespace
-
-D3DTextureSurfaceWGL::D3DTextureSurfaceWGL(const egl::SurfaceState &state,
- RendererGL *renderer,
- EGLClientBuffer clientBuffer,
- DisplayWGL *display,
- HGLRC wglContext,
- HDC deviceContext,
- const FunctionsGL *functionsGL,
- const FunctionsWGL *functionsWGL)
- : SurfaceGL(state, renderer),
- mClientBuffer(clientBuffer),
- mRenderer(renderer),
- mDisplay(display),
- mStateManager(renderer->getStateManager()),
- mWorkarounds(renderer->getWorkarounds()),
- mFunctionsGL(functionsGL),
- mFunctionsWGL(functionsWGL),
- mWGLContext(wglContext),
- mDeviceContext(deviceContext),
- mWidth(0),
- mHeight(0),
- mDeviceHandle(nullptr),
- mObject(nullptr),
- mBoundObjectTextureHandle(nullptr),
- mBoundObjectRenderbufferHandle(nullptr),
- mRenderbufferID(0),
- mFramebufferID(0)
-{
-}
-
-D3DTextureSurfaceWGL::~D3DTextureSurfaceWGL()
-{
- ASSERT(mBoundObjectTextureHandle == nullptr);
-
- SafeRelease(mObject);
-
- if (mDeviceHandle)
- {
- if (mBoundObjectRenderbufferHandle)
- {
- mFunctionsWGL->dxUnregisterObjectNV(mDeviceHandle, mBoundObjectRenderbufferHandle);
- mBoundObjectRenderbufferHandle = nullptr;
- }
- mStateManager->deleteRenderbuffer(mRenderbufferID);
-
- if (mBoundObjectTextureHandle)
- {
- mFunctionsWGL->dxUnregisterObjectNV(mDeviceHandle, mBoundObjectTextureHandle);
- mBoundObjectTextureHandle = nullptr;
- }
-
- // GL framebuffer is deleted by the default framebuffer object
- mFramebufferID = 0;
-
- mDisplay->releaseD3DDevice(mDeviceHandle);
- mDeviceHandle = nullptr;
- }
-}
-
-egl::Error D3DTextureSurfaceWGL::ValidateD3DTextureClientBuffer(EGLClientBuffer clientBuffer)
-{
- return GetD3DTextureInfo(clientBuffer, nullptr, nullptr, nullptr, nullptr);
-}
-
-egl::Error D3DTextureSurfaceWGL::initialize()
-{
- IUnknown *device = nullptr;
- ANGLE_TRY(GetD3DTextureInfo(mClientBuffer, &mWidth, &mHeight, &mObject, &device));
-
- ASSERT(device != nullptr);
- egl::Error error = mDisplay->registerD3DDevice(device, &mDeviceHandle);
- SafeRelease(device);
- if (error.isError())
- {
- return error;
- }
-
- mFunctionsGL->genRenderbuffers(1, &mRenderbufferID);
- mStateManager->bindRenderbuffer(GL_RENDERBUFFER, mRenderbufferID);
- mBoundObjectRenderbufferHandle = mFunctionsWGL->dxRegisterObjectNV(
- mDeviceHandle, mObject, mRenderbufferID, GL_RENDERBUFFER, WGL_ACCESS_READ_WRITE_NV);
- if (mBoundObjectRenderbufferHandle == nullptr)
- {
- return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%08x.",
- HRESULT_CODE(GetLastError()));
- }
-
- mFunctionsGL->genFramebuffers(1, &mFramebufferID);
- mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
- mFunctionsGL->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
- mRenderbufferID);
-
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error D3DTextureSurfaceWGL::makeCurrent()
-{
- if (!mFunctionsWGL->makeCurrent(mDeviceContext, mWGLContext))
- {
- // TODO(geofflang): What error type here?
- return egl::Error(EGL_CONTEXT_LOST, "Failed to make the WGL context current.");
- }
-
- if (!mFunctionsWGL->dxLockObjectsNV(mDeviceHandle, 1, &mBoundObjectRenderbufferHandle))
- {
- DWORD error = GetLastError();
- return egl::Error(EGL_BAD_ALLOC, "Failed to lock object, error: 0x%08x.",
- HRESULT_CODE(error));
- }
-
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error D3DTextureSurfaceWGL::unMakeCurrent()
-{
- if (!mFunctionsWGL->dxUnlockObjectsNV(mDeviceHandle, 1, &mBoundObjectRenderbufferHandle))
- {
- DWORD error = GetLastError();
- return egl::Error(EGL_BAD_ALLOC, "Failed to unlock object, error: 0x%08x.",
- HRESULT_CODE(error));
- }
-
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error D3DTextureSurfaceWGL::swap()
-{
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error D3DTextureSurfaceWGL::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error D3DTextureSurfaceWGL::querySurfacePointerANGLE(EGLint attribute, void **value)
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error D3DTextureSurfaceWGL::bindTexImage(gl::Texture *texture, EGLint buffer)
-{
- ASSERT(mBoundObjectTextureHandle == nullptr);
-
- const TextureGL *textureGL = GetImplAs<TextureGL>(texture);
- GLuint textureID = textureGL->getTextureID();
-
- mBoundObjectTextureHandle = mFunctionsWGL->dxRegisterObjectNV(
- mDeviceHandle, mObject, textureID, GL_TEXTURE_2D, WGL_ACCESS_READ_WRITE_NV);
- if (mBoundObjectTextureHandle == nullptr)
- {
- DWORD error = GetLastError();
- return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%08x.",
- HRESULT_CODE(error));
- }
-
- if (!mFunctionsWGL->dxLockObjectsNV(mDeviceHandle, 1, &mBoundObjectTextureHandle))
- {
- DWORD error = GetLastError();
- return egl::Error(EGL_BAD_ALLOC, "Failed to lock object, error: 0x%08x.",
- HRESULT_CODE(error));
- }
-
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error D3DTextureSurfaceWGL::releaseTexImage(EGLint buffer)
-{
- ASSERT(mBoundObjectTextureHandle != nullptr);
- if (!mFunctionsWGL->dxUnlockObjectsNV(mDeviceHandle, 1, &mBoundObjectTextureHandle))
- {
- DWORD error = GetLastError();
- return egl::Error(EGL_BAD_ALLOC, "Failed to unlock object, error: 0x%08x.",
- HRESULT_CODE(error));
- }
-
- if (!mFunctionsWGL->dxUnregisterObjectNV(mDeviceHandle, mBoundObjectTextureHandle))
- {
- DWORD error = GetLastError();
- return egl::Error(EGL_BAD_ALLOC, "Failed to unregister D3D object, error: 0x%08x.",
- HRESULT_CODE(error));
- }
- mBoundObjectTextureHandle = nullptr;
-
- return egl::Error(EGL_SUCCESS);
-}
-
-void D3DTextureSurfaceWGL::setSwapInterval(EGLint interval)
-{
- UNIMPLEMENTED();
-}
-
-EGLint D3DTextureSurfaceWGL::getWidth() const
-{
- return static_cast<EGLint>(mWidth);
-}
-
-EGLint D3DTextureSurfaceWGL::getHeight() const
-{
- return static_cast<EGLint>(mHeight);
-}
-
-EGLint D3DTextureSurfaceWGL::isPostSubBufferSupported() const
-{
- return EGL_FALSE;
-}
-
-EGLint D3DTextureSurfaceWGL::getSwapBehavior() const
-{
- return EGL_BUFFER_PRESERVED;
-}
-
-FramebufferImpl *D3DTextureSurfaceWGL::createDefaultFramebuffer(const gl::FramebufferState &data)
-{
- return new FramebufferGL(mFramebufferID, data, mFunctionsGL, mWorkarounds,
- mRenderer->getBlitter(), mStateManager);
-}
-} // namespace rx
diff --git a/gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h b/gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h
deleted file mode 100644
index 8fb1d4003..000000000
--- a/gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h
+++ /dev/null
@@ -1,86 +0,0 @@
-
-// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// D3DTextureSurfaceWGL.h: WGL implementation of egl::Surface for D3D texture interop.
-
-#ifndef LIBANGLE_RENDERER_GL_WGL_D3DTEXTIRESURFACEWGL_H_
-#define LIBANGLE_RENDERER_GL_WGL_D3DTEXTIRESURFACEWGL_H_
-
-#include "libANGLE/renderer/gl/SurfaceGL.h"
-
-#include <GL/wglext.h>
-
-namespace rx
-{
-
-class FunctionsGL;
-class FunctionsWGL;
-class DisplayWGL;
-class StateManagerGL;
-struct WorkaroundsGL;
-
-class D3DTextureSurfaceWGL : public SurfaceGL
-{
- public:
- D3DTextureSurfaceWGL(const egl::SurfaceState &state,
- RendererGL *renderer,
- EGLClientBuffer clientBuffer,
- DisplayWGL *display,
- HGLRC wglContext,
- HDC deviceContext,
- const FunctionsGL *functionsGL,
- const FunctionsWGL *functionsWGL);
- ~D3DTextureSurfaceWGL() override;
-
- static egl::Error ValidateD3DTextureClientBuffer(EGLClientBuffer clientBuffer);
-
- egl::Error initialize() override;
- egl::Error makeCurrent() override;
- egl::Error unMakeCurrent() override;
-
- egl::Error swap() override;
- egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
- egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
- egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
- egl::Error releaseTexImage(EGLint buffer) override;
- void setSwapInterval(EGLint interval) override;
-
- EGLint getWidth() const override;
- EGLint getHeight() const override;
-
- EGLint isPostSubBufferSupported() const override;
- EGLint getSwapBehavior() const override;
-
- FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &data) override;
-
- private:
- EGLClientBuffer mClientBuffer;
-
- RendererGL *mRenderer;
-
- DisplayWGL *mDisplay;
- StateManagerGL *mStateManager;
- const WorkaroundsGL &mWorkarounds;
- const FunctionsGL *mFunctionsGL;
- const FunctionsWGL *mFunctionsWGL;
-
- HGLRC mWGLContext;
- HDC mDeviceContext;
-
- size_t mWidth;
- size_t mHeight;
-
- HANDLE mDeviceHandle;
- IUnknown *mObject;
- HANDLE mBoundObjectTextureHandle;
- HANDLE mBoundObjectRenderbufferHandle;
-
- GLuint mRenderbufferID;
- GLuint mFramebufferID;
-};
-} // namespace rx
-
-#endif // LIBANGLE_RENDERER_GL_WGL_D3DTEXTIRESURFACEWGL_H_
diff --git a/gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp b/gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
index 7c5214e82..e07457d10 100755
--- a/gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
+++ b/gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
@@ -36,7 +36,6 @@ DXGISwapChainWindowSurfaceWGL::DXGISwapChainWindowSurfaceWGL(const egl::SurfaceS
mWindow(window),
mStateManager(renderer->getStateManager()),
mWorkarounds(renderer->getWorkarounds()),
- mRenderer(renderer),
mFunctionsGL(functionsGL),
mFunctionsWGL(functionsWGL),
mDevice(device),
@@ -293,8 +292,7 @@ EGLint DXGISwapChainWindowSurfaceWGL::getSwapBehavior() const
FramebufferImpl *DXGISwapChainWindowSurfaceWGL::createDefaultFramebuffer(
const gl::FramebufferState &data)
{
- return new FramebufferGL(mFramebufferID, data, mFunctionsGL, mWorkarounds,
- mRenderer->getBlitter(), mStateManager);
+ return new FramebufferGL(mFramebufferID, data, mFunctionsGL, mWorkarounds, mStateManager);
}
egl::Error DXGISwapChainWindowSurfaceWGL::setObjectsLocked(bool locked)
diff --git a/gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.h b/gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.h
index f516239c9..66444da9b 100755
--- a/gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.h
+++ b/gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.h
@@ -66,7 +66,6 @@ class DXGISwapChainWindowSurfaceWGL : public SurfaceGL
StateManagerGL *mStateManager;
const WorkaroundsGL &mWorkarounds;
- RendererGL *mRenderer;
const FunctionsGL *mFunctionsGL;
const FunctionsWGL *mFunctionsWGL;
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
diff --git a/gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.h b/gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.h
index 509ea9b39..3f56ecf4f 100755
--- a/gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.h
+++ b/gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.h
@@ -37,8 +37,7 @@ class DisplayWGL : public DisplayGL
const egl::AttributeMap &attribs) override;
SurfaceImpl *createPbufferFromClientBuffer(const egl::SurfaceState &state,
const egl::Config *configuration,
- EGLenum buftype,
- EGLClientBuffer clientBuffer,
+ EGLClientBuffer shareHandle,
const egl::AttributeMap &attribs) override;
SurfaceImpl *createPixmapSurface(const egl::SurfaceState &state,
const egl::Config *configuration,
@@ -51,10 +50,6 @@ class DisplayWGL : public DisplayGL
egl::Error restoreLostDevice() override;
bool isValidNativeWindow(EGLNativeWindowType window) const override;
- egl::Error validateClientBuffer(const egl::Config *configuration,
- EGLenum buftype,
- EGLClientBuffer clientBuffer,
- const egl::AttributeMap &attribs) const override;
egl::Error getDevice(DeviceImpl **device) override;
@@ -83,7 +78,7 @@ class DisplayWGL : public DisplayGL
FunctionsWGL *mFunctionsWGL;
FunctionsGL *mFunctionsGL;
- bool mHasRobustness;
+ bool mHasARBCreateContextRobustness;
ATOM mWindowClass;
HWND mWindow;