platform/upstream/mesa.git
3 years agofreedreno/ir3/parser: cat1 instructions can write relative GPR
Rob Clark [Sat, 19 Dec 2020 22:15:13 +0000 (14:15 -0800)]
freedreno/ir3/parser: cat1 instructions can write relative GPR

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

3 years agofreedreno/ir3/parser: Add new cat0 instructions
Rob Clark [Sat, 19 Dec 2020 22:05:58 +0000 (14:05 -0800)]
freedreno/ir3/parser: Add new cat0 instructions

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

3 years agofreedreno/ir3: Various cat0 updates
Rob Clark [Sat, 19 Dec 2020 21:46:59 +0000 (13:46 -0800)]
freedreno/ir3: Various cat0 updates

Update the IR and packer to handle the additional cat0 fields, in
prep for adding support in the assembler (in prep for adding round
trip parsing/packing test coverage).

We don't actually use these yet from the ir3 compiler, but at least
this is one less thing to worry about when we start trying to use
them.

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

3 years agofreedreno/ir3/parser: Reset lexer when input changes
Rob Clark [Sat, 19 Dec 2020 21:17:36 +0000 (13:17 -0800)]
freedreno/ir3/parser: Reset lexer when input changes

Otherwise, in case of parse errors, the lexer state can still contain
buffered input from the previous parse.

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

3 years agofreedreno/ir3: Move assembler error handling
Rob Clark [Sat, 19 Dec 2020 19:45:31 +0000 (11:45 -0800)]
freedreno/ir3: Move assembler error handling

Move out of ir3_parse_asm() so we can re-use it in disasm test for
round-tripping asm/disasm.  We don't want failures to be fatal (yet)
as there are still some things missing from the assembler.

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

3 years agofreedreno/ir3: Add some more disasm test vectors
Rob Clark [Tue, 15 Dec 2020 17:58:15 +0000 (09:58 -0800)]
freedreno/ir3: Add some more disasm test vectors

Various things that I noticed which were initially wrong with the xml
based disasm.

These were extracted from a collection of unique instructions extracted
from deqp traces, which unfortunately looses the link back to the
original test case.

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

3 years agofreedreno/ir3: Fix mova1 disasm
Rob Clark [Tue, 15 Dec 2020 18:50:28 +0000 (10:50 -0800)]
freedreno/ir3: Fix mova1 disasm

Yet another mnemonic for mov

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

3 years agofreedreno/ir3: Fix half-immed decoding issues
Rob Clark [Mon, 14 Dec 2020 18:56:04 +0000 (10:56 -0800)]
freedreno/ir3: Fix half-immed decoding issues

For mov, half-float immeds are packed in 16b.  In other cases, the
syntax for a half-immed is a bit different (ie. `h(1)`)

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

3 years agoir3: Support MOVMSK
Connor Abbott [Mon, 14 Sep 2020 10:15:16 +0000 (12:15 +0200)]
ir3: Support MOVMSK

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

3 years agoir3: Better rules for shared src copy propagation
Connor Abbott [Wed, 16 Sep 2020 14:44:08 +0000 (16:44 +0200)]
ir3: Better rules for shared src copy propagation

It turns out that the actual rule for when a source/dest can be shared
is that it has to be cat1, cat2, or cat3. Allow this and silence
warnings.

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

3 years agoir3: Rename high registers to shared registers
Connor Abbott [Thu, 10 Sep 2020 10:14:24 +0000 (12:14 +0200)]
ir3: Rename high registers to shared registers

This more accurately reflects what they are.

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

3 years agofreedreno: Enable GLSL 3.30, updating us to GL 3.3 contexts
Danylo Piliaiev [Wed, 30 Dec 2020 13:59:46 +0000 (15:59 +0200)]
freedreno: Enable GLSL 3.30, updating us to GL 3.3 contexts

All necessary features are already supported.

GL33 CTS failures:
 KHR-GL33.texture_swizzle.smoke - timeouts, passes otherwise
 KHR-GL33.cull_distance.coverage - see
  https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/2673
  fix is not in the public repo yet.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8270>

3 years agopan: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 08:32:56 +0000 (09:32 +0100)]
pan: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agomicrosoft/compiler: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 08:29:05 +0000 (09:29 +0100)]
microsoft/compiler: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agoanv: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 08:14:32 +0000 (09:14 +0100)]
anv: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agointel/compiler: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 08:14:08 +0000 (09:14 +0100)]
intel/compiler: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agointel/blorp: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 08:13:30 +0000 (09:13 +0100)]
intel/blorp: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agovc4: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 07:51:29 +0000 (08:51 +0100)]
vc4: use intrinsic builders

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

3 years agoiris: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 07:43:52 +0000 (08:43 +0100)]
iris: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agod3d12: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 07:40:37 +0000 (08:40 +0100)]
d3d12: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agotu: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 07:31:11 +0000 (08:31 +0100)]
tu: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agozink: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 06:42:52 +0000 (07:42 +0100)]
zink: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agost: use intrinsic builders
Christian Gmeiner [Sat, 2 Jan 2021 06:36:02 +0000 (07:36 +0100)]
st: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agoir3: use intrinsic builders
Christian Gmeiner [Fri, 1 Jan 2021 20:33:35 +0000 (21:33 +0100)]
ir3: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agov3dv: use intrinsic builders
Christian Gmeiner [Fri, 1 Jan 2021 19:52:20 +0000 (20:52 +0100)]
v3dv: use intrinsic builders

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

3 years agov3d: use intrinsic builders
Christian Gmeiner [Fri, 1 Jan 2021 19:51:03 +0000 (20:51 +0100)]
v3d: use intrinsic builders

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

3 years agonir: use intrinsic builders
Christian Gmeiner [Fri, 1 Jan 2021 19:37:53 +0000 (20:37 +0100)]
nir: use intrinsic builders

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

3 years agotgsi_to_nir: use intrinsic builders
Christian Gmeiner [Fri, 1 Jan 2021 19:53:51 +0000 (20:53 +0100)]
tgsi_to_nir: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agomesa/prog_to_nir: use intrinsic builders
Christian Gmeiner [Fri, 1 Jan 2021 19:33:32 +0000 (20:33 +0100)]
mesa/prog_to_nir: use intrinsic builders

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8295>

3 years agonir: preserve explicit_binding in lower_atomics_to_ssbo
Mike Blumenkrantz [Fri, 7 Aug 2020 20:19:19 +0000 (16:19 -0400)]
nir: preserve explicit_binding in lower_atomics_to_ssbo

it's important to be able to tell whether this is explicitly set by the
user

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

3 years agozink: remove support for fcsel
Erik Faye-Lund [Wed, 6 Jan 2021 05:59:27 +0000 (06:59 +0100)]
zink: remove support for fcsel

fcsel is only emitted by bool -> float lowering. We used to do that a
long time ago, but no longer. So we don't need to support this opcode
any longer.

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

3 years agozink: also lower scmp for soft-fp
Erik Faye-Lund [Wed, 6 Jan 2021 06:38:41 +0000 (07:38 +0100)]
zink: also lower scmp for soft-fp

We recently added two versions of these options, due to soft-fp support.
So let's also add the lowering to the soft-fp version.

Fixes: 43302ead383 ("zink: use lower_scmp instead of open-coding")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8347>

3 years agopanfrost: Fix AFBC on Bifrost v6
Boris Brezillon [Tue, 5 Jan 2021 13:02:07 +0000 (14:02 +0100)]
panfrost: Fix AFBC on Bifrost v6

The AFBC layout of RT/ZS-extension descriptors on Bifrost v6 matches the
v7 one except for the Block Format field. Update the set_buf() functions
accordingly.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8328>

3 years agoradeonsi: enable vrs2x2 coarse shading if flat shading (v9)
Yogesh mohan marimuthu [Mon, 14 Dec 2020 15:56:27 +0000 (21:26 +0530)]
radeonsi: enable vrs2x2 coarse shading if flat shading (v9)

Enable vrs2x2 coarse shading if flat shading as per
idea and guidance given by Marek.

is_flat_shading variable in struct si_shader_info is set
based on the data from gather_intrinsic_info() function
and struct si_state_rasterizer. If is_flat_shading_variable
is set, then in function si_emit_db_render_state() vrs2x2
shading is enabled in hardware.

v2: Fix review comments from Pierre-Eric. Code optimizations.
v3: Fix indentation style issue.
v4: Fix review comments from Marek. Fixed logical issue pointed
    by Marek where info->is_flat_shading variable can be corrupted
    and other code cleanup.
