platform/upstream/mesa.git
4 years agonir/opt_uniform_atomics: optimize image atomics
Rhys Perry [Tue, 1 Sep 2020 16:40:32 +0000 (17:40 +0100)]
nir/opt_uniform_atomics: optimize image atomics

fossil-db (Navi):
Totals from 65 (0.05% of 135946) affected shaders:
SGPRs: 3792 -> 3784 (-0.21%)
VGPRs: 2784 -> 2716 (-2.44%)
CodeSize: 707492 -> 713080 (+0.79%)
MaxWaves: 873 -> 887 (+1.60%)
Instrs: 133376 -> 134524 (+0.86%)
Cycles: 3004772 -> 3011440 (+0.22%)

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

4 years agoaco: use nir_opt_uniform_atomics
Rhys Perry [Tue, 1 Sep 2020 16:42:45 +0000 (17:42 +0100)]
aco: use nir_opt_uniform_atomics

Significantly improves performance of a Control compute shader. Also seems
to increase FPS at the very start of the game by ~9% (RX 580, 1080p,
medium settings, no MSAA).

fossil-db (Navi):
Totals from 315 (0.23% of 135946) affected shaders:
SGPRs: 18296 -> 18336 (+0.22%); split: -0.26%, +0.48%
VGPRs: 11856 -> 11844 (-0.10%); split: -0.81%, +0.71%
CodeSize: 2233800 -> 2457508 (+10.01%)
MaxWaves: 4506 -> 4497 (-0.20%); split: +0.04%, -0.24%
Instrs: 438766 -> 486215 (+10.81%); split: -0.00%, +10.81%
Cycles: 7880180 -> 8963340 (+13.75%); split: -0.00%, +13.75%

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

4 years agonir: add pass to optimize uniform atomics
Rhys Perry [Tue, 1 Sep 2020 15:31:37 +0000 (16:31 +0100)]
nir: add pass to optimize uniform atomics

This optimizes atomics with a uniform offset so that only one atomic
operation is done in the subgroup.

For shaders which do a very large amount of atomics, this can
significantly improve performance.

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

4 years agonir: allow divergence information to be updated when inserting instruction
Rhys Perry [Wed, 2 Sep 2020 10:48:20 +0000 (11:48 +0100)]
nir: allow divergence information to be updated when inserting instruction

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

4 years agonir: move divergence analysis options to nir_shader_compiler_options
Rhys Perry [Wed, 2 Sep 2020 10:45:46 +0000 (11:45 +0100)]
nir: move divergence analysis options to nir_shader_compiler_options

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

4 years agoaco: implement last_invocation
Rhys Perry [Tue, 1 Sep 2020 15:31:02 +0000 (16:31 +0100)]
aco: implement last_invocation

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

4 years agonir: add last_invocation intrinsic
Rhys Perry [Tue, 1 Sep 2020 15:30:34 +0000 (16:30 +0100)]
nir: add last_invocation intrinsic

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

4 years agoradv/aco,nir/lower_subgroups: don't lower elect
Rhys Perry [Tue, 1 Sep 2020 15:35:24 +0000 (16:35 +0100)]
radv/aco,nir/lower_subgroups: don't lower elect

ACO can implement this better.

fossil-db (Navi):
Totals from 33 (0.02% of 135946) affected shaders:
SGPRs: 1736 -> 1744 (+0.46%)
VGPRs: 1680 -> 1656 (-1.43%)
CodeSize: 246160 -> 245916 (-0.10%); split: -0.14%, +0.04%
MaxWaves: 449 -> 461 (+2.67%)
Instrs: 48301 -> 48266 (-0.07%); split: -0.12%, +0.05%
Cycles: 469740 -> 469240 (-0.11%); split: -0.18%, +0.08%

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

4 years agoaco: implement elect
Rhys Perry [Tue, 1 Sep 2020 15:36:58 +0000 (16:36 +0100)]
aco: implement elect

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

4 years agoaco: optimize more uniform reductions/scans
Rhys Perry [Tue, 1 Sep 2020 15:30:06 +0000 (16:30 +0100)]
aco: optimize more uniform reductions/scans

Uniform atomic optimization will create these.

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

