platform/upstream/mesa.git
22 months agomesa: add a format table for GL_BGRA vertex format translation too
Marek Olšák [Tue, 8 Nov 2022 00:55:20 +0000 (19:55 -0500)]
mesa: add a format table for GL_BGRA vertex format translation too

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>

22 months agomesa: add more cases to the gallium vertex_formats table
Marek Olšák [Tue, 8 Nov 2022 00:33:32 +0000 (19:33 -0500)]
mesa: add more cases to the gallium vertex_formats table

The way we convert gltype to the index changed to handle more enums.
The reason why (gltype & 0x3f) works is because of how the enums are
defined.

Also change the type to uint8_t. We only need the low 7 bits of
the pipe format enum.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>

22 months agost/mesa: move setting draw_needs_minmax_index into st_update_array_templ
Marek Olšák [Wed, 19 Oct 2022 22:21:47 +0000 (18:21 -0400)]
st/mesa: move setting draw_needs_minmax_index into st_update_array_templ

This removes several parameters from setup_array that become unused.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>

22 months agost/mesa: simplify st_setup_current parameters
Marek Olšák [Mon, 7 Nov 2022 21:58:22 +0000 (16:58 -0500)]
st/mesa: simplify st_setup_current parameters

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>

22 months agost/mesa: optimize uploading zero-stride vertex attribs
Marek Olšák [Tue, 8 Nov 2022 02:18:33 +0000 (21:18 -0500)]
st/mesa: optimize uploading zero-stride vertex attribs

Instead of memcpy into a temporary array and then upload from that,
upload into a buffer directly.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>

22 months agost/mesa: remove alignment code from st_setup_current
Marek Olšák [Mon, 7 Nov 2022 23:53:22 +0000 (18:53 -0500)]
st/mesa: remove alignment code from st_setup_current

I was the one who added this code and it doesn't seem useful.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19783>

22 months agoci: fix missing line after adding austraincoder's farm killswitch
David Heidelberg [Thu, 8 Dec 2022 17:25:00 +0000 (18:25 +0100)]
ci: fix missing line after adding austraincoder's farm killswitch

Accidentally dropped.

Fixes: ff928d9567a5 ("ci: Allow disabling the whole of austriancoder's farm")

Reported-by: Ana Guerrero Lopez <anagl@igalia.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Ana Guerrero Lopez <anagl@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20236>

22 months agointel/genxml: Add genX_rt_pack.h
Jordan Justen [Wed, 7 Dec 2022 20:49:21 +0000 (12:49 -0800)]
intel/genxml: Add genX_rt_pack.h

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20225>

22 months agointel/fs: add a saturation propagation test
Lionel Landwerlin [Thu, 8 Dec 2022 14:12:24 +0000 (16:12 +0200)]
intel/fs: add a saturation propagation test

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20206>

22 months agobrw: fix saturate propagation region overlap range
Oleksii Bozhenko [Wed, 7 Dec 2022 17:27:45 +0000 (19:27 +0200)]
brw: fix saturate propagation region overlap range

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/commit/947c828d5cbffe9640ac63103a6223112eeff27f
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7691

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20206>

22 months agointel/fs: implement Wa_14017989577
Tapani Pälli [Tue, 6 Dec 2022 16:11:10 +0000 (18:11 +0200)]
intel/fs: implement Wa_14017989577

The first instruction of any kernel should have non-zero emask. This
restriction needs to be obeyed to avoid GPU hangs.

Patch adds a function to insert dummy mov as first instruction
to make sure this requirement is fulfilled.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20194>

22 months agofreedreno: fix compute shared_size underflow
Chia-I Wu [Thu, 8 Dec 2022 04:04:55 +0000 (20:04 -0800)]
freedreno: fix compute shared_size underflow

It caused ~5% of perf regression for some gfxbench benchmarks.

Fixes: b8d10d9e87a ("gallium: split up req_local_mem")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20219>

22 months agoradeonsi/vcn: av1 film_grain output fix
Ruijing Dong [Fri, 2 Dec 2022 21:11:52 +0000 (16:11 -0500)]
radeonsi/vcn: av1 film_grain output fix

use film grain surface as the output instead of target,
which should be kept for DPB process.

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

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>

22 months agofrontends/va: pass in film_grain_target as new output
Ruijing Dong [Fri, 2 Dec 2022 21:09:42 +0000 (16:09 -0500)]
frontends/va: pass in film_grain_target as new output

In av1 film grain case, to use the film_grain_target
as the output, instead of target buffer, which is kept
as the input for DPB processing in film_grain output
scenario.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>

22 months agofrontneds/va: use current_display_picture from VA for film grain
Ruijing Dong [Fri, 2 Dec 2022 21:04:18 +0000 (16:04 -0500)]
frontneds/va: use current_display_picture from VA for film grain

use the interface defined in vaapi for av1 film grain's output
https://github.com/intel/libva/blob/master/va/va_dec_av1.h#L296-L304

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>

