Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
Unterteilungsalgorithmen
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
Unterteilungsalgorithmen
Commits
f8223e1f
Commit
f8223e1f
authored
Jun 28, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move glBindBufferBase calls
parent
78c715fe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
subdivision.cpp
QTProject/subdivision.cpp
+8
-3
No files found.
QTProject/subdivision.cpp
View file @
f8223e1f
...
@@ -285,20 +285,25 @@ void Subdivision::runShader(Input input, Tables &tables) {
...
@@ -285,20 +285,25 @@ void Subdivision::runShader(Input input, Tables &tables) {
qDebug
()
<<
"Running compute shader"
;
qDebug
()
<<
"Running compute shader"
;
edgeShader
->
bind
();
edgeShader
->
bind
();
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
0
,
input
.
vb_handle
);
// Create an input buffer and set it to the value of offset
// Create an input buffer and set it to the value of offset
GLuint
indicesID
;
GLuint
indicesID
;
f
->
glGenBuffers
(
1
,
&
indicesID
);
f
->
glGenBuffers
(
1
,
&
indicesID
);
f
->
glBindBuffer
Base
(
GL_SHADER_STORAGE_BUFFER
,
1
,
indicesID
);
f
->
glBindBuffer
(
GL_SHADER_STORAGE_BUFFER
,
indicesID
);
f
->
glBufferData
(
GL_SHADER_STORAGE_BUFFER
,
tables
.
edge_indices
.
size
()
*
sizeof
(
GLuint
),
tables
.
edge_indices
.
data
(),
GL_DYNAMIC_DRAW
);
f
->
glBufferData
(
GL_SHADER_STORAGE_BUFFER
,
tables
.
edge_indices
.
size
()
*
sizeof
(
GLuint
),
tables
.
edge_indices
.
data
(),
GL_DYNAMIC_DRAW
);
// Create an output buffer
// Create an output buffer
GLuint
bufferID
;
GLuint
bufferID
;
f
->
glGenBuffers
(
1
,
&
bufferID
);
f
->
glGenBuffers
(
1
,
&
bufferID
);
f
->
glBindBuffer
Base
(
GL_SHADER_STORAGE_BUFFER
,
2
,
bufferID
);
f
->
glBindBuffer
(
GL_SHADER_STORAGE_BUFFER
,
bufferID
);
f
->
glBufferData
(
GL_SHADER_STORAGE_BUFFER
,
tables
.
edge_indices
.
size
()
*
sizeof
(
Vertex
)
/
4
,
NULL
,
GL_DYNAMIC_DRAW
);
f
->
glBufferData
(
GL_SHADER_STORAGE_BUFFER
,
tables
.
edge_indices
.
size
()
*
sizeof
(
Vertex
)
/
4
,
NULL
,
GL_DYNAMIC_DRAW
);
f
->
glBindBuffer
(
GL_SHADER_STORAGE_BUFFER
,
0
);
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
0
,
input
.
vb_handle
);
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
1
,
indicesID
);
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
2
,
bufferID
);
// Run the shader
// Run the shader
f
->
glDispatchCompute
(
tables
.
edge_indices
.
size
()
/
4
,
1
,
1
);
f
->
glDispatchCompute
(
tables
.
edge_indices
.
size
()
/
4
,
1
,
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment