<div class="gmail_quote">On Wed, Aug 11, 2010 at 8:34 PM, Luca Barbieri <span dir="ltr"><<a href="mailto:luca@luca-barbieri.com">luca@luca-barbieri.com</a>></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">> I agree that if a texture was created as GL_TEXTURE_RECTANGLE, meaning that<br>
> all shaders use the TGSI_TEXTURE_RECT sampler type, it makes sense to use<br>
> unnormalized coordinates. However if a texture is NPOT as in OpenGL, meaning<br>
> that all shaders use the TGSI_TEXTURE_2D sampler type, we shouldn't force<br>
> unnormalized texture coordinates everywhere and trade effectivity and<br>
> 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's not a problem, though I'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't ask for unnormalized<br>
coordinates and thus the flag won'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>
> I don'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'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't work.<br>
<div class="im"><br>
> Some time ago I think Brian suggested to add PIPE_TEXTURE_RECT as another<br>
> texture type and make it match the meaning of GL_TEXTURE_RECTANGLE. We would<br>
> do this change but we had no time back then. This seems to be the solution<br>
> 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't really care, since it supports everything<br>
orthogonally (BTW, note that OpenCL even requires to be able to<br>
mix&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'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've already done some work for this change. If you don't have time to finish PIPE_TEXTURE_RECT, I'll do that.<br>
<br>-Marek<br>