aboutsummaryrefslogtreecommitdiff
path: root/src/shader
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-12-16 15:16:21 +0100
committerAdrian Kummerlaender2018-12-16 15:16:21 +0100
commit52cbbff72bd5516b5f325d1c88e4fcd8ca67f989 (patch)
tree2dcc47ca89aebe3e5fca68d7e0ef484af3085452 /src/shader
parent2eb7f9925315989735b4fb746cbd7bda6c9bd5bb (diff)
downloadcompustream-52cbbff72bd5516b5f325d1c88e4fcd8ca67f989.tar
compustream-52cbbff72bd5516b5f325d1c88e4fcd8ca67f989.tar.gz
compustream-52cbbff72bd5516b5f325d1c88e4fcd8ca67f989.tar.bz2
compustream-52cbbff72bd5516b5f325d1c88e4fcd8ca67f989.tar.lz
compustream-52cbbff72bd5516b5f325d1c88e4fcd8ca67f989.tar.xz
compustream-52cbbff72bd5516b5f325d1c88e4fcd8ca67f989.tar.zst
compustream-52cbbff72bd5516b5f325d1c88e4fcd8ca67f989.zip
Regeneralize ComputeShader wrapper
Diffstat (limited to 'src/shader')
-rw-r--r--src/shader/wrap/compute_shader.cc6
-rw-r--r--src/shader/wrap/compute_shader.h4
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;
};