我使用 glTexSubImage2D 和 GL_TEXTURE_CUBE_MAP 作为目标。如果高度和宽度不相同,它会在我的驱动程序上给我 GL_INVALID_VALUE 。我不确定这种类型的驱动程序行为。据我所知,Khronos.org 上的 glTexSubImage2D 手册页中没有提到它。有没有人遇到过这个?
以下是后续调用: glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X,0,*internal_format,*width,*height,0,GL_BGRA,*type,color); glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X,0,*internal_format,*width,*height,0,GL_BGRA,*type,color); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y,0,*internal_format,*width,*height,0,GL_BGRA,*type,color); glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,0,*internal_format,*width,*height,0,GL_BGRA,*type,color); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z,0,*internal_format,*width,*height,0,GL_BGRA,*type,color); glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,0,*internal_format,*width,*height,0,GL_BGRA,*type,color); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X,0,*x_offset,*y_offset, *sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10); glTexSubImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,0,*x_offset,*y_offset,*sub_width,*sub_height,GL_BGRA,*type,color+10);
where
name="target" value="GL_TEXTURE_CUBE_MAP"
name="width" value="8"
name="height" value="8"
name="internal_format" value="GL_RG8_SNORM"
name="x_offset" value="4"
name="y_offset" value="4"
name="sub_width" value="2"
name="sub_height" value="4"
name="type" value="GL_UNSIGNED_INT_8_8_8_8"