1. 30 Dec, 2013 1 commit
    • Paul Berry's avatar
      Rename overloads of _mesa_glsl_shader_target_name(). · 26707abe
      Paul Berry authored
      Previously, _mesa_glsl_shader_target_name() had an overload for GLenum
      and an overload for the gl_shader_type enum, each of which behaved
      differently.  However, since GLenum is a synonym for unsigned int, and
      unsigned ints are often used in place of gl_shader_type (e.g. in loop
      indices), there was a big risk of calling the wrong overload by
      mistake.  This patch gives the two overloads different names so that
      it's always clear which one we mean to call.
      Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
      26707abe
  2. 12 Dec, 2013 2 commits
  3. 09 Dec, 2013 3 commits
    • Paul Berry's avatar
      glsl/loops: Get rid of lower_bounded_loops and ir_loop::normative_bound. · 088494aa
      Paul Berry authored
      Now that loop_controls no longer creates normatively bound loops,
      there is no need for ir_loop::normative_bound or the
      lower_bounded_loops pass.
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      088494aa
    • Paul Berry's avatar
      glsl/loops: replace loop controls with a normative bound. · e00b93a1
      Paul Berry authored
      This patch replaces the ir_loop fields "from", "to", "increment",
      "counter", and "cmp" with a single integer ("normative_bound") that
      serves the same purpose.
      
      I've used the name "normative_bound" to emphasize the fact that the
      back-end is required to emit code to prevent the loop from running
      more than normative_bound times.  (By contrast, an "informative" bound
      would be a bound that is informational only).
      Reviewed-by: default avatarJordan Justen <jordan.l.justen@intel.com>
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      e00b93a1
    • Paul Berry's avatar
      glsl/loops: consolidate bounded loop handling into a lowering pass. · 2c17f97f
      Paul Berry authored
      Previously, all of the back-ends (ir_to_mesa, st_glsl_to_tgsi, and the
      i965 fs and vec4 visitors) had nearly identical logic for handling
      bounded loops.  This replaces the duplicate logic with an equivalent
      lowering pass that is used by all the back-ends.
      
      Note: on i965, there is a slight increase in instruction count.  For
      example, a loop like this:
      
          for (int i = 0; i < 100; i++) {
            total += i;
          }
      
      would previously compile down to this (vec4) native code:
      
                mov(8)       g4<1>.xD 0D
                mov(8)       g8<1>.xD 0D
          loop:
                cmp.ge.f0(8) null     g8<4;4,1>.xD 100D
          (+f0) break(8)
                add(8)       g5<1>.xD g5<4;4,1>.xD g4<4;4,1>.xD
                add(8)       g8<1>.xD g8<4;4,1>.xD 1D
                add(8)       g4<1>.xD g4<4;4,1>.xD 1D
                while(8) loop
      
      After this patch, the "(+f0) break(8)" turns into:
      
          (+f0) if(8)
                break(8)
                endif(8)
      
      because the back-end isn't smart enough to recognize that "if
      (condition) break;" can be done using a conditional break instruction.
      However, it should be relatively easy for a future peephole
      optimization to properly optimize this.
      Reviewed-by: default avatarJordan Justen <jordan.l.justen@intel.com>
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      2c17f97f
  4. 22 Nov, 2013 1 commit
  5. 21 Nov, 2013 1 commit
  6. 15 Nov, 2013 2 commits
  7. 29 Oct, 2013 1 commit
  8. 17 Oct, 2013 1 commit
  9. 07 Oct, 2013 3 commits
  10. 03 Oct, 2013 1 commit
  11. 02 Oct, 2013 2 commits
  12. 29 Sep, 2013 1 commit
  13. 21 Sep, 2013 1 commit
  14. 17 Sep, 2013 1 commit
  15. 09 Sep, 2013 2 commits
    • Matt Turner's avatar
      glsl: Add conditional-select IR. · 7aaa3872
      Matt Turner authored
      It's a ?: that operates per-component on vectors. Will be used in
      upcoming lowering pass for ldexp and the implementation of frexp.
      
       csel(selector, a, b):
         per-component result = selector ? a : b
      Reviewed-by: default avatarKenneth Graunke <kenneth@whitecape.org>
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      7aaa3872
    • Kenneth Graunke's avatar
      glsl: Pass _mesa_glsl_parse_state into matching_signature and such. · 3e820e3a
      Kenneth Graunke authored
      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: default avatarKenneth Graunke <kenneth@whitecape.org>
      Reviewed-by: default avatarMatt Turner <mattst88@gmail.com>
      Reviewed-by: default avatarPaul Berry <stereotype441@gmail.com>
      3e820e3a
  16. 27 Aug, 2013 1 commit
  17. 15 Aug, 2013 1 commit
  18. 02 Aug, 2013 2 commits
  19. 30 Jul, 2013 1 commit
  20. 12 Jul, 2013 2 commits
    • Brian Paul's avatar
      tgsi: rename the TGSI fragment kill opcodes · 46205ab8
      Brian Paul authored
      TGSI_OPCODE_KIL and KILP had confusing names.  The former was conditional
      kill (if any src component < 0).  The later was unconditional kill.
      At one time KILP was supposed to work with NV-style condition
      codes/predicates but we never had that in TGSI.
      
      This patch renames both opcodes:
        TGSI_OPCODE_KIL -> KILL_IF   (kill if src.xyzw < 0)
        TGSI_OPCODE_KILP -> KILL     (unconditional kill)
      
      Note: I didn't just transpose the opcode names to help ensure that I
      didn't miss updating any code anywhere.
      
      I believe I've updated all the relevant code and comments but I'm
      not 100% sure that some drivers had this right in the first place.
      For example, the radeon driver might have llvm.AMDGPU.kill and
      llvm.AMDGPU.kilp mixed up.  Driver authors should review their code.
      Reviewed-by: default avatarJose Fonseca <jfonseca@vmware.com>
      46205ab8
    • Brian Paul's avatar
      tgsi: fix-up KILP comments · f501baab
      Brian Paul authored
      KILP is really unconditional fragment kill.
      
      We've had KIL and KILP transposed forever.  I'll fix that next.
      Reviewed-by: default avatarJose Fonseca <jfonseca@vmware.com>
      f501baab
  21. 02 Jul, 2013 1 commit
  22. 21 Jun, 2013 2 commits
  23. 12 Jun, 2013 1 commit
  24. 24 May, 2013 1 commit
  25. 17 May, 2013 1 commit
    • Roland Scheidegger's avatar
      st/mesa: fix weird UCMP opcode use for bool ubo load · 0346e9b3
      Roland Scheidegger authored
      I don't know what this code was trying to do but whatever it was it couldn't
      have worked since negation of integer boolean inputs while not specified as
      outright illegal (not yet at least) won't do anything since it doesn't affect
      the result of comparison with zero at all. In fact it looks like the whole
      instruction can just be omitted.
      Reviewed-by: default avatarMarek Olšák <maraeo@gmail.com>
      0346e9b3
  26. 13 May, 2013 1 commit
    • Ian Romanick's avatar
      glsl: Add lowering pass for ir_triop_vector_insert · ee7a6dad
      Ian Romanick authored
      This will eventually replace do_vec_index_to_cond_assign.  This lowering
      pass is called in all the places where do_vec_index_to_cond_assign or
      do_vec_index_to_swizzle is called.
      
      v2: Use WRITEMASK_* instead of integer literals.  Use a more concise
      method of generating broadcast_index.  Both suggested by Eric.
      
      v3: Use a series of scalar compares instead of a single vector compare.
      Suggested by Eric and Ken.  It still uses 'if (cond) v.x = y;' instead
      of conditional assignments because ir_builder doesn't do conditional
      assignments, and I'd rather keep the code simple.
      Signed-off-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Reviewed-by: default avatarKenneth Graunke <kenneth@whitecape.org>
      ee7a6dad
  27. 12 May, 2013 1 commit
  28. 11 May, 2013 1 commit
  29. 08 May, 2013 1 commit