Advertisement Jump to content
Sign in to follow this  
Chris_F

Strange driver bug?

This topic is 1871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I try this code, it doesn't work. For some reason only mip level 0 is present and all other mip levels are black.

 

GLuint texture = 0;
glGenTextures(1, &texture);
glTextureStorage2DEXT(texture, GL_TEXTURE_2D, 10, GL_RGBA8, 512, 512);
glTextureSubImage2DEXT(texture, GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
glGenerateTextureMipmapEXT(texture, GL_TEXTURE_2D);

 

If I try this code however, all mip levels are present and accounted for.

 

GLuint texture = 0;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexStorage2D(GL_TEXTURE_2D, 10, GL_RGBA8, 512, 512);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
glGenerateMipmap(GL_TEXTURE_2D);

 

and strangely enough this works as well.

 

GLuint texture = 0;
glGenTextures(1, &texture);
glTextureImage2DEXT(texture, GL_TEXTURE_2D, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
glGenerateTextureMipmapEXT(texture, GL_TEXTURE_2D);

 

wacko.png

Share this post


Link to post
Share on other sites
Advertisement

Code looks good to me.

 

Did you try to reproduce it on another platform? Preferably with a GPU from another vendor, or with an entirely different operating system.

 

If you do not have one of those options readily available, you could also write a minimal C program that also shows the same behavior and ask people to compile and run it on their machines. To make it easier for them (and maximizing your chance of success) you should use a platform-independent API like freeglut/GLEW that many people have installed.

 

Before the driver guys even consider helping you they will want that anyway...

Share this post


Link to post
Share on other sites

Oddly enough this works too.
 

GLuint texture = 0;
glGenTextures(1, &texture);
glTextureStorage2DEXT(texture, GL_TEXTURE_2D, 10, GL_RGBA8, 512, 512);
glTextureSubImage2DEXT(texture, GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
glBindTexture(GL_TEXTURE_2D, texture);
glGenerateMipmap(GL_TEXTURE_2D);

as does this

 

GLuint texture = 0;
glGenTextures(1, &texture);
glTextureStorage2DEXT(texture, GL_TEXTURE_2D, 10, GL_RGBA8, 512, 512);
glTextureSubImage2DEXT(texture, GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
glBindTexture(GL_TEXTURE_2D, texture); //for some reason
glGenerateTextureMipmapEXT(texture, GL_TEXTURE_2D);

 

I'll see about making some kind of short glfw/GLEW test app.

Edited by Chris_F

Share this post


Link to post
Share on other sites

OK, I went ahead and made a sample program. Hopefully somebody here can look it over and tell me if it is kosher, and maybe even compile it and tell me the results they get.

 

It should produce a solid white red screen, but on my computer I only get a tiny sliver of white red on the left.

 

https://gist.github.com/anonymous/7837036

 

[attachment=19094:gltest.png]

Edited by Chris_F

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!