Commit f7c76418 by Philipp Adolf

Add copy shader

parent 3a31ac92
......@@ -5,6 +5,7 @@
<file>subdivide.tcs</file>
<file>subdivide.tes</file>
<file>subdivide.vert</file>
<file>subdivision-copy.compute</file>
<file>subdivision-edge.compute</file>
<file>subdivision-vertex.compute</file>
<file>subdivideRegular.tcs</file>
......
#version 430 core
layout (local_size_x = 1) in;
struct Vertex {
vec3 pos;
vec3 norm;
vec2 uv;
};
layout(std430, binding=0) readonly buffer Input {
Vertex vertices_in[];
};
layout(std430, binding=1) writeonly buffer Output {
Vertex vertices_out[];
};
void main(){
vertices_out[gl_GlobalInvocationID.x] = vertices_in[gl_GlobalInvocationID.x];
}
......@@ -10,6 +10,7 @@ Subdivision::Subdivision(QOpenGLFunctions_4_3_Core *f)
Subdivision::~Subdivision()
{
delete copyShader;
delete edgeShader;
delete vertexShader;
}
......@@ -21,7 +22,10 @@ QString Subdivision::formatTimeMeasurement(int time){
}
void Subdivision::init() {
QString source = QLatin1String(":/subdivision-edge.compute");
QString source = QLatin1String(":/subdivision-copy.compute");
copyShader = initComputeShaderProgram(source);
source = QLatin1String(":/subdivision-edge.compute");
edgeShader = initComputeShaderProgram(source);
source = QLatin1String(":/subdivision-vertex.compute");
......
......@@ -51,6 +51,7 @@ private:
QString formatTimeMeasurement(int time);
QOpenGLFunctions_4_3_Core *f;
QOpenGLShaderProgram *copyShader;
QOpenGLShaderProgram *edgeShader;
QOpenGLShaderProgram *vertexShader;
......
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