complete TexStorage support

This commit is contained in:
mp3butcher
2018-08-20 05:10:11 +02:00
parent 587e65e674
commit e043c3db33
7 changed files with 169 additions and 77 deletions

View File

@@ -102,29 +102,32 @@ void Texture2DMultisample::apply(State& state) const
}
else if ( (_textureWidth!=0) && (_textureHeight!=0) && (_numSamples!=0) )
{
textureObject = generateAndAssignTextureObject(
contextID,
getTextureTarget(),
1,
_internalFormat,
_textureWidth,
_textureHeight,
1,
_borderWidth);
// no image present, but dimensions at set so lets create the texture
GLenum texStorageSizedInternalFormat = extensions->isTextureStorageEnabled && (_borderWidth==0) ? selectSizedInternalFormat() : 0;
if (texStorageSizedInternalFormat!=0)
{
textureObject = generateAndAssignTextureObject(contextID, getTextureTarget(), 1, texStorageSizedInternalFormat, _textureWidth, _textureHeight, 1, 0);
textureObject->bind();
textureObject->bind();
extensions->glTexStorage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, _numSamples, texStorageSizedInternalFormat, _textureWidth, _textureHeight, _fixedsamplelocations);
}
else
{
textureObject = generateAndAssignTextureObject(contextID, getTextureTarget(), 1, _internalFormat, _textureWidth, _textureHeight, 1, _borderWidth);
textureObject->bind();
extensions->glTexImage2DMultisample( getTextureTarget(),
extensions->glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE,
_numSamples,
_internalFormat,
_textureWidth,
_textureHeight,
_fixedsamplelocations );
}
}
else
{
glBindTexture( getTextureTarget(), 0 );
glBindTexture( GL_TEXTURE_2D_MULTISAMPLE, 0 );
}
}