platform/upstream/mesa.git
22 months agoaco/gfx11: fix s_waitcnt printing
Rhys Perry [Thu, 21 Jul 2022 14:17:24 +0000 (15:17 +0100)]
aco/gfx11: fix s_waitcnt printing

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17710>

22 months agoaco: improve wait_imm unpack
Rhys Perry [Thu, 21 Jul 2022 14:12:38 +0000 (15:12 +0100)]
aco: improve wait_imm unpack

Add GFX11 support and use wait_imm::unset_counter. Looping in the waitcnt
pass was probably broken on GFX11 because of this.

fossil-db (gfx1100):
Totals from 899 (0.56% of 161689) affected shaders:
Instrs: 1319368 -> 1319179 (-0.01%)
CodeSize: 7124640 -> 7123884 (-0.01%)
Latency: 26554304 -> 26404606 (-0.56%)
InvThroughput: 9032485 -> 8978773 (-0.59%); split: -0.59%, +0.00%

No navi10 fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17710>

22 months agoaco/gfx11: swap ds_cmpst_* data operands
Rhys Perry [Wed, 13 Jul 2022 17:42:21 +0000 (18:42 +0100)]
aco/gfx11: swap ds_cmpst_* data operands

According to an LLVM comment, these are swapped in GFX11.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17710>

22 months agozink: enable loop unrolling for loops that have soft fp64
SoroushIMG [Tue, 27 Sep 2022 10:18:11 +0000 (11:18 +0100)]
zink: enable loop unrolling for loops that have soft fp64

The info that a loop contains fp64 ops is lost after full
software lowering.
Therefore, specifically unroll these loops in zink instead of
in vulkan, where the blown up body is no longer unrolled.
This helps a lot in KHR-Single-GL46.arrays_of_arrays_gl.SubroutineFunctionCalls2.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>

22 months agonir: allow to fine tune unrolling for loops with soft fp64 ops
SoroushIMG [Thu, 29 Sep 2022 14:04:21 +0000 (15:04 +0100)]
nir: allow to fine tune unrolling for loops with soft fp64 ops

Lowered fp64 ops can blow up the loop bodies while still being
suitable for unrolling.
Allow for using different parameters to unroll loops with
soft fp64.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>

22 months agonir: track whether a loop contains soft fp64 ops
SoroushIMG [Thu, 29 Sep 2022 13:59:06 +0000 (14:59 +0100)]
nir: track whether a loop contains soft fp64 ops

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>

22 months agozink: fix spirv temp func variable class emission
SoroushIMG [Mon, 26 Sep 2022 22:19:02 +0000 (23:19 +0100)]
zink: fix spirv temp func variable class emission

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>

22 months agozink: fix nir_op_unpack_64_2x32 emission
SoroushIMG [Wed, 21 Sep 2022 19:49:43 +0000 (20:49 +0100)]
zink: fix nir_op_unpack_64_2x32 emission

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>

22 months agozink: lower 64bit pack when float64 not supported
SoroushIMG [Wed, 21 Sep 2022 20:20:54 +0000 (21:20 +0100)]
zink: lower 64bit pack when float64 not supported

SPIRV ops for 64bit pack/unpack require float64 cap.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>

22 months agozink: optimise lower_64bit_vars for when int64 is supported
SoroushIMG [Wed, 21 Sep 2022 19:52:28 +0000 (20:52 +0100)]
zink: optimise lower_64bit_vars for when int64 is supported

There are vulkan drivers that support Int64 but not Float64.
Optimise the 64bit lowering by converting doubles to uint64,
but keep matrix lowerig to float as glsl int64 matrices do
not exist.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>

22 months agozink: lower 64bit vars for drivers without float64
SoroushIMG [Wed, 21 Sep 2022 19:59:37 +0000 (20:59 +0100)]
zink: lower 64bit vars for drivers without float64

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>

22 months agozink: call flush_resource when presenting garbage
Mike Blumenkrantz [Fri, 30 Sep 2022 12:53:59 +0000 (08:53 -0400)]
zink: call flush_resource when presenting garbage

this ensures the resource is queued for presentation

fixes #7359

Fixes: babf9474c43 ("zink: rework flush_frontbuffer to always flush")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18899>

22 months agoci: Remove Wno-error=stringop-truncation from debian-arm64-asan
Corentin Noël [Thu, 15 Sep 2022 13:56:09 +0000 (15:56 +0200)]
ci: Remove Wno-error=stringop-truncation from debian-arm64-asan

All the warnings are now fixed.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18613>

