rusticl/api: Use iterators in create_program_with_source
authorLingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Wed, 5 Oct 2022 17:43:22 +0000 (19:43 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 19 Oct 2022 23:32:50 +0000 (23:32 +0000)
commit4de48a5dd5841c141d173ef32fc405cd2b2eb7e7
tree5970827d58bc98124a48b8a529cc252049f91497
parent1e9e5618110542550b9f92dca8392f213bfd46b7
rusticl/api: Use iterators in create_program_with_source

This replaces several instances of unsafe pointer arithmetic and dereferencing with a single unsafe
creation of a slice, which we then use normal iterators on.
The spec mandates that a null pointer is to be interpreted as if a slice filled with zeros had been
given. That case is represented by an infinite iterator returning only zero.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
src/gallium/frontends/rusticl/api/program.rs