Commit Graph

134933 Commits

Author SHA1 Message Date
Lionel Landwerlin 4075dd16ab anv: implement vkGetDeviceImageMemoryRequirementsKHR
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin 9058fd8979 anv: move VkImage object allocation to anv_CreateImage
v2 (Jason Ekstrand):
 - Switch the order of arguments to be device, image, other stuff

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Jason Ekstrand 8c2a1ed3da anv: Add an anv_image_get_memory_requirements helper
This is similar to a patch from Lionel except works in terms of aspects
rather than bindings.  This makes it easy to use from the Android code.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin 76b1d04e72 anv: remove unused function
Fixes: 49908c602f ("anv/android: Rework our handling of AHardwareBuffer imports")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin f2397badc4 anv: implement vkGetDeviceBufferMemoryRequirementsKHR
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Lionel Landwerlin 8072cc8f20 anv: move GetBufferMemoryRequirement with other buffer functions
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Jason Ekstrand 7677f1d09e vulkan: Update the XML and headers to 1.2.195
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
2021-10-06 02:18:39 +00:00
Ian Romanick cb28361642 nir/algebraic: Small optimizations for SpvOpFOrdNotEqual and SpvOpFUnordEqual
No shader-db changes on any Intel platform.

Fossil-db results:

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 144380118 -> 143692823 (-0.5%)
SENDs in all programs: 6920822 -> 6920822 (+0.0%)
Loops in all programs: 38299 -> 38299 (+0.0%)
Cycles in all programs: 8434782176 -> 8423078994 (-0.1%)
Spills in all programs: 206830 -> 204469 (-1.1%)
Fills in all programs: 318737 -> 313660 (-1.6%)

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Ian Romanick 0cf25f559f spirv: Generate shorter code for SpvOpFUnord comparisons
No shader-db or fossil-db changes on any Intel platform.

v2: Keep the flt <-> fge switcharoo local to the SpvOpFUnordLessThan,
etc. handling.  Add a comment explaining why the suboptimal
SpvOpFUnordEqual implementation is used here.  Suggested by Caio.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Ian Romanick 1ce48ce91d spirv: SpvOpFUnordNotEqual doesn't need special treatment
The NIR fneu opcode already matches the "unordered not equal" semantics
of the SPIR-V opcode.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Ian Romanick f8148b861f spirv: Minor cleanup in SpvOpFOrdNotEqual
v2: Add a comment explaining why the suboptimal SpvOpFOrdNotEqual
implementation is still used here.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Ian Romanick 803b754b81 spirv: Silence unused parameter warnings in vtn_alu.c
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>
2021-10-06 01:53:47 +00:00
Mike Blumenkrantz c074b2d812 ci: updates
fails are from #4571

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12831>
2021-10-06 01:12:29 +00:00
Mike Blumenkrantz a2fb67209e zink: support 16bit rgbx formats
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12831>
2021-10-06 01:12:29 +00:00
Alyssa Rosenzweig c00e7b729f pan/bi: Optimize abs(derivative)
We implement fine derivatives as:

	broadcast(x, (lane & ~1) + 1) - broadcast(x, lane & ~1)

Most of the complexity is to get the right sign. If we can ignore the
sign, we can generate the simpler code:

	broadcast(x, lane ^ 1) - lane

This is a particular win on v7+ where the broadcast instruction (CLPER)
can do `lane ^ value` for free. However, even on v6 where we lower to an
explicit XOR instruction, it's still a win.

The limiting case is fwidth. The fragment shader

   gl_FragColor = fwidth(vec4_varying);

has the following results on v6, v7, and v9:

G72 (-26% instructions, -43% cycles):
38 inst, 30 tuples, 5 clauses, 1.166667 cycles, 1.166667 arith, 28 quadwords
28 inst, 19 tuples, 4 clauses, 0.666667 cycles, 0.666667 arith, 19 quadwords

G76 (-37% instructions, -54% cycles):
38 inst, 30 tuples, 5 clauses, 1.166667 cycles, 1.166667 arith, 28 quadwords
24 inst, 16 tuples, 4 clauses, 0.541667 cycles, 0.541667 arith, 18 quadwords

G78 (-40% instructions, -56% cycles):
40 inst, 1.125000 cycles, 0.250000 fma, 0.109375 cvt, 1.125000 sfu, 20 quadwords
24 inst, 0.500000 cycles, 0.250000 fma, 0.015625 cvt, 0.500000 sfu, 12 quadwords

shader-db tells a similar story -- most shaders are unaffected, but a
shader that uses fwidth has a 20% reduction in cycle count:

instructions helped:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 264 -> 262 (-0.76%)
instructions helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 36 -> 28 (-22.22%)
tuples helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 27 -> 22 (-18.52%)
tuples HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 211 -> 212 (0.47%)
clauses HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 32 -> 33 (3.12%)
cycles helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 1 -> 0.79 (-20.83%)
arith helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 1 -> 0.79 (-20.83%)
quadwords helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 31 -> 28 (-9.68%)
quadwords HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 176 -> 178 (1.14%)

total instructions in shared programs: 148370 -> 148360 (<.01%)
instructions in affected programs: 300 -> 290 (-3.33%)
helped: 2
HURT: 0

total tuples in shared programs: 124188 -> 124184 (<.01%)
tuples in affected programs: 238 -> 234 (-1.68%)
helped: 1
HURT: 1
helped stats (abs) min: 5.0 max: 5.0 x̄: 5.00 x̃: 5
helped stats (rel) min: 18.52% max: 18.52% x̄: 18.52% x̃: 18.52%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.47% max: 0.47% x̄: 0.47% x̃: 0.47%

total clauses in shared programs: 25692 -> 25693 (<.01%)
clauses in affected programs: 32 -> 33 (3.12%)
helped: 0
HURT: 1

total cycles in shared programs: 12132.04 -> 12131.83 (<.01%)
cycles in affected programs: 1 -> 0.79 (-20.83%)
helped: 1
HURT: 0

total arith in shared programs: 4623.75 -> 4623.54 (<.01%)
arith in affected programs: 1 -> 0.79 (-20.83%)
helped: 1
HURT: 0

total quadwords in shared programs: 110386 -> 110385 (<.01%)
quadwords in affected programs: 207 -> 206 (-0.48%)
helped: 1
HURT: 1
helped stats (abs) min: 3.0 max: 3.0 x̄: 3.00 x̃: 3
helped stats (rel) min: 9.68% max: 9.68% x̄: 9.68% x̃: 9.68%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 1.14% max: 1.14% x̄: 1.14% x̃: 1.14%

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12332>
2021-10-06 00:40:57 +00:00
Alyssa Rosenzweig 3e8f540753 nir: Add Mali-specific derivative opcodes
Add derivative opcodes fddx_must_abs_mali/fddy_must_abs_mali satisfying:

   fabs(fdd*_must_abs_mali(v)) = fabs(fdd*(v))

The sign of their result is undefined.

On Bifrost and Valhall, these unsigned derivatives can be implemented
more efficiently than the correctly-signed counterparts, since the sign
fixup requires extra ALU instructions. On backends where this is the
case, it is useful to optimize fabs(fdd*(v)) to
fabs(fdd*_must_abs_mali(v)). This pattern comes up with the GLSL builtin
`fwidth`.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12332>
2021-10-06 00:40:57 +00:00
Joshua Ashton 72c0e57e7e ac/surface: Use 64 && 128 for GFX10_3 on non-modifier path
DCC_IND_BLK is not hooked up for this to work in the kernel in any released version, and it's unsafe to do so even if it was because it doesn't check the modifiers.

There's no reason to change the legacy non-modifier path to be more performant at the expense of breaking backwards compatibility with older versions of Mesa.

Fixes: 0f6251b3 ("ac/surface: use DCC compatible with image stores for < 4K resolutions")
Closes: #5422

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13122>
2021-10-06 00:13:46 +00:00
Marek Olšák 82b420df32 mesa: use simple_mtx_t for ShaderIncludeMutex
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák f6abb3445b mesa: use simple_mtx_t for TexMutex
change mtx_recursive -> mtx_plain, there's no recursive locking

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák 826e03e6e5 gallium/pb_slab: use simple_mtx_t
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák 5a5637d6ae gallium/pb_cache: use simple_mtx_t
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák b4afe25ebf util/queue: use simple_mtx_t for finish_lock
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák 28bde89556 util/slab: use simple_mtx_t
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Marek Olšák 8f68978caa mesa: add missing unlock_texture into generate_texture_mipmap
Fixes: 5a39938b00 "mesa: Throw an error for compressed glGenerateMipmap on GLES2 contexts."

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>
2021-10-05 23:46:14 +00:00
Enrico Galli c79ec5ea3c nir_to_dxil: Add tagging raw SRVs in shader flags
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13157>
2021-10-05 23:32:18 +00:00
Dave Airlie 1d48022dab gallivm/format: clamp SINT conversion rather than truncate.
KHR-GL32.packed_pixels.pbo_rectangle.r16i on zink on lavapipe
ends up using a pbo that does an SINT image write. This was producing
truncated rather than clamped values.

Fix the calculations for 8/16-bit signed ints to clamp not truncate.

