summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-11-01 17:25:49 +0000
committerKeith Whitwell <[email protected]>2005-11-01 17:25:49 +0000
commitc3626a91cee5034528f3f92c802a8e5947ea5f92 (patch)
treefd16d99ef237e31067e9f7a74bc2cee471bcc7e9 /src/mesa/shader
parent6aa6d440d9d312cb984020e746aa80c3dbf6ea2c (diff)
Several fp and vp tweaks:
- Renumber VERT_RESULT_* values so that they match the numbers of the corresponding FRAG_ATTRIB_ values. - Add ctx->VertexProgram._Current and FragmentProgram._Current values which point to either the current client-supplied program if enabled, or otherwise to the current mesa-internal program. Thus this program is always the correct one for the current state, providing that the mesa flags to turn on automatic generation are enabled. - Add callbacks to ctx->Driver.BindProgram() in texenvprogram.c and t_vp_build.c so that the driver knows when the generated program changes. This is cleaner than trying to code all the possible _NEW_* flags into the driver, and more precise as well. - Add a UsesKill flag to identify fragment programs with that instruction, as these can require special treatment. - Move the FRAG_OUTPUT values to mtypes.h, near to similar defn's.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/arbprogparse.c3
-rw-r--r--src/mesa/shader/arbprogparse.h2
-rw-r--r--src/mesa/shader/nvfragprog.h9
-rw-r--r--src/mesa/shader/nvvertparse.c5
4 files changed, 8 insertions, 11 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index e8fe869d0bb..19c38b6272a 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -3013,6 +3013,7 @@ parse_fp_instruction (GLcontext * ctx, GLubyte ** inst,
break;
case OP_TEX_KIL:
+ Program->UsesKill = 1;
if (parse_fp_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0]))
return 1;
fp->Opcode = FP_OPCODE_KIL;
@@ -4014,6 +4015,8 @@ _mesa_parse_arb_program (GLcontext * ctx, const GLubyte * str, GLsizei len,
program->NumTexInstructions =
program->NumTexIndirections = 0;
+ program->UsesKill = 0;
+
program->FPInstructions = NULL;
program->VPInstructions = NULL;
diff --git a/src/mesa/shader/arbprogparse.h b/src/mesa/shader/arbprogparse.h
index ececfafa8fd..947c22e767b 100644
--- a/src/mesa/shader/arbprogparse.h
+++ b/src/mesa/shader/arbprogparse.h
@@ -65,6 +65,8 @@ struct arb_program
GLuint NumAluInstructions;
GLuint NumTexInstructions;
GLuint NumTexIndirections;
+
+ GLboolean UsesKill;
};
diff --git a/src/mesa/shader/nvfragprog.h b/src/mesa/shader/nvfragprog.h
index 99ec20bb828..bd9c8bb06c1 100644
--- a/src/mesa/shader/nvfragprog.h
+++ b/src/mesa/shader/nvfragprog.h
@@ -37,15 +37,6 @@
#include "mtypes.h"
-/**
- * Fragment program output registers.
- * Note: when we fully suppport GL_ARB_draw_buffers we'll have more than
- * one output color.
- */
-#define FRAG_OUTPUT_COLR 0 /* fragment color */
-#define FRAG_OUTPUT_COLH 1 /* fragment color, half precision (NV) */
-#define FRAG_OUTPUT_DEPR 2 /* depth/Z */
-
/* condition codes */
#define COND_GT 1 /* greater than zero */
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index c48a4cb358f..24882a28979 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -288,8 +288,9 @@ static const char *InputRegisters[MAX_NV_VERTEX_PROGRAM_INPUTS + 1] = {
};
static const char *OutputRegisters[MAX_NV_VERTEX_PROGRAM_OUTPUTS + 1] = {
- "HPOS", "COL0", "COL1", "BFC0", "BFC1", "FOGC", "PSIZ",
- "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", NULL
+ "HPOS", "COL0", "COL1", "FOGC",
+ "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7",
+ "PSIZ", "BFC0", "BFC1", NULL
};
/* NOTE: the order here must match opcodes in nvvertprog.h */