mesa.git
7 years agoradv/ac: copy llvm machine feature flags from radeonsi.
Dave Airlie [Sun, 23 Apr 2017 19:21:29 +0000 (20:21 +0100)]
radv/ac: copy llvm machine feature flags from radeonsi.

This just updates this to use the same flags as radeonsi
for consistency.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoi965: remove now unused GLSL IR optimisations
Timothy Arceri [Mon, 17 Apr 2017 23:30:47 +0000 (09:30 +1000)]
i965: remove now unused GLSL IR optimisations

These are no longer used since the previous commit.

Acked-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: remove GLSL IR optimisation loop
Timothy Arceri [Tue, 17 Jan 2017 23:28:22 +0000 (10:28 +1100)]
i965: remove GLSL IR optimisation loop

IVB is running into some spilling issues in piglit with the
loop removed. However those tests are not really reflective
of a real world use case, also fp64 is brand new to IVB
so we leave the spilling issues to be resolved at a later
time.

Run time for shader-db on my machine goes from ~795 seconds to
~665 seconds.

shader-db results BDW:

total instructions in shared programs: 12969459 -> 12968891 (-0.00%)
instructions in affected programs: 1463154 -> 1462586 (-0.04%)
helped: 3622
HURT: 3326

total cycles in shared programs: 246453572 -> 246504318 (0.02%)
cycles in affected programs: 208842622 -> 208893368 (0.02%)
helped: 24029
HURT: 35407

total loops in shared programs: 2931 -> 2931 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 14560 -> 14498 (-0.43%)
spills in affected programs: 2270 -> 2208 (-2.73%)
helped: 17
HURT: 2

total fills in shared programs: 19671 -> 19632 (-0.20%)
fills in affected programs: 2060 -> 2021 (-1.89%)
helped: 17
HURT: 2

LOST:   17
GAINED: 40

Most of the hurt shaders are 1-2 instructions, with what looks like a max of 7.

I've looked at the worst cycles regressions and as far as I can tell its just
a scheduling difference.

Acked-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoglsl: use ARB_enhahnced_layouts for packing where possible
Timothy Arceri [Sun, 31 Jul 2016 12:39:26 +0000 (22:39 +1000)]
glsl: use ARB_enhahnced_layouts for packing where possible

If packing doesn't cross locations we can easily make use of
ARB_enhanced_layouts to do packing rather than using the GLSL IR
lowering pass lower_packed_varyings().

Shader-db Broadwell results:

total instructions in shared programs: 12977822 -> 12977819 (-0.00%)
instructions in affected programs: 1871 -> 1868 (-0.16%)
helped: 4
HURT: 3

total cycles in shared programs: 246567288 -> 246567668 (0.00%)
cycles in affected programs: 1370386 -> 1370766 (0.03%)
helped: 592
HURT: 733

Acked-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoglsl: disable varying packing for varying used by interpolateAt*
Timothy Arceri [Fri, 14 Apr 2017 06:25:58 +0000 (16:25 +1000)]
glsl: disable varying packing for varying used by interpolateAt*

Currently the NIR backends depend on GLSL IR copy propagation to
fix up the interpolateAt* function params after varying packing
changes the shader input to a global. It's possible copy propagation
might not always do what we need it too, and we also shouldn't
depend on optimisations to do this type of thing for us.

I'm not sure if the same is true for TGSI, but the following
commit should re-enable packing for most cases in a safer way,
so we just disable it everywhere.

No change in shader-db for i965 (BDW)

Acked-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoglsl_to_nir: skip ir_var_shader_shared variables
Timothy Arceri [Wed, 18 Jan 2017 23:41:57 +0000 (10:41 +1100)]
glsl_to_nir: skip ir_var_shader_shared variables

These should be lowered away in GLSL IR but if we don't get dead
code to clean them up it causes issues in glsl_to_nir.

We wan't to drop as many GLSL IR opts in future as we can so this
makes glsl_to_nir just ignore the vars if it sees them.

In future we will want to just use the nir lowering pass that
Vulkan currently uses.

Acked-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agonir/i965: add before ffma algebraic opts
Timothy Arceri [Fri, 13 Jan 2017 06:25:11 +0000 (17:25 +1100)]
nir/i965: add before ffma algebraic opts

This shuffles constants down in the reverse of what the previous
patch does and applies some simpilifications that may be made
possible from doing so.

Shader-db results BDW:

total instructions in shared programs: 12980814 -> 12977822 (-0.02%)
instructions in affected programs: 281889 -> 278897 (-1.06%)
helped: 1231
HURT: 128

total cycles in shared programs: 246562852 -> 246567288 (0.00%)
cycles in affected programs: 11271524 -> 11275960 (0.04%)
helped: 1630
HURT: 1378

V2: mark float opts as inexact

Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agonir: shuffle constants to the top
Timothy Arceri [Thu, 12 Jan 2017 02:10:55 +0000 (13:10 +1100)]
nir: shuffle constants to the top

