Skip to content

Conversation

jonascloud
Copy link

Renames arePointersLogical to shouldBlockPointerOps for clarity.
Adds capability check to allow pointer operations on .storage_buffer when the variable_pointers capability is enabled.

This is a minimal change that fixes the immediate issue. Once PR #24681 merges, this should be updated to use variable_pointers_storage_buffer instead of variable_pointers for more fine-grained control.

Fixes #25638

@alexrp
Copy link
Member

alexrp commented Oct 20, 2025

cc @alichraghi

Renames arePointersLogical to shouldBlockPointerOps for clarity
adds capability check to allow pointer ops on .storage_buffer when
variable_pointers capability is enabled.

Fixes ziglang#25638
.global, .physical_storage_buffer => false,
// Logical pointers that support operations with VariablePointers capability
.shared => !target.cpu.features.isEnabled(@intFromEnum(std.Target.spirv.Feature.variable_pointers)),
//TODO: .storage_buffer is enabled by variable_pointers_storage_buffer once PR #24681 merges.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't mention an unmerged PR in code. We will get a merge conflict anyway so no need to worry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SPIR-V: .storage_buffer address space incorrectly blocks pointer indexing

3 participants