Commit Graph

2925 Commits

Author SHA1 Message Date
Connor Abbott 952ab4f64f tu: Enable subgroupBroadcastDynamicId
It's a Vulkan 1.2 only feature, but it's trivially supported.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13756>
2021-11-12 18:14:34 +00:00
Hyunjun Ko ddb3d30d47 turnip: Enable VK_KHR_separate_depth_stencil_layouts
We now start handling depth/stencil layouts separately when
adding implicit subpass dependancies.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13057>
2021-11-12 13:16:23 +00:00
Christian Gmeiner a0634a3c85 ci/bare-metal: switch to common .baremetal-test-arm64
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13751>
2021-11-12 08:22:29 +00:00
Emma Anholt a68a0c9e1c mesa/st: Disable NV_copy_depth_to_color on non-doubles-capable HW.
The previous doubles check
(https://gitlab.freedesktop.org/mesa/mesa/-/issues/3459) checked that you
didn't have full doubles emulation turned on, but we also need to check
that you have doubles at all (emulated or not) or non-GL4 drivers will
fail.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13743>
2021-11-11 16:38:58 +00:00
Emma Anholt 94e4cd4d83 freedreno/fdl6: Skip redundant setting of TILE_ALL for NV12.
We already respect the tile_all flag above, and it should be set in tu.
Fixes a mismatch between fdl6_view_init() and gallium.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 2e6810a06a util/format: Add G8_B8R8_420_UNORM to match Vulkan.
turnip was playing fast and loose with the name, using the R8_G8B8 format
name but actually setting the descriptors up to read G8_B8R8 like Vulkan
(sensibly) wants.  This caused trouble when trying to make freedreno and
turnip share code.  By having both orderings as format names, we can share
the descriptor code and also confuse readers less.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 271b6cb981 util: Rename PIPE_FORMAT_G8_B8_R8_420_UNORM.
The only user, turnip, was actually treating it as this layout, matching
vulkan's specification of how the planes map to RGB values.  (Y=G means
that Cb=B and Cr=R).

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 549924d53e freedreno: Fix constant-index assumptions in IBO loads.
The encoder already sets up our IBO accesses as potentially nonuniform, so
we just need to be careful to not try to force the IBO index into an
immediate.

