Commit Graph

3456 Commits

Author SHA1 Message Date
David Heidelberg 74da4dc216 ci/freedreno: add more restricted traces
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17167>
2022-07-01 15:04:03 +02:00
Danylo Piliaiev c655387a02 ir3: Use NIR's info.writes_memory to detect when when to force late-z
Better than maintaining our old checks.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16818>
2022-07-01 11:37:17 +00:00
Emma Anholt 05b41f9207 ci/freedreno: Filter when we run test jobs for VK or GL changes.
Not only runs less testing when only one driver is impacted, but also
makes sure zink+turnip is turned off when the farm is.

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17287>
2022-06-30 18:31:21 +00:00
Hyunjun Ko f4b72fa26d turnip: keep the depth_clip_disable state at the pipeline builder.
So we could later decide whether to enable Z_CLIP_DISABLE on not.

Closes: #6732

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17248>
2022-06-30 01:08:17 +00:00
Hyunjun Ko 6cb41c5188 freedreno,ir3: rename Z_CLAMP_ENABLE to Z_CLIP_DISABLE
UNK5 of GRAS_CL_CNTL is still unclear though.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17248>
2022-06-30 01:08:17 +00:00
Hyunjun Ko d2e769c1b6 turnip: fix wrong size for lrz cs when lrz_track_quirk is enabled.
Fixes: 4b5f0d98fd ("tu: Overhaul LRZ, implement on-GPU dir tracking and
LRZ fast-clear")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17289>
2022-06-29 11:15:23 +00:00
Connor Abbott 8183a728a2 tu: Fix stencil border color with has_z24uint_s8uint
On a650+ we use the new Z24UINT_S8UINT format to sample the stencil
aspect of D24S8, which returns stencil in the second component and also
uses the second integer component for the border color. However Vulkan
mandates that the first component is used for the stencil border color.
There's no workaround we know of, so we have to fall back to the old
behavior where there is a workaround. If we know the format, we can
fixup the border color ourselves though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17177>
2022-06-29 03:00:56 +00:00
Connor Abbott e135c03446 freedreno/fdl: Note border color constraints
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17177>
2022-06-29 03:00:56 +00:00
Connor Abbott 4901a8f86e freedreno/a6xx: Use fdl format swizzle
This makes sure that we use a consistent swizzle between computing the
border color and the texture descriptor, and lets us delete the gallium
version.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17177>
2022-06-29 03:00:56 +00:00
Connor Abbott 39c64a4b53 freedreno/a6xx: Fix border color swizzling
From the API's point of view, border color replacement looks like this:

       --------------------
       | API Border Color |
       --------------------
               |
-----------    |    ----------------      ----------
| API fmt |-------->| User Swizzle |----->| Shader |
-----------         ----------------      ----------

From the HW point of view, it looks like this:

                    -------------------
                    | HW Border Color |
                    -------------------
                             |
----------     -----------   |   ---------------      ----------
| HW fmt |-----| HW swap |------>| Tex Swizzle |----->| Shader |
----------     -----------       ---------------      ----------

When the HW fmt + HW swap isn't enough to represent an API format, we
need to prepend our own swizzle to the the user's swizzle, so the tex
swizzle is a "format swizzle" composed with the user swizzle. However,
we don't want this format swizzle to be applied to border colors, so
there's a workaround in freedreno which is meant to undo the format
swizzle so that the HW border color with the format swizzle applied
equals the API border color, and everything is ok. However, on a6xx at
least it was incorrectly undoing the entire tex swizzle. This broke
border color with a user swizzle, because it was now effectively not
getting applied for the border color. It also made it seem like the user
swizzle is required for the workaround, which would have implications
for VK_EXT_border_color_swizzle with turnip, but it's not.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17177>
2022-06-29 03:00:56 +00:00
Connor Abbott 2a928ae325 freedreno/a6xx: Document border color/swizzle interaction
Make it clear that the swap happens before border color replacment but
the swizzle happens after.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17177>
2022-06-29 03:00:56 +00:00
Danylo Piliaiev 4b5f0d98fd tu: Overhaul LRZ, implement on-GPU dir tracking and LRZ fast-clear
On-GPU LRZ direction tracking allows LRZ to support secondary cmdbufs,
reusing LRZ between renderpasses, and in future to support LRZ when
VK_KHR_dynamic_rendering is used.

With on-gpu tracking we have to be careful keeping LRZ state in sync
with underlying depth image, which means we should invalidate LRZ
when underlying image is changed or the view of image is different
from previous renderpass.

All of this resulted in LRZ logic being thinly spread through the code,
making it hard to understand. So most of it was moved to tu_lrz.c.

For more details on past and new LRZ features see comment at the
top of tu_lrz.c.

Note about blob:
- Blob is much more happy to do LRZ_FLUSH, it flushes at the start
  of the renderpass, after binning, and at the end of the renderpass.
- Blob seem not to care about changes in depth image done via
  vkCmdCopyImage.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6347

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16251>
2022-06-28 17:23:16 +00:00
Danylo Piliaiev 70f1d70ddd freedreno: document GRAS_UNKNOWN_810A
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16251>
2022-06-28 17:23:16 +00:00
Connor Abbott 1cd91fdec3 freedreno: Document a650-specific CP_REG_WRITE flag
v2: Danylo: clarified previously unknown GRAS_LRZ_CNTL field.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16251>
2022-06-28 17:23:16 +00:00
Danylo Piliaiev 5592c366cf freedreno: Document rest of GRAS_LRZ_CNTL, clarify UNK_25 event
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16251>
2022-06-28 17:23:16 +00:00
Boris Brezillon 02384ca13c tu: Use vk_pipeline_hash_shader_stage()
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17186>
2022-06-28 09:07:32 +00:00
Emma Anholt f93bee19d9 ci/turnip: Trim the a630 VK run a bit.
We have a lot of spilling coverage in a618 pre-merge, don't do it all (~2
minutes) here.  Also, force-gmem touch testing should probably test less than
the default run does!

