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

Method load

crates/rustc_codegen_spirv/src/builder/builder_methods.rs:1098–1115  ·  view source on GitHub ↗
(&mut self, ty: Self::Type, ptr: Self::Value, _align: Align)

Source from the content-addressed store, hash-verified

1096 }
1097
1098 fn load(&mut self, ty: Self::Type, ptr: Self::Value, _align: Align) -> Self::Value {
1099 if let Some(value) = ptr.const_fold_load(self) {
1100 return value;
1101 }
1102 let ty = match self.lookup_type(ptr.ty) {
1103 SpirvType::Pointer { pointee } => {
1104 assert_ty_eq!(self, ty, pointee);
1105 pointee
1106 }
1107 ty => self.fatal(&format!(
1108 "load called on variable that wasn't a pointer: {ty:?}"
1109 )),
1110 };
1111 self.emit()
1112 .load(ty, None, ptr.def(self), None, empty())
1113 .unwrap()
1114 .with_type(ty)
1115 }
1116
1117 fn volatile_load(&mut self, ty: Self::Type, ptr: Self::Value) -> Self::Value {
1118 // TODO: Implement this

Callers 6

load_u32Method · 0.45
memset_dynamic_sizeMethod · 0.45
volatile_loadMethod · 0.45
load_operandMethod · 0.45
callMethod · 0.45

Calls 6

const_fold_loadMethod · 0.80
lookup_typeMethod · 0.80
fatalMethod · 0.80
with_typeMethod · 0.80
emitMethod · 0.45
defMethod · 0.45

Tested by

no test coverage detected