Commit Graph

161179 Commits

Author SHA1 Message Date
Brian Paul
230584fed5 draw: asst. clean-ups in draw_pipe_cull.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
b813bab889 draw: asst. clean-ups in draw_pt_post_vs.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
6f1b99ab06 draw: asst. clean-ups in draw_pt_fetch.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
da2932c634 draw: asst. clean-ups in draw_pipe.h
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
67ee7ddfb7 draw: remove unused draw_has_llvm()
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
7178d30a52 draw: remove goto in llvm_pipeline_generic()
Just use an else clause.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
f058873832 draw: asst. clean-ups in draw_vs.[ch]
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
c5ddbc6ba7 draw: asst. clean-ups in draw_vs_variant.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
327742c2c9 draw: asst. clean-ups in draw_vs_llvm.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Brian Paul
32218eabdb draw: asst. clean-ups in draw_context.[ch]
Fix whitespace/formatting for consistency.  Move var decls to where
they're first used, etc.

Signed-off-by: Brian Paul <brianp@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-10-11 20:04:36 +00:00
Bas Nieuwenhuizen
243aa6b2ec radv: Consider inactive internal nodes never in the tree.
Since the parent doesn't know to signal it.

Fixes: e83e4fafc8 ("radv: Only emit parents from parents that actually end up in the tree.")
Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19033>
2022-10-11 19:33:46 +00:00
Emma Anholt
8721323100 turnip: Add perf debug for more UBWC-disable cases that we could support.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18990>
2022-10-11 19:10:18 +00:00
Emma Anholt
c425b7342e turnip: Add perf_debug for UBWC being disabled due to mutable formats.
I suspect this is going to be a popular perf issue for zink and angle.  I
keep having to print out format lists for debug.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18990>
2022-10-11 19:10:18 +00:00
Emma Anholt
29488c4183 turnip: Move the ubwc_possible check before mutable formats.
I'm going to add some perf debug about mutable formats, and I don't want
to warn when UBWC would be impossible anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18990>
2022-10-11 19:10:18 +00:00
Emma Anholt
4fe3330765 turnip: Add a perf_debug for feedback-related performance traps.
This can show up in layering drivers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18990>
2022-10-11 19:10:18 +00:00
Emma Anholt
3c278c3f71 zink: Decorate mediump outputs as RelaxedPrecision.
The NIR lowering for mediump can sometimes detect stores of 16-bit values
and demote the outputs, but even better is to have them decorated properly
in the first place.  Fixes a bunch of full-precision outputs in gfxbench
Aztec Ruins.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18960>
2022-10-11 18:22:16 +00:00
Emma Anholt
2592749679 zink: Fix RelaxedPrecision decoration of texture samples.
You can't do it unless GL called the sampler mediump.  Also, the spirv
says "For image-sampling operations, decorations can appear on both the
sampling instruction and the image variable being sampled.  If either is
decorated, they both should be decorated, and if both are decorated their
decorations must match. If only one is decorated, the sampling instruction
can behave either as if both were decorated or neither were decorated." so
emit it on the declaration too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18960>
2022-10-11 18:22:16 +00:00
Emma Anholt
f5f5fed7e2 ci/zink: Add some more flakes for turnip.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18960>
2022-10-11 18:22:16 +00:00
Bas Nieuwenhuizen
66664b8d7c radv: Implement pipeline-wide skiptriangles/skipaabbs.
Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19030>
2022-10-11 18:03:23 +00:00
Samuel Pitoiset
65dd53ca97 radv: always re-emit patch control points when a pipeline with tess is bound
We already re-emit this state when it's static. It could be dirtied
conditionally but the number of parameters to check is not worth it.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7457
Fixes: eef1511437 ("radv: implement dynamic patch control points")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19021>
2022-10-11 17:21:56 +00:00
Mike Blumenkrantz
3c9771b434 zink: add ZINK_DEBUG=shaderdb
this should enable shader-db support with zink

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18961>
2022-10-11 17:02:14 +00:00
Mike Blumenkrantz
41ffb15de5 zink: implement async gfx precompile
the pipe_context::link_shader hook is called when shaders are
linked into a program by the application

by leveraging this, it becomes possible to utilize the existing
graphics pipeline library to implement precompilation
by creating a partial pipeline containing only the shader stages
and then adding in the vertex input and fragment output stages
dynamically using the fast-link feature

