summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/arbprogparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/arbprogparse.c')
-rw-r--r--src/mesa/shader/arbprogparse.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 2e0fc3694a4..a4d0fc3efc8 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -969,6 +969,7 @@ parse_output_color_num (GLcontext * ctx, const GLubyte ** inst,
GLint i = parse_integer (inst, Program);
if ((i < 0) || (i >= (int)ctx->Const.MaxDrawBuffers)) {
+ *color = 0;
program_error(ctx, Program->Position, "Invalid draw buffer index");
return 1;
}
@@ -1688,7 +1689,7 @@ parse_result_binding(GLcontext *ctx, const GLubyte **inst,
*/
parse_output_color_num(ctx, inst, Program, &out_color);
ASSERT(out_color < MAX_DRAW_BUFFERS);
- *outputReg = FRAG_RESULT_COLR;
+ *outputReg = FRAG_RESULT_COLOR;
}
else {
/* for vtx programs, this is VERTEX_RESULT_POSITION */
@@ -1699,7 +1700,7 @@ parse_result_binding(GLcontext *ctx, const GLubyte **inst,
case FRAGMENT_RESULT_DEPTH:
if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) {
/* for frag programs, this is FRAGMENT_RESULT_DEPTH */
- *outputReg = FRAG_RESULT_DEPR;
+ *outputReg = FRAG_RESULT_DEPTH;
}
else {
/* for vtx programs, this is VERTEX_RESULT_COLOR */
@@ -2246,7 +2247,7 @@ parse_declaration (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc
static GLuint
parse_masked_dst_reg (GLcontext * ctx, const GLubyte ** inst,
struct var_cache **vc_head, struct arb_program *Program,
- enum register_file *File, GLuint *Index, GLint *WriteMask)
+ gl_register_file *File, GLuint *Index, GLint *WriteMask)
{
GLuint tmp, result;
struct var_cache *dst;
@@ -2478,7 +2479,7 @@ static GLuint
parse_src_reg (GLcontext * ctx, const GLubyte ** inst,
struct var_cache **vc_head,
struct arb_program *Program,
- enum register_file * File, GLint * Index,
+ gl_register_file * File, GLint * Index,
GLboolean *IsRelOffset )
{
struct var_cache *src;
@@ -2527,7 +2528,7 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst,
return 1;
}
- *File = (enum register_file) src->param_binding_type;
+ *File = (gl_register_file) src->param_binding_type;
switch (*(*inst)++) {
case ARRAY_INDEX_ABSOLUTE:
@@ -2573,7 +2574,7 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst,
if (parse_param_use (ctx, inst, vc_head, Program, &src))
return 1;
- *File = (enum register_file) src->param_binding_type;
+ *File = (gl_register_file) src->param_binding_type;
*Index = src->param_binding_begin;
break;
}
@@ -2598,7 +2599,7 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst,
/* XXX: We have to handle offsets someplace in here! -- or are those above? */
case vt_param:
- *File = (enum register_file) src->param_binding_type;
+ *File = (gl_register_file) src->param_binding_type;
*Index = src->param_binding_begin;
break;
@@ -2623,7 +2624,7 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst,
}
if (*File == PROGRAM_STATE_VAR) {
- enum register_file file;
+ gl_register_file file;
/* If we're referencing the Program->Parameters[] array, check if the
* parameter is really a constant/literal. If so, set File to CONSTANT.
@@ -2652,7 +2653,7 @@ parse_vector_src_reg(GLcontext *ctx, const GLubyte **inst,
struct arb_program *program,
struct prog_src_register *reg)
{
- enum register_file file;
+ gl_register_file file;
GLint index;
GLubyte negateMask;
GLubyte swizzle[4];
@@ -2686,7 +2687,7 @@ parse_scalar_src_reg(GLcontext *ctx, const GLubyte **inst,
struct arb_program *program,
struct prog_src_register *reg)
{
- enum register_file file;
+ gl_register_file file;
GLint index;
GLubyte negateMask;
GLubyte swizzle[4];
@@ -2722,7 +2723,7 @@ parse_dst_reg(GLcontext * ctx, const GLubyte ** inst,
{
GLint mask;
GLuint idx;
- enum register_file file;
+ gl_register_file file;
if (parse_masked_dst_reg (ctx, inst, vc_head, program, &file, &idx, &mask))
return 1;
@@ -2752,9 +2753,6 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst,
_mesa_init_instructions(fp, 1);
- /* Record the position in the program string for debugging */
- fp->StringPos = Program->Position;
-
/* OP_ALU_INST or OP_TEX_INST */
instClass = *(*inst)++;
@@ -3016,7 +3014,7 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst,
{
GLubyte swizzle[4];
GLubyte negateMask;
- enum register_file file;
+ gl_register_file file;
GLint index;
if (parse_src_reg(ctx, inst, vc_head, Program, &file, &index, &rel))
@@ -3104,6 +3102,9 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst,
break;
}
+ if (shadow_tex)
+ fp->TexShadow = 1;
+
/* Don't test the first time a particular sampler is seen. Each time
* after that, make sure the shadow state is the same.
*/
@@ -3191,8 +3192,6 @@ parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst,
code = *(*inst)++;
_mesa_init_instructions(vp, 1);
- /* Record the position in the program string for debugging */
- vp->StringPos = Program->Position;
switch (type) {
/* XXX: */
@@ -3356,7 +3355,7 @@ parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst,
GLubyte swizzle[4];
GLubyte negateMask;
GLboolean relAddr;
- enum register_file file;
+ gl_register_file file;
GLint index;
if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg))
@@ -3554,10 +3553,6 @@ parse_instructions(GLcontext * ctx, const GLubyte * inst,
const GLuint numInst = Program->Base.NumInstructions;
_mesa_init_instructions(Program->Base.Instructions + numInst, 1);
Program->Base.Instructions[numInst].Opcode = OPCODE_END;
- /* YYY Wrong Position in program, whatever, at least not random -> crash
- Program->Position = parse_position (&inst);
- */
- Program->Base.Instructions[numInst].StringPos = Program->Position;
}
Program->Base.NumInstructions++;