<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 3:27 PM, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">On Tue, Jul 22, 2014 at 12:09 AM, Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>> wrote:<br>
> On Fri, Jul 18, 2014 at 5:54 PM, Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br>
>><br>
>> Shouldn't the function return TRUE for floating-point depth textures only?<br>
>><br>
> Depth texture data needs clamping in following two cases:<br>
> 1. Float texture format supplied with signed data needs clamping to [0.0, 1.0].<br>
> 2. Fixed point texture format supplied with signed data needs clamping to<br>
> [0, 2^n -1].<br>
><br>
> But, all the cases except one (float texture supplied with float data) are ruled<br>
> out by _mesa_format_matches_format_and_type() in<br>
> _mesa_texstore_can_use_memcpy().<br>
><br>
> So, I think a better place to do this check will be at end of<br>
> _mesa_texstore_can_use_memcpy() function:<br>
><br>
> if (baseInternalFormat == GL_DEPTH_COMPONENT && srcType == GL_FLOAT))<br>
> return GL_FALSE; /* can't use memcpy */<br>
<br>
</div>I think you meant:<br>
<br>
if ((baseInternalFormat == GL_DEPTH_COMPONENT ||<br>
baseInternalFormat == GL_DEPTH_STENCIL) &&<br>
(srcType == GL_FLOAT || srcType == GL_HALF_FLOAT ||<br>
srcType == FLOAT_32_UNSIGNED_INT_24_8_REV) &&<br>
(_mesa_get_format_datatype(dstFormat) == GL_FLOAT)<br>
<div class=""><div class="h5"> return GL_FALSE; /* can't use memcpy */</div></div></blockquote><div><br></div><div>Yes. I missed GL_DEPTH_STENCIL format and</div><div>FLOAT_32_UNSIGNED_INT_24_8_REV data type :(.</div>
<div>We can drop the checks for srcType == GL_HALF_FLOAT and</div><div>_mesa_get_format_datatype(dstFormat) == GL_FLOAT because<br></div><div>they'll be ruled out in _mesa_format_matches_format_and_type()</div><div>function ?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5"><span style="color:rgb(34,34,34)"> </span><br>
</div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">
</div></div><span class=""><font color="#888888">Marek<br>
</font></span></blockquote></div><br></div></div>