Bug 4499 - texture rectangle should not cause a tcl fallback
Summary: texture rectangle should not cause a tcl fallback
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/R100 (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high enhancement
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-18 17:53 UTC by Roland Scheidegger
Modified: 2009-08-24 12:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
remove texrect fallback, enable texgen for r/q coords (25.65 KB, patch)
2005-09-27 05:41 UTC, Roland Scheidegger
Details | Splinter Review
new patch, fixes two typos (25.64 KB, patch)
2005-10-03 12:28 UTC, Roland Scheidegger
Details | Splinter Review

Description Roland Scheidegger 2005-09-18 17:53:23 UTC
Currently, the use of a texture rectangle causese a tcl fallback, which is not
necessary. In fact, there are 2 easy ways to avoid it:
1) do the texcoord translation on the fly when copying the vertices - this would
work for sw tnl and hw tnl just the same. In fact, I consider the current
solution with its own texrect stage overkill, we need to copy the coords twice
for no good reason, since the coord translation is fixed we should probably just
do it when uploading. I think though texgen would be broken with that solution
for hw tcl. So...
2) the better solution would probably be to just use the texture matrix for the
coord translation (if it's already active, fix it up, otherwise enable it).
Obviously this only works if hw tcl is active, though just fixing the coords up
when uploading may in fact be faster (not sure, does using the texture matrix
even come with a performance hit at all?). This solution should work for texgen
too I suppose however.

btw note that the current solution does not do projective texturing at all for
some reason, as the q coord is simply ignored. Should be easy to fix though...
Comment 1 Roland Scheidegger 2005-09-27 05:41:30 UTC
Created attachment 3413 [details] [review]
remove texrect fallback, enable texgen for r/q coords

Ok here's something to play with. This patch kills the texrect tcl fallback,
and at the same time tries to fix issues with (tcl) texcoord/texgen/texmat
handling. Unfortunately, I can't test it right now, any volunteers (I did get
projtex to work with some quick hack, as well as get correct texcoords for
texrect with another quick hack, but I don't have the card here now to test)?
It's based on lots of assumptions, so even apart from coding errors I wouldn't
be surprised if it doesn't quite work correctly - in theory this should even
fix ut2k3 shadow projectors (though I'm not sure 2 texture units are enough to
get them enabled at all).
Comment 2 Roland Scheidegger 2005-10-03 12:28:12 UTC
Created attachment 3473 [details] [review]
new patch, fixes two typos

The original patch had two important typos, this one works much better. I only
got the chance to test it very briefly, but if noone else tests it I'm going to
submit it anyway. Results seemed very encouraging: texrect, projtex work with
hw tcl. ut2k3 shadow projectors work with hw tcl. From the texgenmix test, the
two mixed cases at the bottom right do not work (that is expected - the other
mixed texgen case gets lucky and hits a fallback). All 3 non-texgen tests work,
as do all 3 texgen tests - with the caveat that the test with only s/t texgen
enabled only works with tcl_mode set to 1, but not 2. I think that's a bug
within the vtxfmt code, maybe the single texcoord which is emitted there causes
trouble.
Comment 3 Roland Scheidegger 2005-10-05 04:44:13 UTC
Commited to cvs.
Comment 4 Adam Jackson 2009-08-24 12:23:26 UTC
Mass version move, cvs -> git


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.