For example see this fragment shader:
FRAG
DCL IN[0], GENERIC[0], LINEAR
DCL IN[1], GENERIC[1], LINEAR
DCL OUT[0], COLOR
0: MUL OUT[0], IN[0], IN[1]
1: END
IN means a varying (input), OUT is the output (like gl_FragColor). GENERIC[i] is basically like gl_TexCoord[i]. Everything is implicitly a 4D vector and you can use swizzles and masks as you want. The code performs:
OUT[0].xyzw = IN[0].xyzw * IN[1].xyzw;
Put it in a file or a string and load it using tgsi_text_translate, then you get the tokens you can pass to the driver (create_fs_state).
See also these shaders:
http://cgit.freedesktop.org/mesa/mes...ega/asm_util.h


Reply With Quote
so at least for now i need to to be able to readback the results )