18 #ifndef PIC_UTIL_GL_SSBO_HPP 19 #define PIC_UTIL_GL_SSBO_HPP 60 void init(
unsigned int size_buffer,
unsigned int size_of_type,
void *data)
62 total_size = size_buffer * size_of_type;
63 glGenBuffers(1, &ssbo);
64 glBindBuffer(GL_SHADER_STORAGE_BUFFER, posSSbo );
65 glBufferData(GL_SHADER_STORAGE_BUFFER, total_size, data, GL_DYNAMIC_COPY );
67 glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
74 void update(
void *data)
76 glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo);
77 GLvoid *p = glMapBuffer(GL_SHADER_STORAGE_BUFFER, GL_WRITE_ONLY);
78 memcpy(p, &data, total_size)
79 glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
82 void bind(
unsigned int index)
84 glBindBufferBase(GL_SHADER_STORAGE_BUFFER, index, ssbo);
87 void unbind(
unsigned int index)
89 glBindBufferBase(GL_SHADER_STORAGE_BUFFER, index, 0);
Definition: bilateral_separation.hpp:25