Buffer of Buffer IDs

Using the Buffer of Buffer IDs, can you get access to a buffer of TextureSamplers in your shader programs?

I was trying to do something as follows.

Buffer buffers = m_context->createBuffer ( RT_BUFFER_INPUT, RT_FORMAT_BUFFER_ID, N) ;
context["buffers"] -> set(buffers) ;
int* buffers_data = static_cast<int*>( buffers -> map() );
for ( int i = 0; i < N; ++i ){
  Buffer buffer = context->createBuffer ( RT_BUFFER_INPUT, RT_FORMAT_FLOAT , M ) ;
  float* buffer_data     = static_cast<float*>( buffer -> map() ) ;
  for ( int j = 0; j < M; ++j ){
    *buffer_data++ = /*float data*/ ;
  }
  TextureSampler sampler = context->createTextureSampler() ;
  sampler -> setWrapMode       (0, RT_WRAP_CLAMP_TO_EDGE);
  sampler -> setFilteringModes (RT_FILTER_LINEAR, RT_FILTER_LINEAR, RT_FILTER_NONE);
  sampler -> setIndexingMode   (RT_TEXTURE_INDEX_NORMALIZED_COORDINATES);
  sampler -> setReadMode       (RT_TEXTURE_READ_ELEMENT_TYPE);
  sampler -> setMaxAnisotropy  ( 1.0f );
  sampler -> setMipLevelCount  ( 1u );
  sampler -> setArraySize      (1);
  sampler -> setBuffer         (0, 0, buffer);
  *buffers_data++ = sampler -> getID() ;
}
buffers -> unmap()

SHADER PROGRAM

rtBuffer<rtBufferId<float,1>, 1>  buffers;
RT_PROGRAM void shader_program()
{
 .
 .
 // Was hoping it would work as such
 float value = tex1D( buffers[index], query_value ); 
}

I was hoping something along these lines would work. The textures I want to use are actually 3D textures which is why I am attempting to use the Buffer of Buffer ID’s. Any suggestions?

Found the solution. Buffer of Buffer IDs wasn’t what I wanted at all. Bindless Textures with rtTex1D was what I was looking for!

Yup. Also see this thread for ways to dynamically test if a bindless texture is present or not.
https://devtalk.nvidia.com/default/topic/1020023/tex2dgrad-exception-when-translating-ptx-to-llvm/

“The textures I want to use are actually 3D textures”
Why aren’t you just using 3D texture samplers then?

Thank you for the link Detlef!