v5: Make the code compact as suggested by Pierre-Eric.
v6: Fix new review comments from Marek.
v7: use info->uses_interp_color variable fix from Marek.
v8: Fix coding style comment from Marek.
v9: Add uses_fbfetch_output check as suggested by Marek.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8161>

3 years agogallium/ntt: Add support for PIPE_CAP_LOAD_CONSTBUF.
Eric Anholt [Mon, 21 Dec 2020 23:29:19 +0000 (15:29 -0800)]
gallium/ntt: Add support for PIPE_CAP_LOAD_CONSTBUF.

We needed to do this anyway to finish enabling NTT in general, but more
importantly: when we enabled sending NIR to the draw module, that broke
PIPE_CAP_LOAD_CONSTBUF drivers in the select/feedback paths if LLVM was
disabled.

Fixes: 44b7e1497f91 ("st/mesa: don't generate TGSI for the draw VS because it now supports NIR too")
(along with the rest of this MR)

Closes: #3996
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8196>

3 years agogallium/ntt: Fix load_ubo_vec4 buffer index setup.
Eric Anholt [Tue, 22 Dec 2020 00:22:03 +0000 (16:22 -0800)]
gallium/ntt: Fix load_ubo_vec4 buffer index setup.

I had a funny +1 in nir_to_tgsi's load_ubo lowering on the buffer index,
because I hadn't set lower_uniform_to_ubo for softpipe.  This removes that
weirdness in favor of just using lower_uniform_to_ubo, regardless of
driver preference (which matters if a NIR-native driver had it set, and
then the gallium draw module triggered the non-LLVM TGSI fallback path
that hit NTT).

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

3 years agogallium/ntt: Fix dynamic indirect indexing of per_vertex_input.
Eric Anholt [Tue, 22 Dec 2020 01:12:02 +0000 (17:12 -0800)]
gallium/ntt: Fix dynamic indirect indexing of per_vertex_input.

It was off by one due to some copy and paste from UBO handling.

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

3 years agogallium/ntt: Fix emitting UBO declarations.
Eric Anholt [Fri, 11 Dec 2020 21:11:26 +0000 (13:11 -0800)]
gallium/ntt: Fix emitting UBO declarations.

Fixes: d70fff99c5bc ("nir: Use a single list for all shader variables")

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

3 years agogallium/tgsi_exec: Add support for PIPE_CAP_LOAD_CONSTBUF.
Eric Anholt [Tue, 5 Jan 2021 19:15:06 +0000 (11:15 -0800)]
gallium/tgsi_exec: Add support for PIPE_CAP_LOAD_CONSTBUF.

Now that we can end up in nir-to-tgsi in the draw fallback paths of
drivers with that flag set, we need to support it.

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

3 years agogallium/tgsi_exec: Refactor to fix CS local memory overflow checks.
Eric Anholt [Tue, 5 Jan 2021 19:12:11 +0000 (11:12 -0800)]
gallium/tgsi_exec: Refactor to fix CS local memory overflow checks.

It was OK because right now we only execute in the first channel of the
CS, but if you wanted to extend that then you'd need to check each
channel.  We already had what we needed for SSBOs, so just reuse it.

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

3 years agogallium/tgsi_exec: Fix assertion failure about missing constbufs.
Eric Anholt [Thu, 10 Dec 2020 19:34:48 +0000 (11:34 -0800)]
gallium/tgsi_exec: Fix assertion failure about missing constbufs.

GL by default gives you UB when you access a missing constbuf, and we were
crashing on debug builds in that case.  More importantly, we were
assertion failing even under valid circumstances, when a !ExecMask channel
had a bad value for the indirect buffer index and we tried to load from it
anyway.

In removing the assertion, also sink the buf declaration to after we've
done the bounds check that determines that there's a constbuf actually
bound to this index.

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

3 years agod3d12: Don't allocate mappable textures
Jesse Natalie [Mon, 14 Dec 2020 19:59:53 +0000 (11:59 -0800)]
d3d12: Don't allocate mappable textures

There's not really a reason to directly map textures. Doing so
requires the texture to be allocated in system RAM instead of
video RAM, which means all GPU access to it would be needlessly slow.

Notably, the one texture type that was allocated this way is the
display target texture for the software driver path. Instead, use
pipe_transfer_map to be able to copy the texture to system RAM.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>

3 years agod3d12: Use an appropriate pipe resource usage for map intermediates
Jesse Natalie [Mon, 14 Dec 2020 19:53:39 +0000 (11:53 -0800)]
d3d12: Use an appropriate pipe resource usage for map intermediates

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>

3 years agod3d12: Use buffer pipe usage to inform allocation
Jesse Natalie [Mon, 14 Dec 2020 19:53:13 +0000 (11:53 -0800)]
d3d12: Use buffer pipe usage to inform allocation

For non-CPU-accessible pipe resource types (DEFAULT/IMMUTABLE),
allocate non-CPU-accessible buffers directly from the cache_bufmgr.
Update the d3d12_bo creation to handle nonmappable buffers.

For CPU-write-only (DYNAMIC/STREAM), use the upload slab_bufmgr.
Update this slab manager to use CPU_WRITE | GPU_READ PB usage.

For CPU-read-write (STAGING), use the readback_slab_bufmgr.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>

3 years agod3d12: Add a slab bufmgr for readback buffers
Jesse Natalie [Mon, 14 Dec 2020 19:45:16 +0000 (11:45 -0800)]
d3d12: Add a slab bufmgr for readback buffers

Readback (GPU write, CPU read) should use different CPU page
properties compared to upload (write-back vs write-combined).

A future commit will start to respect these PB usage flags.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>

3 years agod3d12: Add a path for mapping of not-directly-mappable buffers
Jesse Natalie [Mon, 14 Dec 2020 19:42:49 +0000 (11:42 -0800)]
d3d12: Add a path for mapping of not-directly-mappable buffers

Currently all buffers are allocated as mappable, but a future
commit will change that so that some buffers can be allocated
directly in non-CPU-accessible memory for improved performance.

Note that the returned pointer must be appropriately offset from
a 64-byte-aligned base pointer, so if offsets are used, the data
will be read/written to an offset region in the staging buffer.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>

3 years agonir: Update saturated float->int/uint conversion algorithm
Jesse Natalie [Mon, 28 Dec 2020 23:45:58 +0000 (15:45 -0800)]
nir: Update saturated float->int/uint conversion algorithm

The mantissa for a float doesn't contain enough data to accurately represent
the min/max values for some destination types. Instead of clamping before
converting, clamp after converting when coming from floats. This improves
conformance of CL conversions, specifically for float -> long/ulong with
int64 emulation enabled.

Refactors the limit determination from the clamp, so we can determine
limits for the dest type (int/uint) in both the source (float) and dest
type. The limit as a float is used for comparison, while the limit as a
dest type is used for bcsel.

Important note is that the comparison is inverted to fge instead of flt,
so the bcsel chooses the direct int/uint over the converted float in the
case where the comparison comes up equal, but the conversion can't produce
the exact min/max value.

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

3 years agofreedreno/a5xx: Move link_stream_out after VPC_VAR_DISABLE like on a6xx.
Eric Anholt [Mon, 4 Jan 2021 23:32:56 +0000 (15:32 -0800)]
freedreno/a5xx: Move link_stream_out after VPC_VAR_DISABLE like on a6xx.

Since we've got issues on a5xx xfb that we don't on a6xx, I've been
looking at making them line up a bit better.  No change on tests.

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

3 years agofreedreno/a5xx: Drop redundant stream output linking check.
Eric Anholt [Mon, 4 Jan 2021 23:25:17 +0000 (15:25 -0800)]
freedreno/a5xx: Drop redundant stream output linking check.

The link function just loops over the num_outputs.  Brings us closer to
a6xx.

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

3 years agofreedreno/ir3: Deduplicate link_stream_out.
Eric Anholt [Mon, 4 Jan 2021 23:23:02 +0000 (15:23 -0800)]
freedreno/ir3: Deduplicate link_stream_out.

All 3 copies were the same other than style tweaks.

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

3 years agozink: use lower_scmp instead of open-coding
Erik Faye-Lund [Tue, 5 Jan 2021 17:36:09 +0000 (18:36 +0100)]
zink: use lower_scmp instead of open-coding

We already have the proper lowering in NIR for this, so there's no point
in doing our own implementations of these. The end result is the same
code anyway.

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

3 years agofreedreno/a5xx: implement transform feedback resuming
Danylo Piliaiev [Thu, 31 Dec 2020 13:54:10 +0000 (15:54 +0200)]
freedreno/a5xx: implement transform feedback resuming

Each transform feedback target should have a separate buffer
for an offset from which to resume, instead of just having
one buffer per binding point. Otherwise, if transform feedback
is paused and other tf object is bound - the offset of the
previous tf object would be lost.

Fixes CTS tests:
 dEQP-GLES3.functional.transform_feedback.*triangles*

Fixes Piglit tests:
 gl-3.1-primitive-restart-xfb flush
 gles-3.0-transform-feedback-uniform-buffer-object
 arb_transform_feedback2-change-objects-while-paused
 arb_transform_feedback2-change-objects-while-paused_gles3
 ext_transform_feedback-intervening-read

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8281>

3 years agofreedreno/a6xx: fix transform feedback resuming
Danylo Piliaiev [Thu, 31 Dec 2020 12:49:12 +0000 (14:49 +0200)]
freedreno/a6xx: fix transform feedback resuming

Each transform feedback target should have a separate buffer
for an offset from which to resume, instead of just having
one buffer per binding point. Otherwise, if transform feedback
is paused and other tf object is bound - the offset of the
previous tf object would be lost.

Fixes Piglit tests:
 arb_transform_feedback2-change-objects-while-paused
 arb_transform_feedback2-change-objects-while-paused_gles3
 ext_transform_feedback-alignment 4
 ext_transform_feedback-alignment 8
 ext_transform_feedback-alignment 12
 ext_transform_feedback-change-size offset-grow
 ext_transform_feedback-change-size offset-shrink
 ext_transform_feedback-change-size range-grow
 ext_transform_feedback-change-size range-shrink
 ext_transform_feedback-immediate-reuse-uniform-buffer
 ext_transform_feedback-position *

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8281>

3 years agozink: handle non-const offsets for txf/tg4 ops
Mike Blumenkrantz [Tue, 5 Jan 2021 14:08:33 +0000 (09:08 -0500)]
zink: handle non-const offsets for txf/tg4 ops

required for gl_spirv handling and tg4

Fixes: b77f43f2539 ("zink: use ConstOffset for nir_tex_src_offset")

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

3 years agogallium/dri: Use per-screen DRI extension list
James Jones [Thu, 15 Oct 2020 21:17:16 +0000 (14:17 -0700)]
gallium/dri: Use per-screen DRI extension list

Some DRI extension features are enabled/disabled
based on capabilities of the gallium pipe_screen
associated with the DRI screen. Additionally, the
list of extensions enabled also varied based on
features requested by the screen creator. However,
prior to this change the extension list and
extension definition structures within it were
global variables, meaning the last screen
initialized ended up defining the DRI capabilities
of all screens.

This change instead stores a copy of the
extensions which vary per screen, as well as a
copy of the extension list itself in the gallium
DRI screen structure, allowing them to vary per
screen.

Closes: https://gitlab.freedesktop.org/drm/nouveau/issues/9

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7175>

3 years agogallium/dri: Factor out DRI extension setup code
James Jones [Thu, 15 Oct 2020 21:30:32 +0000 (14:30 -0700)]
gallium/dri: Factor out DRI extension setup code

Share the DRI extension setup code between
dri2_init_screen and dri_kms_init_screen. There's
currently very little difference, and the sharing
will make a subsequent change to refactor this
code to use per-screen extension lists easier.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7175>

3 years agozink: use ConstOffset for nir_tex_src_offset
Erik Faye-Lund [Tue, 5 Jan 2021 10:58:28 +0000 (11:58 +0100)]
zink: use ConstOffset for nir_tex_src_offset

Quote from the OpenGL Shading Language spec, version 4.40, section 8.9.2
"Texel Lookup Functions":

> The offset value must be a constant expression.

So, until we start consuming SPIR-V shaders, it seems we don't need to
deal with non-constant offsets.

This means we can avoid lowering this away in some cases.

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

3 years agozink: do not reserve or pack fragment outputs
Erik Faye-Lund [Wed, 25 Nov 2020 11:43:46 +0000 (12:43 +0100)]
zink: do not reserve or pack fragment outputs

These are completely unrelated to other shader IO variables, so they
don't need this logic.

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

3 years agozink: do not use reservations for stream-out
Erik Faye-Lund [Tue, 24 Nov 2020 18:08:47 +0000 (19:08 +0100)]
zink: do not use reservations for stream-out

