OPENGL: Prefer single operation texture updates.
When doing glTexSubImage2D we do not need to assure that the source data has the same width as the texture when we want to update the data, we just need to assure that the width * Bpp cound matches the pitch.
This commit is contained in:
parent
8bd01f69b2
commit
d81bb9794f
1 changed files with 1 additions and 1 deletions
|
@ -149,7 +149,7 @@ void GLTexture::updateBuffer(const void *buf, int pitch, GLuint x, GLuint y, GLu
|
|||
glBindTexture(GL_TEXTURE_2D, _textureName); CHECK_GL_ERROR();
|
||||
|
||||
// Check if the buffer has its data contiguously
|
||||
if (static_cast<int>(w) * _bytesPerPixel == pitch && w == _textureWidth) {
|
||||
if (static_cast<int>(w) * _bytesPerPixel == pitch) {
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h,
|
||||
_glFormat, _glType, buf); CHECK_GL_ERROR();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue