Commit Graph

129391 Commits

Author SHA1 Message Date
Iago Toral Quiroga 9de4ab17c5 v3dv: retrieve device name from device info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Alejandro Piñeiro 4e88e2d4a9 v3dv: add support to use v3d simulator
v2: use spaces on both sides of ':'

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga 0e0f18ae5e v3dv: Implement vkGetPhysicalDeviceProperties
This is just something to get us going. We will need to tune all these
limits as we make progress with driver features.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga fc52dc8d7d v3dv: pretend to initialize a physical device
Just to keep us moving forward for now. Later, we should probably
revisit this after running on real hardware or after enabling
the simulator.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Alejandro Piñeiro 36e07a0ab9 v3dv: memory management stubs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga fd81dc64ff v3dv: implement vkEnumeratePhysicalDevices
Not an actual implementation since this doesn't initialize any actual
physical devices just yet.

Also, this doesn't check that available decices are really compatible
with the driver for now. This is for convenience, so we can move
past this point even if we are not running on actual hardware.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga dbce41f39b v3dv: implement vkDestroyInstance
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:24 +00:00
Iago Toral Quiroga be1575c625 v3dv: implement vkCreateInstance
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:24 +00:00
Iago Toral Quiroga 20363b0bb9 v3dv: add support for valgrind macros
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:24 +00:00
Alejandro Piñeiro 2f383f9747 v3dv: add support for VK_EXT_debug_report
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:24 +00:00
Alejandro Piñeiro e4af07be76 gitlab-ci: add broadcom vulkan driver
At this point we are only interested to test if it keeps building.

v2: include meson-arm64 (Eric)

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:24 +00:00
Alejandro Piñeiro e5034f0d0d v3dv: add v3d vulkan driver skeleton
Initial commit, mostly a import of the minimum from anv/radv to get a
skeleton to start to work with.

In includes:
 * meson files
 * Copy & adapt entrypoints ane extensions scripts from anv (that were
   later used on radv)

This is a firt approach, but is is likely that we can remove/simplify
some things.

v2: fix copyright character at broadcom/vulkan/meson.build (Eric)
v3: no spaces inside arrays (Dylan)
v4: add gnu_symbol_visibility (detected by CI on first Merge attemp)

Reviewed-by: Eric Anholt <eric@anholt.net>

squash! v3dv: add v3d vulkan driver skeleton

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:24 +00:00
Vinson Lee bdb1e5aa0a glsl: Initialize ir_to_mesa_visitor members in constructor.
Fix defects reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member ctx is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member prog is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member shader_program is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member options is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7071>
2020-10-13 21:07:24 +00:00
Vinson Lee 6529cbd0bc svga: Remove unused printf argument.
Fix defect reported by Coverity Scan.

Extra argument to printf format specifier (PRINTF_ARGS)
extra_argument: This argument was not used by the format string: tex->handle.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7072>
2020-10-13 21:00:01 +00:00
Vinson Lee 12c20cbac0 util/xmlconfig: Initialize xmlconfig member options in constructor.
Fix defects reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member field options.info is not
initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member field options.values is not
initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member field options.tableSize is not
initialized in this constructor nor in any functions that it calls.

Suggested-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6929>
2020-10-13 13:34:53 -07:00
Erik Faye-Lund 77c1b01508 zink: do not report SSBOs as halfway supported
We don't support SSBOs yet, as we don't expose the
PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT-cap. But the gallium
state-tracker's limit-calculation gets confused by this half-way
support, and ends up thinking we can support atomics, which we
don't support yet either.

So let's not confuse the state-tracker here, and let's introduce this
again when SSBOs are actually supported.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7113>
2020-10-13 16:55:22 +00:00
Rhys Perry 044d213086 scons: fix SPIR-V -> NIR build
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Fixes: 18f9fc919e ('spirv: add and use a generator id enum')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7096>
2020-10-13 16:53:10 +01:00
Rhys Perry c122315702 aco: fix get_ssbo_size with a vgpr resource
The result of load_vulkan_descriptor is passed directly to get_ssbo_size.
This caused convert_pointer_to_64_bit() to skip creating a
v_readfirstlane_b32 if it was necessary.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 05b6612b4e ('radv: do not lower UBO/SSBO access to offsets')
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3628
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7095>
2020-10-13 14:20:28 +00:00
Rhys Perry a7114f3f46 nir/opt_uniform_atomics: don't optimize atomics twice
Applications sometimes already do this optimization themselves.