This should help make up for having added the tu-zink run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17125>
2022-06-27 22:38:54 +00:00
Emma Anholt 523ed9521b ci/turnip: Test traces on turnip using zink.
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17125>
2022-06-27 22:38:54 +00:00
Emma Anholt 8e53194f44 ci/freedreno: Add vulkan+gl integration testing in piglit.
The libvulkan-dev was needed for building zink, which ended up turning on
the vulkan tests in piglit.  Split them out here.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17125>
2022-06-27 22:38:54 +00:00
Danylo Piliaiev 5aeefe8d75 tu: Don't count 3d blits in QUERY_TYPE_PRIMITIVES_GENERATED
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17164>
2022-06-24 14:10:56 +00:00
Danylo Piliaiev 97ef19e6ce tu: Use hw binning or sysmem with QUERY_TYPE_PRIMITIVES_GENERATED
Without hw binning in gmem primitives generated query result could be
multiplied by tile count, which is not expected by OpenGL users for
GL_PRIMITIVES_GENERATED.

See https://gitlab.khronos.org/vulkan/vulkan/-/issues/3131

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17164>
2022-06-24 14:10:56 +00:00
Vinson Lee b1df00cb79 tu: Check dereferenced value of rop_reads_dst.
Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking rop_reads_dst suggests that it may be
null, but it has already been dereferenced on all paths leading to the
check.

Fixes: 94be0dd0b8 ("tu: Implement extendedDynamicState2LogicOp")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17099>
2022-06-23 11:11:56 +00:00
Connor Abbott 7d706af76b ir3: Fix vectorizer condition for SSBOs
SSBO access works very differently from UBO access. Straddling
loads/stores isn't an issue, loads/stores instead must be aligned to the
element size and can have up to 4 components.

We support 16-bit access with SSBOs on a650+, and sometimes the
vectorizer tries to create a misaligned 32-bit access when combining
32-bit and 16-bit accesses. The UBO-focused logic didn't reject this,
which is now fixed. This fixes a number of VK-CTS regressions on a650+.

