On Tue, Jul 22, 2014 at 12:09 AM, Anuj Phogat <anuj.pho...@gmail.com> wrote: > On Fri, Jul 18, 2014 at 5:54 PM, Marek Olšák <mar...@gmail.com> wrote: >> >> Shouldn't the function return TRUE for floating-point depth textures only? >> > Depth texture data needs clamping in following two cases: > 1. Float texture format supplied with signed data needs clamping to [0.0, > 1.0]. > 2. Fixed point texture format supplied with signed data needs clamping to > [0, 2^n -1]. > > But, all the cases except one (float texture supplied with float data) are > ruled > out by _mesa_format_matches_format_and_type() in > _mesa_texstore_can_use_memcpy(). > > So, I think a better place to do this check will be at end of > _mesa_texstore_can_use_memcpy() function: > > if (baseInternalFormat == GL_DEPTH_COMPONENT && srcType == GL_FLOAT)) > return GL_FALSE; /* can't use memcpy */
I think you meant: if ((baseInternalFormat == GL_DEPTH_COMPONENT || baseInternalFormat == GL_DEPTH_STENCIL) && (srcType == GL_FLOAT || srcType == GL_HALF_FLOAT || srcType == FLOAT_32_UNSIGNED_INT_24_8_REV) && (_mesa_get_format_datatype(dstFormat) == GL_FLOAT) return GL_FALSE; /* can't use memcpy */ Marek _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev