I am developing cascaded shadow maps with a single draw call using geometry shader for the different textures. I am creating a texture using the following code :
GLuint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
glTextureStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_DEPTH_COMPONENT32F, width, height, mNumCascades);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
I get an error of GL_INVALID_OPERATION and I can’t figure out what is wrong. I read that it has to do with the levels, here 1, but I can’t figure out what value I have to pass in. By the way do you know how to format my code in the question here? Thanks in advance