aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-12-22 13:12:15 +0100
committermarha <marha@users.sourceforge.net>2013-12-22 13:16:58 +0100
commit1d03b6f684ab1ea6772f00058605a9ebb2910628 (patch)
tree8b393bd59900eba6aa9010cab9e714922cac2536 /mesalib/src/mesa/program/ir_to_mesa.cpp
parent5567cf1befbda64f2dc6fae1d337567cd984b46e (diff)
parentc81020559f329a516191927222b3698ba7370aca (diff)
downloadvcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.tar.gz
vcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.tar.bz2
vcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.zip
Merge remote-tracking branch 'origin/released'
* origin/released: libxtrans fontconfig glproto libX11 libxcb xcbproto mesa xserver pixman xkeyboard-config git update 22 Dec 2013 Conflicts: mesalib/include/GL/glext.h mesalib/src/mesa/drivers/dri/common/dri_util.c mesalib/src/mesa/drivers/dri/swrast/swrast.c xorg-server/damageext/damageext.c xorg-server/dix/dispatch.c xorg-server/glx/glxdriswrast.c xorg-server/glx/indirect_dispatch.c xorg-server/glx/indirect_dispatch_swap.c xorg-server/glx/indirect_program.c xorg-server/glx/render2.c xorg-server/glx/render2swap.c xorg-server/hw/xwin/glx/gen_gl_wrappers.py xorg-server/hw/xwin/glx/glthunk.c xorg-server/hw/xwin/glx/indirect.c xorg-server/include/os.h xorg-server/present/present_request.c
Diffstat (limited to 'mesalib/src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp63
1 files changed, 12 insertions, 51 deletions
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp
index c833a12f2..23d479c32 100644
--- a/mesalib/src/mesa/program/ir_to_mesa.cpp
+++ b/mesalib/src/mesa/program/ir_to_mesa.cpp
@@ -681,11 +681,11 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
if (strcmp(ir->name, "gl_FragCoord") == 0) {
struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog;
- fp->OriginUpperLeft = ir->origin_upper_left;
- fp->PixelCenterInteger = ir->pixel_center_integer;
+ fp->OriginUpperLeft = ir->data.origin_upper_left;
+ fp->PixelCenterInteger = ir->data.pixel_center_integer;
}
- if (ir->mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) {
+ if (ir->data.mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) {
unsigned int i;
const ir_state_slot *const slots = ir->state_slots;
assert(ir->state_slots != NULL);
@@ -759,49 +759,10 @@ ir_to_mesa_visitor::visit(ir_variable *ir)
void
ir_to_mesa_visitor::visit(ir_loop *ir)
{
- ir_dereference_variable *counter = NULL;
-
- if (ir->counter != NULL)
- counter = new(mem_ctx) ir_dereference_variable(ir->counter);
-
- if (ir->from != NULL) {
- assert(ir->counter != NULL);
-
- ir_assignment *a =
- new(mem_ctx) ir_assignment(counter, ir->from, NULL);
-
- a->accept(this);
- }
-
emit(NULL, OPCODE_BGNLOOP);
- if (ir->to) {
- ir_expression *e =
- new(mem_ctx) ir_expression(ir->cmp, glsl_type::bool_type,
- counter, ir->to);
- ir_if *if_stmt = new(mem_ctx) ir_if(e);
-
- ir_loop_jump *brk =
- new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_break);
-
- if_stmt->then_instructions.push_tail(brk);
-
- if_stmt->accept(this);
- }
-
visit_exec_list(&ir->body_instructions, this);
- if (ir->increment) {
- ir_expression *e =
- new(mem_ctx) ir_expression(ir_binop_add, counter->type,
- counter, ir->increment);
-
- ir_assignment *a =
- new(mem_ctx) ir_assignment(counter, e, NULL);
-
- a->accept(this);
- }
-
emit(NULL, OPCODE_ENDLOOP);
}
@@ -1567,10 +1528,10 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
ir_variable *var = ir->var;
if (!entry) {
- switch (var->mode) {
+ switch (var->data.mode) {
case ir_var_uniform:
entry = new(mem_ctx) variable_storage(var, PROGRAM_UNIFORM,
- var->location);
+ var->data.location);
this->variables.push_tail(entry);
break;
case ir_var_shader_in:
@@ -1579,21 +1540,21 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
* user-assigned generic attributes (glBindVertexLocation),
* and user-defined varyings.
*/
- assert(var->location != -1);
+ assert(var->data.location != -1);
entry = new(mem_ctx) variable_storage(var,
PROGRAM_INPUT,
- var->location);
+ var->data.location);
break;
case ir_var_shader_out:
- assert(var->location != -1);
+ assert(var->data.location != -1);
entry = new(mem_ctx) variable_storage(var,
PROGRAM_OUTPUT,
- var->location);
+ var->data.location);
break;
case ir_var_system_value:
entry = new(mem_ctx) variable_storage(var,
PROGRAM_SYSTEM_VALUE,
- var->location);
+ var->data.location);
break;
case ir_var_auto:
case ir_var_temporary:
@@ -2443,7 +2404,7 @@ public:
this->idx = -1;
this->program_resource_visitor::process(var);
- var->location = this->idx;
+ var->data.location = this->idx;
}
private:
@@ -2538,7 +2499,7 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
foreach_list(node, sh->ir) {
ir_variable *var = ((ir_instruction *) node)->as_variable();
- if ((var == NULL) || (var->mode != ir_var_uniform)
+ if ((var == NULL) || (var->data.mode != ir_var_uniform)
|| var->is_in_uniform_block() || (strncmp(var->name, "gl_", 3) == 0))
continue;