aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/r300_fragprog.h
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2005-05-23 14:14:19 +0000
committerBen Skeggs <[email protected]>2005-05-23 14:14:19 +0000
commiteeada484979e9784ebb03f635f207e717a04e311 (patch)
tree54a94ddb1af18e91f5908e035b2e2242ca1d0bc5 /src/mesa/drivers/dri/r300/r300_fragprog.h
parent0c4731b27ccf5faa1393102107862c28642b3d76 (diff)
Implement enough of ARB_fragment_program for Keith's texenv program
generation in Mesa. Requires most recent Mesa cvs to work correctly. Swizzle code is possibly slow/buggy and will probably be replaced. Old behaviour can be controlled by a #define in r300_context.h, if no-one minds I'll remove the old code later on. Also, disabled cube map extension. AFAIK We don't support it yet, and it causes issues with UT2004.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_fragprog.h')
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h
new file mode 100644
index 00000000000..b98c6c03a77
--- /dev/null
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.h
@@ -0,0 +1,46 @@
+#ifndef __R300_FRAGPROG_H_
+#define __R300_FRAGPROG_H_
+
+#include "glheader.h"
+#include "macros.h"
+#include "enums.h"
+
+#include "program.h"
+#include "r300_context.h"
+#include "nvfragprog.h"
+
+/* representation of a register for emit_arith/swizzle */
+typedef struct _pfs_reg_t {
+ enum {
+ REG_TYPE_INPUT,
+ REG_TYPE_OUTPUT,
+ REG_TYPE_TEMP,
+ REG_TYPE_CONST
+ } type:2;
+ GLuint index:6;
+ GLuint v_swz:5;
+ GLuint s_swz:5;
+ GLboolean vcross:1;
+ GLboolean scross:1;
+ GLuint negate:1; //XXX: we need to handle negate individually
+ GLboolean has_w:1;
+ GLboolean valid:1;
+} pfs_reg_t;
+
+/* supported hw opcodes */
+#define PFS_OP_MAD 0
+#define PFS_OP_DP3 1
+#define PFS_OP_DP4 2
+#define PFS_OP_MIN 3
+#define PFS_OP_MAX 4
+#define PFS_OP_CMP 5
+#define PFS_OP_FRC 6
+#define PFS_OP_EX2 7
+#define PFS_OP_LG2 8
+#define PFS_OP_RCP 9
+#define PFS_OP_RSQ 10
+#define MAX_PFS_OP 10
+#define OP(n) PFS_OP_##n
+
+#endif
+