Hi,

I'm going to implement GLSL 1.0 support for r300 and I have few questions.
The problem is r300 and r400 hw doesn't support branching/loops. For loops 
there's no other way than fallback to software, but I can do branching by 
executing all branches and then selecting result depending on condition.

Let's take a look at this shader (in pseudo-code):

if (some_vec4 > {2.0, 3.0, 1.0, 0.0})
  some_code;
else
  other_code;
endif

It would be translated into something like this:
SGT TEMP[1].w, TEMP[0].xyzw, CONST[0].xyzw
IF TEMP[1].wwww
 some_code;
ELSE
 other_code;
ENDIF

How should I understand that IF instruction? If all components are greater 
than zero, or only one have to be greater than zero, or maybe all components 
must equal to 1.0?

What if the condition be something like this (var.xw > {2.0, 0.0})?
Is it even legal to compare only selected vector components?
If so, how would the code look like after translation?

Regards,
Maciej Cencora



------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to