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
b2cb8085
Commit
b2cb8085
authored
Sep 22, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add offset to vertex shader
parent
a01a9395
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
subdivision.cpp
QTProject/subdivision.cpp
+4
-3
subdivision.h
QTProject/subdivision.h
+1
-1
No files found.
QTProject/subdivision.cpp
View file @
b2cb8085
...
@@ -743,7 +743,8 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
...
@@ -743,7 +743,8 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
runEdgeShader
(
tables
.
edge_indices
.
size
()
/
4
,
input
.
vb_handle
,
edge_indices_handle
,
output_handle
,
edge_offset
);
runEdgeShader
(
tables
.
edge_indices
.
size
()
/
4
,
input
.
vb_handle
,
edge_indices_handle
,
output_handle
,
edge_offset
);
int
edgeTime
=
timer
.
elapsed
();
int
edgeTime
=
timer
.
elapsed
();
timer
.
restart
();
timer
.
restart
();
runVertexShader
(
input
.
vertex_buffer
.
size
(),
input
.
vb_handle
,
vertex_indices_handle
,
vertex_offsets_handle
,
output_handle
);
int
vertex_offset
=
0
;
runVertexShader
(
input
.
vertex_buffer
.
size
(),
input
.
vb_handle
,
vertex_indices_handle
,
vertex_offsets_handle
,
output_handle
,
vertex_offset
);
int
vertexTime
=
timer
.
elapsed
();
int
vertexTime
=
timer
.
elapsed
();
// Map the output buffer so we can read the results
// Map the output buffer so we can read the results
...
@@ -793,13 +794,13 @@ void Subdivision::runCopyShader(GLuint size, GLuint vb_in, GLuint vb_out) {
...
@@ -793,13 +794,13 @@ void Subdivision::runCopyShader(GLuint size, GLuint vb_in, GLuint vb_out) {
copyShader
->
release
();
copyShader
->
release
();
}
}
void
Subdivision
::
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
)
{
void
Subdivision
::
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
,
GLuint
offset
)
{
vertexShader
->
bind
();
vertexShader
->
bind
();
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
0
,
vb_handle
);
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
0
,
vb_handle
);
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
1
,
vertex_indices_handle
);
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
1
,
vertex_indices_handle
);
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
2
,
vertex_offsets_handle
);
f
->
glBindBufferBase
(
GL_SHADER_STORAGE_BUFFER
,
2
,
vertex_offsets_handle
);
f
->
glBindBuffer
Base
(
GL_SHADER_STORAGE_BUFFER
,
3
,
output_handle
);
f
->
glBindBuffer
Range
(
GL_SHADER_STORAGE_BUFFER
,
3
,
output_handle
,
offset
*
sizeof
(
Vertex
),
size
*
sizeof
(
Vertex
)
);
// Run the shader
// Run the shader
f
->
glDispatchCompute
(
size
,
1
,
1
);
f
->
glDispatchCompute
(
size
,
1
,
1
);
...
...
QTProject/subdivision.h
View file @
b2cb8085
...
@@ -63,7 +63,7 @@ private:
...
@@ -63,7 +63,7 @@ private:
void
findRegular
(
QVector
<
unsigned
int
>
index_buffer
,
QVector
<
Vertex
>
vertex_buffer
,
QVector
<
unsigned
int
>
&
regular
,
QVector
<
unsigned
int
>
&
irregular
);
void
findRegular
(
QVector
<
unsigned
int
>
index_buffer
,
QVector
<
Vertex
>
vertex_buffer
,
QVector
<
unsigned
int
>
&
regular
,
QVector
<
unsigned
int
>
&
irregular
);
Result
runShader
(
Input
input
,
Tables
&
tables
);
Result
runShader
(
Input
input
,
Tables
&
tables
);
void
runCopyShader
(
GLuint
size
,
GLuint
vb_in
,
GLuint
vb_out
);
void
runCopyShader
(
GLuint
size
,
GLuint
vb_in
,
GLuint
vb_out
);
void
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
);
void
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
,
GLuint
offset
);
void
runEdgeShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
edge_indices_handle
,
GLuint
output_handle
,
GLuint
offset
);
void
runEdgeShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
edge_indices_handle
,
GLuint
output_handle
,
GLuint
offset
);
QVector
<
unsigned
int
>
patchIBToTriangleIB
(
QVector
<
unsigned
int
>
ib
);
QVector
<
unsigned
int
>
patchIBToTriangleIB
(
QVector
<
unsigned
int
>
ib
);
...
...
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