V2: mark float opts as inexact

If one of the inputs to an mul/add is the result of another
mul/add there is a chance that we can reuse the result of that
mul/add in other calls if we do the multiplication in the right
order.

Also by attempting to move all constants to the top we increase
the chance of constant folding.

For example it is a fairly common pattern for shaders to do something
similar to this:

  const float a = 0.5;
  in vec4 b;
  in float c;

  ...

  b.x = b.x * c;
  b.y = b.y * c;

  ...

  b.x = b.x * a + a;
  b.y = b.y * a + a;

So by simply detecting that constant a is part of the multiplication
in ffma and switching it with previous fmul that updates b we end up
with:

  ...

  c = a * c;

  ...

  b.x = b.x * c + a;
  b.y = b.y * c + a;

Shader-db results BDW:

total instructions in shared programs: 13011050 -> 12967888 (-0.33%)
instructions in affected programs: 4118366 -> 4075204 (-1.05%)
helped: 17739
HURT: 1343

total cycles in shared programs: 246717952 -> 246410716 (-0.12%)
cycles in affected programs: 166870802 -> 166563566 (-0.18%)
helped: 18493
HURT: 7965

total spills in shared programs: 14937 -> 14560 (-2.52%)
spills in affected programs: 9331 -> 8954 (-4.04%)
helped: 284
HURT: 33

total fills in shared programs: 20211 -> 19671 (-2.67%)
fills in affected programs: 12586 -> 12046 (-4.29%)
helped: 286
HURT: 33

LOST:   39
GAINED: 33

Some of the hurt will go away when we shuffle things back down to the
bottom in the following patch. It's also noteworthy that almost all of the
spill changes are in Deus Ex both hurt and helped.

Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agonir: add flt comparision simplification
Timothy Arceri [Thu, 12 Jan 2017 06:01:03 +0000 (17:01 +1100)]
nir: add flt comparision simplification

Didn't turn out as useful as I'd hoped, but it will help alot more on
i965 by reducing regressions when we drop brw_do_channel_expressions()
and brw_do_vector_splitting().

I'm not sure how much sense 'is_not_used_by_conditional' makes on
platforms other than i965 but since this is a new opt it at least
won't do any harm.

shader-db BDW:

total instructions in shared programs: 13029581 -> 13029415 (-0.00%)
instructions in affected programs: 15268 -> 15102 (-1.09%)
helped: 86
HURT: 0

total cycles in shared programs: 247038346 -> 247036198 (-0.00%)
cycles in affected programs: 692634 -> 690486 (-0.31%)
helped: 183
HURT: 27

Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoradv: Enable lowering fdiv in nir.
Bas Nieuwenhuizen [Sat, 22 Apr 2017 23:31:05 +0000 (01:31 +0200)]
radv: Enable lowering fdiv in nir.

Results in faster code than the lowering by LLVM.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agofreedreno/a5xx: hack for r8g8b8a8_snorm
Rob Clark [Sun, 23 Apr 2017 16:40:15 +0000 (12:40 -0400)]
freedreno/a5xx: hack for r8g8b8a8_snorm

Blob won't render to this format, and sampling from it it uses the same
fmt value for r8g8b8_snorm and r8g8b8a8_snorm.  But this is what is what
blocks us from jumping from gl30/gles20 to gl31/gles30.  So a hack it
is!

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno/a5xx: rgtc formats
Rob Clark [Sun, 23 Apr 2017 16:45:23 +0000 (12:45 -0400)]
freedreno/a5xx: rgtc formats

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agomesa: replace _mesa_index_buffer::type with index_size
Marek Olšák [Sun, 2 Apr 2017 17:07:49 +0000 (19:07 +0200)]
mesa: replace _mesa_index_buffer::type with index_size

This avoids repeated translations of the enum.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoradv: Use the correct pipeline for dispatches.
Bas Nieuwenhuizen [Sat, 22 Apr 2017 16:42:20 +0000 (18:42 +0200)]
radv: Use the correct pipeline for dispatches.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: ec15e0d30 "radv: optimise compute shader grid size emission."
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoetnaviv: Supertiled texture support on gc3000
Wladimir J. van der Laan [Tue, 18 Apr 2017 11:34:50 +0000 (13:34 +0200)]
etnaviv: Supertiled texture support on gc3000

Support supertiled textures on hardware that has the appropriate
feature flag SUPERTILED_TEXTURE.

Most of the scaffolding was already in place in etna_layout_multiple:

   case ETNA_LAYOUT_SUPER_TILED:
      *paddingX = 64;
      *paddingY = 64;
      *halign = TEXTURE_HALIGN_SUPER_TILED;

