platform/upstream/mesa.git
11 months agonouveau/mme: Break the Turing builder guts into a separate header
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Break the Turing builder guts into a separate header

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

11 months agonouveau/mme: Make helpers less Turing specific
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Make helpers less Turing specific

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

11 months agonouveau/mme: Use mme_mov() for temp copies of register IMM32 sources
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Use mme_mov() for temp copies of register IMM32 sources

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

11 months agonouveau/mme: Add an intermediate MME_CMP_OP enum
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Add an intermediate MME_CMP_OP enum

Having everything go through the Turing opcodes isn't a good long-term
plan so add an intermediate which is independent of HW generation.

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

11 months agonouveau/mme: Add an intermediate MME_ALU_OP enum
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Add an intermediate MME_ALU_OP enum

Having everything go through the Turing opcodes isn't a good long-term
plan so add an intermediate which is independent of HW generation.

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

11 months agonouveau/mme: Add a mme_reg_alloc struct
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Add a mme_reg_alloc struct

This has some nice asserts which we'll want when we start having
reserved registers on Fermi.

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

11 months agonouveau/mme: Move mme_value into its own header
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Move mme_value into its own header

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

11 months agonvk: Implement VK_EXT_image_view_min_lod
Rebecca Mckeever [Wed, 21 Dec 2022 19:01:04 +0000 (13:01 -0600)]
nvk: Implement VK_EXT_image_view_min_lod

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/40

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/nil: Add macros for ufixed
Rebecca Mckeever [Thu, 22 Dec 2022 00:03:52 +0000 (18:03 -0600)]
nouveau/nil: Add macros for ufixed

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/mme: Make alu_op_to_str static
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Make alu_op_to_str static

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

11 months agonouveau/mme: Invoke SET_OBJECT in the tests
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Invoke SET_OBJECT in the tests

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

11 months agonouveau/nil: Use nv_device_info for format queries
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/nil: Use nv_device_info for format queries

There's no reason why any of this needs access to the fd or the context.

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

11 months agonouveau/nil: Take an nv_device_info for image functions
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/nil: Take an nv_device_info for image functions

There's no reason why any of this needs access to the fd or the context.

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

11 months agonouveau/winsys: Move device type into nv_device_info
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/winsys: Move device type into nv_device_info

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

11 months agonouveau/winsys: Add an info to nouveau_ws_device
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/winsys: Add an info to nouveau_ws_device

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

11 months agonouveau/winsys: Take a drmDevicePtr in nouveau_ws_device_new()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/winsys: Take a drmDevicePtr in nouveau_ws_device_new()

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

11 months agonvk: Implement VK_EXT_non_seamless_cube_map
Rebecca Mckeever [Wed, 4 Jan 2023 23:17:24 +0000 (15:17 -0800)]
nvk: Implement VK_EXT_non_seamless_cube_map

Add new bit to VkSamplerCreateFlags and then advertise
VK_EXT_non_seamless_cube_map.

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/42

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Enable shadow sampling
Rebecca Mckeever [Wed, 4 Jan 2023 23:16:55 +0000 (15:16 -0800)]
nvk: Enable shadow sampling

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise EXT_4444_formats
Rebecca Mckeever [Fri, 9 Dec 2022 21:25:48 +0000 (15:25 -0600)]
nvk: Advertise EXT_4444_formats

The following tests now pass:

dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.nearest
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.linear
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.nearest_mipmap_nearest
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.linear_mipmap_nearest
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.nearest_mipmap_linear
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.linear_mipmap_linear

The corresponding tests for a4r4g4b4_unorm are still passing.

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/36

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add A4B4G4R4 formats to nil_format_info table
Rebecca Mckeever [Fri, 9 Dec 2022 21:06:27 +0000 (15:06 -0600)]
nvk: Add A4B4G4R4 formats to nil_format_info table

The nil_format_info table contains the following lines, which add
A4R4G4B4 formats.

   C4(A, B4G4R4A4_UNORM,   NONE,       B, G, R, A, UNORM,   A4B4G4R4,   T),
   F3(A, B4G4R4X4_UNORM,   NONE,       B, G, R, x, UNORM,   A4B4G4R4,   T),

Add similar lines to the nil_format_info table for A4B4G4R4 formats.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add VK_FORMAT_B4G4R4A4_UNORM_PACK16 format to nil_format_info table
Rebecca Mckeever [Fri, 9 Dec 2022 21:12:50 +0000 (15:12 -0600)]
nvk: Add VK_FORMAT_B4G4R4A4_UNORM_PACK16 format to nil_format_info table

The following tests now pass:

dEQP-VK.pipeline.monolithic.sampler.view_type.2d_unnormalized.format.b4g4r4a4_unorm_pack16.*

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise KHR_device_group
Rebecca Mckeever [Fri, 9 Dec 2022 22:35:30 +0000 (16:35 -0600)]
nvk: Advertise KHR_device_group

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/35

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement nvk_CmdDispatchBase and delete nvk_CmdDispatch
Rebecca Mckeever [Fri, 9 Dec 2022 22:33:41 +0000 (16:33 -0600)]
nvk: Implement nvk_CmdDispatchBase and delete nvk_CmdDispatch

Implement nvk_CmdDispatchBase() and then delete nvk_CmdDispatch() so that
the vk_common verion with be used instead. This will avoid repeated code.
Update nvk_CmdDispatchIndirect() so that it sets the three base_group
fields of the root descriptor table to 0.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Lower base_workgroup_id
Rebecca Mckeever [Fri, 9 Dec 2022 22:32:57 +0000 (16:32 -0600)]
nvk: Lower base_workgroup_id

Lower load_base_workgroup_id intrinsics to a load_ubo using NIR.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add base_group to root descriptor table
Rebecca Mckeever [Fri, 9 Dec 2022 22:31:42 +0000 (16:31 -0600)]
nvk: Add base_group to root descriptor table

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Set maxMemoryAllocationCount
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Set maxMemoryAllocationCount

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

11 months agonvk: call correct macro to clear views
Thomas H.P. Andersen [Tue, 22 Nov 2022 23:29:26 +0000 (00:29 +0100)]
nvk: call correct macro to clear views

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

11 months agonvk: fix maxPushDescriptors
Thomas H.P. Andersen [Thu, 24 Nov 2022 23:52:31 +0000 (00:52 +0100)]
nvk: fix maxPushDescriptors

maxPushDescriptors was advertised as 0.

Spotted with Sascha Willems pushdescriptors example

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

11 months agonvk: Add a helper for loading resource_index-based descriptors
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Add a helper for loading resource_index-based descriptors

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

11 months agonvk: Drop block_size from the root descriptor table
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Drop block_size from the root descriptor table

It's unused because Vulkan doesn't support compute dispatches with an
unknown workgroup size.  If we ever do, we can add it back in. In case
it ever comes back, add an unreachable() to nvk_nir_lower_descriptors().

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

11 months agonvk: Lower load_num_workgroups ourselves
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Lower load_num_workgroups ourselves

Instead of relying on the back-end to put it at a magic offset in a
magic constant buffer, lower it in NIR.

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

11 months agonvk: Rename grid_size to group_count
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Rename grid_size to group_count

That's the Vulkan name for it.

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

11 months agonvk: Capitalize NVK in user exposed strings
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Capitalize NVK in user exposed strings

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

11 months agonvk: expose KHR_driver_properties
Yusuf Khan [Tue, 8 Nov 2022 07:19:08 +0000 (01:19 -0600)]
nvk: expose KHR_driver_properties

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise VK_EXT_separate_stencil_usage
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Advertise VK_EXT_separate_stencil_usage

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

11 months agonvk: Advertise EXT_index_type_uint8
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Advertise EXT_index_type_uint8

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

11 months agonvk: Advertise KHR_uniform_buffer_standard_layout
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Advertise KHR_uniform_buffer_standard_layout

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

11 months agonvk: Enable KHR_dynamic_rendering
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Enable KHR_dynamic_rendering

We've been dynamic rendering since day 1

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

11 months agonvk: Advertise VK_KHR_bind_memory2
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Advertise VK_KHR_bind_memory2

We already use the entrypoint (via the 1.0 wrappers); we just need to
turn on the extension.

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

11 months agonvk: Advertise samplerMirrorClampToEdge via 1.2 features
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Advertise samplerMirrorClampToEdge via 1.2 features

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

11 months agonvk: Enable VK_EXT_provoking_vertex
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Enable VK_EXT_provoking_vertex

We already have it plumbed through.  Just need to turn it on.

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

11 months agonvk: Enable inheritedQueries
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Enable inheritedQueries

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

11 months agonvk: Re-order Vulkan 1.0 feature bits
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Re-order Vulkan 1.0 feature bits

Also, leave TODO comments for anything we want to enable but haven't.

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

11 months agonvk: Convert system values for gl_PointCoord and PointCoord into inputs
Rebecca Mckeever [Tue, 22 Nov 2022 00:45:01 +0000 (18:45 -0600)]
nvk: Convert system values for gl_PointCoord and PointCoord into inputs

Currently, any attempt to use gl_PointCoord (GLSL) or PointCoord (SPIR-V)
results in an assert in codegen:

ERROR: unknown nir_intrinsic_op load_point_coord

This patch addresses the error by converting nir_intrinsic_load_point_coord
system value into VARYING_SLOT_PNTC. The following tests now pass:

dEQP-VK.glsl.builtin_var.simple.pointcoord
dEQP-VK.glsl.builtin_var.simple.pointcoord_uniform_frag
dEQP-VK.glsl.builtin_var.simple.pointcoord_uniform_vert

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/33
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use nvk_buffer_addr_range for buffer descriptors
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Use nvk_buffer_addr_range for buffer descriptors

Because the helper checks for buffer == NULL, this should prepare us for
VK_KHR_robustness2 where we need to handle null descriptors.

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

11 months agonvk: Add an nvk_buffer_addr_range helper
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Add an nvk_buffer_addr_range helper

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

11 months agonvk: Fix a comment
Faith Ekstrand [Tue, 31 Jan 2023 02:12:04 +0000 (20:12 -0600)]
nvk: Fix a comment

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

11 months agonvk: Support large points
George Ouzounoudis [Sun, 13 Nov 2022 10:43:02 +0000 (12:43 +0200)]
nvk: Support large points

We just need to enable the shader attribute.  With point sprite
rasterization we get correct results on rasterization and draw tests.

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

11 months agonvk: Switch point rasterization to point sprites
George Ouzounoudis [Sun, 13 Nov 2022 10:35:09 +0000 (12:35 +0200)]
nvk: Switch point rasterization to point sprites

It seems for Vulkan we always need square points with shader PointCoords
just like OpenGL point sprites.

From vulkan spec's point rasterization:
"Point rasterization produces a fragment for each fragment area group of
framebuffer pixels with one or more sample points that intersect a region
centered at the point’s (xf,yf).
This region is a square with side equal to the current point size.
... (xf,yf) is the exact, unrounded framebuffer coordinate of the vertex
for the point"

From OpenGL compatibility spec:
Basic point rasterization:
"If point sprites are enabled, then point rasterization produces a
fragment for each framebuffer pixel whose center lies inside a square
centered at the point’s (xw, yw), with side length equal to the current
point size.
... and xw and yw are the exact, unrounded window coordinates of the
vertex for the point"

Also in OpenGL multisampling leads to circle points as we see in the spec:
Point multisample rasterization:
"This region is a circle having diameter equal to the current point width
if POINT_SPRITE is disabled, or a square with side equal to the current
point width if POINT_SPRITE is enabled."

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

11 months agonvk: Lower image_size to txs
Faith Ekstrand [Fri, 28 Jul 2023 15:37:16 +0000 (10:37 -0500)]
nvk: Lower image_size to txs

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

11 months agonvk: wire up M2MF for Fermi
Karol Herbst [Sat, 10 Sep 2022 22:38:34 +0000 (00:38 +0200)]
nvk: wire up M2MF for Fermi

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: allocate VAB memory area
Karol Herbst [Sat, 10 Sep 2022 20:44:24 +0000 (22:44 +0200)]
nvk: allocate VAB memory area

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk/device: fix order of error handling
Karol Herbst [Thu, 22 Sep 2022 18:27:23 +0000 (20:27 +0200)]
nvk/device: fix order of error handling

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: support pre Maxwell Texture Headers
Karol Herbst [Sat, 10 Sep 2022 16:00:01 +0000 (18:00 +0200)]
nvk: support pre Maxwell Texture Headers

GM10x seems to disable it by default, so enable them there.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: bind more subchans in init_context_state
Karol Herbst [Sat, 10 Sep 2022 15:47:44 +0000 (17:47 +0200)]
nvk: bind more subchans in init_context_state

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: reduce pitch for FillBuffer
Karol Herbst [Sat, 10 Sep 2022 01:40:21 +0000 (03:40 +0200)]
nvk: reduce pitch for FillBuffer

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: use remaps for image copies
Karol Herbst [Fri, 9 Sep 2022 23:17:16 +0000 (01:17 +0200)]
nvk: use remaps for image copies

This helps us to get around hardware limitations on the width.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: properly align slm size
Karol Herbst [Fri, 9 Sep 2022 16:46:58 +0000 (18:46 +0200)]
nvk: properly align slm size

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use SET_PIPELINE_PROGRAM pre-Volta
Karol Herbst [Sun, 28 Aug 2022 21:26:03 +0000 (23:26 +0200)]
nvk: Use SET_PIPELINE_PROGRAM pre-Volta

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: align desc root table
Karol Herbst [Mon, 29 Aug 2022 00:31:19 +0000 (02:31 +0200)]
nvk: align desc root table

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: rework QMD handling to support pre Turing
Karol Herbst [Sun, 28 Aug 2022 18:08:09 +0000 (20:08 +0200)]
nvk: rework QMD handling to support pre Turing

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: properly align shaders pre Turing
Karol Herbst [Thu, 8 Sep 2022 14:49:53 +0000 (16:49 +0200)]
nvk: properly align shaders pre Turing

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: fix some class version checks
Karol Herbst [Sun, 28 Aug 2022 15:44:19 +0000 (17:44 +0200)]
nvk: fix some class version checks

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise EXT_vertex_attribute_divisor
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Advertise EXT_vertex_attribute_divisor

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

11 months agonvk: advertise EXT_image_2d_view_of_3d
Thomas H.P. Andersen [Thu, 10 Nov 2022 22:39:26 +0000 (23:39 +0100)]
nvk: advertise EXT_image_2d_view_of_3d

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

11 months agonvk: add check for VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT
Thomas H.P. Andersen [Thu, 10 Nov 2022 22:38:07 +0000 (23:38 +0100)]
nvk: add check for VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT

The tests in dEQP-VK.pipeline.*.image_2d_view_3d_image.* set this
bit and nil was not checking for it

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

11 months agonvk: Support base instance in instanced draw calls
George Ouzounoudis [Fri, 4 Nov 2022 20:28:17 +0000 (22:28 +0200)]
nvk: Support base instance in instanced draw calls

Vulkan's gl_InstanceIndex is different than OpenGL gl_InstanceID.
For nvk, gl_InstanceIndex is lowered as gl_BaseInstance + gl_InstanceID in nir
code. This means we need to supply base instance to the vertex shader.
We load the value at mme draw time to a root constant, as it seems there
is no existing system value corresponding to this info.

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

11 months agonvk: Set base vertex state in sequential mme draw
George Ouzounoudis [Wed, 9 Nov 2022 18:28:39 +0000 (20:28 +0200)]
nvk: Set base vertex state in sequential mme draw

We need to set base vertex state to zero before emitting a sequential
draw call, if we have already emitted an indexed draw call that changed
that state.

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

11 months agonvk: Add a macro for root descriptor table byte offsets
George Ouzounoudis [Wed, 9 Nov 2022 18:13:26 +0000 (20:13 +0200)]
nvk: Add a macro for root descriptor table byte offsets

Use a helper macro instead of using offsetof directly.

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

11 months agonvk: Do not increment instance id across draws
George Ouzounoudis [Wed, 9 Nov 2022 17:50:32 +0000 (19:50 +0200)]
nvk: Do not increment instance id across draws

In cases of multiple draws (i.e. indirect draws) instance id should not
increment across draw boundaries. Use a local copy of "begin" to modify
the instance id inside the instances loop only.

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

11 months agonvk: Add a devenv ICD json file
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Add a devenv ICD json file

This also reworks the ICD generation stuff based on the radv header

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

11 months agonvk: Support VK_FORMAT_B10G11R11_UFLOAT_PACK32 for vertex buffers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Support VK_FORMAT_B10G11R11_UFLOAT_PACK32 for vertex buffers

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

11 months agonvk: fix multiple pipelines failure allocation case.
Dave Airlie [Fri, 4 Nov 2022 03:37:58 +0000 (13:37 +1000)]
nvk: fix multiple pipelines failure allocation case.

Fixes these failures:
dEQP-VK.api.object_management.alloc_callback_fail_multiple*

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

11 months agonvk/format: Style fix for VkFormatProperties3KHR
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk/format: Style fix for VkFormatProperties3KHR

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

11 months agonvk: Add a bo size to nvk_descriptor_set
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Add a bo size to nvk_descriptor_set

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

11 months agonvk: Assert that descriptor buffer access stays in-bounds
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Assert that descriptor buffer access stays in-bounds

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

11 months agonvk: Advertise VK_KHR_depth_stencil_resolve
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Advertise VK_KHR_depth_stencil_resolve

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

11 months agonvk: Advertise MSAA via image format properties
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Advertise MSAA via image format properties

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

11 months agonvk: Stop advertising higher framebufferNoAttachmentsSampleCounts
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Stop advertising higher framebufferNoAttachmentsSampleCounts

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

11 months agonvk: Replace gl_SamplePosition with fract(gl_FragCoord.xy)
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Replace gl_SamplePosition with fract(gl_FragCoord.xy)

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

11 months agonvk: Use meta for MSAA resolves
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Use meta for MSAA resolves

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

11 months agonvk/meta: Fix restore for descriptor set 0
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk/meta: Fix restore for descriptor set 0

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

11 months agovulkan/meta: Add support for MSAA resolves
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
vulkan/meta: Add support for MSAA resolves

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

11 months agovulkan/meta: Rename vk_meta_blit.c to vk_meta_blit_resolve.c
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
vulkan/meta: Rename vk_meta_blit.c to vk_meta_blit_resolve.c

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

11 months agovulkan/meta: Support writing stencil as iterative discard
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
vulkan/meta: Support writing stencil as iterative discard

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

11 months agovulkan/meta: Break the guts of blit into a helper
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
vulkan/meta: Break the guts of blit into a helper

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

11 months agovulkan/meta: Add a helper for building texture ops
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
vulkan/meta: Add a helper for building texture ops

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

11 months agovulkan/meta: Bind whole LODs of 3D blit destinations
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
vulkan/meta: Bind whole LODs of 3D blit destinations

Instead of only binding the layers we need, bind the whole LOD.  In
particular, we now set a layer range of [0, 1] when creating the image
view but a layerCount of minify(depth, level) in VkRenderingInfo.  While
still a bit out of spec, this is more in line with how 3D image views
typically work for sampled and storage images and allows us to avoid
creating 2D images views which would require 2D_ARRAY_COMPATIBLE_BIT.

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

11 months agonvk: Fill out sample locations on Maxwell B+
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Fill out sample locations on Maxwell B+

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

11 months agonvk: Stop creating a new upload BO every time
Faith Ekstrand [Tue, 31 Jan 2023 02:12:03 +0000 (20:12 -0600)]
nvk: Stop creating a new upload BO every time

We intended this optimization for the case where we're uploading more
data than we had in the previous upload BO.  If there is no previous
upload BO, we always want to set it to the new one.

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

11 months agonvk: Set correct multisample regs for graphics pipelines
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nvk: Set correct multisample regs for graphics pipelines

This adds SAMPLE_MASK_*, ANTI_ALIAS_CONTROL, and drops ANTI_ALIAS which
we set in BeginRendering().

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

11 months agonvk: Pass through a shader key for fragment shaders and MSAA
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nvk: Pass through a shader key for fragment shaders and MSAA

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

11 months agonvk: Use the right view format for stencil texturing
Faith Ekstrand [Thu, 3 Aug 2023 20:54:09 +0000 (15:54 -0500)]
nvk: Use the right view format for stencil texturing

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

11 months agonvk: Support copies of MSAA images
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nvk: Support copies of MSAA images

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

11 months agonvk: Handle multisampled render targets properly
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nvk: Handle multisampled render targets properly

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

11 months agonvk: Handle zero color attachments better
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nvk: Handle zero color attachments better

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

11 months agonvk: Stop asserting on MSAA
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nvk: Stop asserting on MSAA

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

11 months agonouveau/parser: Handle SET_ANTI_ALIAS_SAMPLE_POSITIONS
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nouveau/parser: Handle SET_ANTI_ALIAS_SAMPLE_POSITIONS

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

11 months agonouveau/parser: Sort METHOD_ARRAY_SIZES
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nouveau/parser: Sort METHOD_ARRAY_SIZES

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

11 months agonil: Add an offset4d struct and some helpers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nil: Add an offset4d struct and some helpers

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