For graphics shaders? You aren’t.
The logical addressing model is described as this:
The Logical addressing model means pointers are abstract, having no physical size or numeric value. In this mode, pointers can only be created from existing objects, and they cannot be stored into an object, unless additional capabilities, e.g., VariablePointers , are declared to add such functionality.
You aren’t meant to be able to pass pointers to such things to different functions in logical addressing. Variable pointers allow specific exceptions, but only for StorageBuffers.
In logical addressing, pointers are a fiction that mainly exists to allow SPIR-V code for shaders and for OpenCL compute operations to share a lot of functionality. This also allows graphics shaders to gain more functionality over time without having to use a completely different language. This has advanced somewhat with variable pointers and the less restrictive PhysicalStorageBuffer64 addressing mode.
It’s also important to realize what UBOs conceptually represent. They’re not (supposed to be) pointers to memory. They’re static storage within the shader itself. Conceptually, the system uploads to the memory, it gets used during an invocation, and that’s it. You don’t get pointers to it.
That’s why something like PhysicalStorageBuffer64 doesn’t exist for UBOs; that’s not what they’re for.
So try to use variable pointers if you can.