MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / create_const_alloc

Method create_const_alloc

crates/rustc_codegen_spirv/src/codegen_cx/constant.rs:385–400  ·  view source on GitHub ↗
(&self, alloc: ConstAllocation<'tcx>, ty: Word)

Source from the content-addressed store, hash-verified

383 }
384
385 pub fn create_const_alloc(&self, alloc: ConstAllocation<'tcx>, ty: Word) -> SpirvValue {
386 // println!(
387 // "Creating const alloc of type {} with {} bytes",
388 // self.debug_type(ty),
389 // alloc.len()
390 // );
391 let mut offset = Size::ZERO;
392 let result = self.create_const_alloc2(alloc, &mut offset, ty);
393 assert_eq!(
394 offset.bytes_usize(),
395 alloc.inner().len(),
396 "create_const_alloc must consume all bytes of an Allocation"
397 );
398 // println!("Done creating alloc of type {}", self.debug_type(ty));
399 result
400 }
401
402 fn create_const_alloc2(
403 &self,

Callers 3

scalar_to_backendMethod · 0.80
from_const_allocMethod · 0.80
codegen_staticMethod · 0.80

Calls 1

create_const_alloc2Method · 0.80

Tested by

no test coverage detected