From eeada484979e9784ebb03f635f207e717a04e311 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 23 May 2005 14:14:19 +0000 Subject: 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. --- src/mesa/drivers/dri/r300/r300_fragprog.h | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/mesa/drivers/dri/r300/r300_fragprog.h (limited to 'src/mesa/drivers/dri/r300/r300_fragprog.h') 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 + -- cgit v1.2.3