platform/upstream/mesa.git
2 years agomicrosoft/clc: Add a unit test for unused image kernel args
Jesse Natalie [Mon, 27 Jun 2022 04:09:07 +0000 (21:09 -0700)]
microsoft/clc: Add a unit test for unused image kernel args

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17246>

2 years agomicrosoft/clc: Remove dead image vars
Jesse Natalie [Mon, 27 Jun 2022 04:08:56 +0000 (21:08 -0700)]
microsoft/clc: Remove dead image vars

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17246>

2 years agomicrosoft/clc: Fix test double free in the case of compilation failure
Jesse Natalie [Mon, 27 Jun 2022 03:58:24 +0000 (20:58 -0700)]
microsoft/clc: Fix test double free in the case of compilation failure

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17246>

2 years agomicrosoft/clc: Enable tests that pass on server 2022
Jesse Natalie [Mon, 27 Jun 2022 03:58:02 +0000 (20:58 -0700)]
microsoft/clc: Enable tests that pass on server 2022

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17246>

2 years agoutil/disk_cache: Implement disk_cache_get_function_identifier for Windows
Jesse Natalie [Thu, 23 Jun 2022 14:31:10 +0000 (07:31 -0700)]
util/disk_cache: Implement disk_cache_get_function_identifier for Windows

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17208>

2 years agointel/clc: enable fp16 & subgroups for GRL
Lionel Landwerlin [Mon, 27 Jun 2022 10:13:14 +0000 (13:13 +0300)]
intel/clc: enable fp16 & subgroups for GRL

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17253>

2 years agoclc: add new feature options for intel_clc
Lionel Landwerlin [Mon, 27 Jun 2022 10:12:46 +0000 (13:12 +0300)]
clc: add new feature options for intel_clc

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17253>

2 years agoradv: vectorize nir_op_fabs
Daniel Schürmann [Thu, 7 Oct 2021 18:20:23 +0000 (20:20 +0200)]
radv: vectorize nir_op_fabs

Totals from 4 (0.00% of 134913) affected shaders: (GFX10.3)
CodeSize: 37868 -> 36576 (-3.41%)
Instrs: 5332 -> 5169 (-3.06%)
Latency: 24452 -> 24174 (-1.14%)
InvThroughput: 9784 -> 9462 (-3.29%)
VClause: 54 -> 50 (-7.41%)
Copies: 520 -> 519 (-0.19%)
PreVGPRs: 266 -> 264 (-0.75%)

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15176>

2 years agoradv: vectorize nir_op_fdiv & nir_op_flrp & nir_op_ineg
Daniel Schürmann [Tue, 10 Aug 2021 16:06:58 +0000 (18:06 +0200)]
radv: vectorize nir_op_fdiv & nir_op_flrp & nir_op_ineg

These instructions are lowered to fmul/isub.
So, prevent scalarization.

Totals from 49 (0.04% of 134913) affected shaders: (GFX10.3)
VGPRs: 2576 -> 2568 (-0.31%)
SpillVGPRs: 1145 -> 1132 (-1.14%); split: -2.10%, +0.96%
CodeSize: 663968 -> 659376 (-0.69%); split: -1.08%, +0.38%
Scratch: 113664 -> 112640 (-0.90%)
Instrs: 110274 -> 109683 (-0.54%); split: -0.81%, +0.27%
Latency: 2904434 -> 2869588 (-1.20%); split: -1.64%, +0.44%
InvThroughput: 1414237 -> 1396600 (-1.25%); split: -1.69%, +0.44%
VClause: 2899 -> 2891 (-0.28%); split: -0.93%, +0.66%
SClause: 1520 -> 1537 (+1.12%); split: -0.07%, +1.18%
Copies: 28829 -> 28662 (-0.58%); split: -1.90%, +1.32%
Branches: 3560 -> 3564 (+0.11%)
PreVGPRs: 2550 -> 2427 (-4.82%)

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15176>

2 years agoradv: use callback for nir_lower_to_scalar
Daniel Schürmann [Tue, 6 Jul 2021 17:09:51 +0000 (19:09 +0200)]
radv: use callback for nir_lower_to_scalar

Now uses nir_lower_alu_width.
This avoids scalarization and re-vectorization of 16bit instructions.

