InternalFormat and format are the same.

TRAC #15703 Issue=86 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@580 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent aed1832d
...@@ -3152,7 +3152,7 @@ Texture *Context::getIncompleteTexture(SamplerType type) ...@@ -3152,7 +3152,7 @@ Texture *Context::getIncompleteTexture(SamplerType type)
case SAMPLER_2D: case SAMPLER_2D:
{ {
Texture2D *incomplete2d = new Texture2D(Texture::INCOMPLETE_TEXTURE_ID); Texture2D *incomplete2d = new Texture2D(Texture::INCOMPLETE_TEXTURE_ID);
incomplete2d->setImage(0, GL_RGBA, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color); incomplete2d->setImage(0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color);
t = incomplete2d; t = incomplete2d;
} }
break; break;
...@@ -3161,12 +3161,12 @@ Texture *Context::getIncompleteTexture(SamplerType type) ...@@ -3161,12 +3161,12 @@ Texture *Context::getIncompleteTexture(SamplerType type)
{ {
TextureCubeMap *incompleteCube = new TextureCubeMap(Texture::INCOMPLETE_TEXTURE_ID); TextureCubeMap *incompleteCube = new TextureCubeMap(Texture::INCOMPLETE_TEXTURE_ID);
incompleteCube->setImagePosX(0, GL_RGBA, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color); incompleteCube->setImagePosX(0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color);
incompleteCube->setImageNegX(0, GL_RGBA, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color); incompleteCube->setImageNegX(0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color);
incompleteCube->setImagePosY(0, GL_RGBA, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color); incompleteCube->setImagePosY(0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color);
incompleteCube->setImageNegY(0, GL_RGBA, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color); incompleteCube->setImageNegY(0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color);
incompleteCube->setImagePosZ(0, GL_RGBA, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color); incompleteCube->setImagePosZ(0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color);
incompleteCube->setImageNegZ(0, GL_RGBA, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color); incompleteCube->setImageNegZ(0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, color);
t = incompleteCube; t = incompleteCube;
} }
......
...@@ -32,7 +32,10 @@ Texture::Image::Image() ...@@ -32,7 +32,10 @@ Texture::Image::Image()
Texture::Image::~Image() Texture::Image::~Image()
{ {
if (surface) surface->Release(); if (surface)
{
surface->Release();
}
} }
Texture::Texture(GLuint id) : RefCountObject(id) Texture::Texture(GLuint id) : RefCountObject(id)
...@@ -970,7 +973,7 @@ bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GL ...@@ -970,7 +973,7 @@ bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GL
} }
// This implements glCopyTex[Sub]Image2D for non-renderable internal texture formats // This implements glCopyTex[Sub]Image2D for non-renderable internal texture formats
void Texture::copyNonRenderable(Image *image, GLenum internalFormat, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget) void Texture::copyNonRenderable(Image *image, GLenum format, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget)
{ {
IDirect3DDevice9 *device = getDevice(); IDirect3DDevice9 *device = getDevice();
IDirect3DSurface9 *surface = NULL; IDirect3DSurface9 *surface = NULL;
...@@ -1008,7 +1011,7 @@ void Texture::copyNonRenderable(Image *image, GLenum internalFormat, GLint xoffs ...@@ -1008,7 +1011,7 @@ void Texture::copyNonRenderable(Image *image, GLenum internalFormat, GLint xoffs
if (!image->surface) if (!image->surface)
{ {
createSurface(width, height, internalFormat, mType, image); createSurface(width, height, format, mType, image);
} }
if (image->surface == NULL) if (image->surface == NULL)
...@@ -1239,7 +1242,7 @@ GLenum Texture2D::getInternalFormat() const ...@@ -1239,7 +1242,7 @@ GLenum Texture2D::getInternalFormat() const
// //
// Returns true if the existing texture was unsuitable and had to be destroyed. If so, it will also set // Returns true if the existing texture was unsuitable and had to be destroyed. If so, it will also set
// a new height and width for the texture by working backwards from the given width and height. // a new height and width for the texture by working backwards from the given width and height.
bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum type) bool Texture2D::redefineTexture(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type)
{ {
bool widthOkay = (mWidth >> level == width); bool widthOkay = (mWidth >> level == width);
bool heightOkay = (mHeight >> level == height); bool heightOkay = (mHeight >> level == height);
...@@ -1250,13 +1253,13 @@ bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei widt ...@@ -1250,13 +1253,13 @@ bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei widt
bool typeOkay = (type == mType); bool typeOkay = (type == mType);
bool textureOkay = (sizeOkay && typeOkay && internalFormat == mImageArray[0].format); bool textureOkay = (sizeOkay && typeOkay && format == mImageArray[0].format);
if (!textureOkay) if (!textureOkay)
{ {
TRACE("Redefining 2D texture (%d, 0x%04X, %d, %d => 0x%04X, %d, %d).", level, TRACE("Redefining 2D texture (%d, 0x%04X, %d, %d => 0x%04X, %d, %d).", level,
mImageArray[0].format, mWidth, mHeight, mImageArray[0].format, mWidth, mHeight,
internalFormat, width, height); format, width, height);
// Purge all the levels and the texture. // Purge all the levels and the texture.
...@@ -1280,25 +1283,25 @@ bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei widt ...@@ -1280,25 +1283,25 @@ bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei widt
mWidth = width << level; mWidth = width << level;
mHeight = height << level; mHeight = height << level;
mImageArray[0].format = internalFormat; mImageArray[0].format = format;
mType = type; mType = type;
} }
return !textureOkay; return !textureOkay;
} }
void Texture2D::setImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
redefineTexture(level, internalFormat, width, height, type); redefineTexture(level, format, width, height, type);
Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[level]); Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[level]);
} }
void Texture2D::setCompressedImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels) void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
{ {
redefineTexture(level, internalFormat, width, height, GL_UNSIGNED_BYTE); redefineTexture(level, format, width, height, GL_UNSIGNED_BYTE);
Texture::setCompressedImage(width, height, internalFormat, imageSize, pixels, &mImageArray[level]); Texture::setCompressedImage(width, height, format, imageSize, pixels, &mImageArray[level]);
} }
void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height) void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
...@@ -1348,7 +1351,7 @@ void Texture2D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GL ...@@ -1348,7 +1351,7 @@ void Texture2D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GL
} }
} }
void Texture2D::copyImage(GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
{ {
IDirect3DSurface9 *renderTarget = source->getRenderTarget(); IDirect3DSurface9 *renderTarget = source->getRenderTarget();
...@@ -1358,11 +1361,11 @@ void Texture2D::copyImage(GLint level, GLenum internalFormat, GLint x, GLint y, ...@@ -1358,11 +1361,11 @@ void Texture2D::copyImage(GLint level, GLenum internalFormat, GLint x, GLint y,
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
} }
bool redefined = redefineTexture(level, internalFormat, width, height, mType); bool redefined = redefineTexture(level, format, width, height, mType);
if (!isRenderableFormat()) if (!isRenderableFormat())
{ {
copyNonRenderable(&mImageArray[level], internalFormat, 0, 0, x, y, width, height, renderTarget); copyNonRenderable(&mImageArray[level], format, 0, 0, x, y, width, height, renderTarget);
} }
else else
{ {
...@@ -1386,14 +1389,14 @@ void Texture2D::copyImage(GLint level, GLenum internalFormat, GLint x, GLint y, ...@@ -1386,14 +1389,14 @@ void Texture2D::copyImage(GLint level, GLenum internalFormat, GLint x, GLint y,
IDirect3DSurface9 *dest; IDirect3DSurface9 *dest;
HRESULT hr = mTexture->GetSurfaceLevel(level, &dest); HRESULT hr = mTexture->GetSurfaceLevel(level, &dest);
getBlitter()->formatConvert(source->getRenderTarget(), sourceRect, internalFormat, 0, 0, dest); getBlitter()->formatConvert(source->getRenderTarget(), sourceRect, format, 0, 0, dest);
dest->Release(); dest->Release();
} }
} }
mImageArray[level].width = width; mImageArray[level].width = width;
mImageArray[level].height = height; mImageArray[level].height = height;
mImageArray[level].format = internalFormat; mImageArray[level].format = format;
} }
void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
...@@ -1804,41 +1807,41 @@ GLenum TextureCubeMap::getInternalFormat() const ...@@ -1804,41 +1807,41 @@ GLenum TextureCubeMap::getInternalFormat() const
return mImageArray[0][0].format; return mImageArray[0][0].format;
} }
void TextureCubeMap::setImagePosX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void TextureCubeMap::setImagePosX(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
setImage(0, level, internalFormat, width, height, format, type, unpackAlignment, pixels); setImage(0, level, width, height, format, type, unpackAlignment, pixels);
} }
void TextureCubeMap::setImageNegX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void TextureCubeMap::setImageNegX(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
setImage(1, level, internalFormat, width, height, format, type, unpackAlignment, pixels); setImage(1, level, width, height, format, type, unpackAlignment, pixels);
} }
void TextureCubeMap::setImagePosY(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void TextureCubeMap::setImagePosY(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
setImage(2, level, internalFormat, width, height, format, type, unpackAlignment, pixels); setImage(2, level, width, height, format, type, unpackAlignment, pixels);
} }
void TextureCubeMap::setImageNegY(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void TextureCubeMap::setImageNegY(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
setImage(3, level, internalFormat, width, height, format, type, unpackAlignment, pixels); setImage(3, level, width, height, format, type, unpackAlignment, pixels);
} }
void TextureCubeMap::setImagePosZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void TextureCubeMap::setImagePosZ(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
setImage(4, level, internalFormat, width, height, format, type, unpackAlignment, pixels); setImage(4, level, width, height, format, type, unpackAlignment, pixels);
} }
void TextureCubeMap::setImageNegZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void TextureCubeMap::setImageNegZ(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
setImage(5, level, internalFormat, width, height, format, type, unpackAlignment, pixels); setImage(5, level, width, height, format, type, unpackAlignment, pixels);
} }
void TextureCubeMap::setCompressedImage(GLenum face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels) void TextureCubeMap::setCompressedImage(GLenum face, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
{ {
redefineTexture(level, internalFormat, width); redefineTexture(level, format, width);
Texture::setCompressedImage(width, height, internalFormat, imageSize, pixels, &mImageArray[faceIndex(face)][level]); Texture::setCompressedImage(width, height, format, imageSize, pixels, &mImageArray[faceIndex(face)][level]);
} }
void TextureCubeMap::commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height) void TextureCubeMap::commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
...@@ -2104,9 +2107,9 @@ void TextureCubeMap::convertToRenderTarget() ...@@ -2104,9 +2107,9 @@ void TextureCubeMap::convertToRenderTarget()
mIsRenderable = true; mIsRenderable = true;
} }
void TextureCubeMap::setImage(int face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void TextureCubeMap::setImage(int face, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{ {
redefineTexture(level, internalFormat, width); redefineTexture(level, format, width);
Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[face][level]); Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[face][level]);
} }
...@@ -2143,18 +2146,18 @@ bool TextureCubeMap::dirtyImageData() const ...@@ -2143,18 +2146,18 @@ bool TextureCubeMap::dirtyImageData() const
// //
// Returns true if the existing texture was unsuitable had to be destroyed. If so, it will also set // Returns true if the existing texture was unsuitable had to be destroyed. If so, it will also set
// a new size for the texture by working backwards from the given size. // a new size for the texture by working backwards from the given size.
bool TextureCubeMap::redefineTexture(GLint level, GLenum internalFormat, GLsizei width) bool TextureCubeMap::redefineTexture(GLint level, GLenum format, GLsizei width)
{ {
// Are these settings compatible with level 0? // Are these settings compatible with level 0?
bool sizeOkay = (mImageArray[0][0].width >> level == width); bool sizeOkay = (mImageArray[0][0].width >> level == width);
bool textureOkay = (sizeOkay && internalFormat == mImageArray[0][0].format); bool textureOkay = (sizeOkay && format == mImageArray[0][0].format);
if (!textureOkay) if (!textureOkay)
{ {
TRACE("Redefining cube texture (%d, 0x%04X, %d => 0x%04X, %d).", level, TRACE("Redefining cube texture (%d, 0x%04X, %d => 0x%04X, %d).", level,
mImageArray[0][0].format, mImageArray[0][0].width, mImageArray[0][0].format, mImageArray[0][0].width,
internalFormat, width); format, width);
// Purge all the levels and the texture. // Purge all the levels and the texture.
for (int i = 0; i < IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++) for (int i = 0; i < IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++)
...@@ -2183,13 +2186,13 @@ bool TextureCubeMap::redefineTexture(GLint level, GLenum internalFormat, GLsizei ...@@ -2183,13 +2186,13 @@ bool TextureCubeMap::redefineTexture(GLint level, GLenum internalFormat, GLsizei
mHeight = width << level; mHeight = width << level;
mImageArray[0][0].height = width << level; mImageArray[0][0].height = width << level;
mImageArray[0][0].format = internalFormat; mImageArray[0][0].format = format;
} }
return !textureOkay; return !textureOkay;
} }
void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
{ {
IDirect3DSurface9 *renderTarget = source->getRenderTarget(); IDirect3DSurface9 *renderTarget = source->getRenderTarget();
...@@ -2200,11 +2203,11 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum internalFormat ...@@ -2200,11 +2203,11 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum internalFormat
} }
unsigned int faceindex = faceIndex(target); unsigned int faceindex = faceIndex(target);
bool redefined = redefineTexture(level, internalFormat, width); bool redefined = redefineTexture(level, format, width);
if (!isRenderableFormat()) if (!isRenderableFormat())
{ {
copyNonRenderable(&mImageArray[faceindex][level], internalFormat, 0, 0, x, y, width, height, renderTarget); copyNonRenderable(&mImageArray[faceindex][level], format, 0, 0, x, y, width, height, renderTarget);
} }
else else
{ {
...@@ -2229,14 +2232,14 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum internalFormat ...@@ -2229,14 +2232,14 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum internalFormat
IDirect3DSurface9 *dest = getCubeMapSurface(target, level); IDirect3DSurface9 *dest = getCubeMapSurface(target, level);
getBlitter()->formatConvert(source->getRenderTarget(), sourceRect, internalFormat, 0, 0, dest); getBlitter()->formatConvert(source->getRenderTarget(), sourceRect, format, 0, 0, dest);
dest->Release(); dest->Release();
} }
} }
mImageArray[faceindex][level].width = width; mImageArray[faceindex][level].width = width;
mImageArray[faceindex][level].height = height; mImageArray[faceindex][level].height = height;
mImageArray[faceindex][level].format = internalFormat; mImageArray[faceindex][level].format = format;
} }
IDirect3DSurface9 *TextureCubeMap::getCubeMapSurface(GLenum face, unsigned int level) IDirect3DSurface9 *TextureCubeMap::getCubeMapSurface(GLenum face, unsigned int level)
......
...@@ -101,7 +101,7 @@ class Texture : public RefCountObject ...@@ -101,7 +101,7 @@ class Texture : public RefCountObject
bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img); bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img);
void setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img); void setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img);
bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img); bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img);
void copyNonRenderable(Image *image, GLenum internalFormat, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget); void copyNonRenderable(Image *image, GLenum format, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget);
void needRenderTarget(); void needRenderTarget();
...@@ -192,11 +192,11 @@ class Texture2D : public Texture ...@@ -192,11 +192,11 @@ class Texture2D : public Texture
GLenum getTarget() const; GLenum getTarget() const;
GLenum getInternalFormat() const; GLenum getInternalFormat() const;
void setImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setCompressedImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels); void setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels);
void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels); void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source); void copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source); void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
bool isComplete() const; bool isComplete() const;
...@@ -217,7 +217,7 @@ class Texture2D : public Texture ...@@ -217,7 +217,7 @@ class Texture2D : public Texture
virtual bool dirtyImageData() const; virtual bool dirtyImageData() const;
bool redefineTexture(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum type); bool redefineTexture(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type);
void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS]; Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
...@@ -237,18 +237,18 @@ class TextureCubeMap : public Texture ...@@ -237,18 +237,18 @@ class TextureCubeMap : public Texture
GLenum getTarget() const; GLenum getTarget() const;
GLenum getInternalFormat() const; GLenum getInternalFormat() const;
void setImagePosX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImagePosX(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setImageNegX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImageNegX(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setImagePosY(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImagePosY(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setImageNegY(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImageNegY(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setImagePosZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImagePosZ(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setImageNegZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImageNegZ(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void setCompressedImage(GLenum face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels); void setCompressedImage(GLenum face, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels);
void subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels); void subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source); void copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source); void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
bool isComplete() const; bool isComplete() const;
...@@ -277,9 +277,9 @@ class TextureCubeMap : public Texture ...@@ -277,9 +277,9 @@ class TextureCubeMap : public Texture
bool isCubeComplete() const; bool isCubeComplete() const;
void setImage(int face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImage(int face, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); void commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
bool redefineTexture(GLint level, GLenum internalFormat, GLsizei width); bool redefineTexture(GLint level, GLenum format, GLsizei width);
Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS]; Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS];
......
...@@ -4412,7 +4412,7 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL ...@@ -4412,7 +4412,7 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
switch (internalformat) switch (format)
{ {
case GL_ALPHA: case GL_ALPHA:
case GL_LUMINANCE: case GL_LUMINANCE:
...@@ -4507,8 +4507,8 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL ...@@ -4507,8 +4507,8 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
} }
if (internalformat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || if (format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
internalformat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
{ {
if (context->supportsCompressedTextures()) if (context->supportsCompressedTextures())
{ {
...@@ -4544,7 +4544,7 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL ...@@ -4544,7 +4544,7 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
texture->setImage(level, internalformat, width, height, format, type, context->getUnpackAlignment(), pixels); texture->setImage(level, width, height, format, type, context->getUnpackAlignment(), pixels);
} }
else else
{ {
...@@ -4558,22 +4558,22 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL ...@@ -4558,22 +4558,22 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
switch (target) switch (target)
{ {
case GL_TEXTURE_CUBE_MAP_POSITIVE_X: case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
texture->setImagePosX(level, internalformat, width, height, format, type, context->getUnpackAlignment(), pixels); texture->setImagePosX(level, width, height, format, type, context->getUnpackAlignment(), pixels);
break; break;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
texture->setImageNegX(level, internalformat, width, height, format, type, context->getUnpackAlignment(), pixels); texture->setImageNegX(level, width, height, format, type, context->getUnpackAlignment(), pixels);
break; break;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
texture->setImagePosY(level, internalformat, width, height, format, type, context->getUnpackAlignment(), pixels); texture->setImagePosY(level, width, height, format, type, context->getUnpackAlignment(), pixels);
break; break;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
texture->setImageNegY(level, internalformat, width, height, format, type, context->getUnpackAlignment(), pixels); texture->setImageNegY(level, width, height, format, type, context->getUnpackAlignment(), pixels);
break; break;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
texture->setImagePosZ(level, internalformat, width, height, format, type, context->getUnpackAlignment(), pixels); texture->setImagePosZ(level, width, height, format, type, context->getUnpackAlignment(), pixels);
break; break;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
texture->setImageNegZ(level, internalformat, width, height, format, type, context->getUnpackAlignment(), pixels); texture->setImageNegZ(level, width, height, format, type, context->getUnpackAlignment(), pixels);
break; break;
default: UNREACHABLE(); default: UNREACHABLE();
} }
......
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