if all goes well, and if the vulkan driver's fast-linking is
truly fast, the full pipeline should be dynamically combined
in time to avoid stuttering, and an optimized variant will be
queued for async compile to be used the next time the pipeline
triggers a draw

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18961>
2022-10-11 17:02:14 +00:00
Mike Blumenkrantz
aed4e716d0 zink: change zink_gfx_program::last_pipeline -> struct zink_gfx_pipeline_cache_entry
this ensures that the latest version of the pipeline pointer in the cache
entry will always be used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18961>
2022-10-11 17:02:14 +00:00
Mike Blumenkrantz
b54929ac27 zink: gfx_pipeline_cache_entry -> zink_gfx_pipeline_cache_entry
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18961>
2022-10-11 17:02:14 +00:00
Mike Blumenkrantz
b38cb40fdb zink: allow creating full pipelines unoptimized
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18961>
2022-10-11 17:02:14 +00:00
Tapani Pälli
13c422e1b2 anv: toggle on EXT_extended_dynamic_state3
This enabled the extension and toggles on supported features.

v2: set false to non-supported features (Lionel)
    add dynamic sample mask (Tapani)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:05 +00:00
Tapani Pälli
9f6af43743 anv: dynamic multisample sample mask
This affects following packets:

  3DSTATE_SAMPLE_MASK

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:05 +00:00
Tapani Pälli
8e0377dcf3 anv: dynamic color blend equation
This affects following packets:

  BLEND_STATE_ENTRY
  3DSTATE_PS_BLEND

v2: move vk_to_intel_blend and vk_to_intel_blend_op,
    remove ps_blend merge (Lionel)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:05 +00:00
Tapani Pälli
fc3fd7c69e anv: dynamic color write mask
This affects following packets:

  3DSTATE_BLEND_STATE_POINTERS

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:05 +00:00
Tapani Pälli
0b75376e4d anv: dynamic provoking vertex mode
This affects following packets:

  3DSTATE_CLIP
  3DSTATE_SF
  3DSTATE_STREAMOUT

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:05 +00:00
Tapani Pälli
1a8209218e anv: dynamic states for depth clip and clamp
This change implements 3 states in one go:

  - depth clamp enable
  - depth clip enable
  - depth clip negative one to one

This affects following packets:

  3DSTATE_CLIP
  3DSTATE_VIEWPORT_STATE_POINTERS_CC
  3DSTATE_RASTER

v2: remove clip enable bit check from viewport emit (Lionel)
v3: use helper function from runtime to get depth clip (Lionel)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:04 +00:00
Tapani Pälli
ba645f1623 anv: dynamic alpha to one enable
This affects following packets:

  BLEND_STATE

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:04 +00:00
Tapani Pälli
9dc6bed9a1 anv: dynamic state for logic op enable
This affects following packets:

  3DSTATE_PS_BLEND
  3DSTATE_BLEND_STATE_POINTERS

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:04 +00:00
Tapani Pälli
ad2e80ee53 anv: dynamic line rasterization mode
This affects following packets:

  3DSTATE_RASTER

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:04 +00:00
Tapani Pälli
fe5a259723 anv: dynamic line stipple enable
This affects following packets:

  3DSTATE_WM

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:04 +00:00
Tapani Pälli
0a6d0fed9d anv: dynamic rasterization stream
This affects following packets:

  3DSTATE_STREAMOUT

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:04 +00:00
Tapani Pälli
0f33d7061b anv: dynamic state for tessellation domain origin
This affects following packets:

  3DSTATE_TE

v2: remove render target check, move cmd_emit_te and
    stop merging it, cleanups (Lionel)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:04 +00:00
Tapani Pälli
cc0ada2d67 anv: dynamic state for polygon mode
Remove 'polygon_mode' from pipeline and read it from
dynamic state instead.

This affects following packets:

  3DSTATE_CLIP
  3DSTATE_RASTER

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
2022-10-11 16:29:04 +00:00
Timur Kristóf
6586afd6d2 ac/nir/tess: Remove jump from tess factor writes.
When the output patch size <= 32 we can be sure regardless
of wave size that each wave will take this branch, therefore
the jump can be removed.

Fossil DB stats on Navi 21:

Totals from 1385 (1.03% of 134906) affected shaders:
CodeSize: 2664436 -> 2658896 (-0.21%)
Instrs: 488618 -> 487233 (-0.28%)
Latency: 2290157 -> 2289199 (-0.04%)
InvThroughput: 898658 -> 898364 (-0.03%)
Branches: 6554 -> 5169 (-21.13%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>
2022-10-11 15:42:54 +00:00
Timur Kristóf
892c15af64 ac/nir/ngg: Remove jumps from some branches where we know LGKMCNT==0.
The GPU can skip LDS instructions when LGKMCNT==0, and for these
branches this should be always faster than a jump.

Fossil DB stats on Navi 21:

Totals from 60918 (45.16% of 134906) affected shaders:
CodeSize: 158624792 -> 157893776 (-0.46%)
Instrs: 30234254 -> 30051500 (-0.60%)
Latency: 139521675 -> 139434597 (-0.06%); split: -0.06%, +0.00%
InvThroughput: 21184146 -> 21183653 (-0.00%); split: -0.00%, +0.00%
Branches: 1115134 -> 932380 (-16.39%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>
2022-10-11 15:42:54 +00:00
Timur Kristóf
d8639b7a80 aco: Allow explicitly removing jumps on GFX10+ when beneficial.
"Removing jumps" in ACO means skipping the jump instruction
at the beginning of a divergent branch (but still modify exec).

ACO already supports implicitly removing jumps when it decides
that executing a branch with empty exec mask is more beneficial
than a jump.

This commit adds the possibility to use this explicitly
through nir_selection_control. ACO will respect this
setting and remove the branch instructions when this is specified,
unless it decides that this would cause bugs (eg. exp instruction).

There are two cases that benefit from the new change:

1. When the application requests to "flatten" a branch (ie.
remove control flow), we now respect that.
2. When the compiler stack determines that a divergent branch
is always taken.

v2 by Georg Lehmann: fixed applying sel_ctrl to else blocks

Fossil DB stats on Navi 21:

Totals from 13 (0.01% of 134906) affected shaders:
CodeSize: 136616 -> 136496 (-0.09%)
Instrs: 26196 -> 26166 (-0.11%)
Latency: 417928 -> 417889 (-0.01%)
Branches: 1241 -> 1211 (-2.42%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>
2022-10-11 15:42:54 +00:00
Georg Lehmann
00a8be3414 nir: Print nir_selection_control_divergent_always_taken.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>
2022-10-11 15:42:54 +00:00
Timur Kristóf
c0d0a7c176 nir: Add selection control enum for always taken divergent branches.
The new enum is called nir_selection_control_divergent_always_taken,
and it's almost the same as nir_selection_control_flatten.
The main difference between the two is that "flatten" represents
a choice made by the application but "divergent_always_taken" may
be applied by the compiler stack when it thinks this is beneficial.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>
2022-10-11 15:42:54 +00:00
Timur Kristóf
a2ec843727 nir: Document the flatten/dont_flatten selection control options.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>
2022-10-11 15:42:53 +00:00
Sil Vilerino
ea6e69bb2b d3d12: Fix get_index7bits - Reuse previously freed indices
Some apps do not always reuse resources contiguously and we need to search for a previous free index/slot

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18944>
2022-10-11 15:15:11 +00:00
Sil Vilerino
c8e8ce8359 d3d12: Add VP9 Decode support
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18944>
2022-10-11 15:15:11 +00:00
Sil Vilerino
bb86bcad71 frontends/va: Add VP9 decode ref/mode_deltas information
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18944>
2022-10-11 15:15:11 +00:00
Sil Vilerino
baad2575ae frontends/va: Add VP9 decode multi slice information
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18944>
2022-10-11 15:15:11 +00:00
Ruijing Dong
4df54d97e8 frontends/va: fix av1 decoding image distortion issue
problem:
when not using qmatrix, the qm_y, qm_u and qm_v value is set to 0,
which signals av1 decoder to use qmatix and causes confussion.

solution:
when not using qmatrix, set these values to 0xf.

fixed: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5632

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19002>
2022-10-11 14:59:49 +00:00
Rohan Garg
c0c243f1cb anv, iris: Disable pre fetching the binding table entries on DG2
On DG2 the HW will fetch the binding entries into the cache
for every single thread when a compute walker is dispatched,
wiping out the advantages of the cache prefetch.

The spec also advises to not do a cache prefetch when we have more than
31 binding table entries, but most real world applications will never
hit that limit.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18498>
2022-10-11 15:16:09 +02:00