Totals from 289 (0.21% of 134913) affected shaders: (GFX10.3)
VGPRs: 12864 -> 13072 (+1.62%); split: -0.50%, +2.11%
SpillSGPRs: 609 -> 505 (-17.08%)
SpillVGPRs: 946 -> 1145 (+21.04%)
CodeSize: 2537024 -> 2576976 (+1.57%); split: -0.10%, +1.67%
Scratch: 89088 -> 113664 (+27.59%)
MaxWaves: 7150 -> 7134 (-0.22%)
Instrs: 458352 -> 460830 (+0.54%); split: -0.45%, +0.99%
Latency: 6615279 -> 6844092 (+3.46%); split: -0.08%, +3.54%
InvThroughput: 1929504 -> 2044989 (+5.99%); split: -0.22%, +6.21%
VClause: 7186 -> 7338 (+2.12%); split: -0.08%, +2.20%
SClause: 13144 -> 13116 (-0.21%)
Copies: 46152 -> 50127 (+8.61%); split: -0.11%, +8.73%
Branches: 16530 -> 16572 (+0.25%); split: -0.02%, +0.27%
PreSGPRs: 14903 -> 14905 (+0.01%); split: -0.01%, +0.03%
PreVGPRs: 11806 -> 11730 (-0.64%); split: -1.83%, +1.19%

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15176>

2 years agoradv: don't lower vectorized instructions to 32bit
Daniel Schürmann [Mon, 27 Jun 2022 12:49:49 +0000 (14:49 +0200)]
radv: don't lower vectorized instructions to 32bit

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15176>

2 years agoaco: correctly validate v_fma_mixhi_f16 register assignment
Daniel Schürmann [Wed, 1 Jun 2022 15:16:55 +0000 (17:16 +0200)]
aco: correctly validate v_fma_mixhi_f16 register assignment

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15176>

2 years agoanv: disable injection of primitive shading rate for mesh
Marcin Ślusarz [Fri, 6 May 2022 12:38:43 +0000 (14:38 +0200)]
anv: disable injection of primitive shading rate for mesh

It's not needed and causes issues for mesh code (it doesn't
mark the output as per-primitive, which confuses brw_compute_mue_map)

Fixes many tests matching:
dEQP-VK.fragment_shading_rate.dynamic_rendering.*.ms

Fixes: 1542ab70eb4 ("anv: handle primitive shading rate for mesh")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16196>

2 years agointel/compiler: adjust task payload offsets as late as possible
Marcin Ślusarz [Mon, 23 May 2022 15:09:33 +0000 (17:09 +0200)]
intel/compiler: adjust task payload offsets as late as possible

Otherwise passes which expect offsets to be in bytes (like
brw_nir_lower_mem_access_bit_sizes, called from brw_postprocess_nir)
may produce incorrect results.

Fixes 64-bit load/stores in task/mesh shaders.

Fixes: c36ae42e4cc ("intel/compiler: Use nir_var_mem_task_payload")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16196>

2 years agointel/common: allocate space for at least one task urb
Marcin Ślusarz [Fri, 6 May 2022 14:37:27 +0000 (16:37 +0200)]
intel/common: allocate space for at least one task urb

Fixes: c93cbc77f78 ("intel/common: Add helper for URB allocation in Mesh pipeline")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16196>

2 years agoc11: reinstate the original license and authorship
Emil Velikov [Fri, 24 Jun 2022 12:36:44 +0000 (13:36 +0100)]
c11: reinstate the original license and authorship

The original code that was copied in was Boost licensed, so keep that
in. Since Yonggang Luo has code quite some work, keep their copyright
alongside the original one.

Fixes: b2ddec4e98f ("c11: Implement c11/time.h with c11/impl/time.c")
Fixes: e6392fcf3d8 ("c11: Move the implementation of threads.h into c source code")
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17232>

2 years agointel/blorp: Dirty depth bounds dynamic state bits after blorp
Sviatoslav Peleshko [Fri, 24 Jun 2022 07:43:09 +0000 (10:43 +0300)]
intel/blorp: Dirty depth bounds dynamic state bits after blorp

Blorp emits its own 3DSTATE_DEPTH_BOUNDS, so we'll have to re-emit the
expected state after that.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Fixes: 56ef501e3aa4 ("blorp: disable depth bounds")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17205>

2 years agoanv: Dirty all dynamic state bits when creating command buffer state
Sviatoslav Peleshko [Thu, 23 Jun 2022 11:20:24 +0000 (14:20 +0300)]
anv: Dirty all dynamic state bits when creating command buffer state

This makes sure that we'll handle situations when the new state has
the same value as the default one, so we won't dirty some bits, and
consequently will not emit necessary commands (e.g. 3DSTATE_DEPTH_BOUNDS).

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Fixes: 48229d11 ("anv: don't emit 3DSTATE_DEPTH_BOUNDS in pipeline batch")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6722
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17205>

2 years agointel: fix typos found by codespell
Marcin Ślusarz [Wed, 22 Jun 2022 16:31:08 +0000 (18:31 +0200)]
intel: fix typos found by codespell

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17191>

2 years agodzn: Enable the depthClamp feature
Boris Brezillon [Fri, 24 Jun 2022 15:42:34 +0000 (08:42 -0700)]
dzn: Enable the depthClamp feature

depthClampEnable is actually the case we support properly.

!depthClampEnable requires extra work to make sure the
depth clamping that's forced by D3D12 is inactive (setting the
viewport depth range to [0,1] and dealing with the actual range
at the shader level), and clamp the depth value read by the
fragment shader in that case. This will be addressed separately.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17231>

2 years agodzn: Enable shader{Clip,Cull}Distance
Boris Brezillon [Fri, 24 Jun 2022 11:28:09 +0000 (04:28 -0700)]
dzn: Enable shader{Clip,Cull}Distance

DXIL has clip/cull distance builtins too.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17231>

2 years agodzn: Enable dynamic indexing on all kind of descriptors
Boris Brezillon [Fri, 24 Jun 2022 11:24:42 +0000 (04:24 -0700)]
dzn: Enable dynamic indexing on all kind of descriptors

nir_to_dxil() supports it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17231>

2 years agodzn: Advertise shaderImageGatherExtended support
Boris Brezillon [Fri, 24 Jun 2022 11:04:46 +0000 (04:04 -0700)]
dzn: Advertise shaderImageGatherExtended support

nir_to_dxil() takes tg4 offsets into account.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17231>

2 years agodzn: Advertise anisotropic filtering support
Boris Brezillon [Fri, 24 Jun 2022 10:51:01 +0000 (03:51 -0700)]
dzn: Advertise anisotropic filtering support

We support it already, let's toggle the switch to expose it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17231>

2 years agonir/serialize: Put dest last in packed_instr::tex
Boris Brezillon [Thu, 23 Jun 2022 16:53:31 +0000 (18:53 +0200)]
nir/serialize: Put dest last in packed_instr::tex

packed_instr::tex::dest must be last to match the packed_instr::any::dest
position.

Fixes: 35655865cbde ("nir/serialize: pack instructions better")
Cc: stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17212>

2 years agoanv: silence border color swizzle debug message
Lionel Landwerlin [Sun, 26 Jun 2022 06:36:36 +0000 (09:36 +0300)]
anv: silence border color swizzle debug message

   MESA-INTEL: debug: gfx11_CreateSampler: ignored VkStructureType 1000411001

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17245>

2 years agoradv: dump UMR waves before UMR rings
Samuel Pitoiset [Wed, 22 Jun 2022 08:34:34 +0000 (10:34 +0200)]
radv: dump UMR waves before UMR rings

Dumping UMR rings might be slow and dumping waves before would make it
more chance to dump them without reporting "No active waves".

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

2 years agoradv: fix command line for dumping waves with UMR
Samuel Pitoiset [Wed, 22 Jun 2022 08:34:01 +0000 (10:34 +0200)]
radv: fix command line for dumping waves with UMR

GFXOFF must be disabled before dumping waves and re-enabled after.

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

2 years agoradv: use RADEON_FLAG_VA_UNCACHED for the trace BO
Samuel Pitoiset [Wed, 22 Jun 2022 07:38:24 +0000 (09:38 +0200)]
radv: use RADEON_FLAG_VA_UNCACHED for the trace BO

Figured this while debugging a GPU hang with a simple CTS test. This
is to make sure data written by the CP are coherent on the CPU.

This also explains spurious GPU hang reports generated for Hitman 3
that made no sense without it. Now it's clear that this game hangs
after a DRAW_INDEX_INDIRECT packet.

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

2 years agoradv: disable small primitive culling for user sample locations
Samuel Pitoiset [Fri, 24 Jun 2022 08:11:51 +0000 (10:11 +0200)]
radv: disable small primitive culling for user sample locations

The driver can't assume sample positions at (0.5, 0.5) when user
sample locations are used.

This doesn't fix anything in practice because NGGC is only enabled by
default on GFX10.3 and that extension is currently disabled on GFX10+,
but I would like to expose it at some point.

This fixes dEQP-VK.pipeline.*.sample_locations_ext.verify_location.*
(when the extension is enabled locally).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17228>

2 years agov3dv: Implement VK_KHR_performance_query
Ella Stanforth [Tue, 23 Nov 2021 22:29:48 +0000 (22:29 +0000)]
v3dv: Implement VK_KHR_performance_query

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14061>

2 years agoci: Revert "CI: Lima farm is offline"
Erico Nunes [Thu, 23 Jun 2022 15:15:39 +0000 (17:15 +0200)]
ci: Revert "CI: Lima farm is offline"

The lab is up and running again.

This reverts commit 686e20afcd32cb80b96984c8eb4428e777fbce97.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17240>

2 years agoradeonsi: replace llvm gs input handle with nir lowering
Qiang Yu [Mon, 30 May 2022 12:09:49 +0000 (20:09 +0800)]
radeonsi: replace llvm gs input handle with nir lowering

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoac/llvm: get back nir_intrinsic_load_gs_vertex_offset_amd
Qiang Yu [Mon, 30 May 2022 11:49:55 +0000 (19:49 +0800)]
ac/llvm: get back nir_intrinsic_load_gs_vertex_offset_amd

Will be used by radeonsi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoac/nir: add triangle_strip_adjacency_fix to gs input lower
Qiang Yu [Mon, 30 May 2022 11:46:15 +0000 (19:46 +0800)]
ac/nir: add triangle_strip_adjacency_fix to gs input lower

From radeonsi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoradeonsi: replace llvm es output with nir lowering
Qiang Yu [Mon, 30 May 2022 07:03:40 +0000 (15:03 +0800)]
radeonsi: replace llvm es output with nir lowering

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoac/nir: change es output lower param to esgs_itemsize
Qiang Yu [Tue, 31 May 2022 06:18:17 +0000 (14:18 +0800)]
ac/nir: change es output lower param to esgs_itemsize

radeonsi may add extra dword to the stride, so let's pass it
directly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoac/nir: remove unused param num_reserved_es_outputs from gs input lower
Qiang Yu [Mon, 30 May 2022 12:06:03 +0000 (20:06 +0800)]
ac/nir: remove unused param num_reserved_es_outputs from gs input lower

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoradeonsi: set lds for gs/es to handle nir shared memory load/store
Qiang Yu [Tue, 31 May 2022 02:35:28 +0000 (10:35 +0800)]
radeonsi: set lds for gs/es to handle nir shared memory load/store

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoac/nir: skip gl_ViewportIndex and gl_Layer write in ES
Qiang Yu [Mon, 30 May 2022 06:52:57 +0000 (14:52 +0800)]
ac/nir: skip gl_ViewportIndex and gl_Layer write in ES

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoradeonsi: implement two esgs ring nir intrinsic
Qiang Yu [Mon, 30 May 2022 06:41:08 +0000 (14:41 +0800)]
radeonsi: implement two esgs ring nir intrinsic

nir_intrinsic_load_ring_esgs_amd
nir_intrinsic_load_ring_es2gs_offset_amd

Will be used by esgs lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoac/llvm: fix code format alignment in visit_load_local_invocation_index
Qiang Yu [Mon, 30 May 2022 06:28:32 +0000 (14:28 +0800)]
ac/llvm: fix code format alignment in visit_load_local_invocation_index

Used tab instead of space.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16788>

2 years agoradeonsi: replace llvm tes input load with nir lowering
Qiang Yu [Sat, 28 May 2022 14:23:40 +0000 (22:23 +0800)]
radeonsi: replace llvm tes input load with nir lowering

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

2 years agoradeonsi: set uses_vmem_load_other for nir_intrinsic_load_buffer_amd
Qiang Yu [Sat, 28 May 2022 14:20:08 +0000 (22:20 +0800)]
radeonsi: set uses_vmem_load_other for nir_intrinsic_load_buffer_amd

Before lower TES load input to load buffer, mark this flag for this
intrinsic, otherwise we get corruption with GFX10 after the lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoradeonsi: enable PIPE_CAP_GLSL_TESS_LEVELS_AS_INPUTS
Qiang Yu [Sat, 28 May 2022 10:09:56 +0000 (18:09 +0800)]
radeonsi: enable PIPE_CAP_GLSL_TESS_LEVELS_AS_INPUTS

This can remove special handling of tessfactors which also benifit
the nir lower pass which does not handle these as system value.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoradeonsi: replace llvm tcs output with nir lower pass
Qiang Yu [Sat, 28 May 2022 09:52:35 +0000 (17:52 +0800)]
radeonsi: replace llvm tcs output with nir lower pass

Remove the store_tcs_outputs abi, we can use common output abi
to handle the tessfactor pass as vgpr.

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

2 years agoac/nir: add no_input_lds_space param to hs output lower
Qiang Yu [Wed, 1 Jun 2022 09:13:00 +0000 (17:13 +0800)]
ac/nir: add no_input_lds_space param to hs output lower

This is used by radeonsi to save some lds space when all LS output
is passed by register.

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

2 years agoac/llvm: handle write mask for nir_intrinsic_store_buffer_amd
Qiang Yu [Wed, 25 May 2022 11:35:15 +0000 (19:35 +0800)]
ac/llvm: handle write mask for nir_intrinsic_store_buffer_amd

tess lowering may generate buffer store with partial write mask.

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

2 years agoradeonsi: implement nir_intrinsic_load_tess_rel_patch_id_amd for both tcs and tes
Qiang Yu [Tue, 24 May 2022 07:09:00 +0000 (15:09 +0800)]
radeonsi: implement nir_intrinsic_load_tess_rel_patch_id_amd for both tcs and tes

radv will lower this intrinsic before gets to llvm, so we just need to
implement it in radeonsi.

The tes version will be used in tess lower too.

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

2 years agoradeonsi: implement nir_intrinsic_load_ring_tess_offchip(_offset)_amd
Qiang Yu [Tue, 24 May 2022 06:43:36 +0000 (14:43 +0800)]
radeonsi: implement nir_intrinsic_load_ring_tess_offchip(_offset)_amd

Used by tess lower latter.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoradeonsi: preload tess offchip ring for tcs
Qiang Yu [Tue, 24 May 2022 06:40:05 +0000 (14:40 +0800)]
radeonsi: preload tess offchip ring for tcs

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

2 years agoac/nir: add wave_size parameter to ac_nir_lower_hs_outputs_to_mem
Qiang Yu [Fri, 27 May 2022 09:39:18 +0000 (17:39 +0800)]
ac/nir: add wave_size parameter to ac_nir_lower_hs_outputs_to_mem

Used by radeonsi and radv to reflect true wave size used, not minimal size.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoac/nir: add pass_tessfactors_by_reg param to hs output lower
Qiang Yu [Mon, 23 May 2022 12:27:55 +0000 (20:27 +0800)]
ac/nir: add pass_tessfactors_by_reg param to hs output lower

radeonsi won't emit tess factor in the lower pass, need to keep
the output for llvm backend to pass it as parameter. This is used
by radeonsi for an optimization to save LDS write.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoac/nir: use nir_intrinsic_load_hs_out_patch_data_offset_amd in tess lower
Qiang Yu [Mon, 23 May 2022 09:26:00 +0000 (17:26 +0800)]
ac/nir: use nir_intrinsic_load_hs_out_patch_data_offset_amd in tess lower

radeonsi load this from SGPR arg, can't use static value because TCS output
and TES input may not match (TCS output is not a key for TES) and
determined in runtime.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoac/nir: add nir_intrinsic_load_hs_out_patch_data_offset_amd
Qiang Yu [Mon, 23 May 2022 09:23:57 +0000 (17:23 +0800)]
ac/nir: add nir_intrinsic_load_hs_out_patch_data_offset_amd

Also add radv and radeonsi implementation. Will be used in tess lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoac/nir: remove unused parameter in tes input lower
Qiang Yu [Mon, 23 May 2022 08:25:15 +0000 (16:25 +0800)]
ac/nir: remove unused parameter in tes input lower

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoradeonsi: implement nir_intrinsic_load_tcs_num_patches_amd
Qiang Yu [Mon, 23 May 2022 06:42:06 +0000 (14:42 +0800)]
radeonsi: implement nir_intrinsic_load_tcs_num_patches_amd

Used by ac_nir_lower_tess_io_to_mem.c.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoradeonsi: replace llvm based fixed tcs with nir
Qiang Yu [Fri, 20 May 2022 09:27:27 +0000 (17:27 +0800)]
radeonsi: replace llvm based fixed tcs with nir

Create nir passthrough shader with explicit input/output and vertex
output count so that it can be handled by compiler same as user tcs.

The drawback is we create more si_shader_selector with different
input/output and vertex output count which was handled by compiler
backend before.

As fixed function tcs can be handled like user tcs, we don't need
the dedicated fixed_func_tcs_shader state either.

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

2 years agoradeonsi: add si_create_passthrough_tcs
Qiang Yu [Wed, 18 May 2022 09:12:58 +0000 (17:12 +0800)]
radeonsi: add si_create_passthrough_tcs

For replacing si_create_fixed_func_tcs.

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

2 years agoradeonsi: support multi stage shader state creation in nir shaderlib
Qiang Yu [Wed, 18 May 2022 08:57:17 +0000 (16:57 +0800)]
radeonsi: support multi stage shader state creation in nir shaderlib

For creating tcs passthrough shader.

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

2 years agoradeonsi: use si_shader as parameter in si_get_nir_shader
Qiang Yu [Fri, 27 May 2022 09:32:45 +0000 (17:32 +0800)]
radeonsi: use si_shader as parameter in si_get_nir_shader

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16705>

2 years agoradeonsi: deserialize nir binary in si_check_blend_dst_sampler_noop
Qiang Yu [Fri, 27 May 2022 09:24:41 +0000 (17:24 +0800)]
radeonsi: deserialize nir binary in si_check_blend_dst_sampler_noop

We can do this parse with original nir instead of shader key pass
applied nir in si_get_nir_shader.

This can free si_get_nir_shader to just use si_shader as parameter.

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

2 years agoradv: no need to do gs_alloc_req for newer chips in ngg vs/tes
Qiang Yu [Fri, 17 Jun 2022 07:36:08 +0000 (15:36 +0800)]
radv: no need to do gs_alloc_req for newer chips in ngg vs/tes

Copy from radeonsi.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17130>

2 years agoac/llvm: conditionally check wave id in gs sendmsg
Qiang Yu [Wed, 15 Jun 2022 02:34:51 +0000 (10:34 +0800)]
ac/llvm: conditionally check wave id in gs sendmsg

nir lowering already call this with wave id check, no need to
check inside ac_build_sendmsg_gs_alloc_req again.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17130>

2 years agoradv: Deal with derefs from opaque types in function parameters.
Bas Nieuwenhuizen [Mon, 13 Jun 2022 20:17:19 +0000 (22:17 +0200)]
radv: Deal with derefs from opaque types in function parameters.

Needs more copy propagation before nir_opt_derefs picks it up.

Note that the full general problem of opaque types stored in
intermediate variables is still open, but that seems like a whole
can of worms, and no sense to have gfxbench stay broken during the
time it takes to solve that.

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

2 years agoAndroid.mk: Intermediate output paths may already be absolute
Alessandro Astone [Sat, 18 Jun 2022 16:28:26 +0000 (18:28 +0200)]
Android.mk: Intermediate output paths may already be absolute

That is the case when OUT_DIR_COMMON_BASE is set.
Only prefix paths with AOSP_ABSOLUTE_PATH if they're relative.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16674>

2 years agoAndroid.mk: Generate the dummy source in local-generated-sources-dir
Alessandro Astone [Sat, 18 Jun 2022 16:16:09 +0000 (18:16 +0200)]
Android.mk: Generate the dummy source in local-generated-sources-dir

A source file cannot be otherwise referenced by absolute path.
That happens when OUT_DIR_COMMON_BASE is set.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16674>

2 years agoAndroid.mk: Make mesa3d-lib work with absolute path meson outputs
Alessandro Astone [Sat, 18 Jun 2022 16:10:34 +0000 (18:10 +0200)]
Android.mk: Make mesa3d-lib work with absolute path meson outputs

LOCAL_PREBUILT_MODULE_FILE is the only variable that allows
specifying the absolute path to a prebuilt.
That happens when OUT_DIR_COMMON_BASE is set.

Since it does not have multilib variants, define two separate
libraries for multilib

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16674>

2 years agoAndroid.mk: Cleanup mesa3d-lib
Alessandro Astone [Sat, 18 Jun 2022 14:20:37 +0000 (16:20 +0200)]
Android.mk: Cleanup mesa3d-lib

Properly cleanup variables before declaring a library.
Explicitly require library dependencies.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16674>

2 years agoiris: Update comment about 2GB dynamic state range
Kenneth Graunke [Thu, 23 Jun 2022 18:44:18 +0000 (11:44 -0700)]
iris: Update comment about 2GB dynamic state range

We tracked this down with the HW teams back in 2020 and there's now a
documented workaround.  Comments from the HW team say this applies all
the way through XeHP but we're not sure beyond that.

This is a bug that we hit but the Windows drivers didn't because Jason
decided to allocate our memory structures from the top end of the VMA
range explicitly to catch bugs like this, while Windows allocates from
zero and up, so they would need to allocate more than 2GB of dynamic
state before running into it.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4880
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17216>

2 years agovenus: support VK_KHR_copy_commands2
Ryan Neph [Thu, 23 Jun 2022 17:56:28 +0000 (10:56 -0700)]
venus: support VK_KHR_copy_commands2

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17226>

2 years agovenus: enable VK_EXT_image_view_min_lod
Ryan Neph [Fri, 24 Jun 2022 06:57:24 +0000 (23:57 -0700)]
venus: enable VK_EXT_image_view_min_lod

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17227>

