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
3a31ac92
Commit
3a31ac92
authored
Sep 22, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase size of output vertex buffer
parent
5212054f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
subdivision.cpp
QTProject/subdivision.cpp
+3
-1
No files found.
QTProject/subdivision.cpp
View file @
3a31ac92
...
@@ -723,10 +723,12 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
...
@@ -723,10 +723,12 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
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
// the new vertex buffer contains the old vertices + the new edge vertices + the modified non-edge vertices
unsigned
int
output_size
=
input
.
vertex_buffer
.
size
()
+
tables
.
edge_indices
.
size
()
/
4
+
(
tables
.
vertex_offsets
.
size
()
-
1
);
GLuint
output_handle
;
GLuint
output_handle
;
f
->
glGenBuffers
(
1
,
&
output_handle
);
f
->
glGenBuffers
(
1
,
&
output_handle
);
f
->
glBindBuffer
(
GL_SHADER_STORAGE_BUFFER
,
output_handle
);
f
->
glBindBuffer
(
GL_SHADER_STORAGE_BUFFER
,
output_handle
);
f
->
glBufferData
(
GL_SHADER_STORAGE_BUFFER
,
(
input
.
vertex_buffer
.
size
()
+
tables
.
edge_indices
.
size
()
/
4
)
*
sizeof
(
Vertex
),
NULL
,
GL_DYNAMIC_DRAW
);
f
->
glBufferData
(
GL_SHADER_STORAGE_BUFFER
,
output_size
*
sizeof
(
Vertex
),
NULL
,
GL_DYNAMIC_DRAW
);
result
.
vb_handle
=
output_handle
;
result
.
vb_handle
=
output_handle
;
f
->
glBindBuffer
(
GL_SHADER_STORAGE_BUFFER
,
0
);
f
->
glBindBuffer
(
GL_SHADER_STORAGE_BUFFER
,
0
);
...
...
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