4 years agonir: update ubo locations in nir_lower_uniforms_to_ubo
Mike Blumenkrantz [Wed, 29 Jul 2020 23:27:35 +0000 (19:27 -0400)]
nir: update ubo locations in nir_lower_uniforms_to_ubo

locations are important for these because they provide info about how
many block indices each ubo takes up

UBO arrays have nonzero values here. all non-array UBOs have either 0
for the base or nonzero for an io lowered block at an offset,
but only arrays need to be changed here because they're the only ones
with absolute values, whereas all the others are relative.

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

4 years agoglsl: fix up location setting for variables pointing to a UBO's base
Mike Blumenkrantz [Thu, 9 Jul 2020 19:36:54 +0000 (15:36 -0400)]
glsl: fix up location setting for variables pointing to a UBO's base

while linking uniforms, we might get a variable which is the only reference
to the ubo (i.e., offset 0), as determined by its type being the UBO's
interface_type, at which point we can assign the previously-gotten
block index to this variable's location

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

4 years agozink: ARB_uniform_buffer_object is now implemented, so add cap and feature doc
Mike Blumenkrantz [Fri, 26 Jun 2020 19:57:11 +0000 (15:57 -0400)]
zink: ARB_uniform_buffer_object is now implemented, so add cap and feature doc

fixes mesa/mesa#2872

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

4 years agozink: support loading any UBO
Erik Faye-Lund [Fri, 9 Oct 2020 11:35:43 +0000 (13:35 +0200)]
zink: support loading any UBO

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

4 years agozink: support non-const offsets
Erik Faye-Lund [Fri, 9 Oct 2020 11:21:53 +0000 (13:21 +0200)]
zink: support non-const offsets

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

4 years agozink: use nir_lower_ubo_vec4 to simplify things a bit
Erik Faye-Lund [Fri, 9 Oct 2020 11:18:37 +0000 (13:18 +0200)]
zink: use nir_lower_ubo_vec4 to simplify things a bit

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

4 years agoaco: implement missing nir_op_unpack_half_2x16_split_{x,y}_flush_to_zero
Samuel Pitoiset [Wed, 30 Sep 2020 13:41:00 +0000 (15:41 +0200)]
aco: implement missing nir_op_unpack_half_2x16_split_{x,y}_flush_to_zero

SPIRV->NIR emits nir_op_unpack_half_2x16_flush_to_zero instead of
nir_op_unpack_half_2x16 if the shader enables denorm flush to zero
for 16-bit floating point.

This doesn't fix anything known and CTS doesn't have tests.

Fixes: 56d9bcdded8 ("radv: enable more float_controls features")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6939>

4 years agoandroid: fix SPIR-V -> NIR build
Rhys Perry [Mon, 12 Oct 2020 13:44:36 +0000 (14:44 +0100)]
android: fix SPIR-V -> NIR build

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
Fixes: 18f9fc919e1 ('spirv: add and use a generator id enum')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7097>

4 years agodocs: fix 20.2.0 relnotes
Eric Engestrom [Mon, 12 Oct 2020 21:41:29 +0000 (23:41 +0200)]
docs: fix 20.2.0 relnotes

Fixes: ddad8d9c983e04267115 ("docs: add release notes for 20.2.0")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7107>

4 years agodocs: fix release calendar
Eric Engestrom [Mon, 12 Oct 2020 21:31:23 +0000 (23:31 +0200)]
docs: fix release calendar

Fixes: 7d72110a1ceb38f7032b ("docs/release-calender: Add 20.2 stable releases")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7107>

4 years agodocs: fix relnotes index
Eric Engestrom [Mon, 12 Oct 2020 21:28:38 +0000 (23:28 +0200)]
docs: fix relnotes index

Add missing `.0` to 20.2.0 and fix bad merge.

Fixes: 63f61b084a5310c58eaf ("docs: update calendar and link releases notes for 20.2")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7107>

4 years agoradv: add missing u_atomic.h include
Eric Engestrom [Wed, 7 Oct 2020 18:52:42 +0000 (20:52 +0200)]
radv: add missing u_atomic.h include

Fixes: 7568c97df14f8702efcc ("radv: Use atomics to read query results.")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7050>

