Dan Bartlett
09-26-2011, 03:59 AM
Hi,
using Ati Mobility Radeon HD 5650 with Catalyst 11.8 drivers, I noticed that this causes an AV at the glTexImage2D call:
glGenBuffers(1, @PBO);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, PBO);
glBufferData(GL_PIXEL_UNPACK_BUFFER, twidth*theight*4, @data, GL_STATIC_DRAW);
glGenTextures(1, @tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 1);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, twidth, theight, 0, GL_BGRA, GL_UNSIGNED_BYTE, 0);
It's unusual calling glTexImage for a level beneath GL_TEXTURE_BASE_LEVEL, but AFAICT shouldn't cause an AV.
Something else that causes an AV when it comes to render using a texture, is having GL_TEXTURE_MAX_LEVEL < GL_TEXTURE_BASE_LEVEL, eg.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 4);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
This is one of the listed checks of texture completeness, so should handle it cleanly rather than causing an AV.
using Ati Mobility Radeon HD 5650 with Catalyst 11.8 drivers, I noticed that this causes an AV at the glTexImage2D call:
glGenBuffers(1, @PBO);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, PBO);
glBufferData(GL_PIXEL_UNPACK_BUFFER, twidth*theight*4, @data, GL_STATIC_DRAW);
glGenTextures(1, @tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 1);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, twidth, theight, 0, GL_BGRA, GL_UNSIGNED_BYTE, 0);
It's unusual calling glTexImage for a level beneath GL_TEXTURE_BASE_LEVEL, but AFAICT shouldn't cause an AV.
Something else that causes an AV when it comes to render using a texture, is having GL_TEXTURE_MAX_LEVEL < GL_TEXTURE_BASE_LEVEL, eg.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 4);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
This is one of the listed checks of texture completeness, so should handle it cleanly rather than causing an AV.