PDA

View Full Version : ATi: apply 2 or more depth textures simultaneously?



tellaman
01-27-2005, 12:03 PM
going through arb_shadow specs i can see no restriction on using 2 or more depth compare stages at the same time
in fact, this works fine on nv cards (tested on a 5900) but fails on my mobility 9700 (6.14.10.6458 drivers)
actually if there's already 1 depth compare (say in tex unit 0) the card behaves as it is expecting a rgb texture in the next stage
as far as you know, is there any way to get this to work on ati hardware?

thanks for any help you may provide

Korval
01-27-2005, 01:55 PM
Your 9700 probably runs out of fragment program opcodes. Because the hardware doesn't directly implement ARB_shadow, it must expand shadow accesses into fragment program ops. Since PCF takes up quite a few opcodes, doing two or more of them probably blows the 32 opcode limitation of the hardware.

tellaman
01-27-2005, 02:23 PM
Originally posted by Korval:
Your 9700 probably runs out of fragment program opcodes. Because the hardware doesn't directly implement ARB_shadow, it must expand shadow accesses into fragment program ops. Since PCF takes up quite a few opcodes, doing two or more of them probably blows the 32 opcode limitation of the hardware.First of all thanks for your answer.
That said I'm a bit confused, I always thought ati cards could not do PCF, I mean I know for sure there is no hardware support for bilinear, isnt the depth comparison done in some sort of single-fetch-from-depth-texture fragment program?!?

Korval
01-27-2005, 06:47 PM
That said I'm a bit confused, I always thought ati cards could not do PCF, I mean I know for sure there is no hardware support for bilinear, isnt the depth comparison done in some sort of single-fetch-from-depth-texture fragment program?!?The ARB_shadow extension specifies what a compliant implementation must do to be compliant. If you expose ARB_shadow, you have to do PCF. To emulate it, they do 4 samples and manually compute the results. So that's 4 texture accesses (from the same texture. The maximum allowed for the same texture), plus having to do conditional operations and combining the results of that together. Depending on how their hardware works, it may not be possible to do this on 2 separate textures.

Ysaneya
01-27-2005, 11:17 PM
I'm not aware of any PCF on ATI cards, and i work on shadow maps every day with them. Actually PCF is not even mentionned in the specification of ARB_shadow, unless i overlooked something.

Y.

tellaman
01-28-2005, 12:25 AM
agreed with ysaneya, actually the specs are saying that shadow maps filtering is not strictly required and is implementation dependent, they dont state any rule in particular

anyone from ati to confirm this limitation of a single depth compare?

tellaman
01-28-2005, 03:23 AM
By the way, Ysaneya, should you own an ati card, have you ever experienced the same trouble?

spasi
01-28-2005, 04:06 AM
If you're using GLSL for this (sampler2DShadow), my experience with ATIs is full of weird problems, even with a single depth map. And I mean *really weird* results, with any driver.

As for running out of opcodes, it shouldn't be problem (given a good implementation) because I've seen an ATI soft shadow demo with 16 samples/compares (implemented in a low-level d3d shader though).

tellaman
01-28-2005, 01:32 PM
i cant go for glsl, i am using plain arb_shadow extensions
how can it be this restriction is not documented anywhere?

Humus
01-28-2005, 05:39 PM
There shouldn't be any such limitation. We're probably looking at a bug here. In fact, I'm currently investigating an ARB_shadow bug that may be related to this. Do you guys see any difference between different driver revisions, say between Cat 4.10 to 4.12?

Humus
01-28-2005, 05:40 PM
Originally posted by Korval:
the 32 opcode limitation of the hardware.Actually, it's 64 instructions (128 with co-issue), plus 32 texture instructions.

tellaman
01-30-2005, 09:04 AM
thanks for your reply Humus, in the meanwhile i'm goint to try and upgrade my drivers, though my notebook manufacturer offers no updated drivers

Humus
01-30-2005, 09:06 AM
Try this tool:

http://www.driverheaven.net/patje/