Commit Graph

180310 Commits

Author SHA1 Message Date
Faith Ekstrand
5a80c2e89a meson: Pull in syn from crates.io
We don't have real crates.io support yet so this uses a hack where it
pulls wraps from my personal github.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
384f4448e1 nak: Get rid of meta instructions
They're mostly in the way at this point. Instead, make map_instrs return
a Vec<Instr>.  We can reaplace that with a None, One, Some enum type
later if we want.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
438c67c1cb nak: Use Instr::num_srcs/dsts() less
Instead use Iterator::enumerate() and is_empty().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
fafb72e2be HACK: Support old meson
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
44243c4741 nak: Lower 8 and 16-bit types
We can do some of these on some hardware but we'll lower them all for
now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
8f121036ea nak: Implement boolean logic ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
871bb59875 nak: Rework instruction encoding
Use a struct to store the temporary data and the SM number and over-all
reduce the amount of stuff we have to pass around.  Also, rename
everything from tu102 to sm75 which is a more apt description.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
5207d9e3a0 nak: Encode load/store correctly on SM80
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
5daff0876f nak: Plumb the SM through to nak::Shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
611ed96557 nvk: Pass an actual nak_compiler to nak_compile_shader()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
bf72e78e0a nak: Add nak_compiler_create/destroy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
c10aa56efb nak/meson: Use bindgen dependencies
These are new in meson 1.0 and lets us avoid all that manual include
directory mangling which was going to break one of these days anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
e69a30cecb nak: Rework ALU instruction encode
Instead of pulling sources from fixed locations in the instruction, take
a bunch of Option<&Ref> and let the individual encode func take care of
it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
0e755f9964 nak: Implement bcsel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
b3d6dafc7d nak: Implement integer comparisons
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
ac2a56f56f nak: Add support for instruction predicates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
de073a10e6 nak: Implement 32-bit logic ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
8cf12d6a3f nak: Add a pass for computing instruction dependencies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
93eb2f884a nak: Implement iadd and ishl
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
241caaf5ff nak: Add an instruction fuzzing tool
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
90d3fd10e1 nak: Zero out the .w component of descriptors
This saves us from having to constantly add it in as we compute
addresses.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
c212506771 nak: Implement load/store_global
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
c76331fb51 nak: Implement load_ubo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
62f5e65c80 nak: Implement load_sysval_nv as S2R
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
fb96aaf3fa nak: Lower system values to a new load_sysval_nak intrinsic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
481a29a912 nak: Header stuff
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
80376146ed nak: Encode program headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
50b1deefa7 nak: Add encoding for a few instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
83f8d6e2a7 nak: Add bitset infrastructure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
812255fc79 nak: Add a lowering pass for ZERO sources and destinations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
f694f1f8a8 nak: Add a lowering pass for VEC and SPLIT instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
d44b31f3bf nak: Add a trivial register allocator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
08eb906111 nak: Add a util library
Currently, all we do here is implement div_ceil() and next_multiple_of()
because these helpers are super useful but currently an experimental
Rust feature.  This should be a drop-in for the feature so we can delete
it once the feature stabilizes with little to no effect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
4e95cb908f nak: Add a dead-code pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
9769f19c7e nak: Add a copy-prop pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
5585f57c5c nak: Add initial translation from NIR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
a4a5fe2270 nak: Add Rust bindings for NIR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
771d9c8856 nak: Add the core IR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
62695614d7 nvk: Run shaders through NAK
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
79ff2d9a33 nak: Add initial stubs for rust code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
c778d39fa4 nak: Add a bunch of shader lowering code in NIR
The nifty thing about the way NVIDIA hardware does inputs and outputs is
that it maps really well to how we do them in NIR.  We can make the
driver_locations match exactly to the attribute address space.  For
fragment shader outputs, we make them register numbers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
1b70f39ef6 nak: Copy the optimization loop from Intel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
40f9327c8a nouveau: Add initial headers and meson for the new compoiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Jesse Natalie
9ef621ec2e d3d12: ARB_query_buffer_object and GL4.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
6384ccd1cd d3d12: Reference count queries in a batch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
9caea4c3e9 d3d12: Enable ARB_enhanced_layouts and ARB_texture_mirror_clamp_to_edge
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
707cdac7e7 d3d12: Fix GS variant I/O slot counts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
9fe88dd9b9 d3d12: Support enhanced layouts for VS inputs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
72341747f4 d3d12: Split dvec3 interpolatns into devc2 and double
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
1aa56d486c d3d12: Fix location_frac_mask bitfield size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00