Mesa (master): 25 new commits

Paul Berry stereotype441 at kemper.freedesktop.org
Fri Oct 25 05:03:00 UTC 2013


URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e8f6f244bb1963c4af81f431865355beef1b9cbb
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Oct 15 14:56:28 2013 -0700

    glsl: When disabling gl_PerVertex variables, check that mode matches.
    
    In commit 1b4a737 (glsl: Support redeclaration of VS and GS
    gl_PerVertex output), I added code to ensure that when an unnamed
    gl_PerVertex interface block is redeclared, any ir_variables that
    weren't included in the redeclaration are removed from the IR (and the
    symbol table).  This ensures that only those variables that were
    explicitly redeclared may be used.
    
    However, when I wrote this code, I neglected to match the variable
    mode when finding variables to remove.  This meant that redeclaring a
    built-in output block might cause the built-in input gl_in to be
    accidentally removed.
    
    Fixes piglit test gs-redeclares-pervertex-out-only.
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=719bf3016550a279cf0d399b946d0d0b77329927
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Oct 15 15:13:59 2013 -0700

    glsl: Remove unused gl_PerVertex interface blocks.
    
    The GLSL 4.10 rules for redeclaration of built-in interface blocks
    (which we've chosen to regard as clarifications of GLSL 1.50) only
    require gl_PerVertex blocks to match in shaders that actually use
    those blocks.  The easiest way to implement this is to detect
    situations where a compiled shader doesn't refer to any elements of
    gl_PerVertex, and remove all the associated ir_variables from the
    shader at the end of ast-to-ir conversion.
    
    Fixes piglit tests
    linker/interstage-{pervertex,pervertex-in,pervertex-out}-redeclaration-unneeded.
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=37d97668ae7e4572c08174a8eee33ca23b9305ea
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Oct 15 16:48:59 2013 -0700

    glsl: Call check_builtin_array_max_size when redeclaring gl_in.
    
    Normally when a built-in array (such as gl_ClipDistance) is
    redeclared, we call get_variable_being_redeclared() to do the
    redeclaration, and it in turn calls check_builtin_array_max_size() to
    make sure that the redeclared array size isn't too large.
    
    However when a built-in array is redeclared as part of redeclaring
    gl_in, we don't call get_variable_being_redeclared() (since the
    individual built-ins aren't each represented by their own ir_variable
    anymore).  So we need to add an explicit call to
    check_builtin_array_max_size() to make sure the new array size isn't
    too large.
    
    Note: at the moment this is redundant with a test that's done at link
    time, so there's no change to piglit results.  But the patch that
    follows will prevent link errors from being reported if gl_PerVertex
    isn't used, so in order to prevent that patch from causing
    regressions, we need to add the compile check now.  Besides, it's
    nicer to report this error at compile time anyhow.
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=156b31c5be921bca7b7a96f1838c96c17ec3a602
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 16 11:01:42 2013 -0700

    mesa: Fix geometry shader program queries.
    
    The queries GEOMETRY_VERTICES_OUT, GEOMETRY_INPUT_TYPE, and
    GEOMETRY_OUTPUT_TYPE (defined by GL 3.2) differ from the corresponding
    queries in ARB_geometry_shader4 in the following ways:
    
    - They use different enum values
    
    - They can only be queried; they cannot be set.
    
    - Attempting to query them yields INVALID_OPERATION if the program is
      not linked, or lacks a geometry shader.
    
    This patch switches us over from the ARB_geometry_shader4 behaviour to
    the GL 3.2 behaviour.
    
    Fixes piglit test query-gs-prim-types.
    
    v2: Improve comment above has_core_gs.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a49830b8f549c93cf92298048ffe00f931e0525d
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Mon Oct 21 21:09:47 2013 -0700

    glsl: Account for interface block lowering in program_resource_visitor.
    
    When program_resource_visitor visits variables that were created by
    lower_named_interface_blocks, it needs to do extra work to un-do the
    effects of lower_named_interface_blocks and construct the proper API
    names.
    
    Fixes piglit test
    spec/glsl-1.50/execution/interface-blocks-api-access-members.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4b97c581b4f85e1712c7900cb099c9d56babb05d
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Mon Oct 21 20:27:23 2013 -0700

    glsl: mark variables produced by lower_named_interface_blocks.
    
    These variables will need to be treated specially by
    program_resource_visitor, so that they can be addressed through the
    API using their interface block name (and array index, for interface
    block arrays).
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=99512dc40d762d15d636ea711c496bd0350ef7f1
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Oct 22 15:11:51 2013 -0700

    glsl: Keep track of centroid/interpolation mode for interface block members.
    
    Fixes piglit tests:
    - interface-block-interpolation-{array,named,unnamed}
    - glsl-1.50-interface-block-centroid {array,named,unnamed}
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e17d671d9f64fe135a10ec54dd5b5a6beacfd991
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Oct 22 15:03:29 2013 -0700

    glsl: Pass variable mode into ast_process_structure_or_interface_block().
    
    Later patches will use this information to do proper error checking of
    interpolation qualifiers that appear inside of interface blocks.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=81a50679661c2b9e4535114bb6010042dd05dc5a
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Oct 22 14:54:10 2013 -0700

    glsl: Extract interpretation of interpolation to its own function.
    
    In future patches, we will need this in order to interpret
    interpolation qualifiers that appear inside interface blocks.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f65feb5335331ed0960d3fd62a70d0d0aaf23ab7
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Oct 22 14:48:08 2013 -0700

    glsl: Pull interpolation_string() out of ir_variable.
    
    Future patches will need to call this function when there isn't an
    ir_varible present to refer to.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e3e72e3054de27b35322feb6c715e433b00be2a
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Oct 15 20:44:00 2013 -0700

    i965: Reduce gl_MaxGeometryInputComponents to 64.
    
    Although in principle there is no hardware limitation that prevents
    gl_MaxGeometryInputComponents from being set to 128 on Gen7, we have
    the following limitations in the vec4 compiler back end:
    
    - Registers assigned to geometry shader inputs can't be spilled or
      later re-used for any other purpose.
    
    - The last 16 registers are set aside for the "MRF hack", meaning they
      can only be used to send messages, and not for general purpose
      computation.
    
    - Up to 32 registers may be reserved for push constants, even if there
      is sufficient register pressure to make this impractical.
    
    A shader using 128 geometry input components, and having an input type
    of triangles_adjacency, would use up:
    
    - 1 register for r0 (which holds URB handles and various pieces of
      control information).
    
    - 1 register for gl_PrimitiveID.
    
    - 102 registers for geometry shader inputs (17 registers per input
      vertex, assuming DUAL_INSTANCED dispatch mode and allowing for one
      register of overhead for gl_Position and gl_PointSize, which are
      present in the URB map even if they are not used).
    
    - Up to 32 registers for push constants.
    
    - 16 registers for the "MRF hack".
    
    That's a total of 152 registers, which is well over the 128 registers
    the hardware supports.
    
    Fortunately, the GLSL 1.50 spec allows us to reduce
    gl_MaxGeometryInputComponents to 64.  Doing that frees up 48
    registers, brining the total down to 104 registers, leaving 24
    registers available to do computation.
    
    Fixes piglit test
    spec/glsl-1.50/execution/geometry/max-input-components.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c2feb1969db110523093740ace594b5c9d75a25
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 16 12:27:37 2013 -0700

    i965/gs: If a DUAL_OBJECT gs would spill, fall back to DUAL_INSTANCED.
    
    This is similar to what we do for 16-wide vs 8-wide fragment shaders.
    First we try compiling the geometry shader in DUAL_OBJECT mode.  If we
    can't do that without spilling, we fall back on DUAL_INSTANCED mode,
    which should require less spilling (since it uses an interleaved
    layout of payload registers).
    
    In an ideal world we'd fall back to SINGLE mode, which would allow us
    to interleave general-purpose registers too (resulting in even less
    likelihood of spilling).  But at the moment, the vec4 generator and
    visitor classes don't have the infrastructure to interleave general
    purpose registers, so DUAL_INSTANCED is the best we can do.
    
    As a side benefit this paves the way for implementing instanced
    geometry shaders (which are incompatible with DUAL_OBJECT mode).
    
    Since most geometry shaders used in piglit testing are small,
    DUAL_INSTANCED mode won't get exercised very much in a normal piglit
    run.  To force DUAL_INSTANCED mode to be used for all geometry
    shaders, set INTEL_DEBUG=nodualobj.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=03ac2c7223f7645e30028bf59b4c9cf0f5734fc0
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 16 13:18:11 2013 -0700

    i965/gs: Fix up gl_PointSize input swizzling for DUAL_INSTANCED gs.
    
    Geometry shaders that run in "DUAL_INSTANCED" mode store their inputs
    in vec4's.  This means that when compiling gl_PointSize input
    swizzling (a MOV instruction which uses a geometry shader input as
    both source and destination), we need to do two things:
    
    - Set force_writemask_all to ensure that the MOV happens regardless of
      which channels are enabled.
    
    - Set the source register region to <4;4,1> (instead of <0;4,1> to
      satisfy register region restrictions.
    
    v2: move the source register region fixup to the top of
    vec4_generator::generate_vec4_instruction(), so that it applies to all
    instructions rather than just MOV.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a05589ea0b7b760e0473af6c7ab5d796520f5948
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 16 12:04:19 2013 -0700

    i965/gs: Add the ability to compile a DUAL_INSTANCED geometry shader.
    
    Not yet enabled.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=34cba13ef822faebbb1f10f1400f87fa9bf70d60
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 16 12:13:20 2013 -0700

    i965/vec4: Add the ability to suppress register spilling.
    
    In future patches, this will allow us to first try compiling a
    geometry shader in DUAL_OBJECT mode (which is more efficient but uses
    more registers) and then if spilling is required, fall back on
    DUAL_INSTANCED mode.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=89647cffb31ee1ea42d581b1053b4bb147b3e58a
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 16 13:13:20 2013 -0700

    i965/vec4: if register allocation fails, don't try to schedule.
    
    Otherwise the scheduler would be invoked with prog_data->total_grf ==
    0, causing havoc.
    
    In a future patch, this will allow us to try compiling a geometry
    shader in DUAL_OBJECT mode with spilling disabled, and then fall back
    to DUAL_INSTANCED mode if that failed.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8bb15813e3047820a95724e4257aa2c862eeb31a
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 16 11:40:41 2013 -0700

    i965/vec4: Add the ability for attributes to be interleaved.
    
    When geometry shaders are operated in "single" or "dual instanced"
    mode, a single set of geometry shader inputs is interleaved into the
    thread payload (with each payload register containing a pair of
    inputs) in order to save register space.
    
    This patch modifies vec4_visitor::lower_attributes_to_hw_regs so that
    it can handle the interleaved format.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3da2c5123d043a670ebad7d01c6cba37c915b4c9
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Sat Oct 19 13:26:27 2013 -0700

    i965/gs: Set force_writemask_all when setting up g0.
    
    All geometry shaders begin this instruction:
    
        mov(1) g0.2<1>:ud 0x0:ud { align1 }
    
    which sets up GRF0 properly for scratch reads and writes.  Since this
    instruction has a SIMD size of 1, it will only have an effect if the
    first channel is enabled.  In practice, the hardware seems to always
    dispatch geometry shaders with the first channel enabled, but I can't
    find anything in the docs to guarantee that.
    
    So to be on the safe side, set force_writemask_all on the instruction,
    which guarantees that it will have the desired effect regardless of
    which channels are enabled.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=172aec281d3d4eb0709977e0748d137e56aacd90
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 23 07:55:09 2013 -0700

    glsl: set explicit_location correctly in lower_named_interface_blocks.
    
    When lower_named_interface_blocks lowers a built-in interface block
    member to an ir_variable, it needs to set explicit_location in the
    ir_variable.  Otherwise the linker gets confused and treats the
    variable as a generic varying.
    
    Fixes the following piglit tests, which were regressed by commit
    63974c0 (glsl: Simplify the interface to
    link_invalidate_variable_locations):
    - clip-distance-bulk-copy
    - clip-distance-in-bulk-read
    - clip-distance-in-explicitly-sized
    - clip-distance-in-param
    - clip-distance-in-values
    - core-inputs
    - gs-redeclares-both-pervertex-blocks
    - gs-redeclares-pervertex-in-only
    - redeclare-pervertex-subset-vs-to-gs
    - unsized-in-named-interface-block-gs
    - unsized-in-named-interface-block-multiple
    - unsized-in-unnamed-interface-block-gs
    - unsized-in-unnamed-interface-block-multiple
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70820
    
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=85db1326a2f0413a0f55e416791c64732b0af88a
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 23 10:19:39 2013 -0700

    i965/gs: Precompile geometry shaders.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e0f34301b29ecf3fb7118b2e05872510c104a49b
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 23 10:17:30 2013 -0700

    i965/vec4: Extract function to set up vec4 prog key for precompiling.
    
    This will allow us to re-use it for precompiling geometry shaders.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=068df64ba6a8309427612836e5eb384721ca6d40
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 23 11:10:14 2013 -0700

    i965/vec4: Remove uses_clip_distance from program key.
    
    This should never have been in the program key in the first place,
    since it's determined by the shader source, not by GL state.  Change
    the code to just refer to gl_program::UsesClipDistanceOut directly.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=11634e491bf6d7d930f00c5b4f62fd4e8cb4314d
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 23 10:59:57 2013 -0700

    glsl: Move UsesClipDistance from gl_{vertex,geometry}_program into gl_program.
    
    This will make it easier for back-ends to share code between geometry
    shader and vertex shader compilation.  Also, it is renamed to
    "UsesClipDistanceOut" to clarify that (a) in geometry shaders, it
    refers to the gl_ClipDistance output rather than the gl_ClipDistance
    input, and (b) it is irrelevant in fragment shaders.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=44b7ebe52d6f4b220a1c943bac2e571bb593f7e1
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 23 12:55:24 2013 -0700

    glsl/gs: Fix transform feedback of gl_ClipDistance.
    
    Since gl_ClipDistance is lowered from an array of floats to an array
    of vec4's during compilation, transform feedback has special logic to
    keep track of the pre-lowered array size so that attempting to perform
    transform feedback on gl_ClipDistance produces a result with the
    correct size.
    
    Previously, this special logic always consulted the vertex shader's
    size for gl_ClipDistance.  This patch fixes it so that it uses the
    geometry shader's size for gl_ClipDistance when a geometry shader is
    in use.
    
    Fixes piglit test spec/glsl-1.50/transform-feedback-type-and-size.
    
    v2: Change the type of LastClipDistanceArraySize to "unsigned", and
    clarify the comment above it.
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fe36154ff3b2c095cf21462dd7ed6b5ae374fccc
Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Oct 23 13:36:25 2013 -0700

    i965: Fix gl_MaxCombinedTextureImageUnits.
    
    We've always overriden
    ctx->Const.{Vertex,Fragment}Program.MaxTextureImageUnits to reflect
    the number of texture image units supported by the hardware (rather
    than using the default values assigned by Mesa core) so it seems
    sensible to do that for GeometryProgram.MaxTextureImageUnits too.  We
    set it to 0 if geometry shaders aren't supported.
    
    Once that is done, we can just unconditionally add
    GeometryProgram.MaxTextureImageUnits to MaxCombinedTextureImageUnits.
    
    Fixes piglit test "spec/glsl-1.50/built-in
    constants/gl_MaxCombinedTextureImageUnits".
    
    Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>




More information about the mesa-commit mailing list