summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-03-30 15:53:58 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-03-30 15:53:58 +0000
commit41d389909bc87d21cf7ef8639bead1b4494e3b0e (patch)
treea854f7bd4c550962a6053b7530d08e2aa680b056 /src/mesa/swrast
parentff7d3bb7df7a9d526d10dd408aa7ac4eb8b980c4 (diff)
Insert original fragment program instructions as comments.
s/__inline/INLINE/
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_fragprog_to_c.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_fragprog_to_c.c b/src/mesa/swrast/s_fragprog_to_c.c
index 78526ca146..b649da2a3e 100644
--- a/src/mesa/swrast/s_fragprog_to_c.c
+++ b/src/mesa/swrast/s_fragprog_to_c.c
@@ -106,7 +106,7 @@
#define deref(reg,pos) swizzle(reg, pos, pos, pos, pos)
-static __inline int is_swizzled( int reg )
+static INLINE int is_swizzled( int reg )
{
return ((reg & UREG_XYZW_CHANNEL_MASK) !=
(UREG(0,0) & UREG_XYZW_CHANNEL_MASK));
@@ -115,7 +115,7 @@ static __inline int is_swizzled( int reg )
/* One neat thing about the UREG representation:
*/
-static __inline int swizzle( int reg, int x, int y, int z, int w )
+static INLINE int swizzle( int reg, int x, int y, int z, int w )
{
return ((reg & ~UREG_XYZW_CHANNEL_MASK) |
CHANNEL_SRC( GET_CHANNEL_SRC( reg, x ), 0 ) |
@@ -126,7 +126,7 @@ static __inline int swizzle( int reg, int x, int y, int z, int w )
/* Another neat thing about the UREG representation:
*/
-static __inline int negate( int reg, int x, int y, int z, int w )
+static INLINE int negate( int reg, int x, int y, int z, int w )
{
return reg ^ (((x&1)<<UREG_CHANNEL_X_NEGATE_SHIFT)|
((y&1)<<UREG_CHANNEL_Y_NEGATE_SHIFT)|
@@ -476,6 +476,17 @@ static void upload_program( const struct fragment_program *p )
for (i = 0; i < nr; i++)
src[i] = src_vector( &inst->SrcReg[i] );
+ /* Print the original program instruction string */
+ {
+ const char *s = (const char *) p->Base.String + inst->StringPos;
+ printf(" /* ");
+ while (*s != ';') {
+ putchar(*s);
+ s++;
+ }
+ printf("; */\n");
+ }
+
switch (inst->Opcode) {
case FP_OPCODE_ABS:
assign4(p, inst, "FABSF(%s)", src[0]);