Skip to content

Commit

Permalink
Try to fix crash on linux with proprietary drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lejeune committed Jun 18, 2014
1 parent b9c45b7 commit 76b76c6
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/graphics/rtts.cpp
Expand Up @@ -27,16 +27,12 @@ static GLuint generateRTT3D(GLenum target, size_t w, size_t h, size_t d, GLint i
GLuint result;
glGenTextures(1, &result);
glBindTexture(target, result);
if (irr_driver->getGLSLVersion() < 420)
glTexImage3D(target, 0, internalFormat, w, h, d, 0, format, type, 0);
else
{
#if WIN32
if (irr_driver->getGLSLVersion() >= 420)
glTexStorage3D(target, 1, internalFormat, w, h, d);
#else
assert(false);
else
#endif
}
glTexImage3D(target, 0, internalFormat, w, h, d, 0, format, type, 0);
return result;
}

Expand All @@ -45,16 +41,12 @@ static GLuint generateRTT(const core::dimension2du &res, GLint internalFormat, G
GLuint result;
glGenTextures(1, &result);
glBindTexture(GL_TEXTURE_2D, result);
if (irr_driver->getGLSLVersion() < 420)
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, res.Width, res.Height, 0, format, type, 0);
else
{
#if WIN32
if (irr_driver->getGLSLVersion() < 420)

This comment has been minimized.

Copy link
@stephenjust

stephenjust Jun 19, 2014

Contributor

Are you sure about this equality? I thought glTexStorage was a newer feature.

glTexStorage2D(GL_TEXTURE_2D, mipmaplevel, internalFormat, res.Width, res.Height);
#else
assert(false);
else
#endif
}
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, res.Width, res.Height, 0, format, type, 0);
return result;
}

Expand Down

0 comments on commit 76b76c6

Please sign in to comment.