aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-09-25 09:37:58 +0200
committermarha <marha@users.sourceforge.net>2013-09-25 09:37:58 +0200
commit1245204b2091d108a8688ff7f749f2c6cc830381 (patch)
treec903bf477d9ddf666685494f3b035680d5d41580 /mesalib/src/mesa/program
parentb299d73bb416e2a26a642a54d5a15ea9fa30df33 (diff)
parent14718f10dcda487178690de9a51cc5acdf21e468 (diff)
downloadvcxsrv-1245204b2091d108a8688ff7f749f2c6cc830381.tar.gz
vcxsrv-1245204b2091d108a8688ff7f749f2c6cc830381.tar.bz2
vcxsrv-1245204b2091d108a8688ff7f749f2c6cc830381.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig mesa git update 25 Sep 2013
Diffstat (limited to 'mesalib/src/mesa/program')
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp18
-rw-r--r--mesalib/src/mesa/program/program.c5
2 files changed, 17 insertions, 6 deletions
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp
index c46a3d005..8cd42dfd2 100644
--- a/mesalib/src/mesa/program/ir_to_mesa.cpp
+++ b/mesalib/src/mesa/program/ir_to_mesa.cpp
@@ -57,11 +57,13 @@ extern "C" {
#include "program/sampler.h"
}
+static int swizzle_for_size(int size);
+
+namespace {
+
class src_reg;
class dst_reg;
-static int swizzle_for_size(int size);
-
/**
* This struct is a corresponding struct to Mesa prog_src_register, with
* wider fields.
@@ -129,6 +131,8 @@ public:
src_reg *reladdr;
};
+} /* anonymous namespace */
+
src_reg::src_reg(dst_reg reg)
{
this->file = reg.file;
@@ -147,6 +151,8 @@ dst_reg::dst_reg(src_reg reg)
this->reladdr = reg.reladdr;
}
+namespace {
+
class ir_to_mesa_instruction : public exec_node {
public:
DECLARE_RZALLOC_CXX_OPERATORS(ir_to_mesa_instruction)
@@ -316,6 +322,8 @@ public:
void *mem_ctx;
};
+} /* anonymous namespace */
+
static src_reg undef_src = src_reg(PROGRAM_UNDEFINED, 0, NULL);
static dst_reg undef_dst = dst_reg(PROGRAM_UNDEFINED, SWIZZLE_NOOP);
@@ -2244,7 +2252,7 @@ ir_to_mesa_visitor::visit(ir_if *ir)
visit_exec_list(&ir->else_instructions, this);
}
- if_inst = emit(ir->condition, OPCODE_ENDIF);
+ emit(ir->condition, OPCODE_ENDIF);
}
void
@@ -2407,6 +2415,8 @@ print_program(struct prog_instruction *mesa_instructions,
}
}
+namespace {
+
class add_uniform_to_shader : public program_resource_visitor {
public:
add_uniform_to_shader(struct gl_shader_program *shader_program,
@@ -2436,6 +2446,8 @@ private:
gl_shader_type shader_type;
};
+} /* anonymous namespace */
+
void
add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
bool row_major)
diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c
index 2529c1305..093d37297 100644
--- a/mesalib/src/mesa/program/program.c
+++ b/mesalib/src/mesa/program/program.c
@@ -72,10 +72,10 @@ _mesa_init_program(struct gl_context *ctx)
ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
/* If this fails, increase prog_instruction::TexSrcUnit size */
- ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
+ STATIC_ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
/* If this fails, increase prog_instruction::TexSrcTarget size */
- ASSERT(NUM_TEXTURE_TARGETS <= (1 << 4));
+ STATIC_ASSERT(NUM_TEXTURE_TARGETS <= (1 << 4));
ctx->Program.ErrorPos = -1;
ctx->Program.ErrorString = _mesa_strdup("");
@@ -477,7 +477,6 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
if (prog->Parameters)
clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
- memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
clone->IndirectRegisterFiles = prog->IndirectRegisterFiles;
clone->NumInstructions = prog->NumInstructions;
clone->NumTemporaries = prog->NumTemporaries;