mesa.git
4 years agoutil: Avoid strict aliasing bugs in xxhash.
Eric Anholt [Fri, 29 May 2020 22:23:51 +0000 (15:23 -0700)]
util: Avoid strict aliasing bugs in xxhash.

XXH32 is doing access through u32 *, and with strict aliasing the compiler
gets to assume that those are independent of the u16 writes we did in
fd6_texture_key setup, and based on various tweaks to the code, would
result in bad hashes computed after inlining.  The failure was:

../src/util/hash_table.c:326:_mesa_hash_table_search_pre_hashed: Assertion
`ht->key_hash_function == ((void *)0) || hash == ht->key_hash_function(key)'
failed.)

By setting these two flags, we always take the unaligned,
memcpy-the-32-bit-data path.  I believe this should be same perf on x86
(which will happily unaligned load 32 bits in the end), while it will be
slower on arm (where you have to a special unaligned load operation iirc).
This should still be far faster than our old hash.

Fixes: edd62619a1c4 ("freedreno: replace fnv1a hash function with xxhash")
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5271>

4 years agodraw/clip: fix viewport index for geometry shaders
Dave Airlie [Thu, 2 Jul 2020 05:37:16 +0000 (15:37 +1000)]
draw/clip: fix viewport index for geometry shaders

The old code updated the viewport index on the first vertex in
a primitive, however it was picking the first vertex wrong
when used with geometry shaders.

This code has access to the prim info with the primitive lengths
so instead keep track of when a new primitive starts by tracking
the lengths and updating the viewport index then. The prim info
is only valid after a GS or prim assembly, so enable prim assembly
if a vertex shader ever uses viewport index.

This fixes:
piglit arb_viewport_array-render-viewport-2
KHR-GLES31.core.viewport_array.draw_to_single_layer_with_multiple_viewports,Fail
KHR-GLES31.core.viewport_array.draw_mulitple_viewports_with_single_invocation,Fail
KHR-GLES31.core.viewport_array.draw_multiple_layers,Fail
KHR-GLES31.core.viewport_array.depth_range,Fail

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5489>

4 years agodraw/clip: cleanup viewport index handling code.
Dave Airlie [Thu, 2 Jul 2020 05:29:32 +0000 (15:29 +1000)]
draw/clip: cleanup viewport index handling code.

This moves code around, and adds initial clamping

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5489>

4 years agoturnip: vsc improvements
Jonathan Marek [Thu, 18 Jun 2020 22:08:58 +0000 (18:08 -0400)]
turnip: vsc improvements

* Remove scratch_bo from cmdbuffer, use a device-global bo instead, which
  also includes border color (and eventually shaders for 3D blit path)
* Use CP_SET_BIN_DATA5_OFFSET to allow setting VSC buffer addresses only
  once at the start of the cmdstream
* Use scratch bo mechanism for a resizable VSC buffer
* Use feedback from "vsc_draw_overflow" and "vsc_prim_overflow" values to
  increase the size of VSC buffer when beginning to record a new cmdbuffer

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5570>

4 years agoturnip: rework render_tiles loop
Jonathan Marek [Fri, 19 Jun 2020 00:51:11 +0000 (20:51 -0400)]
turnip: rework render_tiles loop

Loop through pipes and then loop over the tiles in that pipe instead of
looping over all tiles then having to calculate the pipe # and slot #.

Mainly this avoids the hard to follow "config_get_tile" logic, but should
also be a gain due to better use of cache with the VSC data.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5570>

4 years agoturnip: make tiling config part of framebuffer state
Jonathan Marek [Fri, 19 Jun 2020 00:39:39 +0000 (20:39 -0400)]
turnip: make tiling config part of framebuffer state

Compute the tiling config at framebuffer creation time. A framebuffer will b
be re-used multiple times, so this will avoid having to re-calculate the
tiling config every time a command buffer is recorded.

The tiling config already couldn't use the render area's x1/y1 because of
hw binning, this move makes it so the render area isn't used at all for the
tiling config.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5570>

4 years agoRevert "loader/dri3: Check for window destruction in dri3_wait_for_event_locked"
Michel Dänzer [Thu, 2 Jul 2020 16:49:26 +0000 (18:49 +0200)]
Revert "loader/dri3: Check for window destruction in dri3_wait_for_event_locked"

This reverts commit d7d7687829875e401690219d4a72458fb2bbe4de.

It caused freezes with e.g. kwin_x11 due to hitting the 1s timeout.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3214
Reopens: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5722>

4 years agomeson: Add versioning for xvmc tracker
Emmanuel Vadot [Wed, 1 Jul 2020 09:54:32 +0000 (11:54 +0200)]
meson: Add versioning for xvmc tracker

The xvmc tracker used to be versionned with autotool but this seems to have been
lost in the meson switch.

Fixes: 22a817af8a89eb3c762f ("meson: build gallium xvmc state tracker")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5708>

4 years agost/program: use nir_lower_clip_disable instead of nir_lower_clip_vs conditionally
Mike Blumenkrantz [Wed, 17 Jun 2020 13:40:51 +0000 (09:40 -0400)]
st/program: use nir_lower_clip_disable instead of nir_lower_clip_vs conditionally

if the shader already outputs gl_ClipDistance, nir_lower_clip_vs will create
duplicate variables when what we want is to just change the existing values

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5529>

4 years agonir: add lowering pass for clip plane enabling
Mike Blumenkrantz [Wed, 17 Jun 2020 13:35:46 +0000 (09:35 -0400)]
nir: add lowering pass for clip plane enabling

a pass which rewrites gl_ClipDistance[n] to an undef if the corresponding
clip plane is disabled in the rasterizer state

this pass is needed for zink to handle api disables of clip planes

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5529>

4 years agov3d/tex: handle correctly coordinates for cube/cubearrays images
Alejandro Piñeiro [Fri, 26 Jun 2020 13:32:31 +0000 (15:32 +0200)]
v3d/tex: handle correctly coordinates for cube/cubearrays images

When fetching for cube maps, we need to interpret them as 2d texture
arrays, being the third coordinate the index for the face.

Fixes Vulkan CTS tests like the following using v3dv:

dEQP-VK.binding_model.shader_access.primary_cmd_buf.storage_image.fragment.single_descriptor.cube_base_mip
dEQP-VK.binding_model.shader_access.primary_cmd_buf.storage_image.compute.multiple_descriptor_sets.multiple_contiguous_descriptors.cube_array_base_mip

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5675>

4 years agoCI: reduce bandwidth for git pull
Benjamin Tissoires [Thu, 11 Jun 2020 15:16:28 +0000 (17:16 +0200)]
CI: reduce bandwidth for git pull

Over the last 7 days, git pulls represented a total of 1.7 TB.

On those 1.7 TB, we can see:
- ~300 GB for the CI farm on hetzner
- ~730 GB for the CI farm on packet.net
- ~680 GB for the rest of the world

We can not really change the rest of the world*, but we can
certainly reduce the egress costs towards our CI farms.

Right now, the gitlab runners are not doing a good job at
caching the git trees for the various jobs we make, and
we end up with a lot of cache-misses. A typical pipeline
ends up with a good 2.8GB of git pull data. (a compressed
archive of the mesa folder accounts for 280MB)

In this patch, we implemented what was suggested in
https://gitlab.com/gitlab-org/gitlab/-/issues/215591#note_334642576

- we host a brand new MinIO server on packet
- jobs can upload files on 2 locations:
  * git-cache/<namespace>/<project>/<branch-name>.tar.gz
  * artifacts/<namespace>/<project>/<pipeline-id>/
- the authorization is handled by gitlab with short tokens
  valid only for the time of the job is running
- whenever a job runs, the runner are configured to execute
  (eval) $CI_PRE_CLONE_SCRIPT
- this variable is set globally to download the current cache
  from the MinIO packet server, unpack it and replace the
  possibly out of date cache found on the runner
- then git fetch is run by the runner, and only the delta
  between the upstream tree and the local tree gets pulled.

We can rebuild the git cache in a schedule job (once a day
seems sufficient), and then we can stop the cache miss
entirely.

First results showed that instead of pulling 280MB of data
in my fork, I got a pull of only 250KB. That should help us.

* arguably, there are other farms in the rest of the world, so
hopefully we can change those too.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5428>

4 years agotu,radv: fix potentially wrong offset of flexible array.
Hyunjun Ko [Wed, 1 Jul 2020 03:13:40 +0000 (03:13 +0000)]
tu,radv: fix potentially wrong offset of flexible array.

v2. Remove redundant memset and make the expression simpler.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5703>

4 years agomeson: turn on Wimplicit-fallthrough project wide
Timothy Arceri [Wed, 1 Jul 2020 03:37:14 +0000 (13:37 +1000)]
meson: turn on Wimplicit-fallthrough project wide

This will help avoid coding errors and allows for less warnings
from some static analysis tools.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agonv30: add missing fallthrough comment
Timothy Arceri [Thu, 2 Jul 2020 04:24:14 +0000 (14:24 +1000)]
nv30: add missing fallthrough comment

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agomesa: update fallthrough comment so gcc can see it
Timothy Arceri [Wed, 1 Jul 2020 06:46:28 +0000 (16:46 +1000)]
mesa: update fallthrough comment so gcc can see it

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agosvga: add missing fallthrough comments
Timothy Arceri [Wed, 1 Jul 2020 06:44:07 +0000 (16:44 +1000)]
svga: add missing fallthrough comments

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agor300: add and fix up fallthrough comments
Timothy Arceri [Wed, 1 Jul 2020 06:35:44 +0000 (16:35 +1000)]
r300: add and fix up fallthrough comments

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agomesa: fix unintended fallthrough in glIsEnabled()
Timothy Arceri [Wed, 1 Jul 2020 06:20:17 +0000 (16:20 +1000)]
mesa: fix unintended fallthrough in glIsEnabled()

Fixes: 08fae07f5246 ("mesa: Handle GL_TEXTURE_GEN_STR_OES in _mesa_Enable()")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agomesa: add missing fallthrough comment to teximage.c
Timothy Arceri [Wed, 1 Jul 2020 06:11:28 +0000 (16:11 +1000)]
mesa: add missing fallthrough comment to teximage.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agomesa/vbo: add some missing fallthrough comments
Timothy Arceri [Wed, 1 Jul 2020 06:07:54 +0000 (16:07 +1000)]
mesa/vbo: add some missing fallthrough comments

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agospirv: add missing fallthrough comments
Timothy Arceri [Wed, 1 Jul 2020 05:55:47 +0000 (15:55 +1000)]
spirv: add missing fallthrough comments

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agoradeon: add missing fallthrough comments
Timothy Arceri [Wed, 1 Jul 2020 05:50:11 +0000 (15:50 +1000)]
radeon: add missing fallthrough comments

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agoglsl: move fallthrough comment to where gcc can see it
Timothy Arceri [Wed, 1 Jul 2020 05:40:51 +0000 (15:40 +1000)]
glsl: move fallthrough comment to where gcc can see it

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agoglx: add missing fallthrough comment
Timothy Arceri [Wed, 1 Jul 2020 05:38:48 +0000 (15:38 +1000)]
glx: add missing fallthrough comment

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agoradeonsi: add missing fallthrough comment
Timothy Arceri [Wed, 1 Jul 2020 05:37:02 +0000 (15:37 +1000)]
radeonsi: add missing fallthrough comment

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agomesa: add fallthrough comments to COPY_SZ_4V()
Timothy Arceri [Wed, 1 Jul 2020 05:10:34 +0000 (15:10 +1000)]
mesa: add fallthrough comments to COPY_SZ_4V()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agonir: fix implicit fallthrough warnings
Timothy Arceri [Wed, 1 Jul 2020 05:00:59 +0000 (15:00 +1000)]
nir: fix implicit fallthrough warnings

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agomesa: add fallthrough comments to get.c
Timothy Arceri [Wed, 1 Jul 2020 03:59:41 +0000 (13:59 +1000)]
mesa: add fallthrough comments to get.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agomesa: add fallthrough comments to glformats.c
Timothy Arceri [Wed, 1 Jul 2020 03:49:26 +0000 (13:49 +1000)]
mesa: add fallthrough comments to glformats.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agomesa: fix fallthrough in glformats
Timothy Arceri [Wed, 1 Jul 2020 03:04:25 +0000 (13:04 +1000)]
mesa: fix fallthrough in glformats

Before 908f817918fb this would fallthrough to GL_INVALID_OPERATION
if the validation condition was not met. But since that change it
will now only return GL_INVALID_OPERATION if
!_mesa_has_EXT_texture_compression_bptc(ctx) is true. This seems
unintended.

Here we fix up the fallthrough and add the fallthrough comment so
this doesn't happen again.

Fixes: 908f817918fb ("mesa: expose EXT_texture_compression_bptc in GLES")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3005
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>

4 years agonir/algebraic: Don't distrubte absolute-value into dot-products
Ian Romanick [Sat, 20 Jun 2020 20:48:19 +0000 (13:48 -0700)]
nir/algebraic: Don't distrubte absolute-value into dot-products

Dot product is multiplication followed by addition, and absolute value
does not distribute into addition.

Only vec4 platforms are affected by this change as scalar-only platforms
never have any of the fdot_replicated instructions.  In the shader-db
results, below, shaders in MANY different applications are affected.
Trine, Doom3, Enemy Territory: Quake Wars, Counter Strike: Global
Offensive, Mad Max, Metro Last Light, and on and on...  I'm really
shocked that there were no test regressions!

All Haswell and earlier platforms had similar results. (Haswell shown)
total instructions in shared programs: 16219743 -> 16219820 (<.01%)
instructions in affected programs: 12171 -> 12248 (0.63%)
helped: 1
HURT: 78
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 0.78% max: 0.78% x̄: 0.78% x̃: 0.78%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.35% max: 2.38% x̄: 0.91% x̃: 1.06%
95% mean confidence interval for instructions value: 0.92 1.03
95% mean confidence interval for instructions %-change: 0.78% 1.00%
Instructions are HURT.

total cycles in shared programs: 538481383 -> 538491045 (<.01%)
cycles in affected programs: 470796 -> 480458 (2.05%)
helped: 149
HURT: 142
helped stats (abs) min: 1 max: 1338 x̄: 71.13 x̃: 4
helped stats (rel) min: 0.06% max: 40.99% x̄: 2.76% x̃: 0.67%
HURT stats (abs)   min: 1 max: 2092 x̄: 142.68 x̃: 12
HURT stats (rel)   min: 0.07% max: 55.38% x̄: 5.07% x̃: 1.07%
95% mean confidence interval for cycles value: -5.28 71.69
95% mean confidence interval for cycles %-change: -0.07% 2.19%
Inconclusive result (value mean confidence interval includes 0).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 62795475e8f ("nir/algebraic: Distribute source modifiers into instructions")
Closes: #3129
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5581>

4 years agoci: Disable pixmark-piano trace on a630 due to GPU hangs.
Eric Anholt [Fri, 26 Jun 2020 17:14:41 +0000 (10:14 -0700)]
ci: Disable pixmark-piano trace on a630 due to GPU hangs.

I haven't reproduced it with just this trace in a loop locally, but it's
blocked some CI jobs with hangs where a few tiles didn't get
rendered.  For example:

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/3314062

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5667>

4 years agopan/mdg: Schedule based on liveness
Alyssa Rosenzweig [Tue, 16 Jun 2020 23:06:21 +0000 (19:06 -0400)]
pan/mdg: Schedule based on liveness

By estimating liveness in the scheduler and choosing instructions likely
to reduce register pressure, on average we can decrease pressure given a
sufficiently larger window. On the other hand, decreasing pressure
instead of leaning too heavily on the search window enables us to use a
much larger search window without inflating pressure too much. So by
doing both in lockstep, we benefit pretty well.

total instructions in shared programs: 49458 -> 48540 (-1.86%)
instructions in affected programs: 26931 -> 26013 (-3.41%)
helped: 221
HURT: 15
helped stats (abs) min: 1 max: 36 x̄: 4.37 x̃: 2
helped stats (rel) min: 0.31% max: 16.90% x̄: 4.97% x̃: 3.85%
HURT stats (abs)   min: 1 max: 4 x̄: 3.13 x̃: 3
HURT stats (rel)   min: 0.50% max: 7.14% x̄: 4.53% x̃: 4.55%
95% mean confidence interval for instructions value: -4.65 -3.13
95% mean confidence interval for instructions %-change: -4.94% -3.81%
Instructions are helped.

total bundles in shared programs: 25199 -> 23446 (-6.96%)
bundles in affected programs: 21600 -> 19847 (-8.12%)
helped: 277
HURT: 170
helped stats (abs) min: 1 max: 45 x̄: 7.33 x̃: 6
helped stats (rel) min: 1.06% max: 33.83% x̄: 11.01% x̃: 8.57%
HURT stats (abs)   min: 1 max: 6 x̄: 1.63 x̃: 1
HURT stats (rel)   min: 1.19% max: 40.00% x̄: 13.36% x̃: 11.11%
95% mean confidence interval for bundles value: -4.61 -3.23
95% mean confidence interval for bundles %-change: -3.00% -0.49%
Bundles are helped.

total quadwords in shared programs: 40269 -> 39652 (-1.53%)
quadwords in affected programs: 35881 -> 35264 (-1.72%)
helped: 242
HURT: 244
helped stats (abs) min: 1 max: 36 x̄: 4.61 x̃: 3
helped stats (rel) min: 0.39% max: 16.33% x̄: 5.33% x̃: 5.13%
HURT stats (abs)   min: 1 max: 20 x̄: 2.04 x̃: 1
HURT stats (rel)   min: 0.81% max: 21.74% x̄: 7.57% x̃: 6.25%
95% mean confidence interval for quadwords value: -1.71 -0.83
95% mean confidence interval for quadwords %-change: 0.46% 1.82%
Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

total registers in shared programs: 3786 -> 3336 (-11.89%)
registers in affected programs: 2161 -> 1711 (-20.82%)
helped: 262
HURT: 35
helped stats (abs) min: 1 max: 7 x̄: 1.87 x̃: 1
helped stats (rel) min: 6.25% max: 66.67% x̄: 28.91% x̃: 25.00%
HURT stats (abs)   min: 1 max: 3 x̄: 1.11 x̃: 1
HURT stats (rel)   min: 7.69% max: 100.00% x̄: 19.76% x̃: 12.50%
95% mean confidence interval for registers value: -1.70 -1.33
95% mean confidence interval for registers %-change: -25.56% -20.79%
Registers are helped.

total threads in shared programs: 2453 -> 2592 (5.67%)
threads in affected programs: 160 -> 299 (86.87%)
helped: 79
HURT: 6
helped stats (abs) min: 1 max: 2 x̄: 1.85 x̃: 2
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1 max: 2 x̄: 1.17 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: 1.45 1.82
95% mean confidence interval for threads %-change: 81.08% 97.75%
Threads are [helped].

total spills in shared programs: 168 -> 17 (-89.88%)
spills in affected programs: 167 -> 16 (-90.42%)
helped: 13
HURT: 0

total fills in shared programs: 186 -> 35 (-81.18%)
fills in affected programs: 186 -> 35 (-81.18%)
helped: 14

HURT: 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Vectorize vlut operations
Icecream95 [Sat, 23 May 2020 12:23:25 +0000 (00:23 +1200)]
pan/mdg: Vectorize vlut operations

total instructions in shared programs: 49462 -> 49458 (<.01%)
instructions in affected programs: 348 -> 344 (-1.15%)
helped: 2
HURT: 0

total bundles in shared programs: 25201 -> 25199 (<.01%)
bundles in affected programs: 142 -> 140 (-1.41%)
helped: 2
HURT: 0

total quadwords in shared programs: 40273 -> 40269 (<.01%)
quadwords in affected programs: 244 -> 240 (-1.64%)
helped: 2
HURT: 0

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Skip r1.w write where possible
Alyssa Rosenzweig [Tue, 16 Jun 2020 16:30:28 +0000 (12:30 -0400)]
pan/mdg: Skip r1.w write where possible

Should help cycle count. Register pressure is spurious here.

total instructions in shared programs: 50501 -> 49517 (-1.95%)
instructions in affected programs: 33342 -> 32358 (-2.95%)
helped: 393
HURT: 0
helped stats (abs) min: 2 max: 3 x̄: 2.50 x̃: 3
helped stats (rel) min: 0.26% max: 33.33% x̄: 11.99% x̃: 9.09%
95% mean confidence interval for instructions value: -2.55 -2.45
95% mean confidence interval for instructions %-change: -13.01% -10.97%
Instructions are helped.

total bundles in shared programs: 25511 -> 25309 (-0.79%)
bundles in affected programs: 7778 -> 7576 (-2.60%)
helped: 202
HURT: 0
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 0.43% max: 20.00% x̄: 5.97% x̃: 4.35%
95% mean confidence interval for bundles value: -1.00 -1.00
95% mean confidence interval for bundles %-change: -6.65% -5.28%
Bundles are helped.

total quadwords in shared programs: 40789 -> 40339 (-1.10%)
quadwords in affected programs: 25453 -> 25003 (-1.77%)
helped: 273
HURT: 0
helped stats (abs) min: 1 max: 3 x̄: 1.65 x̃: 2
helped stats (rel) min: 0.16% max: 22.22% x̄: 5.99% x̃: 3.92%
95% mean confidence interval for quadwords value: -1.71 -1.59
95% mean confidence interval for quadwords %-change: -6.68% -5.30%
Quadwords are helped.

total registers in shared programs: 3911 -> 3784 (-3.25%)
registers in affected programs: 275 -> 148 (-46.18%)
helped: 129
HURT: 2
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 14.29% max: 50.00% x̄: 48.69% x̃: 50.00%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for registers value: -1.01 -0.93
95% mean confidence interval for registers %-change: -49.45% -44.91%
Registers are helped.

total threads in shared programs: 2455 -> 2455 (0.00%)
threads in affected programs: 0 -> 0
helped: 0

HURT: 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Prioritize non-moves on VADD/VLUT
Alyssa Rosenzweig [Thu, 2 Jul 2020 17:13:00 +0000 (13:13 -0400)]
pan/mdg: Prioritize non-moves on VADD/VLUT

This helps reduce ALU cycle count.

total instructions in shared programs: 50507 -> 50501 (-0.01%)
instructions in affected programs: 487 -> 481 (-1.23%)
helped: 7
HURT: 3
helped stats (abs) min: 1 max: 2 x̄: 1.29 x̃: 1
helped stats (rel) min: 1.01% max: 8.33% x̄: 4.11% x̃: 4.35%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 1.54% max: 4.35% x̄: 2.80% x̃: 2.50%
95% mean confidence interval for instructions value: -1.44 0.24
95% mean confidence interval for instructions %-change: -5.12% 1.04%
Inconclusive result (value mean confidence interval includes 0).

total bundles in shared programs: 25640 -> 25511 (-0.50%)
bundles in affected programs: 5879 -> 5750 (-2.19%)
helped: 67
HURT: 7
helped stats (abs) min: 1 max: 16 x̄: 2.04 x̃: 1
helped stats (rel) min: 0.63% max: 18.18% x̄: 4.11% x̃: 2.12%
HURT stats (abs)   min: 1 max: 2 x̄: 1.14 x̃: 1
HURT stats (rel)   min: 1.75% max: 14.29% x̄: 5.42% x̃: 3.70%
95% mean confidence interval for bundles value: -2.29 -1.20
95% mean confidence interval for bundles %-change: -4.41% -2.00%
Bundles are helped.

total quadwords in shared programs: 40899 -> 40789 (-0.27%)
quadwords in affected programs: 11438 -> 11328 (-0.96%)
helped: 70
HURT: 26
helped stats (abs) min: 1 max: 8 x̄: 2.17 x̃: 1
helped stats (rel) min: 0.42% max: 9.76% x̄: 3.29% x̃: 2.56%
HURT stats (abs)   min: 1 max: 5 x̄: 1.62 x̃: 1
HURT stats (rel)   min: 0.48% max: 9.68% x̄: 3.58% x̃: 1.99%
95% mean confidence interval for quadwords value: -1.60 -0.69
95% mean confidence interval for quadwords %-change: -2.28% -0.58%
Quadwords are helped.

total registers in shared programs: 3916 -> 3911 (-0.13%)
registers in affected programs: 129 -> 124 (-3.88%)
helped: 10
HURT: 5
helped stats (abs) min: 1 max: 2 x̄: 1.10 x̃: 1
helped stats (rel) min: 8.33% max: 25.00% x̄: 12.84% x̃: 9.55%
HURT stats (abs)   min: 1 max: 2 x̄: 1.20 x̃: 1
HURT stats (rel)   min: 11.11% max: 66.67% x̄: 27.30% x̃: 14.29%
95% mean confidence interval for registers value: -0.98 0.32
95% mean confidence interval for registers %-change: -12.67% 13.75%
Inconclusive result (value mean confidence interval includes 0).

total threads in shared programs: 2455 -> 2455 (0.00%)
threads in affected programs: 6 -> 6 (0.00%)
helped: 1
HURT: 1
helped stats (abs) min: 2 max: 2 x̄: 2.00 x̃: 2
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 2 max: 2 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%

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

total spills in shared programs: 168 -> 168 (0.00%)
spills in affected programs: 0 -> 0
helped: 0
HURT: 0

total fills in shared programs: 186 -> 186 (0.00%)
fills in affected programs: 0 -> 0
helped: 0
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Allow Z/S writes to use any 2nd stage unit
Alyssa Rosenzweig [Thu, 2 Jul 2020 18:36:46 +0000 (14:36 -0400)]
pan/mdg: Allow Z/S writes to use any 2nd stage unit

This ensures there will not be dependency problems if we emit a move
that tries to read from a parallel instruction.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Defer smul, vlut until after writeout moves
Alyssa Rosenzweig [Tue, 30 Jun 2020 14:27:21 +0000 (10:27 -0400)]
pan/mdg: Defer smul, vlut until after writeout moves

We can end up with bad dependencies with a depth/stencil export. Let's
let the writeout special cases consume these values if possible, using a
move otherwise in which case it won't be used in the other slots anyway.

total instructions in shared programs: 50508 -> 50507 (<.01%)
instructions in affected programs: 12 -> 11 (-8.33%)
helped: 1
HURT: 0

total bundles in shared programs: 25640 -> 25640 (0.00%)
bundles in affected programs: 0 -> 0
helped: 0
HURT: 0

total quadwords in shared programs: 40899 -> 40899 (0.00%)
quadwords in affected programs: 0 -> 0
helped: 0
HURT: 0

total registers in shared programs: 3917 -> 3916 (-0.03%)
registers in affected programs: 3 -> 2 (-33.33%)
helped: 1
HURT: 0

total threads in shared programs: 2455 -> 2455 (0.00%)
threads in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 168 -> 168 (0.00%)
spills in affected programs: 0 -> 0
helped: 0
HURT: 0

total fills in shared programs: 186 -> 186 (0.00%)
fills in affected programs: 0 -> 0
helped: 0
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Schedule writeout to VLUT
Alyssa Rosenzweig [Mon, 15 Jun 2020 23:23:32 +0000 (19:23 -0400)]
pan/mdg: Schedule writeout to VLUT

Many thanks to Icecream95 for noticing this is possible if alpha is not
written.

total instructions in shared programs: 50509 -> 50508 (<.01%)
instructions in affected programs: 221 -> 220 (-0.45%)
helped: 2
HURT: 1
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 0.74% max: 1.35% x̄: 1.04% x̃: 1.04%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 9.09% max: 9.09% x̄: 9.09% x̃: 9.09%

total bundles in shared programs: 25675 -> 25640 (-0.14%)
bundles in affected programs: 5434 -> 5399 (-0.64%)
helped: 34
HURT: 0
helped stats (abs) min: 1 max: 2 x̄: 1.03 x̃: 1
helped stats (rel) min: 0.27% max: 20.00% x̄: 2.29% x̃: 0.67%
95% mean confidence interval for bundles value: -1.09 -0.97
95% mean confidence interval for bundles %-change: -3.64% -0.94%
Bundles are helped.

total quadwords in shared programs: 40887 -> 40899 (0.03%)
quadwords in affected programs: 1995 -> 2007 (0.60%)
helped: 2
HURT: 16
helped stats (abs) min: 1 max: 3 x̄: 2.00 x̃: 2
helped stats (rel) min: 1.67% max: 2.40% x̄: 2.03% x̃: 2.03%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.54% max: 5.88% x̄: 1.40% x̃: 0.86%
95% mean confidence interval for quadwords value: 0.15 1.18
95% mean confidence interval for quadwords %-change: 0.13% 1.90%
Quadwords are HURT.

total registers in shared programs: 3916 -> 3917 (0.03%)
registers in affected programs: 2 -> 3 (50.00%)
helped: 0
HURT: 1

total threads in shared programs: 2455 -> 2455 (0.00%)
threads in affected programs: 0 -> 0
helped: 0
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Remove bundle interference code
Alyssa Rosenzweig [Mon, 29 Jun 2020 22:56:36 +0000 (18:56 -0400)]
pan/mdg: Remove bundle interference code

This incorrectly worked around the r1 issue fixed earlier.

total instructions in shared programs: 50514 -> 50509 (<.01%)
instructions in affected programs: 826 -> 821 (-0.61%)
helped: 10
HURT: 5
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 1.10% max: 4.17% x̄: 2.04% x̃: 1.59%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 1.16% max: 5.00% x̄: 3.10% x̃: 2.17%
95% mean confidence interval for instructions value: -0.87 0.21
95% mean confidence interval for instructions %-change: -1.90% 1.25%
Inconclusive result (value mean confidence interval includes 0).

total bundles in shared programs: 25680 -> 25675 (-0.02%)
bundles in affected programs: 539 -> 534 (-0.93%)
helped: 10
HURT: 5
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 1.54% max: 9.09% x̄: 3.51% x̃: 2.22%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 2.22% max: 8.33% x̄: 5.44% x̃: 4.17%
95% mean confidence interval for bundles value: -0.87 0.21
95% mean confidence interval for bundles %-change: -3.40% 2.35%
Inconclusive result (value mean confidence interval includes 0).

total quadwords in shared programs: 40887 -> 40887 (0.00%)
quadwords in affected programs: 0 -> 0
helped: 0
HURT: 0

total registers in shared programs: 3916 -> 3916 (0.00%)
registers in affected programs: 22 -> 22 (0.00%)
helped: 2
HURT: 2
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 16.67% max: 25.00% x̄: 20.83% x̃: 20.83%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 16.67% max: 16.67% x̄: 16.67% x̃: 16.67%
95% mean confidence interval for registers value: -1.84 1.84
95% mean confidence interval for registers %-change: -36.96% 32.79%
Inconclusive result (value mean confidence interval includes 0).

total threads in shared programs: 2455 -> 2455 (0.00%)
threads in affected programs: 0 -> 0
helped: 0
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Don't assign destination in writeout block to r1
Alyssa Rosenzweig [Tue, 30 Jun 2020 17:52:05 +0000 (13:52 -0400)]
pan/mdg: Don't assign destination in writeout block to r1

It will misbehave.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopan/mdg: Defer nir_fuse_io_16 until after opts
Alyssa Rosenzweig [Tue, 16 Jun 2020 17:07:02 +0000 (13:07 -0400)]
pan/mdg: Defer nir_fuse_io_16 until after opts

Sometimes DCE/etc can opt out things that would force 32-bit, so this is
worthwhile.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agopanfrost: Specify stack_shift on SFBD
Alyssa Rosenzweig [Tue, 30 Jun 2020 17:20:56 +0000 (13:20 -0400)]
panfrost: Specify stack_shift on SFBD

Fixes spilling on T720.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

4 years agoetnaviv: move ra into own file
Christian Gmeiner [Tue, 30 Jun 2020 09:37:54 +0000 (11:37 +0200)]
etnaviv: move ra into own file

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: move nir compiler related stuff into .c file
Christian Gmeiner [Tue, 30 Jun 2020 08:53:53 +0000 (10:53 +0200)]
etnaviv: move nir compiler related stuff into .c file

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: move functions that generate asm to own file
Christian Gmeiner [Mon, 29 Jun 2020 15:14:20 +0000 (17:14 +0200)]
etnaviv: move functions that generate asm to own file

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: drop emit macro
Christian Gmeiner [Mon, 29 Jun 2020 14:55:28 +0000 (16:55 +0200)]
etnaviv: drop emit macro

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: merge struct etna_compile and etna_state
Christian Gmeiner [Mon, 29 Jun 2020 14:51:47 +0000 (16:51 +0200)]
etnaviv: merge struct etna_compile and etna_state

I see no good architectural reason for this split.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: move liveness related stuff into own file
Christian Gmeiner [Mon, 29 Jun 2020 14:00:29 +0000 (16:00 +0200)]
etnaviv: move liveness related stuff into own file

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: make more use of compile_error(..)
Christian Gmeiner [Mon, 29 Jun 2020 12:09:39 +0000 (14:09 +0200)]
etnaviv: make more use of compile_error(..)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: drop OPT_V define
Christian Gmeiner [Mon, 29 Jun 2020 11:26:02 +0000 (13:26 +0200)]
etnaviv: drop OPT_V define

Directly use NIR_PASS_V(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: move etna_lower_alu(..) to etnaviv_nir.c
Christian Gmeiner [Mon, 29 Jun 2020 11:22:33 +0000 (13:22 +0200)]
etnaviv: move etna_lower_alu(..) to etnaviv_nir.c

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: get rid of etna_compile dependency
Christian Gmeiner [Mon, 29 Jun 2020 11:18:51 +0000 (13:18 +0200)]
etnaviv: get rid of etna_compile dependency

Needed prep change to be able to move alu lowering.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: move etna_lower_io(..) to etnaviv_nir.c
Christian Gmeiner [Mon, 29 Jun 2020 11:16:59 +0000 (13:16 +0200)]
etnaviv: move etna_lower_io(..) to etnaviv_nir.c

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: convert enums
Christian Gmeiner [Tue, 30 Jun 2020 09:10:23 +0000 (11:10 +0200)]
etnaviv: convert enums

Atm. it is not possible to move the enums to a header file
as they do not use an identifier but directly define an
object.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoetnaviv: delete not used struct
Christian Gmeiner [Mon, 29 Jun 2020 14:22:28 +0000 (16:22 +0200)]
etnaviv: delete not used struct

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>

4 years agoci: Move deploy stage between container & build stages
Michel Dänzer [Wed, 1 Jul 2020 15:37:49 +0000 (17:37 +0200)]
ci: Move deploy stage between container & build stages

Having it as the last stage meant that the pages job could only run
once all other jobs had finished.

The new position means it can run in parallel with build jobs.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5711>

4 years agoci: Use "when: always" for pages job
Michel Dänzer [Wed, 1 Jul 2020 15:41:06 +0000 (17:41 +0200)]
ci: Use "when: always" for pages job

"when: on_success" meant that that the job wouldn't run automatically
until all jobs of all earlier stages passed, and would be skipped if
any of them failed. But we need to always run this job if any
documentation files were modified.

Fixes: 8e2cb8ef276b "gitlab-ci: Extend .ci-run-policy template for docs
                     jobs"

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5711>

4 years agoradv,vulkan: add a new x11 wsi drirc workaround for DOOM Eternal
Samuel Pitoiset [Wed, 1 Jul 2020 06:06:09 +0000 (08:06 +0200)]
radv,vulkan: add a new x11 wsi drirc workaround for DOOM Eternal

DOOM Eternal happily creates a swapchain with 2 images for IMMEDIATE.
This fixes a 10% performance issue with RADV.

Cc: 20.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5704>

4 years agoRevert "vulkan/wsi/x11: Ensure we create at least minImageCount images."
Samuel Pitoiset [Wed, 1 Jul 2020 05:50:08 +0000 (07:50 +0200)]
Revert "vulkan/wsi/x11: Ensure we create at least minImageCount images."

This breaks some games like Wolfenstein Youngblood or Wolfenstein 2
that crash at launch if the number of images is more than what they
expected.

We could add vk_x11_strict_image_count to fix these game bugs but
it seems more conservative to revert that change and add a new wsi
drirc workaround for Doom Eternal.

This reverts commit 5f97dfc4c848cb6388ec138c19a22a8a880901d1.

Cc: 20.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5704>

4 years agoradv: fix wide lines with multisample enabled
Samuel Pitoiset [Tue, 30 Jun 2020 17:10:36 +0000 (19:10 +0200)]
radv: fix wide lines with multisample enabled

When set, EXPAND_LINE_WIDTH expands the line width by 1/cos(a),
where a is the minimum angle from horizontal or vertical. This
seems required by OpenGL line rasterization but not by Vulkan.

Similar to what AMDVLK and AMDGPU-PRO do for AA wide lines.

This fixes
dEQP-VK.rasterization.interpolation_multisample_*_bit.*lines_wide.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5698>

4 years agoCI: Disable Windows build due to unstable infrastructure
Daniel Stone [Thu, 2 Jul 2020 07:21:33 +0000 (08:21 +0100)]
CI: Disable Windows build due to unstable infrastructure

The Windows runner is having a lot of issues cloning repositories,
failing early due to an unhandled HTTP error. Temporarily disable it
until we can figure out what's going on and fix it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5716>

4 years agozink: implement Vk_EXT_index_type_uint8
Mike Blumenkrantz [Wed, 1 Jul 2020 13:13:35 +0000 (09:13 -0400)]
zink: implement Vk_EXT_index_type_uint8

this is a simple extension that enables using uint8-sized index buffers,
which lets us avoid having those go through primconvert

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5712>

4 years agoradv: fix wide points and lines
Samuel Pitoiset [Tue, 30 Jun 2020 16:45:08 +0000 (18:45 +0200)]
radv: fix wide points and lines

The maximum value for both points and lines is 65536. This doesn't
fix anything known (just found this while looking in that area).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5696>

4 years agodocs: update llvmpipe GL 4.0 status
Dave Airlie [Thu, 2 Jul 2020 03:26:41 +0000 (13:26 +1000)]
docs: update llvmpipe GL 4.0 status

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agoci: fixup tests after all indirect images fixes.
Dave Airlie [Tue, 16 Jun 2020 07:21:01 +0000 (17:21 +1000)]
ci: fixup tests after all indirect images fixes.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agollvmpipe: handle indirect images properly
Dave Airlie [Tue, 16 Jun 2020 02:51:10 +0000 (12:51 +1000)]
llvmpipe: handle indirect images properly

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agodraw/sample: add support for indirect images
Dave Airlie [Tue, 16 Jun 2020 02:53:43 +0000 (12:53 +1000)]
draw/sample: add support for indirect images

This uses the array functions to implement indirect image support
for draw shaders

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/nir: add support for indirect image loading
Dave Airlie [Tue, 16 Jun 2020 02:50:41 +0000 (12:50 +1000)]
gallivm/nir: add support for indirect image loading

This adds support for indirect image loading, image stores
can cause images with different formats to be stored to,
so this operates like the texture code now.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/img: refactor out the texel return type (v2)
Dave Airlie [Tue, 16 Jun 2020 07:18:36 +0000 (17:18 +1000)]
gallivm/img: refactor out the texel return type (v2)

v2:
refactor to just pass type as pointed out by Roland.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/nir: refactor image operations for indirect support.
Dave Airlie [Tue, 16 Jun 2020 02:49:30 +0000 (12:49 +1000)]
gallivm/nir: refactor image operations for indirect support.

This just refactors the image code, so that outdata is passed
explicitly, and refactors the internal handling of NONE formats.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/nir: support passing image index into image code.
Dave Airlie [Tue, 16 Jun 2020 02:47:25 +0000 (12:47 +1000)]
gallivm/nir: support passing image index into image code.

This doesn't do anything yet, just adds parsing support for it.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agollvmpipe: pass number of images into image soa create
Dave Airlie [Tue, 16 Jun 2020 02:45:26 +0000 (12:45 +1000)]
llvmpipe: pass number of images into image soa create

Just store this for now to use later with indexing

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agodraw: pass number of images to image soa create
Dave Airlie [Tue, 19 May 2020 01:55:38 +0000 (11:55 +1000)]
draw: pass number of images to image soa create

This is stored for now but will be used as part of indirect
image support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agollvmpipe: enable ARB_gpu_shader5
Dave Airlie [Fri, 5 Jun 2020 04:48:45 +0000 (14:48 +1000)]
llvmpipe: enable ARB_gpu_shader5

This isn't fully free of bugs, but it's good to get CI working,
so fixing those bugs doesn't break anything.

The main buggy areas are missing indirect texture size,
and transform feedback geometry streams.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/sample: handle size unit offset
Dave Airlie [Mon, 15 Jun 2020 07:22:01 +0000 (17:22 +1000)]
gallivm/sample: handle size unit offset

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agollvmpipe/draw: wire up indirect offset
Dave Airlie [Mon, 15 Jun 2020 07:21:27 +0000 (17:21 +1000)]
llvmpipe/draw: wire up indirect offset

This bounds checks and adds to the llvm index.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/sample: pass indirect offset into texture/image units
Dave Airlie [Mon, 15 Jun 2020 07:00:20 +0000 (17:00 +1000)]
gallivm/sample: pass indirect offset into texture/image units

This isn't needed for the basic indirect code, but it is needed for
texture size/image size unfortunately. They could be done with a super
switch, but it seems simple to query them.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/nir: handle non-uniform texture offsets
Dave Airlie [Fri, 10 Apr 2020 04:13:44 +0000 (14:13 +1000)]
gallivm/nir: handle non-uniform texture offsets

The way we construt vertex/geom shaders means these can
diverge, so we have to just hammer it out manually,
there are likely optimisation opportuniities in here

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/nir: add texture unit indexing
Dave Airlie [Fri, 27 Mar 2020 04:49:37 +0000 (14:49 +1000)]
gallivm/nir: add texture unit indexing

This hooks up the index from NIR into the sampler code.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agollvmpipe: add support for indirect texture access.
Dave Airlie [Tue, 19 May 2020 02:18:52 +0000 (12:18 +1000)]
llvmpipe: add support for indirect texture access.

This hooks up the sampler switch statement generator
 to the llvmpipe sampler interface.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agodraw: add support for indirect texture access
Dave Airlie [Tue, 19 May 2020 02:18:20 +0000 (12:18 +1000)]
draw: add support for indirect texture access

This hooks up the switch statement generator to the draw code.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm: add indirect texture switch statement builder.
Dave Airlie [Tue, 19 May 2020 02:16:34 +0000 (12:16 +1000)]
gallivm: add indirect texture switch statement builder.

This adds the apis to add an indirect accessor for arrays
of textures, using an LLVM switch statement and per-texture
sampler functions.

It also adds the indexer to the sampler parameters

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agogallivm/sample: change texture function generator api
Dave Airlie [Tue, 19 May 2020 02:01:54 +0000 (12:01 +1000)]
gallivm/sample: change texture function generator api

This passes some more paramters in directly and changes how
the returns are done in order to reuse this function for
indirect texture support later.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agollvmpipe: pass number of samplers into llvm sampler code.
Dave Airlie [Tue, 19 May 2020 01:51:13 +0000 (11:51 +1000)]
llvmpipe: pass number of samplers into llvm sampler code.

This is to be used later for indirect texture access

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agodraw: pass nr_samplers into llvm sample state creation.
Dave Airlie [Tue, 19 May 2020 01:48:23 +0000 (11:48 +1000)]
draw: pass nr_samplers into llvm sample state creation.

This will be used later to handle indirect texture support.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>

4 years agonir: add missing break to nir_opt_access()
Timothy Arceri [Wed, 1 Jul 2020 08:56:09 +0000 (18:56 +1000)]
nir: add missing break to nir_opt_access()

Fixes: f2d0e48ddc74 ("glsl/nir: Add optimization pass for access flags")
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>

4 years agoegl: move fallthrough comment so gcc can see it
Timothy Arceri [Wed, 1 Jul 2020 06:48:43 +0000 (16:48 +1000)]
egl: move fallthrough comment so gcc can see it

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>

4 years agoiris: add missing fallthrough comment
Timothy Arceri [Wed, 1 Jul 2020 06:41:07 +0000 (16:41 +1000)]
iris: add missing fallthrough comment

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>

4 years agointel/compiler: add and fix up fallthrough comments for gcc warnings
Timothy Arceri [Wed, 1 Jul 2020 06:30:01 +0000 (16:30 +1000)]
intel/compiler: add and fix up fallthrough comments for gcc warnings

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>

4 years agoanv: update fallthrough comment so gcc sees it
Timothy Arceri [Wed, 1 Jul 2020 06:24:59 +0000 (16:24 +1000)]
anv: update fallthrough comment so gcc sees it

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>

4 years agogallivm: add missing break
Timothy Arceri [Wed, 1 Jul 2020 05:25:40 +0000 (15:25 +1000)]
gallivm: add missing break

Fixes: 26c5ae80f0b5 ("llvmpipe: enable ARB_shader_group_vote")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>

4 years agollvmpipe: add missing fallthrough comments
Timothy Arceri [Wed, 1 Jul 2020 05:24:41 +0000 (15:24 +1000)]
llvmpipe: add missing fallthrough comments

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>

4 years agoi965: add and fix fallthrough comments
Timothy Arceri [Wed, 1 Jul 2020 05:18:02 +0000 (15:18 +1000)]
i965: add and fix fallthrough comments

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>

4 years agointel/compiler: Don't emit no-op cr0 changes
Matt Turner [Fri, 19 Jun 2020 19:33:31 +0000 (12:33 -0700)]
intel/compiler: Don't emit no-op cr0 changes

If mask is 0, we're asking for no changes to cr0.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5566>

4 years agointel/compiler: Add assert that set bits are within mask
Matt Turner [Fri, 19 Jun 2020 19:32:44 +0000 (12:32 -0700)]
intel/compiler: Add assert that set bits are within mask

We generate bitfields of bits that we want to retain (mask) and bits
that we want to set (brw_mode) in the cr0 register, so the bits we want
to set should be in the set of bits we want to retain.

Also, remove the initialization of mask from
fs_visitor::emit_shader_float_controls_execution_mode since
brw_rnd_mode_from_nir initializes the mask parameter unconditionally.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5566>

4 years agogallium,util: undef ALIGN on FreeBSD to prevent name clash
Greg V [Thu, 23 Apr 2020 13:15:38 +0000 (16:15 +0300)]
gallium,util: undef ALIGN on FreeBSD to prevent name clash

Some rare headers like ipc/shm and pthread_np cause
machine/param.h to be included which defines a macro called ALIGN.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3559>

4 years agoi965: Explicitly cast value to uint64_t
Emmanuel [Fri, 24 Jan 2020 22:48:06 +0000 (23:48 +0100)]
i965: Explicitly cast value to uint64_t

In FreeBSD x86 and aarch64 __u64 is typedef to unsigned long and
is the same size as unsigned long long.
Since we are explicitly specifying the format, cast the value
to the proper type.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emmanuel <manu@FreeBSD.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3559>

4 years agoiris: Explicitly cast value to uint64_t
Emmanuel [Fri, 24 Jan 2020 22:45:40 +0000 (23:45 +0100)]
iris: Explicitly cast value to uint64_t

In FreeBSD x86 and aarch64 __u64 is typedef to unsigned long and
is the same size as unsigned long long.
Since we are explicitly specifying the format, cast the value
to the proper type.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emmanuel <manu@FreeBSD.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3559>