reservations are accumulated for all shader-stages in a program without
resetting it. But stream-out is completely orthogonal to all other
inputs and outputs, so they don't matter for this stuff at all.

So let's drop considering reservations here, and simply count how many
generic outputs we have here instead.

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

3 years agozink: destroy device and instance
Erik Faye-Lund [Tue, 15 Dec 2020 09:42:11 +0000 (10:42 +0100)]
zink: destroy device and instance

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

3 years agozink: destroy transfer-helper
Erik Faye-Lund [Tue, 15 Dec 2020 09:41:57 +0000 (10:41 +0100)]
zink: destroy transfer-helper

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

3 years agozink: free sets and hash-tables in context
Erik Faye-Lund [Tue, 15 Dec 2020 09:41:03 +0000 (10:41 +0100)]
zink: free sets and hash-tables in context

Up until now, we've simply leaked all of these. Let's try to do better.

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

3 years agozink: dot leak dummy_buffer
Erik Faye-Lund [Tue, 15 Dec 2020 09:39:46 +0000 (10:39 +0100)]
zink: dot leak dummy_buffer

Fixes: 8736ffae2ed ("zink: replace unset buffer with a dummy-buffer")

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

3 years agozink: do not leak vertex element state
Erik Faye-Lund [Tue, 15 Dec 2020 09:39:15 +0000 (10:39 +0100)]
zink: do not leak vertex element state

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

3 years agozink: release batch memory
Erik Faye-Lund [Tue, 15 Dec 2020 09:38:07 +0000 (10:38 +0100)]
zink: release batch memory

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

3 years agozink: destroy blitter before destroying batches
Erik Faye-Lund [Tue, 15 Dec 2020 09:35:32 +0000 (10:35 +0100)]
zink: destroy blitter before destroying batches

Destroying the blitter frees samplers, which pushes the sampler-handles
onto the batches' zombie-sampler lists. So if we want to properly clean
these zombie-samplers up, we need to first get them onto the list so
we'll know about them in time.

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

3 years agozink: factor out zink_batch_release-helper
Erik Faye-Lund [Tue, 15 Dec 2020 09:33:58 +0000 (10:33 +0100)]
zink: factor out zink_batch_release-helper

This will be useful for making sure everything has gotten cleaned up
properly.

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

3 years agozink: do not open-code CALLOC_STRUCT
Erik Faye-Lund [Tue, 15 Dec 2020 09:38:34 +0000 (10:38 +0100)]
zink: do not open-code CALLOC_STRUCT

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

3 years agofeatures: mark off GL 4.1 for zink
Mike Blumenkrantz [Tue, 5 Jan 2021 13:47:29 +0000 (08:47 -0500)]
features: mark off GL 4.1 for zink

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

3 years agozink: GLSL 410
Mike Blumenkrantz [Mon, 3 Aug 2020 13:12:11 +0000 (09:12 -0400)]
zink: GLSL 410

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

3 years agofeatures: mark off GL 4.0 for zink
Mike Blumenkrantz [Tue, 5 Jan 2021 13:46:35 +0000 (08:46 -0500)]
features: mark off GL 4.0 for zink

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

3 years agozink: GLSL 4.00
Mike Blumenkrantz [Thu, 30 Jul 2020 00:34:41 +0000 (20:34 -0400)]
zink: GLSL 4.00

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

3 years agozink: handle arrays of ubos
Mike Blumenkrantz [Thu, 30 Jul 2020 00:33:50 +0000 (20:33 -0400)]
zink: handle arrays of ubos

with the nir pass removing all dynamic indexing, all that's needed here
is generating extra binding points for each array member, as everything else
is already handled

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

3 years agozink: run nir_lower_dynamic_bo_access
Mike Blumenkrantz [Wed, 29 Jul 2020 19:30:09 +0000 (15:30 -0400)]
zink: run nir_lower_dynamic_bo_access

this fixes up most cases of dynamic bo loading

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

3 years agozink: handle vertex streams
Mike Blumenkrantz [Thu, 30 Jul 2020 18:11:21 +0000 (14:11 -0400)]
zink: handle vertex streams

we already support all this, it's just a matter of slapping on some Stream
decoration flex tape

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

3 years agozink: enable PIPE_CAP_START_INSTANCE
Mike Blumenkrantz [Mon, 3 Aug 2020 19:37:35 +0000 (15:37 -0400)]
zink: enable PIPE_CAP_START_INSTANCE

and add feature

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

3 years agozink: always load (gl_InstanceID - gl_BaseInstance) when loading gl_InstanceID
Mike Blumenkrantz [Mon, 3 Aug 2020 19:34:38 +0000 (15:34 -0400)]
zink: always load (gl_InstanceID - gl_BaseInstance) when loading gl_InstanceID

gl's values here always begin at 0, while vk begins with the firstInstance param
used in the current draw command

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

3 years agoradv: enable TC-compat HTILE in GENERAL on GFX10+
Samuel Pitoiset [Thu, 10 Dec 2020 17:29:03 +0000 (18:29 +0100)]
radv: enable TC-compat HTILE in GENERAL on GFX10+

GFX10+ supports compressed writes to HTILE, so it should just work
to skip decompressions when transitioning from/to GENERAL.

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

3 years agoradv: only load the DS fast clear values for compressed rendering
Samuel Pitoiset [Thu, 10 Dec 2020 13:50:40 +0000 (14:50 +0100)]
radv: only load the DS fast clear values for compressed rendering

Otherwise it's useless because we are unlikely to perform a
fast depth stencil clear.

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

3 years agoradv: clean up radv_layout_is_htile_compressed()
Samuel Pitoiset [Thu, 10 Dec 2020 13:28:11 +0000 (14:28 +0100)]
radv: clean up radv_layout_is_htile_compressed()

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

3 years agoradv: fix TC-compat HTILE images with DST_OPTIMAL on the compute queue
Samuel Pitoiset [Thu, 10 Dec 2020 13:06:58 +0000 (14:06 +0100)]
radv: fix TC-compat HTILE images with DST_OPTIMAL on the compute queue

This is probably rare but can happen if someone performs a depth-stencil
copy on the compute queue. This might work (untested by CTS) but it
looks more conservative to decompress before perfoming the operation.

Found by inspection.

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

3 years agoradv: add radv_htile_get_initial_value() and document the HTILE dword
Samuel Pitoiset [Wed, 9 Dec 2020 16:51:10 +0000 (17:51 +0100)]
radv: add radv_htile_get_initial_value() and document the HTILE dword

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

3 years agoradv: fix potential HTILE issues for TC-compat images on GFX8
Samuel Pitoiset [Wed, 9 Dec 2020 16:48:56 +0000 (17:48 +0100)]
radv: fix potential HTILE issues for TC-compat images on GFX8

We can only use the entire HTILE buffer if TILE_STENCIL_DISABLE is
TRUE. On GFX8+, this is only true if the depth image has no stencil
and if it's not TC-compatible because of the ZRANGE_PRECISION issue.

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

3 years agoradv: always clear the SR0/SR1 bits of the HTILE buffer
Samuel Pitoiset [Wed, 9 Dec 2020 16:28:40 +0000 (17:28 +0100)]
radv: always clear the SR0/SR1 bits of the HTILE buffer

To make sure the stencil compare state is properly initialized and
cleared when the driver performs a fast depth clear.

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

3 years agomesa/st: fix redundant initialization
Pierre-Eric Pelloux-Prayer [Fri, 18 Dec 2020 14:48:51 +0000 (15:48 +0100)]
mesa/st: fix redundant initialization

https://gitlab.freedesktop.org/mesa/mesa/-/issues/3966

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

3 years agoradeonsi: fix redundant initializations
Pierre-Eric Pelloux-Prayer [Fri, 18 Dec 2020 14:48:05 +0000 (15:48 +0100)]
radeonsi: fix redundant initializations

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/3966

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

3 years agogallium/vl: merge identical h264/h265 enums
Pierre-Eric Pelloux-Prayer [Tue, 1 Dec 2020 10:04:16 +0000 (11:04 +0100)]
gallium/vl: merge identical h264/h265 enums

Use h2645 notations for shared enums to reduce duplication and
fix a clang warning.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846>

3 years agotesselator: remove unused variable
Pierre-Eric Pelloux-Prayer [Wed, 25 Nov 2020 14:45:02 +0000 (15:45 +0100)]
tesselator: remove unused variable

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846>