22 months agofrontends/omx: initialize film_grain_target
Ruijing Dong [Fri, 2 Dec 2022 21:02:12 +0000 (16:02 -0500)]
frontends/omx: initialize film_grain_target

set film_grain_target to NULL, and not using it
in omx path.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>

22 months agogallium: add film_grain_target into av1 dec desc
Ruijing Dong [Fri, 2 Dec 2022 20:58:24 +0000 (15:58 -0500)]
gallium: add film_grain_target into av1 dec desc

In vaapi, film_grain output will need to direct into
other output surface instead of the current render_target.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>

22 months agodrm-shim: add __readlink_chk as readlink with overflow check
Max Lee [Wed, 12 Oct 2022 03:41:12 +0000 (14:41 +1100)]
drm-shim: add __readlink_chk as readlink with overflow check

As per Linux Standard Base Core Specification 4.0, __readlink_chk
display value of a symbolic link, with buffer overflow checking.

if size > buflen, abort() is called.

Signed-off-by: Max Lee <endlesspring@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19045>

22 months agopvr: Check depth/stencil attachment is tile-aligned
Matt Coster [Mon, 28 Nov 2022 15:04:17 +0000 (15:04 +0000)]
pvr: Check depth/stencil attachment is tile-aligned

The hardware requires depth/stencil attachments to be size-aligned to
the zls tile size (as defined by rogue_get_zls_tile_size_xy()).

In practice however, this is a tiny edge case. The restriction only
applies during some operations, and any attachment larger than the tile
size will be twiddled and over-allocated into alignment beforehand.

This commit also adds the mentioned rogue_get_zls_tile_size_xy()
function. These values differ from the regular tile_size_{x,y} feature
values in some cases. Instead of including them as features as well, we
compute them directly.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20160>

22 months agopvr: Account for other depth formats in pvr_frag_state_stream_init()
Matt Coster [Fri, 2 Dec 2022 11:58:48 +0000 (11:58 +0000)]
pvr: Account for other depth formats in pvr_frag_state_stream_init()

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20160>

22 months agopvr: Add stencil support in render job setup
Matt Coster [Mon, 28 Nov 2022 15:00:03 +0000 (15:00 +0000)]
pvr: Add stencil support in render job setup

The implementation here assumes separate depth and stencil attachments
are not possible, as they are in Vulkan without VK_KHR_dynamic_rendering
and before core 1.3.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20160>

22 months agoci: Allow disabling the whole of austriancoder's farm
Christian Gmeiner [Fri, 7 Oct 2022 11:31:22 +0000 (13:31 +0200)]
ci: Allow disabling the whole of austriancoder's farm

Add a global-level variable that allows disabling all jobs that would
have gone to my lab, to be used in case of outages.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18997>

22 months agoradv,aco: move radv_ps_epilog_key to the graphics pipeline key
Samuel Pitoiset [Thu, 8 Dec 2022 12:55:34 +0000 (13:55 +0100)]
radv,aco: move radv_ps_epilog_key to the graphics pipeline key

To avoid redundant structs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20199>

22 months agoradv: fix PS epilogs with RADV_PERFTEST=pswave32
Samuel Pitoiset [Thu, 8 Dec 2022 12:55:09 +0000 (13:55 +0100)]
radv: fix PS epilogs with RADV_PERFTEST=pswave32

This option is rarely or even never used but it was broken. While we
are at it, remove radv_ps_epilog_key::wave32 because the wave size
can only be changed globally for PS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20199>

22 months agoradv,aco: use 8-bit for color_is_int{8,10} everywhere
Samuel Pitoiset [Thu, 8 Dec 2022 12:54:42 +0000 (13:54 +0100)]
radv,aco: use 8-bit for color_is_int{8,10} everywhere

Do not need 32-bits because there is only up to 8 MRTs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20199>

22 months agoradv,aco: rename color output related fields for consistency
Samuel Pitoiset [Thu, 8 Dec 2022 12:54:21 +0000 (13:54 +0100)]
radv,aco: rename color output related fields for consistency

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20199>

22 months agopvr: Extract common code from pvr_CmdDispatch{,Indirect}
Matt Coster [Fri, 18 Nov 2022 16:20:18 +0000 (16:20 +0000)]
pvr: Extract common code from pvr_CmdDispatch{,Indirect}

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20159>

22 months agopvr: Track max_shared_regs for compute jobs
Matt Coster [Fri, 18 Nov 2022 16:04:05 +0000 (16:04 +0000)]
pvr: Track max_shared_regs for compute jobs

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20159>

22 months agopvr: Refactor pvr_compute_pipeline and pvr_compute_pipeline_shader
Matt Coster [Fri, 18 Nov 2022 15:57:07 +0000 (15:57 +0000)]
pvr: Refactor pvr_compute_pipeline and pvr_compute_pipeline_shader

This brings the two structs more into line with their graphics
counterparts, and removes the extra member access previously required
to access almost all members of pvr_compute_pipeline.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20159>

