Commit 09a808ae by Philipp Adolf

Rename edge compute shader

parent 817044b4
......@@ -5,6 +5,6 @@
<file>subdivide.tcs</file>
<file>subdivide.tes</file>
<file>subdivide.vert</file>
<file>subdivision.compute</file>
<file>subdivision-edge.compute</file>
</qresource>
</RCC>
......@@ -7,11 +7,11 @@ Subdivision::Subdivision(QOpenGLFunctions_4_3_Core *f)
Subdivision::~Subdivision()
{
delete shader;
delete edgeShader;
}
void Subdivision::init() {
shader = initComputeShaderProgram();
edgeShader = initEdgeComputeShaderProgram();
}
QVector<unsigned int> Subdivision::fillVector(unsigned int a, unsigned int b, unsigned int c,unsigned int d){
......@@ -23,8 +23,8 @@ QVector<unsigned int> Subdivision::fillVector(unsigned int a, unsigned int b, un
return x;
}
QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(){
QString source = QLatin1String(":/subdivision.compute");
QOpenGLShaderProgram *Subdivision::initEdgeComputeShaderProgram(){
QString source = QLatin1String(":/subdivision-edge.compute");
qDebug()<<"Compiling compute shader ...";
QOpenGLShader *computeShader = new QOpenGLShader(QOpenGLShader::Compute);
......@@ -282,7 +282,7 @@ void Subdivision::runShader(Mesh *mesh, QVector<QVector<unsigned int> > &edgeInd
GLuint vb_handle = firstMeshEntry->VB_handle;
QVector<Vertex> vb = firstMeshEntry->getVertexBuffer();
shader->bind();
edgeShader->bind();
f->glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, vb_handle);
GLuint *edgeIDs = new GLuint[edgeIndices.size() * 4];
......@@ -329,5 +329,5 @@ void Subdivision::runShader(Mesh *mesh, QVector<QVector<unsigned int> > &edgeInd
f->glDeleteBuffers(1, &indicesID);
f->glDeleteBuffers(1, &bufferID);
shader->release();
edgeShader->release();
}
......@@ -17,9 +17,9 @@ public:
private:
QOpenGLFunctions_4_3_Core *f;
QOpenGLShaderProgram *shader;
QOpenGLShaderProgram *edgeShader;
QOpenGLShaderProgram *initComputeShaderProgram();
QOpenGLShaderProgram *initEdgeComputeShaderProgram();
void precomputeTables(Mesh *mesh, QVector<QVector<unsigned int> > &edgeIndices_base);
void runShader(Mesh *mesh, QVector<QVector<unsigned int> > &edgeIndices);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment