aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-16 16:08:57 +0000
committermarha <marha@users.sourceforge.net>2011-01-16 16:08:57 +0000
commit367c91bebcdc1f5ba4278b68eb8715218d9640ad (patch)
tree7ddef803c402f1b84e293793c5fd3d0e95d3de0a /mesalib/src/mesa/program
parent6feea7e6cdde235d7e3727c4155ca9f8d90df3ca (diff)
downloadvcxsrv-367c91bebcdc1f5ba4278b68eb8715218d9640ad.tar.gz
vcxsrv-367c91bebcdc1f5ba4278b68eb8715218d9640ad.tar.bz2
vcxsrv-367c91bebcdc1f5ba4278b68eb8715218d9640ad.zip
mesalib git update 16/1/2011
Diffstat (limited to 'mesalib/src/mesa/program')
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp5
-rw-r--r--mesalib/src/mesa/program/prog_execute.c4
-rw-r--r--mesalib/src/mesa/program/prog_execute.h1
-rw-r--r--mesalib/src/mesa/program/prog_print.c5
4 files changed, 15 insertions, 0 deletions
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp
index abac35ad6..ae2742afd 100644
--- a/mesalib/src/mesa/program/ir_to_mesa.cpp
+++ b/mesalib/src/mesa/program/ir_to_mesa.cpp
@@ -1462,6 +1462,7 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
case ir_var_in:
case ir_var_out:
case ir_var_inout:
+ case ir_var_system_value:
/* The linker assigns locations for varyings and attributes,
* including deprecated builtins (like gl_Color), user-assign
* generic attributes (glBindVertexLocation), and
@@ -1484,6 +1485,10 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
ir->var->type->gl_type,
ir->var->location - VERT_ATTRIB_GENERIC0);
}
+ } else if (ir->var->mode == ir_var_system_value) {
+ entry = new(mem_ctx) variable_storage(ir->var,
+ PROGRAM_SYSTEM_VALUE,
+ ir->var->location);
} else {
entry = new(mem_ctx) variable_storage(ir->var,
PROGRAM_OUTPUT,
diff --git a/mesalib/src/mesa/program/prog_execute.c b/mesalib/src/mesa/program/prog_execute.c
index 4faed2663..28a3e1e20 100644
--- a/mesalib/src/mesa/program/prog_execute.c
+++ b/mesalib/src/mesa/program/prog_execute.c
@@ -159,6 +159,10 @@ get_src_register_pointer(const struct prog_src_register *source,
return ZeroVec;
return prog->Parameters->ParameterValues[reg];
+ case PROGRAM_SYSTEM_VALUE:
+ assert(reg < Elements(machine->SystemValues));
+ return machine->SystemValues[reg];
+
default:
_mesa_problem(NULL,
"Invalid src register file %d in get_src_register_pointer()",
diff --git a/mesalib/src/mesa/program/prog_execute.h b/mesalib/src/mesa/program/prog_execute.h
index ac71c0da3..6365b0741 100644
--- a/mesalib/src/mesa/program/prog_execute.h
+++ b/mesalib/src/mesa/program/prog_execute.h
@@ -61,6 +61,7 @@ struct gl_program_machine
GLfloat (*EnvParams)[4]; /**< Vertex or Fragment env parameters */
GLuint CondCodes[4]; /**< COND_* value for x/y/z/w */
GLint AddressReg[MAX_PROGRAM_ADDRESS_REGS][4];
+ GLfloat SystemValues[SYSTEM_VALUE_MAX][4];
const GLubyte *Samplers; /** Array mapping sampler var to tex unit */
diff --git a/mesalib/src/mesa/program/prog_print.c b/mesalib/src/mesa/program/prog_print.c
index de0ca1c4f..c1383f882 100644
--- a/mesalib/src/mesa/program/prog_print.c
+++ b/mesalib/src/mesa/program/prog_print.c
@@ -72,6 +72,8 @@ _mesa_register_file_name(gl_register_file f)
return "ADDR";
case PROGRAM_SAMPLER:
return "SAMPLER";
+ case PROGRAM_SYSTEM_VALUE:
+ return "SYSVAL";
case PROGRAM_UNDEFINED:
return "UNDEFINED";
default:
@@ -310,6 +312,9 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
case PROGRAM_UNIFORM: /* extension */
sprintf(str, "uniform[%s%d]", addr, index);
break;
+ case PROGRAM_SYSTEM_VALUE:
+ sprintf(str, "sysvalue[%s%d]", addr, index);
+ break;
case PROGRAM_STATE_VAR:
{
struct gl_program_parameter *param