So this is just a matter of allowing it.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: etnaviv_fence: Simplify the return code logic
Fabio Estevam [Mon, 17 Apr 2017 22:36:40 +0000 (19:36 -0300)]
etnaviv: etnaviv_fence: Simplify the return code logic

The return code can be simplified by using the logical not operator.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agofreedreno/a5xx: occlusion query
Rob Clark [Fri, 21 Apr 2017 21:48:42 +0000 (17:48 -0400)]
freedreno/a5xx: occlusion query

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: drop ring arg from _set_stage()
Rob Clark [Fri, 21 Apr 2017 20:26:49 +0000 (16:26 -0400)]
freedreno: drop ring arg from _set_stage()

It is always the draw ring.  Except for a5xx queries like time-elapsed,
where we will eventually want to emit cmds into both binning and draw
rings.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: update generated headers
Rob Clark [Fri, 21 Apr 2017 20:08:58 +0000 (16:08 -0400)]
freedreno: update generated headers

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: add support for hw accumulating queries
Rob Clark [Fri, 21 Apr 2017 19:30:33 +0000 (15:30 -0400)]
freedreno: add support for hw accumulating queries

Some queries on a4xx and all queries on a5xx can do result accumulation
on CP so we don't need to track per-tile samples.  We do still need to
handle pausing/resuming while switching batches (in case the query is
active over multiple draws which are executed out of order).

So introduce new accumulated-query helpers for these sorts of queries,
since it doesn't really fit in cleanly with the original query infra-
structure.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: a bit of query refactor
Rob Clark [Fri, 21 Apr 2017 15:31:20 +0000 (11:31 -0400)]
freedreno: a bit of query refactor

Move a bit more of the logic shared by all query types (active tracking,
etc) into common code.  This avoids introducing a 3rd copy of that logic
for a5xx.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: make hw-query a helper
Rob Clark [Fri, 21 Apr 2017 13:50:30 +0000 (09:50 -0400)]
freedreno: make hw-query a helper

For a5xx (and actually some queries on a4xx) we can accumulate results
in the cmdstream, so we don't need this elaborate mechanism of tracking
per-tile query results.  So make it into vfuncs so generation specific
backend can use it when it makes sense.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agoi965/vec4: Avoid reswizzling MACH instructions in opt_register_coalesce().
Kenneth Graunke [Fri, 21 Apr 2017 08:28:13 +0000 (01:28 -0700)]
i965/vec4: Avoid reswizzling MACH instructions in opt_register_coalesce().

opt_register_coalesce() was optimizing sequences such as:

   mul(8) acc0:D, attr18.xyyy:D, attr19.xyyy:D
   mach(8) vgrf5.xy:D, attr18.xyyy:D, attr19.xyyy:D
   mov(8) m4.zw:F, vgrf5.xxxy:F

into:

   mul(8) acc0:D, attr18.xyyy:D, attr19.xyyy:D
   mach(8) m4.zw:D, attr18.xxxy:D, attr19.xxxy:D

This doesn't work - if we're going to reswizzle MACH, we'd need to
reswizzle the MUL as well.  Here, the MUL fills the accumulator's .zw
components with attr18.yy * attr19.yy.  But the MACH instruction expects
.z to contain attr18.x * attr19.x.  Bogus results ensue.

No change in shader-db on Haswell.  Prevents regressions in Timothy's
patches to use enhanced layouts for varying packing (which rearrange
code just enough to trigger this pre-existing bug, but were fine
themselves).

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agomesa: validate sampler type across the whole program
Timothy Arceri [Fri, 21 Apr 2017 07:04:10 +0000 (17:04 +1000)]
mesa: validate sampler type across the whole program

Currently we were only making sure types were the same within a
single stage. This looks to have regressed with 953a0af8e3f73.

Fixes: 953a0af8e3f73 ("mesa: validate sampler uniforms during gluniform calls")
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
https://bugs.freedesktop.org/show_bug.cgi?id=97524

7 years agomesa: don't lock hashtables that are not shared across contexts
Timothy Arceri [Fri, 7 Apr 2017 01:40:40 +0000 (11:40 +1000)]
mesa: don't lock hashtables that are not shared across contexts

From Chapter 5 'Shared Objects and Multiple Contexts' of
the OpenGL 4.5 spec:

   "Objects which contain references to other objects include
   framebuffer, program pipeline, query, transform feedback,
   and vertex array objects.   Such objects are called container
   objects and are not shared"

For we leave locking in place for framebuffer objects because
the EXT fbo extension allowed sharing.

We could maybe just replace the hash with an ordinary hash table
but for now this should remove most of the unnecessary locking.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: Remove deleteFlag pattern from container objects.
Matt Turner [Wed, 5 Apr 2017 04:29:00 +0000 (14:29 +1000)]
mesa: Remove deleteFlag pattern from container objects.