4 years agoradv: Fix mipmap extent adjustment on GFX9+.
Bas Nieuwenhuizen [Fri, 9 Oct 2020 01:12:55 +0000 (03:12 +0200)]
radv: Fix mipmap extent adjustment on GFX9+.

With arrays we really have to use the correct size for the base
mipmap to get the right array pitch. In particular, using
surf_pitch results in pitch that is bigger than the base mipmap
and hence results in wrong pitches computed by the HW.

It seems that on GFX9 this has mostly been hidden by the epitch
provided in the descriptor but this is not something we do on
GFX10 anymore.

Now this has some draw-backs:

1. normalized coordinates don't work
2. Bounds checking uses slightly bigger bounds.

2 mostly is not an issue as we still ensure that they're within
the texture memory and not overlapping other layers/mips, but
we can't properly ignore writes.

1 is kinda dead in the water ... On the other hand I'd argue that
using normalized coords & a filter for sampling a block view of
a compressed format is extraordinarily useless.

The old method we employed already had these drawbacks for everything
except the base miplevel of the imageview.

AFAICT this is the same tradeoff AMDVLK makes and no CTS test hits
this. (once it does I think the HW is dead in the water ... Only
workaround I can think of is shader processing which is hard because
we don't know texture formats at compile time.)

I also removed the extra calculations when the image has only 1 mip
level because they ended up being a no-op in that case.

CC: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2292
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2266
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2483
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2906
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3607
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7090>

4 years agozink: enable VK_EXT_shader_stencil_export
Mike Blumenkrantz [Sat, 10 Oct 2020 14:53:46 +0000 (10:53 -0400)]
zink: enable VK_EXT_shader_stencil_export

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

4 years agozink: add VK_EXT_pipeline_creation_cache_control
Mike Blumenkrantz [Thu, 8 Oct 2020 12:46:19 +0000 (08:46 -0400)]
zink: add VK_EXT_pipeline_creation_cache_control

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

4 years agozink: support VK_EXT_extended_dynamic_state
Mike Blumenkrantz [Wed, 16 Sep 2020 16:56:05 +0000 (12:56 -0400)]
zink: support VK_EXT_extended_dynamic_state

just the screen parts

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

4 years agozink: support VK_EXT_blend_operation_advanced
Mike Blumenkrantz [Fri, 21 Aug 2020 12:37:13 +0000 (08:37 -0400)]
zink: support VK_EXT_blend_operation_advanced

just the screen bits

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

4 years agozink: add VK_EXT_custom_border_color
Mike Blumenkrantz [Mon, 3 Aug 2020 12:32:43 +0000 (08:32 -0400)]
zink: add VK_EXT_custom_border_color

just the screen stuff

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

4 years agozink: enable VK_KHR_vulkan_memory_model extension
Mike Blumenkrantz [Fri, 17 Jul 2020 13:52:16 +0000 (09:52 -0400)]
zink: enable VK_KHR_vulkan_memory_model extension

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

4 years agoradv: fix adjusting vertex alpha
Samuel Pitoiset [Mon, 12 Oct 2020 17:14:32 +0000 (19:14 +0200)]
radv: fix adjusting vertex alpha

AC_FETCH_FORMAT_NONE is not zero... Oops.

Fixes: b0829c6af70 ("radv: replace RADV_ALPHA_ADJUST by AC_FETCH_FORMAT")
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/7103>

4 years agodocs: Add sh256 sums for 20.2.0
Dylan Baker [Mon, 28 Sep 2020 23:28:46 +0000 (16:28 -0700)]
docs: Add sh256 sums for 20.2.0

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

4 years agodocs: add release notes for 20.2.0
Dylan Baker [Mon, 28 Sep 2020 23:27:44 +0000 (16:27 -0700)]
docs: add release notes for 20.2.0

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

4 years agodocs/release-calender: Add 20.2 stable releases
Dylan Baker [Mon, 28 Sep 2020 23:25:43 +0000 (16:25 -0700)]
docs/release-calender: Add 20.2 stable releases

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

4 years agodocs: update calendar and link releases notes for 20.2
Dylan Baker [Mon, 28 Sep 2020 23:23:44 +0000 (16:23 -0700)]
docs: update calendar and link releases notes for 20.2

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

4 years agoradv: move lower_io_arrays_to_elements before lower_io_to_scalar_early
Samuel Pitoiset [Tue, 6 Oct 2020 15:54:33 +0000 (17:54 +0200)]
radv: move lower_io_arrays_to_elements before lower_io_to_scalar_early

nir_lower_io_arrays_to_elements lowers arrays or matrices to elements,
which ends up to vectors for matrices, but a bunch of IO optimizations
only work for scalars.

Calling it before lower_io_to_scalar_early allows nir_link_opt_varyings
to remove duplicated inputs and replace constant inputs.

fossils-db (Navi10):
Totals from 294 (0.22% of 136546) affected shaders:
CodeSize: 861356 -> 860224 (-0.13%); split: -0.13%, +0.00%
Instrs: 161972 -> 161832 (-0.09%); split: -0.09%, +0.00%
Cycles: 1185680 -> 1185120 (-0.05%); split: -0.05%, +0.00%
SMEM: 31422 -> 31424 (+0.01%)
Copies: 9065 -> 9068 (+0.03%)

Only Talos and Dark Souls 3 are affected.

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

4 years agoradv: replace RADV_ALPHA_ADJUST by AC_FETCH_FORMAT
Samuel Pitoiset [Thu, 8 Oct 2020 14:52:36 +0000 (16:52 +0200)]
radv: replace RADV_ALPHA_ADJUST by AC_FETCH_FORMAT

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

4 years agoac/llvm: move AC_FETCH_FORMAT to non-LLVM code
Samuel Pitoiset [Thu, 8 Oct 2020 14:49:44 +0000 (16:49 +0200)]
ac/llvm: move AC_FETCH_FORMAT to non-LLVM code

While we are it, give it a name.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7065>

4 years agoradeonsi/gfx10: fix stream index for multi-stream overflow query
Indrajit Kumar Das [Mon, 12 Oct 2020 08:13:38 +0000 (13:43 +0530)]
radeonsi/gfx10: fix stream index for multi-stream overflow query

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

4 years agoradv: remove RDR2 discard workaround
Rhys Perry [Wed, 7 Oct 2020 19:33:50 +0000 (20:33 +0100)]
radv: remove RDR2 discard workaround

The game appears to use HLSL, so this workaround now lives in
SPIR-V -> NIR.

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

4 years agospirv: replace discard with demote for incorrect HLSL->SPIR-V translations
Rhys Perry [Wed, 7 Oct 2020 19:07:42 +0000 (20:07 +0100)]
spirv: replace discard with demote for incorrect HLSL->SPIR-V translations

Fixes artifacts on decals in Path of Exile.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3610
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7062>

4 years agospirv: add and use a generator id enum
Rhys Perry [Thu, 8 Oct 2020 14:30:44 +0000 (15:30 +0100)]
spirv: add and use a generator id enum

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7062>

4 years agoradv/winsys: Expand scope of allbos lock.
Bas Nieuwenhuizen [Thu, 8 Oct 2020 12:36:08 +0000 (14:36 +0200)]
radv/winsys: Expand scope of allbos lock.

With us not creating a bo_list anymore, there is a problem if we
delete a buffer between enumerating all buffers and doing the submission.

Also changes this to a rwlock given the wider scope of the things under
lock. (especialy some of the syncobj stuff is now under the lock)

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

4 years agoradv: Fix event write cmdbuffer allocation when tracing.
Bas Nieuwenhuizen [Thu, 8 Oct 2020 10:34:30 +0000 (12:34 +0200)]
radv: Fix event write cmdbuffer allocation when tracing.

The trace emit is another 7 words.

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

4 years agoradv: remove one leftover TODO in the shader info pass
Samuel Pitoiset [Tue, 6 Oct 2020 06:46:15 +0000 (08:46 +0200)]
radv: remove one leftover TODO in the shader info pass

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

4 years agoradv/llvm: reduce LDS size for tess by using NIR IO assigned locations
Samuel Pitoiset [Fri, 2 Oct 2020 11:36:05 +0000 (13:36 +0200)]
radv/llvm: reduce LDS size for tess by using NIR IO assigned locations

To match ACO.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7022>

4 years agoradv/llvm: reduce the ESGS itemsize by using NIR IO assigned locations
Samuel Pitoiset [Fri, 2 Oct 2020 11:21:18 +0000 (13:21 +0200)]
radv/llvm: reduce the ESGS itemsize by using NIR IO assigned locations

There is no longer gaps in the ESGS ring.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7022>

4 years agoradv/llvm: switch to NIR IO assigned locations
Samuel Pitoiset [Tue, 6 Oct 2020 06:38:58 +0000 (08:38 +0200)]
radv/llvm: switch to NIR IO assigned locations

To match ACO.

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

4 years agoac/nir: pass the variable location to store_tcs_outputs
Samuel Pitoiset [Mon, 5 Oct 2020 08:22:00 +0000 (10:22 +0200)]
ac/nir: pass the variable location to store_tcs_outputs

It's actually simpler for the backend to know the variable location.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7022>

4 years agoac,radv,radeonsi: stop multiplying driver_location by 4
Samuel Pitoiset [Mon, 5 Oct 2020 13:41:33 +0000 (15:41 +0200)]
ac,radv,radeonsi: stop multiplying driver_location by 4

It's no longer needed to do that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7010>

4 years agoradv/llvm: stop assigning driver_location in NIR->LLVM
Samuel Pitoiset [Mon, 5 Oct 2020 13:36:27 +0000 (15:36 +0200)]
radv/llvm: stop assigning driver_location in NIR->LLVM

It's already assigned just after NIR linking shaders.

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

4 years agonir: Allow more deref modes in phis
Jason Ekstrand [Thu, 8 Oct 2020 04:05:25 +0000 (23:05 -0500)]
nir: Allow more deref modes in phis

In particular, OpenCL needs to allow shader_temp and function_temp
through because they're 100% real pointers.

Fixes piglit CL calls.cl

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

4 years agoandroid: util: Move xxd.py to util
Mauro Rossi [Sat, 10 Oct 2020 12:48:22 +0000 (14:48 +0200)]
android: util: Move xxd.py to util

Android porting of gen rules as per 22ffc05266c6 ("util: Move xxd.py to util")

Fixes the following building error:

ninja: error: 'external/mesa/src/compiler/glsl/xxd.py', needed by 'out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_glsl_intermediates/glsl/float64_glsl.h', missing and no known rule to make it

Fixes: 22ffc05266c6 ("util: Move xxd.py to util")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7087>

4 years agovc4: enable lower_isign for VC4
Jose Maria Casanova Crespo [Sat, 10 Oct 2020 11:19:39 +0000 (12:19 +0100)]
vc4: enable lower_isign for VC4

Since 1e7d82c8813647 ("nir/algebraic: always lower idiv
to shifts if bitops are allowed") idiv is lowered and
generates a isign operation.

VC4 HW doesn't support isign and lower_isign wasn't enabled.
Enabling it fixes the regressions caused by this new
optimization on piglit tests shaders/glsl-fs-loop-nested.

Fixes: 1e7d82c8813647 ("nir/algebraic: always lower idiv to shifts if bitops are allowed")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7089>

4 years agopan/bi: Range check newc/oldc when rewriting
Alyssa Rosenzweig [Sat, 10 Oct 2020 20:46:49 +0000 (16:46 -0400)]
pan/bi: Range check newc/oldc when rewriting

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

4 years agopan/bi: Disable mediump output lowering
Alyssa Rosenzweig [Fri, 9 Oct 2020 14:45:44 +0000 (10:45 -0400)]
pan/bi: Disable mediump output lowering

Without fp16, this is useless for now.

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

4 years agopanfrost: Temporarily disable FP16 on Bifrost
Alyssa Rosenzweig [Fri, 9 Oct 2020 14:44:21 +0000 (10:44 -0400)]
panfrost: Temporarily disable FP16 on Bifrost

There are some missing bits for FP16 to work on more complicated Bifrost
tests. Towards conformance let's disable FP16 on Bifrost and reenable
when these issues are sorted (principally, swizzle lowering).

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

4 years agopanfrost: Set "shader modifies coverage?" flag
Alyssa Rosenzweig [Thu, 8 Oct 2020 23:59:15 +0000 (19:59 -0400)]
panfrost: Set "shader modifies coverage?" flag

Principally when DISCARD is used.

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

4 years agopanfrost: Update XML for Bifrost early-z/FPK
Alyssa Rosenzweig [Thu, 8 Oct 2020 23:46:21 +0000 (19:46 -0400)]
panfrost: Update XML for Bifrost early-z/FPK

Had bits scrambled during RE.

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

4 years agopan/bi: Implement FETCH
Alyssa Rosenzweig [Thu, 8 Oct 2020 23:30:44 +0000 (19:30 -0400)]
pan/bi: Implement FETCH

For texelFetch. A few earlier header fields were wrong.

Fixes dEQP-GLES2.functional.texture.mipmap.2d.generate.rgba8888_fastest

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

4 years agopan/bi: Add bi_emit_lod_cube helper
Alyssa Rosenzweig [Thu, 8 Oct 2020 23:31:41 +0000 (19:31 -0400)]
pan/bi: Add bi_emit_lod_cube helper

There's a different LOD format used for TXF that will be able to
accomodate cube maps as well.

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

4 years agopan/bi: Map NIR tex ops to Bifrost ops
Alyssa Rosenzweig [Thu, 8 Oct 2020 23:01:29 +0000 (19:01 -0400)]
pan/bi: Map NIR tex ops to Bifrost ops

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

4 years agopanfrost: Fix faults on block-based formats on Bifrost
Alyssa Rosenzweig [Thu, 8 Oct 2020 22:51:43 +0000 (18:51 -0400)]
panfrost: Fix faults on block-based formats on Bifrost

Fixes

dEQP-GLES2.functional.texture.filtering.2d.nearest_nearest_clamp_etc1

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

4 years agopan/bi: Use new block dimension helper
Alyssa Rosenzweig [Thu, 8 Oct 2020 22:35:17 +0000 (18:35 -0400)]
pan/bi: Use new block dimension helper

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

4 years agopanfrost: Add panfrost_block_dim helper
Alyssa Rosenzweig [Thu, 8 Oct 2020 22:34:48 +0000 (18:34 -0400)]
panfrost: Add panfrost_block_dim helper

So we can calculate strides of block-based formats correctly. Will help
us down the road for Bifrost AFBC.

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

4 years agopan/bi: Don't terminate helper threads
Alyssa Rosenzweig [Thu, 8 Oct 2020 18:36:56 +0000 (14:36 -0400)]
pan/bi: Don't terminate helper threads

Fixes our filtering fails. Roughly equivalent to the .kill texture
bit on Midgard. We'll need to port the dataflow analysis over along with
the .skip analysis, but for now this will suffice.

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

4 years agopan/bi: Fix message type printing
Alyssa Rosenzweig [Thu, 8 Oct 2020 18:21:49 +0000 (14:21 -0400)]
pan/bi: Fix message type printing

Lazy copy/pasting fail.

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

4 years agopanfrost: Set helper_invocation_enable for Bifrost
Alyssa Rosenzweig [Wed, 7 Oct 2020 22:50:34 +0000 (18:50 -0400)]
panfrost: Set helper_invocation_enable for Bifrost

Actually, this is for barriers, field name is wrong. But it's the same
as Midgard.

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

4 years agopan/bi: Implement txb
Alyssa Rosenzweig [Wed, 7 Oct 2020 22:32:32 +0000 (18:32 -0400)]
pan/bi: Implement txb

Also uses the 8.8 signed fixed-point format.

dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2d_bias

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

4 years agopanfrost: Add some missing Bifrost texture XML
Alyssa Rosenzweig [Wed, 7 Oct 2020 02:00:49 +0000 (22:00 -0400)]
panfrost: Add some missing Bifrost texture XML

Still incomplete due to many states, but this is a start.

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

4 years agopanfrost: Fix Bifrost high LOD clamp
Alyssa Rosenzweig [Wed, 7 Oct 2020 01:46:56 +0000 (21:46 -0400)]
panfrost: Fix Bifrost high LOD clamp

Broke mipmapping.

Fixes: ad0b32cdbd5 ("panfrost: XMLify Bifrost textures")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7081>

4 years agopanfrost: Fix Bifrost filter selection
Alyssa Rosenzweig [Wed, 7 Oct 2020 01:31:18 +0000 (21:31 -0400)]
panfrost: Fix Bifrost filter selection

Point sampling is jargon for nearest, apparently. Fixes

dEQP-GLES2.functional.texture.filtering.2d.nearest_nearest_clamp_rgba8888_pot

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

4 years agopanfrost: Add missing XML for Bifrost samplers
Alyssa Rosenzweig [Wed, 7 Oct 2020 01:29:05 +0000 (21:29 -0400)]
panfrost: Add missing XML for Bifrost samplers

This is now complete and mostly canonical.

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

4 years agopan/bi: Prefer 'texture_index' to 'image_index'
Alyssa Rosenzweig [Tue, 6 Oct 2020 16:28:47 +0000 (12:28 -0400)]
pan/bi: Prefer 'texture_index' to 'image_index'

They're not images. Making the executive decision to fix the notation.
Not canonical.

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

4 years agopan/bi: Rewrite to fit dest = src constraint
Alyssa Rosenzweig [Tue, 6 Oct 2020 16:14:32 +0000 (12:14 -0400)]
pan/bi: Rewrite to fit dest = src constraint

Needed for TEXC as well as atomics.

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

4 years agopan/bi: Pack TEXC
Alyssa Rosenzweig [Tue, 6 Oct 2020 15:50:12 +0000 (11:50 -0400)]
pan/bi: Pack TEXC

1-line change, thanks to the generator magic.

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

4 years agopan/bi: Handle nir_tex_src_lod
Alyssa Rosenzweig [Tue, 6 Oct 2020 15:46:50 +0000 (11:46 -0400)]
pan/bi: Handle nir_tex_src_lod

We need to emit some lowering code to convert it to the 8:8 format
expected by the hardware.

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

4 years agopan/bi: Add data register passing infrastructure
Alyssa Rosenzweig [Tue, 6 Oct 2020 15:32:55 +0000 (11:32 -0400)]
pan/bi: Add data register passing infrastructure

Lower to a COMBINE, which in turn will lower to moves so RA does the
right thing.

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

4 years agopan/bi: Stub out TEXC handling
Alyssa Rosenzweig [Tue, 6 Oct 2020 15:18:16 +0000 (11:18 -0400)]
pan/bi: Stub out TEXC handling

We still need to handle actual complex texturing instructions, as well
as packing, but this is the start.

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

4 years agopan/bi: Add texture operator descriptor
Alyssa Rosenzweig [Wed, 23 Sep 2020 17:57:52 +0000 (13:57 -0400)]
pan/bi: Add texture operator descriptor

Used to encode all the different texture modes.

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

4 years agopan/bi: Pack skip bit for texture operations
Alyssa Rosenzweig [Tue, 6 Oct 2020 14:45:11 +0000 (10:45 -0400)]
pan/bi: Pack skip bit for texture operations

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

4 years agopan/bi: Encode skip bit into IR
Alyssa Rosenzweig [Tue, 6 Oct 2020 14:42:39 +0000 (10:42 -0400)]
pan/bi: Encode skip bit into IR

Currently unset.

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

4 years agopan/bi: Streamline TEXC/TEXS naming/selection
Alyssa Rosenzweig [Tue, 6 Oct 2020 14:40:16 +0000 (10:40 -0400)]
pan/bi: Streamline TEXC/TEXS naming/selection

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

4 years agopan/bi: Use canonical texture op names in IR
Alyssa Rosenzweig [Tue, 6 Oct 2020 14:31:04 +0000 (10:31 -0400)]
pan/bi: Use canonical texture op names in IR

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

4 years agopan/bi: Fix simple txl test
Alyssa Rosenzweig [Tue, 6 Oct 2020 14:24:56 +0000 (10:24 -0400)]
pan/bi: Fix simple txl test

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 731dfc6066d ("pan/bi: Allow vertex txl with lod=0 as compact")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7081>

4 years agopan/bi: Expose GL 2.1 on Bifrost
Alyssa Rosenzweig [Fri, 2 Oct 2020 20:41:53 +0000 (16:41 -0400)]
pan/bi: Expose GL 2.1 on Bifrost

Needed for glamor. These features should work fine.

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

4 years agopan/bi: Handle vector moves
Alyssa Rosenzweig [Fri, 2 Oct 2020 19:49:55 +0000 (15:49 -0400)]
pan/bi: Handle vector moves

And fix the bad assertion that let this slip.

Like combines, nir_op_vec can be vector, and we need to lower this
ourselves. Thankfully, the lowering is simple.

Fixes
dEQP-GLES2.functional.shaders.loops.for_uniform_iterations.nested_tricky_dataflow_1_*

Fixes: b2c6cf2b6db ("pan/bi: Eliminate writemasks in the IR")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7081>

4 years agopan/bi: Pass flow_control through directly
Alyssa Rosenzweig [Fri, 2 Oct 2020 19:13:29 +0000 (15:13 -0400)]
pan/bi: Pass flow_control through directly

More than just a single bool!

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

4 years agopan/bi: Use canonical flow control enum
Alyssa Rosenzweig [Fri, 2 Oct 2020 19:03:58 +0000 (15:03 -0400)]
pan/bi: Use canonical flow control enum

Merges multiple bits and adds some new combinations. The semantics are
the compiler are evidently wrong, we'll fix that next.

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

4 years agopan/bi: Use canonical term dependency
Alyssa Rosenzweig [Fri, 2 Oct 2020 18:12:45 +0000 (14:12 -0400)]
pan/bi: Use canonical term dependency

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

4 years agopan/bi: Use canonical term "message type"
Alyssa Rosenzweig [Fri, 2 Oct 2020 18:02:25 +0000 (14:02 -0400)]
pan/bi: Use canonical term "message type"

These identify the type of message produced by a message-passing
instruction, rather than information about the clause per se.

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

4 years agopan/bi: Print message types as strings
Alyssa Rosenzweig [Fri, 2 Oct 2020 18:01:22 +0000 (14:01 -0400)]
pan/bi: Print message types as strings

Even if we're not in verbose mode to match the canonical syntax.

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

4 years agopan/bi: Add missing message types
Alyssa Rosenzweig [Fri, 2 Oct 2020 17:57:59 +0000 (13:57 -0400)]
pan/bi: Add missing message types

Names are not canonical but that's ok.

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

4 years agopan/bi: Expand clause type to 5-bit
Alyssa Rosenzweig [Fri, 2 Oct 2020 17:54:09 +0000 (13:54 -0400)]
pan/bi: Expand clause type to 5-bit

The upper bit is reserved.

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

4 years agopan/bi: Use canonical name for staging registers
Alyssa Rosenzweig [Fri, 2 Oct 2020 17:53:03 +0000 (13:53 -0400)]
pan/bi: Use canonical name for staging registers

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

4 years agopan/bi: Use canonical next_clause_prefetch
Alyssa Rosenzweig [Fri, 2 Oct 2020 17:46:35 +0000 (13:46 -0400)]
pan/bi: Use canonical next_clause_prefetch

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

4 years agopan/bi: Canonicalize terminate_discarded_threads
Alyssa Rosenzweig [Fri, 2 Oct 2020 17:27:15 +0000 (13:27 -0400)]
pan/bi: Canonicalize terminate_discarded_threads

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

4 years agopan/bi: Use canonical floating-point modes
Alyssa Rosenzweig [Fri, 2 Oct 2020 17:23:33 +0000 (13:23 -0400)]
pan/bi: Use canonical floating-point modes

First few pre-clause modifiers.

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

4 years agopan/bi: Cull unnecessary edges on the CF graph
Alyssa Rosenzweig [Fri, 2 Oct 2020 17:06:54 +0000 (13:06 -0400)]
pan/bi: Cull unnecessary edges on the CF graph

If a block ends in an unconditional jump, we don't need to record a
fallthrough successor as well, since it's unreachable.

Likely harmless but makes the IR harder to parse with messy CF graphs.

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

4 years agopan/bi: Drop if 0'd combine lowering
Alyssa Rosenzweig [Fri, 2 Oct 2020 16:49:44 +0000 (12:49 -0400)]
pan/bi: Drop if 0'd combine lowering

This is supposed to be optimized but actually just broken. When we look
at optimizing this later we'll probably want a more straightforward copy
prop pass instead.

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

4 years agopan/bi: Fix memory corruption in scheduler
Alyssa Rosenzweig [Sun, 27 Sep 2020 23:45:50 +0000 (19:45 -0400)]
pan/bi: Fix memory corruption in scheduler

If empty the last will be bogus, I think. Missing Rust hard right around
now.

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