PDA

View Full Version : vp program and "result"



V-man
06-23-2003, 05:49 PM
In my vp program, I named one of my temporaries result.
Is this illegal?
It gives me an error and when I rename it as resul, it works fine.

I'm quite certain it worked fine before.
My drivers are 44.03

Yes I know, it's a stupid problem.

PS: I hope GL2 makes it easier to debug these things.

bashbaug
06-23-2003, 05:58 PM
Originally posted by V-man:
In my vp program, I named one of my temporaries result.
Is this illegal?
It gives me an error and when I rename it as resul, it works fine.

I'm quite certain it worked fine before.
My drivers are 44.03

Yes I know, it's a stupid problem.

PS: I hope GL2 makes it easier to debug these things.

Yep... from the ARB_vp spec:



(93) This extension allows applications to name their own variables. What
keywords should be reserved?

RESOLVED: Instruction names and declaration keywords (e.g., PARAM) will
be reserved. Additionally, since attribute, parameter, and result
bindings are allowed in the program text, the binding prefix keywords
"vertex", "state", "program", and "result" are reserved to simplify
parsing. This prevents the need to distinguish between
"vertex.position" ("vertex" as a binding) and "vertex.xyzw" ("vertex" as
a variable).

V-man
06-24-2003, 06:06 AM
That's odd. Even the spec uses result as a variable in all it's examples.

Thanks.

vincoof
06-24-2003, 09:16 AM
It's not used as a variable in the examples. It is used as a binding.

V-man
06-25-2003, 06:01 AM
Originally posted by vincoof:
It's not used as a variable in the examples. It is used as a binding.

Yes, it is a binding, but the spec is full of thisv line in the examples :

TEMP result, temp;

Why do they do that?

vincoof
06-25-2003, 11:13 AM
They do that because the result of an operation is logically called "result", but I admit it leads to confusion.