22 months agoaco: Migrate RA to use std::optional
Tatsuyuki Ishi [Fri, 2 Dec 2022 08:00:10 +0000 (17:00 +0900)]
aco: Migrate RA to use std::optional

The use of std::optional simplifies expressions and would be useful for some
upcoming RA tweaks.

C++17 has been available since the merge of rusticl and should be safe to use as
far as packaging is concerned.

A few style choices are:
- Testing for emptiness uses implicit bool conversion.
- Constructing an empty value uses {}.
- Constructing a filled value uses the implicit conversion constructor.

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

22 months agoci/valve-infra: use a new version of the mesa trigger
Martin Roukala (né Peres) [Wed, 7 Dec 2022 15:06:57 +0000 (17:06 +0200)]
ci/valve-infra: use a new version of the mesa trigger

This new version of the container will re-try up to 3 times to download
the job bucket, rather than failing directly. If the issue persists,
the job will still succeed, but not all artifacts will be present...

Fixes: #7809
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20203>

22 months agointel/compiler: Set NoMask on cr0 access for float controls mode
Kenneth Graunke [Wed, 7 Dec 2022 20:00:33 +0000 (12:00 -0800)]
intel/compiler: Set NoMask on cr0 access for float controls mode

This is trying to clear a bit in the control register.  However, it's
executing with whatever channel mask happens to be active.  Typically
this is the one at the start of the program, so at least some channels
will be active.  Typically the first channel will be active due to
packed dispatch, but that's not always guaranteed.  Without NoMask,
the float controls writes may randomly not happen.

Recent GPUs also seem to have a hang issue when the first instruction in
the shader doesn't have any active channels.  Having an instruction with
NoMask at the start of the program works around the issue.  See HSD bug
14017989577.  In our case, the float controls preamble was breaking that
restriction every time, causing us to run into this problem frequently.

Thanks to Tapani Pälli for finding this hang issue, and Francisco
Jerez and Lionel Landwerlin for helping pinpoint this issue during
review of a workaround patch in !20194.

Fixes GPU hangs in Elder Scrolls Online, Witcher 3, and likely more.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7639
Fixes: 9da56ffc522 ("i965/fs: add emit_shader_float_controls_execution_mode() and aux functions")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20214>

22 months agovirgl: lower FMA and MULADD
Gert Wollny [Mon, 14 Nov 2022 12:52:53 +0000 (13:52 +0100)]
virgl: lower FMA and MULADD

On the host we emit this as separate ops anyway, so avoid
wired optimizations in the guest that might introduce
difficult to optimize dependencies.

v2: update trace expectations - some minor accuracy changes
    are to be expected when fma is handled differently

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20182>

22 months agoglsl: dont create temps for builtin function inputs
Timothy Arceri [Thu, 3 Nov 2022 01:59:20 +0000 (12:59 +1100)]
glsl: dont create temps for builtin function inputs

It's not valid to be copying input variables to temps when
inlining atomic memory, interpolateAt functions, etc. We got away
with this previously because tree grafting would clean up the
mess but we shouldn't depend on an optimisation to clean up
invalid IR. Also I hope to remove tree grafting in a follow up
merge request.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19890>

22 months agoglsl: use ir_rvalue_visitor for function inlining
Timothy Arceri [Mon, 7 Nov 2022 01:00:02 +0000 (12:00 +1100)]
glsl: use ir_rvalue_visitor for function inlining

This allows us to drop some duplicate code that is already in the
ir_rvalue_visitor. It also allows us to better replace rvalues
and handle swizzle in the following patch without having to add
even more duplicate code.

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

22 months agovenus: scrub ignored fields for descriptor writes for push descriptor
Yiwei Zhang [Tue, 6 Dec 2022 22:03:02 +0000 (14:03 -0800)]
venus: scrub ignored fields for descriptor writes for push descriptor

Fixes: 933ca11f1a4 ("venus: implement vkCmdPushDescriptorSetWithTemplateKHR")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20191>

22 months agovulkan: VkPolygonMode has a bit more than two values
Iván Briano [Wed, 7 Dec 2022 20:30:36 +0000 (12:30 -0800)]
vulkan: VkPolygonMode has a bit more than two values

Fixes: 9d0ed9cbcc0 ("vulkan: Add more dynamic rasterizer state")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20212>

22 months agohasvk: Report correct multisampling limits on gfx7
Väinö Mäkelä [Sat, 29 Oct 2022 07:59:56 +0000 (10:59 +0300)]
hasvk: Report correct multisampling limits on gfx7

Some limits reported by hasvk were too high, which caused CTS tests to
fail.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19393>

22 months agoaco: Add s_delay_alu support for GFX11+
Bas Nieuwenhuizen [Sun, 13 Nov 2022 18:15:28 +0000 (18:15 +0000)]
aco: Add s_delay_alu support for GFX11+

Roughly copied from LLVM. This facilitates better ALU usage by
switching between waves when there is an ALU stall, which isn't
automatic anymore on GFX11.

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

