为什么会生成以下代码GL_INVALID_OPERATION
?
int8_t bytes[256];
for (int i = 0; i < 256; i++)
bytes[i] = (int8_t) i;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_1D, texture);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage1D(GL_TEXTURE_1D, 0, GL_R8I, 256, 0, GL_RED, GL_BYTE, bytes);
/* Here I get GL_INVALID_OPERATION */
glBindTexture(GL_TEXTURE_1D, 0);