Fixes: bf49d4a084 ("freedreno/ir3: Enable load/store vectorization for SSBO access, too.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17040>
2022-06-23 10:46:31 +00:00
Jason Ekstrand deb36dc6c2 turnip: Use the new border color helpers
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15359>
2022-06-23 00:01:41 +00:00
Emma Anholt 13bf36588d ci/bare-metal: Consolidate needs declarations in .baremetal-test-*.
We had it set up for arm64 asan already, do it for everyone else too.  In
cleaning up the duplication, this fixes a pasteo in rpi3 which had the
"artifacts: false" on the wrong job, causing it to do a slow download of
the mesa build from gitlab.

Doing this required also moving the ".use-debian/arm_test" in as well, so
that its "needs:" didn't overwrite ours if it appeared after us in the
consumer's "extends:"

Should save about 20 seconds on rpi3 jobs.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17146>
2022-06-22 20:59:54 +00:00
Emma Anholt 69cad6dcb7 ci/freedreno: Turn a530 back on by default and update expectations.
I think it should be fixed since I redid how we manage serial around
restarts.  Haven't seen a fail in the manual runs I've done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17004>
2022-06-22 20:07:36 +00:00
Emma Anholt 4e3c51cbd8 freedreno/a5xx: Set the buffer bit appropriately in XS_CTRL_REG0.
This seems to be how the bit gets used, from grepping my blob traces.
Hopefully this helps stabilize some stuff.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17004>
2022-06-22 20:07:36 +00:00
Emma Anholt 6cf2b24eaf freedreno/ir3: Disable image/ssbo 16-bit conversion folding pre-a6xx.
I don't see it in blob dumps, and the reordered args tripped up validation.

Fixes: 49dc60efa1 ("freedreno/ir3: Fold 16-bit conversions into image load/store src/dsts.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17004>
2022-06-22 20:07:36 +00:00
Connor Abbott d455838081 tu: Fix linemode for tessellation with isolines
Fixes: 542211676c ("turnip: enable VK_EXT_line_rasterization")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17190>
2022-06-22 17:57:53 +00:00
Danylo Piliaiev f1c1b9687e tu: Do not expose storage image/buffer features for PACK16 formats
We don't support storing into them.

Fixes GL CTS tests running through ZINK:
 KHR-GL46.packed_pixels.pbo_rectangle.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17168>
2022-06-22 14:39:47 +00:00
Connor Abbott c601ba332b ir3/sched: Fix could_sched() determination
This needs to be accurate so that when we split and then schedule a new
a0.x/a1.x/p0.x write we will eventually make progress. It wasn't taking
the kill_path into account which could create an infinite loop as we
keep scheduling writes whose uses are blocked because they are memory
instructions not on the kill_path.

Closes: #6413
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16635>
2022-06-22 10:09:13 +00:00
Danylo Piliaiev a8671b2182 meson/tu: Don't compile libdrm paths if KGSL is selected
Even if there is libdrm we shouldn't use it if KGSL is selected.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17173>
2022-06-22 11:52:36 +03:00
Emma Anholt 5f09b1ebe9 ci/bare-metal: Add test phase timeouts to all boards.
This should help with "marge got stuck for an hour and all I got was this
failed job with no results/" when a system intermittently wedges.

This replaces the BM_POE_TIMEOUT ("did we get something on serial in the
last 3 minutes?") that rpi had, in favor of checking that the whole test
job gets through in 20 minutes.

Acked-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17096>
2022-06-21 21:38:25 +00:00
Danylo Piliaiev 909e7aaf57 tu: Reset xfb_used at the end of a renderpass
Otherwise xfb_used could be true until the end of command buffer,
which is not what we intended it to be.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17162>
2022-06-21 21:15:10 +00:00
Emma Anholt 086faecbba turnip: Document some fields about resolves.
I noticed the unk12 pattern, and cwabbott and danylo had figured out some
more details.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17126>
2022-06-21 19:40:58 +00:00
Danylo Piliaiev 48540caec9 tu: Disable sample counting for 3d blits during occlusion query
Per Vulkan spec only "Draw" commands should be counted towards
occlusion query.

Apparently RB_SAMPLE_COUNT_CONTROL::UNK0 bool controls whether
sample counting is enabled, so we could use it to disable
sample counting for 3d blits which are sometimes used for
clear/copy/blit/gmem-store/resolve operations.

Fixes GL CTS tests running through Zink:
 dEQP-GLES3.functional.occlusion_query.depth_clear
 dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_clear
 dEQP-GLES3.functional.occlusion_query.scissor_depth_clear_stencil_clear
 dEQP-GLES3.functional.occlusion_query.scissor_stencil_clear
 dEQP-GLES3.functional.occlusion_query.stencil_clear

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6559

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17138>
2022-06-21 13:13:36 +00:00
David Heidelberg 57ad38c2fc ci/freedreno: disable non-existing trace
Never existed in the repository.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17137>
2022-06-20 16:36:10 +00:00
David Heidelberg dfe9b856cb ci/freedreno: update restricted traces to the brotli compressed version
Save some space on proxies and speedup network transfer to the runners.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17016>
2022-06-20 12:42:41 +00:00
Chia-I Wu 858cd2797c freedreno/fdl: use XYZW swap for PIPE_FORMAT_X24S8_UINT
We used to use WZYX and apply swizzles.  Because swizzles apply for
border colors as well, the gallium driver un-swizzled the border colors
to cancel out swizzles.  That did not work for turnip because turnip
advertises customBorderColorWithoutFormat and does not know when to
un-swizzle.

This change replaces WZYX by XYZW and removes the swizzles.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6516
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16647>
2022-06-17 18:39:47 +00:00
Danylo Piliaiev 10f6191fb5 turnip: copy disasm strings for pipeline executables
A single compiled_shaders instance could be reused by several
pipelines, but strings from disasm info could be stolen only once.
So now we have to copy them.

Fixes crashes when using RenderDoc.

Fixes: 05329d7f9a
("tu: Implement pipeline caching with shared Vulkan cache")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17053>
2022-06-16 08:45:34 +00:00
Connor Abbott cba6da2b21 tu: Save/restore *_BIN_CONTROL in 3d GMEM store path
These are normally only set once because it's constant across the entire
renderpass, but they're trashed by the 3d store path because it needs to
store to CCU instead of GMEM. Therefore we need to save/restore them. Do
it in a way compatible with #5181.

Fixes: b157a5d ("tu: Implement non-aligned multisample GMEM STORE_OP_STORE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17058>
2022-06-16 01:10:24 +00:00
Connor Abbott a9d7b47613 tu: Add missing WFI to the 3d GMEM store path
Similar to the 2d path.

Fixes: b157a5d ("tu: Implement non-aligned multisample GMEM STORE_OP_STORE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17058>
2022-06-16 01:10:24 +00:00
Connor Abbott 705c0d0373 tu: Fix 3d GMEM store swizzle in texture descriptor
Even though image views for attachments must use the identity swizzle,
there are cases where we have to add in our own swizzle, in particular
for D24S8 when the view is depth-only/stencil-only. Therefore we have to
reset it to the identity, similar to what we do with input attachments.

Fixes: b157a5d ("tu: Implement non-aligned multisample GMEM STORE_OP_STORE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17058>
2022-06-16 01:10:24 +00:00
Connor Abbott 6dfabab08f freedreno/a6xx: Support more 3-component formats
These should be trivially enableable. This gets us some test coverage on
turnip because there are no tests of RGB32 texel buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16980>
2022-06-15 22:48:38 +00:00
Connor Abbott 2e63c570dd tu: Enable uniform texture buffers with NPOT formats
This is enough for zink to expose ARB_texture_buffer_object_rgb32 and
therefore GL 4.0. We could enable sampled images with a few more
workarounds, but the blob doesn't bother and there isn't any need at the
moment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16980>
2022-06-15 22:48:38 +00:00
Chia-I Wu af0080c4ef turnip: advertise VK_EXT_border_color_swizzle
We already support the functionality so just advertise it.  Pass all
dEQP-VK*border_swizzle*.

v2: update freedreno-a630-fails.txt

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17019>
2022-06-15 15:48:47 +00:00
Connor Abbott 169e03800d tu: Implement VK_EXT_color_write_enable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16936>
2022-06-14 23:18:17 +00:00
Connor Abbott 94be0dd0b8 tu: Implement extendedDynamicState2LogicOp
Because this impacts most of the registers in the BLEND draw state, we
make the entire draw state dynamic so that it all gets re-emitted when
the logicOp changes. This also lays the groundwork for
VK_EXT_color_write_enable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16936>
2022-06-14 23:18:17 +00:00
Connor Abbott c23eb99357 tu: Fix partial-write LRZ determination
There were a few problems with this:

- It wasn't considering logic op at all, which is another source of
  reading from the destination.
- It was conditioned on the blend_enable_mask, so it was missing the
  case where there's no blending but some of the outputs were masked
  out.
- It wasn't considering attachments with less than 4 components (for
  example, normals in a typical deferred rendering setup) and would
  always consider them partially written unless the user added extra
  unnecessary components.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16936>
2022-06-14 23:18:17 +00:00
David Heidelberg a7f7f2a1dd ci/freedreno: fix A530 glmark2@ideas:speed=10000 trace
Just one-pixel change in rendering, look correct to me.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16909>
2022-06-14 11:52:45 +00:00
David Heidelberg e8cf79f664 ci/freedreno: add Blender, Warzone2100, Freedoom and Unvanquished traces
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16909>
2022-06-14 11:52:45 +00:00
Connor Abbott 3cd39c2b32 tu: Enable VK_KHR_swapchain_mutable_format
This is already implemented entirely in common code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16976>
2022-06-13 14:58:32 +00:00
Danylo Piliaiev 19682028eb tu/autotune: Prevent division by zero
src/freedreno/vulkan/tu_autotune.c:509:48: runtime error: division by zero

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16967>
2022-06-10 14:09:59 +00:00
Danylo Piliaiev 4846d53b18 turnip: Fix out-of-bounds builder->shader_iova access
src/freedreno/vulkan/tu_pipeline.c:1722:72: runtime error: index 5 out of bounds for type 'uint64_t [5]'

Fixes: 05329d7f9a
("tu: Implement pipeline caching with shared Vulkan cache")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16967>
2022-06-10 14:09:59 +00:00
Chia-I Wu 3933752c7f turnip: force sample interpolations for sample shading
Sample shading has similiar definitions in Vulkan and OpenGL, and they
both require unique associated data.  While the definition for Vulkan
might change, we should stick to the current definition until the change
takes place and until apps (i.e., ANGLE) are updated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16700>
2022-06-10 12:08:32 +00:00
Jason Ekstrand 0c764afac1 turnip: Set supported_sync_types before wsi_init
The WSI code is about to start querying for available semaphore handle
types via GetPhysicalDeviceExternalSemaphoreProperties in wsi_init().
For drivers that use vk_sync, supported_sync_types needs to be
initialized before GetPhysicalDeviceExternalSemaphoreProperties is
called.  Really, wsi_init() should be the very last step of physical
device setup.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand 4c95b574d1 turnip: Use the common QueuePresent implementation
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand 513d73b160 turnip: Use the common AcquireNextImage implementation
The only reason for the wrapper was so that we could dummy signal the
semaphore and fence.  Now that the WSI code always dos this for us, we
can drop our wrapper.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Emma Anholt c426e21ff1 turnip: Reverse the order of walking pipes or tiles on odd rows.
This improves the cache locality compared to raster order.  Improves
gfxbench vk-5-normal perf by 3.3009% +/- 0.105934% (n=3).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16917>
2022-06-09 20:36:42 +00:00
Chia-I Wu 790fc8455f ci/turnip: add a link to VkPhysicalDeviceMemoryProperties failure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16939>
2022-06-09 19:55:32 +00:00
Chia-I Wu 5c17a04282 turnip: consider render pass costs in autotune
To be able to sum drawcall cost and render pass cost, the units of costs
are changed to bytes.  With that, tu_autotune_use_bypass can make
decisions by comparing the costs of sysmem rendering and gmem rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16733>
2022-06-08 12:48:08 +00:00
Chia-I Wu ce118a7002 turnip: estimate render pass costs
They will be used by autotuner.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16733>
2022-06-08 12:48:08 +00:00
Chia-I Wu fe9a2374e6 turnip: include stencil test for drawcall costs
Stencil test reads from and writes to the stencil buffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16733>
2022-06-08 12:48:08 +00:00
Chia-I Wu 2dc10165a1 turnip: base pipeline draw costs on colorWriteMask
drawcall_base_cost estimates the memory bandwidth per sample.
colorWriteMask should be more accurate than fs outputs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16733>
2022-06-08 12:48:08 +00:00
Chia-I Wu 6fe7b92114 turnip: if-checks autotune debug macros
This avoids bitrot while the compiler can easily optimize away those
checks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16733>
2022-06-08 12:48:08 +00:00
Emma Anholt 7af5929b54 turnip: Move tile loads back into the draw CS.
Now that we don't need to know if HW binning actually will get used or
not, we can just emit the tile loads into the start of the draw CS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Danylo Piliaiev ecabd3b5a9 turnip: Allow nested CP_COND_REG_EXEC
This ends up being needed for moving tile loads into the draw cs.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt a92fad45e9 turnip: Allow load/store skipping in vkCmdClearAttachments().
We have to use a 3D draw to make it possible (so it goes through the
binner's visibility calcs), but hopefully the increased overhead for apps
with non-skippable rendering balances against skipping in others.

The real motivation is to get draw-time state out of tile load setup.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt b8619ef343 turnip: Refactor a bit of subpass attachment processing.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt 83ae4a5ed4 turnip: Include 3d-based CmdClearAttachments() in binning visibility.
It means the clear's draw can get skipped when it doesn't intersect with
the tile.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt 48403628a2 turnip: Refactor a bit of repeated code for subpass setup.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt 5b119c0148 ci/turnip: Add a little forced touch-testing of XFB with no binning requested.
This is just a couple of seconds of runtime.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt 046438b7a4 turnip: Use fb->binning_possible to decide on conditional tile load/stores.
When !fb->binning but fb->binning_possible, we can just set the VSC
per-tile visibility reg to all visible in the "whoops, we'd rather not bin
but we had to anyway for XFB" case.  This gets that EndRenderPass state out
of tile_load_cs/store_cs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt 6c37b4ded1 turnip: Move binning decisions from FB usage time to FB creation time.
This is mostly about helping me understand which choices are constant for the object as opposed to runtime decisions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt ceeaac340a turnip: Refactor a bit of tu6_emit_tile_select().
Reduce redundant code, make the used SET_VISIBILITY_OVERRIDE value clearer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Emma Anholt 2cad0dd03b turnip: Don't bother creating tile_load/store_cs for sysmem rendering.
They won't get called, so don't bother.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
2022-06-07 00:00:28 +00:00
Timothy Arceri 57dee95b85 freedreno: switch to NIR loop unrolling
Force unroll setting based on GLSL IR settings:

   case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
   case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
   case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
   case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR:
      /* a2xx compiler doesn't handle indirect: */
      return is_ir3(screen) ? 1 : 0;

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Timothy Arceri 34e868d882 freedreno/ir3: tidy up duplication of common nir options
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
2022-06-04 16:11:49 +00:00
Erik Faye-Lund 200091aad0 freedreno: do not use variable in STATIC_ASSERT
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Erik Faye-Lund 08f8ccfc60 turnip: do not do STATIC_ASSERT on a variable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Hyunjun Ko 8eb5178a6d turnip: clamp to 1 for negative bottom-right of viewport.
This fixes a crash of spec@!opengl 3.0@viewport-clamp in
piglit(with zink).
Also fixes a crash of negativeviewportheight in Sascha's examples.

Closes: #6583

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16831>
2022-06-03 02:40:08 +00:00
Connor Abbott bd68559d36 tu: Enable shaderTessellationAndGeometryPointSize
This already works and AFAICT there was no reason to disable it other
than that the blob does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16830>
2022-06-02 16:32:57 +00:00
Danylo Piliaiev eba8671e40 tu: Fix D32S8 resolves into D32 or S8 in sysmem mode
Fixes CTS tests in sysmem mode:
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint.compatibility_depth_zero_stencil_zero_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_stencil
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.compatibility_depth_zero_stencil_zero_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_stencil

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16834>
2022-06-02 16:01:46 +00:00
Erik Faye-Lund 9bcd538643 freedreno: remove stale makefile
We don't use this makefile, so there's no point in keeping it in the
repo. It's also a generated one, so it contains a lot of... mess.

Fixes: 536f43cb96 ("freedreno: slurp in afuc")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16790>
2022-06-02 09:13:23 +00:00
Emma Anholt 49dc60efa1 freedreno/ir3: Fold 16-bit conversions into image load/store src/dsts.
Shaves 5 instructions off of one manhattan31 shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>
2022-06-01 22:19:44 +00:00
Emma Anholt f005a2d786 freedreno/ir3: Fix validation of half-precision image store values.
ce1a381e57 ("turnip: enable VK_KHR_16bit_storage on A650") determined
that the type of the instr decided the type of the value being stored in
the ".b" case.  But it would be surprising if image stores had the type
determine the coordinates' precision instead of the value's, and once we
turned on image instruction precision lowering we ran into asserts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>
2022-06-01 22:19:44 +00:00
Matt Turner 003327dd95 freedreno/ir3: Pass 16-bit sampler coordinates when possible.
shader-db highlights from Rob's android shaders:

total instructions in shared programs: 769641 -> 767536 (-0.27%)
instructions in affected programs: 151139 -> 149034 (-1.39%)
total last-baryf in shared programs: 55908 -> 55607 (-0.54%)
last-baryf in affected programs: 35219 -> 34918 (-0.85%)
total sstall in shared programs: 67074 -> 65767 (-1.95%)
total full in shared programs: 36115 -> 36080 (-0.10%)
full in affected programs: 203 -> 168 (-17.24%)
sstall in affected programs: 9510 -> 8203 (-13.74%)
total (ss) in shared programs: 14380 -> 14239 (-0.98%)
(ss) in affected programs: 2965 -> 2824 (-4.76%)
total systall in shared programs: 92425 -> 91522 (-0.98%)
systall in affected programs: 13146 -> 12243 (-6.87%)
total (sy) in shared programs: 4330 -> 4314 (-0.37%)
(sy) in affected programs: 167 -> 151 (-9.58%)
total waves in shared programs: 71580 -> 71584 (<.01%)
waves in affected programs: 12 -> 16 (33.33%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>
2022-06-01 22:19:44 +00:00
Emma Anholt ac24c49c37 freedreno/ir3: Make the types of tex coord padding match.
Required for lowering of coords to be 16-bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>
2022-06-01 22:19:44 +00:00
Matt Turner edb0904775 freedreno/ir3: Move the texture array coord fixup to nir
We're going to optimize sampler coordinates to FP16, so we'll need to
add the appropriately typed 0.5. Move this to NIR where that information
is readily available.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>
2022-06-01 22:19:44 +00:00
Emma Anholt bf49d4a084 freedreno/ir3: Enable load/store vectorization for SSBO access, too.
Saves a few ldib/stib instructions in gfxbench vk-5-normal compute shaders
by grouping vec4 accesses together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>
2022-06-01 22:19:44 +00:00
Emma Anholt 5f64bc7a3e ci/turnip: Add missing xfails for a618 full VK run
Fixes: 836ce97f5e ("ci: bump VK-GL-CTS to 1.3.2.0")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>
2022-06-01 22:19:44 +00:00
Danylo Piliaiev 79e266fffc ir3: Force late-z if FS has global store/atomic
No known tests are fixed.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16816>
2022-06-01 16:30:36 +00:00
Connor Abbott 68b10b39f7 tu: Implement VK_EXT_image_2d_view_of_3d
This is already allowed by the gallium driver, which uses the same code
for image layout and image views, so everything Just Works and the tests
pass. radv doesn't enable the sampler feature, but I don't see any
reason it wouldn't work and the tests pass.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16806>
2022-06-01 15:04:31 +00:00
Connor Abbott 2e9c53549b tu: Expose VK_KHR_synchronization2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16374>
2022-06-01 04:06:46 +00:00
Connor Abbott 59259a0167 tu: Convert to sync2 entrypoints
Use the common Vulkan fallbacks to implement the now-deprecated original
entrypoints.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16374>
2022-06-01 04:06:46 +00:00
Timothy Arceri abe4536c51 ci: uprev piglit 2022-05-31
Also document additional piglit failures and passes.

Multiple changes, mostly notable:
  - few new tests
  - fixed test for upcoming mesa MR

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16785>
2022-06-01 03:14:29 +00:00
Jason Ekstrand c8e191e369 turnip: Use nir_gather_xfb_info
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16750>
2022-05-31 23:09:30 +00:00
Jason Ekstrand 3e04432b3a nir: Rename nir_gather_xfb_info to nir_shader_get_xfb_info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16750>
2022-05-31 23:09:30 +00:00
Juan A. Suarez Romero 836ce97f5e ci: bump VK-GL-CTS to 1.3.2.0
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16689>
2022-05-31 15:02:08 +00:00
Erico Nunes 3d7b2f0186 ci: update linux kernel to v5.17
In addition to pushing it to the current latest stable, the v5.17 kernel
for mesa CI pulls a patch to address a regression in drm that affects at
least the lima jobs.

The dtb for sc7180-trogdor-lazor-limozeen-nots is also updated since the
old one no longer exists in v5.17.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16641>
2022-05-31 06:31:15 +00:00
Hyunjun Ko 16ea41c901 ir3: handle intrinsic_load_draw_id when scanning driver constants
Fixes: #6567

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16769>
2022-05-31 01:33:55 +00:00
David Heidelberg 2cf7f08b04 ci: traces: temporarily disable nheko trace
Disable nheko trace until apitrace gets fixed.
apitrace currently fails with this trace, when more than 1 run is
requested.

Upstream issue: https://github.com/apitrace/apitrace/issues/800

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16774>
2022-05-31 00:00:25 +00:00
David Heidelberg b8381aaa37 ci/freedreno: enable ROR and Nheko traces
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16633>
2022-05-27 06:51:38 +00:00
Danylo Piliaiev 713f504033 ir3: handle gl_Layer and gl_ViewportIndex when there is TES + GS
Fixes CTS tests:
 KHR-GL46.shader_viewport_layer_array.ShaderViewportIndexTestCase
 KHR-GL46.shader_viewport_layer_array.ShaderLayerFramebufferLayeredTestCase
 KHR-GL46.shader_viewport_layer_array.ShaderLayerFramebufferNonLayeredTestCase

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6497

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16696>
2022-05-26 08:47:02 +00:00
Mike Blumenkrantz aa32b96c51 turnip: fix assert for max xfb outputs
this is a counter, not an index, so use <=

cc: mesa-stable

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16620>
2022-05-21 16:48:54 +00:00
Chia-I Wu 2a8e6a4d1a turnip: disable UBWC for SNORM formats
In copy_format, we treat snorm as unorm to avoid clamping.  But snorm
and unorm are UBWC incompatible for special values such as all 0's or
all 1's.  Disable UBWC for snorm.

For reference, I dumped the first byte of an UBWC blocks and it was

  color      UNORM  SNORM
  all black  0x01   0x31
  all white  0x0d   0x11

@flto clarified that bit 4 is unset for fast clear encoded blocks.  It
looks like fast clear is not used for SNORM.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6480
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16534>
2022-05-21 15:27:42 +00:00
Chia-I Wu e8eb6d13a5 turnip: fix tu6_pack_border_color for z24
The value should be at the bottom 24 bits, not at the top.

dEQP-VK.pipeline.sampler.* still passes.  This fixes most of
dEQP-GLES31.functional.texture_border_clamp.formats.*depth* on angle.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16570>
2022-05-21 00:54:28 +00:00
Hyunjun Ko f2635ca47b turnip: add an assertion for max descriptor set count.
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16624>
2022-05-20 09:49:00 +00:00
Jason Ekstrand c24aa449d0 vulkan,anv,turnip: Add a common CmdBindVertexBuffers wrapper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16611>
2022-05-20 02:12:37 +00:00
Emma Anholt 7938ce4af3 freedreno/ir3: Lower texture instructions used only for f2f16 to 16-bit.
2.5% improvement in gfxbench vk-5-normal.  No obvious change on
gl-5-normal.

shader-db on Rob's android shaders:

total instructions in shared programs: 770644 -> 770595 (<.01%)
instructions in affected programs: 14880 -> 14831 (-0.33%)
total nops in shared programs: 167784 -> 167860 (0.05%)
nops in affected programs: 3351 -> 3427 (2.27%)
total non-nops in shared programs: 602860 -> 602735 (-0.02%)
non-nops in affected programs: 10523 -> 10398 (-1.19%)
total mov in shared programs: 19313 -> 19286 (-0.14%)
mov in affected programs: 365 -> 338 (-7.40%)
total cov in shared programs: 18075 -> 17978 (-0.54%)
cov in affected programs: 566 -> 469 (-17.14%)
total dwords in shared programs: 1612848 -> 1612596 (-0.02%)
dwords in affected programs: 13882 -> 13630 (-1.82%)
total last-baryf in shared programs: 56144 -> 55975 (-0.30%)
last-baryf in affected programs: 482 -> 313 (-35.06%)
total full in shared programs: 36094 -> 36092 (<.01%)
full in affected programs: 10 -> 8 (-20.00%)
total sstall in shared programs: 66986 -> 66923 (-0.09%)
sstall in affected programs: 1392 -> 1329 (-4.53%)
total systall in shared programs: 91244 -> 91072 (-0.19%)
systall in affected programs: 1194 -> 1022 (-14.41%)
total (sy) in shared programs: 4316 -> 4321 (0.12%)
(sy) in affected programs: 19 -> 24 (26.32%)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16465>
2022-05-19 19:43:36 +00:00
Emma Anholt 1cf0736f1c freedreno/ir3: Add support for 16-bit nir_texop_lod.
Same basic path, just do the rescaling in half float.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16465>
2022-05-19 19:43:36 +00:00
Emma Anholt a28d2e87d3 turnip: Make RelaxedPrecision-decorated ALU ops 16-bit.
Improves gfxbench vk-5-normal performance 5.5%.

Fixes: #6346
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16465>
2022-05-19 19:43:36 +00:00
Emma Anholt 633cf4eca1 freedreno/ir3: Fix 16-bit bit_count.
No need to do the 16-bit lowering if it already is.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16465>
2022-05-19 19:43:36 +00:00
Connor Abbott 9f67fa368e tu: Implement VK_EXT_pipeline_creation_cache_control
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16562>
2022-05-18 13:14:55 +00:00
Connor Abbott 49827da6fa tu: Implement VK_EXT_pipeline_creation_feedback
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16562>
2022-05-18 13:14:55 +00:00
Connor Abbott e348f2fb38 tu: Zero-initialize compute driver key
Fixes: 05329d7 ("tu: Implement pipeline caching with shared Vulkan cache")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16562>
2022-05-18 13:14:55 +00:00
Danylo Piliaiev 5d377f435b freedreno/a6xx: Add EARLYPREAMBLE flag to all a6xx_sp_xs_ctrl_reg0
Each shader stage has its own "early preamble" flag.

Early preamble is likely an optimization to hide some of latency
when loading UBOs into consts in the preamble.

Early preamble has the following limitations:
- Only shared, a1, and consts regs could be used
  (accessing other regs would result in GPU fault);
- No cat5/cat6, only stc/ldc variants are working;
- Values writen to shared regs are not accessible by the rest
  of the shader;
- Instructions before shps are also considered to be a part of
  early preamble.

Note, for all shaders from d3d11 games blob produced preambles
compatible with early preamble mode.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15901>
2022-05-18 11:17:47 +00:00
Chia-I Wu 2410993ef6 turnip: fix off-by-one in border color bitset
BITSET_FFS reserves 0 for no bit set.  BITSET_CLEAR just below cleared
the wrong bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16567>
2022-05-17 23:29:15 +00:00
Timothy Arceri d7a071a28f gallium/drivers: set force_indirect_unrolling_sampler for all required drivers
This is set to true for all drivers that have a GLSL level
of support lower than 4.00. This matches the rule for setting the
GLSL IR option EmitNoIndirectSampler.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>
2022-05-17 02:12:21 +00:00
Chia-I Wu cb50fe7110 ir3: fix mem_ctx for ir3_disasm_info::nir
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6494
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16535>
2022-05-16 22:09:13 +00:00
Chia-I Wu d3d34ad476 turnip: emit VPC_SO_DISABLE in xfb begin/end
SO was always enabled before this change.  That meant, after a call to
tu_CmdBindTransformFeedbackBuffersEXT to emit VPC_SO_BUFFER_SIZE, any
draw call (from the same render pass, in a different render pass, or in
a different cmdbuf) could potentially cause writes to the SO buffers
regardless of whether the draw is inside xfb begin/end or not.

I choose to emit VPC_SO_DISABLE instead of using stateobjs like
freedreno does only because it is simpler.  It is not clear to me which
is more efficient to HW.

This also fixes double SO writes for gmem rendering.  While
tu6_tile_render_begin was careful to disable SO for the draw pass,
tu6_emit_tile_select re-enabled it.

dEQP-VK.transform_feedback.* still passes.  It fixes
dEQP-GLES3.functional.transform_feedback.* on angle.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16502>
2022-05-16 20:46:59 +00:00
Chia-I Wu 0b7751babf turnip: fix sampledImageIntegerSampleCounts
It seems fine to advertise msaa in sampledImageIntegerSampleCounts.

dEQP-VK.rasterization.rasterization_order_attachment_access.format_integer.*
goes from NotSupported to Pass for more test cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16487>
2022-05-16 19:26:46 +00:00
David Heidelberg 875643feeb ci: uprev piglit 2022-05-10
Also document additional piglit failures and crashes with new tests.

Multiple changes, mostly notable:
 - few new tests
 - traces downloader improvements

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16428>
2022-05-16 06:33:36 +00:00
Chia-I Wu e9e8c649cd freedreno/fdperf: support dumping counters
This is useful for comparing two workloads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16488>
2022-05-14 22:18:52 +00:00
Chia-I Wu 267786be60 freedreno/fdperf: make refresh rate configurable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16488>
2022-05-14 22:18:52 +00:00
Chia-I Wu cd42f63c43 turnip: let modifier takes precedence over TU_DEBUG=noubwc
TU_DEBUG=noubwc is not very usable on sway/xwayland where the wsi uses
modifiers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16507>
2022-05-14 21:56:38 +00:00
Connor Abbott 05329d7f9a tu: Implement pipeline caching with shared Vulkan cache
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 43981f0f58 tu: Include turnip debug flags in pipeline cache UUID
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott d023ae4686 tu: Rewrite cache UUID based on radv
Switch to using sha1 so that we can add as many other flags as we need
to easily.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 410d59943d tu: Hash pipeline layout contents
Mostly adapted from anv.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 3e3f8b1639 ir3: Add ir3_shader_create_variant()
This is similar to ir3_shader_get_variant(), but always compiles the
variant from scratch and returns a variant that's owned by the user
rather than the shader. We'll need this because when variants are stored
in the Vulkan pipeline cache they will outlive their shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott ea646ac9af ir3: Support disabling the pipeline cache
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott c7a6293635 ir3: Add functions to serialize variants
This will be used by turnip to create free-floating variant objects that
integrate into the Vulkan cache system.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott ceae844794 ir3: Remove ir3_shader_variant::shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 91160dab97 tu: Keep original blit shaders separately
We won't be able to access them once the ->shader link is gone.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 69f5be8bad ir3: Add ir3_shader_variant::compiler
And replace uses of ->shader->compiler.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 4509b49fb8 ir3: Allocate disasm_info under variant
This shouldn't matter much because it gets stolen later, but the shader
is going away.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 21e3dd57d3 ir3: Use ir3_shader_variant::type more often
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott f45c86dfb7 ir3, fd, tu: Copy misc. info from ir3_shader to ir3_shader_variant
The shader won't be available for deserialized variants, so we need to
include all the info we need for compiling variants to be in the
variant. Most of the things we dug out of the shader were various bits
from nir_shader_info which we move into ir3_shader_variant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 3e30608ceb ir3, freedreno, tu: Make ir3_shader_variant store stream_output
This reduces the number of uses of ir3_shader which will be gone when we
deserialize the variant directly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Connor Abbott 3cad11d84a tu: Delete unused tu_clear_blit GS handling
This has been unused for a while since we switched to writing the
array index in the VS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>
2022-05-13 17:07:05 +00:00
Rob Clark 7292b35da0 freedreno/devices: Add another SKU
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16477>
2022-05-12 22:12:24 +00:00
Rob Clark a31c34e0d6 freedreno/drm/virtio: Don't try to mmap imported bo's
Previously it would fail, and then we'd fall back to the transfer path
for things like readpix.  But it would spam logcat w/ bo_mmap fail
messages.  Since gralloc allocated buffers for GPU usage are allocate
without _USE_MAPPABLE, let's just assume we can't map imported bo's.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16477>
2022-05-12 22:12:24 +00:00
Rob Clark 62f3e703c8 freedreno/drm: Use DEBUG_GET_ONCE_OPTION()
In particular this uses os_get_option() so the android setprop fallback
works.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16477>
2022-05-12 22:12:24 +00:00
Danylo Piliaiev 9a11ad7efd tu: Fix indices of drm_msm_gem_submit_cmd when filling them
For some reason CTS doesn't trigger the issue...
When submit entry is not filled - kernel says:
 [drm:msm_ioctl_gem_submit] *ERROR* invalid type: 00000000

Fixes: dbae9fa7d8
("tu: implement sysmem vs gmem autotuner")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16474>
2022-05-12 16:44:09 +00:00
Emma Anholt b282d504a4 turnip: Add a TU_DEBUG=perf debug option.
For doing performance investigation, I often find it useful to have a "are
we tripping over any of our performance TODOs?" flag, so add it and use it
in a few of the TODOs.

This also greatly cleans up the deqp-vk logs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16316>
2022-05-12 01:00:25 +00:00
Jason Ekstrand 352e32e5ba nir/builder: Add a nir_trim_vector helper
This pattern pops up a bunch and the semantics of nir_channels() aren't
very convenient much of the time.  Let's add a nir_trim_vector() which
matches nir_pad_vector().

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16309>
2022-05-11 14:47:33 +00:00
Danylo Piliaiev 187d3df52c tu: Do not flush ccu in clear/blits during renderpass
For clear/blits ccu flush not only worse for perf, but also messes up
flush_bits when executed in a conditional set of commands.

We already don't flush for 3d blits.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6419

Fixes: 487aa807bd
("tu: Rewrite flushing to use barriers")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16352>
2022-05-11 08:07:50 +00:00
Danylo Piliaiev db69218cbe tu: Implement VK_EXT_image_view_min_lod
Relevant tests:
 dEQP-VK.texture.mipmap.*.image_view_min_lod.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16292>
2022-05-09 07:53:41 +00:00
Rob Clark 409b76511c freedreno/drm-shim: Better iova handling
We actually want to use util_vma to handle this.  But fortunately core
drm-shim alredy does this for mem offset, we can just delete a bunch of
code and re-use that.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16250>
2022-05-02 19:50:33 +00:00