summaryrefslogtreecommitdiff
path: root/src/mesa/program
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp5
-rw-r--r--src/mesa/program/prog_execute.c4
-rw-r--r--src/mesa/program/prog_execute.h1
-rw-r--r--src/mesa/program/prog_print.c5
4 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 0929b95950..786fdfbd23 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/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/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index dd15e9a1cc..e7553c69db 100644
--- a/src/mesa/program/prog_execute.c
+++ b/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/src/mesa/program/prog_execute.h b/src/mesa/program/prog_execute.h
index cefd468c36..cdf37082a0 100644
--- a/src/mesa/program/prog_execute.h
+++ b/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/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
index abebf392c0..484596af76 100644
--- a/src/mesa/program/prog_print.c
+++ b/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