Added the immutable parameter.

TRAC #18730 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@856 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent fbc39524
......@@ -336,6 +336,11 @@ typedef void* GLeglImageOES;
#define GL_NO_RESET_NOTIFICATION_EXT 0x8261
#endif
/* GL_EXT_texture_storage */
#ifndef GL_EXT_texture_storage
#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
#endif
/*------------------------------------------------------------------------*
* DMP extension tokens
*------------------------------------------------------------------------*/
......@@ -951,6 +956,11 @@ GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
#endif
/* GL_EXT_texture_storage */
#ifndef GL_EXT_texture_storage
#define GL_EXT_texture_storage 1
#endif
/*------------------------------------------------------------------------*
* DMP extension functions
*------------------------------------------------------------------------*/
......
......@@ -1231,6 +1231,8 @@ Texture::Texture(GLuint id) : RefCountObject(id)
mDirtyParameters = true;
mDirtyImages = true;
mImmutable = false;
}
Texture::~Texture()
......@@ -1506,6 +1508,11 @@ unsigned int Texture::getRenderTargetSerial(GLenum target) const
return texture ? texture->getRenderTargetSerial(target) : 0;
}
bool Texture::isImmutable() const
{
return mImmutable;
}
GLint Texture::creationLevels(GLsizei width, GLsizei height) const
{
if ((isPow2(width) && isPow2(height)) || getContext()->supportsNonPower2Texture())
......
......@@ -197,6 +197,8 @@ class Texture : public RefCountObject
unsigned int getTextureSerial() const;
unsigned int getRenderTargetSerial(GLenum target) const;
bool isImmutable() const;
static const GLuint INCOMPLETE_TEXTURE_ID = static_cast<GLuint>(-1); // Every texture takes an id at creation time. The value is arbitrary because it is never registered with the resource manager.
protected:
......@@ -228,6 +230,8 @@ class Texture : public RefCountObject
bool mDirtyImages;
bool mImmutable;
private:
DISALLOW_COPY_AND_ASSIGN(Texture);
......
......@@ -3338,6 +3338,9 @@ void __stdcall glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
case GL_TEXTURE_WRAP_T:
*params = (GLfloat)texture->getWrapT();
break;
case GL_TEXTURE_IMMUTABLE_FORMAT_EXT:
*params = (GLfloat)(texture->isImmutable() ? GL_TRUE : GL_FALSE);
break;
default:
return error(GL_INVALID_ENUM);
}
......@@ -3387,6 +3390,9 @@ void __stdcall glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
case GL_TEXTURE_WRAP_T:
*params = texture->getWrapT();
break;
case GL_TEXTURE_IMMUTABLE_FORMAT_EXT:
*params = texture->isImmutable() ? GL_TRUE : GL_FALSE;
break;
default:
return error(GL_INVALID_ENUM);
}
......
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