[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mesa: Changes to 'upstream-experimental'



 Android.common.mk                                        |    2 
 SConstruct                                               |    2 
 configure.ac                                             |    2 
 src/gallium/auxiliary/draw/draw_context.c                |    5 
 src/gallium/drivers/llvmpipe/lp_bld_depth.c              |   27 +--
 src/gallium/drivers/nv30/nv30_format.c                   |    6 
 src/gallium/drivers/nv50/nv84_video.c                    |    6 
 src/gallium/drivers/radeonsi/radeonsi_shader.c           |  135 ++++++++-------
 src/gallium/drivers/radeonsi/radeonsi_shader.h           |    1 
 src/gallium/drivers/radeonsi/si_state_draw.c             |    6 
 src/glsl/ast_to_hir.cpp                                  |   74 ++++++--
 src/glsl/builtins/profiles/100es.frag                    |    2 
 src/glsl/builtins/profiles/300es.frag                    |    1 
 src/glsl/builtins/profiles/OES_EGL_image_external.glsl   |    1 
 src/glsl/builtins/profiles/OES_standard_derivatives.frag |    1 
 src/glsl/builtins/profiles/OES_texture_3D.frag           |    1 
 src/glsl/glsl_parser_extras.cpp                          |    1 
 src/glsl/glsl_parser_extras.h                            |    7 
 src/glsl/ir_optimization.h                               |    2 
 src/glsl/link_uniform_blocks.cpp                         |   17 +
 src/glsl/link_uniforms.cpp                               |   56 +++++-
 src/glsl/linker.cpp                                      |    6 
 src/glsl/linker.h                                        |   15 +
 src/glsl/opt_dead_builtin_varyings.cpp                   |   27 ++-
 src/mesa/drivers/common/meta.c                           |   43 +++-
 src/mesa/drivers/dri/i915/intel_tex_image.c              |    1 
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c            |    9 +
 src/mesa/drivers/dri/i965/intel_tex_image.c              |    1 
 src/mesa/program/program_parse.y                         |    4 
 src/mesa/vbo/vbo_exec_array.c                            |   82 ++++++---
 30 files changed, 383 insertions(+), 160 deletions(-)

New commits:
commit 796b4a7b40889747562d8d693f25f67aff35c189
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Mon Aug 19 16:49:02 2013 -0700

    mesa: Bump version to 9.2-rc1

diff --git a/Android.common.mk b/Android.common.mk
index c6ee4e1..b5ed472 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -35,7 +35,7 @@ LOCAL_C_INCLUDES += \
 
 # define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
 LOCAL_CFLAGS += \
-	-DPACKAGE_VERSION=\"9.2.0-devel\" \
+	-DPACKAGE_VERSION=\"9.2.0-rc1\" \
 	-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"; \
 	-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)
 
diff --git a/SConstruct b/SConstruct
index 834e9d5..a75bcb9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -70,7 +70,7 @@ if env['gles']:
 # Environment setup
 
 env.Append(CPPDEFINES = [
-    ('PACKAGE_VERSION', '\\"9.2.0-devel\\"'),
+    ('PACKAGE_VERSION', '\\"9.2.0-rc1\\"'),
     ('PACKAGE_BUGREPORT', '\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\";'),
 ])
 
diff --git a/configure.ac b/configure.ac
index 35f6797..bd5c71d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ dnl Tell the user about autoconf.html in the --help output
 m4_divert_once([HELP_END], [
 See docs/autoconf.html for more details on the options for Mesa.])
 
