Commit 0305320f by Geoff Lang

WGL Pbuffer implementation.

BUG:angleproject:890 Change-Id: Id6e04117ddf7bde3ffb0d9e4cef6db3d07039a54 Reviewed-on: https://chromium-review.googlesource.com/261410Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 1239ee94
...@@ -60,7 +60,7 @@ Surface::~Surface() ...@@ -60,7 +60,7 @@ Surface::~Surface()
{ {
if (mImplementation) if (mImplementation)
{ {
mImplementation->releaseTexImage(mTexture->id()); mImplementation->releaseTexImage(EGL_BACK_BUFFER);
} }
mTexture->releaseTexImage(); mTexture->releaseTexImage();
mTexture = NULL; mTexture = NULL;
......
...@@ -342,12 +342,26 @@ gl::Error TextureGL::generateMipmaps() ...@@ -342,12 +342,26 @@ gl::Error TextureGL::generateMipmaps()
void TextureGL::bindTexImage(egl::Surface *surface) void TextureGL::bindTexImage(egl::Surface *surface)
{ {
UNIMPLEMENTED(); ASSERT(mTextureType == GL_TEXTURE_2D);
// Make sure this texture is bound
mStateManager->bindTexture(mTextureType, mTextureID);
} }
void TextureGL::releaseTexImage() void TextureGL::releaseTexImage()
{ {
UNIMPLEMENTED(); // Not all Surface implementations reset the size of mip 0 when releasing, do it manually
ASSERT(mTextureType == GL_TEXTURE_2D);
mStateManager->bindTexture(mTextureType, mTextureID);
if (UseTexImage2D(mTextureType))
{
mFunctions->texImage2D(mTextureType, 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
}
else
{
UNREACHABLE();
}
} }
template <typename T> template <typename T>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "libANGLE/Surface.h" #include "libANGLE/Surface.h"
#include "libANGLE/renderer/gl/renderergl_utils.h" #include "libANGLE/renderer/gl/renderergl_utils.h"
#include "libANGLE/renderer/gl/wgl/FunctionsWGL.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/WindowSurfaceWGL.h"
#include "libANGLE/renderer/gl/wgl/wgl_utils.h" #include "libANGLE/renderer/gl/wgl/wgl_utils.h"
...@@ -349,8 +350,23 @@ egl::Error DisplayWGL::createWindowSurface(const egl::Config *configuration, EGL ...@@ -349,8 +350,23 @@ egl::Error DisplayWGL::createWindowSurface(const egl::Config *configuration, EGL
egl::Error DisplayWGL::createPbufferSurface(const egl::Config *configuration, const egl::AttributeMap &attribs, egl::Error DisplayWGL::createPbufferSurface(const egl::Config *configuration, const egl::AttributeMap &attribs,
SurfaceImpl **outSurface) SurfaceImpl **outSurface)
{ {
UNIMPLEMENTED(); EGLint width = attribs.get(EGL_WIDTH, 0);
return egl::Error(EGL_BAD_DISPLAY); EGLint height = attribs.get(EGL_HEIGHT, 0);
bool largest = (attribs.get(EGL_LARGEST_PBUFFER, EGL_FALSE) == EGL_TRUE);
EGLenum textureFormat = attribs.get(EGL_TEXTURE_FORMAT, EGL_NO_TEXTURE);
EGLenum textureTarget = attribs.get(EGL_TEXTURE_TARGET, EGL_NO_TEXTURE);
PbufferSurfaceWGL *surface = new PbufferSurfaceWGL(width, height, textureFormat, textureTarget, largest,
mPixelFormat, mDeviceContext, mWGLContext, mFunctionsWGL);
egl::Error error = surface->initialize();
if (error.isError())
{
SafeDelete(surface);
return error;
}
*outSurface = surface;
return egl::Error(EGL_SUCCESS);
} }
egl::Error DisplayWGL::createPbufferFromClientBuffer(const egl::Config *configuration, EGLClientBuffer shareHandle, egl::Error DisplayWGL::createPbufferFromClientBuffer(const egl::Config *configuration, EGLClientBuffer shareHandle,
...@@ -367,6 +383,17 @@ egl::Error DisplayWGL::createPixmapSurface(const egl::Config *configuration, Nat ...@@ -367,6 +383,17 @@ egl::Error DisplayWGL::createPixmapSurface(const egl::Config *configuration, Nat
return egl::Error(EGL_BAD_DISPLAY); return egl::Error(EGL_BAD_DISPLAY);
} }
static int QueryWGLFormatAttrib(HDC dc, int format, int attribName, const FunctionsWGL *functions)
{
int result = 0;
if (functions->getPixelFormatAttribivARB == nullptr ||
!functions->getPixelFormatAttribivARB(dc, format, 0, 1, &attribName, &result))
{
return 0;
}
return result;
}
egl::ConfigSet DisplayWGL::generateConfigs() const egl::ConfigSet DisplayWGL::generateConfigs() const
{ {
egl::ConfigSet configs; egl::ConfigSet configs;
...@@ -393,8 +420,8 @@ egl::ConfigSet DisplayWGL::generateConfigs() const ...@@ -393,8 +420,8 @@ egl::ConfigSet DisplayWGL::generateConfigs() const
config.luminanceSize = 0; config.luminanceSize = 0;
config.alphaSize = pixelFormatDescriptor.cAlphaBits; config.alphaSize = pixelFormatDescriptor.cAlphaBits;
config.alphaMaskSize = 0; config.alphaMaskSize = 0;
config.bindToTextureRGB = EGL_FALSE; config.bindToTextureRGB = (QueryWGLFormatAttrib(mDeviceContext, mPixelFormat, WGL_BIND_TO_TEXTURE_RGB_ARB, mFunctionsWGL) == TRUE);
config.bindToTextureRGBA = EGL_FALSE; config.bindToTextureRGBA = (QueryWGLFormatAttrib(mDeviceContext, mPixelFormat, WGL_BIND_TO_TEXTURE_RGBA_ARB, mFunctionsWGL) == TRUE);
config.colorBufferType = EGL_RGB_BUFFER; config.colorBufferType = EGL_RGB_BUFFER;
config.configCaveat = EGL_NONE; config.configCaveat = EGL_NONE;
config.configID = mPixelFormat; config.configID = mPixelFormat;
...@@ -402,9 +429,9 @@ egl::ConfigSet DisplayWGL::generateConfigs() const ...@@ -402,9 +429,9 @@ egl::ConfigSet DisplayWGL::generateConfigs() const
config.depthSize = pixelFormatDescriptor.cDepthBits; config.depthSize = pixelFormatDescriptor.cDepthBits;
config.level = 0; config.level = 0;
config.matchNativePixmap = EGL_NONE; config.matchNativePixmap = EGL_NONE;
config.maxPBufferWidth = 0; // TODO config.maxPBufferWidth = QueryWGLFormatAttrib(mDeviceContext, mPixelFormat, WGL_MAX_PBUFFER_WIDTH_ARB, mFunctionsWGL);
config.maxPBufferHeight = 0; // TODO config.maxPBufferHeight = QueryWGLFormatAttrib(mDeviceContext, mPixelFormat, WGL_MAX_PBUFFER_HEIGHT_ARB, mFunctionsWGL);
config.maxPBufferPixels = 0; // TODO config.maxPBufferPixels = QueryWGLFormatAttrib(mDeviceContext, mPixelFormat, WGL_MAX_PBUFFER_PIXELS_ARB, mFunctionsWGL);
config.maxSwapInterval = maxSwapInterval; config.maxSwapInterval = maxSwapInterval;
config.minSwapInterval = minSwapInterval; config.minSwapInterval = minSwapInterval;
config.nativeRenderable = EGL_TRUE; // Direct rendering config.nativeRenderable = EGL_TRUE; // Direct rendering
...@@ -414,8 +441,8 @@ egl::ConfigSet DisplayWGL::generateConfigs() const ...@@ -414,8 +441,8 @@ egl::ConfigSet DisplayWGL::generateConfigs() const
config.sampleBuffers = 0; // FIXME: enumerate multi-sampling config.sampleBuffers = 0; // FIXME: enumerate multi-sampling
config.samples = 0; config.samples = 0;
config.stencilSize = pixelFormatDescriptor.cStencilBits; config.stencilSize = pixelFormatDescriptor.cStencilBits;
config.surfaceType = ((pixelFormatDescriptor.dwFlags & PFD_DRAW_TO_WINDOW) ? EGL_WINDOW_BIT : 0) | config.surfaceType = ((pixelFormatDescriptor.dwFlags & PFD_DRAW_TO_WINDOW) ? EGL_WINDOW_BIT : 0) |
((pixelFormatDescriptor.dwFlags & PFD_DRAW_TO_BITMAP) ? EGL_PBUFFER_BIT : 0) | ((QueryWGLFormatAttrib(mDeviceContext, mPixelFormat, WGL_DRAW_TO_PBUFFER_ARB, mFunctionsWGL) == TRUE) ? EGL_PBUFFER_BIT : 0) |
EGL_SWAP_BEHAVIOR_PRESERVED_BIT; EGL_SWAP_BEHAVIOR_PRESERVED_BIT;
config.transparentType = EGL_NONE; config.transparentType = EGL_NONE;
config.transparentRedValue = 0; config.transparentRedValue = 0;
......
...@@ -68,7 +68,15 @@ FunctionsWGL::FunctionsWGL() ...@@ -68,7 +68,15 @@ FunctionsWGL::FunctionsWGL()
getPixelFormatAttribivARB(nullptr), getPixelFormatAttribivARB(nullptr),
getExtensionStringEXT(nullptr), getExtensionStringEXT(nullptr),
getExtensionStringARB(nullptr), getExtensionStringARB(nullptr),
swapIntervalEXT(nullptr) swapIntervalEXT(nullptr),
createPbufferARB(nullptr),
getPbufferDCARB(nullptr),
releasePbufferDCARB(nullptr),
destroyPbufferARB(nullptr),
queryPbufferARB(nullptr),
bindTexImageARB(nullptr),
releaseTexImageARB(nullptr),
setPbufferAttribARB(nullptr)
{ {
} }
...@@ -116,6 +124,18 @@ void FunctionsWGL::intialize(HMODULE glModule, HDC context) ...@@ -116,6 +124,18 @@ void FunctionsWGL::intialize(HMODULE glModule, HDC context)
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_create_context", "wglCreateContextAttribsARB", &createContextAttribsARB); GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_create_context", "wglCreateContextAttribsARB", &createContextAttribsARB);
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_pixel_format", "wglGetPixelFormatAttribivARB", &getPixelFormatAttribivARB); GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_pixel_format", "wglGetPixelFormatAttribivARB", &getPixelFormatAttribivARB);
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_EXT_swap_control", "wglSwapIntervalEXT", &swapIntervalEXT); GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_EXT_swap_control", "wglSwapIntervalEXT", &swapIntervalEXT);
// WGL_ARB_pbuffer
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_pbuffer", "wglCreatePbufferARB", &createPbufferARB);
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_pbuffer", "wglGetPbufferDCARB", &getPbufferDCARB);
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_pbuffer", "wglReleasePbufferDCARB", &releasePbufferDCARB);
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_pbuffer", "wglDestroyPbufferARB", &destroyPbufferARB);
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_pbuffer", "wglQueryPbufferARB", &queryPbufferARB);
// WGL_ARB_render_texture
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_render_texture", "wglBindTexImageARB", &bindTexImageARB);
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_render_texture", "wglReleaseTexImageARB", &releaseTexImageARB);
GetWGLExtensionProcAddress(glModule, getProcAddress, extensions, "WGL_ARB_render_texture", "wglSetPbufferAttribARB", &setPbufferAttribARB);
} }
} }
...@@ -48,6 +48,18 @@ class FunctionsWGL : angle::NonCopyable ...@@ -48,6 +48,18 @@ class FunctionsWGL : angle::NonCopyable
PFNWGLGETEXTENSIONSSTRINGEXTPROC getExtensionStringEXT; PFNWGLGETEXTENSIONSSTRINGEXTPROC getExtensionStringEXT;
PFNWGLGETEXTENSIONSSTRINGARBPROC getExtensionStringARB; PFNWGLGETEXTENSIONSSTRINGARBPROC getExtensionStringARB;
PFNWGLSWAPINTERVALEXTPROC swapIntervalEXT; PFNWGLSWAPINTERVALEXTPROC swapIntervalEXT;
// WGL_ARB_pbuffer
PFNWGLCREATEPBUFFERARBPROC createPbufferARB;
PFNWGLGETPBUFFERDCARBPROC getPbufferDCARB;
PFNWGLRELEASEPBUFFERDCARBPROC releasePbufferDCARB;
PFNWGLDESTROYPBUFFERARBPROC destroyPbufferARB;
PFNWGLQUERYPBUFFERARBPROC queryPbufferARB;
// WGL_ARB_render_texture
PFNWGLBINDTEXIMAGEARBPROC bindTexImageARB;
PFNWGLRELEASETEXIMAGEARBPROC releaseTexImageARB;
PFNWGLSETPBUFFERATTRIBARBPROC setPbufferAttribARB;
}; };
} }
//
// 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.
//
// SurfaceWGL.cpp: WGL implementation of egl::Surface
#include "libANGLE/renderer/gl/wgl/PBufferSurfaceWGL.h"
#include "common/debug.h"
#include "libANGLE/renderer/gl/wgl/FunctionsWGL.h"
#include "libANGLE/renderer/gl/wgl/wgl_utils.h"
namespace rx
{
PbufferSurfaceWGL::PbufferSurfaceWGL(EGLint width, EGLint height, EGLenum textureFormat, EGLenum textureTarget,
bool largest, int pixelFormat, HDC deviceContext, HGLRC wglContext,
const FunctionsWGL *functions)
: SurfaceGL(),
mWidth(width),
mHeight(height),
mLargest(largest),
mTextureFormat(textureFormat),
mTextureTarget(textureTarget),
mPixelFormat(pixelFormat),
mParentDeviceContext(deviceContext),
mShareWGLContext(wglContext),
mPbuffer(nullptr),
mPbufferDeviceContext(nullptr),
mFunctionsWGL(functions)
{
}
PbufferSurfaceWGL::~PbufferSurfaceWGL()
{
mFunctionsWGL->releasePbufferDCARB(mPbuffer, mPbufferDeviceContext);
mPbufferDeviceContext = nullptr;
mFunctionsWGL->destroyPbufferARB(mPbuffer);
mPbuffer = nullptr;
}
static int GetWGLTextureType(EGLenum eglTextureType)
{
switch (eglTextureType)
{
case EGL_NO_TEXTURE: return WGL_NO_TEXTURE_ARB;
case EGL_TEXTURE_RGB: return WGL_TEXTURE_RGB_ARB;
case EGL_TEXTURE_RGBA: return WGL_TEXTURE_RGBA_ARB;
default: UNREACHABLE(); return 0;
}
}
static int GetWGLTextureTarget(EGLenum eglTextureTarget)
{
switch (eglTextureTarget)
{
case EGL_NO_TEXTURE: return WGL_NO_TEXTURE_ARB;
case EGL_TEXTURE_2D: return WGL_TEXTURE_2D_ARB;
default: UNREACHABLE(); return 0;
}
}
egl::Error PbufferSurfaceWGL::initialize()
{
const int pbufferCreationAttributes[] =
{
WGL_PBUFFER_LARGEST_ARB, mLargest ? 1 : 0,
WGL_TEXTURE_FORMAT_ARB, GetWGLTextureType(mTextureFormat),
WGL_TEXTURE_TARGET_ARB, GetWGLTextureTarget(mTextureTarget),
0, 0,
};
mPbuffer = mFunctionsWGL->createPbufferARB(mParentDeviceContext, mPixelFormat, mWidth, mHeight,
pbufferCreationAttributes);
if (mPbuffer == nullptr)
{
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to create a native WGL pbuffer, error: 0x%08x.", HRESULT_CODE(error));
}
// The returned pbuffer may not be as large as requested, update the size members.
if (mFunctionsWGL->queryPbufferARB(mPbuffer, WGL_PBUFFER_WIDTH_ARB, &mWidth) != TRUE ||
mFunctionsWGL->queryPbufferARB(mPbuffer, WGL_PBUFFER_HEIGHT_ARB, &mHeight) != TRUE)
{
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to query the WGL pbuffer's dimensions, error: 0x%08x.", HRESULT_CODE(error));
}
mPbufferDeviceContext = mFunctionsWGL->getPbufferDCARB(mPbuffer);
if (mPbufferDeviceContext == nullptr)
{
mFunctionsWGL->destroyPbufferARB(mPbuffer);
mPbuffer = nullptr;
DWORD error = GetLastError();
return egl::Error(EGL_BAD_ALLOC, "Failed to get the WGL pbuffer handle, error: 0x%08x.", HRESULT_CODE(error));
}
return egl::Error(EGL_SUCCESS);
}
egl::Error PbufferSurfaceWGL::makeCurrent()
{
if (!mFunctionsWGL->makeCurrent(mPbufferDeviceContext, mShareWGLContext))
{
// TODO: What error type here?
return egl::Error(EGL_CONTEXT_LOST, "Failed to make the WGL context current.");
}
return egl::Error(EGL_SUCCESS);
}
egl::Error PbufferSurfaceWGL::swap()
{
return egl::Error(EGL_SUCCESS);
}
egl::Error PbufferSurfaceWGL::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
{
return egl::Error(EGL_SUCCESS);
}
egl::Error PbufferSurfaceWGL::querySurfacePointerANGLE(EGLint attribute, void **value)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
static int GetWGLBufferBindTarget(EGLint buffer)
{
switch (buffer)
{
case EGL_BACK_BUFFER: return WGL_BACK_LEFT_ARB;
default: UNREACHABLE(); return 0;
}
}
egl::Error PbufferSurfaceWGL::bindTexImage(EGLint buffer)
{
if (!mFunctionsWGL->bindTexImageARB(mPbuffer, GetWGLBufferBindTarget(buffer)))
{
DWORD error = GetLastError();
return egl::Error(EGL_BAD_SURFACE, "Failed to bind native wgl pbuffer, error: 0x%08x.", HRESULT_CODE(error));
}
return egl::Error(EGL_SUCCESS);
}
egl::Error PbufferSurfaceWGL::releaseTexImage(EGLint buffer)
{
if (!mFunctionsWGL->releaseTexImageARB(mPbuffer, GetWGLBufferBindTarget(buffer)))
{
DWORD error = GetLastError();
return egl::Error(EGL_BAD_SURFACE, "Failed to unbind native wgl pbuffer, error: 0x%08x.", HRESULT_CODE(error));
}
return egl::Error(EGL_SUCCESS);
}
void PbufferSurfaceWGL::setSwapInterval(EGLint interval)
{
}
EGLint PbufferSurfaceWGL::getWidth() const
{
return mWidth;
}
EGLint PbufferSurfaceWGL::getHeight() const
{
return mHeight;
}
EGLint PbufferSurfaceWGL::isPostSubBufferSupported() const
{
return EGL_FALSE;
}
}
//
// 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.
//
// PBufferSurfaceWGL.h: WGL implementation of egl::Surface for PBuffers
#ifndef LIBANGLE_RENDERER_GL_WGL_PBUFFERSURFACEWGL_H_
#define LIBANGLE_RENDERER_GL_WGL_PBUFFERSURFACEWGL_H_
#include "libANGLE/renderer/gl/SurfaceGL.h"
#include <GL/wglext.h>
namespace rx
{
class FunctionsWGL;
class PbufferSurfaceWGL : public SurfaceGL
{
public:
PbufferSurfaceWGL(EGLint width, EGLint height, EGLenum textureFormat, EGLenum textureTarget,
bool largest, int pixelFormat, HDC deviceContext, HGLRC wglContext,
const FunctionsWGL *functions);
~PbufferSurfaceWGL() override;
egl::Error initialize();
egl::Error makeCurrent() 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(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;
private:
EGLint mWidth;
EGLint mHeight;
bool mLargest;
EGLenum mTextureFormat;
EGLenum mTextureTarget;
int mPixelFormat;
HGLRC mShareWGLContext;
HDC mParentDeviceContext;
HPBUFFERARB mPbuffer;
HDC mPbufferDeviceContext;
const FunctionsWGL *mFunctionsWGL;
};
}
#endif // LIBANGLE_RENDERER_GL_WGL_PBUFFERSURFACEWGL_H_
...@@ -417,6 +417,8 @@ ...@@ -417,6 +417,8 @@
'libANGLE/renderer/gl/wgl/DisplayWGL.h', 'libANGLE/renderer/gl/wgl/DisplayWGL.h',
'libANGLE/renderer/gl/wgl/FunctionsWGL.cpp', 'libANGLE/renderer/gl/wgl/FunctionsWGL.cpp',
'libANGLE/renderer/gl/wgl/FunctionsWGL.h', 'libANGLE/renderer/gl/wgl/FunctionsWGL.h',
'libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.cpp',
'libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.h',
'libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp', 'libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp',
'libANGLE/renderer/gl/wgl/WindowSurfaceWGL.h', 'libANGLE/renderer/gl/wgl/WindowSurfaceWGL.h',
'libANGLE/renderer/gl/wgl/functionswgl_typedefs.h', 'libANGLE/renderer/gl/wgl/functionswgl_typedefs.h',
......
...@@ -781,7 +781,12 @@ EGLBoolean EGLAPIENTRY BindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint b ...@@ -781,7 +781,12 @@ EGLBoolean EGLAPIENTRY BindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint b
return EGL_FALSE; return EGL_FALSE;
} }
eglSurface->bindTexImage(textureObject, buffer); egl::Error error = eglSurface->bindTexImage(textureObject, buffer);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
} }
SetGlobalError(Error(EGL_SUCCESS)); SetGlobalError(Error(EGL_SUCCESS));
...@@ -845,7 +850,12 @@ EGLBoolean EGLAPIENTRY ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLin ...@@ -845,7 +850,12 @@ EGLBoolean EGLAPIENTRY ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLin
if (texture) if (texture)
{ {
eglSurface->releaseTexImage(buffer); egl::Error error = eglSurface->releaseTexImage(buffer);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
} }
SetGlobalError(Error(EGL_SUCCESS)); SetGlobalError(Error(EGL_SUCCESS));
......
#include "ANGLETest.h" #include "ANGLETest.h"
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_TYPED_TEST_CASE(PbufferTest, ES2_D3D9, ES2_D3D11); ANGLE_TYPED_TEST_CASE(PbufferTest, ES2_D3D9, ES2_D3D11, ES2_OPENGL);
template<typename T> template<typename T>
class PbufferTest : public ANGLETest class PbufferTest : public ANGLETest
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment