Mesa (master): 24 new commits

Kenneth Graunke kwg at kemper.freedesktop.org
Mon Sep 9 21:48:49 UTC 2013


URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=260965b7a702efa099dbea6bb90bc5d7426e8465
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Sep 5 17:10:54 2013 -0700

    build: Delete cross-compiling macros.
    
    Now that builtin_compiler is gone, nothing uses these.
    
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Acked-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b973b44a4de3bd02e6c63b4a851c14808bf1df3d
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Sep 5 16:57:29 2013 -0700

    glsl: Add missing type inference for ir_binop_bfm.
    
    Matt noticed that this was missing.  Nothing uses this currently.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=722eff674b832e2321f791c68358ef52d2a1ff25
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 21:23:18 2013 -0700

    glsl: Delete old built-in function generation code.
    
    None of this is used anymore.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Acked-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c845140a20efa6a30a5465301d1f9b4acea79155
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 21:22:17 2013 -0700

    glsl: Remove builtin_compiler from the build system.
    
    We don't actually use anything from builtin_function.cpp, so we don't
    need to generate it anymore.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Acked-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=76d2f73643f5502d88fdc272447753fde8f6438b
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Sun Sep 1 20:48:45 2013 -0700

    glsl: Switch to the new built-in function module.
    
    All built-ins are now handled by the new code; the old system is dead.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7ddc312c1b2c610ba8f244b49f4c4bc94eeca985
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Aug 29 23:06:39 2013 -0700

    glsl: Write a new built-in function module.
    
    This creates a new replacement for the existing built-in function code.
    The new module lives in builtin_functions.cpp (not builtin_function.cpp)
    and exists in parallel with the existing system.  It isn't used yet.
    
    The new built-in function code takes a significantly different approach:
    
    Instead of implementing built-ins via printed IR, build time scripts,
    and run time parsing, we now implement them directly in C++, using
    ir_builder.  This translates to faster load times, and a much less
    complex build system.
    
    It also takes a different approach to built-in availability: each
    signature now stores a boolean predicate, which makes it easy to
    construct arbitrary expressions based on _mesa_glsl_parse_state's
    fields.  This is much more flexible than the old system, and also
    easier to use.
    
    Built-ins are also now stored in a single gl_shader object, rather
    than being spread out across a number of shaders that need to be linked.
    When searching for a matching prototype, we simply consult the
    availability predicate.  This also simplifies the code.
    
    v2: Incorporate Matt Turner's feedback: use the new fma() function rather
        than expr().  Don't expose textureQueryLOD() in GLSL 4.00 (since it
        was renamed to textureQueryLod()).  Also correct some #undefs.
    v3: Incorporate Paul Berry's feedback: rename legacy to compatibility;
        add comments to explain a few things; fix uvec availability; include
        shaderobj.h instead of repeating the _mesa_new_shader prototype.
    v4: Fix lack of TEX_PROJECT on textureProjGrad[Offset] (caught by oglc).
        Add an out_var convenience function (more feedback by Matt Turner).
    v5: Rework availability predicates for Lod functions.  They were broken.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Enthusiastically-acked-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d90328eb3a934e07a9fa54b829e768750ab6d8b
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 17:07:18 2013 -0700

    glsl: Add optional parameters to the ir_factory constructor.
    
    Each ir_factory needs an instruction list and memory context in order to
    be useful.  Rather than creating an object and manually assigning these,
    we can just use optional parameters in the constructor.
    
    This makes it possible to create a ready-to-use factory in one line:
    
       ir_factory body(&sig->body, mem_ctx);
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=666df565519357833aabb265e42d1ed981bf2a4a
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 17:02:07 2013 -0700

    glsl: Add IR builder shortcuts for a bunch of random opcodes.
    
    Adding new convenience emitters makes it easier to generate IR involving
    these opcodes.
    
    bitfield_insert is particularly useful, since there is no expr() for
    quadops.
    
    v2: Add fma() and rename lrp() operands to x/y/a to match the GLSL
        specification (suggested by Matt Turner).  Fix whitespace issues.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a6c0efa116e7427e3ee5f24db2000e3edb66047
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 16:55:37 2013 -0700

    glsl: Expose IR builder support for arbitrary swizzling.
    
    IR builder already offers a lot of swizzling functions, such as
    swizzle_xxxx, swizzle_z, or swizzle_for_size.
    
    The swizzle_xxxx style is convenient if you statically know which
    components you want.  swizzle_for_size is great if you want to select
    the first few components.  However, if you want to select components
    based on, say, a loop counter, none of those are sufficient.
    
    IR builder actually already had support for arbitrary swizzling, but
    didn't expose it.  This patch exposes that API.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=202238824bdde9ddac5753232eee4f3d1e2d67db
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 16:46:05 2013 -0700

    glsl: Add a new ir_builder::dotlike() function.
    
    dotlike() uses ir_binop_mul for scalars, and ir_binop_dot for vectors.
    
    When generating built-in functions, we often want to use regular
    multiply for scalar signatures, and dot() for vector signatures.
    ir_binop_dot only works on vectors, so we have to switch opcodes,
    even if the code is otherwise identical.  dotlike() makes this easy.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d716b3376ccf66200d007852b30147ca7f7e7c68
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 16:44:25 2013 -0700

    glsl: Add IR builder support for generating return statements.
    
    We use "ret" as the function name since "return" is a C++ keyword, and
    "ir_return" is already a class name.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f72a8498e7e2c2d3233cdfd58de3b1124a247d39
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 16:41:42 2013 -0700

    glsl: Add IR builder support for conditional assignments.
    
    This adds two new signatures:
    
       assign(lhs, rhs, condition, writemask);
       assign(lhs, rhs, condition);
    
    All the other existing APIs still exist.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eff2ca1ac3f77da81a698b08c46f245b28930ede
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 16:37:39 2013 -0700

    glsl: Add IR builder support for triops.
    
    Now that we have the ir_expression constructor that does type inference,
    this is trivial to do.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7f0f60cd840fc88f01b8f6e46cad36c36709d813
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 11:52:40 2013 -0700

    glsl: Add an ir_expression triop constructor with type inference.
    
    We already have ir_expression constructors for unary and binary
    operations, which automatically infer the type based on the opcode and
    operand types.
    
    These are convenient and also required for ir_builder support.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=183f7a3e6f45a3351b86eb4c25313efe140e9793
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Sep 3 13:58:04 2013 -0700

    glsl: Add missing type inference support for ARB_gpu_shader5 unops.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=33faaf0b4ac6391793eea8771090ae6def4882da
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Sun Sep 1 23:18:37 2013 -0700

    glsl: Initialize lod_info in the ir_texture constructor.
    
    This isn't strictly necessary, since creators of ir_texture objects
    should set LOD when relevant.  However, it's nice to have a NULL pointer
    in case they forget.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b3a482a9642a6850f1717966f1c6630fcbbe3bc
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Sep 2 23:14:43 2013 -0700

    glsl: Skip unavailable built-ins when printing out similar candidates.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ffcef04cee5eaa14617fa1dfb92fdb4a68332cf
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Aug 30 23:15:59 2013 -0700

    glsl: Skip unavailable built-ins when matching signatures.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e820e3aef382fed73b6b8128596424ed7690951
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Aug 30 23:11:55 2013 -0700

    glsl: Pass _mesa_glsl_parse_state into matching_signature and such.
    
    During compilation, we'll use this to determine built-in availability.
    The plan is to have a single shader containing every built-in in every
    version of the language, but filter out the ones that aren't actually
    available to the shader being compiled.
    
    At link time, we don't actually need this filtering capability: we've
    already imported prototypes for every built-in that the shader actually
    calls, and they're flagged as is_builtin().  The linker doesn't import
    any additional prototypes, so it won't pull in any unavailable
    built-ins.  When resolving prototypes to function definitions, the
    linker ensures the values of is_builtin() match, which means that a
    shader can't trick the linker into importing the body of an unavailable
    built-in by defining a suspiciously similar prototype.
    
    In other words, during linking, we can just pass in NULL.  It will work
    out fine.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0823a87a7520c79708d6990f761b871c41ebffdf
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Aug 30 00:06:30 2013 -0700

    glsl: Add a method to tell whether a built-in is available.
    
    We can simply call the stored predicate function.  If state is NULL,
    just report that the function is available.
    
    v2: Add a comment (requested by Paul Berry).
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d403a105735f2b56e24092b1c25e2d3d108e15bc
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Aug 30 01:07:37 2013 -0700

    glsl: Mark _mesa_glsl_parse_state::is_version() as const.
    
    This promises the method won't modify the contents of the object.
    This allows us to call it even with a const pointer to the state.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4b0bac0dce31ab6c5c36fc35347e6e0e3b2ecc2a
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Aug 30 16:12:55 2013 -0700

    glsl: Convert ir_function_signature::is_builtin to a method.
    
    A signature is a built-in if and only if builtin_info != NULL, so we
    don't actually need a separate flag bit.  Making a boolean-valued
    method allows existing code to ask the same question while not worrying
    about the internal representation.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca321d07fda7d4c550eec985c79bbafb3dfbf570
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Aug 30 16:00:43 2013 -0700

    glsl: Store a predicate for whether a built-in signature is available.
    
    For the upcoming built-in function rewrite, we'll need to be able to
    answer "Is this built-in function signature available?".
    
    This is actually a somewhat complex question, since it depends on the
    language version, GLSL vs. GLSL ES, enabled extensions, and the current
    shader stage.
    
    Storing such a set of constraints in a structure would be painful, so
    instead we store a function pointer.  When creating a signature, we
    simply point to a predicate that inspects _mesa_glsl_parse_state and
    answers whether the signature is available in the current shader.
    
    Unfortunately, IR reader doesn't actually know when built-in functions
    are available, so this patch makes it lie and say that they're always
    present.  This allows us to hook up the new functionality; it just won't
    be useful until real data is populated.  In the meantime, the existing
    profile mechanism ensures built-ins are available in the right places.
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Reviewed-by: Matt Turner <mattst88 at gmail.com>
    Reviewed-by: Paul Berry <stereotype441 at gmail.com>

URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c3db2167c64ecf2366862f15f8e2d4a91f1028c
Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Sep 9 11:11:03 2013 -0700

    i965/vec4: Only zero out unused message components when there are any.
    
    Otherwise, coordinates with four components would result in a MOV
    with a destination writemask that has no channels enabled:
    
    mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };
    
    At best, this is stupid: we emit code that shouldn't do anything.
    Worse, it apparently causes GPU hangs (observable with Chris's
    textureGather test on CubeArrays.)
    
    Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
    Cc: Chris Forbes <chrisf at ijw.co.nz>
    Cc: mesa-stable at lists.freedesktop.org




More information about the mesa-commit mailing list