Fixes assertion failures in piglit arb_shader_image_load_store-invalid
(intermittent due to
https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/597), which
had some interesting actual failures hidden behind it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13601>
2021-11-10 17:48:59 +00:00
Emma Anholt 9e04f97d8e freedreno: Fix the uniform/nonuniform handling for cat5 bindful modes.
We can see from the dynamically_uniform (compiler doesn't know if you're
uniform or not) vs uniform (compiler can see it's uniform) case in the
blob which is which.  Now that we have the right names, also use the
nonunif flag for encoding the actual non-uniform mode (previously, we were
always setting it always in a way that meant uniform).

I verified this behavior back to a418 with samplers.  The a3xx blob I have
only does GLES3, so we don't have the opaque_type_indexing tests to see.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13601>
2021-11-10 17:48:59 +00:00
Hyunjun Ko 5d0712b185 turnip: expose VK_KHR_driver_properties
Now that we have a conformance version to advertise, we can expose the
extension.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6251>
2021-11-09 03:43:54 +00:00
Emma Anholt 1e850f23b1 turnip: Claim 1.2.7.1 CTS conformance.
I submitted a conformance package for A618 today, so let's stop doing all
this warning about non-conformance.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6251>
2021-11-09 03:43:54 +00:00
Connor Abbott 38f0b36f1a ir3/spill: Initial implementation of rematerialization
This only handles moves from immedates/constants. The next step would be
to rematerialize ALU instructions whose sources are available.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13650>
2021-11-08 23:51:37 +00:00
Connor Abbott db566904ba ir3/spill: Mark root as non-spillable after inserting
We have to mark the root as non-spillable in case the interval is the
child of some other interval, but we can't know whether it's the child
of some other interval until it's been inserted. Move the setting of
cant_spill below the insertion. This prevents us from using a bogus
parent value.

Fixes: 613eaac7b5 ("ir3: Initial support for spilling non-shared registers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13650>
2021-11-08 23:51:37 +00:00
Emma Anholt 34739cb6e2 freedreno/ir3: Fix off-by-one in prefetch safety assert.
This looks like just a typo, we allow up to == 0xf in the lowering pass.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13668>
2021-11-04 22:49:29 +00:00
Emma Anholt 35f56ad856 freedreno/a5xx: Diff reduction in fd5_layout to fd6_layout.
This should be exactly equivalent code, except for the is_3d "level <= 1"
which doesn't bring over 6c19d37331 ("freedreno/a6xx: fix 3d tex
layout") due to it failing our unit tests where we compare to the blob's
behavior.  The layer_stride setup is pulling in what freedreno_resource.c
was doing after the layout setup, so we match fd6 and so that it could
potentially be checked in unit testing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13668>
2021-11-04 22:49:29 +00:00
Emma Anholt 1e869e3fb4 freedreno/a5xx+: Fix missing LA formats.
GL_ARB_texture_buffer_object uses these formats, and we expose it.  Since
we didn't have the formats in the table, we we were using bad HW
texture/color formats for them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13666>
2021-11-04 19:07:54 +00:00
Emma Anholt 0e4fcda7e0 freedreno/a6xx: Don't try to generate mipmaps for SNORM with our blitter.
Since we're casting to unorm, the linear filtering will give bad results.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13666>
2021-11-04 19:07:54 +00:00
Emma Anholt 0913ac33a9 freedreno/a618: Mark a flaky test that triggers hangcheck.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13659>
2021-11-04 03:47:54 +00:00
Emma Anholt d1801d43f8 freedreno/a5xx: Use the defined names for 2D_BLIT_CNTL regs.
We have definitions for them above, no need to be UNKNOWN about it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13659>
2021-11-04 03:47:54 +00:00
Emma Anholt f0f5b8d47c freedreno/a6xx: Fix partial z/s clears with sysmem.
We have to set 8c01 to say "leave these channels alone" when
clearing/storing just Z or S of z24s8.  Fixes the bypass path for
KHR-GLES3.packed_depth_stencil.verify_read_pixels.depth24_stencil8.

Cc: mesa-stable
Fixes: #5592
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13659>
2021-11-04 03:47:54 +00:00
Matt Turner cc29b94041 freedreno/ir3: Use immediate for flat.b's src1
According to Jonathan Marek:

  Only one immediate can be decoded in a cat2 instruction (if both srcs
  are immediates, they will use the value of the either the first or
  second one, I don't remember which) - using 2 immediates in a cat2
  instruction is only "correct" if they are both equal.

  The (i,j) in the second src of flat.b is not unused, but behaves as 0
  for any (small) integer because it is a float src. The hack I
  suggested is to set the second src equal to (immediate) first src,
  which seems to work.

This allows us to remove a couple of mov instructions or a bit of extra
constfile usage.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13558>
2021-11-04 02:59:28 +00:00
Matt Turner 2ab0cf2b54 freedreno/ir3: Use flat.b to load flat varyings on a6xx
The flat.b/bary.f cat2 instruction should be faster than an ldlv cat6
instruction, even with a couple of additional moves (which will be
removed in the next patch).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13558>
2021-11-04 02:59:28 +00:00
Matt Turner 2ee1b5a526 freedreno/ir3: Add infrastructure for flat.b
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13558>
2021-11-04 02:59:28 +00:00
Matt Turner a150e31910 ir3: Add support for (dis)assembling flat.b
flat.b is a variant of the bary.f instruction that does not perform
interpolation of the varying input.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13558>
2021-11-04 02:59:28 +00:00
Emma Anholt 14fca01b32 freedreno: Fix layered rendering to just Z/S and not color.
We would try to take the gmem path which can't do layered rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13653>
2021-11-03 21:13:45 +00:00
Emma Anholt 3050e20283 freedreno/fdl6: Add support for texture swizzles of A/L/I/LA/RGBx.
To convert freedreno over, we need to support these formats where we remap
R or RG formats to GL compat ones, or RGBA to RGBx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt 669caded51 turnip: Remove buffer-view cross-check code.
Now that I've tested storage.*buffer, I'm confident I've moved the buffer
views correctly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt ef1fb25787 turnip: Use the new shared buffer-view descriptor creation function.
This cross-checks that our descriptors match as I move the code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt aa3074e5be freedreno/fdl6: Add an interface for setting up buffer descriptors.
Buffers don't need all the layout stuff that image views do, so it's
easier to have a separate interface for generating them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt 7b578c1249 freedreno/a6xx: Emit a null descriptor for unoccupied IBO slots.
Fixes a crash in some desktop GL testcases in piglit.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13635>
2021-11-03 19:38:48 +00:00
Emma Anholt 29093bc42d freedreno: Fix gmem invalidating the depth or stencil of packed d/s.
The gmem store stores both depth and stencil for z24s8.  So, if we're
doing a write (clear or draw) to one or the other of the channels, we need
the other one restored as well.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13649>
2021-11-03 18:56:23 +00:00
Danylo Piliaiev 3afdc3ab2c freedreno/computerator: Support A660 gpu
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13640>
2021-11-03 16:32:19 +00:00
Danylo Piliaiev 79fcd63bd6 tu: fix rast state allocation size on a6xx gen4
A few regs were added without changing the size of draw state.

Fixes: 4e05338d99 ("turnip: Rast updates for a6xx gen4")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13644>
2021-11-03 16:09:23 +00:00
Emma Anholt 4e28962800 ci: Uprev VK-GL-CTS to 1.2.7.2, and pull in piglit while I'm here.
The VK-GL-CTS fixes some issues for freedreno, and almost all of LVP's
xfails.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13622>
2021-11-02 20:29:31 +00:00
Tomeu Vizoso 27cb4166b5 freedreno/ci: Test Turnip on Adreno 618
Collabora has added 7 new lazor Chromebooks which have Adreno 618 GPUs.

Run half of the test suite (plus variants) in pre-merge.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13441>
2021-11-02 10:51:54 +00:00
Guilherme Gallo 8d96cf4eaa ci/freedreno: Add maxcpus=2 to the kernel cmdline on a530
It seems that the cpufreq support in a530 is not rock solid yet, as the
device intermittently reboots during the boot process.

Passing `maxcpus=2` to the kernel avoids this issue.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13089>
2021-11-02 07:06:46 +01:00
Rob Clark 7e998783db freedreno/ir3: xfb fix for duplicate outputs
We can't rely on regid to be unique, shaders can have multiple varyings
with the same output value.  Normally shader linking deduplicates these,
but we still need to handle the case for xfb.  So use slot instead as
the unique identifier.

Fixes KHR-GLES31.core.gpu_shader5.fma_precision_*

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13605>
2021-10-31 16:30:13 +00:00
Rob Clark f6f760a98d freedreno/ir3/print: Show end's outidxs
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13605>
2021-10-31 16:30:13 +00:00
Connor Abbott 68a62226e4 ir3: Don't emit barriers for make_available/make_visible
When looking at the output of some CTS tests, I realized that the
barriers vtn currently inserts to emulate coherent memory accesses
were being turned into fences, even though we never needed to do
anything special for coherent accesses before so presumably accesses are
already cache-coherent by default. Ignore make_visible/make_available
semantics to get us back to parity with the old path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13599>
2021-10-29 23:38:10 +00:00
Jason Ekstrand 4108fda426 vulkan: Move all the common object code to runtime/
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Connor Abbott 8d0b508d91 ir3: Emit barriers for images again
This was accidentally broken with the nir_var_image work.

Fixes: e87dbfd3 ("ir3: Check for nir_var_mem_image in shared_barrier handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13593>
2021-10-29 16:33:04 +00:00
Connor Abbott 98c1448509 tu: Always write GRAS_LRZ_MRT_BUF_INFO_0
This fixes flakes in dEQP-VK.pipeline.stencil.nocolor.format.* when run
after ycbcr tests. Apparently LRZ needs to know if there's a media
format enabled even if there are no color attachments, so we need to
write something here. Presumably any "normal" format would work but 0
seems like a good neutral choice.

Fixes: 9c895e13 ("tu: Emit GRAS_LRZ_MRT_BUF_INFO_0")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13578>
2021-10-28 22:19:09 +00:00
Danylo Piliaiev aa264ded94 ir3/ra: Check register file upper bound when updating preferred_reg
Otherwise we could get invalid reg in get_reg()

Would fix many dEQP-VK.ssbo.phys.layout.*

Fixes: 0ffcb19b9d "ir3: Rewrite register allocation"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13546>
2021-10-28 14:08:43 +00:00
Emma Anholt bfbc41a9fa ci/piglit-runner: Merge piglit-driver-*.txt files into driver-*.txt.
The test names are definitely unique (deqp has specific prefixes, piglit
uses '@' as a separator instead of '.'), so we can just have a single file
regardless of test type.  Merges the two groups of xfails together so you
can't mix up which file to edit (I certainly have), and so that we don't
need to introduce yet another set of files when we add gtest for libva.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13517>
2021-10-27 20:54:11 +00:00
Emma Anholt 38dff02bfb ci/deqp-runner: Rename the deqp-drivername-*.txt files to drivername-*.txt
We have two testsuites with the same format for fails/flakes/skips files,
and test names that are definitely unique.  As I'm about to add a third
testsuite (gtest for libva-utils), so let's have just one file each for
fails/flakes/skips instead of one per type of testsuite.  This starts the
move with just the bulk rename of deqp.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13517>
2021-10-27 20:54:11 +00:00
Ilia Mirkin 6c61494771 freedreno: support lua54
This is the default version in gentoo, and it apparently uses the lua54
variant rather than lua.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13510>
2021-10-26 00:33:31 +00:00
Rob Clark d2a7afe34d freedreno/drm: Move suballoc_bo to device
Having it in msm_pipe isn't saving any locking.  But it does mean that
cleanup_fences() can drop the last pipe reference, which in turn drops
the last suballoc_bo reference, which can cause recursion back into the
bo cache.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5562
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13521>
2021-10-26 00:12:02 +00:00
Rob Clark 2c6fb9780c freedreno/drm: Add some asserts
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13521>
2021-10-26 00:12:02 +00:00
Emma Anholt ebe9494b61 turnip: Drop the assertion about the temporary bit in sync fd imports.
Khronos's conclusion was that you only need the bit when you want
temporary and there's a choice between temporary and permanent.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13473>
2021-10-22 21:44:44 +00:00
Matt Turner 2822b1345c tu: Expose required VK_FORMAT_FEATURE bits for planar YUV formats
Specifically this enables these VK_FORMAT_FEATURE bits:

  VK_FORMAT_FEATURE_TRANSFER_SRC_BIT
  VK_FORMAT_FEATURE_TRANSFER_DST_BIT
  VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT
  VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT
  VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
  VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
  VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT
  VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT

Fixes the following tests:
  dEQP-VK.api.info.format_properties.g8_b8_r8_3plane_420_unorm
  dEQP-VK.api.info.format_properties.g8_b8r8_2plane_420_unorm
  dEQP-VK.api.info.image_format_properties.2d.optimal.g8_b8_r8_3plane_420_unorm
  dEQP-VK.api.info.image_format_properties.2d.optimal.g8_b8r8_2plane_420_unorm

Additionally allows 339 tests in dEQP-VK.ycbcr.* to go from Skip to
Pass.

[ Connor: Fake support for 3-plane formats, fixup modifiers path ]

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>
2021-10-22 11:25:31 +00:00
Jonathan Marek 330a8cfa07 turnip: enable UBWC for NV12
Use the special format for accessing the Y plane of UBWC-enabled NV12, and
enable UBWC for NV12.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>
2021-10-22 11:25:30 +00:00
Connor Abbott 9c895e133b tu: Emit GRAS_LRZ_MRT_BUF_INFO_0
The blob seems to always emit this, even though it seems to only be used
when rendering to the special planar formats (which we only do in the
blit path). Based on the LRZ prefix it might used in other cases though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>
2021-10-22 11:25:30 +00:00
Connor Abbott c135c2cdb7 freedreno/a6xx: Rename GRAS_2D_BLIT_INFO
It's not actually used for 2d blits, it's supposed to mirror
RB_MRT_BUF_INFO[0].COLOR_FORMAT and seems to be used only when rendering
to the special planar formats, although the blob name seems to suggest
it's connected to LRZ.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>
2021-10-22 11:25:30 +00:00
Jonathan Marek 8ea6f17fdf freedreno/layout: Fix the UBWC block size for the Y plane
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>
2021-10-22 11:25:30 +00:00
Rob Clark 138be96301 freedreno/ir3: Fix validation of subgroup macros
They don't need to enforce that src types are all the same.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark e68d918ffb freedreno/ir3: Get req_local_mem from pipe_compute_state
mesa/st initializes req_local_mem to shader->info.shared_size.  But for
clover the shared size doesn't come from the shader.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark f58438320c freedreno/ir3: Add ihadd/uhadd
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark f5ce806ed7 freedreno/ir3: Add wide load/store lowering
Lower load/store for vectors wider than 4.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 7a7ac8cd40 freedreno/ir3: Fix reg size validation
8b types also live in half-regs

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 8a6934dfe8 freedreno/ir3: Fix load/store_global_ir3 type
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 81eefe0090 freedreno/ir3: 8bit fixes
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark f7b2d613c5 freedreno/ir3: 16b bools
A create_immed_for_instr() type thing could be useful to make the immed
type match other src(s) for instruction..

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 9a2562a545 freedreno/ir3: Deal with zero-source instructions
Needed by the next patch, which starts treating bools as 16bit exposing
a bug that was previously accidentially hidden for instructions like
ELECT_MACRO.  Needed for next patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 0a35ba5c43 freedreno/ir3: Move lower_idiv_options
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark e544a9db16 freedreno/ir3: Add support for load_kernel_input
Used for function arguments to compute kernels (ie. OpenCL).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark e10c76d277 freedreno/ir3: implement load_work_dim intrinsic
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 3bd265a393 freedreno/ir3: vec8+vec16 support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 1e9f27f37f freedreno/ir3: Handle MESA_SHADER_KERNEL
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Danylo Piliaiev c4e7541b9d freedreno/ir3: use stg.a/ldg.a only if offset is reg or doesn't fit
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 064c806d23 freedreno/ir3: Add load/store_global lowering
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Danylo Piliaiev d85eb9268a freedreno/ir3: set proper dst size for {store,load}_{global,shared}_ir3
We want to pass 64b variables.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Danylo Piliaiev 1ef43a0be7 freedreno/ir3: disallow immediate addr/offset for ldg/ldg.a
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark f45b7c58c4 freedreno/ir3: Lower 64b phis
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Danylo Piliaiev bee9212efb ir3/freedreno: add 64b undef lowering
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Rob Clark 2d65e6f56d freedreno/ir3: 64b intrinsic lowering
Both for OpenCL and VK_KHR_buffer_device_address

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
2021-10-21 18:59:57 +00:00
Emma Anholt 9202e8cbaf turnip: Make copy_format() and tu6_plane_format() return pipe_format
[ Connor: Keep the argument to copy_format() a VkFormat, fold in
  plane_format() conversion. ]

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13379>
2021-10-21 08:46:31 +00:00
Emma Anholt cbdc8e09bf turnip: Switch format_to_ifmt() to take a pipe_format.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13379>
2021-10-21 08:46:31 +00:00
Emma Anholt e4e8db0132 turnip: Switch tu6_format_color() to a pipe_format.
To handle Y8 specially, we want a PIPE_FORMAT instead of VK_FORMAT.  There
are some redundant vk-to-pipe conversions, but they're going to go away
shortly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13379>
2021-10-21 08:46:31 +00:00
Emma Anholt 3b68fc0c6a turnip: Switch tu6_format_texture() to a pipe_format.
To handle Y8 specially, we want a PIPE_FORMAT instead of VK_FORMAT.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13379>
2021-10-21 08:46:31 +00:00
Connor Abbott cfabdbd7d3 tu/clear_blit: Move around copy_format()/tu6_plane_format()
We want these functions to take a Vulkan format and return a
pipe_format, but tu6_plane_format() was getting redundantly called on
the result of copy_format() and copy_format() was also getting called
twice with image to image copies. Pull these functions further up the
call chain so that they're only called once.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13379>
2021-10-21 08:46:31 +00:00
Emma Anholt b978688df6 ci/deqp-runner: Use new deqp-runner's built-in renderer/version checks.
This is prettier in the log files, less shell code, and for non-suite mode
adds checking that the driver has the right git sha1.  Also, no need for
suites to have a DEQP_VER to say which dEQP we should run for the renderer
check.

The version checks can help us make sure that GL version exposed doesn't
accidentally regress, and the ".*git" checks that we're using a git
version of Mesa rather than something that snuck in through distro
packages.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13372>
2021-10-21 07:34:19 +00:00
Emma Anholt 9ddfd297e0 ci/deqp-runner: Simplify the --jobs argument setup.
We can use the general "how parallel should we go on this runner?" env var
and save a bunch of massaging env var names.  Fixes how PIGLIT_PARALLEL
looked like it was useful but actually wasn't passed through to HW
runners.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13372>
2021-10-21 07:34:19 +00:00
Connor Abbott e7599f09a1 ir3: Use stp/ldp base offset for {load,store}_scratch
When we have a series of loads/stores we were creating a constant for
each one, which isn't great. Furthermore, because the nir pass puts the
offset constant at the top of the shader, it resulted in extra register
pressure and spilling when that happened inside a loop. Fix this by
using the base/offset form of stp and ldp.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13307>
2021-10-20 15:19:15 +00:00
Connor Abbott 7deb0d296d ir3/cse: Support mov instructions
This doesn't affect shader-db at all, but it will help clean up the
mov's emitted in the next commit when there are multiple ldp/stp.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13307>
2021-10-20 15:19:15 +00:00
Emma Anholt 80d5e40fd1 freedreno/afuc: Disable the disassembler on 32-bit builds.
There's an mmap(2 << 32), which armhf can't handle.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5514
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13421>
2021-10-19 18:55:07 +00:00
Rob Clark 5948ff4826 freedreno/computerator: Fix mergedregs
This was getting set *after* ir3_shader_assemble, which was too late.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13426>
2021-10-19 16:04:42 +00:00
Rob Clark 22a203aa4c freedreno/isa: Fix ldg/stg "halfness"
Whether the load dst or store src is a half reg is determined by the
type field, similar to cat5.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13426>
2021-10-19 16:04:42 +00:00
Rob Clark 834e8066c1 freedreno/ir3/tests: Add some 8/16b ldg/stg tests
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13426>
2021-10-19 16:04:42 +00:00
Rob Clark 8657e201d0 freedreno/ir3/tests: Don't skip encode test if decode fails
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13426>
2021-10-19 16:04:42 +00:00
Danylo Piliaiev ebca227db1 turnip: implement vk_dont_care_as_load workaround
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13367>
2021-10-18 17:26:41 +00:00
Danylo Piliaiev fd31989ecb turnip: add support for dirconf
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13367>
2021-10-18 17:26:41 +00:00
Connor Abbott de568c3b2c tu/clear_blit: Stop creating a franken-image for staging blits
Extricate the last use of tu_image_*.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13359>
2021-10-18 16:00:39 +00:00
Connor Abbott 9803c1aa10 tu: Remove cross-check scaffolding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13359>
2021-10-18 16:00:39 +00:00
Connor Abbott d785aea530 tu: Switch clear/blit to fdl6_view and cross-check
This will help us create staging resources with a Y8 format and avoids
calling into the Vulkan-level entrypoints which will have to be changed
to use vk_image and vk_image_view.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13359>
2021-10-18 16:00:39 +00:00
Connor Abbott 1874e12f19 tu: Use fdl6_view in tu_image_view and cross-check
Because some of the fields aren't filled out when a format doesn't
support rendering, we temporarily clear the structure so that we can
compare.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13359>
2021-10-18 16:00:39 +00:00
Connor Abbott 5509132a80 freedreno/fdl: Add fdl6_view
This is mostly based on tu_image_view. The notable difference is that we
don't handle choosing the correct plane out of multiple planes when
indicated by the aspect, which means that there is no equivalent of
VK_IMAGE_ASPECT_PLANE_1 etc. This is expected to be done in the driver,
and note that freedreno gallium handles this very differently anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13359>
2021-10-18 16:00:38 +00:00
Connor Abbott 464b9d6bf1 freedreno/fdl: Add mip_level to fdl_layout
We need this when calculating the descriptors in the image view.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13359>
2021-10-18 16:00:38 +00:00
Connor Abbott 7bcccd1f08 freedreno/fdl: Constify fdl6_get_ubwc_blockwidth()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13359>
2021-10-18 16:00:38 +00:00
Jason Ekstrand 956199e870 nir: s/nir_var_mem_image/nir_var_image/g
We typically use nir_var_mem_* for stuff that has an explicit byte-based
memory layout.  Images are opaque.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13386>
2021-10-16 03:47:10 +00:00
Rob Clark 0480595d03 freedreno/isa: Add immed reg accessors
This way we can assert that a src that we expect to be an immediate
actually is.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
2021-10-15 15:52:33 +00:00
Rob Clark 5b6e5db5d0 freedreno/ir3: Don't lower s2en if samp/tex is too large
We only have four bits to encode an immediate samp/tex.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
2021-10-15 15:52:33 +00:00
Rob Clark bfd8b7c930 freedreno/ir3/tests: Add additional disasm test vectors
Add branch with negative offset, and a couple others to trigger issues I
found while adding pack_field() overflow asserts.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
2021-10-15 15:52:33 +00:00
Rob Clark c0ecfeb023 freedreno/ir3/tests: Fix indentation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
2021-10-15 15:52:33 +00:00
Rob Clark 8b0550f09f freedreno/isa: Fixes for validation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
2021-10-15 15:52:33 +00:00
Rob Clark 9516d8ce98 freedreno/ir3+isa: Cleanup bindless cat5 samp/tex encoding
Don't let the way they are encoded at the isa level leak thru to the
ir3 level.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13353>
2021-10-15 15:52:33 +00:00
Jason Ekstrand d43f89f17a ir3: Images are always nir_var_mem_image
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
2021-10-15 14:58:56 +00:00
Jason Ekstrand e87dbfd3e8 ir3: Check for nir_var_mem_image in shared_barrier handling
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4743>
2021-10-15 14:58:56 +00:00
Danylo Piliaiev 1c0eb7aa78 ir3/freedreno: account for component in build_tessfactor_base
The burden was put on the caller, which caused:
- Reading of tess levels back in TCS not accounting for component
- Reading patch outputs in TES account for component twice

Fixes vkd3d tests:
- test_tessellation_read_tesslevel
- test_tessellation_primitive_id
- test_line_tessellation_dxbc

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13338>
2021-10-14 17:35:24 +00:00
Hyunjun Ko 30b4911031 turnip: enable strictLines
Now we can enable strictLines as we set rectangular lines by default.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6020>
2021-10-13 12:18:01 +00:00
Hyunjun Ko 542211676c turnip: enable VK_EXT_line_rasterization
By default line mode is VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT,
when lineRasterizationMode is VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT
and primtype is line - we enable bresenham line mode.

We have to disable MSAA when bresenham lines are used, this is
a hardware limitation and spec allows it:

  "When Bresenham lines are being rasterized, sample locations may
   all be treated as being at the pixel center (this may affect
   attribute and depth interpolation)."

This forces us to re-emit msaa state when line mode is changed.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6020>
2021-10-13 12:18:01 +00:00
Hyunjun Ko 88afceacf0 freedreno/a5xx,a6xx: rename MSAA_ENABLE to LINE_MODE in GRAS_SU_CNTL
This bit seems like the control for line mode of rastrization.

That can be simply figured out by comparing
dEQP-VK.rasterization.primitives.no_stipple.bresenham_lines,
dEQP-VK.rasterization.primitives.no_stipple.rectangular_lines and
dEQP-VK.rasterization.primitives.no_stipple.lines.

For opengl, the value of bresenham lines mode, which is 0, is set
by default and the value of rectangular mode, which is 0x1, is set
when multi-sampled.

For vulkan, the bresenham lines are enabled when lineRasterizationMode is
VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT, which sets the bit to 0, while
the value is 1 when it's VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT,
that seems to be default.

If both multi-sampled and bresenham-lines are used when primitive type is
line, the bit is to be set as 0 and makes msaa disabled.

Note that this is only tested on a6xx, but I guess it's likely the same
for a5xx.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6020>
2021-10-13 12:18:01 +00:00
Danylo Piliaiev 9539315f97 turnip: fix streamout buffer offset calculations
Fixes vkd3d test "test_vbv_stride_edge_cases"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13315>
2021-10-13 01:46:03 +00:00
Emma Anholt 613b9c8c47 ci: Update deqp to vulkan-cts-1.2.7.1.
Brings in some VK fixes for tilers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13253>
2021-10-13 00:37:59 +00:00
Jason Ekstrand 531437d7f6 turnip: Use the common WSI wrappers
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
2021-10-13 00:06:15 +00:00
Jason Ekstrand 916c9335b4 meson: Add and use an idep for Vulkan WSI
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
2021-10-13 00:06:15 +00:00
Emma Anholt d071a241f4 ci/freedreno: Disable the minetest trace due to flaky shader code.
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4595
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13316>
2021-10-12 20:50:17 +00:00
Danylo Piliaiev 4218596671 ir3/freedreno: handle non-uniform a1en instructions
Fixes vkd3d test "test_bindless_samplers_sm51"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13311>
2021-10-12 17:43:52 +00:00
Danylo Piliaiev f0d469e85f ir3/freedreno: handle non-uniform resinfo
We forgot to handle non-uniform resinfo case.

Fixes vkd3d test "test_bindless_bufinfo_sm51"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13311>
2021-10-12 17:43:52 +00:00
Connor Abbott f8e9a50322 ir3: Fold ldc src immediates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott 470bf75ff8 ir3: Fix handling cat6 immediates
We were treating them the same as regular cat2/cat3/cat4 immediates, but
that's not right because cat6 sources are only 8 bits.

Our bindless code was handling this before for bindless resources, and
it was disabled for most other things, so this was mostly harmless, but
fixing it will be necessary for handling ldc offsets.

In addition enable tests for this that were just commented out, and add
a custom test making sure that the immediate source is treated as
unsigned.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott bf3c8e3705 ir3: Fix check for immediate range
This would incorrectly allow both e.g. 0x2000 and 0xffffe000 to be
encoded as 0x2000.

Fixes: f0a1f3de27 ("freedreno/ir3: cp small negative integers too")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott 6dc56f18bc ir3/legalize: handle WAR for special regs
In particular many cat5/cat6 instructions read a1.x, and we need to add
a (ss) before any mova1 instruction afterwards, as the blob does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott 1ed9a2f50c ir3: Handle special regs in regmask
Use the same hack as post-RA scheduling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott a37f9602b7 ir3: Remove separate regmask.h
Inline it into its one user. There's no point in keeping it separate,
and in order to handle special registers it will have to become a bit
more intertwined with core ir3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott 548377bcf3 ir3: Always create barycentrics in the input block
Otherwise, when there are uses in multiple blocks the collect may not
dominate some of the uses.

This is a bugfix, but before it would've mattered only in weird
scenarios with interpolateAt*. When we start moving prefetch textures
into the block before the preamble it will start to matter more, because
it will need to read the barycentrics from a different block than the
bary.f instructions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott 38a84723f1 ir3: Make ir3_create_collect() take a block
There's no reason to make this any different from the other builders,
since it just creates a collect instruction, and in the next commit
we'll need to create a collect in the first block for prefetch textures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott 8fb99b58df ir3: Fix printing branch type
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott 751f425c37 ir3/cp: Fix inlining 32->16 const into meta instructions
We shouldn't return early here, because we still need to actually do the
conversion. Fixes an infinite loop.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Connor Abbott ab0a665615 ir3/cp: Add missing const promotion check
We need to check the source type for moves when the destination type is
u16, just like the f16 check above.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13142>
2021-10-12 11:30:52 +00:00
Vinson Lee c30fb8ee4d freedreno: Add valgrind dependency.
Fix a build error.

In file included from ../src/util/u_queue.h:38,
                 from ../src/freedreno/drm/freedreno_ringbuffer.h:33,
                 from ../src/freedreno/ds/fd_pps_driver.h:13,
                 from ../src/freedreno/ds/fd_pps_driver.cc:7:
../src/util/simple_mtx.h:35:12: fatal error: valgrind.h: No such file or directory
   35 | #  include <valgrind.h>
      |            ^~~~~~~~~~~~

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13280>
2021-10-11 19:20:23 +00:00
Connor Abbott d4b5d2a020 ir3/ra: Use killed sources in register eviction
Let's assume we have a vec2 collect instruction with killed sources that
are non-contiguous and the entire rest of the register file is blocked,
which can happen when our register target is very tight. It's impossible
to just insert move instructions to resolve this, but we can make space
by swapping one of the killed sources with the value next to the other,
assuming it's also scalar.

This commit implements that idea, preventing us from falling back to the
terrible shuffle-everything approach in this case.

total instructions in shared programs: 1566648 -> 1565117 (-0.10%)
instructions in affected programs: 13332 -> 11801 (-11.48%)
helped: 30
HURT: 5
helped stats (abs) min: 6 max: 535 x̄: 51.77 x̃: 25
helped stats (rel) min: 2.67% max: 33.63% x̄: 12.28% x̃: 9.58%
HURT stats (abs)   min: 1 max: 6 x̄: 4.40 x̃: 6
HURT stats (rel)   min: 0.18% max: 5.13% x̄: 2.41% x̃: 2.13%
95% mean confidence interval for instructions value: -75.05 -12.43
95% mean confidence interval for instructions %-change: -13.18% -7.18%
Instructions are helped.

total mov in shared programs: 77336 -> 76683 (-0.84%)
mov in affected programs: 2135 -> 1482 (-30.59%)
helped: 29
HURT: 5
helped stats (abs) min: 2 max: 227 x̄: 23.31 x̃: 10
helped stats (rel) min: 6.06% max: 72.73% x̄: 31.83% x̃: 30.00%
HURT stats (abs)   min: 2 max: 9 x̄: 4.60 x̃: 4
HURT stats (rel)   min: 14.29% max: 69.23% x̄: 34.00% x̃: 27.78%
95% mean confidence interval for mov value: -33.21 -5.20
95% mean confidence interval for mov %-change: -32.94% -11.35%
Mov are helped.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13143>
2021-10-11 16:54:37 +00:00
Connor Abbott 214febdc5d ir3/ra: Don't reset round-robin start for each block
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13143>
2021-10-11 16:54:37 +00:00
Connor Abbott decbced48f ir3: Initialize local size earlier
We need the local size in RA for occupancy calculations. Not
initializing these had the unfortunate consequence of
ir3_get_reg_independent_max_waves() returning 0 for compute shaders with
shared variables, disabling the register limiting logic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13143>
2021-10-11 16:54:37 +00:00
Connor Abbott 0450c1b8a2 tu: Expose VK_KHR_shader_subgroup_extended_types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13271>
2021-10-11 11:00:56 +00:00
Connor Abbott bbd8301337 ir3: Skip src size validation for cat1
They are already handled below, like cat6. The default rules won't work
for the READ_* macros once they have 16-bit sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13271>
2021-10-11 11:00:56 +00:00
Connor Abbott bf0013f3c5 ir3/lower_subgroups: Support 16-bit READ_* sources
With VK_EXT_shader_subgroup_extended_types these will have 16-bit
sources that need to be expanded to 32-bit (and then narrowed again).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13271>
2021-10-11 11:00:56 +00:00
Connor Abbott 4537814349 tu: Implement VK_KHR_imageless_framebuffer
This is mostly a matter of auditing uses of
cmd->state.framebuffer and replacing every use of fb->attachments with
cmd->state.attachments. We already weren't using the attachments
anywhere outside of the render pass, so this is pretty straightforward.
We also don't have any use for anything in
VkFramebufferAttachmentImageInfo so we can just ignore it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13228>
2021-10-08 15:09:59 +00:00
Connor Abbott c5b64dfbf6 tu/clear_blit: Constify some image views
I wanted cmd->state.attachments to contain const pointers, since we
can't change the image view, but a few places were still not yet
constified.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13228>
2021-10-08 15:09:59 +00:00
Rob Clark faed3d4dfe freedreno/drm: Move pipe unref after fence removal
Dropping the final pipe ref could in turn drop the final ref to one
of a couple other bo's, which in turn could indirectly recurse back
into cleanup_fences() on the same bo, resulting in a double decrement
of bo->nr_fences and underflow to a large positive #.  This happens
because free'ing a bo back to the bo cache periodically calls
fd_bo_cache_cleanup() and any bo's that have not been re-used can
be really free'd, which in turn calls cleanup_fences().

Fixes: 7dabd62464 ("freedreno/drm: Userspace fences")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13263>
2021-10-08 07:40:14 +00:00
Jason Ekstrand a1ac8234ec turnip: Plumb non-startup errors through the new vk_error helpers
Also, change every vk_error to use the closest object instead of
fetching all the way back to the instance.

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>
2021-10-07 20:51:36 +00:00
Boris Brezillon b47090c5b3 spirv: Always declare FragCoord as a sysval
Now that all spirv_to_nir() users take care of converting sysvals to
varyings, we can unconditionally declare FragCoord as a sysval.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>
2021-10-07 19:45:35 +00:00
Boris Brezillon 4b62e90e71 spirv: Let spirv_to_nir() users turn sysvals into input varyings
This is an attempt at simplifying the spirv_to_nir() backend when it
comes to choosing between system values and input varyings. Let's patch
drivers to do the sysval to input varying conversion on their own so we
can get rid of the frag_coord_is_varying field in spirv_to_nir_options
and unconditionally create create sysvals for FragCoord, FrontFacing and
PointCoord inputs instead of adding new xxx_is_{sysval,varying} flags.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>
2021-10-07 19:45:35 +00:00
Danylo Piliaiev d590515112 ir3: support source modes for resinfo.b
IBO/SSBO may have dynamic index, previously we just silently ignored
this fact. However resinfo supports different modes.

Fixes vkd3d test "test_null_uav"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13224>
2021-10-07 08:19:13 +00:00
Emma Anholt d4efb16687 ci/freedreno: Move the other a530 test jobs to test-manual-mr.
I meant to put this in the general a530 properties, not just the a530 deqp.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13238>
2021-10-07 05:17:08 +00:00
Danylo Piliaiev 127352457c turnip: do nothing on dispatch with zero total workgroups
Otherwise GPU hangs...

Fixes vkd3d test "test_dispatch_zero_thread_groups"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13227>
2021-10-06 23:53:03 +00:00
Emma Anholt 591afd1d52 turnip: Free disk cache on pdev init failure.
Noticed while debugging test failure under valgrind (the disk cache
doesn't come from the vulkan allocator, so we could leak it and not fail
the test).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13200>
2021-10-06 16:49:03 +00:00
Emma Anholt 36d761f2a5 turnip: Fix allocation failure handling around device->name.
Fixes regressions in dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail

Fixes: 5116388e0b ("turnip: Expose a device name similar to the blob.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13200>
2021-10-06 16:49:03 +00:00
Emma Anholt 23cad1b566 turnip: Plug the vendor/device ID into the pipeline cache fields, too.
Fixes a regression in dEQP-VK.pipeline.cache.misc_tests.cache_header_test.

Fixes: 7e471541e0 ("turnip: Match the blob's format for vendorID and deviceID.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13200>
2021-10-06 16:49:03 +00:00
Danylo Piliaiev 729991e09c ir3: remove obsolete assert for intrinsic_store_output in tess
We do support non-zero nir_intrinsic_component for
nir_intrinsic_store_output in tess shaders.

Fixes vkd3d test "test_hull_shader_fork_phase_dxbc"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13196>
2021-10-06 16:06:10 +00:00
Mike Blumenkrantz 7cc85dba71 build: unify vulkan cpp platform args
these were duplicated all over the place, and it's annoying to have to keep
duplicating them any time a new component includes the vulkan header

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13141>
2021-10-06 14:19:35 +00:00