aconstlink / natus

[Discontinued] Software Framework for Audio/Visual/Interactive Real-Time Applications
https://aconstlink.de
MIT License
0 stars 0 forks source link

Data buffer #319

Closed aconstlink closed 1 year ago

aconstlink commented 1 year ago

In nsl there is no way of accessing large amounts of data. This is already possible through the C++ API and when writing the platform shaders directly using TBOs, HLSL buffers and a texture(es3). Data buffer can only handle vec4 aligned data.

A possible implementation would be

// declare
data_buffer_t my_data ;

// access
vec4_t data_item = my_data[idx] ;

Accessing the data buffer the way used above requires to extend nsl by the [] operator specifically for the data buffer.

aconstlink commented 1 year ago

Accessing the data changed a bit. It is rather done like this fetch_data( buffer, idx ). This method of accessing the data just fit perfectly in what was already there instead of newly implementing the [] operator.