22 months agoaco: Add helper to get cycle info for an instruction.
Bas Nieuwenhuizen [Mon, 14 Nov 2022 18:58:32 +0000 (18:58 +0000)]
aco: Add helper to get cycle info for an instruction.

For use in s_delay_alu tracking

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

22 months agoaco: Add isTrans helper.
Bas Nieuwenhuizen [Mon, 14 Nov 2022 18:57:08 +0000 (18:57 +0000)]
aco: Add isTrans helper.

For the s_delay_alu tracking.

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

22 months agoradv: mark extendedDynamicState3SampleLocationsEnable as not required by Zink
Samuel Pitoiset [Tue, 22 Nov 2022 09:12:06 +0000 (10:12 +0100)]
radv: mark extendedDynamicState3SampleLocationsEnable as not required by Zink

Only dynamic blend equation support is still required.

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

22 months agoradv: advertise extendedDynamicState3LineRasterizationMode
Samuel Pitoiset [Tue, 22 Nov 2022 07:56:09 +0000 (08:56 +0100)]
radv: advertise extendedDynamicState3LineRasterizationMode

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

22 months agoradv: add support for dynamic line rasterization mode
Samuel Pitoiset [Tue, 22 Nov 2022 08:07:25 +0000 (09:07 +0100)]
radv: add support for dynamic line rasterization mode

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

22 months agoradv: advertise extendedDynamicState3RasterizationSamples
Samuel Pitoiset [Mon, 7 Nov 2022 22:36:20 +0000 (23:36 +0100)]
radv: advertise extendedDynamicState3RasterizationSamples

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

22 months agoradv: add support for dynamic rasterization samples
Samuel Pitoiset [Mon, 21 Nov 2022 07:23:28 +0000 (08:23 +0100)]
radv: add support for dynamic rasterization samples

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

22 months agoradv: store the number of color/ds samples to the rendering state
Samuel Pitoiset [Mon, 21 Nov 2022 16:37:54 +0000 (17:37 +0100)]
radv: store the number of color/ds samples to the rendering state

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

22 months agonir: fix digit order in print_bitset()
Mihai Preda [Mon, 5 Dec 2022 14:44:04 +0000 (16:44 +0200)]
nir: fix digit order in print_bitset()

Also fix the leading curly for the new function definitions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agonir: print shader_info bools with the value
Mihai Preda [Wed, 30 Nov 2022 09:45:07 +0000 (11:45 +0200)]
nir: print shader_info bools with the value

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agonir: print shader_info inputs/outputs as bit ranges
Mihai Preda [Wed, 23 Nov 2022 20:12:24 +0000 (22:12 +0200)]
nir: print shader_info inputs/outputs as bit ranges

e.g.
inputs_read: 15-17
outputs_written: 0,32

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agoradeonsi: add AMD_DEBUG=elements for printing vertex elements
Mihai Preda [Wed, 23 Nov 2022 12:47:23 +0000 (14:47 +0200)]
radeonsi: add AMD_DEBUG=elements for printing vertex elements

in si_create_vertex_elements()

This information is useful in debugging shader inputs/outputs

Sample output:
AMD_DEBUG=elements ./bin/arb_vertex_attrib_64bit-overlapping-locations shader -auto
elements[0]: offset  0, buffer_index 0, dual_slot 0, format  16, divisor 0
elements[1]: offset 16, buffer_index 0, dual_slot 0, format  16, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 104, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 105, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 106, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format  16, divisor 0
elements[1]: offset 16, buffer_index 0, dual_slot 0, format  16, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 104, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 105, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 106, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[1]: offset 16, buffer_index 0, dual_slot 1, format 107, divisor 0
elements[2]: offset 32, buffer_index 0, dual_slot 1, format 105, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[1]: offset 40, buffer_index 0, dual_slot 1, format 107, divisor 0
elements[2]: offset 56, buffer_index 0, dual_slot 1, format 105, divisor 0
elements[0]: offset  0, buffer_index 0, dual_slot 0, format 107, divisor 0
elements[1]: offset 64, buffer_index 0, dual_slot 1, format 107, divisor 0
elements[2]: offset 80, buffer_index 0, dual_slot 1, format 105, divisor 0

PIGLIT: {"result": "pass" }
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agoutil: minor refactor _mesa_sha1_print()
Mihai Preda [Mon, 14 Nov 2022 17:58:13 +0000 (19:58 +0200)]
util: minor refactor _mesa_sha1_print()

should not change the output; avoids an additional printf()
for the separator.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agonir: print_shader_info(): brief output
Mihai Preda [Mon, 14 Nov 2022 17:52:37 +0000 (19:52 +0200)]
nir: print_shader_info(): brief output

Make the shader_info printing less verbose by skipping the fields that
are likely not used (being zero).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agonir: print_shader_info: print stage-specific shader info
Mihai Preda [Mon, 7 Nov 2022 11:30:39 +0000 (13:30 +0200)]
nir: print_shader_info: print stage-specific shader info

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agonir: print_shader_info() print bitsets
Mihai Preda [Wed, 2 Nov 2022 11:49:38 +0000 (13:49 +0200)]
nir: print_shader_info() print bitsets

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agonir: print more in print_shader_info()
Mihai Preda [Wed, 2 Nov 2022 11:30:16 +0000 (13:30 +0200)]
nir: print more in print_shader_info()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agonir: extract print_shader_info() from nir_print_shader_annotated()
Mihai Preda [Wed, 2 Nov 2022 10:07:36 +0000 (12:07 +0200)]
nir: extract print_shader_info() from nir_print_shader_annotated()

This is a refactoring, it is not supposed to change the printed output.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19570>

22 months agoanv/hasvk: Clamping Scissor Rect values in a valid range
Otavio Pontes [Wed, 19 Oct 2022 21:39:24 +0000 (14:39 -0700)]
anv/hasvk: Clamping Scissor Rect values in a valid range

On cmd_buffer_emit_scissor(), if VkViewport height or width are set to
a value lower than 1.0, y_max or x_max can be attributed negative values,
causing an overflow. That leads to ScissorRectangleYMax or
ScissorRectangleXMax to be set to values on an unsupported range.

Clamping x_max and y_max in the valid range solves the problem.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7471
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20200>

22 months agotu: allow using resolve engine for SRGB MSAA resolves
Jonathan Marek [Fri, 17 Sep 2021 15:32:48 +0000 (11:32 -0400)]
tu: allow using resolve engine for SRGB MSAA resolves

CTS accepts this behavior since a1be5ce2c893f525da82bc28c6e81b17cacc5d14

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20120>

22 months agomeson: Do not enable drm for KGSL Turnip build
Danylo Piliaiev [Mon, 5 Dec 2022 16:58:05 +0000 (17:58 +0100)]
meson: Do not enable drm for KGSL Turnip build

Android may use either DRM or some downstream solution, KGSL is a
downstream kernel driver for Adreno. Don't enable DRM when we want
Turnip to use KGSL instead of DRM.

Fixes: 09ac29cca9bf7978911f81bcfce12ce71c260a97
("meson: Enable system_has_kms_drm for android")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20168>

22 months agost/mesa: stop using redundant st_context::vp,tcp,tep,gp,fp,cp
Marek Olšák [Fri, 18 Nov 2022 13:08:30 +0000 (08:08 -0500)]
st/mesa: stop using redundant st_context::vp,tcp,tep,gp,fp,cp

Use ctx->XXProgram._Current instead of the st_context variables.

v2: split from a bigger commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agost/mesa: fix the glBitmap cache wrt FS, scissor, and clamp color changes
Marek Olšák [Fri, 18 Nov 2022 15:20:17 +0000 (10:20 -0500)]
st/mesa: fix the glBitmap cache wrt FS, scissor, and clamp color changes

We need to track those states in the cache and flush the cache
if the next glBitmap call uses different states.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agost/mesa: don't flag ST_NEW_RASTERIZER for _NEW_PROGRAM
Marek Olšák [Fri, 18 Nov 2022 12:52:11 +0000 (07:52 -0500)]
st/mesa: don't flag ST_NEW_RASTERIZER for _NEW_PROGRAM

This should have no effect thanks to previous commits.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agomesa: flag ST_NEW_RASTERIZER for !needs_texcoord_semantic if changing FS
Marek Olšák [Fri, 18 Nov 2022 12:49:33 +0000 (07:49 -0500)]
mesa: flag ST_NEW_RASTERIZER for !needs_texcoord_semantic if changing FS

This will be required with the next change, which will remove
the rasterizer state dependency on _NEW_PROGRAM.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agomesa: remove unused composite _NEW_* flags
Marek Olšák [Fri, 18 Nov 2022 12:38:40 +0000 (07:38 -0500)]
mesa: remove unused composite _NEW_* flags

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agomesa: don't flag _NEW_PROGRAM for "texture_unit -> sampler" mapping changes
Marek Olšák [Fri, 18 Nov 2022 12:35:00 +0000 (07:35 -0500)]
mesa: don't flag _NEW_PROGRAM for "texture_unit -> sampler" mapping changes

st/mesa just reorders sampler views, so we only need to rebind those.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agomesa: set fewer flags for VertexProgram.TwoSideEnabled changes
Marek Olšák [Fri, 18 Nov 2022 12:31:03 +0000 (07:31 -0500)]
mesa: set fewer flags for VertexProgram.TwoSideEnabled changes

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agomesa: set fewer dirty flags for PointSizeEnabled state changes
Marek Olšák [Fri, 18 Nov 2022 12:20:20 +0000 (07:20 -0500)]
mesa: set fewer dirty flags for PointSizeEnabled state changes

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agomesa: flag ST_NEW_FS_CONSTANTS instead of _NEW_PROGRAM for ATI_fs constants
Marek Olšák [Fri, 18 Nov 2022 12:07:46 +0000 (07:07 -0500)]
mesa: flag ST_NEW_FS_CONSTANTS instead of _NEW_PROGRAM for ATI_fs constants

