On Sun, 18 Mar 2012 10:49:24 -0600, Brian Paul <bri...@vmware.com> wrote: > Merge the mipmap level checking code that was separate cases for 1D, > 2D, 3D and CUBE before.
> - if (img->_BaseFormat == GL_DEPTH_COMPONENT) { > - incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D > tex"); > - return; > - } [...] > - /* Don't support GL_DEPTH_COMPONENT for cube maps */ > - if (ctx->VersionMajor < 3 && > !ctx->Extensions.EXT_gpu_shader4) { > - if (t->Image[face][i]->_BaseFormat == > GL_DEPTH_COMPONENT) { > - incomplete(t, "GL_DEPTH_COMPONENT only works with > 1/2D tex"); > - return; > - } > - } It was a surprise tosee these two blocks be dropped. However, it looks totally safe: texture image creation already errors out in these cases, so we shouldn't have any reason to check for it at completeness time. > - /* check that all six images have same size */ > - if (t->Image[face][i]->Width2 != width || > - t->Image[face][i]->Height2 != height) { > + > + /* Extra checks for cube textures */ > + if (face > 0) { > + /* check that cube faces are the same size */ > + if (img->Width2 != t->Image[0][i]->Width2 || > + img->Height2 != t->Image[0][i]->Height2) { > incomplete(t, "CubeMap Image[n][i] bad size"); > return; > } I thought this testing might be wrong, since we're not checking that cube faces have width == height. That's also tested at image creation time, though, so it's true at this point (and so, technically, we wouldn't even need to test for Height2s matching up)
pgp5B8wTjiHKV.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev