diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-05-14 16:04:29 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-05-14 16:04:29 -0600 |
commit | 05cacc06ccbbf088ab3fed0bf648f4f5fc61c154 (patch) | |
tree | e5688562395101dfe39047995be55d7055817e6d /src | |
parent | fcb23d7db7339a2b1ca51d929fc1b5065f7e0f77 (diff) |
mesa: minor bug fixes from master
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 964274eba8..ff63e05dd2 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.0.3 * * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. * @@ -869,12 +869,18 @@ emit_return(slang_emit_info *emitInfo, slang_ir_node *n) static struct prog_instruction * emit_kill(slang_emit_info *emitInfo) { + struct gl_fragment_program *fp; struct prog_instruction *inst; /* NV-KILL - discard fragment depending on condition code. * Note that ARB-KILL depends on sign of vector operand. */ inst = new_instruction(emitInfo, OPCODE_KIL_NV); inst->DstReg.CondMask = COND_TR; /* always branch */ + + assert(emitInfo->prog->Target == GL_FRAGMENT_PROGRAM_ARB); + fp = (struct gl_fragment_program *) emitInfo->prog; + fp->UsesKill = GL_TRUE; + return inst; } @@ -1500,6 +1506,10 @@ emit_struct_field(slang_emit_info *emitInfo, slang_ir_node *n) { if (n->Store->File == PROGRAM_STATE_VAR) { n->Store->Index = _slang_alloc_statevar(n, emitInfo->prog->Parameters); + if (n->Store->Index < 0) { + slang_info_log_error(emitInfo->log, "Error parsing state variable"); + return NULL; + } } else { GLint offset = n->FieldOffset / 4; |