We only need to update the constant buffer.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agost/mesa: update st_context::active_states in _mesa_update_state
Marek Olšák [Fri, 18 Nov 2022 11:53:48 +0000 (06:53 -0500)]
st/mesa: update st_context::active_states in _mesa_update_state

just a code movement to a better place

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agost/mesa: move check_program_state code into _mesa_update_state
Marek Olšák [Fri, 18 Nov 2022 11:42:07 +0000 (06:42 -0500)]
st/mesa: move check_program_state code into _mesa_update_state

_mesa_update_state() receives the _NEW_PROGRAM flag, so we can handle
any shader changes there.

There may be some overhead reduction because gfx_shaders_may_be_dirty
is removed.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agost/mesa: always unbind constant buffer 0 when unbinding a shader
Marek Olšák [Sat, 26 Nov 2022 17:22:26 +0000 (12:22 -0500)]
st/mesa: always unbind constant buffer 0 when unbinding a shader

softpipe loads from an unbound and destroyed constant buffer for some reason

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agomesa: clean up hairy code in state.c: update_program
Marek Olšák [Fri, 25 Nov 2022 18:08:48 +0000 (13:08 -0500)]
mesa: clean up hairy code in state.c: update_program

No change in behavior.

Replace:

if (shader)
   bind(shader);
else
   bind(NULL);

With:

bind(shader);

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19859>

22 months agozink: fix rebase-mistake
Erik Faye-Lund [Wed, 7 Dec 2022 08:27:28 +0000 (09:27 +0100)]
zink: fix rebase-mistake

This should not have re-introduced this lowering, effectively reverting
dcf3ae72abf78e8959c5b5a94ef332c0b7396ab2.

Fixes: 16971cd667b ("zink: add driver-workaround for missing gl_point_size")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20195>

22 months agointel/fs: clamp per vertex input accesses to patchControlPoints
Lionel Landwerlin [Thu, 25 Mar 2021 12:53:32 +0000 (14:53 +0200)]
intel/fs: clamp per vertex input accesses to patchControlPoints

In a tesselation control shader where an input array is accessed using
the index gl_InvocationID, we can end up accessing elements beyond the
number of input vertices specified in the shader key.

This happens because of the lowering in nir_lower_indirect_derefs().
This lowering will affect compact variables which happens in this
case :

  in gl_PerVertex {
      vec4  gl_Position;
      float gl_ClipDistance[1];
  } gl_in[gl_MaxPatchVertices];

The lowered code produced by NIR is somewhat ineffecient (implements a
binary seach) :

  if (gl_InvocationID < 16) {
     if (gl_InvocationID < 8) {
        if (gl_InvocationID < 4) {
          vec4 vals = load_at_offset(0);
          value = bcsel(vals, gl_InvocationID);
        } else {
          vec4 vals = load_at_offset(4);
          value = bcsel(vals, gl_InvocationID - 4);
        }
     } else {
        if (gl_InvocationID < 12) {
          vec4 vals = load_at_offset(8);
          value = bcsel(vals, gl_InvocationID - 8);
        } else {
          vec4 vals = load_at_offset(12);
          value = bcsel(vals, gl_InvocationID - 12);
        }
     }
  } else {
     if (gl_InvocationID < 24) {
        ...
     } else {
        ...
     }
  }

By default the gl_MaxPatchVertices must be set at 32 items and that's
what the lowering code will use to divide the access into chunks of 4.
But when running with 3 input vertices, this means we'll pull one more
item than what was delivered in the shader payload.

This triggers issues further down the register scheduling where the
g5UD (register for the 4th item) is overwritten by a previous SEND,
leading the URB read to use an invalid handle.

This pass clamps any access load_per_vertex_input intrinsic vertex
indice to (input_vertices - 1).

Fixes issues with tests like :
dEQP-VK.clipping.user_defined.clip_distance.vert_tess.*

Also fixes a hang with zink/anv on :
KHR-GL46.draw_elements_base_vertex_tests.AEP_shader_stages

v2: Don't replace source register

v3: Implement in NIR

v4: Clamp per vertex array sizes in NIR (Jason)

v5: Move the clamping on the intel compiler

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9749>

22 months agonir: Use nir_component_mask_t for nir_alu_dst::write_mask
Jason Ekstrand [Wed, 7 Dec 2022 00:26:25 +0000 (18:26 -0600)]
nir: Use nir_component_mask_t for nir_alu_dst::write_mask

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20193>

22 months agoglx: fix xshm check to init xshm_opcode.
Dave Airlie [Tue, 6 Dec 2022 19:11:47 +0000 (05:11 +1000)]
glx: fix xshm check to init xshm_opcode.

Found and proposed by Ray Strode (halfline)

Fixes: 68e89401140d ("glx/drisw: use xcb instead of X to query connection")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20188>

22 months agozink: don't use defunct custom-flag
Erik Faye-Lund [Tue, 6 Dec 2022 15:16:08 +0000 (16:16 +0100)]
zink: don't use defunct custom-flag

We're no longer respecting this flag, so there's no need in setting it.

Fixes: 00dc0036bb6 ("zink: flatten out buffer creation usage flags codepath")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20183>

22 months agonir: Add missing includes
Konstantin Seurer [Wed, 2 Feb 2022 15:09:32 +0000 (16:09 +0100)]
nir: Add missing includes

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14831>

22 months agovenus: check against the Vulkan type rather than type index.
Dawn Han [Wed, 30 Nov 2022 19:02:40 +0000 (19:02 +0000)]
venus: check against the Vulkan type rather than type index.

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20064>

22 months agovenus: fix deqp tests failed on iub descriptor type
Dawn Han [Tue, 29 Nov 2022 23:31:34 +0000 (23:31 +0000)]
venus: fix deqp tests failed on iub descriptor type

Fixes: abae9d4831b ("Add the iub binding count tracking")

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20064>

22 months agoradv: fix guardband if the polygon mode is points or lines
Samuel Pitoiset [Wed, 30 Nov 2022 07:05:36 +0000 (08:05 +0100)]
radv: fix guardband if the polygon mode is points or lines

If points or lines are drawn using the polygon mode, the guardband
should be adjusted for large points/lines.

Cc: 22.3 mesa-stable
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/20185>

22 months agotu: Destroy disk_cache during tu_physical_device_finish
Mark Collins [Tue, 6 Dec 2022 09:09:25 +0000 (09:09 +0000)]
tu: Destroy disk_cache during tu_physical_device_finish

While running VK-CTS with valgrind, the application hit the max
thread count of 500. After further investigation, this was due to
multiple instances being created with the disk cache spinning up
worker threads which wouldn't be cleaned as disk_cache_destroy
wasn't being called.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20178>

22 months agomesa: Add missing dep on generated marshal header in the tests build.
Emma Anholt [Mon, 5 Dec 2022 20:52:51 +0000 (12:52 -0800)]
mesa: Add missing dep on generated marshal header in the tests build.

We lost the race in a recent MR of mine.

Fixes: 381e0b43d617 ("mesa: Add test to prevent windows.h to be included in shared headers")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20170>

22 months agoir3: Disallow `noperspective` texture preloads
Mark Collins [Fri, 18 Nov 2022 07:48:14 +0000 (07:48 +0000)]
ir3: Disallow `noperspective` texture preloads

The `coord_offset` pass is responsible for upgrading any eligible
texture loads into prefetches, but a texture prefetch's capabilities
are limited and cannot handle any interpolation modes aside from
`smooth`.

An exception is carved out for `flat` interpolation modes, but this
doesn't exclude upgrading `noperspective` texture loads and results
in perspective-corrected samples being provided that can severely
break applications depending on this behaviour.

Fixes incorrect lighting projection on Super Mario Odyssey on
Skyline Emulator.

Fixes incorrect dirt texture mapping on Portal 2 trace on Turnip and
Zink on Turnip.

Fixes incorrect lighter shadowing on Half Life 2 trace on Turnip.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19842>

22 months agoir3: Propagate `coord_offset` result from `alu` src insts
Mark Collins [Mon, 28 Nov 2022 08:35:32 +0000 (08:35 +0000)]
ir3: Propagate `coord_offset` result from `alu` src insts

`coord_offset` is called on the source of `alu` instructions and
it returns -1 for failures, this not explicitly checked for and
as a result the fetch can incorrectly be upgraded to a prefetch
when it isn't appropriate to do so.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19842>

22 months agoturnip: Initialize *memory on 0-sized alloc early exit.
Emma Anholt [Mon, 5 Dec 2022 22:52:07 +0000 (14:52 -0800)]
turnip: Initialize *memory on 0-sized alloc early exit.

Otherwise, making a CS using the memory will use the uninitialized .map
value (when checking the size of the CS in in begin's tu_cs_is_empty()
check), causing valgrind noise in
dEQP-VK.binding_model.descriptorset_random.sets4.dynindexed.ubolimitlow.sbolimitlow.sampledimghigh.lowimgsingletex.iublimitlow.nouab.vert.noia.0
(thanks to vi_info->vertexBindingDescriptionCount==0).

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

22 months agointel/compiler/mesh: align payload size to the size of vec4
Marcin Ślusarz [Mon, 5 Dec 2022 11:27:38 +0000 (12:27 +0100)]
intel/compiler/mesh: align payload size to the size of vec4

This reduces the number of instructions in task shaders when payload
size is not aligned to vec4 and payload_in_shared WA is enabled,
because nir_lower_task_shader will not need to handle the unaligned
size case.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20080>

22 months agonir/lower_task_shader: fix task payload corruption when shared memory workaround...
Marcin Ślusarz [Wed, 30 Nov 2022 12:47:19 +0000 (13:47 +0100)]
nir/lower_task_shader: fix task payload corruption when shared memory workaround is enabled

We were not taking into account that when all invocations within workgroup
are active, we'll copy more data than needed, corrupting task payload
of other workgroups.