Fixes: 13e5f331db ("gallivm/nir: fix image store conversions")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13187>
2021-10-05 23:11:57 +00:00
Emma Anholt 60f464bbce i915g: Check for the scanout-layout conditions before setting level info.
Fixes leaks (release) or assertion failures (debug) on allocating small
scanout resources, when falling through to the non-scanout-specific layout
code, which became more common as of ad50b47a14 ("gbm: assume
USE_SCANOUT in create_with_modifiers").

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13202>
2021-10-05 22:36:36 +00:00
Alyssa Rosenzweig f0325ca3da panfrost: Fix PAN_MESA_DEBUG=sync with INTEL_blackhole_render
We need to ignore the "sync" in this case, or we'll crash with
"incomplete job" since we never submitted the work. Fixes the Piglit
intel_blackhole-draw_gles2 when run in CI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Alyssa Rosenzweig 12facf23b1 panfrost: Don't set CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER
We already set HALF_INTEGER, which is what the compiler actually does.
If we also set PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER, we get
incorrect lowering. Only set the CAP we respect.

On Bifrost, this convention is arbitrary. We should consider moving the
Bifrost lowering into NIR to optimize this better...

Fixes Piglit glsl-arb-fragment-coord-conventions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Alyssa Rosenzweig b88225378d panfrost: Introduce PAN_MAX_VARYINGS define
The number of varying records we need to reserve in the worst case is
greater than the number of source-level varyings we advertise
(gl_Position, gl_PointSize...)

We advertise MAX_VARYINGS source level varyings, which means anywhere we
manipulate varyings we need up to (MAX_VARYINGS + max non-source level
varyings) records. Add a PAN_MAX_VARYINGS define for this and use it
throughout.

Fixes a buffer overflow in Piglit glsl-max-varyings, which now passes
instead of crashes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Alyssa Rosenzweig 9c8311b737 panfrost: Fix off-by-one in varying count assert
We want to assert that the number of varyings (the count) is at most the
the maximum count. This is <=, not <, with the assertion previously
failing for exactly the maximum.

Fixes: 2c2cf0ecfe ("panfrost: Streamline varying linking code")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Alyssa Rosenzweig 00b0529061 panfrost: Move special_varying to compiler definitions
The number of special varyings on midgard can influence how much space
we need to allocate for varyings in the compiler ABI. Move the enum so
we can get access it.

No functional change. This is cc stable purely so the following patches
can be backported.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>
2021-10-05 21:13:52 +00:00
Pavel Asyutchenko 7ffb152276 llvmpipe: fix crash when doing FB fetch + gl_FragDepth write in one shader
Reproducible by piglit test from this MR:
https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/576

Signed-off-by: Pavel Asyutchenko <sventeam@yandex.ru>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12705>
2021-10-05 20:45:38 +00:00
Emma Anholt 48499a8d44 turnip: Replace our format table with fd6_format_table.
Now we have a common format table with just a little bit of overriding in
turnip, which I hope we can decrease over time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:18 +00:00
Emma Anholt 3bc681d87f turnip: Do format lookups from the fd6 format table and cross-check.
Intermediate step to make sure things stay the same as I transition us to
sharing the format table.

The YUV special casing is pretty not the prettiest, but I'm hoping to
continue working on planar RGB formats as pipe formats separately.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:18 +00:00
Emma Anholt 3d53b43dab turnip: Switch tu_format internals to using pipe_format more.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:18 +00:00
Emma Anholt bfe36ad3f1 turnip: Give D32_SFLOAT_S8_UINT a native format.
We won't actually use the native format here, as when sampling our image
we we just see the format for either the D or S aspect.  This syncs us up
with freedreno's table, though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:18 +00:00
Emma Anholt 70ecd3a119 freedreno/a6xx: Enable UBWC for RGBA5551 (and 1555) textures.
Turnip has it enabled, and it seems to be happy in the CTS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 38f23b1108 freedreno/a6xx: Add support for A/XRGB1555 formats.
This switches the format we use by default for GLES's rgb5_a1, and means
that our formats supported more closely matches turnip.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt ebaeddcbb3 freedreno/a6xx: Rewrite the format table format/swap helpers.
We need to take a tiling mode to in order to support 1555 like turnip
does, and I like this naming better.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 1ce837d6f4 freedreno/a6xx: Make the format table const.
This data never changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 4d6f5cd572 freedreno/a6xx: Use fd6_pipe2tex() for the 2D src format.
The differences between the two are:

- tex supports more formats (fine, we've already decided on which formats
  we can blit)
- FMT6_10_10_10_2_UNORM instead of FMT6_10_10_10_2_UNORM_DEST.
- FMT6_A8_UNORM for PIPE_FORMAT_A8_UNORM.

For 1555 support we get another difference between tex and color, and we
need 2/3 of the tex differences for blit srcs, so switch it over.  This
also matches what turnip does (except it doesn't have A8 as a format).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 7952a17f7f freedreno/a6xx: Put R8_G8_B8_420_UNORM in the format table.
turnip will use this format, even if we don't have the freedreno side
rigged up yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt e47b4ba629 util/format: Add an RGB planar format for YV12, like we have for NV12.
Turnip will use this for mapping the to the corresponding hardware format,
and we could also extend mesa/st to avoid adding extra samplers for
external image sampling of YV12 on freedreno.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt ab0462e05d freedreno/a6xx+: Add support for the R8G8_R8B8 and G8R8_B8R8 formats.
This means that EGLimage imports of YUYV and UYVY can use a single sampler
instead of having to create RGBA8 and RG8 samplers mapping the same
texture.  The swizzles are the same as turnip uses, and it makes the
piglit tests for these formats happy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt a7459b5409 freedreno/a6xx: Add some more 16-bit rgb/rgba swaps to our format tables.
BGR565 is chosen for GL_RGB565 and BGRA4 for GL_RGBA4, so it doesn't
change GLES's behavior.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 4b36e7b1b5 freedreno/a6xx: Drop texturing support from other scaled formats.
GLES doesn't expose these texture formats, and we don't want to start
exposing them when turnip starts using our tables.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 20d02f347d freedreno/a6xx: Add support for EXT_texture_sRGB_R8/RG8.
Noticed to be missing when comparing format tables between turnip and
freedreno.  Passes dEQP-GLES31 fine.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt d275184ed2 freedreno/a6xx: disable vertex fetch support flag for b8g8r8a8_srgb.
We don't have an srgb decode flag on vertex fetch, r8g8b8a8_srgb isn't
supported either, and GL doesn't ask for vertex fetch for this anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt 1573af4138 freedreno/a6xx: Add int/scaled/snorm vertex formats to match turnip.
Noticed because the vertex formats didn't match up between the two.  GL
doesn't actually look for these vertex formats, though.

Having these marked as supporting texture or color could theoretically
change things I think.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Emma Anholt bdddcc4d3f freedreno/a6xx: Move the format table to common code.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-05 20:09:17 +00:00
Filip Gawin a3f553beab r300: fix UB caused by 1 << 31 and 2 << 30
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13158>
2021-10-05 19:07:27 +00:00
Chia-I Wu eed0fc4caf vulkan/wsi/wayland: fix an invalid u_vector_init call
u_vector_init requires size to be power-of-two.

Fixes: 151b65b211 ("vulkan/wsi/wayland: generalize modifier handling")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13186>
2021-10-05 17:42:41 +00:00
Danylo Piliaiev d2543658ef turnip: clamp per-tile scissors to max viewport size in binning pass
Tiles on the edge may cross maximum viewport size, we have to clamp
per-tile scissor to maximum allowed viewport dimensions.

Add MAX_VIEWPORT_SIZE constant along the way.

Fixes vkd3d test "test_draw_uav_only"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13197>
2021-10-05 14:27:44 +00:00
Jason Ekstrand 492e182a8a radv: Use VK_DEFINE_*HANDLE_CASTS instead of rolling our own
The core ones have some nifty stuff like asserts that it's a valid
vk_object_base and has the right type.  We don't have real type safety
with Vulkan handles but this is as close as we can get.  The core ones
also track when we've started handing out handles for logging purposes
which we want.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13100>
2021-10-05 09:02:03 -05:00
Tapani Pälli 811bf72f9f intel/blorp: fix a compile warning about uninitialized use
warning: ‘bind_offset’ may be used uninitialized in this function

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13190>
2021-10-05 11:59:27 +00:00
Lionel Landwerlin d0a3a11258 nir/lower_io: preserve all metadata when no progress
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13168>
2021-10-05 11:23:23 +00:00
Samuel Pitoiset fb2d031047 radv/llvm: fix exporting VS parameters
My mistake.

Fixes: 2aa705ec87 ("radv: determine the VS output parameters 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/13191>
2021-10-05 12:37:57 +02:00
Lionel Landwerlin 5d7ab9ea6a anv: remove redundant VertexURBEntryReadLength setting
We're setting the same field a dozen lines below to the exact same
value.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13169>
2021-10-05 10:30:51 +00:00
Marcin Ślusarz e26328582a nir: preserve all metadata when nir_opt_vectorize doesn't make progress
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 54df09c8d4 nir: preserve all metadata when nir_propagate_invariant doesn't make progress
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 804c56f1a2 nir: preserve all metadata when nir_lower_int_to_float doesn't make progress
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 87ecdd4eff glsl: preserve all metadata when lower_buffer_interface_derefs doesn't make progress
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 338955b53c anv: preserve all metadata when anv_nir_lower_multiview doesn't make progress
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 6e0c38567f anv: use nir_shader_instructions_pass in anv_nir_lower_ycbcr_textures
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 8c592e386a anv: use nir_shader_instructions_pass in anv_nir_add_base_work_group_id
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 1faebd0936 intel/compiler: use nir_metadata_none instead of its value
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 71bec85db0 intel/compiler: use nir_shader_instructions_pass in brw_nir_opt_peephole_ffma
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 9e6acd801d intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_storage_image
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 10a33b046e intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_scoped_barriers
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 3d0332eb12 intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_mem_access_bit_sizes
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 183987d438 intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_conversions
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 5b8c993d50 intel/compiler: use nir_shader_instructions_pass in brw_nir_clamp_image_1d_2d_array_sizes
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Marcin Ślusarz 9e22e0838a intel/compiler: use nir_shader_instructions_pass in brw_nir_demote_sample_qualifiers
Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress
- pass returns true ONLY when it makes progress ("progress" was initialized incorrectly)

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>
2021-10-05 10:02:54 +00:00
Samuel Pitoiset ae4be2d7ae radv: fix vk_object_base_init/finish for internal device memory objects
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/13172>
2021-10-05 07:45:48 +00:00
Samuel Pitoiset 87505442de radv: fix writing combined image/sampler descriptor
This will crash with the common Vulkan handles if sampler is NULL.

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/13172>
2021-10-05 07:45:48 +00:00
Samuel Pitoiset b0bd0aac6e radv: fix vk_object_base_init/finish for push descriptors
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/13172>
2021-10-05 07:45:48 +00:00
Lionel Landwerlin 4e4560ab6f intel/compiler: add missing line returns to logs
In the upcoming intel_clc tool, we're allowing to print these messages
out and some of them just don't look right.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13165>
2021-10-05 07:31:52 +00:00
Lionel Landwerlin 710393b3aa anv: enable UBO indexing
We added support but didn't expose it through the API.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b704d03efd ("anv: Do UBO loads with global addresses for bindless")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5426
Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13097>
2021-10-05 07:16:49 +00:00
Dave Airlie 0a592db573 crocus/query: don't loop on ready status after gpu hang.
When a GPU hang occurs, the syncobj will eventually timeout,
if this is a wait, just set ready, so things will continue.

This matches 965 behaviour better.

Fixes: c282a082be ("crocus/query: poll the syncobj in the no wait situation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13188>
2021-10-05 12:18:30 +10:00
Dave Airlie f2bc6e400e crocus/gen6: don't reemit the svbi when debugging
This messes up the counts, stops some tests failing when reemit
is enabled

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13188>
2021-10-05 12:18:17 +10:00
Emma Anholt 85e428f1e0 freedreno/tools: Fix build failure when cffdump isn't built but tests are.
Can't test the tool if we don't build it.  Move the other test definition
next to the tool, too.

Fixes: 82b5c95265 ("freedreno: Move crashdec/cffdec tests to be meson unit tests.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13183>
2021-10-05 00:06:14 +00:00
Jason Ekstrand 2f55aace9c vulkan/physical_device_features: Stop generating a header
It only has one entrypoint and nothing in it is based on code-gen.  We
can put that one entrypoint in vk_physical_device.h instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13150>
2021-10-04 22:42:32 +00:00
Jason Ekstrand ec9619a83e vulkan/physical_device_features: Drop some unnecessary dependencies
None of these are actually used.  We parse the XML bare and don't need
any extension or entrypoint information.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13150>
2021-10-04 22:42:32 +00:00
Emma Anholt 9d1d2d7e43 panfrost: Disable flaky piglit job for now.
It's been getting intermittent failures on marge since being enabled, turn
it back off until it can get stabilized.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13180>
2021-10-04 21:43:27 +00:00
Rob Clark cd38b3ec54 Revert "freedreno: Move the batch cache to the context."
This reverts commit b2349a4671.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5441
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13159>
2021-10-04 20:24:59 +00:00
Rob Clark 398a731af9 Revert "freedreno: Remove the submit lock locking."
This reverts commit 22486ffa51.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13159>
2021-10-04 20:24:59 +00:00
Rob Clark 52a2253071 Revert "freedreno: Use a BO bitset for faster checks for resource referenced."
This reverts commit 3ade94df86.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13159>
2021-10-04 20:24:59 +00:00
Rob Clark fbf324ee6c Revert "freedreno: Remove dead fd_batch_reset()."
This reverts commit 63cc1fe71f.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13159>
2021-10-04 20:24:59 +00:00
Rob Clark 93df18e889 Revert "freedreno: Fix autotune regression since batch-cache rework."
This reverts commit b8c4ad378d.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13159>
2021-10-04 20:24:59 +00:00
Rob Clark 53917ab403 zink: Disable TC syncs for get_device_reset_status()
zmike said it should work.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13163>
2021-10-04 19:45:28 +00:00
Rob Clark 5b7c81fd13 freedreno: Disable TC syncs for get_device_reset_status()
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13163>
2021-10-04 19:45:28 +00:00
Rob Clark 75808934f8 gallium/u_threaded: Get reset status without sync
GPU hangs are asynchronous already, there should not be an expectation
that this is synchronized with driver thread.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13163>
2021-10-04 19:45:28 +00:00
Caio Marcelo de Oliveira Filho 1a20cfb7d6 anv: Identify code paths specific to graphics primitive pipeline
In preparation for adding support for the graphics mesh pipeline,
identify all the paths that are specific the primitive pipeline.

This shouldn't change any behavior since the code currently only
supports the primitive pipeline.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13047>
2021-10-04 18:55:56 +00:00
Caio Marcelo de Oliveira Filho a63aa9ad41 anv: Move together primitive pipeline emit calls
Just moving code and the packet order, no functional change expected.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13047>
2021-10-04 18:55:56 +00:00
Marcin Ślusarz 1f1ad5a9b4 anv: Use input assembly state only when pipeline has vertex stage
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13047>
2021-10-04 18:55:56 +00:00
Marcin Ślusarz d79c518a32 anv: Set graphics pipeline active_stages earlier
So that we can use the active_stages in copy_non_dynamic_state() later.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13047>
2021-10-04 18:55:56 +00:00
Caio Marcelo de Oliveira Filho bc2545fc57 anv: Validate vertex related states only when VS is present
Mesh pipeline doesn't use those states, so we can't assert them
unconditionally for a graphics pipeline.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13047>
2021-10-04 18:55:56 +00:00
Jesse Natalie 82c69c9a9d compiler/clc: Preserve OCL kernel arg type metadata on LLVM13
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13177>
2021-10-04 18:16:01 +00:00
Jesse Natalie 3a752256f5 compiler/clc: Null extensions should mean all supported, not all
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13177>
2021-10-04 18:16:01 +00:00
Marcin Ślusarz b8cafaa91d lima: use nir_shader_instructions_pass in lima_nir_split_load_input
Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13176>
2021-10-04 15:54:06 +00:00
Adam Jackson aa30e58600 wsi/x11: Fix a misunderstanding about how xcb_get_geometry works
The code here is well-intentioned, but the only way a GetGeometry
request can fail is if you name an invalid drawable. And if we did that,
either our internal state got corrupted, or - more likely - the user
destroyed the window. In either case there's nothing more we can do with
the surface, so report that it's been lost.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13104>
2021-10-04 15:30:06 +00:00
Rob Clark ac783acd74 freedreno: Handle PIPE_FORMAT_NONE buffers
Clover creates buffers with format=NONE.. which is not technically
incorrect.  Just treat this as r8_unorm so we know width0 is the size
in bytes.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>
2021-10-04 15:10:07 +00:00
Rob Clark 9e74f458a8 freedreno: Handle cso==NULL in bind_sampler_states
This is a thing that comes up with clover.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>
2021-10-04 15:10:07 +00:00
Rob Clark 96b37b9546 freedreno/ir3: Remove used unused
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>
2021-10-04 15:10:07 +00:00
Rob Clark 748583d808 freedreno: Fix some indentation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>
2021-10-04 15:10:07 +00:00
Rob Clark 6223f29a87 freedreno: Optimize no-op submits
In some cases we need to emit a no-op batch/submit, just to get a fence.
No need to emit all the boilerplate state-resture and flushing in this
case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>
2021-10-04 15:10:07 +00:00
Rob Clark 383df59987 freedreno: Get shader variant msgs in perf debug output
We want FD_MESA_DEBUG=perf to also tell us about variants.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13160>
2021-10-04 15:10:07 +00:00
Icecream95 ad60fffd49 pan/mdg: Use the correct swizzle for condition moves
Fixes: 70072a20e0 ("pan/midgard: Refactor swizzles")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13173>
2021-10-04 14:55:07 +00:00
Boris Brezillon d34c1dc93d panvk: Support clearing ZS attachments
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13137>
2021-10-04 14:34:55 +02:00
Boris Brezillon c3ebd8ddac panvk: Allow clear_attachment of RTs > 0
It's just a matter of skipping unused BLEND descriptors and emitting
the one we want to clear.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13137>
2021-10-04 14:34:55 +02:00
Boris Brezillon 555e6626c2 panvk: Pass the render target index to panvk_meta_clear_attachment()
The attachment index and render target don't necessarily match. We need
to explicitly pass the render target index to
panvk_meta_clear_attachment() so it can select the correct shader and
emit a valid RSD.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13136>
2021-10-04 12:17:07 +00:00
Boris Brezillon 3ba34f6633 panvk: Fix wls_size retrieval
Fix a typo in wls_size assignment leading to a wrong wls_size.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13136>
2021-10-04 12:17:07 +00:00
Boris Brezillon 4692baacfb panvk: Don't use panfrost_get_default_swizzle() on v7+
This helper produces invalid component order values on v7. Use the
MALI_RGB_COMPONENT_ORDER_xxx definitions instead.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13136>
2021-10-04 12:17:07 +00:00
Boris Brezillon 8acc8f6a0e panvk: Fix allocation of BOs bigger than the slab size
We can pick a BO from the pool if the BO size exceeds the pool size. In
that case, allocate a BO and save it in a separate array so we can free
it when the memory pool is reset or released.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13136>
2021-10-04 12:17:07 +00:00
Joshua Ashton 4e58d30d98 radv: Add force_emulate_rt perftest option
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12974>
2021-10-04 11:52:40 +00:00
Joshua Ashton 26826a7d60 radv: Enable raytracing extensions on older generations
We have shader-based bvh traversal for this on older generations now.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12974>
2021-10-04 11:52:40 +00:00
Joshua Ashton 548382de42 radv: Implement software emulation for intersect_ray
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12974>
2021-10-04 11:52:40 +00:00
Joshua Ashton a0f51921a6 radv: Implement build_node_to_addr for GFX8 and below
Removes the nir_ prefix also given it no longer acts like a typical builder function.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12974>
2021-10-04 11:52:40 +00:00
Joshua Ashton ff087dd601 radv: Do not pass result to insert_traversal_aabb_case
This is unused as it performs the tests itself.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12974>
2021-10-04 11:52:40 +00:00
Joshua Ashton e30a714ad9 radv: Remove assert in radv_rt_bind_tables
Not necessary anymore.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12974>
2021-10-04 11:52:40 +00:00
Samuel Pitoiset 87c732bfee radv: determine the ES type (VS or TES) for GS earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13170>
2021-10-04 12:13:10 +02:00
Samuel Pitoiset 75e5795d41 radv: remove useless loads_dynamic_offsets when emitting push constants
It's always TRUE if loads_push_constants is TRUE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13170>
2021-10-04 12:13:10 +02:00
Samuel Pitoiset f901294c0a radv: remove redundant check of needs_multiview_view_index for PS
layer_input is always TRUE if needs_multiview_view_index is TRUE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13170>
2021-10-04 12:13:10 +02:00
Samuel Pitoiset 69e656dae4 radv: move use of NGG to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset 0fa431087c radv: move forcing VRS rates to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset 5bacc668fa radv: move forcing MRT output NaN fixup to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset fb453d80a4 radv: move forcing invariant geometry to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset 421b5379df radv: move forcing discard to demote to the graphics pipeline key
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/13099>
2021-10-04 10:05:18 +00:00
Samuel Pitoiset 38c34bf132 radv: constify radv_shader_info for radv_lower_{io_to_mem,ngg}()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset b52aaea630 radv: remove unnecessary ac_nir_ngg_config output struct
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset 52e91f7640 radv: move ngg passthrough determination earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset 2ce78a30ff move: move ngg lds bytes determination earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset 90858dd718 radv: move ngg early prim export determination earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Rhys Perry 24501b5452 radv: move ngg culling determination earlier
Co-Authored-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13134>
2021-10-04 08:55:19 +00:00
Samuel Pitoiset 5896bf41ca radv: do not declare an extra user SGPR for sample positions and PS
This is part of the scratch buffer.

No fossils-db change on Sienna.

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/13140>
2021-10-04 08:30:38 +00:00
Pierre-Eric Pelloux-Prayer dfa4a85ddf radeonsi: don't clear G_028644_OFFSET
Before 11d1309d82 this field was updated even when G_028644_PT_SPRITE_TEX was 0.

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

Fixes: 11d1309d82 ("radeonsi: restructure si_get_ps_input_cntl for future refactoring")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13105>
2021-10-04 08:04:37 +00:00
Samuel Pitoiset 19a71e79b8 radv: get the float controls execution mode from NIR for LLVM
No need to duplicate it. Though, I think it was already broken
for merged shaders, but it doesn't matter.

No CTS regressions anyways with LLVM.

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/12989>
2021-10-04 07:42:19 +00:00
Samuel Pitoiset 55e6a68f69 radv: disable the DX10 diamond test for better line rasterization perf
Ported from RadeonSI. PAL also doesn't enable it for Vulkan.

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/13066>
2021-10-04 07:21:51 +00:00
Andreas Baierl 1e9f18008f lima/parser: add shader disassembly to dump
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13138>
2021-10-04 08:37:50 +02:00
Lionel Landwerlin 445996379b clc: let user specify the targetted SPIRV version
This version is given to the LLVM-SPIRV translator. On the SPIRV-Tools
side of things, we want to use the highest available version to be
sure to be able to parse back what was generated.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13113>
2021-10-03 19:32:54 +00:00
Lionel Landwerlin 72fd81d0ac clc: print warnings/errors on their own line
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13113>
2021-10-03 19:32:54 +00:00
Lionel Landwerlin 3c8c817ae7 clc: add allowed extension for compile parameter
The LLVM-SPIRV translator can include a bunch of capabilities into the
generated SPIRV which is not what you always want. That include
internal Intel specific capabilities from the translator.

v2: Rename options
    Fixup checks (Jesse)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13113>
2021-10-03 19:32:54 +00:00
Mike Blumenkrantz 9e3293bcd4 zink: ensure fences are released before reusing them
at this point it's guaranteed that the cmdbuf has completed since the
timeline id has passed, but vulkan hasn't technically "released" the fence
until it's been waited upon, so cut down on some validation spam by waiting
here like in get_batch_state()

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13144>
2021-10-03 14:57:03 +00:00
Mike Blumenkrantz 477855fce4 zink: stop using VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT
the pool is reset anyway so this is unnecessary

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13145>
2021-10-03 10:43:39 -04:00
Bas Nieuwenhuizen 0dd0f6cf75 radv: Don't invalidate VCACHE after clear_htile_mask.
radv_src_access_flush sets all the required flags (which doesn't include VCACHE. The
flush after write is implicit. The invalidate happens for any user that needs it
with the radv_dst_access_flush).

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12274>
2021-10-03 12:16:55 +00:00
Lionel Landwerlin 9667539b96 anv: honor INTEL_DEBUG=sync
Useful debug option for hangs.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13161>
2021-10-03 11:01:18 +00:00
Bas Nieuwenhuizen c6b8702eb4 radv: Fix Android build for common functions.
Fixes: 9fc16b66d0 ("radv: use common vkGetPhysicalDevice{Image}FormatProperties()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5328
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12764>
2021-10-03 00:36:58 +00:00
Marek Olšák edc8a4a037 ac/surface: enable DCC image stores for all displayable DCC on gfx10.3
Co-authored-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13153>
2021-10-02 22:56:48 +00:00
Joshua Ashton e76956b9e0 radeonsi: Use common DCC image store check
We need to keep RADV and RadeonSI on the same page about this due to modifiers.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13153>
2021-10-02 22:56:48 +00:00
Joshua Ashton fccdebd64d radv: Use common DCC image store check
We need to keep RADV and RadeonSI on the same page about this due to modifiers.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13153>
2021-10-02 22:56:48 +00:00
Joshua Ashton e6fcf65578 ac/surface: Add helper for checking if a surface supports DCC Image stores
We need to keep RADV and RadeonSI on the same page about this due to modifiers.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13153>
2021-10-02 22:56:48 +00:00
Kenneth Graunke 0a9e46e535 iris: Delete the MI_COPY_MEM_MEM resource_copy_region implementation.
The MI_COPY_MEM_MEM version of resource_copy_region has known bugs:

- It's failing to set valid_buffer_range correctly
- It's missing iris_emit_buffer_barrier_for() for the
  source/destination, so there may be missing flushes.
- There are some bad interactions with the tile cache and VF using L3.

Even with those fixed, if you expand the "no more than 16 bytes"
restriction to allow copies up to 1024 bytes, then it starts failing
Piglit tests on Icelake.

We could probably fix this.  However, I had originally only measured a
0.689096% +/- 0.473968% (n=4) speedup in Shadow of Mordor's OpenGL
port, which is already fairly small, especially before adding missing
flushes.  Further, some of that likely came from not switching between
render and compute...which we'll soon be able to avoid thanks to BLOCS.

Folks were also worried that MI_COPY_MEM_MEM can't be pipelined, and
that stalling the command streamer may actually slow things down,
especially as the GPUs become more powerful.  We aren't really sure
about this, but it's another concern.

So, let's just get rid of this optimization.  It seemed like a good
idea at the time, but it's just causing issues for very little gain.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12863>
2021-10-02 01:48:59 -07:00
Emma Anholt b40d070ab9 freedreno: Move the headergen2 test to be meson unit tests.
Now all the freedreno build-time testing is just "meson test -C build"

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Emma Anholt 82b5c95265 freedreno: Move crashdec/cffdec tests to be meson unit tests.
Now they run automatically in parallel with other unit testing, rather
than needing a separate script and environment to run them.

Instead of doing shell script filtering afterwards, I just added a little
flag to suppress printing the path name.  Also dropped the "Parsing
<file>" in addition to "Reading <file>" in the tested script, since it's
redundant and baked the path name into the reference.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Emma Anholt 5209a0ae16 freedreno: Move afuc tests to meson unit tests.
Now they run automatically in parallel with other unit testing, rather
than needing a separate script and environment to run them.

Instead of doing shell script filtering afterwards, I just added a little
flag to suppress printing the path name.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Eric Anholt 7438ea55c4 freedreno: Reuse u_math.h instead of open coding uif().
Plus the old version had a comment with what conversion was being done
swapped!

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Eric Anholt db95dfe252 freedreno: Reuse u_math.h instead of open coding ALIGN/ARRAY_SIZE.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Eric Anholt 21df8b3e08 freedreno: Fix UBSan failures in cffdec's (uint8_t)x << 24
Types <32 bit get promoted to int32_t when you do expressions on them
(thus why (u8)x << 8 works at all), but shifting into the top bit of the
signed int is undefined behavior.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Emma Anholt d5a80781aa freedreno/afuc: Avoid ubsan warns about shifting to the top bit of 'int'
I think maybe it's being promoted to int due to the mismatched bitfield
sizes of the uint32_t values being referenced here?

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Emma Anholt ba9e994034 freedreno/rnndec: Avoid making 0-length variable length arrays.
ubsan hates it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Emma Anholt bd8bfe43fa freedreno/rnndec: Fix use of undefined value_orig in the !ti case.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Filip Gawin b47017192b r300: implement forgotten tgsi's cases of textures
Fixes: d0c398a8 ("r300g: Use radeon compiler for fragment programs")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13135>
2021-10-01 22:56:51 +00:00
Emma Anholt 5116388e0b turnip: Expose a device name similar to the blob.
We add "Turnip" so that users (and vulkan.gpuinfo.org) can distinguish us
without requiring VK_KHR_driver_properties.  This will be a lot more
user-friendly than "FD618", though.

I made some little vk_asprintf helpers, because I figure other drivers
setting up deviceName's will want them too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13041>
2021-10-01 22:32:10 +00:00
Emma Anholt 7e471541e0 turnip: Match the blob's format for vendorID and deviceID.
This should hopefully cause us the least trouble with apps tuning for
device performance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13041>
2021-10-01 22:32:10 +00:00
Sagar Ghuge 7ddb0c9f76 iris: Enable atomic operations on compressed surfaces
Let's not turn off compression for atomic operations since XeHPG
supports it.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12966>
2021-10-01 22:16:22 +00:00
Mike Blumenkrantz 2f7ea2c493 anv: support EXT_primitive_topology_list_restart
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Tested-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12628>
2021-10-01 21:49:26 +00:00
Marek Olšák 923c535ee8 ac/surface: don't overwrite DCC settings for imported buffers
Fixes: 0f6251b31f - ac/surface: use DCC compatible with image stores for < 4K resolutions

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13120>
2021-10-01 16:15:40 -04:00
Vasily Khoruzhick 5db5ff58b7 lima: split_load_input: don't split unaligned vec2
Mali4x0 can't fetch unaligned vec2 (i.e. .yz), so don't split it.

Fixes: 6dd0ad66de ("lima/ppir: add NIR pass to split varying loads")
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13131>
2021-10-01 18:11:54 +00:00
Tapani Pälli c752bb459b panvk: remove feature checks from device creation
This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Tapani Pälli 54325dd138 lavapipe: remove feature checks from device creation
This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Tapani Pälli f056fb1e56 v3dv: remove feature checks from device creation
This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Tapani Pälli 40c798c6bc turnip: remove feature checks from device creation
This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Tapani Pälli 814d6b626f radv: remove feature checks from device creation
This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Tapani Pälli 69e82462a1 anv: remove feature checks from device creation
This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Tapani Pälli 2e5718c957 vulkan: provide common functions to check device features
v2: move checks to vk_device_init, ignore struct types from
    provisional extensions + lots of cleanups/fixes (Jason Ekstrand)
v3: squash in following patch from Jason:
    "vulkan: Restructure vk_physical_device_check_device_features()"
v4 (Jason): Fix a Windows build error

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Samuel Pitoiset 2aa705ec87 radv: determine the VS output parameters in the shader info pass
This can be determined earlier instead of duplicating code in both
compiler backends.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13119>
2021-10-01 17:11:39 +00:00
Samuel Pitoiset 89f1117c62 radv: set export_clip_dists for the GS copy shader
This is needed for the next change to correctly compute the VS
output parameters from the shader info pass.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13119>
2021-10-01 17:11:39 +00:00
Timur Kristóf c53a1dff32 radv: Don't declare ngg_gs_state when there is no API GS.
This shader arg is only used when the pipeline has API GS,
so it is useless to declare it otherwise.

Also remove unused code from radv_declare_shader_args.
NGG is handled by the GS code path so these were never
actually used.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13129>
2021-10-01 15:46:12 +00:00
Timur Kristóf 6ca66808b5 aco: Fix determining whether any culling is enabled.
Use 0xB instead of 0x00FFFFFF - this allows to jump over the culling
code when no actual culling is enabled but the ngg_cull_face_is_ccw
flag is set.

Fixes: 182d9b1e60
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13129>
2021-10-01 15:46:12 +00:00
Timur Kristóf c13a8d20f7 aco: Fix small primitive precision.
This is a mistake. It should use ngg_culling_settings
instead of ngg_gs_state.

Fixes: 182d9b1e60
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13129>
2021-10-01 15:46:12 +00:00
Marek Olšák fb8f532ea1 radeonsi: implement draw_vertex_state for lower display list overhead
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák 73f7142ace radeonsi: separate VBO descriptor code into a new function (for future work)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák e78d7fe7d5 mesa: use pipe_vertex_state in vbo and st/mesa for lower display list overhead
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák f32cefdb87 st/mesa: make setup_arrays more reusable for future display list support
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák 74cb74045f st/mesa: add ST_PIPELINE_RENDER_NO_VARRAYS, for future display list support
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák 7a2458f4bd gallium/util: add util_vertex_state_cache for deduplicating the states
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák e8cad57aa7 gallium/trace: add pipe_vertex_state support
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák 0842488859 gallium/u_threaded: implement draw_vertex_state
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák 1c66de3239 gallium: add pipe_vertex_state and draw_vertex_state for display lists
The main motivation is to improve the score of viewperf13/snx.

This new interface is designed to be optimal for display lists as implemented
by the vbo module. It has much lower CPU overhead in the frontend, threaded
context, and the driver.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák d5218f0889 gallium/util: make pipe_vertex_buffer_reference safe for hashing dst
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák 6e69acad82 util: import u_debug_refcnt, u_hash_table, u_debug_describe from gallium
to allow pipe_*_reference to be called in src/mesa/vbo.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Marek Olšák bec054ec63 util: add util_popcnt_inline_asm
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-10-01 14:51:23 +00:00
Bas Nieuwenhuizen 0b92d4ec98 radv: Add GPU serialization of acceleration structures.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen 5a45e2e04d radv: Add CPU serialization of acceleration structures.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen 0bf77a3fd1 radv: Add GPU copying of acceleration structures.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen c7e0a8a6f7 radv: Add CPU copying of acceleration structures.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen 76fcd50e14 radv: Add GPU copy/serialization/deserialization shader.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen 6def6ba04e radv: Add acceleration structure queries.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen 817b4a9aca radv: Add copy/serialization info to accel struct headers.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen c814e42c12 radv: Add an indirect dispatch struct to the header.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen 237a979419 radv: Add an internal indirect dispatch command.
Avoiding the entire buffer dance.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Bas Nieuwenhuizen 8500e9e1f0 radv: Add DMA buffer update function for internal use.
Only split out the DMA part because that doesn't need the BO.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12840>
2021-10-01 13:43:28 +00:00
Mike Blumenkrantz 5e9669650c zink: break out surface info init to helper function
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13126>
2021-10-01 13:27:50 +00:00
Mike Blumenkrantz fed9243078 zink: make a local resource var in fb_clears_apply_internal
no functional changes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13126>
2021-10-01 13:27:50 +00:00
Tomeu Vizoso 0497d4aeef panfrost/ci: Run Piglit's quick_gl tests on G52
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13063>
2021-10-01 12:03:42 +00:00
Christian Gmeiner 8f118b5011 etnaviv: add etna_lookup_or_create_screen(..)
It is an improved version of etna_drm_screen_create_renderonly(..)
which also needs the gpu fd. Also switch etna_drm_screen_create(..)
and etna_drm_screen_create_renderonly(..) to use the new function.

This follows how other driver's winsys code looks like and fixes a
crash I when running piglit with PIGLIT_PLATFORM="gbm".

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Philipp Zabel p.zabel@pengutronix.de
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12904>
2021-10-01 10:13:32 +00:00
Christian Gmeiner 5328fc6ca3 etnaviv: extend screen_create(..) with gpu_fd
Decouples gpu fd and renderonly object. This opens the door for
some simplifications.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Philipp Zabel p.zabel@pengutronix.de
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12904>
2021-10-01 10:13:32 +00:00
Christian Gmeiner f096441359 etnaviv: allow screen creation with NULL renderonly object
Prep change for winsys cleanups.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Philipp Zabel p.zabel@pengutronix.de
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12904>
2021-10-01 10:13:32 +00:00
Christian Gmeiner e18ee14f3b etnaviv: move drm version readout to drm layer
It fits here better.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Philipp Zabel p.zabel@pengutronix.de
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12904>
2021-10-01 10:13:32 +00:00
Christian Gmeiner 075649a38d etnaviv: fix indentation
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Philipp Zabel p.zabel@pengutronix.de
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12904>
2021-10-01 10:13:32 +00:00
Christian Gmeiner f7168feb9b etnaviv: fix leak of the screen hash table
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Philipp Zabel p.zabel@pengutronix.de
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12904>
2021-10-01 10:13:32 +00:00
Christian Gmeiner 61ddec23c5 etnaviv: use better name for fd hash table
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Philipp Zabel p.zabel@pengutronix.de
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12904>
2021-10-01 10:13:32 +00:00
Tapani Pälli 8cc4e0b0c4 anv: remove a format assert when setting up attachments
There are exceptions in spec where the framebuffer image format and
format given for render pass attachment may differ. This happens in
particular when subpass has resolve attachment that might resolve
only depth from a combined depth+stencil format. There the formats do
not need to match but be 'compatible' with each other.

As example using VK_FORMAT_D32_SFLOAT format is considered compatible
when actual framebuffer format is VK_FORMAT_D32_SFLOAT_S8_UINT.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13082>
2021-10-01 09:59:32 +00:00
Tony Wasserka fa655b6f70 aco/spill: Use std::unordered_map for spills_entry
fossil-db on Navi14:
Totals from 305 (0.20% of 150305) affected shaders:
CodeSize: 5498340 -> 5498328 (-0.00%)
Instrs: 1009992 -> 1009989 (-0.00%)
Latency: 33922644 -> 33923018 (+0.00%)
InvThroughput: 9302963 -> 9303151 (+0.00%)
VClause: 19004 -> 19001 (-0.02%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 3fad5efd15 aco/spill: Use unordered_map for spills_exit
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 7368f16fe8 aco/spill: Clarify use of long-lived references by adding const
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka a3ac3b231f aco/spill: Reduce allocations in next_uses_per_block
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka a6bcda6a01 aco/spill: Change worklist to a single integer
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka e60a70dde0 aco/spill: Store remat list in an std::unordered_map instead of std::map
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 4a78a05247 aco/spill: Replace an std::map to booleans with std::set
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 112babc697 aco/spill: Reduce redundant std::map lookups
The previous code checked for element containment first and then performed
another map lookup upon element access. Instead, map::find can be used to
retrieve an iterator usable for element access with no extra lookup needed.

Furthermore, pure containment checks have been simplified using map::count.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 05163fd4f4 aco/spill: Avoid copying current_spills when not needed
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 6650799ea5 aco/spill: Prefer unordered_map over map for next use distances
This changes the iteration order of next use distances, so some "random"
changes to shader metrics are expected.

fossil-db for Navi14:
Totals from 1239 (0.82% of 150305) affected shaders:
SpillSGPRs: 10559 -> 10562 (+0.03%); split: -0.05%, +0.08%
SpillVGPRs: 1632 -> 1863 (+14.15%)
CodeSize: 19321468 -> 19304164 (-0.09%); split: -0.09%, +0.01%
Instrs: 3593957 -> 3591647 (-0.06%); split: -0.07%, +0.01%
Latency: 103120695 -> 102475647 (-0.63%); split: -0.63%, +0.01%
InvThroughput: 23897614 -> 23575320 (-1.35%); split: -1.36%, +0.02%
VClause: 66406 -> 66943 (+0.81%); split: -0.01%, +0.81%
SClause: 118559 -> 118548 (-0.01%)
Copies: 310871 -> 308950 (-0.62%); split: -0.69%, +0.08%
Branches: 123386 -> 123413 (+0.02%); split: -0.00%, +0.03%

These numbers mostly come from parallel-rdp ubershaders. Small changes are
also found in the rdr2 and rage2 shader metrics, whereas others are not
significantly affected.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 4453bce770 aco/spill: Replace vector<map> with vector<vector> for local_next_use
While adding/removing elements is faster with std::map, the cost of container
copies (and the involved memory allocations) vastly outweigh that benefit in
this usage pattern.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 92d7a6ab1c aco/spill: Avoid destroying local next use maps over-eagerly
Recreating these maps in a later block requires allocating fresh memory.
Instead, by never shrinking the containing vector in the first place,
previously allocated map memory is now re-used.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka df6c395095 aco/spill: Persist memory allocations of local next use maps
The function local_next_uses allocated one next-use map per instruction in
the current block. Since the function is called once per block, this caused
an excessive amount of memory allocations to take place.

With this change, the memory for next-use maps is allocated only once and
then reused for later blocks.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 387b315ea0 aco/spill: Avoid copying next_use maps more often than needed
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 276da301e6 aco/spill: Replace map[] with map::insert
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka b183bdeabf aco/spill: Remove unused container
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka 0812d440c7 aco: Use std::vector for the underlying container of std::stack
By default, std::stack uses std::deque to allocate its elements, which has
poor cache efficiency. std::vector makes appending elements more expensive
(due to potential reallocations), but in the changed contexts the element
count should always be low anyway.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Tony Wasserka f81eb2a827 aco/spill: Avoid unneeded copies when iterating over maps
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
2021-10-01 09:39:13 +00:00
Emmanuel Gil Peyrot c238faf746 radv: Allow building when LLVM isn’t enabled
Now that ACO is considered feature-complete, it can be nice to avoid the
huge LLVM dependency when one only wants a Vulkan driver.

This patch allows radv to be built without LLVM.  The two features which
get disabled are RADV_DEBUG=llvm and shader disassembly.  The latter
is an issue for debugging, so I added a warning that this configuration
is unsupported.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Tony Wasserka b70e551a51 aco/tests: Assert that the requested IR is actually provided
In particular, assembly will not be provided if no disassembler is available
for the given GPU architecture.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Tony Wasserka 3c1802accd radv: Disable shader disassembly when no disassembler is available
ACO relies on LLVM to disassemble AMD shaders for ISAs newer than GFX7,
so disassembly needs to be skipped when LLVM is not enabled.

For vkGetPipelineExecutableInternalRepresentationsKHR and vkGetShaderInfoAMD,
the disassembly will not be reported anymore if it can't be generated.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Tony Wasserka d5ac15c0e4 radv: Build code which depends on LLVM only when enabled
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Emmanuel Gil Peyrot d0ec3582af radv: Support shader compilation without LLVM dependencies
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Emmanuel Gil Peyrot 02ee0a0a7f radv: Support device initialization without LLVM dependencies
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Tony Wasserka a3e339853a aco: Extend set of supported GPUs that can be disassembled with CLRX
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Tony Wasserka ef48887a9e aco: Separate LLVM/CLRX asm printers more cleanly
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Tony Wasserka 73e82f94c9 radv: Rename radv_shader_helper.h to radv_llvm_helper.h
This better reflects that the functions declared in this header are only
available with LLVM.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>
2021-10-01 10:40:18 +02:00
Martin Roukala (néé Peres) 7ef8f1fa46 radv/ci: mark some tests as flaky on gfx9
These tests have been flaky on vega10/renoir. We don't have time to look
into it just yet, so let's just mark them as such for now!

I am also including raven, as it likely has the same issue!

v2: add dEQP-VK.api.object_management.multithreaded_per_thread_resources.image_2d
v3:
 - don't skip the test, mark them as flakes (Emma Anholt)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (néé Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13118>
2021-10-01 08:21:39 +00:00
Marcin Ślusarz 1d1cd2ee77 anv: drop redundant unlikely's around INTEL_DEBUG
They are not needed since 4015e1876a.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13115>
2021-10-01 07:57:20 +00:00
Marcin Ślusarz 6229d40fbf intel/compiler: drop redundant likely's around INTEL_DEBUG
They are not needed since 4015e1876a.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13115>
2021-10-01 07:57:20 +00:00
Marcin Ślusarz f7f5062f09 crocus: drop redundant unlikely's around INTEL_DEBUG
They are not needed since 4015e1876a.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13115>
2021-10-01 07:57:20 +00:00
Samuel Pitoiset 5b684a7a7c radv: fix vk_object_base_init/finish for internal buffers
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13102>
2021-10-01 07:26:37 +00:00
Samuel Pitoiset f07e67272e radv: fix vk_object_base_init/finish for internal image views
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13102>
2021-10-01 07:26:37 +00:00
Samuel Pitoiset 16378837db radv: fix vk_object_base_init/finish for the internal push descriptors
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13102>
2021-10-01 07:26:37 +00:00
Samuel Pitoiset 3e89b20858 radv: fix vk_object_base_init/finish for internal buffer views
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13102>
2021-10-01 07:26:37 +00:00
Samuel Pitoiset 1b3f0ccb38 radv: fix vk_object_base_init/finish for the internal pipeline cache
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13102>
2021-10-01 07:26:37 +00:00