diff options
Diffstat (limited to 'mesalib/src/mesa')
-rw-r--r-- | mesalib/src/mesa/drivers/dri/swrast/Makefile.am | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/main/bufferobj.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/main/compiler.h | 9 | ||||
-rw-r--r-- | mesalib/src/mesa/main/enums.h | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/mtypes.h | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/teximage.c | 33 | ||||
-rw-r--r-- | mesalib/src/mesa/program/ir_to_mesa.cpp | 18 | ||||
-rw-r--r-- | mesalib/src/mesa/program/program.c | 5 |
8 files changed, 48 insertions, 25 deletions
diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am index d3da19651..fb9b8a050 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am @@ -42,7 +42,8 @@ endif swrast_dri_la_SOURCES = \ $(SWRAST_C_FILES) -swrast_dri_la_LDFLAGS = -module -avoid-version -shared +swrast_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS) + swrast_dri_la_LIBADD = \ $(DRI_LIB_DEPS) diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index ab5bbbf6d..e5814e397 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -440,7 +440,6 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size, * Note that all GL error checking will have been done already. * * \param ctx GL context. - * \param target Buffer object target on which to operate. * \param offset Offset of the first byte to be modified. * \param size Size, in bytes, of the data range. * \param data Pointer to the data to store in the buffer object. diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h index fb7baf84e..0f27d5a66 100644 --- a/mesalib/src/mesa/main/compiler.h +++ b/mesalib/src/mesa/main/compiler.h @@ -270,6 +270,15 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) #define NULL 0 #endif +/* Used to optionally mark structures with misaligned elements or size as + * packed, to trade off performance for space. + */ +#if (__GNUC__ >= 3) +#define PACKED __attribute__((__packed__)) +#else +#define PACKED +#endif + /** * LONGSTRING macro diff --git a/mesalib/src/mesa/main/enums.h b/mesalib/src/mesa/main/enums.h index 556c1db99..36c053d4b 100644 --- a/mesalib/src/mesa/main/enums.h +++ b/mesalib/src/mesa/main/enums.h @@ -44,6 +44,4 @@ extern const char *_mesa_lookup_enum_by_nr( int nr ); */ const char *_mesa_lookup_prim_by_nr( unsigned nr ); -extern int _mesa_lookup_enum_by_name( const char *symbol ); - #endif diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index c88c1c67b..448946c03 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -3498,8 +3498,6 @@ struct gl_uniform_buffer_binding * OpenGL state is contained in this structure. * Think of this as a base class from which device drivers will derive * sub classes. - * - * The struct gl_context typedef names this structure. */ struct gl_context { diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index b719fc856..c1261138d 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -661,22 +661,29 @@ _mesa_delete_texture_image(struct gl_context *ctx, GLboolean _mesa_is_proxy_texture(GLenum target) { + unsigned i; + static const GLenum targets[] = { + GL_PROXY_TEXTURE_1D, + GL_PROXY_TEXTURE_2D, + GL_PROXY_TEXTURE_3D, + GL_PROXY_TEXTURE_CUBE_MAP, + GL_PROXY_TEXTURE_RECTANGLE, + GL_PROXY_TEXTURE_1D_ARRAY, + GL_PROXY_TEXTURE_2D_ARRAY, + GL_PROXY_TEXTURE_CUBE_MAP_ARRAY, + GL_PROXY_TEXTURE_2D_MULTISAMPLE, + GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY + }; /* - * NUM_TEXTURE_TARGETS should match number of terms below, except there's no + * NUM_TEXTURE_TARGETS should match number of terms above, except there's no * proxy for GL_TEXTURE_BUFFER and GL_TEXTURE_EXTERNAL_OES. */ - assert(NUM_TEXTURE_TARGETS == 10 + 2); - - return (target == GL_PROXY_TEXTURE_1D || - target == GL_PROXY_TEXTURE_2D || - target == GL_PROXY_TEXTURE_3D || - target == GL_PROXY_TEXTURE_CUBE_MAP_ARB || - target == GL_PROXY_TEXTURE_RECTANGLE_NV || - target == GL_PROXY_TEXTURE_1D_ARRAY_EXT || - target == GL_PROXY_TEXTURE_2D_ARRAY_EXT || - target == GL_PROXY_TEXTURE_CUBE_MAP_ARRAY || - target == GL_PROXY_TEXTURE_2D_MULTISAMPLE || - target == GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY); + STATIC_ASSERT(NUM_TEXTURE_TARGETS == Elements(targets) + 2); + + for (i = 0; i < Elements(targets); ++i) + if (target == targets[i]) + return GL_TRUE; + return GL_FALSE; } 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; |