Fixes: 8aff8d3dd42 ("nir: Add common task shader lowering to make the backend's job easier.")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20080>

22 months agoaco: apply NUW to additions for scratch access
Rhys Perry [Thu, 1 Dec 2022 18:04:49 +0000 (18:04 +0000)]
aco: apply NUW to additions for scratch access

fossil-db (navi21):
Totals from 52 (0.04% of 135636) affected shaders:
Instrs: 79036 -> 78567 (-0.59%)
CodeSize: 431188 -> 427984 (-0.74%)
Latency: 1318142 -> 1313821 (-0.33%)
InvThroughput: 293842 -> 292836 (-0.34%)
VClause: 2555 -> 2361 (-7.59%); split: -8.06%, +0.47%
Copies: 8746 -> 8767 (+0.24%); split: -0.11%, +0.35%

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

22 months agoaco: more carefully apply constant offsets into scratch accesses
Rhys Perry [Thu, 1 Dec 2022 15:05:49 +0000 (15:05 +0000)]
aco: more carefully apply constant offsets into scratch accesses

Death stranding does scratch_arr[80-idx]. This doesn't seem to work if we
try to combine the subtraction into the access.

fossil-db (navi21):
Totals from 52 (0.04% of 135636) affected shaders:
Instrs: 78560 -> 79036 (+0.61%)
CodeSize: 427940 -> 431188 (+0.76%)
Latency: 1313809 -> 1318142 (+0.33%)
InvThroughput: 292833 -> 293842 (+0.34%)
VClause: 2361 -> 2555 (+8.22%); split: -0.51%, +8.73%
Copies: 8767 -> 8746 (-0.24%); split: -0.35%, +0.11%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 0e783d687a3 ("aco: use scratch_* for scratch load/store on GFX9+")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7735
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20117>

22 months agoradv/rt: set additions for scratch access as NUW
Rhys Perry [Thu, 1 Dec 2022 20:26:52 +0000 (20:26 +0000)]
radv/rt: set additions for scratch access as NUW

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

22 months agonir/range_analysis: unsigned upper bound analysis for b2i
Rhys Perry [Thu, 1 Dec 2022 20:22:16 +0000 (20:22 +0000)]
nir/range_analysis: unsigned upper bound analysis for b2i

fossil-db (navi21):
Totals from 93 (0.07% of 135636) affected shaders:
Instrs: 133949 -> 133899 (-0.04%); split: -0.05%, +0.01%
CodeSize: 708124 -> 707528 (-0.08%); split: -0.09%, +0.01%
Latency: 2451564 -> 2450158 (-0.06%); split: -0.06%, +0.00%
InvThroughput: 398282 -> 397345 (-0.24%)
SClause: 4441 -> 4437 (-0.09%); split: -0.18%, +0.09%
Copies: 7578 -> 7546 (-0.42%); split: -0.55%, +0.13%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20117>

22 months agoci/freedreno: temporarily disable godot-trive on zink+freedreno
David Heidelberg [Tue, 6 Dec 2022 12:25:43 +0000 (13:25 +0100)]
ci/freedreno: temporarily disable godot-trive on zink+freedreno

Test if this trace impact surrounding traces causing rendering changes.

Ref: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7732

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20179>

22 months agoac/llvm: set invariant.load on image loads with ACCESS_CAN_REORDER
Marek Olšák [Sun, 4 Dec 2022 11:32:19 +0000 (06:32 -0500)]
ac/llvm: set invariant.load on image loads with ACCESS_CAN_REORDER

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>

22 months agoac/llvm: inline ac_get_load_intr_attribs
Marek Olšák [Sun, 4 Dec 2022 11:25:55 +0000 (06:25 -0500)]
ac/llvm: inline ac_get_load_intr_attribs

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>

22 months agoac/llvm: rename attribute enums
Marek Olšák [Sun, 4 Dec 2022 11:19:56 +0000 (06:19 -0500)]
ac/llvm: rename attribute enums

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>

22 months agoac/llvm: use invariant.load metadata on load intrinsics instead of readnone
Marek Olšák [Sun, 4 Dec 2022 11:14:10 +0000 (06:14 -0500)]
ac/llvm: use invariant.load metadata on load intrinsics instead of readnone

readnone is illegal now and we should be using invariant.load since LLVM 15.
(suggested by Nicolai)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>

22 months agoac/llvm: don't set "readnone" on non-memory intrinsics
Marek Olšák [Sun, 4 Dec 2022 11:00:15 +0000 (06:00 -0500)]
ac/llvm: don't set "readnone" on non-memory intrinsics

It's illegal and LLVM always knows which intrinsics don't read memory.
This started failing IR validation with LLVM 16.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>

22 months agoac/llvm: don't set "convergent" on intrinsics where it's automatic
Marek Olšák [Sun, 4 Dec 2022 10:22:48 +0000 (05:22 -0500)]
ac/llvm: don't set "convergent" on intrinsics where it's automatic

LLVM adds the flag automatically.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>