-AC_INIT([Mesa], [9.2.0-devel],
+AC_INIT([Mesa], [9.2.0-rc1],
     [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
 AC_CONFIG_AUX_DIR([bin])
 AC_CONFIG_MACRO_DIR([m4])

commit d3004acdd15d0fe3a0ac21f9bd7070d22b13a680
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Sat Aug 17 00:27:43 2013 -0700

    glsl: Use alignment of container record for its first field
    
    The first field of a record in a UBO has the aligment of the record
    itself.
    
    Fixes piglit vs-struct-pad, fs-struct-pad, and (with the patch posted to
    the piglit list that extends the test) layout-std140.
    
    NOTE: The bit of strangeness with the version of visit_field without the
    record_type poitner is because that method is pure virtual in the base
    class.  The original implementation of the class did this to ensure
    derived classes remembered to implement that flavor.  Now they can
    implement either flavor but not both.  I don't know a C++ way to enforce
    that.
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Paul Berry <stereotype441@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68195
    Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
    (cherry picked from commit 574e4843e9e26aa6affa31c80ac42f745b68268b)

diff --git a/src/glsl/link_uniform_blocks.cpp b/src/glsl/link_uniform_blocks.cpp
index c72d1d8..e475147 100644
--- a/src/glsl/link_uniform_blocks.cpp
+++ b/src/glsl/link_uniform_blocks.cpp
@@ -59,6 +59,15 @@ private:
    virtual void visit_field(const glsl_type *type, const char *name,
                             bool row_major)
    {
+      (void) type;
+      (void) name;
+      (void) row_major;
+      assert(!"Should not get here.");
+   }
+
+   virtual void visit_field(const glsl_type *type, const char *name,
+                            bool row_major, const glsl_type *record_type)
+   {
       assert(this->index < this->num_variables);
 
       gl_uniform_buffer_variable *v = &this->variables[this->index++];
@@ -85,7 +94,9 @@ private:
          v->IndexName = v->Name;
       }
 
-      unsigned alignment = type->std140_base_alignment(v->RowMajor);
+      const unsigned alignment = record_type
+	 ? record_type->std140_base_alignment(v->RowMajor)
+	 : type->std140_base_alignment(v->RowMajor);
       unsigned size = type->std140_size(v->RowMajor);
 
       this->offset = glsl_align(this->offset, alignment);
@@ -107,6 +118,10 @@ private:
 
    virtual void visit_field(const glsl_struct_field *field)
    {
+      /* FINISHME: When support for doubles (dvec4, etc.) is added to the
+       * FINISHME: compiler, this may be incorrect for a structure in a UBO
+       * FINISHME: like struct s { struct { float f } s1; dvec4 v; };.
+       */
       this->offset = glsl_align(this->offset,
                                 field->type->std140_base_alignment(false));
    }
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 095895b..fa77157 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -402,6 +402,15 @@ private:
    virtual void visit_field(const glsl_type *type, const char *name,
                             bool row_major)
    {
+      (void) type;
+      (void) name;
+      (void) row_major;
+      assert(!"Should not get here.");
+   }
+
+   virtual void visit_field(const glsl_type *type, const char *name,
+                            bool row_major, const glsl_type *record_type)
+   {
       assert(!type->is_record());
       assert(!(type->is_array() && type->fields.array->is_record()));
       assert(!type->is_interface());
@@ -446,7 +455,9 @@ private:
       if (this->ubo_block_index != -1) {
 	 this->uniforms[id].block_index = this->ubo_block_index;
 
-	 unsigned alignment = type->std140_base_alignment(ubo_row_major);
+	 const unsigned alignment = record_type
+	    ? record_type->std140_base_alignment(ubo_row_major)
+	    : type->std140_base_alignment(ubo_row_major);
 	 this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, alignment);
 	 this->uniforms[id].offset = this->ubo_byte_offset;
 	 this->ubo_byte_offset += type->std140_size(ubo_row_major);

commit 684316512c5570483365d36849250a008b6fcd84
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Fri Aug 16 23:30:43 2013 -0700

    glsl: Add new overload of program_resource_visitor::visit_field method
    
    The outer-most record is passed into the visit_field method for
    the first field.  In other words, in the following structure:
    
        struct S1 {
            vec4 v;
            float f;
        };
    
        struct S {
            S1 s1;
            S1 s2;
        };
    
        uniform Ubo {
            S s;
        };
    
    s.s1.v would get record_type = S (because s1.v is the first non-record
    field in S), and s.s2.v would get record_type = S1.  s.s1.f and s.s2.f
    would get record_type = NULL becuase they aren't the first field of
    anything.
    
    This new overload isn't used yet, but the next patch will add several
    uses.
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Paul Berry <stereotype441@gmail.com>
    Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
    (cherry picked from commit 5ac884fd9f213baed1de52eb7d17b86455c48a02)

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 35ace1e..095895b 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -60,7 +60,7 @@ program_resource_visitor::process(const glsl_type *type, const char *name)
           || (type->is_array() && type->fields.array->is_interface()));
 
    char *name_copy = ralloc_strdup(NULL, name);
-   recursion(type, &name_copy, strlen(name), false);
+   recursion(type, &name_copy, strlen(name), false, NULL);
    ralloc_free(name_copy);
 }
 
@@ -77,24 +77,25 @@ program_resource_visitor::process(ir_variable *var)
    /* Only strdup the name if we actually will need to modify it. */
    if (t->is_record() || (t->is_array() && t->fields.array->is_record())) {
       char *name = ralloc_strdup(NULL, var->name);
-      recursion(var->type, &name, strlen(name), false);
+      recursion(var->type, &name, strlen(name), false, NULL);
       ralloc_free(name);
    } else if (t->is_interface()) {
       char *name = ralloc_strdup(NULL, var->type->name);
-      recursion(var->type, &name, strlen(name), false);
+      recursion(var->type, &name, strlen(name), false, NULL);
       ralloc_free(name);
    } else if (t->is_array() && t->fields.array->is_interface()) {
       char *name = ralloc_strdup(NULL, var->type->fields.array->name);
-      recursion(var->type, &name, strlen(name), false);
+      recursion(var->type, &name, strlen(name), false, NULL);
       ralloc_free(name);
    } else {
-      this->visit_field(t, var->name, false);
+      this->visit_field(t, var->name, false, NULL);
    }
 }
 
 void
 program_resource_visitor::recursion(const glsl_type *t, char **name,
-                                    size_t name_length, bool row_major)
+                                    size_t name_length, bool row_major,
+                                    const glsl_type *record_type)
 {
    /* Records need to have each field processed individually.
     *
@@ -103,6 +104,9 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
     * individually.
     */
    if (t->is_record() || t->is_interface()) {
+      if (record_type == NULL && t->is_record())
+         record_type = t;
+
       for (unsigned i = 0; i < t->length; i++) {
 	 const char *field = t->fields.structure[i].name;
 	 size_t new_length = name_length;
@@ -118,10 +122,18 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
          }
 
          recursion(t->fields.structure[i].type, name, new_length,
-                   t->fields.structure[i].row_major);
+                   t->fields.structure[i].row_major, record_type);
+
+         /* Only the first leaf-field of the record gets called with the
+          * record type pointer.
+          */
+         record_type = NULL;
       }
    } else if (t->is_array() && (t->fields.array->is_record()
                                 || t->fields.array->is_interface())) {
+      if (record_type == NULL && t->fields.array->is_record())
+         record_type = t->fields.array;
+
       for (unsigned i = 0; i < t->length; i++) {
 	 size_t new_length = name_length;
 
@@ -129,14 +141,27 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
 	 ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i);
 
          recursion(t->fields.array, name, new_length,
-                   t->fields.structure[i].row_major);
+                   t->fields.structure[i].row_major, record_type);
+
+         /* Only the first leaf-field of the record gets called with the
+          * record type pointer.
+          */
+         record_type = NULL;
       }
    } else {
-      this->visit_field(t, *name, row_major);
+      this->visit_field(t, *name, row_major, record_type);
    }
 }
 
 void