2 years agovenus: update venus-protocol with VK_EXT_image_view_min_lod
Ryan Neph [Fri, 24 Jun 2022 06:31:29 +0000 (23:31 -0700)]
venus: update venus-protocol with VK_EXT_image_view_min_lod

Copy in auto-generated protocol bindings.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17227>

2 years agovulkan/render_pass: Support VkAttachmentSampleCountInfoAMD
Jason Ekstrand [Fri, 6 May 2022 19:53:03 +0000 (14:53 -0500)]
vulkan/render_pass: Support VkAttachmentSampleCountInfoAMD

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>

2 years agovulkan/render_pass: Allow for mixed sample counts
Jason Ekstrand [Wed, 25 May 2022 21:37:32 +0000 (16:37 -0500)]
vulkan/render_pass: Allow for mixed sample counts

RADV supports VK_AMD_mixed_attachment_samples which does exactly what it
sounds like.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>

2 years agovulkan/render_pass: Pass sample locations to barriers
Jason Ekstrand [Fri, 6 May 2022 23:14:26 +0000 (18:14 -0500)]
vulkan/render_pass: Pass sample locations to barriers

This is required for depth/stencil images created with
VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>

2 years agovulkan/render_pass: Use a special layout for self-dependencies
Jason Ekstrand [Thu, 12 May 2022 21:47:46 +0000 (16:47 -0500)]
vulkan/render_pass: Use a special layout for self-dependencies

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>

2 years agoanv: Use CmdBeginRendering for resumes in BeginCommandBuffer when possible
Jason Ekstrand [Tue, 31 May 2022 21:14:12 +0000 (16:14 -0500)]
anv: Use CmdBeginRendering for resumes in BeginCommandBuffer when possible

This lets us avoid the code duplication between BeginRendering and
BeginCommandBuffer and also lets us stop crawling core render pass
structs directly and instead focus on dynamic rendering concepts.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>

2 years agovulkan/render_pass: Add a better helper for render pass inheritance
Jason Ekstrand [Tue, 31 May 2022 20:53:51 +0000 (15:53 -0500)]
vulkan/render_pass: Add a better helper for render pass inheritance

Instead of making drivers dive into the render pass and framebuffer
themselves, provide a helper that constructs a VkRenderingInfo for a
render pass resume that they can use instead.  This should reduce code
duplication between driver implementations of BeginRendering and
BeginCommandBuffer.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16953>

2 years agozink: add a turnip driver workaround for EXT_depth_clip_enable
Mike Blumenkrantz [Fri, 24 Jun 2022 16:02:21 +0000 (12:02 -0400)]
zink: add a turnip driver workaround for EXT_depth_clip_enable

this is broken

ref #6732

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

2 years agozink: fix-ish depth clipping without VK_EXT_depth_clip_enable
Mike Blumenkrantz [Fri, 24 Jun 2022 16:01:06 +0000 (12:01 -0400)]
zink: fix-ish depth clipping without VK_EXT_depth_clip_enable

if this extension is unsupported, use the previous behavior and hope for the best

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

2 years agonir/opt_memcpy: Add another case for function_temp
Jason Ekstrand [Tue, 2 Mar 2021 03:25:11 +0000 (21:25 -0600)]
nir/opt_memcpy: Add another case for function_temp

Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> (1.5 years later)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13166>

2 years agonir: Add an options parameter to deref_instr_has_complex_use
Jason Ekstrand [Tue, 2 Mar 2021 03:22:06 +0000 (21:22 -0600)]
nir: Add an options parameter to deref_instr_has_complex_use

Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> (1.5 years later)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13166>

2 years agonir/opt_memcpy: lower copies to/from tightly packed types
Jason Ekstrand [Sat, 24 Oct 2020 21:48:16 +0000 (16:48 -0500)]
nir/opt_memcpy: lower copies to/from tightly packed types

v2: Add comment by Jason (Lionel)

Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> (1.5 years later)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13166>

2 years agozink: remove another zink/tu fail
Mike Blumenkrantz [Fri, 24 Jun 2022 18:15:06 +0000 (14:15 -0400)]
zink: remove another zink/tu fail

fixed in f1c1b9687e8d58b62df5bc563c784cffda325611

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

2 years agoci/dzn: Copy testlog.{css,xsl} to the result dir
Boris Brezillon [Fri, 24 Jun 2022 12:17:22 +0000 (05:17 -0700)]
ci/dzn: Copy testlog.{css,xsl} to the result dir

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17235>

2 years agomicrosoft/compiler: Fix emit_ubo_var()
Boris Brezillon [Fri, 24 Jun 2022 09:38:55 +0000 (02:38 -0700)]
microsoft/compiler: Fix emit_ubo_var()

get_dword_size() is misleading, its name implies it's returning
a size in dwords, but it's actually returning a size in bytes.
This led to a wrong size passed to emit_cbv(). Instead of fixing
get_dword_size(), let's inline the code in emit_ubo_var().

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17230>

2 years agodzn: Transition resource to RENDER_TARGET/DEPTH_WRITE before clears
Boris Brezillon [Tue, 26 Apr 2022 09:56:15 +0000 (02:56 -0700)]
dzn: Transition resource to RENDER_TARGET/DEPTH_WRITE before clears

When clear_attachment() is called, we must ensure the resource is
in the DEPTH_WRITE or RENDER_TARGET state.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17229>

2 years agodzn: Clamp depthBiasConstantFactor when doing the float -> int conversion
Boris Brezillon [Fri, 24 Jun 2022 15:12:16 +0000 (08:12 -0700)]
dzn: Clamp depthBiasConstantFactor when doing the float -> int conversion

If we don't do that, we might end up with an integer overflow/underflow.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17236>

2 years agodzn: Fix CmdPushConstants()
Boris Brezillon [Fri, 24 Jun 2022 13:15:03 +0000 (06:15 -0700)]
dzn: Fix CmdPushConstants()

The original offset value is overwritten in our first for(i: num_states)
iteration, messing up the compute push constant update if stageFlags
applies to both compute and graphics.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17233>

2 years agotu: Don't count 3d blits in QUERY_TYPE_PRIMITIVES_GENERATED
Danylo Piliaiev [Tue, 21 Jun 2022 10:08:54 +0000 (13:08 +0300)]
tu: Don't count 3d blits in QUERY_TYPE_PRIMITIVES_GENERATED

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17164>

2 years agotu: Use hw binning or sysmem with QUERY_TYPE_PRIMITIVES_GENERATED
Danylo Piliaiev [Tue, 21 Jun 2022 09:41:30 +0000 (12:41 +0300)]
tu: Use hw binning or sysmem with QUERY_TYPE_PRIMITIVES_GENERATED

Without hw binning in gmem primitives generated query result could be
multiplied by tile count, which is not expected by OpenGL users for
GL_PRIMITIVES_GENERATED.

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17164>

2 years agoaco: cleanup force-waitcnt output
Rhys Perry [Thu, 23 Jun 2022 15:30:17 +0000 (16:30 +0100)]
aco: cleanup force-waitcnt output

If we don't reset ctx.vm_cnt/gpr_map/etc, this will spam a lot of
s_waitcnt instructions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17207>

2 years agoCODEOWNERS: evelikov renamed to xexaxo
Yonggang Luo [Thu, 16 Jun 2022 02:26:58 +0000 (10:26 +0800)]
CODEOWNERS: evelikov renamed to xexaxo

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17072>

2 years agoCODEOWNERS: Update c11 code owners
Yonggang Luo [Wed, 15 Jun 2022 03:51:45 +0000 (11:51 +0800)]
CODEOWNERS: Update c11 code owners

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17072>

2 years agointel/blorp/gen6: Set BLEND_STATEChange only if emitting the blend state
Sviatoslav Peleshko [Mon, 20 Jun 2022 09:47:25 +0000 (12:47 +0300)]
intel/blorp/gen6: Set BLEND_STATEChange only if emitting the blend state

This change is pretty straightforward: if set this field when we don't emit
the blend state, then the garbage at offset=0 will be set as a blend state,
and this will cause artifacts until the proper blend state will be given.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6544
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6232

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17132>

2 years agopvr: Rename loop iterator variable.
Karmjit Mahil [Thu, 23 Jun 2022 09:30:45 +0000 (10:30 +0100)]
pvr: Rename loop iterator variable.

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

2 years agopvr: Fix off by 1 error in buffer_id for ubo pds program.
Karmjit Mahil [Tue, 17 May 2022 15:27:37 +0000 (16:27 +0100)]
pvr: Fix off by 1 error in buffer_id for ubo pds program.

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

2 years agopvr: Handle vdm degen_cull_enable.
Karmjit Mahil [Tue, 17 May 2022 08:52:02 +0000 (09:52 +0100)]
pvr: Handle vdm degen_cull_enable.

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

2 years agopvr: Fix physical device limits.
Karmjit Mahil [Thu, 9 Jun 2022 12:03:30 +0000 (13:03 +0100)]
pvr: Fix physical device limits.

This commit changes to the physical device limits which were
missed during the 1.17 transition.

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