This pattern was only useful when we used mutex locks, which the previous
commit removed.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: Remove unnecessary locking from container objects.
Matt Turner [Fri, 21 Apr 2017 03:48:38 +0000 (13:48 +1000)]
mesa: Remove unnecessary locking from container objects.

From Chapter 5 'Shared Objects and Multiple Contexts' of
the OpenGL 4.5 spec:

   "Objects which contain references to other objects include
   framebuffer, program pipeline, query, transform feedback,
   and vertex array objects.   Such objects are called container
   objects and are not shared"

For we leave locking in place for framebuffer objects because
the EXT fbo extension allowed sharing.

V2: (Timothy Arceri)
 - rebased and dropped changes to framebuffer objects

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agomesa: remove fallback RefCount == 0 pattern
Timothy Arceri [Fri, 21 Apr 2017 03:29:46 +0000 (13:29 +1000)]
mesa: remove fallback RefCount == 0 pattern

We should never get here if this is 0 unless there is a
bug. Replace the check with an assert.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agoegl: add gitignore
Elie TOURNIER [Fri, 21 Apr 2017 16:20:05 +0000 (17:20 +0100)]
egl: add gitignore

Since commit ce562f9e3fa, two new files are generated.
We don't want to track them.

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoglsl: make use of glsl_type::is_float()
Samuel Pitoiset [Fri, 21 Apr 2017 09:18:50 +0000 (11:18 +0200)]
glsl: make use of glsl_type::is_float()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: make use of glsl_type::is_double()
Samuel Pitoiset [Fri, 21 Apr 2017 08:53:32 +0000 (10:53 +0200)]
glsl: make use of glsl_type::is_double()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: make use of glsl_type::is_integer_64()
Samuel Pitoiset [Fri, 21 Apr 2017 08:46:24 +0000 (10:46 +0200)]
glsl: make use of glsl_type::is_integer_64()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: simplify glsl_type::is_integer_32_64()
Samuel Pitoiset [Fri, 21 Apr 2017 08:42:12 +0000 (10:42 +0200)]
glsl: simplify glsl_type::is_integer_32_64()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: add glsl_type::is_integer_64()
Samuel Pitoiset [Fri, 21 Apr 2017 08:41:13 +0000 (10:41 +0200)]
glsl: add glsl_type::is_integer_64()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: make use of glsl_type::is_boolean()
Samuel Pitoiset [Fri, 21 Apr 2017 08:36:05 +0000 (10:36 +0200)]
glsl: make use of glsl_type::is_boolean()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: make use of glsl_type::is_record()
Samuel Pitoiset [Fri, 21 Apr 2017 08:32:39 +0000 (10:32 +0200)]
glsl: make use of glsl_type::is_record()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: make use of glsl_type::is_interface()
Samuel Pitoiset [Fri, 21 Apr 2017 08:28:58 +0000 (10:28 +0200)]
glsl: make use of glsl_type::is_interface()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: make use of glsl_type::is_array()
Samuel Pitoiset [Fri, 21 Apr 2017 08:25:42 +0000 (10:25 +0200)]
glsl: make use of glsl_type::is_array()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: make use glsl_type::is_atomic_uint()
Samuel Pitoiset [Fri, 21 Apr 2017 08:16:58 +0000 (10:16 +0200)]
glsl: make use glsl_type::is_atomic_uint()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agoglsl: add glsl_type::is_atomic_uint() helper
Samuel Pitoiset [Fri, 21 Apr 2017 08:13:49 +0000 (10:13 +0200)]
glsl: add glsl_type::is_atomic_uint() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agomesa/glthread: correctly compare thread handles
Emil Velikov [Thu, 20 Apr 2017 15:24:08 +0000 (16:24 +0100)]
mesa/glthread: correctly compare thread handles

As mentioned in the manual - comparing pthread_t handles via the C
comparison operator is incorrect and pthread_equal() should be used
instead.

Cc: Timothy Arceri <tarceri@itsqueeze.com>
Fixes: d8d81fbc316 ("mesa: Add infrastructure for a worker thread to process GL commands.")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agost/clover: add space between < and ::
Emil Velikov [Wed, 19 Apr 2017 10:35:10 +0000 (11:35 +0100)]
st/clover: add space between < and ::

As pointed out by compiler