+program_resource_visitor::visit_field(const glsl_type *type, const char *name,
+                                      bool row_major,
+                                      const glsl_type *record_type)
+{
+   visit_field(type, name, row_major);
+}
+
+void
 program_resource_visitor::visit_field(const glsl_struct_field *field)
 {
    (void) field;
diff --git a/src/glsl/linker.h b/src/glsl/linker.h
index 2fe2410..c55ba22 100644
--- a/src/glsl/linker.h
+++ b/src/glsl/linker.h
@@ -124,6 +124,19 @@ protected:
     * \param type  Type of the field.
     * \param name  Fully qualified name of the field.
     * \param row_major  For a matrix type, is it stored row-major.
+    * \param record_type  Type of the record containing the field.
+    *
+    * The default implementation just calls the other \c visit_field method.
+    */
+   virtual void visit_field(const glsl_type *type, const char *name,
+                            bool row_major, const glsl_type *record_type);
+
+   /**
+    * Method invoked for each leaf of the variable
+    *
+    * \param type  Type of the field.
+    * \param name  Fully qualified name of the field.
+    * \param row_major  For a matrix type, is it stored row-major.
     */
    virtual void visit_field(const glsl_type *type, const char *name,
                             bool row_major) = 0;
@@ -144,7 +157,7 @@ private:
     *                     terminating \c NUL character.
     */
    void recursion(const glsl_type *t, char **name, size_t name_length,
-                  bool row_major);
+                  bool row_major, const glsl_type *record_type);
 };
 
 void

