From 52cbbff72bd5516b5f325d1c88e4fcd8ca67f989 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 16 Dec 2018 15:16:21 +0100 Subject: Regeneralize ComputeShader wrapper --- src/shader/wrap/compute_shader.cc | 6 ++---- src/shader/wrap/compute_shader.h | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/shader/wrap') 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& 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 +#include #include @@ -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& buffers) const; + void dispatch(GLuint nX, GLuint nY) const; }; -- cgit v1.2.3