If a given generation hasn't removed any methods, then the default case
can defer to the previous generation without changing the output at all.
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37475>
Note that this changes the output so it lists the method as being in the
class where it most recently changed rather than always in the class of
the running gpu. Personally, I find this more useful than the old
behavior.
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37475>
This makes it more clear since it's no longer baked into the Rust
codegen. The new one is also probably a little safer since it doesn't
blindly delete all parens.
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36849>
Some of the headers (video is a particularly egregious culprit) wrap
defined values in parens, even when they don't need to be. This changes
the parser to up-front strip all outer pairs of parens to get us down to
the original value.
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36641>
Newer generation copy headers (including Turing) have a few enums with
more than one enumerant having the same value. Skip these in the
printer and in the Rust bindings.
Cc: 25.2
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36251>
We detect whenever a method hasn't changed from one generation to the
next and just `pub use` the older generation's method struct and any
enum types associated. This keeps each mthd module independently usable
with all necessary types while reducing the number of unique Rust types
and associated trait implementations generated. This drops the size of
libnvidia_headers.rlib from 84 MiB to 22 MiB and will hopefully make
Rust code a little less expensive to build.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34136>
This adds proper Method and Field classes and uses them instead of
the pile of dictionaries we had before. This is probably faster and
definitely more readable. I've verified with cl9097.h that this makes
no differenct to the generated C or Rust besides whitespace.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34136>
This adds the infrastructure for the nvidia_headers crate. It currently
only has declarations for the texture headers but QMDs should be trivial
to add as well. The plan is to organize it as follows:
crate nvidia_headers {
mod cl9097 {
// Methods
mod tex {
// Texture defines
}
}
mod clc5c0 {
// Methods
mod qmd {
// QMD defines
}
}
}
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27397>