platform/upstream/mesa.git
3 years agonir/dce: perform DCE for unlooped instructions in a single pass
Rhys Perry [Tue, 17 Nov 2020 17:44:11 +0000 (17:44 +0000)]
nir/dce: perform DCE for unlooped instructions in a single pass

It's unnecessary to iterate twice for instructions outside loops.

Compile-time (nir_opt_dce):
Difference at 95.0% confidence
-630.64 +/- 6.18761
-27.0751% +/- 0.223134%
(Student's t, pooled s = 7.30785)

Compile-time (entire run):
Difference at 95.0% confidence
-749.54 +/- 48.8272
-1.82644% +/- 0.117838%
(Student's t, pooled s = 57.6672)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7691>

3 years agonir: inline nir_foreach_{src,dest}
Rhys Perry [Mon, 18 Jan 2021 14:43:15 +0000 (14:43 +0000)]
nir: inline nir_foreach_{src,dest}

Compile-time (nir_opt_dce):
Difference at 95.0% confidence
-319.51 +/- 5.67632
-12.0627% +/- 0.208076%
(Student's t, pooled s = 6.70399)

Compile-time (overall):
Difference at 95.0% confidence
-385.025 +/- 42.1124
-0.929489% +/- 0.10139%
(Student's t, pooled s = 49.7367)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7691>

3 years agonir/dce: replace instruction worklist with ssa def bitset
Rhys Perry [Tue, 17 Nov 2020 16:27:26 +0000 (16:27 +0000)]
nir/dce: replace instruction worklist with ssa def bitset

Instead of a keeping a worklist of live instructions, use a bitset of live
ssa defs and iterate over instructions in reverse.

Compile-time (nir_opt_dce):
Difference at 95.0% confidence
-931.911 +/- 4.41383
-26.0263% +/- 0.105781%
(Student's t, pooled s = 5.21293)

Compile-time (overall):
Difference at 95.0% confidence
-882.245 +/- 28.3492
-2.08541% +/- 0.0665121%
(Student's t, pooled s = 33.4818)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7691>

3 years agoci/vc4/v3d: Parallelize piglit jobs
Juan A. Suarez Romero [Fri, 12 Feb 2021 17:33:59 +0000 (18:33 +0100)]
ci/vc4/v3d: Parallelize piglit jobs

Split the piglit jobs in multiple parallel executions to speed up the
runtime.

v2:
 - Set parallel in V3D piglit jobs.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9022>

3 years agoci/piglit: allow parallel piglit jobs
Juan A. Suarez Romero [Fri, 12 Feb 2021 17:20:00 +0000 (18:20 +0100)]
ci/piglit: allow parallel piglit jobs

This allows to split a piglit job in several parallel jobs, to speed up
the execution.

Due piglit restrictions, this only works for single profiles. Otherwise
an error will be shown in the runner.

Also, a new gitlab job variable `PIGLIT_TESTS` is introduced that
contains the excluded/included tests with `-x` or `-n`. The rest of the
piglit options go to `PIGLIT_OPTIONS` (like `--timeout n`).

v2 (Andres):
 - Replay profile is supported in parallel jobs.
 - Bail out inmediately if parallel jobs is tried with multiple
profiles.
 - Use testlist only when doing parallel jobs.
 - Do not drop pass tests when filtering executed tests.
 - Get rid of PIGLIT_FRACTION.

v4:
 - uncommit unrelated change (Andres).

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9022>

3 years agobroadcom/compiler: use nir_opt_sink
Iago Toral Quiroga [Mon, 22 Feb 2021 07:17:46 +0000 (08:17 +0100)]
broadcom/compiler: use nir_opt_sink

total instructions in shared programs: 14072341 -> 14062334 (-0.07%)
instructions in affected programs: 1996685 -> 1986678 (-0.50%)
helped: 3038
HURT: 2432
Instructions are helped.

total uniforms in shared programs: 3797720 -> 3794523 (-0.08%)
uniforms in affected programs: 191711 -> 188514 (-1.67%)
helped: 831
HURT: 449
Uniforms are helped.

total max-temps in shared programs: 2340632 -> 2335124 (-0.24%)
max-temps in affected programs: 113632 -> 108124 (-4.85%)
helped: 2728
HURT: 436
Max-temps are helped.

total spills in shared programs: 6050 -> 5931 (-1.97%)
spills in affected programs: 2869 -> 2750 (-4.15%)
helped: 14
HURT: 4

total fills in shared programs: 13970 -> 13371 (-4.29%)
fills in affected programs: 8831 -> 8232 (-6.78%)
helped: 14
HURT: 4

total inst-and-stalls in shared programs: 14103668 -> 14093712 (-0.07%)
inst-and-stalls in affected programs: 2004035 -> 1994079 (-0.50%)
helped: 3009
HURT: 2426
Inst-and-stalls are helped.

LOST:   0
GAINED: 10

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9209>

3 years agoanv/gen12: Implement programming of pixel pipe hashing tables.
Francisco Jerez [Thu, 14 Jan 2021 06:59:40 +0000 (22:59 -0800)]
anv/gen12: Implement programming of pixel pipe hashing tables.

See previous commit "iris/gen12: Implement programming of pixel pipe
hashing tables." for the rationale.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>

3 years agoanv/gen11+: Calculate pixel hashing tables instead of hardcoding.
Francisco Jerez [Thu, 14 Jan 2021 06:53:13 +0000 (22:53 -0800)]
anv/gen11+: Calculate pixel hashing tables instead of hardcoding.

See commit "iris/gen11+: Calculate pixel hashing tables instead of
hardcoding." for the rationale.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>

3 years agoiris/gen12: Implement programming of pixel pipe hashing tables.
Francisco Jerez [Thu, 14 Jan 2021 07:07:22 +0000 (23:07 -0800)]
iris/gen12: Implement programming of pixel pipe hashing tables.

Straightforward by using the pixel hashing table computation helper
previously introduced, assuming we know the fraction of work that
needs to be submitted to each pixel pipe.  Note that AFAIA the
hardware maps indices in the table to pixel pipes from largest to
smallest, so it shouldn't be necessary to permute indices based on the
physical IDs of the pixel pipes as we are doing on Gen11.

Improves performance of most non-trivial graphics workloads I've tried
on an 80 EU TGL.  E.g. the following testcases improve performance
significantly with sample size 27 and statistical significance 1%:

  gputest/pixmark_piano:      62.89% ±0.10%
  gputest/pixmark_volplosion: 61.51% ±0.06%
  unigine/valley:             26.72% ±0.25%
  gfxbench/gl_5_high:         24.70% ±0.19%
  unigine/heaven:             23.54% ±0.17%
  steam/csgo:                 22.75% ±4.36%
  gfxbench/gl_manhattan31:    22.43% ±0.29%
  gfxbench/gl_4:              20.92% ±0.35%
  warsow/benchsow:            19.15% ±2.53%
  gfxbench/gl_trex_off:       18.84% ±0.27%

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>

3 years agoiris/gen11+: Calculate pixel hashing tables instead of hardcoding.
Francisco Jerez [Thu, 14 Jan 2021 07:06:55 +0000 (23:06 -0800)]
iris/gen11+: Calculate pixel hashing tables instead of hardcoding.

Pixel hashing tables are a pain to type in, review and maintain IMHO.
In order to obtain satisfactory load balancing on all Gen12 parts
currently in production this series would need to add 5 different
additional tables.  Instead this introduces a simple algorithm able to
calculate a table on the fly based on a handful of parameters.

Note that the Gen11 tables generated with this algorithm are not
identical to the hardcoded ones, however the only difference should be
a phase shift that isn't expected to have any effect on performance,
since it shouldn't change the fraction of work submitted to each pixel
pipe.

The CPU overhead from this change is negligible since the tables only
need to be programmed once at context init time.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>

3 years agointel/dev: Implement pixel pipe subslice counting for Gen12+.
Francisco Jerez [Fri, 4 Dec 2020 20:39:39 +0000 (12:39 -0800)]
intel/dev: Implement pixel pipe subslice counting for Gen12+.

Unlike Gen11, Gen12 hardware supports up to three pixel pipes per
slice.

Unfortunately the kernel interface is somewhat inconsistent between
Gen11 and Gen12: I915_PARAM_SUBSLICE_MASK returns a mask of enabled
*dual* subslices since TGL, so there is half the number of bits per
pixel pipe in the mask.  This is worked around here so we're able to
calculate the correct size of each pixel pipe, but the result is
returned in dual subslice units, inheriting the inconsistency from the
kernel -- Reason is that as of now all our Gen12 subslice counts
returned by gen_device_info.c are really dual subslice counts, and the
num_eu_per_subslice counts are also scaled accordingly, so it seems
like it would only make the matter worse if I fixed the units of this
field only without also fixing the rest.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>

3 years agointel/genxml: Define 3DSTATE_SUBSLICE_HASH_TABLE command for Gen12 and Gen12.5.
Francisco Jerez [Thu, 14 Jan 2021 03:57:35 +0000 (19:57 -0800)]
intel/genxml: Define 3DSTATE_SUBSLICE_HASH_TABLE command for Gen12 and Gen12.5.

This command allows programming custom pixel hashing tables
controlling the balancing of load across pixel pipes.  Rather
confusingly 3DSTATE_SLICE_TABLE_STATE_POINTERS was serving the same
purpose on Gen11: A pixel is mapped to the pixel pipe with index
specified by the entry in the table corresponding to the LSBs of the
pixel coordinates [Yes you read right the entries are neither subslice
nor slice indices!].  Either a 2-way or a 3-way table can be
programmed based on whether the platform has two or three pixel pipes
per slice.  In addition the 16x8 tables defined below can hold two
separate 8x8 tables when in DUAL_TABLE mode (which AFAIA is only
useful for platforms with multiple asymmetric slices -- I.e. no
production platforms as of today to my knowledge).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>

3 years agointel/genxml: Fix pixel hashing 3DSTATE_3D_MODE field definitions for Gen12 and Gen12.5.
Francisco Jerez [Thu, 14 Jan 2021 03:50:00 +0000 (19:50 -0800)]
intel/genxml: Fix pixel hashing 3DSTATE_3D_MODE field definitions for Gen12 and Gen12.5.

The former "Subslice Hashing Mode" field is no longer used by the
hardware, Gen12 parts always do 16x16 subslice pixel hashing -- Remove
it since it's no longer useful.  In addition add a couple of bits that
will be useful in order to make some adjustments to the default pixel
pipe hashing behavior.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8749>

3 years agozink: ci updates
Mike Blumenkrantz [Wed, 24 Feb 2021 03:50:48 +0000 (22:50 -0500)]
zink: ci updates

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

3 years agozink: support stencil-export
Antonio Caggiano [Tue, 21 Jul 2020 14:07:17 +0000 (16:07 +0200)]
zink: support stencil-export

Enable pipe capability of exporting stencil from shader when Vulkan
extension is available.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9244>

3 years agozink: check shader stencil output
Antonio Caggiano [Fri, 17 Jul 2020 14:11:17 +0000 (16:11 +0200)]
zink: check shader stencil output

Enable SPV_EXT_stencil_export and SpvCapabilityStencilExportEXT and
mark output with FragStencilRefEXT when fragment shader writes to
reference stencil value.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9244>

3 years agozink: add X32_S8X24 format
Erik Faye-Lund [Fri, 1 Nov 2019 13:13:15 +0000 (14:13 +0100)]
zink: add X32_S8X24 format

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9244>

3 years agozink: improve descriptor set oom handling
Mike Blumenkrantz [Wed, 9 Sep 2020 13:38:14 +0000 (09:38 -0400)]
zink: improve descriptor set oom handling

this attempts to dynamically establish an upper bound for per-batch descriptor
use, flushing all batches and resetting the pools on alloc failure in
an attempt to be more robust about it

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

3 years agozink: ci changes
Mike Blumenkrantz [Tue, 23 Feb 2021 20:21:25 +0000 (15:21 -0500)]
zink: ci changes

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

3 years agozink: always do full-fb clears in renderpass begin when possible
Mike Blumenkrantz [Wed, 14 Oct 2020 16:37:01 +0000 (12:37 -0400)]
zink: always do full-fb clears in renderpass begin when possible

previously if any of the pending clears required an explicit clear then
we'd clear them explicitly, but with this patch we're shifting the first
pending clear into the renderpass begin if possible and then applying the
remaining clears on top of that in order to reduce gpu operations

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

3 years agozink: move all the clear stuff to zink_clear.h
Mike Blumenkrantz [Thu, 17 Sep 2020 20:41:19 +0000 (16:41 -0400)]
zink: move all the clear stuff to zink_clear.h

this was getting way too crowded in zink_context.h

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

3 years agozink: optimize the remaining read cases of applying pending clear calls
Mike Blumenkrantz [Thu, 17 Sep 2020 20:32:54 +0000 (16:32 -0400)]
zink: optimize the remaining read cases of applying pending clear calls

we have src regions for all the blit/copy/map calls, so we can use those to
verify whether we actually need to apply the clears now or if we can keep
sitting on them a while longer

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

3 years agozink: add yet another clear helper, this time for applying overlap regions
Mike Blumenkrantz [Thu, 17 Sep 2020 20:29:35 +0000 (16:29 -0400)]
zink: add yet another clear helper, this time for applying overlap regions

if we know we're going to be reading from a region then we can examine the
pending clears to see if there's any overlap, which helps us decide whether
we need to apply them immediately

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

3 years agozink: discard pending clears during blit/copy if we'll overwrite the data
Mike Blumenkrantz [Thu, 17 Sep 2020 13:21:07 +0000 (09:21 -0400)]
zink: discard pending clears during blit/copy if we'll overwrite the data

these operations are redundant, so there's no point in forcing them through
since they'll never be visible

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

3 years agozink: add helper for applying/discarding clears based on a rect
Mike Blumenkrantz [Thu, 17 Sep 2020 14:45:20 +0000 (10:45 -0400)]
zink: add helper for applying/discarding clears based on a rect

this lets us test whether we're going to overwrite a scissored clear
region in order to correctly no-op it

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

3 years agozink: break out fb clear apply into helper function
Mike Blumenkrantz [Thu, 17 Sep 2020 13:50:46 +0000 (09:50 -0400)]
zink: break out fb clear apply into helper function

we'll be reusing this shortly...

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

3 years agozink: add another helper for checking whether one rect covers another
Mike Blumenkrantz [Thu, 17 Sep 2020 13:37:50 +0000 (09:37 -0400)]
zink: add another helper for checking whether one rect covers another

this is going to be used for no-oping writes

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

3 years agozink: add helper for converting pipe_box -> u_rect
Mike Blumenkrantz [Thu, 17 Sep 2020 13:13:12 +0000 (09:13 -0400)]
zink: add helper for converting pipe_box -> u_rect

how is this not a thing already

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

3 years agozink: break out region overlap testing function into helper
Mike Blumenkrantz [Thu, 17 Sep 2020 13:08:37 +0000 (09:08 -0400)]
zink: break out region overlap testing function into helper

this is useful for a lot of copying operations

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

3 years agozink: also defer fb clears when conditional render is active
Mike Blumenkrantz [Thu, 17 Sep 2020 20:08:39 +0000 (16:08 -0400)]
zink: also defer fb clears when conditional render is active

this just requires adding an explicit flush for the deferred clears in
case conditional rendering is disabled before a draw happens

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

3 years agozink: defer pipe_context::clear calls when not currently in a renderpass
Mike Blumenkrantz [Wed, 16 Sep 2020 21:47:17 +0000 (17:47 -0400)]
zink: defer pipe_context::clear calls when not currently in a renderpass

instead, we can attach the clear to the next renderpass start and even add it to
the renderpass cache for reuse

also add handling for flushing clears on map or fb switching to avoid brekaing behavior

this should save us a lot of time with potentially beginning/ending renderpasses as well
as allowing drivers to do better batching of clears by passing in all the buffers at
once

this doesn't handle deferring conditional renders yet in a futile attempt to try and keep
the size of the patch down

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

3 years agozink: create framebuffer and renderpass objects just before vkCmdBeginRenderPass()
Mike Blumenkrantz [Wed, 16 Sep 2020 18:57:49 +0000 (14:57 -0400)]
zink: create framebuffer and renderpass objects just before vkCmdBeginRenderPass()

this lets us remove a flush and accumulate clears to perform in the renderpass

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

3 years agozink: ralloc the main context
Mike Blumenkrantz [Thu, 17 Sep 2020 16:58:31 +0000 (12:58 -0400)]
zink: ralloc the main context

we can start sticking stuff onto this now

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

3 years agofreedreno: Workaround for UNSYNC+DISCARD_RANGE
Rob Clark [Tue, 23 Feb 2021 16:18:13 +0000 (08:18 -0800)]
freedreno: Workaround for UNSYNC+DISCARD_RANGE

Dead-cells (and perhaps others) does MapBufferRange(UNSYNC|DISCARD_RANGE)
to update single buffered VBOs every frame in the opening menu screen,
and because we were considering UNSYNC with higher priority than
DISCARD_RANGE, this would result in the game racing VBO updates between
binning and tile passes, causing visibility stream inconsistency between
the two passes, resulting in "tile flicker".

The letter of the gl spec implies this is undefined behavior (at least
to my reading of it).  But we already hand DISCARD_RANGE in the !UNSYNC
case, so just go down this path instead.  It means we could potentially
end up invalidating (and back-blit) in cases where the app really knows
what it is doing, but oh well.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4337
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9223>

3 years agofreedreno: Add perf_debug logging for bo stalls
Rob Clark [Tue, 23 Feb 2021 23:44:39 +0000 (15:44 -0800)]
freedreno: Add perf_debug logging for bo stalls

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9223>

3 years agofreedreno: Handle InvalidateBufferData() case
Rob Clark [Tue, 23 Feb 2021 16:17:36 +0000 (08:17 -0800)]
freedreno: Handle InvalidateBufferData() case

We already had all the mechanism, it just wasn't wired up.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9223>

3 years agolavapipe: enable KHR_maintenace3
Dave Airlie [Tue, 23 Feb 2021 23:40:00 +0000 (09:40 +1000)]
lavapipe: enable KHR_maintenace3

At this stage I can't think of any reason a swrast would need to
limit descriptor sets at this point. I'm sure there are some in the
future.

Otherwise it just fixes up a lookup that really is a noop, but
may as well make it correct.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9238>

3 years agolavapipe: enable KHR_maintenance2
Dave Airlie [Tue, 23 Feb 2021 02:59:54 +0000 (12:59 +1000)]
lavapipe: enable KHR_maintenance2

This seems to pass all the CTS tests at least. I think
most of the details are handled already.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9238>

3 years agolavapipe: handle tessellation domain winding
Dave Airlie [Tue, 22 Dec 2020 07:29:45 +0000 (17:29 +1000)]
lavapipe: handle tessellation domain winding

Fixes: dEQP-VK.tessellation.winding.*

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9238>

3 years agointel/compiler: Relax some conditions in try_copy_propagate
Ian Romanick [Mon, 7 Dec 2020 00:26:04 +0000 (16:26 -0800)]
intel/compiler: Relax some conditions in try_copy_propagate

Previously can_do_source_mods was used to determine whether a value with
a source modifier or a value from a scalar source (e.g., a uniform)
could be copy propagated.  The former is a superset of the latter, so
this always produces correct results, but it is overly restrictive.  For
example, a BFI instruction can't have source modifiers, but it can have
scalar sources.

This was originally authored to prevent a small number of shader-db
regressions in a commit that marked SHR has not being able to have
source modifiers.  That commit has since been dropped in favor of a
different method.

v2: Refactor register region restriction detection to a helper function.
Suggested by Jason.

No fossil-db changes on any Intel platform.

All Gen7+ platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 20039111 -> 20038943 (<.01%)
instructions in affected programs: 31736 -> 31568 (-0.53%)
helped: 104
HURT: 0
helped stats (abs) min: 1 max: 9 x̄: 1.62 x̃: 1
helped stats (rel) min: 0.30% max: 0.88% x̄: 0.45% x̃: 0.42%
95% mean confidence interval for instructions value: -2.03 -1.20
95% mean confidence interval for instructions %-change: -0.47% -0.42%
Instructions are helped.

total cycles in shared programs: 980309750 -> 980308897 (<.01%)
cycles in affected programs: 591078 -> 590225 (-0.14%)
helped: 70
HURT: 26
helped stats (abs) min: 2 max: 622 x̄: 23.94 x̃: 4
helped stats (rel) min: <.01% max: 2.85% x̄: 0.33% x̃: 0.12%
HURT stats (abs)   min: 2 max: 520 x̄: 31.65 x̃: 6
HURT stats (rel)   min: 0.02% max: 2.45% x̄: 0.34% x̃: 0.15%
95% mean confidence interval for cycles value: -26.41 8.64
95% mean confidence interval for cycles %-change: -0.27% -0.03%
Inconclusive result (value mean confidence interval includes 0).

No shader-db changes on earlier Intel platforms.

Reviewed-by: Anuj Phogat anuj.phogat@gmail.com [v1]
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9237>

3 years agointel: Silence unused parameter warnings in files that include genX_pack.h
Ian Romanick [Wed, 9 Dec 2020 20:31:52 +0000 (12:31 -0800)]
intel: Silence unused parameter warnings in files that include genX_pack.h

src/intel/genxml/gen4_pack.h: In function ‘__gen_address’:
src/intel/genxml/gen4_pack.h:115:38: warning: unused parameter ‘start’ [-Wunused-parameter]
  115 |               NDEBUG_UNUSED uint32_t start, uint32_t end)
      |                             ~~~~~~~~~^~~~~

Reviewed-by: Anuj Phogat anuj.phogat@gmail.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9237>

3 years agointel: Silence unused parameter warnings in files that include gen_device_info.h
Ian Romanick [Wed, 9 Dec 2020 20:30:26 +0000 (12:30 -0800)]
intel: Silence unused parameter warnings in files that include gen_device_info.h

src/intel/dev/gen_device_info.h: In function ‘unsigned int gen_device_info_num_dual_subslices(const gen_device_info*)’:
src/intel/dev/gen_device_info.h:311:66: warning: unused parameter ‘devinfo’ [-Wunused-parameter]
  311 | gen_device_info_num_dual_subslices(const struct gen_device_info *devinfo)
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

Reviewed-by: Anuj Phogat anuj.phogat@gmail.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9237>

3 years agointel/compiler: Silence unused parameter warnings in files that include brw_eu.h
Ian Romanick [Wed, 9 Dec 2020 20:29:15 +0000 (12:29 -0800)]
intel/compiler: Silence unused parameter warnings in files that include brw_eu.h

src/intel/compiler/brw_eu.h: In function ‘uint32_t brw_btd_spawn_msg_type(const gen_device_info*, uint32_t)’:
src/intel/compiler/brw_eu.h:1040:54: warning: unused parameter ‘devinfo’ [-Wunused-parameter]
 1040 | brw_btd_spawn_msg_type(const struct gen_device_info *devinfo,
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
src/intel/compiler/brw_eu.h: In function ‘uint32_t brw_btd_spawn_exec_size(const gen_device_info*, uint32_t)’:
src/intel/compiler/brw_eu.h:1047:55: warning: unused parameter ‘devinfo’ [-Wunused-parameter]
 1047 | brw_btd_spawn_exec_size(const struct gen_device_info *devinfo,
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
src/intel/compiler/brw_eu.h: In function ‘uint32_t brw_rt_trace_ray_desc_exec_size(const gen_device_info*, uint32_t)’:
src/intel/compiler/brw_eu.h:1065:63: warning: unused parameter ‘devinfo’ [-Wunused-parameter]
 1065 | brw_rt_trace_ray_desc_exec_size(const struct gen_device_info *devinfo,
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

Reviewed-by: Anuj Phogat anuj.phogat@gmail.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9237>

3 years agolavapipe: fix color-only renderpass clears
Mike Blumenkrantz [Tue, 23 Feb 2021 20:52:49 +0000 (15:52 -0500)]
lavapipe: fix color-only renderpass clears

not all attachments must be cleared

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

3 years agollvmpipe: Enable FXT1 texture decompression.
Eric Anholt [Fri, 19 Feb 2021 23:22:08 +0000 (15:22 -0800)]
llvmpipe: Enable FXT1 texture decompression.

We have the software decode hooked up now, and it's not like this
decompression is more expensive than a lot of other software decompression
we have.  One less feature to be missing from the old swrast classic driver.

Reviewed-by: Adam jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9194>

3 years agomesa: Move the FXT1 compressor/decompressor to util/
Eric Anholt [Fri, 19 Feb 2021 20:27:42 +0000 (12:27 -0800)]
mesa: Move the FXT1 compressor/decompressor to util/

softpipe failed at handling FXT1, despite exposing it, because we didn't
have a fetch function for it in the util/ format table.

Fixes: #3968
Reviewed-by: Adam jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9194>

3 years agomesa: Get the FXT1 compressor/decompressor off of GL types.
Eric Anholt [Fri, 19 Feb 2021 20:21:34 +0000 (12:21 -0800)]
mesa: Get the FXT1 compressor/decompressor off of GL types.

We can use stdint now.  This is preparation for moving to util/

Reviewed-by: Adam jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9194>

3 years agosoftpipe: Fix the const buffer overflow check.
Eric Anholt [Fri, 19 Feb 2021 00:31:00 +0000 (16:31 -0800)]
softpipe: Fix the const buffer overflow check.

The size is in bytes, pos is a dword index.

Fixes these asan failures (not tested in CI since we run a fraction):

dEQP-GLES31.functional.shaders.opaque_type_indexing.ubo.const_expression_compute,Crash
dEQP-GLES31.functional.shaders.opaque_type_indexing.ubo.const_literal_compute,Crash

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9162>

3 years agozink: actually disable sample mask tests on ci
Mike Blumenkrantz [Tue, 23 Feb 2021 17:18:54 +0000 (12:18 -0500)]
zink: actually disable sample mask tests on ci

Fixes: 5edbc6148d7 ("zink: disable some builtin-gl-sample-mask sample shading tests on ci")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9227>

3 years agogallium/xlib: Partial fix for glXCopySubBufferMESA
Adam Jackson [Wed, 17 Feb 2021 20:55:26 +0000 (15:55 -0500)]
gallium/xlib: Partial fix for glXCopySubBufferMESA

xmesa_copy_st_framebuffer would attempt to flush from the front buffer
to the display, but we don't actually have an attachment for the front
buffer (just the back) so nothing would happen. Fix this by flushing
fron the back to the display, threading the dirty box through so we
don't update more than we were told to.

This has the virtue of displaying correctly, but glx-copy-sub-buffer
still fails since there is no real front buffer, reads from GL_FRONT
actually read from the back buffer. The test does: clear to red, swap,
clear to green, copy sub-buffer, expect a green square inside of a red
one from the front buffer. Since you're really reading from the back you
instead get solid green.

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

3 years agoandroid: ac/rgp: fix building error
Mauro Rossi [Sat, 20 Feb 2021 01:43:47 +0000 (02:43 +0100)]
android: ac/rgp: fix building error

Include "util/list.h" as per "util/simple_mtx.h" one line later

Fixes the following building error in Android:

In file included from external/mesa/src/amd/common/ac_rgp.c:24:
external/mesa/src/amd/common/ac_rgp.h:31:10: fatal error: 'list.h' file not found
         ^~~~~~~~
1 error generated.

Fixes: 12515d6b ("ac/rgp: add rgp co, col, pso data structures")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4334
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9202>

3 years agoci/v3d: Update expected resuls for piglit
Juan A. Suarez Romero [Tue, 23 Feb 2021 15:20:23 +0000 (16:20 +0100)]
ci/v3d: Update expected resuls for piglit

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9224>

3 years agozink: Remove NULL checks after GET_PROC_ADDR_INSTANCE().
Eric Anholt [Fri, 19 Feb 2021 06:11:20 +0000 (22:11 -0800)]
zink: Remove NULL checks after GET_PROC_ADDR_INSTANCE().

They're already done inside GET_PROC_ADDR*().

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

3 years agozink: Use mesa_loge() for should-never-be-reached initialization errors.
Eric Anholt [Fri, 19 Feb 2021 06:07:56 +0000 (22:07 -0800)]
zink: Use mesa_loge() for should-never-be-reached initialization errors.

dEQP in CI was hitting these, and debug_printf is not enabled on non-debug
(such as debugoptimized or release) builds.  Besides, mesa_loge() gets you
logging on Android, should someone ever do zink for that.

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

3 years agoci/zink: Add tests of gles2, gles3, and gl33 on lavapipe.
Eric Anholt [Fri, 5 Feb 2021 19:19:13 +0000 (11:19 -0800)]
ci/zink: Add tests of gles2, gles3, and gl33 on lavapipe.

This catches a bunch of conformance issues on the current driver stack.

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

3 years agodocs: Document USE_ELF_TLS can work on Windows too
Jesse Natalie [Mon, 22 Feb 2021 19:23:45 +0000 (11:23 -0800)]
docs: Document USE_ELF_TLS can work on Windows too

Reviewed-by: Jose Fonseca <jfonseca@vmware.com.>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9165>

3 years agoglapi: Support "ELF" TLS on Windows
Jesse Natalie [Fri, 19 Feb 2021 22:55:57 +0000 (14:55 -0800)]
glapi: Support "ELF" TLS on Windows

To avoid a massive rename, I'm leaving this as a misnomer, it's not
really ELF TLS, but it's the same concept.

Note that Windows doesn't support thread-local variables imported
or exported between modules, so we can only support this when we're
not using a shared glapi.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4050
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9165>

3 years agoradv: Disable displayable DCC for GFX8 properly.
Bas Nieuwenhuizen [Tue, 23 Feb 2021 16:27:53 +0000 (17:27 +0100)]
radv: Disable displayable DCC for GFX8 properly.

On scanout the GFX8 ac_surface doesn't clear the size but only
doesn't allocate space and hence dcc_offset is 0. This is the same
as radeonsi.

Fixes: 7acb30de8ac ("radv: Enable displayable DCC.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4346
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9221>

3 years agozink: disable some builtin-gl-sample-mask sample shading tests on ci
Mike Blumenkrantz [Tue, 23 Feb 2021 15:28:10 +0000 (10:28 -0500)]
zink: disable some builtin-gl-sample-mask sample shading tests on ci

these are super flaky

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9219>

3 years agomesa: update vao _EnabledWithMapMode in copy_array_object
Pierre-Eric Pelloux-Prayer [Mon, 22 Feb 2021 20:05:57 +0000 (21:05 +0100)]
mesa: update vao _EnabledWithMapMode in copy_array_object

Otherwise it can be out of sync.

Fixes: 306f1ef417a ("mesa: precompute _mesa_get_vao_vp_inputs")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4331
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9199>

3 years agoanv: Fix wait_count missing increment
Lionel Landwerlin [Mon, 22 Feb 2021 16:41:24 +0000 (18:41 +0200)]
anv: Fix wait_count missing increment

If we don't wait on anything, I bet it makes the QueuePresent faster,
but also completely wrong...

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 02f94c33066eff ("anv: don't wait for completion of work on vkQueuePresent()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4276
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9211>

3 years agoac/rgp: define EM_AMDGPU if missing for compatibility
Jan Beich [Sat, 20 Feb 2021 13:27:02 +0000 (13:27 +0000)]
ac/rgp: define EM_AMDGPU if missing for compatibility

EM_AMDGPU isn't defined on DragonFly, FreeBSD, OpenBSD, so use the
same workaround as ac_rtld.c.

src/amd/common/ac_rgp_elf_object_pack.c:382:24: error: use of undeclared identifier 'EM_AMDGPU'
   elf_hdr.e_machine = EM_AMDGPU;
                       ^

Fixes: 110bb2c77dd3 ("ac/rgp: add helper function to write rgp elf oject")
Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9169>

3 years agoac: prefer system EM_AMDGPU definition
Jan Beich [Mon, 22 Feb 2021 10:41:56 +0000 (10:41 +0000)]
ac: prefer system EM_AMDGPU definition

May improve compatibility with systems where EM_AMDGPU value is
different from Linux.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9169>

3 years agoetnaviv: use nir_lower_uniforms_to_ubo(..)
Christian Gmeiner [Thu, 17 Dec 2020 11:39:14 +0000 (12:39 +0100)]
etnaviv: use nir_lower_uniforms_to_ubo(..)

This removes our local copy and fixes the following nir validation problem:
  error: nir_intrinsic_range(instr) != 0 (../src/compiler/nir/nir_validate.c:646)

No piglit or deqp regression seen.

shader-db results for GC3000:

instructions helped:   shaders/deqp_gles2/23470.shader_test VERT:        328 -> 316 (-3.66%)
instructions helped:   shaders/deqp_gles2/23473.shader_test FRAG:        328 -> 316 (-3.66%)
instructions helped:   shaders/glamor/88.shader_test FRAG:               472 -> 452 (-4.24%)
instructions helped:   shaders/chromeos/36.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/24.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/18.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/chromeos/45.shader_test VERT:             60 -> 56 (-6.67%)
instructions helped:   shaders/deqp_gles2/23494.shader_test VERT:        176 -> 164 (-6.82%)
instructions helped:   shaders/deqp_gles2/23497.shader_test FRAG:        176 -> 164 (-6.82%)
instructions helped:   shaders/glamor/82.shader_test FRAG:               280 -> 260 (-7.14%)
instructions helped:   shaders/chromeos/21.shader_test VERT:             56 -> 52 (-7.14%)
instructions helped:   shaders/chromeos/15.shader_test VERT:             56 -> 52 (-7.14%)
instructions helped:   shaders/tesseract/268.shader_test VERT:           152 -> 136 (-10.53%)
instructions helped:   shaders/tesseract/270.shader_test VERT:           184 -> 164 (-10.87%)
instructions helped:   shaders/tesseract/272.shader_test VERT:           216 -> 192 (-11.11%)
instructions helped:   shaders/tesseract/266.shader_test VERT:           88 -> 76 (-13.64%)
instructions helped:   shaders/deqp_gles2/23488.shader_test VERT:        112 -> 96 (-14.29%)
instructions helped:   shaders/deqp_gles2/23491.shader_test FRAG:        112 -> 96 (-14.29%)
instructions helped:   shaders/chromeos/102.shader_test VERT:            168 -> 144 (-14.29%)
instructions helped:   shaders/deqp_gles2/23449.shader_test FRAG:        64 -> 52 (-18.75%)
instructions helped:   shaders/deqp_gles2/23446.shader_test VERT:        64 -> 52 (-18.75%)
instructions helped:   shaders/deqp_gles2/23461.shader_test FRAG:        124 -> 100 (-19.35%)
instructions helped:   shaders/deqp_gles2/23458.shader_test VERT:        124 -> 100 (-19.35%)
instructions helped:   shaders/chromeos/39.shader_test VERT:             124 -> 100 (-19.35%)

temps helped:   shaders/chromeos/102.shader_test VERT:            6 -> 5 (-16.67%)
temps helped:   shaders/deqp_gles2/23470.shader_test VERT:        5 -> 4 (-20.00%)
temps helped:   shaders/deqp_gles2/23473.shader_test FRAG:        5 -> 4 (-20.00%)

temps HURT:   shaders/tesseract/272.shader_test VERT:           6 -> 7 (16.67%)

immediates helped:   shaders/deqp_gles2/23470.shader_test VERT:        24 -> 20 (-16.67%)
immediates helped:   shaders/deqp_gles2/23473.shader_test FRAG:        24 -> 20 (-16.67%)
immediates helped:   shaders/chromeos/102.shader_test VERT:            8 -> 4 (-50.00%)
immediates helped:   shaders/chromeos/39.shader_test VERT:             8 -> 4 (-50.00%)

immediates HURT:   shaders/glamor/88.shader_test FRAG:               32 -> 36 (12.50%)
immediates HURT:   shaders/deqp_gles2/23494.shader_test VERT:        4 -> 8 (100.00%)
immediates HURT:   shaders/deqp_gles2/23497.shader_test FRAG:        4 -> 8 (100.00%)

total instructions in shared programs: 1123728 -> 1123392 (-0.03%)
instructions in affected programs: 3644 -> 3308 (-9.22%)
helped: 24
HURT: 0
helped stats (abs) min: 4 max: 24 x̄: 14.00 x̃: 12
helped stats (rel) min: 3.66% max: 19.35% x̄: 10.74% x̃: 8.83%
95% mean confidence interval for instructions value: -17.11 -10.89
95% mean confidence interval for instructions %-change: -13.03% -8.45%
Instructions are helped.

total temps in shared programs: 86978 -> 86976 (<.01%)
temps in affected programs: 22 -> 20 (-9.09%)
helped: 3
HURT: 1
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 16.67% max: 20.00% x̄: 18.89% x̃: 20.00%
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 temps value: -2.09 1.09
95% mean confidence interval for temps %-change: -38.40% 18.40%
Inconclusive result (value mean confidence interval includes 0).

total immediates in shared programs: 141464 -> 141460 (<.01%)
immediates in affected programs: 104 -> 100 (-3.85%)
helped: 4
HURT: 3
helped stats (abs) min: 4 max: 4 x̄: 4.00 x̃: 4
helped stats (rel) min: 16.67% max: 50.00% x̄: 33.33% x̃: 33.33%
HURT stats (abs)   min: 4 max: 4 x̄: 4.00 x̃: 4
HURT stats (rel)   min: 12.50% max: 100.00% x̄: 70.83% x̃: 100.00%
95% mean confidence interval for immediates value: -4.53 3.38
95% mean confidence interval for immediates %-change: -48.17% 70.79%
Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9039>

3 years agoetnaviv: nir: add ubo lowering pass
Christian Gmeiner [Thu, 24 Dec 2020 12:11:26 +0000 (13:11 +0100)]
etnaviv: nir: add ubo lowering pass

Adds a pass to lower the load_ubo intrinsics for block 0 back
to load_uniform intrinsic.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9039>

3 years agoaco: don't rematerialize exec
Daniel Schürmann [Tue, 23 Feb 2021 14:07:43 +0000 (15:07 +0100)]
aco: don't rematerialize exec

Since exec is not considered a temporary anymore,
we accidentally allowed to rematerialize it.

Fixes: a56ddca4e80a6ef7bb0c44edb4e5b6169510aaca ('aco: make all exec accesses non-temporaries')
Closes: #4327

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9215>

3 years agovc4: let st lower rect tex
Christian Gmeiner [Sat, 6 Feb 2021 20:14:49 +0000 (21:14 +0100)]
vc4: let st lower rect tex

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agoetnaviv: let st lower rect tex
Christian Gmeiner [Sat, 6 Feb 2021 20:12:35 +0000 (21:12 +0100)]
etnaviv: let st lower rect tex

Before this change we used a dummy load_uniform to represent texcoord
scale. That dummy load was converted to a load_const where we are using
the upper 32 bits to store the uniform content type and that breaks nir's
validation. With the new nir_intrinsic_load_texture_scaling we know the
uniform type and do not need to go from load_ubo->load_const (with type
information).

shader-db for GC3000:

instructions helped:   shaders/tesseract/491.shader_test FRAG:           260 -> 248 (-4.62%)
instructions helped:   shaders/tesseract/494.shader_test FRAG:           256 -> 244 (-4.69%)
instructions helped:   shaders/tesseract/238.shader_test FRAG:           244 -> 232 (-4.92%)
instructions helped:   shaders/tesseract/241.shader_test FRAG:           244 -> 232 (-4.92%)
instructions helped:   shaders/tesseract/127.shader_test FRAG:           80 -> 76 (-5.00%)
instructions helped:   shaders/tesseract/130.shader_test FRAG:           156 -> 148 (-5.13%)
instructions helped:   shaders/tesseract/226.shader_test FRAG:           204 -> 192 (-5.88%)
instructions helped:   shaders/tesseract/229.shader_test FRAG:           204 -> 192 (-5.88%)
instructions helped:   shaders/tesseract/217.shader_test FRAG:           164 -> 152 (-7.32%)
instructions helped:   shaders/tesseract/214.shader_test FRAG:           164 -> 152 (-7.32%)
instructions helped:   shaders/tesseract/205.shader_test FRAG:           124 -> 112 (-9.68%)
instructions helped:   shaders/tesseract/202.shader_test FRAG:           124 -> 112 (-9.68%)
instructions helped:   shaders/tesseract/169.shader_test FRAG:           36 -> 32 (-11.11%)
instructions helped:   shaders/tesseract/166.shader_test FRAG:           36 -> 32 (-11.11%)
instructions helped:   shaders/tesseract/118.shader_test FRAG:           32 -> 28 (-12.50%)
instructions helped:   shaders/tesseract/181.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/178.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/121.shader_test FRAG:           60 -> 52 (-13.33%)
instructions helped:   shaders/tesseract/193.shader_test FRAG:           84 -> 72 (-14.29%)
instructions helped:   shaders/tesseract/190.shader_test FRAG:           84 -> 72 (-14.29%)

temps HURT:   shaders/tesseract/494.shader_test FRAG:           6 -> 7 (16.67%)
temps HURT:   shaders/tesseract/491.shader_test FRAG:           6 -> 7 (16.67%)

total instructions in shared programs: 1122112 -> 1121920 (-0.02%)
instructions in affected programs: 2676 -> 2484 (-7.17%)
helped: 20
HURT: 0
helped stats (abs) min: 4 max: 12 x̄: 9.60 x̃: 12
helped stats (rel) min: 4.62% max: 14.29% x̄: 8.92% x̃: 8.50%
95% mean confidence interval for instructions value: -11.14 -8.06
95% mean confidence interval for instructions %-change: -10.65% -7.18%
Instructions are helped.

total temps in shared programs: 86942 -> 86944 (<.01%)
temps in affected programs: 12 -> 14 (16.67%)
helped: 0
HURT: 2

total immediates in shared programs: 141216 -> 141216 (0.00%)
immediates in affected programs: 0 -> 0
helped: 0
HURT: 0

total loops in shared programs: 0 -> 0
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   0
GAINED: 0

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agoetnaviv: nir: support nir_intrinsic_load_texture_rect_scaling
Christian Gmeiner [Sat, 6 Feb 2021 20:09:19 +0000 (21:09 +0100)]
etnaviv: nir: support nir_intrinsic_load_texture_rect_scaling

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agottn: lower rectangle textures if not supported
Christian Gmeiner [Fri, 19 Feb 2021 08:52:31 +0000 (09:52 +0100)]
ttn: lower rectangle textures if not supported

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agogallium/st: lower rectangle textures if not supported
Christian Gmeiner [Mon, 1 Feb 2021 10:48:02 +0000 (11:48 +0100)]
gallium/st: lower rectangle textures if not supported

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agogallium: add PIPE_CAP_TEXRECT
Christian Gmeiner [Mon, 1 Feb 2021 10:44:45 +0000 (11:44 +0100)]
gallium: add PIPE_CAP_TEXRECT

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agonir/lower_tex: wider usage of nir_tex_instr_src_index(..)
Christian Gmeiner [Thu, 11 Feb 2021 12:13:42 +0000 (13:13 +0100)]
nir/lower_tex: wider usage of nir_tex_instr_src_index(..)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agonir/lower_tex: 'txs free' tex_rect lowering
Christian Gmeiner [Mon, 1 Feb 2021 10:13:19 +0000 (11:13 +0100)]
nir/lower_tex: 'txs free' tex_rect lowering

GPUs without native txs support (and without an emulation in sw)
can use this new lowering. Also it saves us from doing int/float
conversions.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agonir: add has_txs flag
Christian Gmeiner [Mon, 1 Feb 2021 10:05:48 +0000 (11:05 +0100)]
nir: add has_txs flag

Some nir lowerings might need to know if txs is supported by
the backend.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agonir: add load_texture_rect_scaling
Christian Gmeiner [Fri, 13 Nov 2020 09:35:38 +0000 (10:35 +0100)]
nir: add load_texture_rect_scaling

Will be used in a different form of lower_rect tex lowering.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8898>

3 years agoradv: add support for instruction timing with RGP
Samuel Pitoiset [Thu, 18 Feb 2021 10:23:19 +0000 (11:23 +0100)]
radv: add support for instruction timing with RGP

This is probably the most useful feature with SQTT/RGP.

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/9130>

3 years agoradv: add support for exporting pipelines with RGP
Samuel Pitoiset [Tue, 16 Feb 2021 13:09:20 +0000 (14:09 +0100)]
radv: add support for exporting pipelines with RGP

This is still experimental and only enabled with
RADV_THREAD_TRACE_PIPELINE to avoid breaking existing support.

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/9130>

3 years agoradv: store a pointer to the code in radv_shader_variant
Samuel Pitoiset [Tue, 16 Feb 2021 13:08:34 +0000 (14:08 +0100)]
radv: store a pointer to the code in radv_shader_variant

This will be used by SQTT to dump the disassembly.

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/9130>

3 years agoradv: Enable displayable DCC.
Bas Nieuwenhuizen [Mon, 26 Oct 2020 22:48:44 +0000 (23:48 +0100)]
radv: Enable displayable DCC.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoradv: Use ac_surface DCC settings for shareable images.
Bas Nieuwenhuizen [Mon, 26 Oct 2020 22:39:36 +0000 (23:39 +0100)]
radv: Use ac_surface DCC settings for shareable images.

On GFX10 the settings for displayable DCC are different than those
for normal texturing.

This is technically a slight pessimization as ac_surface does not
know about textures that don't have to be sampled. However, for color
surfaces this is a very unlikely situation as presumably even MSAA
images have to be resolved (potentially using texture HW).

So in practice this should be equal for everything except displayable DCC.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoradv: Add DCC info to the metadata.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 09:57:06 +0000 (11:57 +0200)]
radv: Add DCC info to the metadata.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoradv: Implement displayable DCC retiling.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 09:54:36 +0000 (11:54 +0200)]
radv: Implement displayable DCC retiling.

Straightforward implementation using the retile map from radeonsi.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoradv: Implement initialization of displayable DCC.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 01:32:19 +0000 (03:32 +0200)]
radv: Implement initialization of displayable DCC.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoamd/common: Add retile map size helper.
Bas Nieuwenhuizen [Fri, 19 Feb 2021 02:58:28 +0000 (03:58 +0100)]
amd/common: Add retile map size helper.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoradv: Use shared code for setting opaque metadata.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 01:18:25 +0000 (03:18 +0200)]
radv: Use shared code for setting opaque metadata.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoradv: Handle UMD metadata on import.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 00:20:41 +0000 (02:20 +0200)]
radv: Handle UMD metadata on import.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoamd/common: constify ac_surface_set_umd_metata.
Bas Nieuwenhuizen [Wed, 5 Aug 2020 00:20:18 +0000 (02:20 +0200)]
amd/common: constify ac_surface_set_umd_metata.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9042>

3 years agoaco/lower_phis: fix all_preds_uniform with continue_or_break
Rhys Perry [Mon, 22 Feb 2021 15:05:32 +0000 (15:05 +0000)]
aco/lower_phis: fix all_preds_uniform with continue_or_break

Found in a Death Stranding shader with loop unrolling disabled.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 9a089baff1a ("aco: optimize boolean phis with uniform selections")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9193>

3 years agobroadcom/compiler: skip unnecessary unifa writes
Iago Toral Quiroga [Thu, 18 Feb 2021 07:32:13 +0000 (08:32 +0100)]
broadcom/compiler: skip unnecessary unifa writes

If a new UBO load happens to read exactly at the offset right after the
previous UBO load (something that is fairly common, for example when
reading a matrix), we can skip the unifa write (with its 3 delay slots)
and just continue to call ldunifa to continue reading consecutive addresses.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9128>

3 years agobroadcom/compiler: add a constant alu optimization pass
Iago Toral Quiroga [Wed, 17 Feb 2021 10:17:25 +0000 (11:17 +0100)]
broadcom/compiler: add a constant alu optimization pass

Currently this is useful to clean up after DCEing leading ldunifa
instructions, but it can be expanded to handle more cases which
may allow to simplify the compiler code in places where we have
been trying to optimize manually for similar cases.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9128>

3 years agobroadcom/compiler: remove unused leading ldunifa
Iago Toral Quiroga [Tue, 16 Feb 2021 11:08:05 +0000 (12:08 +0100)]
broadcom/compiler: remove unused leading ldunifa

This requires that we go back to the unifa write and update the address
to jump over the unused leading component.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9128>

3 years agobroadcom/compiler: allow dead code elimination of unused trailing ldunifa
Iago Toral Quiroga [Tue, 16 Feb 2021 10:04:44 +0000 (11:04 +0100)]
broadcom/compiler: allow dead code elimination of unused trailing ldunifa

If a ldunifa is the last in a sequence and is not used, we can safely
eliminate it.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9128>

3 years agobroadcom/compiler: fix ldunif optimization
Iago Toral Quiroga [Fri, 19 Feb 2021 10:08:36 +0000 (11:08 +0100)]
broadcom/compiler: fix ldunif optimization

When we look back for a previous uniform definition we want to
start looking from the current position of the cursor, not the
end of the current block. The latter only works when translating
from NIR, since in that case both always match, but any optimization
pass may rewrite code and emit uniforms at any place in the middle of
the program.

Also, ntq_store_dest expects result to be written by the last instruction
to handle the case where it is stored to a NIR register. That won't be
the case if the result comes from an optimized uniform, so in that case
we need to insert a MOV, like we do in non-uniform control flow.

v2: fix ntq_store_dest for optimized uniforms.

Fixes: 14af7b3085 ('broadcom/compiler: don't emit redundant ldunif')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9128>

3 years agovulkan: Use typed outarray API
James Park [Wed, 3 Feb 2021 18:29:26 +0000 (10:29 -0800)]
vulkan: Use typed outarray API

MSVC cannot perform GCC __typeof__ for C code. (C++ has decltype.)

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>

3 years agomeson/llvm: add native for gallium swrast
Dave Airlie [Mon, 22 Feb 2021 01:08:45 +0000 (11:08 +1000)]
meson/llvm: add native for gallium swrast

If we are building llvmpipe and lavapipe we want native in this
list.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>

3 years agolavapipe: fix icd generation for windows
Dave Airlie [Mon, 22 Feb 2021 02:01:59 +0000 (18:01 -0800)]
lavapipe: fix icd generation for windows

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>

3 years agolavapipe: add dll definition file instead of using PUBLIC
Dave Airlie [Mon, 22 Feb 2021 01:27:20 +0000 (17:27 -0800)]
lavapipe: add dll definition file instead of using PUBLIC

This avoids conflicts with the definitions in vk_icd.h

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>

3 years agolavapipe: fix msvc initialiser
Dave Airlie [Mon, 22 Feb 2021 01:14:05 +0000 (11:14 +1000)]
lavapipe: fix msvc initialiser

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>

3 years agolavapipe: use the common icd generator
Dave Airlie [Tue, 16 Feb 2021 03:56:54 +0000 (13:56 +1000)]
lavapipe: use the common icd generator

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>