Open
Description
Issue automatically imported from old repo: EmbarkStudios/rust-gpu#767
Old labels: t: enhancement,s: qptr may fix
Originally creatd by expenses on 2021-10-13T09:10:25Z
I started looking into how OpConvertUToPtr
can be implemented - initially for RuntimeArray
s. Something like this works well, but is not generic:
unsafe fn load_f32_runtime_array_from_handle(handle: u64) -> &'static mut RuntimeArray<f32> {
asm!(
"%f32 = OpTypeFloat 32",
"%runtime_array = OpTypeRuntimeArray %f32",
"%runtime_array_ptr = OpTypePointer Generic %runtime_array",
"%result = OpConvertUToPtr %runtime_array_ptr {handle}",
"OpReturnValue %result",
handle = in(reg) handle,
options(noreturn)
)
}
I know that @msiglreith implemented loading resources from handles in EmbarkStudios/rust-gpu@main...msiglreith:glace, but it looks like that requires a lot of codegen changes - ideally we should keep things at the asm!
layer if possible.
Is there a way to make the above function generic over T
, or will this require a few codegen changes?
Metadata
Metadata
Assignees
Labels
No labels