Originally posted by V-man:
[b]Also the SUB instruction is not available on NV.
I don’t care about optimizing for now. I’m trying to find out about the little details.
There is no way to get information on errors on NV?
In ARB, you can do glGetString(GL_PROGRAM_ERROR_ARB);[/b]
V-man,
FYI – I believe NV_vertex_program1_1 adds a “SUB” instruction. All NVIDIA devices that support NV_vertex_program support NV_vertex_program1_1. But you do have to have a “!VP1.1” header (or better) for “SUB” to work.
Current NVIDIA drivers don’t support queries of GL_PROGRAM_ERROR_STRING_ARB for NV_v_p programs (I added the functionality in NV_fragment_program and carried it over to ARB_vertex_program.) This may change in the future, but that doesn’t help you for now.
I don’t see anything obviously wrong with
SUB R1, c[18].w, c[18].z;
or
ADD R1, c[18].w, -c[18].z;
I’m assuming the program loads if you take out/comment out such instructions? That’s a good debugging tool, as is querying the ERROR_POSITION (which is supported for both ARB and NV programs). The error string is also helpful.
NV_v_p does disallow the use of multiple constants in an instruction, but does allow multiple uses of the same constant.
If you’re stuck, send me an email with your program text and I’d be happy to scan it to figure out why it’s not working.
Other basic rules that apply to ARB and NV programs:
As far as swizzles go, you always specify four components. “.x” is shorthand for “.xxxx” and a blank swizzle is shorthand for “.xyzw”.
Note that writemasks have to enumerate components in order – R1.xyz is valid; R1.zyx is not.
Hope this helps,
Pat