I'm having problems when using the following statement on different GPUs:
glTexSubImage3D(target, 0, 0, 0, 0, width, height, layers, format, type, NULL);
on NVIDIA cards "format = GL_RGBA" throws a fatal error that causes the program to crash, but it works and throws no errors if I use the sized version "format = GL_RGBA8"
on AMD cards "format = GL_RGBA" works and throws no errors, "format = GL_RGBA8" also works, but throws the error "GL_INVALID_ENUMERATION"
I'm currently using GL_RGBA8, so it works on both cards, but I wonder if there is a way to do this that throws no errors on either card.
Here's the spec for glTexSubImage3D from Khronos.org
Specifies the format of the pixel data. The following symbolic values are accepted: GL_RED, GL_RG, GL_RGB, GL_BGR, GL_RGBA, GL_DEPTH_COMPONENT, and GL_STENCIL_INDEX.
I'm using opengl 4.3 core profile, glfw and glew. Here is my texStorage statement called before glTexSubImage3D
internalFormat = GL_RGBA8; glTexStorage3D(target, 1, internalFormat, width, height, layers);
per the comments, the other values are
target = GL_TEXTURE_2D; width = 4096; height = 4096; layers = 1; format = GL_RGBA8; type = GL_UNSIGNED_BYTE;
Am I using this incorrectly? Is there a way to satisfy both implementations?