Permalink
Browse files

Try to fix crash on linux with proprietary drivers

  • Loading branch information...
1 parent b9c45b7 commit 76b76c6872577a8a3371450234d0b7f4a84274de Vincent Lejeune committed Jun 18, 2014
Showing with 6 additions and 14 deletions.
  1. +6 −14 src/graphics/rtts.cpp
View
20 src/graphics/rtts.cpp
@@ -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;
}
@@ -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)
@stephenjust
stephenjust Jun 19, 2014

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;
}

0 comments on commit 76b76c6

Please sign in to comment.