fossil-db (Navi):
Totals from 51 (0.04% of 135946) affected shaders:
CodeSize: 507484 -> 501860 (-1.11%)
Instrs: 99635 -> 98471 (-1.17%)
Cycles: 2421944 -> 2414780 (-0.30%)

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>
2020-10-13 12:47:21 +00:00
Rhys Perry bc43650522 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>
2020-10-13 12:47:21 +00:00
Rhys Perry bcf7a70008 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>
2020-10-13 12:47:21 +00:00
Rhys Perry f83bc5beb8 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>
2020-10-13 12:47:21 +00:00
Rhys Perry 37b6b0967c 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>
2020-10-13 12:47:21 +00:00
Rhys Perry e1120f274f 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>
2020-10-13 12:47:21 +00:00
Rhys Perry bb5c0ba0d2 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>
2020-10-13 12:47:21 +00:00
Rhys Perry 1a912a550f 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>
2020-10-13 12:47:20 +00:00
Rhys Perry 8850a63161 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>
2020-10-13 12:47:20 +00:00
Rhys Perry 36da9c4aa2 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>
2020-10-13 12:47:20 +00:00
Rhys Perry bf77f539ee 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>
2020-10-13 12:47:20 +00:00
Mike Blumenkrantz c31ababae3 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>
2020-10-13 12:31:40 +00:00
Mike Blumenkrantz 47c358233d 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>
2020-10-13 12:13:18 +00:00
Mike Blumenkrantz ef0babab38 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>
2020-10-13 12:02:59 +00:00
Erik Faye-Lund 1b6a80a467 zink: support loading any UBO
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7079>
2020-10-13 12:02:59 +00:00
Erik Faye-Lund 67e4bcb713 zink: support non-const offsets
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7079>
2020-10-13 12:02:59 +00:00
Erik Faye-Lund 47bdda0f3f 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>
2020-10-13 12:02:59 +00:00
Samuel Pitoiset b9ca4923d6 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: 56d9bcdded ("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>
2020-10-13 08:35:22 +02:00
Rhys Perry 1070bba19e android: fix SPIR-V -> NIR build
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
Fixes: 18f9fc919e ('spirv: add and use a generator id enum')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7097>
2020-10-12 22:26:05 +00:00
Eric Engestrom 86ededf296 docs: fix 20.2.0 relnotes
Fixes: ddad8d9c98 ("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>
2020-10-12 22:10:38 +00:00
Eric Engestrom e57cd6dc19 docs: fix release calendar
Fixes: 7d72110a1c ("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>
2020-10-12 22:10:38 +00:00
Eric Engestrom b04f57cb3d docs: fix relnotes index
Add missing `.0` to 20.2.0 and fix bad merge.

Fixes: 63f61b084a ("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>
2020-10-12 22:10:38 +00:00
Eric Engestrom c02e933de4 radv: add missing u_atomic.h include
Fixes: 7568c97df1 ("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>
2020-10-12 23:24:18 +02:00
Bas Nieuwenhuizen 1fb3e1fb70 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>
2020-10-12 21:00:00 +00:00
Mike Blumenkrantz 85dfe6118a 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>
2020-10-12 18:26:56 +00:00
Mike Blumenkrantz 25d13b0ad0 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>
2020-10-12 18:26:56 +00:00
Mike Blumenkrantz bab0d8630c 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>
2020-10-12 18:26:56 +00:00
Mike Blumenkrantz 66fc9f5571 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>
2020-10-12 18:26:56 +00:00
Mike Blumenkrantz fa2fd72570 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>
2020-10-12 18:26:56 +00:00
Mike Blumenkrantz 9c43ccd1c2 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>
2020-10-12 18:26:56 +00:00
Samuel Pitoiset 66d7bb0f23 radv: fix adjusting vertex alpha
AC_FETCH_FORMAT_NONE is not zero... Oops.

Fixes: b0829c6af7 ("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>
2020-10-12 19:48:35 +02:00
Dylan Baker 207138b927 docs: Add sh256 sums for 20.2.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6904>
2020-10-12 09:59:28 -07:00