./llvm/codegen.hpp:52:22: error: ‘<::’ cannot begin a template-argument list [-fpermissive]
./llvm/codegen.hpp:52:22: note: ‘<:’ is an alternate spelling for ‘[’. Insert whitespace between ‘<’ and ‘::’

Cc: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
7 years agoglsl: get rid of values_for_type()
Samuel Pitoiset [Thu, 20 Apr 2017 17:02:28 +0000 (19:02 +0200)]
glsl: get rid of values_for_type()

This function is actually a wrapper for component_slots()
and it always returns 1 (or N) for samplers. Since
component_slots() now return 1 for samplers, it can go.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoglsl: make component_slots() returns 1 for sampler types
Samuel Pitoiset [Thu, 20 Apr 2017 17:02:27 +0000 (19:02 +0200)]
glsl: make component_slots() returns 1 for sampler types

It looks inconsistent to return 1 for image types and 0 for
sampler types. Especially because component_slots() is mostly
used by values_for_type() which always returns 1 for samplers.

For bindless, this value will be bumped to 2 because the
ARB_bindless_texture states that bindless samplers/images
should consume two components.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agodocs/features: mark KHR_no_error as started
Kai Wasserbäch [Thu, 20 Apr 2017 10:21:02 +0000 (12:21 +0200)]
docs/features: mark KHR_no_error as started

The OpenGL extension KHR_no_error is exposed since commit
d42d150ad26e29d9e894ba9f9e28f8134e2e5393 by Timothy Arceri. Therefore it
should be marked as "started" in the features.txt

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoRevert "android: fix segfault within swap_buffers"
Tapani Pälli [Fri, 21 Apr 2017 07:00:21 +0000 (10:00 +0300)]
Revert "android: fix segfault within swap_buffers"

This reverts commit 4d4558411db166d2d66f8cec9cb581149dbe1597.

This was a wrong call, while it fixed issue with 3DMark it
actually introduced regression elsewhere.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
7 years agonvc0: Add support for setting viewport index/layer from VS/TES
Ilia Mirkin [Wed, 19 Apr 2017 22:38:02 +0000 (18:38 -0400)]
nvc0: Add support for setting viewport index/layer from VS/TES

This enables support on GM200+ for:
 - GL_AMD_vertex_shader_layer
 - GL_AMD_vertex_shader_layer_viewport_index
 - GL_ARB_shader_viewport_layer_array

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
[lyude: add relnotes/TES cap]
Signed-off-by: Lyude <lyude@redhat.com>
[imirkin: move relnotes to right place, add features.txt]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agonvc0/ir: Only store viewport in scratch register for GP
Lyude [Wed, 19 Apr 2017 22:38:01 +0000 (18:38 -0400)]
nvc0/ir: Only store viewport in scratch register for GP

EMIT only applies to geometry shaders. For everything else, we want to
export the viewport normally.

Signed-off-by: Lyude <lyude@redhat.com>
Reviewed-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agoradv: Prefetch compute shader too.
Bas Nieuwenhuizen [Thu, 20 Apr 2017 20:03:15 +0000 (22:03 +0200)]
radv: Prefetch compute shader too.

For consistency, doesn't really impact performance.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoanv/query: Use genxml for MI_MATH
Jason Ekstrand [Thu, 20 Apr 2017 00:16:49 +0000 (17:16 -0700)]
anv/query: Use genxml for MI_MATH

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed by: Iago Toral Quiroga <itoral@igalia.com>

7 years agogenxml: Add better support for MI_MATH
Jason Ekstrand [Wed, 19 Apr 2017 23:21:08 +0000 (16:21 -0700)]
genxml: Add better support for MI_MATH

This breaks the guts of MI_MATH (the instruction part) out into its own
structure with proper named values.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed by: Iago Toral Quiroga <itoral@igalia.com>

7 years agogenxml/pack: Allow hex values in the XML
Jason Ekstrand [Wed, 19 Apr 2017 23:20:44 +0000 (16:20 -0700)]
genxml/pack: Allow hex values in the XML

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
7 years agoradv/ac: use tex_lz if we can.
Dave Airlie [Thu, 20 Apr 2017 19:53:37 +0000 (20:53 +0100)]
radv/ac: use tex_lz if we can.

Looking at some Talos shaders vs radeonsi, I noticed they use
tex_lz in a few places, so we should be able to as well.

Reviewed-by: Bas Nieuwenhuizen <basni@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agost/mesa: use one big translation table in st_pipe_vertex_format
Marek Olšák [Sun, 9 Apr 2017 20:35:36 +0000 (22:35 +0200)]
st/mesa: use one big translation table in st_pipe_vertex_format

for lower overhead.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agost/mesa: check in advance in st_draw_vbo whether the bitmap cache is empty
Marek Olšák [Sun, 9 Apr 2017 14:48:40 +0000 (16:48 +0200)]
st/mesa: check in advance in st_draw_vbo whether the bitmap cache is empty

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agost/mesa: put the bitmap_cache structure inside st_context
Marek Olšák [Sun, 9 Apr 2017 14:45:00 +0000 (16:45 +0200)]
st/mesa: put the bitmap_cache structure inside st_context

This is nicer on caches, and the next commit will need to access
the structure from a different place.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agost/mesa: inline and optimize st_invalidate_readpix_cache
Marek Olšák [Sun, 9 Apr 2017 14:39:39 +0000 (16:39 +0200)]
st/mesa: inline and optimize st_invalidate_readpix_cache

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agost/mesa: invalidate the readpix cache in st_indirect_draw_vbo
Marek Olšák [Sun, 9 Apr 2017 14:03:59 +0000 (16:03 +0200)]
st/mesa: invalidate the readpix cache in st_indirect_draw_vbo

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agogallium/util: remove util_draw_range_elements helper
Marek Olšák [Sun, 2 Apr 2017 14:33:07 +0000 (16:33 +0200)]
gallium/util: remove util_draw_range_elements helper

min/max_index are typically hints for the u_vbuf module, not the driver.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agogallium: fold u_trim_pipe_prim call from st/mesa to drivers
Marek Olšák [Sun, 9 Apr 2017 13:57:45 +0000 (15:57 +0200)]
gallium: fold u_trim_pipe_prim call from st/mesa to drivers

Most drivers don't need it and shouldn't need it because it can't be used
in some cases (indirect draws, primitive restart, count from streamout).

Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agodocs/envvars: sort INTEL_DEBUG envvar options by name
Samuel Iglesias Gonsálvez [Thu, 20 Apr 2017 12:02:44 +0000 (14:02 +0200)]
docs/envvars: sort INTEL_DEBUG envvar options by name

It helps to find the envvar option you are looking for.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoac: fix build after LLVM 5.0 SVN r300718
Christoph Haag [Thu, 20 Apr 2017 08:34:18 +0000 (10:34 +0200)]
ac: fix build after LLVM 5.0 SVN r300718

v2: previously getWithDereferenceableBytes() exists, but addAttr() doesn't take that type

Signed-off-by: Christoph Haag <haagch+mesadev@frickel.club>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-and-reviewed-by: Mike Lothian <mike@fireburn.co.uk>
7 years agobin/get-{extra,fixes}-pick-list.sh: improve output
Juan A. Suarez Romero [Wed, 5 Apr 2017 18:18:42 +0000 (20:18 +0200)]
bin/get-{extra,fixes}-pick-list.sh: improve output

Show the commit hash and the title in a way that it is easier to copy
and paste in the bin/.cherry-ignore-extra file if we want to ignore
those commits for the future.

v2:
- Use printf instead echo (Eric Engestrom)

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agobin/get-{extra,fixes}-pick-list.sh: add support for ignore list
Juan A. Suarez Romero [Wed, 5 Apr 2017 18:14:22 +0000 (20:14 +0200)]
bin/get-{extra,fixes}-pick-list.sh: add support for ignore list

Both scripts does not use a file with the commits to ignore. So if we
have handled one of the suggested commits and decided we won't pick it,
the scripts will continue suggesting them.

v2:
- Mark the candidates in bin/get-extra-pick-list.sh (Juan A. Suarez)
- Use bin/.cherry-ignore to store rejected patches (Emil)

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomesa: print target string in glBindTexture() error message
Brian Paul [Fri, 14 Apr 2017 18:42:40 +0000 (12:42 -0600)]
mesa: print target string in glBindTexture() error message

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agomesa: fix Windows build error related to getuid()
Brian Paul [Wed, 19 Apr 2017 18:13:36 +0000 (12:13 -0600)]
mesa: fix Windows build error related to getuid()

getuid() and geteuid() are not present on Windows.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agoswr: simd16 vs work
Tim Rowley [Tue, 18 Apr 2017 22:02:56 +0000 (17:02 -0500)]
swr: simd16 vs work

Build VS with alternating output for the current simd16 fe double-pump
of a simd8 shader.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoradv: Set variant code_size when created from the cache.
Bas Nieuwenhuizen [Wed, 19 Apr 2017 22:59:31 +0000 (00:59 +0200)]
radv: Set variant code_size when created from the cache.

Signed-off-by: Bas Nieeuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Add shader prefetch.
Bas Nieuwenhuizen [Wed, 19 Apr 2017 20:32:16 +0000 (22:32 +0200)]
radv: Add shader prefetch.

Gives me approximately a 2% perf increase in bot dota2 & talos.

Having descriptors (both sets and vertex buffers) prefetched
didn't help so I didn't include that.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Remove binding buffer count.
Bas Nieuwenhuizen [Mon, 17 Apr 2017 10:22:02 +0000 (12:22 +0200)]
radv: Remove binding buffer count.

In cases where it is used it is always 1.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Bas Nieuwenhuizen <basni@google.com>
7 years agoradv: Don't try to find gaps for non-freeable descriptors.
Bas Nieuwenhuizen [Tue, 18 Apr 2017 23:08:06 +0000 (01:08 +0200)]
radv: Don't try to find gaps for non-freeable descriptors.

With this we don't have any operations on a pool with non-freeable
descriptors left that have O(#descriptors) complexity.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Bas Nieuwenhuizen <basni@google.com>
7 years agoradv: Use host memory pool for non-freeable descriptors.
Bas Nieuwenhuizen [Mon, 17 Apr 2017 00:14:06 +0000 (02:14 +0200)]
radv: Use host memory pool for non-freeable descriptors.

v2: Handle out of pool memory error.
v3: Actually use VK_ERROR_OUT_OF_POOL_MEMORY_KHR for the error condition.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Bas Nieuwenhuizen <basni@google.com>
7 years agoradv: Don't allocate dynamic descriptors separately.
Bas Nieuwenhuizen [Mon, 17 Apr 2017 09:30:43 +0000 (11:30 +0200)]
radv: Don't allocate dynamic descriptors separately.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Bas Nieuwenhuizen <basni@google.com>
7 years agost/mesa: automake: honour the vdpau header install location
Emil Velikov [Sun, 16 Apr 2017 14:46:28 +0000 (15:46 +0100)]
st/mesa: automake: honour the vdpau header install location

If VDPAU is installed in the non-default location, we'll fail to find
the headers and error at build time.

../../src/gallium/include/state_tracker/vdpau_dmabuf.h:37:25: fatal error: vdpau/vdpau.h: No such file or directory
 #include <vdpau/vdpau.h>
                         ^

Fixes: faba96bc60b ("st/vdpau: add new interop interface")
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agowinsys/sw/dri: don't use GNU void pointer arithmetic
Emil Velikov [Sun, 16 Apr 2017 13:39:03 +0000 (14:39 +0100)]
winsys/sw/dri: don't use GNU void pointer arithmetic

Resolves build issues like the following:

src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
        data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
                               ^
src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:62: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
        data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
                                                              ^

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoconfigure.ac: check require_basic_egl only if egl enabled
Emil Velikov [Sun, 16 Apr 2017 00:46:59 +0000 (01:46 +0100)]
configure.ac: check require_basic_egl only if egl enabled

Fixes: 1ac40173c2a ("configure.ac: simplify EGL requirements for drivers dependent on EGL")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoconfigure.ac: manually expand PKG_CHECK_VAR
Emil Velikov [Tue, 18 Apr 2017 10:33:42 +0000 (11:33 +0100)]
configure.ac: manually expand PKG_CHECK_VAR

The macro is introduced with pkgconfig v0.28 which isn't universally
available. Thus it will error at configure stage.

Reported-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Fixes: ce562f9e3fa ("EGL: Implement the libglvnd interface for EGL (v3)")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomesa: add KHR_no_error support to glVertexAttribDivisor()
Timothy Arceri [Tue, 4 Apr 2017 05:45:06 +0000 (15:45 +1000)]
mesa: add KHR_no_error support to glVertexAttribDivisor()

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/vbo: add KHR_no_error support to DrawElements*() functions
Timothy Arceri [Mon, 3 Apr 2017 05:11:29 +0000 (15:11 +1000)]
mesa/vbo: add KHR_no_error support to DrawElements*() functions

V2: move MESA_VERBOSE checks back into the common code path.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/vbo: add KHR_no_error support to vbo_exec_DrawArrays*()
Timothy Arceri [Fri, 31 Mar 2017 04:38:48 +0000 (15:38 +1100)]
mesa/vbo: add KHR_no_error support to vbo_exec_DrawArrays*()

V2: add missing FLUSH_CURRENT() to no_error path

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/vbo: move some Draw checks out of validation
Timothy Arceri [Mon, 3 Apr 2017 06:38:18 +0000 (16:38 +1000)]
mesa/vbo: move some Draw checks out of validation

These checks do not generate any errors. Move them so we can add
KHR_no_error support and still make sure we do these checks.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/varray: add KHR_no_error support to *Pointer() functions
Timothy Arceri [Mon, 3 Apr 2017 04:37:25 +0000 (14:37 +1000)]
mesa/varray: add KHR_no_error support to *Pointer() functions

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/varray: add KHR_no_error support to some callers of validate_array_format()
Timothy Arceri [Fri, 31 Mar 2017 04:26:34 +0000 (15:26 +1100)]
mesa/varray: add KHR_no_error support to some callers of validate_array_format()

The only caller we don't update is update_arrays(), we leave that to the
following commit.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/varray: rename update_array_format() -> validate_array_format()
Timothy Arceri [Fri, 31 Mar 2017 04:02:40 +0000 (15:02 +1100)]
mesa/varray: rename update_array_format() -> validate_array_format()

We also move _mesa_update_array_format() into the caller.

This gets these functions ready for KHR_no_error support.

V2: Updated function comment as suggested by Brian.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/varray: create get_array_format() helper
Timothy Arceri [Fri, 31 Mar 2017 03:44:59 +0000 (14:44 +1100)]
mesa/varray: create get_array_format() helper

This will help us split array validation from array update.

V2: add const to ctx param

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa/varray: split update_array() into validate_array() and update_array()
Timothy Arceri [Fri, 31 Mar 2017 03:18:35 +0000 (14:18 +1100)]
mesa/varray: split update_array() into validate_array() and update_array()

This will be used for adding KHR_no_error support.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: add KHR_no_error support to glUniform*() functions
Timothy Arceri [Thu, 30 Mar 2017 12:22:46 +0000 (23:22 +1100)]
mesa: add KHR_no_error support to glUniform*() functions

V2: restore lost comment, add static to validate_uniform(),
    simplify array offset logic.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: always return GL_OUT_OF_MEMORY or GL_NO_ERROR when KHR_no_error enabled
Timothy Arceri [Tue, 28 Mar 2017 03:43:23 +0000 (14:43 +1100)]
mesa: always return GL_OUT_OF_MEMORY or GL_NO_ERROR when KHR_no_error enabled

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: add _mesa_is_no_error_enabled() helper
Timothy Arceri [Thu, 30 Mar 2017 12:11:34 +0000 (23:11 +1100)]
mesa: add _mesa_is_no_error_enabled() helper

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: add env var to force enable the KHR_no_error ctx flag
Timothy Arceri [Wed, 12 Apr 2017 05:08:01 +0000 (15:08 +1000)]
mesa: add env var to force enable the KHR_no_error ctx flag

V2: typo know -> known
V3: add security check (Suggested by Nicolai)

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: expose KHR_no_error
Timothy Arceri [Tue, 28 Mar 2017 03:47:58 +0000 (14:47 +1100)]
mesa: expose KHR_no_error

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agor600g: update dirty_level_mask after the 1-st draw after FB change
Constantine Kharlamov [Thu, 13 Apr 2017 20:56:28 +0000 (23:56 +0300)]
r600g: update dirty_level_mask after the 1-st draw after FB change

Ported from radeonsi. Testing with Kane&Lynch2 shows ≈1k skipped updates per
frame on average.

No piglit changes with tests/gpu.py, gbm mode.

Signed-off-by: Constantine Kharlamov <Hi-Angel@yandex.ru>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agovbo: fix gl_DrawID handling in glMultiDrawArrays
Nicolai Hähnle [Fri, 7 Apr 2017 16:24:44 +0000 (18:24 +0200)]
vbo: fix gl_DrawID handling in glMultiDrawArrays

Fixes a bug in
KHR-GL45.shader_draw_parameters_tests.ShaderMultiDrawArraysParameters.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agomesa: move glMultiDrawArrays to vbo and fix error handling
Nicolai Hähnle [Fri, 7 Apr 2017 16:20:34 +0000 (18:20 +0200)]
mesa: move glMultiDrawArrays to vbo and fix error handling

When any count[i] is negative, we must skip all draws.

Moving to vbo makes the subsequent change easier.

v2:
- provide the function in all contexts, including GLES
- adjust validation accordingly to include the xfb check
v3:
- fix mix-up of pre- and post-xfb prim count (Nils Wallménius)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agomesa: extract need_xfb_remaining_prims_check
Nicolai Hähnle [Thu, 13 Apr 2017 19:06:11 +0000 (21:06 +0200)]
mesa: extract need_xfb_remaining_prims_check

The same logic needs to be applied to glMultiDrawArrays.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agomesa: fix remaining xfb prims check for GLES with multiple instances
Nicolai Hähnle [Thu, 13 Apr 2017 18:53:17 +0000 (20:53 +0200)]
mesa: fix remaining xfb prims check for GLES with multiple instances

Found by inspection.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradv/meta: Fix nir_builder.h include
Mike Lothian [Wed, 19 Apr 2017 02:09:05 +0000 (03:09 +0100)]
radv/meta: Fix nir_builder.h include

This fixes the build after:

commit 399ebd2a84a133bd2ca3da388a059fd3bafe33f5
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed Apr 19 06:18:23 2017 +1000

    radv/meta: add common shader vertex generation function

Signed-off-by: Mike Lothian <mike@fireburn.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac: Fix nir.h include
Mike Lothian [Wed, 19 Apr 2017 02:09:04 +0000 (03:09 +0100)]
radv/ac: Fix nir.h include

This fixes the build after:

commit 224cf2906a8f38ce47411afc93a223ac0e41795f
Author: Dave Airlie <airlied@redhat.com>
Date:   Mon Apr 17 13:01:52 2017 +1000

    radv/ac: add initial pre-pass for shader info gathering

Signed-off-by: Mike Lothian <mike@fireburn.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/meta: refactor out some common shaders.
Dave Airlie [Tue, 18 Apr 2017 23:13:06 +0000 (09:13 +1000)]
radv/meta: refactor out some common shaders.

The vs vertex generate and fs noop shaders are used in a few places,
so refactor them out.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/meta: generate position for blit shaders.
Dave Airlie [Tue, 18 Apr 2017 20:40:29 +0000 (06:40 +1000)]
radv/meta: generate position for blit shaders.

This generates the position info using the vertex shader.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>