rusticl/api: remove some repr(C)

The only part we strictly need repr(C) is in `CLObjectBase` and we already
didn't have it set for `Device` and it worked just fine.

We keep it on in `Platform` as this is a more hand rolled type and less
relevant.

With this we can make use of Rusts data layout which saves us some memory.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23573>
This commit is contained in:
Karol Herbst 2023-06-11 11:42:57 +02:00 committed by Marge Bot
parent 30559a399b
commit e7d336bb85
5 changed files with 0 additions and 6 deletions

View file

@ -33,7 +33,6 @@ struct EventMutState {
work: Option<EventSig>,
}
#[repr(C)]
pub struct Event {
pub base: CLObjectBase<CL_INVALID_EVENT>,
pub context: Arc<Context>,

View file

@ -331,7 +331,6 @@ impl KernelDevState {
}
}
#[repr(C)]
pub struct Kernel {
pub base: CLObjectBase<CL_INVALID_KERNEL>,
pub prog: Arc<Program>,

View file

@ -101,7 +101,6 @@ impl Mappings {
}
}
#[repr(C)]
pub struct Mem {
pub base: CLObjectBase<CL_INVALID_MEM_OBJECT>,
pub context: Arc<Context>,
@ -1237,7 +1236,6 @@ impl Drop for Mem {
}
}
#[repr(C)]
pub struct Sampler {
pub base: CLObjectBase<CL_INVALID_SAMPLER>,
pub context: Arc<Context>,

View file

@ -55,7 +55,6 @@ pub enum ProgramSourceType {
Il(spirv::SPIRVBin),
}
#[repr(C)]
pub struct Program {
pub base: CLObjectBase<CL_INVALID_PROGRAM>,
pub context: Arc<Context>,

View file

@ -14,7 +14,6 @@ use std::sync::Mutex;
use std::thread;
use std::thread::JoinHandle;
#[repr(C)]
pub struct Queue {
pub base: CLObjectBase<CL_INVALID_COMMAND_QUEUE>,
pub context: Arc<Context>,