SHADER STYLE AND COMMENTS

You can place C-style comments in your code. Just place two forward slashes (//), and anything after that till the end of the line will be ignored. The tokenizer will remove comments and ends of lines from your code as it works, so this means that it will read past ends of lines until it completes an instruction. That is, it treats all white space the same, so you can be indiscriminate in using any kind of white space. This means that things like the following example are legal:

 // a single line with a comment at the end mov r1, c[5+a0.x] // comment // can be written as... mov r1   ,  c [5          // five +           // plus the a0          // address register's (can't break up) . x           // x element ] 

Any errors that are reported when you assemble lines like this might be reported on the line that begins the actual instruciton, not the line that contains the error.

All instructions and register names are case sensitive. This means that all instructions to be used in a DirectX shader have to be lowercase and that register names have to be mixed case exactly as they are described.

Note 

You'll occasionally see in early examples the "asm" style comments—a semicolon followed by a comment. This is currently still accepted by the assembler but is not a supported comment type.



Real-Time Shader Programming(c) Covering Directx 9. 0
Real-Time Shader Programming (The Morgan Kaufmann Series in Computer Graphics)
ISBN: 1558608532
EAN: 2147483647
Year: 2005
Pages: 104
Authors: Ron Fosner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net