3 years agoamd/addrlib: use cpp.has_argument() to filter compiler arguments
Pierre-Eric Pelloux-Prayer [Wed, 25 Nov 2020 14:44:53 +0000 (15:44 +0100)]
amd/addrlib: use cpp.has_argument() to filter compiler arguments

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846>

3 years agovdpau: fix invalid enum usage
Pierre-Eric Pelloux-Prayer [Tue, 1 Dec 2020 17:09:44 +0000 (18:09 +0100)]
vdpau: fix invalid enum usage

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846>

3 years agovdpau: fix -Wabsolute-value warning
Pierre-Eric Pelloux-Prayer [Wed, 25 Nov 2020 14:32:36 +0000 (15:32 +0100)]
vdpau: fix -Wabsolute-value warning

vdpau specifies that top-left is x0/y0, bottom-right is x1/y1 and that x0/y0 are
inclusive while x1/y1 are exclusive.

This commit remove the abs() usage and instead verifies that the VdpRects passed
by the user matche the documentation. When they don't they're treated as empty
rectangles.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846>

3 years agoac/nir: use llvm.readcyclecounter for LLVM9+
Rhys Perry [Mon, 4 Jan 2021 13:06:15 +0000 (13:06 +0000)]
ac/nir: use llvm.readcyclecounter for LLVM9+

Unlike llvm.amdgcn.s.memtime, this works on GFX10.3

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4033
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8306>

3 years agogallium/tgsi_exec: Remove unused MaxGeometryShaderOutputs.
Eric Anholt [Wed, 30 Dec 2020 23:33:45 +0000 (15:33 -0800)]
gallium/tgsi_exec: Remove unused MaxGeometryShaderOutputs.

Just an indirection from the value you should be grepping for (the one
that controls the allocation of the output buffer).

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

3 years agogallium/tgsi_exec: Clean up storage of the pixel kill mask.
Eric Anholt [Tue, 22 Dec 2020 21:45:33 +0000 (13:45 -0800)]
gallium/tgsi_exec: Clean up storage of the pixel kill mask.

We need one dword per exec, rather than one per channel, since it's the
bitmask of channels killed.  Removes the remainder of the
TGSI_EXEC_NUM_TEMP_EXTRAS!

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

3 years agogallium/tgsi_exec: Drop the unused scratch temp regs.
Eric Anholt [Tue, 22 Dec 2020 21:40:53 +0000 (13:40 -0800)]
gallium/tgsi_exec: Drop the unused scratch temp regs.

I suspect this was used back in the SSE2 backend days.  Definitely dead
now.

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

3 years agogallium/tgsi_exec: Stop doing the weird allocation of the Addrs array.
Eric Anholt [Tue, 22 Dec 2020 21:37:54 +0000 (13:37 -0800)]
gallium/tgsi_exec: Stop doing the weird allocation of the Addrs array.

Saves an indirection on referencing the address regs, and also my sanity.

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

3 years agogallium/tgsi_exec: Simplify GS output vertex count tracking.
Eric Anholt [Tue, 22 Dec 2020 21:02:20 +0000 (13:02 -0800)]
gallium/tgsi_exec: Simplify GS output vertex count tracking.

We had this strange 5-dword-per-stream storage for the single dword
current vertex count, due to copy and paste.  We can make much cleaner
code by just having a 4-element array in the machine.

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

3 years agoradv: remove unused radv_image::aspects
Samuel Pitoiset [Tue, 5 Jan 2021 07:37:56 +0000 (08:37 +0100)]
radv: remove unused radv_image::aspects

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

3 years agoradv: fix clearing images with vkCmdClear{Color,DepthStencil}Image()
Samuel Pitoiset [Tue, 5 Jan 2021 07:36:59 +0000 (08:36 +0100)]
radv: fix clearing images with vkCmdClear{Color,DepthStencil}Image()

The image aspects field is actually never set and we should use the
range aspect anyways.

Fixes: 1a7b7b17ad0 ("radv: avoid oob read during clear")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8324>

3 years agovbo/dlist: use a shared index buffer
Pierre-Eric Pelloux-Prayer [Mon, 7 Dec 2020 16:34:18 +0000 (17:34 +0100)]
vbo/dlist: use a shared index buffer

Draws can be merged by u_threaded if they share the same IB.

This improves performance in SPECviewperf13 snx-03: tests fps
are improved by a 1.2x - 2.0x factor.

v2: reworked error handling

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> (v2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8111>