22 months agogallium/hud: use snprintf(..., "%s", ...) instead of strncpy
Corentin Noël [Thu, 15 Sep 2022 12:55:52 +0000 (14:55 +0200)]
gallium/hud: use snprintf(..., "%s", ...) instead of strncpy

This fixes a warning with stringop-truncation:
```
error: 'strncpy' output may be truncated copying 127 bytes from a string of length 255 [-Werror=stringop-truncation]
 1443 |             strncpy(graph->name, s, sizeof(graph->name)-1);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18613>

22 months agomesa/main: do not copy the exact size of the string
Corentin Noël [Thu, 15 Sep 2022 12:49:22 +0000 (14:49 +0200)]
mesa/main: do not copy the exact size of the string

This fixes a compiler warning with stringop-truncation:
```
error: 'strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
  286 |    strncpy(s, msg, MAX_DEBUG_MESSAGE_LENGTH);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18613>

22 months agoaco: add VMEMtoScalarWriteHazard tests
Rhys Perry [Fri, 26 Aug 2022 10:46:06 +0000 (11:46 +0100)]
aco: add VMEMtoScalarWriteHazard tests

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18270>

22 months agoaco: improve printing of s_waitcnt_depctr
Rhys Perry [Thu, 21 Jul 2022 14:13:57 +0000 (15:13 +0100)]
aco: improve printing of s_waitcnt_depctr

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18270>

22 months agoaco: improve printing of sgpr_null
Rhys Perry [Thu, 21 Jul 2022 14:13:46 +0000 (15:13 +0100)]
aco: improve printing of sgpr_null

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18270>

22 months agoaco: use some helpers in GFX10 hazard workarounds
Rhys Perry [Thu, 25 Aug 2022 19:07:41 +0000 (20:07 +0100)]
aco: use some helpers in GFX10 hazard workarounds

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18270>

22 months agoaco: improve VMEMtoScalarWriteHazard s_waitcnt mitigation
Rhys Perry [Thu, 25 Aug 2022 19:40:31 +0000 (20:40 +0100)]
aco: improve VMEMtoScalarWriteHazard s_waitcnt mitigation

