Skip to content

Commit 0fc8de0

Browse files
committed
Add back pointer to spec / docs about first GEP offset
1 parent f03fae5 commit 0fc8de0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
650650
// the index applied directly to `ptr`, effectively an offset multiplier based
651651
// on the size of `ty`. `indices` are the subsequent indices used to drill down
652652
// into fields or elements of `ty`.
653+
// https://llvm.org/docs/GetElementPtr.html
654+
// "An OpAccessChain instruction is the equivalent of an LLVM getelementptr instruction where the first index element is zero."
655+
// https://github.com/gpuweb/gpuweb/issues/33
653656
let (&ptr_base_index, indices) = combined_indices.split_first().unwrap();
654657

655658
// Determine if this GEP operation is effectively byte-level addressing.

0 commit comments

Comments
 (0)