complete TexStorage support
This commit is contained in:
@@ -230,18 +230,30 @@ void Texture1D::apply(State& state) const
|
||||
}
|
||||
else if ( (_textureWidth!=0) && (_internalFormat!=0) )
|
||||
{
|
||||
textureObject = generateAndAssignTextureObject(contextID, GL_TEXTURE_1D,_numMipmapLevels,_internalFormat,_textureWidth,1,1,0);
|
||||
// no image present, but dimensions at set so lets create the texture
|
||||
GLExtensions * extensions = state.get<GLExtensions>();
|
||||
GLenum texStorageSizedInternalFormat = extensions->isTextureStorageEnabled ? selectSizedInternalFormat() : 0;
|
||||
if (texStorageSizedInternalFormat!=0)
|
||||
{
|
||||
textureObject = generateAndAssignTextureObject(contextID, GL_TEXTURE_1D, _numMipmapLevels, texStorageSizedInternalFormat, _textureWidth, 1, 1, 0);
|
||||
textureObject->bind();
|
||||
applyTexParameters(GL_TEXTURE_1D, state);
|
||||
|
||||
textureObject->bind();
|
||||
extensions->glTexStorage1D( GL_TEXTURE_1D, (_numMipmapLevels >0)?_numMipmapLevels:1, texStorageSizedInternalFormat, _textureWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
GLenum internalFormat = _sourceFormat ? _sourceFormat : _internalFormat;
|
||||
textureObject = generateAndAssignTextureObject(contextID, GL_TEXTURE_1D, _numMipmapLevels, internalFormat, _textureWidth, 1, 1, 0);
|
||||
textureObject->bind();
|
||||
applyTexParameters(GL_TEXTURE_1D, state);
|
||||
|
||||
applyTexParameters(GL_TEXTURE_1D,state);
|
||||
|
||||
// no image present, but dimensions are set so lets create the texture
|
||||
glTexImage1D( GL_TEXTURE_1D, 0, _internalFormat,
|
||||
glTexImage1D( GL_TEXTURE_1D, 0, _internalFormat,
|
||||
_textureWidth, _borderWidth,
|
||||
_sourceFormat ? _sourceFormat : _internalFormat,
|
||||
internalFormat,
|
||||
_sourceType ? _sourceType : GL_UNSIGNED_BYTE,
|
||||
0);
|
||||
}
|
||||
|
||||
if (_readPBuffer.valid())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user