commit 9f7f727345fb555b30cbc8ad03c9324c7644bdcf
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Aug 13 09:15:01 2013 -0700

    glsl: Disallow embedded structure definitions
    
    Continue to allow them in GLSL 1.10 because the spec allows it.
    Generate an error in all other versions because the specs specifically
    disallow it.
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Cc: "9.2" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit d9bb8b7b56ce65bbf6909419aa6d3d69ccd34c08)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 870ea3d..216acfc 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -4329,6 +4329,34 @@ ast_struct_specifier::hir(exec_list *instructions,
 			  struct _mesa_glsl_parse_state *state)
 {
    YYLTYPE loc = this->get_location();
+
+   /* Section 4.1.8 (Structures) of the GLSL 1.10 spec says:
+    *
+    *     "Anonymous structures are not supported; so embedded structures must
+    *     have a declarator. A name given to an embedded struct is scoped at
+    *     the same level as the struct it is embedded in."
+    *
+    * The same section of the  GLSL 1.20 spec says:
+    *
+    *     "Anonymous structures are not supported. Embedded structures are not
+    *     supported.
+    *
+    *         struct S { float f; };
+    *         struct T {
+    *             S;              // Error: anonymous structures disallowed
+    *             struct { ... }; // Error: embedded structures disallowed
+    *             S s;            // Okay: nested structures with name are allowed
+    *         };"
+    *
+    * The GLSL ES 1.00 and 3.00 specs have similar langauge and examples.  So,
+    * we allow embedded structures in 1.10 only.
+    */
+   if (state->language_version != 110 && state->struct_specifier_depth != 0)
+      _mesa_glsl_error(&loc, state,
+		       "embedded structure declartions are not allowed");
+
+   state->struct_specifier_depth++;
+
    glsl_struct_field *fields;
    unsigned decl_count =
       ast_process_structure_or_interface_block(instructions,
@@ -4355,6 +4383,8 @@ ast_struct_specifier::hir(exec_list *instructions,
       }
    }
 
+   state->struct_specifier_depth--;
+
    /* Structure type definitions do not have r-values.
     */
    return NULL;
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 9f44c20..c16f71f 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -71,6 +71,7 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
    this->loop_nesting_ast = NULL;
    this->switch_state.switch_nesting_ast = NULL;
 
+   this->struct_specifier_depth = 0;
    this->num_builtins_to_link = 0;
 
    /* Set default language version and extensions */
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 1e386dd..dec13ac 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -159,6 +159,13 @@ struct _mesa_glsl_parse_state {
    enum _mesa_glsl_parser_targets target;
 
    /**
+    * Number of nested struct_specifier levels
+    *
+    * Outside a struct_specifer, this is zero.
+    */
+   unsigned struct_specifier_depth;
+
+   /**
     * Default uniform layout qualifiers tracked during parsing.
     * Currently affects uniform blocks and uniform buffer variables in
     * those blocks.

commit 1fb22bf1433a0c0d7c059c435da7af8eb40b1ffc
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Fri Aug 9 16:25:17 2013 -0700

    meta: Add default precision qualifier to all fragement shaders
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Cc: "9.2" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 5fb1dd51f3845985b9389987a1c6337e7fafeabc)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index cfcd0e2..a81ffde 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1537,6 +1537,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
          "}\n";
 
       fs_source = ralloc_asprintf(mem_ctx,
+                                  "#ifdef GL_ES\n"
+                                  "precision highp float;\n"
+                                  "#endif\n"
                                   "uniform %s texSampler;\n"
                                   "varying vec2 texCoords;\n"
                                   "void main()\n"
@@ -1561,6 +1564,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
                                   _mesa_is_desktop_gl(ctx) ? "130" : "300 es");
       fs_source = ralloc_asprintf(mem_ctx,
                                   "#version %s\n"
+                                  "#ifdef GL_ES\n"
+                                  "precision highp float;\n"
+                                  "#endif\n"
                                   "uniform %s texSampler;\n"
                                   "in vec2 texCoords;\n"
                                   "out vec4 out_color;\n"
@@ -2139,6 +2145,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
       "   gl_Position = position;\n"
       "}\n";
    const char *fs_source =
+      "#ifdef GL_ES\n"
+      "precision highp float;\n"
+      "#endif\n"
       "uniform vec4 color;\n"
       "void main()\n"
       "{\n"
@@ -2198,6 +2207,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
       const char *fs_int_source =
          ralloc_asprintf(shader_source_mem_ctx,
                          "#version %s\n"
+                         "#ifdef GL_ES\n"
+                         "precision highp float;\n"
+                         "#endif\n"
                          "uniform ivec4 color;\n"
                          "out ivec4 out_color;\n"
                          "\n"
@@ -3426,6 +3438,9 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
 
       fs_source = ralloc_asprintf(mem_ctx,
                                   "#extension GL_EXT_texture_array : enable\n"
+                                  "#ifdef GL_ES\n"
+                                  "precision highp float;\n"
+                                  "#endif\n"
                                   "uniform %s texSampler;\n"
                                   "varying vec3 texCoords;\n"
                                   "void main()\n"
@@ -3449,6 +3464,9 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
                                   _mesa_is_desktop_gl(ctx) ? "130" : "300 es");
       fs_source = ralloc_asprintf(mem_ctx,
                                   "#version %s\n"
+                                  "#ifdef GL_ES\n"
+                                  "precision highp float;\n"
+                                  "#endif\n"
                                   "uniform %s texSampler;\n"
                                   "in vec3 texCoords;\n"
                                   "out vec4 out_color;\n"

commit 9fa7313e346085d98785bd7f87bae73af016e307
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Fri Aug 9 15:02:49 2013 -0700

    glsl: Add default precision qualifiers for ES builtins
    
    Once the compiler proplerly checks for default precision qualifiers,
    these shaders will cease to compile.
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Cc: "9.2" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 5ac247a73e78c6df7a3980c84e6207c3da601987)

diff --git a/src/glsl/builtins/profiles/100es.frag b/src/glsl/builtins/profiles/100es.frag
index 904aa30..28c4527 100644
--- a/src/glsl/builtins/profiles/100es.frag
+++ b/src/glsl/builtins/profiles/100es.frag
@@ -1,4 +1,6 @@
 #version 100
+precision highp float;
+
 vec4 texture2D       (sampler2D sampler, vec2 coord, float bias);
 vec4 texture2DProj   (sampler2D sampler, vec3 coord, float bias);
 vec4 texture2DProj   (sampler2D sampler, vec4 coord, float bias);
diff --git a/src/glsl/builtins/profiles/300es.frag b/src/glsl/builtins/profiles/300es.frag
index 38589f7..ef412d8 100644
--- a/src/glsl/builtins/profiles/300es.frag
+++ b/src/glsl/builtins/profiles/300es.frag
@@ -1,4 +1,5 @@
 #version 300 es
+precision highp float;
 
 /* texture - bias variants */
  vec4 texture( sampler2D sampler, vec2 P, float bias);
diff --git a/src/glsl/builtins/profiles/OES_EGL_image_external.glsl b/src/glsl/builtins/profiles/OES_EGL_image_external.glsl
index 71e6af9..90300ec 100644
--- a/src/glsl/builtins/profiles/OES_EGL_image_external.glsl
+++ b/src/glsl/builtins/profiles/OES_EGL_image_external.glsl
@@ -1,5 +1,6 @@
 #version 100
 #extension GL_OES_EGL_image_external : enable
+precision highp float;
 
 vec4 texture2D(samplerExternalOES sampler, vec2 coord);
 vec4 texture2DProj(samplerExternalOES sampler, vec3 coord);
diff --git a/src/glsl/builtins/profiles/OES_standard_derivatives.frag b/src/glsl/builtins/profiles/OES_standard_derivatives.frag
index 2c6ea07..44991ef 100644
--- a/src/glsl/builtins/profiles/OES_standard_derivatives.frag
+++ b/src/glsl/builtins/profiles/OES_standard_derivatives.frag
@@ -1,5 +1,6 @@
 #version 100
 #extension GL_OES_standard_derivatives : enable
+precision highp float;
 
 /*
  * 8.8 - Fragment Processing Functions
diff --git a/src/glsl/builtins/profiles/OES_texture_3D.frag b/src/glsl/builtins/profiles/OES_texture_3D.frag
index b6ebd6a..c2c3339 100644
--- a/src/glsl/builtins/profiles/OES_texture_3D.frag
+++ b/src/glsl/builtins/profiles/OES_texture_3D.frag
@@ -1,5 +1,6 @@
 #version 100
 #extension GL_OES_texture_3D : enable
+precision highp float;
 
 vec4 texture3D (sampler3D sampler, vec3 coord);
 vec4 texture3DProj (sampler3D sampler, vec4 coord);

commit 6296abed150883edbd5fa6bbcd3057b015e2dee6
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Fri Aug 9 22:34:45 2013 +0200

    glsl: don't eliminate texcoords that can be set by GL_COORD_REPLACE
    
    Tested by examining generated TGSI shaders from piglit/glsl-routing.
    
    Cc: mesa-stable@lists.freedesktop.org
    Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
    Tested-by: Henri Verbeet <hverbeet@gmail.com>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit d13003f544417db6de44c65a0c118bd2b189458a)

diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h
index 2c1479f..d9d90dd 100644
--- a/src/glsl/ir_optimization.h
+++ b/src/glsl/ir_optimization.h
@@ -77,7 +77,7 @@ bool do_copy_propagation(exec_list *instructions);
 bool do_copy_propagation_elements(exec_list *instructions);
 bool do_constant_propagation(exec_list *instructions);
 void do_dead_builtin_varyings(struct gl_context *ctx,
-                              exec_list *producer, exec_list *consumer,
+                              gl_shader *producer, gl_shader *consumer,
                               unsigned num_tfeedback_decls,
                               class tfeedback_decl *tfeedback_decls);
 bool do_dead_code(exec_list *instructions, bool uniform_locations_assigned);
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index ac010cf..b37b150 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1906,7 +1906,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
             goto done;
       }
 
-      do_dead_builtin_varyings(ctx, sh->ir, NULL,
+      do_dead_builtin_varyings(ctx, sh, NULL,
                                num_tfeedback_decls, tfeedback_decls);
 
       demote_shader_inputs_and_outputs(sh, ir_var_shader_out);
@@ -1921,7 +1921,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
        */
       gl_shader *const sh = prog->_LinkedShaders[first];
 
-      do_dead_builtin_varyings(ctx, NULL, sh->ir,
+      do_dead_builtin_varyings(ctx, NULL, sh,
                                num_tfeedback_decls, tfeedback_decls);
 
       demote_shader_inputs_and_outputs(sh, ir_var_shader_in);
@@ -1943,7 +1943,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
                 tfeedback_decls))
          goto done;
 
-      do_dead_builtin_varyings(ctx, sh_i->ir, sh_next->ir,
+      do_dead_builtin_varyings(ctx, sh_i, sh_next,
                 next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0,
                 tfeedback_decls);
 
diff --git a/src/glsl/opt_dead_builtin_varyings.cpp b/src/glsl/opt_dead_builtin_varyings.cpp
index 2e813d2..6745d5c 100644
--- a/src/glsl/opt_dead_builtin_varyings.cpp
+++ b/src/glsl/opt_dead_builtin_varyings.cpp
@@ -409,7 +409,7 @@ lower_texcoord_array(exec_list *ir, const varying_info_visitor *info)
 
 void
 do_dead_builtin_varyings(struct gl_context *ctx,
-                         exec_list *producer, exec_list *consumer,
+                         gl_shader *producer, gl_shader *consumer,
                          unsigned num_tfeedback_decls,
                          tfeedback_decl *tfeedback_decls)
 {
@@ -431,44 +431,55 @@ do_dead_builtin_varyings(struct gl_context *ctx,
    varying_info_visitor consumer_info(ir_var_shader_in);
 
    if (producer) {
-      producer_info.get(producer, num_tfeedback_decls, tfeedback_decls);
+      producer_info.get(producer->ir, num_tfeedback_decls, tfeedback_decls);
 
       if (!consumer) {
          /* At least eliminate unused gl_TexCoord elements. */
          if (producer_info.lower_texcoord_array) {
-            lower_texcoord_array(producer, &producer_info);
+            lower_texcoord_array(producer->ir, &producer_info);
          }
          return;
       }
    }
 
    if (consumer) {
-      consumer_info.get(consumer, 0, NULL);
+      consumer_info.get(consumer->ir, 0, NULL);
 
       if (!producer) {
          /* At least eliminate unused gl_TexCoord elements. */
          if (consumer_info.lower_texcoord_array) {
-            lower_texcoord_array(consumer, &consumer_info);
+            lower_texcoord_array(consumer->ir, &consumer_info);
          }
          return;
       }
    }
 
-   /* Eliminate the varyings unused by the other shader. */
+   /* Eliminate the outputs unused by the consumer. */
    if (producer_info.lower_texcoord_array ||
        producer_info.color_usage ||
        producer_info.has_fog) {
-      replace_varyings_visitor(producer,
+      replace_varyings_visitor(producer->ir,
                                &producer_info,
                                consumer_info.texcoord_usage,
                                consumer_info.color_usage,
                                consumer_info.has_fog);
    }
 
+   /* The gl_TexCoord fragment shader inputs can be initialized
+    * by GL_COORD_REPLACE, so we can't eliminate them.
+    *
+    * This doesn't prevent elimination of the gl_TexCoord elements which
+    * are not read by the fragment shader. We want to eliminate those anyway.
+    */
+   if (consumer->Type == GL_FRAGMENT_SHADER) {
+      producer_info.texcoord_usage = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
+   }
+
+   /* Eliminate the inputs uninitialized by the producer. */
    if (consumer_info.lower_texcoord_array ||
        consumer_info.color_usage ||
        consumer_info.has_fog) {
-      replace_varyings_visitor(consumer,
+      replace_varyings_visitor(consumer->ir,
                                &consumer_info,
                                producer_info.texcoord_usage,
                                producer_info.color_usage,

commit 5b8c943eb23fbe1eca9a60895db853bb32a58bcc
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat Aug 17 10:53:09 2013 -0400

    nv50: allow non-nv12 buffers to be created, just pass them through to vl
    
    Since we expose non-NV12 formats as supported when there is no decoer
    profile selected, make sure that those formats are actually allowed to
    be allocated.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
    Cc: "9.2" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit a8346a2f52d08233d376db3aa8205d0b2cc74318)

diff --git a/src/gallium/drivers/nv50/nv84_video.c b/src/gallium/drivers/nv50/nv84_video.c
index d5f6295..5c63433 100644
--- a/src/gallium/drivers/nv50/nv84_video.c
+++ b/src/gallium/drivers/nv50/nv84_video.c
@@ -624,17 +624,13 @@ nv84_video_buffer_create(struct pipe_context *pipe,
    union nouveau_bo_config cfg;
    unsigned bo_size;
 
-   if (getenv("XVMC_VL"))
+   if (getenv("XVMC_VL") || template->buffer_format != PIPE_FORMAT_NV12)
       return vl_video_buffer_create(pipe, template);
 
    if (!template->interlaced) {
       debug_printf("Require interlaced video buffers\n");
       return NULL;
    }
-   if (template->buffer_format != PIPE_FORMAT_NV12) {
-      debug_printf("Must use NV12 format\n");
-      return NULL;
-   }
    if (template->chroma_format != PIPE_VIDEO_CHROMA_FORMAT_420) {
       debug_printf("Must use 4:2:0 format\n");
       return NULL;

commit d72f7720a6de538da21d883688d34bbaf656b542
Author: Anuj Phogat <anuj.phogat@gmail.com>
Date:   Mon Aug 5 14:27:47 2013 -0700

    meta: Fix blitting a framebuffer with renderbuffer attachment
    
    This patch fixes a case of framebuffer blitting with renderbuffer
    as color attachment and GL_LINEAR filter. Meta implementation of
    glBlitFrambuffer() converts source color buffer to a texture and
    uses it to do the scaled blitting in to destination buffer. Using
    the exact source rectangle to create the texture does incorrect
    linear filtering along the edges. This patch makes the changes to
    extend the texture edges by one pixel in x, y directions. This
    ensures correct linear filtering.
    It fixes failing piglit fbo-attachments-blit-scaled-linear test.
    
    Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
    CC: "9.2" <mesa-stable@lists.freedesktop.org>
    CC: "9.1" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Paul Berry <stereotype441@gmail.com>
    (cherry picked from commit d944a6144f6ee6a0b24126ce72de280db90038c9)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 286f32e..cfcd0e2 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1884,19 +1884,24 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
       const GLenum rb_base_format =
          _mesa_base_tex_format(ctx, colorReadRb->InternalFormat);
 
-      newTex = alloc_texture(tex, srcW, srcH, rb_base_format);
-      setup_copypix_texture(ctx, tex, newTex, srcX, srcY, srcW, srcH,
+      /* Using  the exact source rectangle to create the texture does incorrect
+       * linear filtering along the edges. So, allocate the texture extended along
+       * edges by one pixel in x, y directions.
+       */
+      newTex = alloc_texture(tex, srcW + 2, srcH + 2, rb_base_format);
+      setup_copypix_texture(ctx, tex, newTex,
+                            srcX - 1, srcY - 1, srcW + 2, srcH + 2,
                             rb_base_format, filter);
       /* texcoords (after texture allocation!) */
       {
-         verts[0].s = 0.0F;
-         verts[0].t = 0.0F;
-         verts[1].s = tex->Sright;
-         verts[1].t = 0.0F;
-         verts[2].s = tex->Sright;
-         verts[2].t = tex->Ttop;
-         verts[3].s = 0.0F;
-         verts[3].t = tex->Ttop;
+         verts[0].s = 1.0F;
+         verts[0].t = 1.0F;
+         verts[1].s = tex->Sright - 1.0F;
+         verts[1].t = 1.0F;
+         verts[2].s = tex->Sright - 1.0F;
+         verts[2].t = tex->Ttop - 1.0F;
+         verts[3].s = 1.0F;
+         verts[3].t = tex->Ttop - 1.0F;
 
          /* upload new vertex data */
          _mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts);

commit b40d9e4f416cbd1b643a04c0ac40e2b8d78daa9d
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Thu Aug 15 19:52:48 2013 -0400

    nv30: remove no-longer-used formats from table
    
    Commit 14ee790df77 removed the formats from the vtxfmt_table but forgot
    to also update the info_table.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit c1a6f59b20dab380b77ad1375062f9987cad9183)

diff --git a/src/gallium/drivers/nv30/nv30_format.c b/src/gallium/drivers/nv30/nv30_format.c
index 4367fbb..86620b4 100644
--- a/src/gallium/drivers/nv30/nv30_format.c
+++ b/src/gallium/drivers/nv30/nv30_format.c
@@ -111,9 +111,6 @@ nv30_format_info_table[PIPE_FORMAT_COUNT] = {
    _(R16G16_SNORM        , __V_),
    _(R16G16B16_SNORM     , __V_),
    _(R16G16B16A16_SNORM  , __V_),
-   _(R8_USCALED          , __V_),
-   _(R8G8_USCALED        , __V_),
-   _(R8G8B8_USCALED      , __V_),
    _(R8G8B8A8_USCALED    , __V_),
    _(R16_FLOAT           , __V_),
    _(R16G16_FLOAT        , __V_), //S_V_),

commit e2185778e2e6d2d1c6bd7846e94f5ebfd3cdd160
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Tue Aug 13 15:03:12 2013 -0700

    i965: Force X-tiling for 128 bpp formats on Sandybridge.
    
    128 bpp formats are not allowed to be Y-tiled on any architectures
    except Gen7.
    
    +11 Piglits on Sandybridge (mostly regression fixes since the
    switch to Y-tiling).
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63867
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64261
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Cc: "9.2" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit c189840b21e176d87cbb382e64e848061b8c7b06)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 36a080f..6775909 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -468,6 +468,15 @@ intel_miptree_choose_tiling(struct brw_context *brw,
    if (brw->gen < 6)
       return I915_TILING_X;
 
+   /* From the Sandybridge PRM, Volume 1, Part 2, page 32:
+    * "NOTE: 128BPE Format Color Buffer ( render target ) MUST be either TileX
+    *  or Linear."
+    * 128 bits per pixel translates to 16 bytes per pixel.  This is necessary
+    * all the way back to 965, but is explicitly permitted on Gen7.
+    */
+   if (brw->gen != 7 && mt->cpp >= 16)
+      return I915_TILING_X;
+
    return I915_TILING_Y | I915_TILING_X;
 }
 

commit a98d5f2663dc8488b4232449369df45f2dfaa42f
Author: Laurent Carlier <lordheavym@gmail.com>
Date:   Fri Aug 16 10:51:49 2013 -0700

    mesa/program: remove useless YYID
    
    This fixes the build with Bison 3.0. Also works with Bison 2.7.1.
    
    CC: "9.2" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    (cherry picked from commit 5ffa28df4e4cc22481b4ed41c78632f35765f41d)

diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 3aceb21..a76db4e 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -98,7 +98,7 @@ static struct asm_instruction *asm_instruction_copy_ctor(
 
 #define YYLLOC_DEFAULT(Current, Rhs, N)					\
    do {									\
-      if (YYID(N)) {							\
+      if (N) {							\
 	 (Current).first_line = YYRHSLOC(Rhs, 1).first_line;		\
 	 (Current).first_column = YYRHSLOC(Rhs, 1).first_column;	\
 	 (Current).position = YYRHSLOC(Rhs, 1).position;		\
@@ -112,7 +112,7 @@ static struct asm_instruction *asm_instruction_copy_ctor(
 	 (Current).position = YYRHSLOC(Rhs, 0).position			\
 	    + (Current).first_column;					\
       }									\
-   } while(YYID(0))
+   } while(0)
 %}
 
 %pure-parser

commit 24d1949ddcdbec891f828a63419cecb48cf1989f
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Wed Aug 7 11:15:41 2013 -0700

    mesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts
    
    It is only in OpenGL compatibility-style contexts where generic
    attribute 0 and GL_VERTEX_ARRAY have a bizzare, aliasing relationship.
    Moreover, it is only in OpenGL compatibility-style contexts and OpenGL
    ES 1.x where one of these attributes provokes the vertex.  In all other
    APIs each implicit call to glArrayElement provokes a vertex regardless
    of which attributes are enabled.
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Robert Bragg <robert@sixbynine.org>
    Cc: "9.0 9.1 9.2" <mesa-stable@lists.freedesktop.org>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55503
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66292
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67548
    (cherry picked from commit 41eef83cc030e7087b79b0070d00fbc56538fb81)

diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 75831fa..bd05cd0 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -442,41 +442,77 @@ recalculate_input_bindings(struct gl_context *ctx)
       break;
 
    case VP_ARB:
-      /* GL_ARB_vertex_program or GLSL vertex shader - Only the generic[0]
+      /* There are no shaders in OpenGL ES 1.x, so this code path should be
+       * impossible to reach.  The meta code is careful to not use shaders in
+       * ES1.
+       */
+      assert(ctx->API != API_OPENGLES);
+
+      /* In the compatibility profile of desktop OpenGL, the generic[0]
        * attribute array aliases and overrides the legacy position array.  
-       *
        * Otherwise, legacy attributes available in the legacy slots,
        * generic attributes in the generic slots and materials are not
        * available as per-vertex attributes.
+       *
+       * In all other APIs, only the generic attributes exist, and none of the
+       * slots are considered "magic."
        */
-      if (vertexAttrib[VERT_ATTRIB_GENERIC0].Enabled)
-	 inputs[0] = &vertexAttrib[VERT_ATTRIB_GENERIC0];
-      else if (vertexAttrib[VERT_ATTRIB_POS].Enabled)
-	 inputs[0] = &vertexAttrib[VERT_ATTRIB_POS];
-      else {
-	 inputs[0] = &vbo->currval[VBO_ATTRIB_POS];
-         const_inputs |= VERT_BIT_POS;
-      }
+      if (ctx->API == API_OPENGL_COMPAT) {
+         if (vertexAttrib[VERT_ATTRIB_GENERIC0].Enabled)
+            inputs[0] = &vertexAttrib[VERT_ATTRIB_GENERIC0];
+         else if (vertexAttrib[VERT_ATTRIB_POS].Enabled)
+            inputs[0] = &vertexAttrib[VERT_ATTRIB_POS];
+         else {
+            inputs[0] = &vbo->currval[VBO_ATTRIB_POS];
+            const_inputs |= VERT_BIT_POS;
+         }
 
-      for (i = 1; i < VERT_ATTRIB_FF_MAX; i++) {
-	 if (vertexAttrib[VERT_ATTRIB_FF(i)].Enabled)
-	    inputs[i] = &vertexAttrib[VERT_ATTRIB_FF(i)];
-	 else {
-	    inputs[i] = &vbo->currval[VBO_ATTRIB_POS+i];


Reply to: