Dave Airlie
8017ac0e79
nvk: add some limits/features from binary driver.
...
These are just copied from nvidia vulkaninfo for my tu104.
I've left geom/tess stuff out for now.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Dave Airlie
ba2faab08c
nvk: fix depth emission ordering.
...
dEQP-VK.api.image_clearing.core.clear_depth_stencil_image.single_layer.x8_d24_unorm_pack32_200x180
was hitting
nouveau_push.h:233: nvk_push_val: Assertion `last_method == idx' failed.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Dave Airlie
871c587414
nvk: increase graphics cpu push buffer
...
dEQP-VK.pipeline.monolithic.image.suballocation.sampling_type.separate.view_type.1d.format.r8g8_uint.count_4.size.512x1
was hitting 98 dwords
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Dave Airlie
86b05c2750
nvk: fix pipeline pushbuf sizing
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8dff06aada
nvk: add linear image creation support.
...
the dEQP-VK.draw.* tests use a tiled + linear image and copy between
them.
This fixes the result gathering, not the actual result.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Dave Airlie
f28bf4407d
nvk: add initial 8/16 byte clears.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
3d77175f1d
nouveau: Fix pushbuf ref reset for user command buffers
...
Copy+paste error. Also, we should do the refs reset before potentialy
doing a full reset, otherwise the refs reset will assert.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
150cba46ba
nvk: Enable all the dynamic state features
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
0a9903f778
nvk: Stop using vk_cmd_set_dynamic_graphics_state in meta_end()
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
e1c665013b
nvk: Use vk_meta for CmdClearAttachments
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
4746099306
nvk: Expose a bind_vertex_buffer helper
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
b0d007e7de
nvk: Add an addr field to nvk_buffer
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
5b10446a9b
nvk: Add an attachment format even for secondaries
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
b07e2a1049
vulkan/meta: Add implementations of Clear*Image
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
6a25cba792
vulkan/meta: Implement start-of-rendering clears
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
daa4485ecf
vulkan/meta: Implement attachment clears
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
514c10344e
vulkan/meta: Add a concept of rect pipelines
...
Most hardware supports some sort of rectangle primitive. This adds a
new VK_PRIMITIVE_TOPOLOGY_RECT_LIST_MESA which will be used by the vast
majority of (if not all) meta commands. Drivers can key off of of this
to build pipelines differently and implement their own cmd_draw_rects
and cmd_draw_volume hooks or they can map it to TRIANGLE_LIST and use
the provided helpers.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8418d6c97a
vulkan/meta: Add an object tracking list
...
This will let us create objects which get held onto by the command
buffer until it's reset or destroyed.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
54366ea922
vulkan/meta: Add the start of a meta framework
...
For now, this just adds some basic object caching.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8c2f95e3e7
nvk: Color attachments clears via image clears
...
This is a bit of a hack but it's good enough for now.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8ce12f33e2
nvk: Implement vkCmdDraw()
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
83598f44a9
nvk: Graphics pipelines
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:57 +00:00
Faith Ekstrand
c9e28274cc
nouveau: Add CPU push buffers
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
8530c3c882
nvk: Implement push constants and descriptors for graphics
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
1e3e85056b
nvk: Emit dynamic graphics state
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
d98a7d0de5
nvk: Misc. additional state setup
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ff3e099a73
nvk: Add boilerplate for Begin/EndRendering
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
5ee481bf26
nil/format: Add helpers for render formats
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
617532b24e
nvk: Import 3D context init code from nouveau
...
We really should organize this better but at least we have it now.
This should pretty much be equivalent to what nouveau is doing on
screen/context create.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
7315650739
nvk: Add a nvk_cmd_buffer_device() helper
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
abb7f69520
nvk/shader: Populate headers for vertex and fragment shaders
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
8df9d16fb4
nvk/shader: Assign I/O locations and gather info
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
0b179da344
nvk: Make shader_upload take an nvk_device
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
61a91914df
nvk: Expose pipeline alloc/free functions
...
This will provide some commonality between graphics and compute.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ae0d8edc1d
nvk: Free pipeline shader BOs
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
c2f636861a
nvk: Add an nvk_shader_address helper
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
782d376363
nvk: Don't free the NIR in nvk_compile_nir
...
It's a layering violation and the NIR is currently leaked if we the
compile fails. It's better to make the caller clean up.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ffc6c3afaf
nvk: Switch to vk_pipeline_shader_stage_to_nir
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
65b1cc3adf
nvk: Split pipeline binding into helpers
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
db2cf498ce
nvk: Add graphics state to command buffers
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
0f203b2b44
nouveau: Generate 3D headers
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
b3531276c6
nouveau: Null terminate the debug flag list
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
4a22e24e98
nouveau/push: Make P_IMMD more versatile
...
It's now able to use either the immediate form or method form depending
on whether or not the value fits into 13 bits. We wrap the check with
__builtin_constant_p() so that this choice is compile-time determined
instead of runtime. I've verified with SET_CT_SELECT() that GCC is able
to determine which bits are used even if not all of them are constants.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ec0b9109b8
nouveau/parser: Handle arrays properly in P_IMMD()
...
We make a new macro VA_NVCLS_FOO which is either an array macro or a
regular macro and, either way, redirects to V_NVCLS_FOO. This lets us
unconditionally use VA_NVCLS_FOO in P_IMMD() and, if the caller hands in
a FOO(i), it will get unwrapped and mangled to produce to V_NVCLS_FOO.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
68403e5742
nouveau/parser: Better dump float data
...
For now, we only do something with floats when we dump. You still need
to use fui() when setting them.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
bbdd35f155
nouveau/parser: Properly dump most arrays used by 3D
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
76e30e64da
nouveau/parser: Fix an integer overflow and a typo
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Faith Ekstrand
a4b29aaa72
nvk: Init WSI after setting up supported_sync_types
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Karol Herbst
edfc84b4eb
nouveau/ws: allocate copy subchan as well
...
Starting with Ampere we have to do this. It is a safe thing for previous
gens to do.
Very old kernels might reject this, but too lazy to check.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00
Karol Herbst
25a91f9093
nouveau/ws: allocate 3D subchan
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:31:56 +00:00