diff options
author | marha <marha@users.sourceforge.net> | 2013-10-24 08:10:01 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-10-24 08:10:01 +0200 |
commit | 4eb0b643ad978d94837e2d587a5d4358f974a25c (patch) | |
tree | ecb04ee3cf0d7c2fa80707218382d68e7a49f621 | |
parent | 6d895f30ab93d71afddc612d8b007f2de7f04165 (diff) | |
download | vcxsrv-4eb0b643ad978d94837e2d587a5d4358f974a25c.tar.gz vcxsrv-4eb0b643ad978d94837e2d587a5d4358f974a25c.tar.bz2 vcxsrv-4eb0b643ad978d94837e2d587a5d4358f974a25c.zip |
fontconfig mesa xserver git update 24 oct 2013
xserver commit 7ecfab47eb221dbb996ea6c033348b8eceaeb893
fontconfig commit 76ea9af816a50c6bb0b3dc2960460a90fadd9cdb
mesa commit a6e45b6a17462f4d261a2d176791469847356923
-rw-r--r-- | fontconfig/test/test-migration.c | 18 | ||||
-rw-r--r-- | mesalib/configure.ac | 18 | ||||
-rw-r--r-- | mesalib/docs/GL3.txt | 10 | ||||
-rw-r--r-- | mesalib/docs/relnotes/10.0.html | 1 | ||||
-rw-r--r-- | mesalib/include/GL/gl.h | 41 | ||||
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_blitter.c | 12 | ||||
-rw-r--r-- | mesalib/src/glsl/Makefile.am | 18 | ||||
-rw-r--r-- | mesalib/src/glsl/ast_to_hir.cpp | 1 | ||||
-rw-r--r-- | mesalib/src/glsl/builtin_variables.cpp | 1 | ||||
-rw-r--r-- | mesalib/src/glsl/glsl_parser.yy | 35 | ||||
-rw-r--r-- | mesalib/src/glsl/ir.cpp | 11 | ||||
-rw-r--r-- | mesalib/src/glsl/linker.cpp | 60 | ||||
-rw-r--r-- | mesalib/src/glsl/linker.h | 3 | ||||
-rw-r--r-- | mesalib/src/glsl/opt_algebraic.cpp | 40 | ||||
-rw-r--r-- | mesalib/src/mapi/glapi/gen/gl_API.xml | 32 | ||||
-rw-r--r-- | mesalib/src/mesa/main/macros.h | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/main/querymatrix.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_draw.c | 19 | ||||
-rw-r--r-- | xorg-server/glx/glxdricommon.c | 24 |
19 files changed, 204 insertions, 148 deletions
diff --git a/fontconfig/test/test-migration.c b/fontconfig/test/test-migration.c index a0ab83902..970965186 100644 --- a/fontconfig/test/test-migration.c +++ b/fontconfig/test/test-migration.c @@ -4,6 +4,11 @@ #include <unistd.h> #include <sys/types.h> #include <dirent.h> +#ifndef HAVE_STRUCT_DIRENT_D_TYPE +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#endif #include <fontconfig/fontconfig.h> FcBool @@ -36,6 +41,9 @@ unlink_dirs(const char *dir) size_t len = strlen (dir); char *n = NULL; FcBool ret = FcTrue; +#ifndef HAVE_STRUCT_DIRENT_D_TYPE + struct stat statb; +#endif if (!d) return FcFalse; @@ -53,7 +61,17 @@ unlink_dirs(const char *dir) strcpy (n, dir); n[len] = '/'; strcpy (&n[len + 1], e->d_name); +#ifdef HAVE_STRUCT_DIRENT_D_TYPE if (e->d_type == DT_DIR) +#else + if (stat (n, &statb) == -1) + { + fprintf (stderr, "E: %s\n", n); + ret = FcFalse; + break; + } + if (S_ISDIR (statb.st_mode)) +#endif { if (!unlink_dirs (n)) { diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 08344c501..dfa35b41b 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -593,6 +593,12 @@ AC_ARG_ENABLE([opencl], @<:@default=no@:>@])], [], [enable_opencl=no]) +AC_ARG_ENABLE([opencl_icd], + [AS_HELP_STRING([--enable-opencl-icd], + [Build an OpenCL ICD library to be loaded by an ICD implementation + @<:@default=no@:>@])], + [enable_opencl_icd="$enableval"], + [enable_opencl_icd=no]) AC_ARG_ENABLE([xlib-glx], [AS_HELP_STRING([--enable-xlib-glx], [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])], @@ -1337,8 +1343,8 @@ if test "x$enable_opencl" = xyes; then AC_MSG_ERROR([cannot enable OpenCL without Gallium]) fi - if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then - AC_MSG_ERROR([gcc >= 4.6 is required to build clover]) + if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then + AC_MSG_ERROR([gcc >= 4.7 is required to build clover]) fi if test "x$have_libclc" = xno; then @@ -1356,8 +1362,16 @@ if test "x$enable_opencl" = xyes; then GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover" GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl" enable_gallium_loader=yes + + if test "x$enable_opencl_icd" = xyes; then + OPENCL_LIBNAME="MesaOpenCL" + else + OPENCL_LIBNAME="OpenCL" + fi fi AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes) +AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes) +AC_SUBST([OPENCL_LIBNAME]) dnl dnl Gallium configuration diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt index a56e7fead..ff28ea6a8 100644 --- a/mesalib/docs/GL3.txt +++ b/mesalib/docs/GL3.txt @@ -64,8 +64,8 @@ Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600) GL 3.2: Core/compatibility profiles DONE -GLSL 1.50 in progress -Geometry shaders (GL_ARB_geometry_shader4) partially done +GLSL 1.50 DONE (i965) +Geometry shaders DONE (i965) BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (i965, r300, r600, swrast) Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE (i965, r300, r600, swrast) Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (i965, r300, r600, swrast) @@ -79,7 +79,7 @@ GLX_ARB_create_context_profile DONE GL 3.3: -GLSL 3.30 new features in this version pretty much done +GLSL 3.30 DONE (i965) GL_ARB_blend_func_extended DONE (i965, r600, softpipe) GL_ARB_explicit_attrib_location DONE (i915, i965, r300, r600, swrast) GL_ARB_occlusion_query2 DONE (i965, r300, r600, swrast) @@ -157,7 +157,7 @@ ARB_robust_buffer_access_behavior not started ARB_shader_image_size not started ARB_shader_storage_buffer_object not started ARB_stencil_texturing not started -ARB_texture_buffer_range DONE (nv50, nvc0) +ARB_texture_buffer_range DONE (nv50, nvc0, i965) ARB_texture_query_levels DONE (i965) ARB_texture_storage_multisample DONE (i965) ARB_texture_view not started @@ -173,7 +173,7 @@ ARB_clear_texture not started ARB_enhanced_layouts not started ARB_multi_bind not started ARB_query_buffer_object not started -ARB_texture_mirror_clamp_to_edge not started +ARB_texture_mirror_clamp_to_edge DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi, swrast) ARB_texture_stencil8 not started ARB_vertex_type_10f_11f_11f_rev not started diff --git a/mesalib/docs/relnotes/10.0.html b/mesalib/docs/relnotes/10.0.html index 0b25f49b5..ef550d154 100644 --- a/mesalib/docs/relnotes/10.0.html +++ b/mesalib/docs/relnotes/10.0.html @@ -48,6 +48,7 @@ Note: some of the new features are only available with certain drivers. <li>GL_ARB_conservative_depth on i965.</li> <li>GL_ARB_texture_gather on i965.</li> <li>GL_ARB_texture_query_levels on i965.</li> +<li>GL_ARB_texture_mirror_clamp_to_edge.</li> <li>GL_KHR_debug</li> </ul> diff --git a/mesalib/include/GL/gl.h b/mesalib/include/GL/gl.h index babb7463e..6b94e3fb0 100644 --- a/mesalib/include/GL/gl.h +++ b/mesalib/include/GL/gl.h @@ -2086,26 +2086,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh -#if GL_ARB_shader_objects - -#ifndef GL_MESA_shader_debug -#define GL_MESA_shader_debug 1 - -#define GL_DEBUG_OBJECT_MESA 0x8759 -#define GL_DEBUG_PRINT_MESA 0x875A -#define GL_DEBUG_ASSERT_MESA 0x875B - -GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void); -GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); -GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength, - GLsizei *length, GLcharARB *debugLog); -GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); - -#endif /* GL_MESA_shader_debug */ - -#endif /* GL_ARB_shader_objects */ - - /* * ???. GL_MESA_packed_depth_stencil * XXX obsolete @@ -2122,27 +2102,6 @@ GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logTyp #endif /* GL_MESA_packed_depth_stencil */ -#ifndef GL_MESA_program_debug -#define GL_MESA_program_debug 1 - -#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0 -#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1 -#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2 -#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3 -#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4 -#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5 -#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6 -#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7 - -typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); - -GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data); - -GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v); - -#endif /* GL_MESA_program_debug */ - - #ifndef GL_MESA_texture_array #define GL_MESA_texture_array 1 diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c index a51b9ef20..096d3bc2b 100644 --- a/mesalib/src/gallium/auxiliary/util/u_blitter.c +++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c @@ -535,9 +535,9 @@ static void blitter_restore_textures(struct blitter_context_priv *ctx) ctx->base.saved_num_sampler_states = ~0; /* Fragment sampler views. */ - pipe->set_fragment_sampler_views(pipe, - ctx->base.saved_num_sampler_views, - ctx->base.saved_sampler_views); + pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, + ctx->base.saved_num_sampler_views, + ctx->base.saved_sampler_views); for (i = 0; i < ctx->base.saved_num_sampler_views; i++) pipe_sampler_view_reference(&ctx->base.saved_sampler_views[i], NULL); @@ -1309,7 +1309,7 @@ void util_blitter_blit_generic(struct blitter_context *blitter, views[0] = src; views[1] = pipe->create_sampler_view(pipe, src->texture, &templ); - pipe->set_fragment_sampler_views(pipe, 2, views); + pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 2, views); pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0, 2, samplers); pipe_sampler_view_reference(&views[1], NULL); @@ -1324,13 +1324,13 @@ void util_blitter_blit_generic(struct blitter_context *blitter, view = pipe->create_sampler_view(pipe, src->texture, &templ); - pipe->set_fragment_sampler_views(pipe, 1, &view); + pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &view); pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &sampler_state); pipe_sampler_view_reference(&view, NULL); } else { - pipe->set_fragment_sampler_views(pipe, 1, &src); + pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &src); pipe->bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &sampler_state); } diff --git a/mesalib/src/glsl/Makefile.am b/mesalib/src/glsl/Makefile.am index cbf253cb5..b9ed5b62b 100644 --- a/mesalib/src/glsl/Makefile.am +++ b/mesalib/src/glsl/Makefile.am @@ -32,6 +32,7 @@ AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS) include Makefile.sources TESTS = glcpp/tests/glcpp-test \ + tests/general-ir-test \ tests/optimization-test \ tests/ralloc-test \ tests/sampler-types-test \ @@ -45,12 +46,29 @@ noinst_LTLIBRARIES = libglsl.la libglcpp.la check_PROGRAMS = \ glcpp/glcpp \ glsl_test \ + tests/general-ir-test \ tests/ralloc-test \ tests/sampler-types-test \ tests/uniform-initializer-test noinst_PROGRAMS = glsl_compiler +tests_general_ir_test_SOURCES = \ + $(top_srcdir)/src/mesa/main/hash_table.c \ + $(top_srcdir)/src/mesa/main/imports.c \ + $(top_srcdir)/src/mesa/program/prog_hash_table.c\ + $(top_srcdir)/src/mesa/program/symbol_table.c \ + $(GLSL_SRCDIR)/standalone_scaffolding.cpp \ + tests/builtin_variable_test.cpp \ + tests/invalidate_locations_test.cpp \ + tests/general_ir_test.cpp +tests_general_ir_test_CFLAGS = \ + $(PTHREAD_CFLAGS) +tests_general_ir_test_LDADD = \ + $(top_builddir)/src/gtest/libgtest.la \ + $(top_builddir)/src/glsl/libglsl.la \ + $(PTHREAD_LIBS) + tests_uniform_initializer_test_SOURCES = \ $(top_srcdir)/src/mesa/main/hash_table.c \ $(top_srcdir)/src/mesa/main/imports.c \ diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index dfa32d920..b644b22c7 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -4876,7 +4876,6 @@ ast_interface_block::hir(exec_list *instructions, var_mode); } - var->init_interface_type(block_type); if (state->target == geometry_shader && var_mode == ir_var_shader_in) handle_geometry_shader_input_decl(state, loc, var); diff --git a/mesalib/src/glsl/builtin_variables.cpp b/mesalib/src/glsl/builtin_variables.cpp index 64f34061a..fc1115bc4 100644 --- a/mesalib/src/glsl/builtin_variables.cpp +++ b/mesalib/src/glsl/builtin_variables.cpp @@ -890,7 +890,6 @@ builtin_variable_generator::generate_varyings() this->per_vertex_in.construct_interface_instance(); ir_variable *var = add_variable("gl_in", array(per_vertex_in_type, 0), ir_var_shader_in, -1); - var->init_interface_type(per_vertex_in_type); } if (state->target == vertex_shader || state->target == geometry_shader) { const glsl_type *per_vertex_out_type = diff --git a/mesalib/src/glsl/glsl_parser.yy b/mesalib/src/glsl/glsl_parser.yy index 00589e28e..0a0708e95 100644 --- a/mesalib/src/glsl/glsl_parser.yy +++ b/mesalib/src/glsl/glsl_parser.yy @@ -2372,6 +2372,7 @@ layout_defaults: | layout_qualifier IN_TOK ';' { void *ctx = state; + $$ = NULL; if (state->target != geometry_shader) { _mesa_glsl_error(& @1, state, "input layout qualifiers only valid in " @@ -2380,8 +2381,22 @@ layout_defaults: _mesa_glsl_error(& @1, state, "input layout qualifiers must specify a primitive" " type"); + } else { + /* Make sure this is a valid input primitive type. */ + switch ($1.prim_type) { + case GL_POINTS: + case GL_LINES: + case GL_LINES_ADJACENCY: + case GL_TRIANGLES: + case GL_TRIANGLES_ADJACENCY: + $$ = new(ctx) ast_gs_input_layout(@1, $1.prim_type); + break; + default: + _mesa_glsl_error(&@1, state, + "invalid geometry shader input primitive type"); + break; + } } - $$ = new(ctx) ast_gs_input_layout(@1, $1.prim_type); } | layout_qualifier OUT_TOK ';' @@ -2390,8 +2405,22 @@ layout_defaults: _mesa_glsl_error(& @1, state, "out layout qualifiers only valid in " "geometry shaders"); - } else if (!state->out_qualifier->merge_qualifier(& @1, state, $1)) { - YYERROR; + } else { + if ($1.flags.q.prim_type) { + /* Make sure this is a valid output primitive type. */ + switch ($1.prim_type) { + case GL_POINTS: + case GL_LINE_STRIP: + case GL_TRIANGLE_STRIP: + break; + default: + _mesa_glsl_error(&@1, state, "invalid geometry shader output " + "primitive type"); + break; + } + } + if (!state->out_qualifier->merge_qualifier(& @1, state, $1)) + YYERROR; } $$ = NULL; } diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp index de9613e8f..54a8e400c 100644 --- a/mesalib/src/glsl/ir.cpp +++ b/mesalib/src/glsl/ir.cpp @@ -1603,8 +1603,15 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name, this->depth_layout = ir_depth_layout_none; this->used = false; - if (type && type->base_type == GLSL_TYPE_SAMPLER) - this->read_only = true; + if (type != NULL) { + if (type->base_type == GLSL_TYPE_SAMPLER) + this->read_only = true; + + if (type->is_interface()) + this->init_interface_type(type); + else if (type->is_array() && type->fields.array->is_interface()) + this->init_interface_type(type->fields.array); + } } diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp index 9095a4015..b23c31a16 100644 --- a/mesalib/src/glsl/linker.cpp +++ b/mesalib/src/glsl/linker.cpp @@ -366,35 +366,38 @@ parse_program_resource_name(const GLchar *name, void -link_invalidate_variable_locations(gl_shader *sh, int input_base, - int output_base) +link_invalidate_variable_locations(exec_list *ir) { - foreach_list(node, sh->ir) { + foreach_list(node, ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var == NULL) continue; - int base; - switch (var->mode) { - case ir_var_shader_in: - base = input_base; - break; - case ir_var_shader_out: - base = output_base; - break; - default: - continue; - } - - /* Only assign locations for generic attributes / varyings / etc. + /* Only assign locations for variables that lack an explicit location. + * Explicit locations are set for all built-in variables, generic vertex + * shader inputs (via layout(location=...)), and generic fragment shader + * outputs (also via layout(location=...)). */ - if ((var->location >= base) && !var->explicit_location) + if (!var->explicit_location) { var->location = -1; + var->location_frac = 0; + } - if ((var->location == -1) && !var->explicit_location) { + /* ir_variable::is_unmatched_generic_inout is used by the linker while + * connecting outputs from one stage to inputs of the next stage. + * + * There are two implicit assumptions here. First, we assume that any + * built-in variable (i.e., non-generic in or out) will have + * explicit_location set. Second, we assume that any generic in or out + * will not have explicit_location set. + * + * This second assumption will only be valid until + * GL_ARB_separate_shader_objects is supported. When that extension is + * implemented, this function will need some modifications. + */ + if (!var->explicit_location) { var->is_unmatched_generic_inout = 1; - var->location_frac = 0; } else { var->is_unmatched_generic_inout = 0; } @@ -2057,14 +2060,10 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) } } - /* Previous to GLSL version 1.30, different compilation units could mix and - * match shading language versions. With GLSL 1.30 and later, the versions - * of all shaders must match. - * - * GLSL ES has never allowed mixing of shading language versions. + /* In desktop GLSL, different shader versions may be linked together. In + * GLSL ES, all shader versions must be the same. */ - if ((is_es_prog || max_version >= 130) - && min_version != max_version) { + if (is_es_prog && min_version != max_version) { linker_error(prog, "all shaders must use same shading " "language version\n"); goto done; @@ -2221,18 +2220,15 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) /* Mark all generic shader inputs and outputs as unpaired. */ if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) { link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_VERTEX], - VERT_ATTRIB_GENERIC0, VARYING_SLOT_VAR0); + prog->_LinkedShaders[MESA_SHADER_VERTEX]->ir); } if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) { link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_GEOMETRY], - VARYING_SLOT_VAR0, VARYING_SLOT_VAR0); + prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir); } if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_FRAGMENT], - VARYING_SLOT_VAR0, FRAG_RESULT_DATA0); + prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->ir); } /* FINISHME: The value of the max_attribute_index parameter is diff --git a/mesalib/src/glsl/linker.h b/mesalib/src/glsl/linker.h index 8a0027d2b..887cd33d1 100644 --- a/mesalib/src/glsl/linker.h +++ b/mesalib/src/glsl/linker.h @@ -31,8 +31,7 @@ link_function_calls(gl_shader_program *prog, gl_shader *main, gl_shader **shader_list, unsigned num_shaders); extern void -link_invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode, - int generic_base); +link_invalidate_variable_locations(exec_list *ir); extern void link_assign_uniform_locations(struct gl_shader_program *prog); diff --git a/mesalib/src/glsl/opt_algebraic.cpp b/mesalib/src/glsl/opt_algebraic.cpp index 3e5802e18..37b2f02c6 100644 --- a/mesalib/src/glsl/opt_algebraic.cpp +++ b/mesalib/src/glsl/opt_algebraic.cpp @@ -210,6 +210,34 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) this->mem_ctx = ralloc_parent(ir); switch (ir->operation) { + case ir_unop_abs: + if (op_expr[0] == NULL) + break; + + switch (op_expr[0]->operation) { + case ir_unop_abs: + case ir_unop_neg: + this->progress = true; + temp = new(mem_ctx) ir_expression(ir_unop_abs, + ir->type, + op_expr[0]->operands[0], + NULL); + return swizzle_if_required(ir, temp); + default: + break; + } + break; + + case ir_unop_neg: + if (op_expr[0] == NULL) + break; + + if (op_expr[0]->operation == ir_unop_neg) { + this->progress = true; + return swizzle_if_required(ir, op_expr[0]->operands[0]); + } + break; + case ir_unop_logic_not: { enum ir_expression_operation new_op = ir_unop_logic_not; @@ -257,11 +285,9 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) * folding. */ if (op_const[0] && !op_const[1]) - reassociate_constant(ir, 0, op_const[0], - ir->operands[1]->as_expression()); + reassociate_constant(ir, 0, op_const[0], op_expr[1]); if (op_const[1] && !op_const[0]) - reassociate_constant(ir, 1, op_const[1], - ir->operands[0]->as_expression()); + reassociate_constant(ir, 1, op_const[1], op_expr[0]); break; case ir_binop_sub: @@ -315,11 +341,9 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) * constant folding. */ if (op_const[0] && !op_const[1]) - reassociate_constant(ir, 0, op_const[0], - ir->operands[1]->as_expression()); + reassociate_constant(ir, 0, op_const[0], op_expr[1]); if (op_const[1] && !op_const[0]) - reassociate_constant(ir, 1, op_const[1], - ir->operands[0]->as_expression()); + reassociate_constant(ir, 1, op_const[1], op_expr[0]); break; diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml index 48fce36ab..30ab9c9c1 100644 --- a/mesalib/src/mapi/glapi/gen/gl_API.xml +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml @@ -13027,38 +13027,6 @@ <enum name="RGBA8_SNORM" value="0x8F97"/> </category> -<category name="GL_MESA_shader_debug"> - <enum name="DEBUG_OBJECT_MESA" value="0x8759"/> - <enum name="DEBUG_PRINT_MESA" value="0x875A"/> - <enum name="DEBUG_ASSERT_MESA" value="0x875B"/> - <function name="CreateDebugObjectMESA" exec="skip"> - <return type="GLhandleARB"/> - <glx ignore="true"/> - </function> - <function name="ClearDebugLogMESA" exec="skip"> - <param name="obj" type="GLhandleARB"/> - <param name="logType" type="GLenum"/> - <param name="shaderType" type="GLenum"/> - <glx ignore="true"/> - </function> - <function name="GetDebugLogMESA" exec="skip"> - <param name="obj" type="GLhandleARB"/> - <param name="logType" type="GLenum"/> - <param name="shaderType" type="GLenum"/> - <param name="maxLength" type="GLsizei"/> - <param name="length" type="GLsizei *" output="true"/> - <param name="debugLog" type="GLcharARB *" output="true"/> - <glx ignore="true"/> - </function> - <function name="GetDebugLogLengthMESA" exec="skip"> - <return type="GLsizei"/> - <param name="obj" type="GLhandleARB"/> - <param name="logType" type="GLenum"/> - <param name="shaderType" type="GLenum"/> - <glx ignore="true"/> - </function> -</category> - <category name="GL_SGIS_point_parameters"> <enum name="POINT_SIZE_MIN_SGIS" count="1" value="0x8126"> <size name="PointParameterfv"/> diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h index 880c6564e..379f75663 100644 --- a/mesalib/src/mesa/main/macros.h +++ b/mesalib/src/mesa/main/macros.h @@ -193,7 +193,7 @@ static INLINE uint32_t U_FIXED(float value, uint32_t frac_bits) { value *= (1 << frac_bits); - return value < 0 ? 0 : value; + return value < 0.0f ? 0 : (uint32_t) value; } /** @@ -201,10 +201,10 @@ U_FIXED(float value, uint32_t frac_bits) * * \param frac_bits The number of bits used to store the fractional part. */ -static INLINE uint32_t +static INLINE int32_t S_FIXED(float value, uint32_t frac_bits) { - return value * (1 << frac_bits); + return (int32_t) (value * (1 << frac_bits)); } /*@}*/ diff --git a/mesalib/src/mesa/main/querymatrix.c b/mesalib/src/mesa/main/querymatrix.c index aee8aef12..19a8e9201 100644 --- a/mesalib/src/mesa/main/querymatrix.c +++ b/mesalib/src/mesa/main/querymatrix.c @@ -38,6 +38,7 @@ #define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0)) #if defined(_MSC_VER) +#if _MSC_VER < 1800 /* Not required on VS2013 and above. */ /* Oddly, the fpclassify() function doesn't exist in such a form * on MSVC. This is an implementation using slightly different * lower-level Windows functions. @@ -70,6 +71,7 @@ fpclassify(double x) return FP_NAN; } } +#endif /* _MSC_VER < 1800 */ #elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \ diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c index a440ae2a8..c35723087 100644 --- a/mesalib/src/mesa/state_tracker/st_draw.c +++ b/mesalib/src/mesa/state_tracker/st_draw.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ /* @@ -72,7 +72,7 @@ static GLboolean all_varyings_in_vbos(const struct gl_client_array *arrays[]) { GLuint i; - + for (i = 0; i < VERT_ATTRIB_MAX; i++) if (arrays[i]->StrideB && !arrays[i]->InstanceDivisor && @@ -104,6 +104,7 @@ setup_index_buffer(struct st_context *st, ibuffer->offset = pointer_to_offset(ib->ptr); } else if (st->indexbuf_uploader) { + /* upload indexes from user memory into a real buffer */ if (u_upload_data(st->indexbuf_uploader, 0, ib->count * ibuffer->index_size, ib->ptr, &ibuffer->offset, &ibuffer->buffer) != PIPE_OK) { @@ -222,6 +223,7 @@ st_draw_vbo(struct gl_context *ctx, } util_draw_init_info(&info); + if (ib) { /* Get index bounds for user buffers. */ if (!index_bounds_valid) @@ -256,7 +258,7 @@ st_draw_vbo(struct gl_context *ctx, /* do actual drawing */ for (i = 0; i < nr_prims; i++) { - info.mode = translate_prim( ctx, prims[i].mode ); + info.mode = translate_prim(ctx, prims[i].mode); info.start = prims[i].start; info.count = prims[i].count; info.start_instance = prims[i].base_instance; @@ -282,8 +284,9 @@ st_draw_vbo(struct gl_context *ctx, /* don't trim, restarts might be inside index list */ cso_draw_vbo(st->cso_context, &info); } - else if (u_trim_pipe_prim(prims[i].mode, &info.count)) + else if (u_trim_pipe_prim(prims[i].mode, &info.count)) { cso_draw_vbo(st->cso_context, &info); + } } if (ib && st->indexbuf_uploader && !_mesa_is_bufferobj(ib->obj)) { diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c index b027f2498..0ab3e3071 100644 --- a/xorg-server/glx/glxdricommon.c +++ b/xorg-server/glx/glxdricommon.c @@ -211,6 +211,14 @@ glxConvertConfigs(const __DRIcoreExtension * core, static const char dri_driver_path[] = DRI_DRIVER_PATH; +/* Temporary define to allow building without a dri_interface.h from + * updated Mesa. Some day when we don't care about Mesa that old any + * more this can be removed. + */ +#ifndef __DRI_DRIVER_GET_EXTENSIONS +#define __DRI_DRIVER_GET_EXTENSIONS "__driDriverGetExtensions" +#endif + void * glxProbeDriver(const char *driverName, void **coreExt, const char *coreName, int coreVersion, @@ -219,7 +227,8 @@ glxProbeDriver(const char *driverName, int i; void *driver; char filename[PATH_MAX]; - const __DRIextension **extensions; + char *get_extensions_name; + const __DRIextension **extensions = NULL; snprintf(filename, sizeof filename, "%s/%s_dri.so", dri_driver_path, driverName); @@ -231,7 +240,18 @@ glxProbeDriver(const char *driverName, goto cleanup_failure; } - extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS); + if (asprintf(&get_extensions_name, "%s_%s", + __DRI_DRIVER_GET_EXTENSIONS, driverName) != -1) { + const __DRIextension **(*get_extensions)(void); + + get_extensions = dlsym(driver, get_extensions_name); + if (get_extensions) + extensions = get_extensions(); + free(get_extensions_name); + } + + if (!extensions) + extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS); if (extensions == NULL) { LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n", driverName, dlerror()); |