   int n_bits;
 };
 
+// access the ith bit in a packed bit vector
+bool access(layout(rgba32ui) readonly uimage1D raw, uint i) {
+  return (imageLoad(raw, int(i >> 7))[int(i >> 5) & 3] & (1 << int(i & 31))) != 0;
+}
+
+// access the ith bit in a poppy array
+bool access(poppy p, uint i) {
+  return access(p.raw, i);
+}
 
 // O(1) compute the non-inclusive prefix sum of the number of 1 bits in a poppy compact indexed dictionary.
 uint rank1(poppy p, uint i) {

#ifndef INCLUDED_SUCCINCT_GLSL
#define INCLUDED_SUCCINCT_GLSL

// --------------------------------------
// (pseudo)-succinct indexed dictionaries
// --------------------------------------

// [Space-Efficient, High-Performance Rank & Select Structures on Uncompressed Bit Sequences](https://www.cs.cmu.edu/~dga/papers/zhou-sea2013.pdf)
// by Zhou, Andersen, and Kaminsky, but modified to use texture loads, and remove L0.

  return i - rank1(p, i);
}


#endif