platform/upstream/mesa.git
14 months agonvk: Implement VK_KHR_draw_indirect_count on Turing+
Thomas H.P. Andersen [Thu, 3 Nov 2022 22:30:53 +0000 (23:30 +0100)]
nvk: Implement VK_KHR_draw_indirect_count on Turing+

v2: handle maxDrawCount parameter
v3: assert on pre-turing. Free regsisters after use.
v4: less register presure. Update to pass new tests

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

14 months agonvk: add warning on non-nouveau drm driver
Thomas H.P. Andersen [Wed, 25 Jan 2023 21:53:15 +0000 (22:53 +0100)]
nvk: add warning on non-nouveau drm driver

Check that the drm kernel driver in use is nouveau, and
add a short description of the issue.

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

14 months agonvk: Return VK_ERROR_INCOMPATIBLE_DRIVER if the PCI vendor isn't NVIDIA
Faith Ekstrand [Tue, 28 Feb 2023 18:32:33 +0000 (12:32 -0600)]
nvk: Return VK_ERROR_INCOMPATIBLE_DRIVER if the PCI vendor isn't NVIDIA

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

14 months agonvk: Support VK_KHR_shader_draw_parameters
George Ouzounoudis [Sat, 5 Nov 2022 19:55:25 +0000 (21:55 +0200)]
nvk: Support VK_KHR_shader_draw_parameters

We need to supply the base vertex, the base instance and draw index to
the shader for this extension. Similar to the base instance we supported
before, we load base vertex and draw index as root constants at draw time.

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

14 months agonvk: Simplify mme build function argument
George Ouzounoudis [Thu, 26 Jan 2023 17:39:28 +0000 (19:39 +0200)]
nvk: Simplify mme build function argument

We do not need the full nvk_device struct for the mme builder functions,
just the nv_device_info is enough. We keep a pointer in the
mme_builder so we can use this instead. Also, when we run mme builder
tests we do not need to initialize a device struct.

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

14 months agonouveau/mme: Keep device info in mme_builder
George Ouzounoudis [Thu, 26 Jan 2023 17:36:53 +0000 (19:36 +0200)]
nouveau/mme: Keep device info in mme_builder

We keep a pointer to nv_device_info instead of just copying the GPU's
3D engine class.

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

14 months agonvk: Advertise VK_EXT_robustness2
Rebecca Mckeever [Mon, 23 Jan 2023 19:59:18 +0000 (11:59 -0800)]
nvk: Advertise VK_EXT_robustness2

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

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

14 months agonvk: Advertise VK_EXT_image_robustness
Rebecca Mckeever [Fri, 27 Jan 2023 06:06:28 +0000 (22:06 -0800)]
nvk: Advertise VK_EXT_image_robustness

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

14 months agonvk: Set image index to zero for NULL nvk_buffer_view
Rebecca Mckeever [Fri, 27 Jan 2023 19:47:34 +0000 (11:47 -0800)]
nvk: Set image index to zero for NULL nvk_buffer_view

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

14 months agonvk: Advertise VK_EXT_mutable_descriptor_type
Rebecca Mckeever [Fri, 13 Jan 2023 23:36:25 +0000 (15:36 -0800)]
nvk: Advertise VK_EXT_mutable_descriptor_type

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

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

14 months agonvk: Enable VK_KHR_maintenance3
Rebecca Mckeever [Fri, 20 Jan 2023 17:53:59 +0000 (09:53 -0800)]
nvk: Enable VK_KHR_maintenance3

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

14 months agonvk: Implement nvk_GetDescriptorSetLayoutSupport
Rebecca Mckeever [Sat, 14 Jan 2023 05:32:02 +0000 (21:32 -0800)]
nvk: Implement nvk_GetDescriptorSetLayoutSupport

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

14 months agonvk: Don't over-size push descriptor sets
Faith Ekstrand [Tue, 31 Jan 2023 02:12:07 +0000 (20:12 -0600)]
nvk: Don't over-size push descriptor sets

We were over-allocating them by 4x.

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

14 months agonvk: Replace asserts with conditional that sets type_list = NULL
Rebecca Mckeever [Sat, 14 Jan 2023 04:35:00 +0000 (20:35 -0800)]
nvk: Replace asserts with conditional that sets type_list = NULL

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

14 months agonvk: Update mutable descriptor struct type
Rebecca Mckeever [Fri, 13 Jan 2023 23:36:47 +0000 (15:36 -0800)]
nvk: Update mutable descriptor struct type

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

14 months agonouveau/mme: fix print inst for case MME_FERMI_OP_MERGE
Mauro Rossi [Sat, 14 Jan 2023 07:18:32 +0000 (08:18 +0100)]
nouveau/mme: fix print inst for case MME_FERMI_OP_MERGE

By applying the same coding style of the other case statements,
this patch fixes the following building errors:

../src/nouveau/mme/mme_fermi.c:209:10: error: expected expression
         uint32_t src_bit  = inst->bitfield.src_bit;
         ^
../src/nouveau/mme/mme_fermi.c:216:39: error: use of undeclared identifier 'src_bit'; did you mean 'dst_bit'?
         fprintf(fp, " (%u, %u, %u)", src_bit, size, dst_bit);
                                      ^~~~~~~
                                      dst_bit
../src/nouveau/mme/mme_fermi.c:211:19: note: 'dst_bit' declared here
         uint32_t dst_bit  = inst->bitfield.dst_bit;
                  ^
2 errors generated.

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

14 months agonouveau/mme: use fermi enum in fermi builder
Thomas H.P. Andersen [Sat, 14 Jan 2023 17:27:35 +0000 (18:27 +0100)]
nouveau/mme: use fermi enum in fermi builder

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

14 months agonvk: Add a build test for MMEs
Faith Ekstrand [Tue, 31 Jan 2023 02:12:07 +0000 (20:12 -0600)]
nvk: Add a build test for MMEs

This simple test compiles all the MMEs for Turing and Volta to ensure
that they build and don't run out of registers.  We could, in theory, do
actual unit testing here with gtest but just building is enough to
ensure that no one breaks driver start-up on hardware they don't own.
They can still break the driver functionally, of course, but at least
it'll initialize.

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

14 months agovulkan/meta: Use the new NIR texture helpers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:07 +0000 (20:12 -0600)]
vulkan/meta: Use the new NIR texture helpers

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

14 months agonvk: Implement Draw*Indirect on pre-Turing
Faith Ekstrand [Tue, 31 Jan 2023 02:12:07 +0000 (20:12 -0600)]
nvk: Implement Draw*Indirect on pre-Turing

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

14 months agonouveau/push: Add an NV_PUSH_MAX_COUNT #define
Faith Ekstrand [Tue, 31 Jan 2023 02:12:07 +0000 (20:12 -0600)]
nouveau/push: Add an NV_PUSH_MAX_COUNT #define

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

14 months agonvk: Reduce register pressure in nvk_mme_build_draw*()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:07 +0000 (20:12 -0600)]
nvk: Reduce register pressure in nvk_mme_build_draw*()

Re-order things a bit so we deal with vertex offset and first instance
separately and free those regs when we're done.

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

14 months agonouveau/mme: Don't allow WaW dependencies in the same Turing instruction
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: Don't allow WaW dependencies in the same Turing instruction

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

14 months agonvk: Make some MME builder names more consistent
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Make some MME builder names more consistent

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

14 months agonvk: Add a helper for pushing indirect data
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Add a helper for pushing indirect data

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

14 months agonvk: Rework nvk_cmd_push a bit
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Rework nvk_cmd_push a bit

Instead of taking an nvk_cmd_bo take a nouveau_ws_bo and keep the map
pointer separate.  We'll need to do this when we start pushing stuff
that isn't nvk_cmd_bo.  Also, rework the bounds to be in bytes.

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

14 months agonvk/drm: Take a byte offset/range in push_add_push
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk/drm: Take a byte offset/range in push_add_push

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

14 months agonouveau/mme: nouveau/mme: Add builder tests for SLL and SRL
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: nouveau/mme: Add builder tests for SLL and SRL

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

14 months agonouveau/mme: Use a uint32_t for size in mme_fermi_bfe()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: Use a uint32_t for size in mme_fermi_bfe()

It will never be a non-fixed value.

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

14 months agonouveau/mme: Add builder tests for SUB
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: Add builder tests for SUB

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

14 months agonouveau/mme: Add some generic builder tests
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: Add some generic builder tests

These don't need hardware and instead run entirely in the simulator.
The goal is to have something that we can run in CI and which ensures
consistency between the Turing and Fermi MMEs.

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

14 months agonouveau/mme: Unify some of the test framework
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: Unify some of the test framework

Most of the actual nouveau device enumeration and test running framework
was copy+paste between the two.

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

14 months agonouveau/mme: Take a const nv_device_info in mme_builder_init
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: Take a const nv_device_info in mme_builder_init

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

14 months agonouveau/mme: Don't swap x and y in mme_fermi_merge_to()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: Don't swap x and y in mme_fermi_merge_to()

This was probably an artifact of the fermi/turing merge.

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

14 months agonouveau/mme: Fix is_int18 for negative numbers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nouveau/mme: Fix is_int18 for negative numbers

util_mask_sign_extend returns a uint64_t which we need to cast to
uint32_t in order to get the right comparison.  Otherwise, we risk
having ~0 in the top 32 bits and the comparison failing.

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

14 months agonil: Only choose a PTE kind for tiled images
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nil: Only choose a PTE kind for tiled images

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

14 months agonvk: Report image alignments from NIL
Dave Airlie [Wed, 2 Nov 2022 06:52:28 +0000 (16:52 +1000)]
nvk: Report image alignments from NIL

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

14 months agonil: Fix image align and size constraints
Dave Airlie [Wed, 11 Jan 2023 18:03:31 +0000 (12:03 -0600)]
nil: Fix image align and size constraints

In order to use compressed images we have to align to at least (1<<16)
though the kernel also likes (1<<21).

This fixes the alignments/sizes so they can work with vm allocs

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

14 months agonvk: set the device fd
Dave Airlie [Wed, 2 Nov 2022 06:47:52 +0000 (16:47 +1000)]
nvk: set the device fd

This is needed later for syncobj support

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

14 months agonvk/winsys: store device ptr into bo instead of ptr
Dave Airlie [Mon, 31 Oct 2022 00:28:18 +0000 (10:28 +1000)]
nvk/winsys: store device ptr into bo instead of ptr

This will be needed later.

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

14 months agonvk: init dev->physical_device earlier.
Dave Airlie [Mon, 31 Oct 2022 04:54:14 +0000 (14:54 +1000)]
nvk: init dev->physical_device earlier.

When device is passed to bo destroy this is needed earlier.

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

14 months agonvk: Cosmetic clean-ups to Create/DestroyDevice
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Cosmetic clean-ups to Create/DestroyDevice

Use dev and pdev instead of device and physical_device.  Also, clean up
whitespace a bit while we're here.

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

14 months agonvk: Handle zero-size index and vertex buffers pre-Turing
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Handle zero-size index and vertex buffers pre-Turing

According to the nouveau GL driver, this should be the addres of the
last byte, not the byte after the end.  The calculation will overflow if
range is 0 so we need to handle that special.

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

14 months agonvk: Use a GS for layerered rendering pre-MaxwellB
Faith Ekstrand [Fri, 31 Mar 2023 16:48:29 +0000 (11:48 -0500)]
nvk: Use a GS for layerered rendering pre-MaxwellB

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

14 months agovulkan/meta: Insert a geometry shader when needed
Faith Ekstrand [Fri, 31 Mar 2023 16:44:09 +0000 (11:44 -0500)]
vulkan/meta: Insert a geometry shader when needed

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

14 months agonvk: Compile all NIR before running codegen
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Compile all NIR before running codegen

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

14 months agonvk: Compile geometry shaders
George Ouzounoudis [Tue, 18 Oct 2022 18:51:37 +0000 (21:51 +0300)]
nvk: Compile geometry shaders

This enables compiling geometry shaders.  Based primarily on gallium
nvc0/nvc0_program.c.

We need to enable/disable user clip planes based on the last geometry
stage.  Some asserts in codegen need to be changed too because the
compacted clip distance inputs are arrayed in the geometry shader. So we
have an array of clip distances for each input vertex.

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

14 months agonvk: Properly align root descriptor tables for pre-Pascal
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Properly align root descriptor tables for pre-Pascal

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

14 months agonvk: Free a couple regs in nvk_mme_build_draw_*()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Free a couple regs in nvk_mme_build_draw_*()

We don't need base_instance after we've set it the first time. We also
don't need to keep intance_count around forever.  mme_loop() always
consumes the value at the beginning so we can free up a register right
away.  Fermi is really tight on registers and this is enough to make
the basic draw MMEs successfully compile.

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

14 months agonvk: Disable indirect draw/dispatch and query copy MMEs for now
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Disable indirect draw/dispatch and query copy MMEs for now

These all rely on mme_tu104_read_fifoed() which isn't available before
Turing.  They're also really register-expensive and we can't compile
them without paring things down a bit.

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

14 months agonvk: Use a contiguous shader heap pre-Volta
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Use a contiguous shader heap pre-Volta

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

14 months agonvk: Add support for contiguous heaps to nvk_heap
Faith Ekstrand [Tue, 31 Jan 2023 02:12:06 +0000 (20:12 -0600)]
nvk: Add support for contiguous heaps to nvk_heap

This is required for shader heaps pre-Volta because they use a single
64-bit base address and 32-bit offsets for individual shaders.  In this
case, the addresses returned from the heap are relative to the base.
The BO for the heap can be retrieved via nvk_heap_get_contiguous_bo_ref
which returns an actual reference so it's safe to call from the queue
submit path.

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

14 months agonouveau/mme: Add Fermi hardware tests
Mary [Fri, 6 Jan 2023 00:17:59 +0000 (01:17 +0100)]
nouveau/mme: Add Fermi hardware tests

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

14 months agonouveau/mme: Add Fermi simulator
Mary [Fri, 6 Jan 2023 00:13:55 +0000 (01:13 +0100)]
nouveau/mme: Add Fermi simulator

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

14 months agoAdd add immediate optimizations
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
Add add immediate optimizations

Also, immediates are signed 18-bit values so modify the builder to
support the entire range.

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

14 months agoSupport immediates in MERGE
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
Support immediates in MERGE

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

14 months agonouveau/mme: Add Fermi builder
Mary [Thu, 5 Jan 2023 22:57:39 +0000 (23:57 +0100)]
nouveau/mme: Add Fermi builder

Co-Authored-By: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

14 months agonouveau/mme: Add initial Fermi definition
Mary [Thu, 5 Jan 2023 22:43:00 +0000 (23:43 +0100)]
nouveau/mme: Add initial Fermi definition

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

14 months agonouveau/mme: Take an nv_device_info in mme_builder_init
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Take an nv_device_info in mme_builder_init

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

14 months agonouveau/mme: Prepare the builder for multiple GPU generations
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Prepare the builder for multiple GPU generations

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

14 months agonouveau/mme: Move the cf_stack struct to mme_builder.h
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Move the cf_stack struct to mme_builder.h

Fermi wants exactly the same thing.

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

14 months agonouveau/mme: Drop the implicit_imm parameter from mme_alu_to()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Drop the implicit_imm parameter from mme_alu_to()

It's only used for control-flow and MERGE, all of which are special.

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

14 months agonouveau/mme: Move the guts of mme_state_arr_to() into mme_tu104_builder.c
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Move the guts of mme_state_arr_to() into mme_tu104_builder.c

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

14 months agonouveau/mme: Move the guts of mme_merge_to() into mme_tu104_builder.c
Faith Ekstrand [Tue, 31 Jan 2023 02:12:05 +0000 (20:12 -0600)]
nouveau/mme: Move the guts of mme_merge_to() into mme_tu104_builder.c

It's going to be a bit different on Fermi.

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

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>

14 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>