PDA

View Full Version : gl_FragCoord in sw on Radeon



Dee.cz
11-06-2006, 09:52 AM
Do you know why Radeon (tested on X300) runs shaders with gl_FragCoord in sw? Is it known limitation, do we have to compute gl_FragCoord ourselves?

I tested shader using 2 samplers and 2 interpolators, so with plenty of free unused interpolators. Still it switches to sw when gl_FragCoord is added. Tested with catalyst 6.8 and 6.10.

Dee

Humus
11-06-2006, 03:26 PM
gl_FragCoord is not natively supported by the hardware, but it should be emulated and run in hardware if there's a free interpolator. However, it can still go into software mode if you're using for instance glPolygonOffset().

Dee.cz
11-07-2006, 03:15 PM
It was caused by glPolygonOffset(), thanks!

Dee.cz
11-08-2006, 12:04 AM
Radeon switches to sw, this time without shader, but after glPointSize(x) for any x>1. Any idea why?

Experimenting with all settings to guess reasons behind switch to sw is slow. Is there better way, some list of forbidden operations?

It would be great if we have simple extension that provides explanation -> each time driver decides to switch to sw, it would set pointer to string with explanation. Extension would add method to retrieve this string.

Dee.cz
11-08-2006, 01:23 AM
Heureka. Radeon switches to sw when gl_FragCoord is used and glPointSize>1. Even when no points are rendered. Simple glPointSize(1) helps.

dobradusa
11-08-2006, 07:12 AM
Originally posted by Dee.cz:
Heureka. Radeon switches to sw when gl_FragCoord is used and glPointSize>1. Even when no points are rendered. Simple glPointSize(1) helps. I know this may be a silly question, but how exactly do you detect when the gpu switches to sw mode?

Humus
11-08-2006, 05:27 PM
Originally posted by Dee.cz:
Radeon switches to sw, this time without shader, but after glPointSize(x) for any x>1. Any idea why?

Experimenting with all settings to guess reasons behind switch to sw is slow. Is there better way, some list of forbidden operations?It shouldn't run in software if you're not using shaders. There are some cases with shaders running in software if you're using shader and either wide points/lines, AA points/lines or stipple. This is because they are implemented with shader resources and may not stay within hardware limits.

Humus
11-08-2006, 05:28 PM
Originally posted by dobradusa:
I know this may be a silly question, but how exactly do you detect when the gpu switches to sw mode? If you can count your framerate in seconds per frame rather than frames per second that's a pretty strong indication.