fossil-db (navi10):
Totals from 171 (0.13% of 134563) affected shaders:
Instrs: 69348 -> 69144 (-0.29%)
CodeSize: 381112 -> 380296 (-0.21%)
Latency: 451534 -> 451387 (-0.03%)
InvThroughput: 88692 -> 88686 (-0.01%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18270>

22 months agoaco: fix VMEMtoScalarWriteHazard s_waitcnt mitigation
Rhys Perry [Thu, 25 Aug 2022 19:04:01 +0000 (20:04 +0100)]
aco: fix VMEMtoScalarWriteHazard s_waitcnt mitigation

It doesn't make sense for a "s_waitcnt vmcnt(0)" to affect a store or DS
instruction.

LLVM checks for "s_waitcnt vmcnt(0) lgkmcnt(0) expcnt(0)" but ignores
s_waitcnt_vscnt (which I assume is a bug).

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: bcf94bb933e ("aco: properly recognize that s_waitcnt mitigates VMEMtoScalarWriteHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18270>

22 months agonir/opt_algebraic: Optimize more (a cmp b ? a : b) to min/max.
Georg Lehmann [Mon, 12 Sep 2022 11:12:18 +0000 (13:12 +0200)]
nir/opt_algebraic: Optimize more (a cmp b ? a : b) to min/max.

Foz-DB Navi21:
Totals from 112 (0.08% of 134913) affected shaders:
CodeSize: 1618384 -> 1618172 (-0.01%); split: -0.06%, +0.04%
Instrs: 307695 -> 307535 (-0.05%); split: -0.05%, +0.00%
Latency: 3590228 -> 3589658 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 563692 -> 563447 (-0.04%); split: -0.05%, +0.01%
Copies: 24541 -> 24519 (-0.09%); split: -0.10%, +0.01%
Branches: 13480 -> 13468 (-0.09%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18548>

22 months agopvr: Implement vkGetEventStatus API.
Rajnesh Kanwal [Thu, 22 Sep 2022 11:08:00 +0000 (12:08 +0100)]
pvr: Implement vkGetEventStatus API.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18864>

22 months agopvr: Add assert to check for non-NULL binding_desc.
Rajnesh Kanwal [Sun, 25 Sep 2022 19:36:41 +0000 (20:36 +0100)]
pvr: Add assert to check for non-NULL binding_desc.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agopvr: Call VALGRIND_FREELIKE_BLOCK before unmapping to avoid use after free.
Rajnesh Kanwal [Sun, 25 Sep 2022 19:25:18 +0000 (20:25 +0100)]
pvr: Call VALGRIND_FREELIKE_BLOCK before unmapping to avoid use after free.

Fixes: CID 1503261.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agopvr: Fix Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) errors.
Rajnesh Kanwal [Sun, 25 Sep 2022 19:11:53 +0000 (20:11 +0100)]
pvr: Fix Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) errors.

Fixes: CID 1503255, 1503258, 1503265, 1503268, 1504078, 1507509.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agopvr: Zero init pbe_cs_words to avoid passing on garbage.
Rajnesh Kanwal [Sun, 25 Sep 2022 18:52:10 +0000 (19:52 +0100)]
pvr: Zero init pbe_cs_words to avoid passing on garbage.

In case if the surface->resolve_type is not PVR_RESOLVE_TYPE_PBE
then we do not setup pbe_cs_words in which case we might end up
using garbage values.

Fixes: CID 1515466.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agopvr: Remove dead code from pvr_perform_start_of_render_clears.
Rajnesh Kanwal [Sun, 25 Sep 2022 18:47:43 +0000 (19:47 +0100)]
pvr: Remove dead code from pvr_perform_start_of_render_clears.

Logically the hw_render would never be NULL so the if block is
never used and can be removed.

Fixes: CID1503270.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agopvr: Remove framebuffer NULL check from pvr_CmdBeginRenderPass2.
Rajnesh Kanwal [Sun, 25 Sep 2022 18:43:47 +0000 (19:43 +0100)]
pvr: Remove framebuffer NULL check from pvr_CmdBeginRenderPass2.

Framebuffer can not be NULL in pvr_CmdBeginRenderPass2.

Fixes: CID 1503259.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agopvr: Remove redundant assignment error.instruction.
Rajnesh Kanwal [Sun, 25 Sep 2022 18:39:31 +0000 (19:39 +0100)]
pvr: Remove redundant assignment error.instruction.

Fixes: CID 1503256.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agopvr: Remove redundant instruction buffer check.
Rajnesh Kanwal [Sun, 25 Sep 2022 18:38:37 +0000 (19:38 +0100)]
pvr: Remove redundant instruction buffer check.

Fixes: CID 1503273.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agopvr: Convert attachment indexes to unsigned.
Rajnesh Kanwal [Sun, 25 Sep 2022 18:20:22 +0000 (19:20 +0100)]
pvr: Convert attachment indexes to unsigned.

This commit converts attachment indexes used in renderpass to unsigned
and uses VK_ATTACHMENT_UNUSED for unused attachments instead of -1.

Also fixes some signed to unsigned comparisons.

Fixed: CID 1515587, 1515590, 1515597, 1515604.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18866>

22 months agoanv: limit to default fast clear color when image used for transfer
Tapani Pälli [Tue, 27 Sep 2022 05:42:13 +0000 (08:42 +0300)]
anv: limit to default fast clear color when image used for transfer

v2: use vk_image_layout_to_usage_flags for detecting
    transfer usage (Nanley)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7189
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18836>

22 months agopvr: Handle indirect buffer address in pvr_setup_descriptor_mappings.
Rajnesh Kanwal [Thu, 22 Sep 2022 14:39:32 +0000 (15:39 +0100)]
pvr: Handle indirect buffer address in pvr_setup_descriptor_mappings.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18872>

22 months agopvr: implement vkcmddispatchindirect api.
Rajnesh Kanwal [Thu, 22 Sep 2022 13:36:02 +0000 (14:36 +0100)]
pvr: implement vkcmddispatchindirect api.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18872>

22 months agoradv: enable the unified heap on APUs for Red Dead Redemption 2
Samuel Pitoiset [Thu, 29 Sep 2022 12:49:34 +0000 (14:49 +0200)]
radv: enable the unified heap on APUs for Red Dead Redemption 2

This seems to resolve the memory explosion without hurting performance.
This workaround is only applied for native Vulkan.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18884>

22 months agoradv: add a new drirc option to enable a unified heap on APUs
Samuel Pitoiset [Tue, 27 Sep 2022 17:46:53 +0000 (19:46 +0200)]
radv: add a new drirc option to enable a unified heap on APUs

This option (radv_enable_unified_heap_on_apu) allows to force the
driver to expose only one heap of VRAM because some games seem to
perform better with that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18884>

22 months agozink: enable glthread by default
Mike Blumenkrantz [Tue, 27 Sep 2022 20:11:01 +0000 (16:11 -0400)]
zink: enable glthread by default

huge perf gains.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18858>

22 months agopipe-loader: fix zink driinfo header path
Mike Blumenkrantz [Tue, 27 Sep 2022 21:06:28 +0000 (17:06 -0400)]
pipe-loader: fix zink driinfo header path

this feels like a compiler bug, but somehow just specifying the
shorter path ends up with a broken/partial header include

Fixes: d760a9151b7 ("gallium: Learn about kopper")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18858>

22 months agozink: export PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE
Mike Blumenkrantz [Tue, 27 Sep 2022 20:04:49 +0000 (16:04 -0400)]
zink: export PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18858>

22 months agozink: export PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION
Mike Blumenkrantz [Tue, 27 Sep 2022 20:04:39 +0000 (16:04 -0400)]
zink: export PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18858>

22 months agozink: fix/improve handling for multi-component bitfield ops
Mike Blumenkrantz [Tue, 20 Sep 2022 15:42:41 +0000 (11:42 -0400)]
zink: fix/improve handling for multi-component bitfield ops

the original improvement for this correctly handled cases where
the offset/count values were swizzled with .xxxx, but it was broken
for any other swizzling

this adds a nir pass to more easily manipulate the swizzles and rewrite
the multi-component ops as multiple ops with the swizzled params

fixes #6697

Fixes: 8e97f51c676 ("zink: handle swizzled offset/count values for shader bitfield ops")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18706>

22 months agollvmpipe/fs: convert outputs handling to explicit api
Dave Airlie [Wed, 28 Sep 2022 22:26:01 +0000 (08:26 +1000)]
llvmpipe/fs: convert outputs handling to explicit api

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agollvmpipe/fs: cleanup some remaining mask handling and reuse types
Dave Airlie [Wed, 28 Sep 2022 22:25:42 +0000 (08:25 +1000)]
llvmpipe/fs: cleanup some remaining mask handling and reuse types

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agollvmpipe/fs: handle explicit types around blending and c/zs bufs calcs
Dave Airlie [Wed, 28 Sep 2022 22:24:44 +0000 (08:24 +1000)]
llvmpipe/fs: handle explicit types around blending and c/zs bufs calcs

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agollvmpipe/fs: use explicit api in viewport code.
Dave Airlie [Wed, 28 Sep 2022 22:20:25 +0000 (08:20 +1000)]
llvmpipe/fs: use explicit api in viewport code.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agollvmpipe/fs: pass mask type to alpha to coverage handler
Dave Airlie [Wed, 28 Sep 2022 22:19:44 +0000 (08:19 +1000)]
llvmpipe/fs: pass mask type to alpha to coverage handler

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agollvmpipe/fs: add sample position type to the interp interface
Dave Airlie [Wed, 28 Sep 2022 22:17:35 +0000 (08:17 +1000)]
llvmpipe/fs: add sample position type to the interp interface

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agollvmpipe/fs: port depth code to opaque pointer api
Dave Airlie [Wed, 28 Sep 2022 22:15:28 +0000 (08:15 +1000)]
llvmpipe/fs: port depth code to opaque pointer api

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agollvmpipe/fs: pass explicit mask_type into interp code.
Dave Airlie [Mon, 26 Sep 2022 07:36:58 +0000 (17:36 +1000)]
llvmpipe/fs: pass explicit mask_type into interp code.

This is so it is known for explicit pointer support

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agollvmpipe/fs: add mask_type for mask_store accesses.
Dave Airlie [Mon, 26 Sep 2022 03:55:57 +0000 (13:55 +1000)]
llvmpipe/fs: add mask_type for mask_store accesses.

This adds and passes around the type for mask stores.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agogallivm/struct: add opaque ptr friendly pointer accessors.
Dave Airlie [Mon, 26 Sep 2022 03:47:15 +0000 (13:47 +1000)]
gallivm/struct: add opaque ptr friendly pointer accessors.

These just add explicit types.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>

22 months agoRevert "intel/compiler: Vectorize gl_TessLevelInner/Outer[] writes"
Kenneth Graunke [Fri, 30 Sep 2022 00:39:18 +0000 (17:39 -0700)]
Revert "intel/compiler: Vectorize gl_TessLevelInner/Outer[] writes"

This reverts commit abba55382f5588e3b9dfbc517d5fe940b2917c7c.
The assertions I added late in the process broke shader-db, and my
quick fix broke CI, so let's just revert it for now and I'll resubmit
this later when it's working better.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7385
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18895>

22 months agofreedreno/ir3: Validate our scheduling DAGs after construction.
Eric Anholt [Tue, 8 Sep 2020 21:39:51 +0000 (14:39 -0700)]
freedreno/ir3: Validate our scheduling DAGs after construction.

This gives us some better explanation of a stack overflow in ir3_postsched
with shader-db:

IR3_SHADER_DEBUG=nouboopt ./run shaders/nexuiz/46.shader_test

DAG validation failed at:
  0x55f6570e8460: 0079:0107:002:  _meta:collect r1.w (wrmask=0xff), r1.w, r2.x, r2.y, r2.z, r2.w, r3.x, r3.y, r3.z, false-deps:_[0098:0126:000:  mov.u32u32], _[0112:0143:000:  mov.u32u32], _[0087:0113:000:  mov.u32u32], _[0113:0144:000:  mov.u32u32], _[0099:0127:000:  mov.u32u32], _[0088:0114:000:  mov.u32u32]

Nodes in stack:
  0x55f657102050: 0079:0103:009:  mov.u32u32 r1.w, r0.x, right=_[0080:0104:009:  mov.u32u32]

  0x55f6570e8460: 0079:0107:002:  _meta:collect r1.w (wrmask=0xff), r1.w, r2.x, r2.y, r2.z, r2.w, r3.x, r3.y, r3.z, false-deps:_[0098:0126:000:  mov.u32u32], _[0112:0143:000:  mov.u32u32], _[0087:0113:000:  mov.u32u32], _[0113:0144:000:  mov.u32u32], _[0099:0127:000:  mov.u32u32], _[0088:0114:000:  mov.u32u32]

  0x55f657075f80: 0083:0108:007:  samgq (f32)(xyz)r0.z (wrmask=0x7), r1.w (wrmask=0xff), s#3, t#3

  0x55f657051b60: 0104:0134:008:  ldc.offset0 r3.x (wrmask=0xf), imm[0.000000,0,0x0], r9.w

  0x55f657103040: 0112:0143:000:  mov.u32u32 r9.w, r0.x, right=_[0113:0144:000:  mov.u32u32]

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6656>

22 months agoutil/dag: Add a validation function.
Eric Anholt [Tue, 8 Sep 2020 21:25:42 +0000 (14:25 -0700)]
util/dag: Add a validation function.

I experienced a circular dag in freedreno, and wanted a way to see what
was going wrong.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6656>

22 months agoutil/dag: Move the callback function pointer to the state.
Eric Anholt [Tue, 8 Sep 2020 21:16:05 +0000 (14:16 -0700)]
util/dag: Move the callback function pointer to the state.

No sense passing it as a recursive argument when we have this storage
right there.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6656>

22 months agoglthread: handle DeleteBuffers(n=-1) gracefully
Mike Blumenkrantz [Wed, 28 Sep 2022 01:42:49 +0000 (21:42 -0400)]
glthread: handle DeleteBuffers(n=-1) gracefully

this is a valid error condition

cc: mesa-stable

fixes:
GTF-GL46.gtf21.GL2FixedTests.buffer_objects.buffer_objects

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18856>

22 months agoglthread: use signed vertex buffer offsets when available, don't require them
Mike Blumenkrantz [Tue, 27 Sep 2022 22:26:49 +0000 (18:26 -0400)]
glthread: use signed vertex buffer offsets when available, don't require them

this is a great memory-saving optimization for drivers that support it,
but for drivesr that can't, it ends up taking slower paths instead
of just consuming more memory

but the year is 2022. we have all the memory. so use more memory if signed
offsets aren't supported

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18856>

22 months agod3d12: Style variable fix in d3d12_video_decoder_prepare_dxva_slices_control_av1
Sil Vilerino [Wed, 28 Sep 2022 21:38:47 +0000 (17:38 -0400)]
d3d12: Style variable fix in d3d12_video_decoder_prepare_dxva_slices_control_av1

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18875>

22 months agod3d12: Fix aliased usage of m_SliceControlBuffer in d3d12_video_decoder_prepare_dxva_...
Sil Vilerino [Wed, 28 Sep 2022 21:38:04 +0000 (17:38 -0400)]
d3d12: Fix aliased usage of m_SliceControlBuffer in d3d12_video_decoder_prepare_dxva_slices_control_XXXX

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18875>

22 months agod3d12: Support more video formats
Sil Vilerino [Fri, 23 Sep 2022 04:17:33 +0000 (00:17 -0400)]
d3d12: Support more video formats

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Adds support for P010 Encoding and Decoding
Also adds support for RGBA/RGBX UNORM/UINT in the video processor

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18875>

22 months agod3d12: Add support for AV1 Video Decode
Sil Vilerino [Thu, 15 Sep 2022 17:41:10 +0000 (13:41 -0400)]
d3d12: Add support for AV1 Video Decode

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18875>

22 months agofrontends/va: Fix AV1 decode qm_* parameters reading from VADecPictureParameterBufferAV1
Sil Vilerino [Thu, 29 Sep 2022 15:52:45 +0000 (11:52 -0400)]
frontends/va: Fix AV1 decode qm_* parameters reading from VADecPictureParameterBufferAV1

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Those are being read with | 0xF, but instead should be & 0xF to clear the bits above 4 (the field is 4 bits in size)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18875>

22 months agofrontends/va: Use is_video_format_supported in vlVaVidEngineBlit instead of format...
Sil Vilerino [Fri, 23 Sep 2022 04:18:07 +0000 (00:18 -0400)]
frontends/va: Use is_video_format_supported in vlVaVidEngineBlit instead of format list

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18875>

22 months agofrontends/va: Support AV1 Decode with multiple tiles (num_elements > 1) in a single...
Sil Vilerino [Fri, 16 Sep 2022 14:29:13 +0000 (10:29 -0400)]
frontends/va: Support AV1 Decode with multiple tiles (num_elements > 1) in a single VASliceParameterBufferAV1 buffer

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18875>

22 months agofrontends/va: Add more params from VADecPictureParameterBufferAV1 and VASliceParamete...
Sil Vilerino [Wed, 28 Sep 2022 13:45:15 +0000 (09:45 -0400)]
frontends/va: Add more params from VADecPictureParameterBufferAV1 and VASliceParameterBufferAV1 to pipe_av1_picture_desc

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18875>

22 months agointel/compiler: fix loading of draw_id from task & mesh payload
Marcin Ślusarz [Thu, 29 Sep 2022 14:47:32 +0000 (16:47 +0200)]
intel/compiler: fix loading of draw_id from task & mesh payload

Previously both destination and source were floats, so no casting was
performed, but with 7664c85b1da source register was reinterpreted as
unsigned integer, so MOV started casting that integer to float.

Fixes: 7664c85b1da ("intel/compiler: Create and use struct for TASK and MESH thread payloads")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18886>

22 months agoci/virgl: Enable virgl-iris-traces
Dmitry Osipenko [Fri, 23 Sep 2022 14:29:57 +0000 (17:29 +0300)]
ci/virgl: Enable virgl-iris-traces

All virgl-iris-traces tests are passing now after the crosvm revup that
fixed crosvm crash and after updating test checksums. Enable auto-testing
for the virgl-iris-traces pipeline stage.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18693>

22 months agoci: Update virgl-iris-traces checksums
Dmitry Osipenko [Fri, 23 Sep 2022 14:10:36 +0000 (17:10 +0300)]
ci: Update virgl-iris-traces checksums

Few virgl-iris-traces tests fail because resultant images now have few
pixels that changed. The actual reason of the change is unknown, we
assume it happened due to a new optimizations. Update the virgl-iris-traces
checksums.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18693>

22 months agoci: Bump crosvm version
Dmitry Osipenko [Tue, 20 Sep 2022 00:16:23 +0000 (03:16 +0300)]
ci: Bump crosvm version

Recent crosvm contains a fix for the unmapping memory on a wrong thread
that crashes crosvm. Bump the crosvm version.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Link: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/282
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18693>

22 months agovenus/ci: remove redundant crosvm patch
Yiwei Zhang [Thu, 22 Sep 2022 06:06:22 +0000 (06:06 +0000)]
venus/ci: remove redundant crosvm patch

VirglRenderer::export_blob doesn't need to handle opaque fd. That will
let rutabaga's export_blob to fail and fallback directly to the external
mapping path desired.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18693>

22 months agoradv: ignore shader stages that don't need to be imported with GPL
Samuel Pitoiset [Wed, 28 Sep 2022 15:35:30 +0000 (17:35 +0200)]
radv: ignore shader stages that don't need to be imported with GPL

Fixes an assertion with vkoverhead.

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/18869>

22 months agoradv: fix initializing the blend state for NULL render pass with GPL
Samuel Pitoiset [Wed, 28 Sep 2022 15:11:08 +0000 (17:11 +0200)]
radv: fix initializing the blend state for NULL render pass with GPL

If a library with only the vertex input interface is created, this
would crash.

This fixes segfault with vkoverhead.

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/18869>

22 months agoradv: fix initializing the attribute mask for VS input state and GPL
Samuel Pitoiset [Wed, 28 Sep 2022 12:13:17 +0000 (14:13 +0200)]
radv: fix initializing the attribute mask for VS input state and GPL

attribute_mask was unused when I first introduced this but now it's
used again.

This fixes a bunch of GPL regressions.

Fixes: 0feab7b9cfa ("radv: prepare the VS input state for prologs created with GPL")
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/18862>

22 months agozink: replace mixed_zs with zs feedback loops
Mike Blumenkrantz [Wed, 28 Sep 2022 16:13:42 +0000 (12:13 -0400)]
zink: replace mixed_zs with zs feedback loops

this is the more technically correct way to handle such things

SoroushIMG <soroush.kashani@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18855>

22 months agozink: add a draw barrier when unbinding a sampler-bound fb surface
Mike Blumenkrantz [Wed, 28 Sep 2022 02:51:50 +0000 (22:51 -0400)]
zink: add a draw barrier when unbinding a sampler-bound fb surface

this is guaranteed to need some kind of layout change, so ensure the
barrier actually happens

cc: mesa-stable

SoroushIMG <soroush.kashani@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18855>

22 months agovirgl: Add nir_lower_tex pass
Corentin Noël [Thu, 22 Sep 2022 15:14:42 +0000 (17:14 +0200)]
virgl: Add nir_lower_tex pass

In GLES hosts that do not support EXT_texture_shadow_lod we need to lower
the shadow texture calls with offset.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18296>

22 months agovirgl: Add TEXTURE_SHADOW_LOD capability support
Corentin Noël [Mon, 29 Aug 2022 14:44:12 +0000 (16:44 +0200)]
virgl: Add TEXTURE_SHADOW_LOD capability support

Bind PIPE_CAP_TEXTURE_SHADOW_LOD with its value so that we are not using
non-existing GLSL on host side.

Rename VIRGL_CAP_FAKE_FP64 into VIRGL_CAP_HOST_IS_GLES

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18296>

22 months agoradv: remove NULL checks when binding a graphics pipeline
Samuel Pitoiset [Wed, 28 Sep 2022 16:19:19 +0000 (18:19 +0200)]
radv: remove NULL checks when binding a graphics pipeline

The driver no longer bind NULL graphics pipelines, so these checks
are useless.

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/18873>

22 months agotu: Fix setting RB_DEPTH_CNTL::Z_CLAMP_ENABLE
Connor Abbott [Wed, 28 Sep 2022 11:53:09 +0000 (13:53 +0200)]
tu: Fix setting RB_DEPTH_CNTL::Z_CLAMP_ENABLE

I missed this when enabling pipeline libraries, and we were also setting
this to the wrong thing. Previously we were using rasterization state
when parsing depth/stencil indirectly via builder->depth_clip_disable,
which is not allowed with pipeline libraries. Fixing this is a bit
painful because now RB_DEPTH_CNTL can depend on state from both the
fragment shader library and the pre-rasterization library, in addition
to being disabled via output interface state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18861>

22 months agofreedreno/a6xx, tu: GRAS_CL_CNTL::UNK5 is Z_CLAMP_ENABLE
Connor Abbott [Wed, 28 Sep 2022 10:47:38 +0000 (12:47 +0200)]
freedreno/a6xx, tu: GRAS_CL_CNTL::UNK5 is Z_CLAMP_ENABLE

This changes the behavior for freedreno but it should ultimately be the
same for GL/GLES, given what mesa/st does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18861>

22 months agoRevert "freedreno,ir3: rename Z_CLAMP_ENABLE to Z_CLIP_DISABLE"
Connor Abbott [Wed, 28 Sep 2022 10:32:42 +0000 (12:32 +0200)]
Revert "freedreno,ir3: rename Z_CLAMP_ENABLE to Z_CLIP_DISABLE"

This reverts commit 6cb41c51884c2488194f74e2ce637b950c835620. It was
incorrect and the issue it was trying to fix was actually a zink bug.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18861>

22 months agolavapipe: dynamic state3
Mike Blumenkrantz [Mon, 13 Jun 2022 16:24:27 +0000 (12:24 -0400)]
lavapipe: dynamic state3

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agovulkan: Add more dynamic color blend states
Jason Ekstrand [Thu, 21 Jul 2022 22:18:27 +0000 (17:18 -0500)]
vulkan: Add more dynamic color blend states

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agovulkan: Add more dynamic multisample states
Jason Ekstrand [Thu, 21 Jul 2022 19:55:51 +0000 (14:55 -0500)]
vulkan: Add more dynamic multisample states

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agovulkan: Add dynamic state for tessellation domain origin
Jason Ekstrand [Thu, 21 Jul 2022 19:29:16 +0000 (14:29 -0500)]
vulkan: Add dynamic state for tessellation domain origin

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agovulkan: Add more dynamic rasterizer state
Jason Ekstrand [Thu, 21 Jul 2022 19:19:30 +0000 (14:19 -0500)]
vulkan: Add more dynamic rasterizer state

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agovulkan: Add a dynamic state for vp.depth_clip_negative_one_to_one
Jason Ekstrand [Thu, 21 Jul 2022 19:01:02 +0000 (14:01 -0500)]
vulkan: Add a dynamic state for vp.depth_clip_negative_one_to_one

This is the last bit of viewport state that's not dynamic.  Making it
dynamic will help ANV out a bit.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agovulkan: Rename viewport_state::negative_one_to_one
Jason Ekstrand [Thu, 21 Jul 2022 18:54:16 +0000 (13:54 -0500)]
vulkan: Rename viewport_state::negative_one_to_one

This makes it a bit clearer what it's for.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agovulkan: Update the XML and headers to 1.3.230
Mike Blumenkrantz [Thu, 29 Sep 2022 04:34:44 +0000 (00:34 -0400)]
vulkan: Update the XML and headers to 1.3.230

Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agovulkan: Use altlen when available for array lengths
Jason Ekstrand [Thu, 21 Jul 2022 21:27:44 +0000 (16:27 -0500)]
vulkan: Use altlen when available for array lengths

When the array length is a calculation, the C version of the calculation
is provided in altlen while len often contains LaTeX that we can't do
anything with.  Use altlen when available.  Also, while we're here, wrap
array lengths in parentheses in case they contain math.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18878>

22 months agogallium: avoid using float based conditions in loops
Filip Gawin [Mon, 16 Aug 2021 20:41:24 +0000 (22:41 +0200)]
gallium: avoid using float based conditions in loops

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12996>

22 months agozink: pass actual screen->threaded to zink_tc_context_unwrap()
Mike Blumenkrantz [Tue, 27 Sep 2022 21:35:00 +0000 (17:35 -0400)]
zink: pass actual screen->threaded to zink_tc_context_unwrap()

using the ctx->screen pointer may not actually yield a zink_screen object

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18868>

22 months agozink: hook up VK_EXT_depth_clamp_zero_one
Mike Blumenkrantz [Tue, 27 Sep 2022 18:42:08 +0000 (14:42 -0400)]
zink: hook up VK_EXT_depth_clamp_zero_one

this is required for GL since the allowable depth range is always [0,1]

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18868>

22 months agozink: move create_pipeline_lib to zink_program.c
Mike Blumenkrantz [Thu, 22 Sep 2022 20:41:52 +0000 (16:41 -0400)]
zink: move create_pipeline_lib to zink_program.c

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18868>

22 months agozink: rework ZINK_PIPELINE_LIBRARY_FORCE into ZINK_DEBUG flag
Mike Blumenkrantz [Thu, 22 Sep 2022 21:01:42 +0000 (17:01 -0400)]
zink: rework ZINK_PIPELINE_LIBRARY_FORCE into ZINK_DEBUG flag

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18868>

22 months agozink: move zink_screen_get_pipeline_cache() calls out to callers
Mike Blumenkrantz [Thu, 22 Sep 2022 21:03:17 +0000 (17:03 -0400)]
zink: move zink_screen_get_pipeline_cache() calls out to callers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18868>

22 months agovulkan/wsi: Add a supports_scanout flag
Jason Ekstrand [Mon, 26 Sep 2022 15:48:08 +0000 (10:48 -0500)]
vulkan/wsi: Add a supports_scanout flag

This flag indicates whether or not the legacy scanout flag is supported.
It defaults to true since that has been the default assumption for the
WSI code up until now.

On NVIDIA hardware, we can't render to linear so, if we don't have
modifiers, we want to automatically fall back to the blit path.  In
theory, we could do this inside the driver but it's a giant pain and
much harder to ensure that the blit only happens as part of
vkQueuePresent().

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18826>

22 months agovulkan/wsi: Add a typedef for memory type select callbacks
Jason Ekstrand [Mon, 26 Sep 2022 15:53:53 +0000 (10:53 -0500)]
vulkan/wsi: Add a typedef for memory type select callbacks

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18826>

22 months agovulkan/wsi: Don't expose as many image configure helpers
Jason Ekstrand [Mon, 26 Sep 2022 18:13:33 +0000 (13:13 -0500)]
vulkan/wsi: Don't expose as many image configure helpers

Now that everything is going through the params-based ones, we don't
need to expose the individual ones.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18826>