Commit 79c7e273 by Nicolas Capens

Implement EGL_LARGEST_PBUFFER.

Bug 23041720 Change-Id: I9f6bed0a3d239a0adde9cc4e90cc368f078f3662 Reviewed-on: https://swiftshader-review.googlesource.com/3902Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent f77786ef
...@@ -305,7 +305,7 @@ EGLSurface Display::createWindowSurface(EGLNativeWindowType window, EGLConfig co ...@@ -305,7 +305,7 @@ EGLSurface Display::createWindowSurface(EGLNativeWindowType window, EGLConfig co
return error(EGL_BAD_ALLOC, EGL_NO_SURFACE); return error(EGL_BAD_ALLOC, EGL_NO_SURFACE);
} }
Surface *surface = new Surface(this, configuration, window); Surface *surface = new WindowSurface(this, configuration, window);
if(!surface->initialize()) if(!surface->initialize())
{ {
...@@ -319,61 +319,63 @@ EGLSurface Display::createWindowSurface(EGLNativeWindowType window, EGLConfig co ...@@ -319,61 +319,63 @@ EGLSurface Display::createWindowSurface(EGLNativeWindowType window, EGLConfig co
return success(surface); return success(surface);
} }
EGLSurface Display::createOffscreenSurface(EGLConfig config, const EGLint *attribList) EGLSurface Display::createPBufferSurface(EGLConfig config, const EGLint *attribList)
{ {
EGLint width = 0, height = 0; EGLint width = 0, height = 0;
EGLenum textureFormat = EGL_NO_TEXTURE; EGLenum textureFormat = EGL_NO_TEXTURE;
EGLenum textureTarget = EGL_NO_TEXTURE; EGLenum textureTarget = EGL_NO_TEXTURE;
EGLBoolean largestPBuffer = EGL_FALSE;
const Config *configuration = mConfigSet.get(config); const Config *configuration = mConfigSet.get(config);
if(attribList) if(attribList)
{ {
while(*attribList != EGL_NONE) while(*attribList != EGL_NONE)
{ {
switch (attribList[0]) switch(attribList[0])
{ {
case EGL_WIDTH: case EGL_WIDTH:
width = attribList[1]; width = attribList[1];
break; break;
case EGL_HEIGHT: case EGL_HEIGHT:
height = attribList[1]; height = attribList[1];
break; break;
case EGL_LARGEST_PBUFFER: case EGL_LARGEST_PBUFFER:
if(attribList[1] != EGL_FALSE) largestPBuffer = attribList[1];
UNIMPLEMENTED(); // FIXME
break; break;
case EGL_TEXTURE_FORMAT: case EGL_TEXTURE_FORMAT:
switch (attribList[1]) switch(attribList[1])
{ {
case EGL_NO_TEXTURE: case EGL_NO_TEXTURE:
case EGL_TEXTURE_RGB: case EGL_TEXTURE_RGB:
case EGL_TEXTURE_RGBA: case EGL_TEXTURE_RGBA:
textureFormat = attribList[1]; textureFormat = attribList[1];
break; break;
default: default:
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE); return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
} }
break; break;
case EGL_TEXTURE_TARGET: case EGL_TEXTURE_TARGET:
switch (attribList[1]) switch(attribList[1])
{ {
case EGL_NO_TEXTURE: case EGL_NO_TEXTURE:
case EGL_TEXTURE_2D: case EGL_TEXTURE_2D:
textureTarget = attribList[1]; textureTarget = attribList[1];
break; break;
default: default:
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE); return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
} }
break; break;
case EGL_MIPMAP_TEXTURE: case EGL_MIPMAP_TEXTURE:
if(attribList[1] != EGL_FALSE) if(attribList[1] != EGL_FALSE)
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE); {
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
}
break; break;
case EGL_VG_COLORSPACE: case EGL_VG_COLORSPACE:
return error(EGL_BAD_MATCH, EGL_NO_SURFACE); return error(EGL_BAD_MATCH, EGL_NO_SURFACE);
case EGL_VG_ALPHA_FORMAT: case EGL_VG_ALPHA_FORMAT:
return error(EGL_BAD_MATCH, EGL_NO_SURFACE); return error(EGL_BAD_MATCH, EGL_NO_SURFACE);
default: default:
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE); return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
} }
...@@ -408,7 +410,7 @@ EGLSurface Display::createOffscreenSurface(EGLConfig config, const EGLint *attri ...@@ -408,7 +410,7 @@ EGLSurface Display::createOffscreenSurface(EGLConfig config, const EGLint *attri
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE); return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
} }
Surface *surface = new Surface(this, configuration, width, height, textureFormat, textureTarget); Surface *surface = new PBufferSurface(this, configuration, width, height, textureFormat, textureTarget, largestPBuffer);
if(!surface->initialize()) if(!surface->initialize())
{ {
...@@ -543,21 +545,24 @@ bool Display::hasExistingWindowSurface(EGLNativeWindowType window) ...@@ -543,21 +545,24 @@ bool Display::hasExistingWindowSurface(EGLNativeWindowType window)
{ {
for(SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++) for(SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
{ {
if((*surface)->getWindowHandle() == window) if((*surface)->isWindowSurface())
{ {
return true; if((*surface)->getWindowHandle() == window)
} {
return true;
}
}
} }
return false; return false;
} }
EGLint Display::getMinSwapInterval() EGLint Display::getMinSwapInterval() const
{ {
return mMinSwapInterval; return mMinSwapInterval;
} }
EGLint Display::getMaxSwapInterval() EGLint Display::getMaxSwapInterval() const
{ {
return mMaxSwapInterval; return mMaxSwapInterval;
} }
......
...@@ -39,7 +39,7 @@ namespace egl ...@@ -39,7 +39,7 @@ namespace egl
bool getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value); bool getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value);
EGLSurface createWindowSurface(EGLNativeWindowType window, EGLConfig config, const EGLint *attribList); EGLSurface createWindowSurface(EGLNativeWindowType window, EGLConfig config, const EGLint *attribList);
EGLSurface createOffscreenSurface(EGLConfig config, const EGLint *attribList); EGLSurface createPBufferSurface(EGLConfig config, const EGLint *attribList);
EGLContext createContext(EGLConfig configHandle, const Context *shareContext, EGLint clientVersion); EGLContext createContext(EGLConfig configHandle, const Context *shareContext, EGLint clientVersion);
void destroySurface(Surface *surface); void destroySurface(Surface *surface);
...@@ -52,8 +52,8 @@ namespace egl ...@@ -52,8 +52,8 @@ namespace egl
bool isValidWindow(EGLNativeWindowType window); bool isValidWindow(EGLNativeWindowType window);
bool hasExistingWindowSurface(EGLNativeWindowType window); bool hasExistingWindowSurface(EGLNativeWindowType window);
EGLint getMinSwapInterval(); EGLint getMinSwapInterval() const;
EGLint getMaxSwapInterval(); EGLint getMaxSwapInterval() const;
EGLNativeDisplayType getNativeDisplay() const; EGLNativeDisplayType getNativeDisplay() const;
const char *getExtensionString() const; const char *getExtensionString() const;
......
...@@ -31,13 +31,8 @@ class Image; ...@@ -31,13 +31,8 @@ class Image;
class Surface : public gl::Object class Surface : public gl::Object
{ {
public: public:
Surface(Display *display, const egl::Config *config, EGLNativeWindowType window); virtual bool initialize();
Surface(Display *display, const egl::Config *config, EGLint width, EGLint height, EGLenum textureFormat, EGLenum textureTarget); virtual void swap() = 0;
bool initialize();
void swap();
EGLNativeWindowType getWindowHandle();
virtual egl::Image *getRenderTarget(); virtual egl::Image *getRenderTarget();
virtual egl::Image *getDepthStencil(); virtual egl::Image *getDepthStencil();
...@@ -56,45 +51,78 @@ public: ...@@ -56,45 +51,78 @@ public:
virtual EGLenum getSwapBehavior() const; virtual EGLenum getSwapBehavior() const;
virtual EGLenum getTextureFormat() const; virtual EGLenum getTextureFormat() const;
virtual EGLenum getTextureTarget() const; virtual EGLenum getTextureTarget() const;
virtual EGLBoolean getLargestPBuffer() const;
virtual EGLNativeWindowType getWindowHandle() const = 0;
virtual void setBoundTexture(egl::Texture *texture); virtual void setBoundTexture(egl::Texture *texture);
virtual egl::Texture *getBoundTexture() const; virtual egl::Texture *getBoundTexture() const;
bool checkForResize(); // Returns true if surface changed due to resize virtual bool isWindowSurface() const { return false; }
virtual bool isPBufferSurface() const { return false; }
protected:
Surface(const Display *display, const Config *config);
private:
virtual ~Surface(); virtual ~Surface();
void deleteResources(); virtual void deleteResources();
bool reset();
Display *const mDisplay; const Display *const display;
egl::Image *mDepthStencil; Image *depthStencil;
sw::FrameBuffer *frameBuffer; Image *backBuffer;
egl::Image *backBuffer; Texture *texture;
egl::Texture *mTexture;
bool reset(int backbufferWidth, int backbufferHeight); bool reset(int backbufferWidth, int backbufferHeight);
const EGLNativeWindowType mWindow; // Window that the surface is created for. const Config *const config; // EGL config surface was created with
bool mWindowSubclassed; // Indicates whether we successfully subclassed mWindow for WM_RESIZE hooking EGLint height; // Height of surface
const egl::Config *mConfig; // EGL config surface was created with EGLint width; // Width of surface
EGLint mHeight; // Height of surface // EGLint horizontalResolution; // Horizontal dot pitch
EGLint mWidth; // Width of surface // EGLint verticalResolution; // Vertical dot pitch
// EGLint horizontalResolution; // Horizontal dot pitch EGLBoolean largestPBuffer; // If true, create largest pbuffer possible
// EGLint verticalResolution; // Vertical dot pitch // EGLBoolean mipmapTexture; // True if texture has mipmaps
// EGLBoolean largestPBuffer; // If true, create largest pbuffer possible // EGLint mipmapLevel; // Mipmap level to render to
// EGLBoolean mipmapTexture; // True if texture has mipmaps // EGLenum multisampleResolve; // Multisample resolve behavior
// EGLint mipmapLevel; // Mipmap level to render to EGLint pixelAspectRatio; // Display aspect ratio
// EGLenum multisampleResolve; // Multisample resolve behavior EGLenum renderBuffer; // Render buffer
EGLint mPixelAspectRatio; // Display aspect ratio EGLenum swapBehavior; // Buffer swap behavior
EGLenum mRenderBuffer; // Render buffer EGLenum textureFormat; // Format of texture: RGB, RGBA, or no texture
EGLenum mSwapBehavior; // Buffer swap behavior EGLenum textureTarget; // Type of texture: 2D or no texture
EGLenum mTextureFormat; // Format of texture: RGB, RGBA, or no texture // EGLenum vgAlphaFormat; // Alpha format for OpenVG
EGLenum mTextureTarget; // Type of texture: 2D or no texture // EGLenum vgColorSpace; // Color space for OpenVG
// EGLenum vgAlphaFormat; // Alpha format for OpenVG EGLint swapInterval;
// EGLenum vgColorSpace; // Color space for OpenVG };
EGLint mSwapInterval;
class WindowSurface : public Surface
{
public:
WindowSurface(Display *display, const egl::Config *config, EGLNativeWindowType window);
bool initialize() override;
bool isWindowSurface() const override { return true; }
void swap() override;
EGLNativeWindowType getWindowHandle() const override;
private:
void deleteResources() override;
bool checkForResize();
bool reset(int backBufferWidth, int backBufferHeight);
const EGLNativeWindowType window;
sw::FrameBuffer *frameBuffer;
};
class PBufferSurface : public Surface
{
public:
PBufferSurface(Display *display, const egl::Config *config, EGLint width, EGLint height, EGLenum textureFormat, EGLenum textureTarget, EGLBoolean largestPBuffer);
bool isPBufferSurface() const override { return true; }
void swap() override;
EGLNativeWindowType getWindowHandle() const override;
}; };
} }
......
...@@ -302,7 +302,7 @@ EGLSurface CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint * ...@@ -302,7 +302,7 @@ EGLSurface CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *
return EGL_NO_SURFACE; return EGL_NO_SURFACE;
} }
return display->createOffscreenSurface(config, attrib_list); return display->createPBufferSurface(config, attrib_list);
} }
EGLSurface CreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list) EGLSurface CreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list)
...@@ -380,7 +380,10 @@ EGLBoolean QuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EG ...@@ -380,7 +380,10 @@ EGLBoolean QuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EG
UNIMPLEMENTED(); // FIXME UNIMPLEMENTED(); // FIXME
break; break;
case EGL_LARGEST_PBUFFER: case EGL_LARGEST_PBUFFER:
UNIMPLEMENTED(); // FIXME if(eglSurface->isPBufferSurface()) // For a window or pixmap surface, the contents of *value are not modified.
{
*value = eglSurface->getLargestPBuffer();
}
break; break;
case EGL_MIPMAP_TEXTURE: case EGL_MIPMAP_TEXTURE:
UNIMPLEMENTED(); // FIXME UNIMPLEMENTED(); // FIXME
...@@ -530,7 +533,7 @@ EGLBoolean BindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) ...@@ -530,7 +533,7 @@ EGLBoolean BindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
return error(EGL_BAD_PARAMETER, EGL_FALSE); return error(EGL_BAD_PARAMETER, EGL_FALSE);
} }
if(surface == EGL_NO_SURFACE || eglSurface->getWindowHandle()) if(surface == EGL_NO_SURFACE || eglSurface->isWindowSurface())
{ {
return error(EGL_BAD_SURFACE, EGL_FALSE); return error(EGL_BAD_SURFACE, EGL_FALSE);
} }
...@@ -572,7 +575,7 @@ EGLBoolean ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) ...@@ -572,7 +575,7 @@ EGLBoolean ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
return error(EGL_BAD_PARAMETER, EGL_FALSE); return error(EGL_BAD_PARAMETER, EGL_FALSE);
} }
if(surface == EGL_NO_SURFACE || eglSurface->getWindowHandle()) if(surface == EGL_NO_SURFACE || eglSurface->isWindowSurface())
{ {
return error(EGL_BAD_SURFACE, EGL_FALSE); return error(EGL_BAD_SURFACE, EGL_FALSE);
} }
......
...@@ -2129,7 +2129,7 @@ void Context::applyTextures(sw::SamplerType samplerType) ...@@ -2129,7 +2129,7 @@ void Context::applyTextures(sw::SamplerType samplerType)
} }
else else
{ {
applyTexture(samplerType, samplerIndex, 0); applyTexture(samplerType, samplerIndex, nullptr);
device->setStageOperation(samplerIndex, sw::TextureStage::STAGE_SELECTARG1); device->setStageOperation(samplerIndex, sw::TextureStage::STAGE_SELECTARG1);
device->setFirstArgument(samplerIndex, sw::TextureStage::SOURCE_CURRENT); device->setFirstArgument(samplerIndex, sw::TextureStage::SOURCE_CURRENT);
...@@ -2144,7 +2144,7 @@ void Context::applyTextures(sw::SamplerType samplerType) ...@@ -2144,7 +2144,7 @@ void Context::applyTextures(sw::SamplerType samplerType)
} }
else else
{ {
applyTexture(samplerType, samplerIndex, NULL); applyTexture(samplerType, samplerIndex, nullptr);
} }
} }
} }
......
...@@ -2238,7 +2238,7 @@ void Context::applyTextures() ...@@ -2238,7 +2238,7 @@ void Context::applyTextures()
} }
else else
{ {
applyTexture(unit, 0); applyTexture(unit, nullptr);
device->setFirstArgument(unit, sw::TextureStage::SOURCE_CURRENT); device->setFirstArgument(unit, sw::TextureStage::SOURCE_CURRENT);
device->setFirstModifier(unit, sw::TextureStage::MODIFIER_COLOR); device->setFirstModifier(unit, sw::TextureStage::MODIFIER_COLOR);
......
...@@ -90,17 +90,9 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLsizei count, Buffer *bu ...@@ -90,17 +90,9 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLsizei count, Buffer *bu
} }
intptr_t offset = reinterpret_cast<intptr_t>(indices); intptr_t offset = reinterpret_cast<intptr_t>(indices);
bool alignedOffset = false;
if(buffer != NULL) if(buffer != NULL)
{ {
switch(type)
{
case GL_UNSIGNED_BYTE: alignedOffset = (offset % sizeof(GLubyte) == 0); break;
case GL_UNSIGNED_SHORT: alignedOffset = (offset % sizeof(GLushort) == 0); break;
default: UNREACHABLE(type); alignedOffset = false;
}
if(typeSize(type) * count + offset > static_cast<std::size_t>(buffer->size())) if(typeSize(type) * count + offset > static_cast<std::size_t>(buffer->size()))
{ {
return GL_INVALID_OPERATION; return GL_INVALID_OPERATION;
......
...@@ -3083,12 +3083,12 @@ void Context::applyTextures(sw::SamplerType samplerType) ...@@ -3083,12 +3083,12 @@ void Context::applyTextures(sw::SamplerType samplerType)
} }
else else
{ {
applyTexture(samplerType, samplerIndex, 0); applyTexture(samplerType, samplerIndex, nullptr);
} }
} }
else else
{ {
applyTexture(samplerType, samplerIndex, NULL); applyTexture(samplerType, samplerIndex, nullptr);
} }
} }
} }
......
...@@ -98,18 +98,9 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLuint start, GLuint end, ...@@ -98,18 +98,9 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLuint start, GLuint end,
} }
intptr_t offset = reinterpret_cast<intptr_t>(indices); intptr_t offset = reinterpret_cast<intptr_t>(indices);
bool alignedOffset = false;
if(buffer != NULL) if(buffer != NULL)
{ {
switch(type)
{
case GL_UNSIGNED_BYTE: alignedOffset = (offset % sizeof(GLubyte) == 0); break;
case GL_UNSIGNED_SHORT: alignedOffset = (offset % sizeof(GLushort) == 0); break;
case GL_UNSIGNED_INT: alignedOffset = (offset % sizeof(GLuint) == 0); break;
default: UNREACHABLE(type); alignedOffset = false;
}
if(typeSize(type) * count + offset > static_cast<std::size_t>(buffer->size())) if(typeSize(type) * count + offset > static_cast<std::size_t>(buffer->size()))
{ {
return GL_INVALID_OPERATION; return GL_INVALID_OPERATION;
......
...@@ -77,14 +77,14 @@ static bool validateSubImageParams(bool compressed, GLsizei width, GLsizei heigh ...@@ -77,14 +77,14 @@ static bool validateSubImageParams(bool compressed, GLsizei width, GLsizei heigh
if(compressed) if(compressed)
{ {
if((width % 4 != 0 && width != texture->getWidth(target, 0)) || if((width % 4 != 0 && width != texture->getWidth(target, 0)) ||
(height % 4 != 0 && height != texture->getHeight(target, 0))) (height % 4 != 0 && height != texture->getHeight(target, 0)))
{ {
return error(GL_INVALID_OPERATION, false); return error(GL_INVALID_OPERATION, false);
} }
} }
if(xoffset + width > texture->getWidth(target, level) || if(xoffset + width > texture->getWidth(target, level) ||
yoffset + height > texture->getHeight(target, level)) yoffset + height > texture->getHeight(target, level))
{ {
return error(GL_INVALID_VALUE, false); return error(GL_INVALID_VALUE, false);
} }
......
...@@ -73,7 +73,7 @@ static bool validateSubImageParams(bool compressed, GLsizei width, GLsizei heigh ...@@ -73,7 +73,7 @@ static bool validateSubImageParams(bool compressed, GLsizei width, GLsizei heigh
} }
if(xoffset + width > texture->getWidth(target, level) || if(xoffset + width > texture->getWidth(target, level) ||
yoffset + height > texture->getHeight(target, level)) yoffset + height > texture->getHeight(target, level))
{ {
return error(GL_INVALID_VALUE, false); return error(GL_INVALID_VALUE, false);
} }
...@@ -101,8 +101,8 @@ static bool validateSubImageParams(bool compressed, GLsizei width, GLsizei heigh ...@@ -101,8 +101,8 @@ static bool validateSubImageParams(bool compressed, GLsizei width, GLsizei heigh
if(compressed) if(compressed)
{ {
if((width % 4 != 0 && width != texture->getWidth(target, 0)) || if((width % 4 != 0 && width != texture->getWidth(target, 0)) ||
(height % 4 != 0 && height != texture->getHeight(target, 0)) || (height % 4 != 0 && height != texture->getHeight(target, 0)) ||
(depth % 4 != 0 && depth != texture->getDepth(target, 0))) (depth % 4 != 0 && depth != texture->getDepth(target, 0)))
{ {
return error(GL_INVALID_OPERATION, false); return error(GL_INVALID_OPERATION, false);
} }
...@@ -124,10 +124,10 @@ static bool validateColorBufferFormat(GLenum textureFormat, GLenum colorbufferFo ...@@ -124,10 +124,10 @@ static bool validateColorBufferFormat(GLenum textureFormat, GLenum colorbufferFo
{ {
case GL_ALPHA: case GL_ALPHA:
if(colorbufferFormat != GL_ALPHA && if(colorbufferFormat != GL_ALPHA &&
colorbufferFormat != GL_RGBA && colorbufferFormat != GL_RGBA &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8) colorbufferFormat != GL_RGBA8)
{ {
return error(GL_INVALID_OPERATION, false); return error(GL_INVALID_OPERATION, false);
} }
...@@ -135,12 +135,12 @@ static bool validateColorBufferFormat(GLenum textureFormat, GLenum colorbufferFo ...@@ -135,12 +135,12 @@ static bool validateColorBufferFormat(GLenum textureFormat, GLenum colorbufferFo
case GL_LUMINANCE: case GL_LUMINANCE:
case GL_RGB: case GL_RGB:
if(colorbufferFormat != GL_RGB && if(colorbufferFormat != GL_RGB &&
colorbufferFormat != GL_RGB565 && colorbufferFormat != GL_RGB565 &&
colorbufferFormat != GL_RGB8 && colorbufferFormat != GL_RGB8 &&
colorbufferFormat != GL_RGBA && colorbufferFormat != GL_RGBA &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8) colorbufferFormat != GL_RGBA8)
{ {
return error(GL_INVALID_OPERATION, false); return error(GL_INVALID_OPERATION, false);
} }
...@@ -148,9 +148,9 @@ static bool validateColorBufferFormat(GLenum textureFormat, GLenum colorbufferFo ...@@ -148,9 +148,9 @@ static bool validateColorBufferFormat(GLenum textureFormat, GLenum colorbufferFo
case GL_LUMINANCE_ALPHA: case GL_LUMINANCE_ALPHA:
case GL_RGBA: case GL_RGBA:
if(colorbufferFormat != GL_RGBA && if(colorbufferFormat != GL_RGBA &&
colorbufferFormat != GL_RGBA4 && colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB5_A1 && colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8) colorbufferFormat != GL_RGBA8)
{ {
return error(GL_INVALID_OPERATION, false); return error(GL_INVALID_OPERATION, false);
} }
......
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