<div class="gmail_quote">On Wed, Aug 11, 2010 at 8:34 PM, Luca Barbieri <span dir="ltr">&lt;<a href="mailto:luca@luca-barbieri.com">luca@luca-barbieri.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im">&gt; I agree that if a texture was created as GL_TEXTURE_RECTANGLE, meaning that<br>
&gt; all shaders use the TGSI_TEXTURE_RECT sampler type, it makes sense to use<br>
&gt; unnormalized coordinates. However if a texture is NPOT as in OpenGL, meaning<br>
&gt; that all shaders use the TGSI_TEXTURE_2D sampler type, we shouldn&#39;t force<br>
&gt; unnormalized texture coordinates everywhere and trade effectivity and<br>
&gt; simplicity of one driver (nvfx/nv30) at the expense of another (r300). Also<br>
</div>The only change to r300g would be a single line to set the flag off.<br>
Why would this be a problem? Am I missing something?<br></blockquote><div><br>No, it&#39;s not a problem, though I&#39;d like you to use TGSI_TEXTURE_RECT in shaders when appropriate to be Radeon-friendly (I am talking about r300 up to r700 here).<br>

<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Note that for ARB_texture_non_power_of_two textures, there would be no<br>
changes, since the state tracker won&#39;t ask for unnormalized<br>
coordinates and thus the flag won&#39;t be set, unless the driver decides<br>
to set it itself because it always prefers unnormalized coordinates.<br>
<br>
In general, only drivers that actively prefer one normalization would<br>
need to take action, in the form of advertising that by setting the<br>
flag on the texture.<br>
<div class="im"><br>
&gt; I don&#39;t like changing pipe_resource::flags after a texture is created.<br>
</div>It seems a good idea though to let the driver have a say on how<br>
u_blitter/u_blit should specify coordinates.<br>
Otherwise, they can&#39;t possible behave optimally on both nv30 and r300,<br>
which have opposing needs.<br>
And since it depends on the texture layout, a cap won&#39;t work.<br>
<div class="im"><br>
&gt; Some time ago I think Brian suggested to add PIPE_TEXTURE_RECT as another<br>
&gt; texture type and make it match the meaning of GL_TEXTURE_RECTANGLE. We would<br>
&gt; do this change but we had no time back then. This seems to be the solution<br>
&gt; that would work best for everybody.<br>
<br>
</div>I think this would require extensive changes due to all the places<br>
that check for PIPE_TEXTURE_2D, and unduly burdens modern hardware<br>
(nv50+, r600+) which doesn&#39;t really care, since it supports everything<br>
orthogonally (BTW, note that OpenCL even requires to be able to<br>
mix&amp;match samplers and sampler views in the shaders).<br>
It seems best to minimize the impact of this legacy behavior as much<br>
as possible.<br>
<br>
Is there any other factor that would balance all these disadvantages<br>
of introducing PIPE_TEXTURE_RECT?<br>
</blockquote></div><br>Because all nvidia hardware seems to have the normalized bit as a property of a resource (PIPE_TEXTURE_RECT or a flag would be 
okay here), and all ATI hardware has the normalized bit as part of the 
texture instruction (it&#39;s a shader state, so a driver looks for 
TGSI_TEXTURE_RECT), I believe it would really be best for everyone to have this RECT texture target type and removing normalized_coords from pipe_sampler_state. Luca, you&#39;ve already done some work for this change. If you don&#39;t have time to finish PIPE_TEXTURE_RECT, I&#39;ll do that.<br>

<br>-Marek<br>