diff options
Diffstat (limited to 'src/shader/wrap')
-rw-r--r-- | src/shader/wrap/compute_shader.cc | 6 | ||||
-rw-r--r-- | src/shader/wrap/compute_shader.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/shader/wrap/compute_shader.cc b/src/shader/wrap/compute_shader.cc index ab5d4c4..54f50f8 100644 --- a/src/shader/wrap/compute_shader.cc +++ b/src/shader/wrap/compute_shader.cc @@ -46,10 +46,8 @@ GLuint ComputeShader::setUniform(const std::string& name, unsigned int value) co return id; } -void ComputeShader::workOn(GLuint bufferA, GLuint bufferB, GLuint bufferC) const { - glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, bufferA); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, bufferB); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, bufferC); +void ComputeShader::workOn(const std::vector<GLuint>& buffers) const { + glBindBuffersBase(GL_SHADER_STORAGE_BUFFER, 1, buffers.size(), buffers.data()); } void ComputeShader::dispatch(GLuint nX, GLuint nY) const { diff --git a/src/shader/wrap/compute_shader.h b/src/shader/wrap/compute_shader.h index 816b925..f2ab182 100644 --- a/src/shader/wrap/compute_shader.h +++ b/src/shader/wrap/compute_shader.h @@ -1,6 +1,7 @@ #pragma once #include <string> +#include <vector> #include <GL/glew.h> @@ -28,6 +29,7 @@ public: GLuint setUniform(const std::string& name, float x, float y) const; GLuint setUniform(const std::string& name, unsigned int value) const; - void workOn(GLuint bufferA, GLuint bufferB, GLuint bufferC) const; + void workOn(const std::vector<GLuint>& buffers) const; + void dispatch(GLuint nX, GLuint nY) const; }; |