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
97ea391e
Commit
97ea391e
authored
Jun 27, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make compute shader loading more generic
parent
27ca1b90
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
subdivision.cpp
QTProject/subdivision.cpp
+3
-4
subdivision.h
QTProject/subdivision.h
+1
-1
No files found.
QTProject/subdivision.cpp
View file @
97ea391e
...
@@ -11,7 +11,8 @@ Subdivision::~Subdivision()
...
@@ -11,7 +11,8 @@ Subdivision::~Subdivision()
}
}
void
Subdivision
::
init
()
{
void
Subdivision
::
init
()
{
edgeShader
=
initEdgeComputeShaderProgram
();
QString
source
=
QLatin1String
(
":/subdivision-edge.compute"
);
edgeShader
=
initComputeShaderProgram
(
source
);
}
}
QVector
<
unsigned
int
>
Subdivision
::
fillVector
(
unsigned
int
a
,
unsigned
int
b
,
unsigned
int
c
,
unsigned
int
d
){
QVector
<
unsigned
int
>
Subdivision
::
fillVector
(
unsigned
int
a
,
unsigned
int
b
,
unsigned
int
c
,
unsigned
int
d
){
...
@@ -23,9 +24,7 @@ QVector<unsigned int> Subdivision::fillVector(unsigned int a, unsigned int b, un
...
@@ -23,9 +24,7 @@ QVector<unsigned int> Subdivision::fillVector(unsigned int a, unsigned int b, un
return
x
;
return
x
;
}
}
QOpenGLShaderProgram
*
Subdivision
::
initEdgeComputeShaderProgram
(){
QOpenGLShaderProgram
*
Subdivision
::
initComputeShaderProgram
(
QString
&
source
){
QString
source
=
QLatin1String
(
":/subdivision-edge.compute"
);
qDebug
()
<<
"Compiling compute shader ..."
;
qDebug
()
<<
"Compiling compute shader ..."
;
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
if
(
!
computeShader
->
compileSourceFile
(
source
)){
if
(
!
computeShader
->
compileSourceFile
(
source
)){
...
...
QTProject/subdivision.h
View file @
97ea391e
...
@@ -19,7 +19,7 @@ private:
...
@@ -19,7 +19,7 @@ private:
QOpenGLFunctions_4_3_Core
*
f
;
QOpenGLFunctions_4_3_Core
*
f
;
QOpenGLShaderProgram
*
edgeShader
;
QOpenGLShaderProgram
*
edgeShader
;
QOpenGLShaderProgram
*
init
EdgeComputeShaderProgram
(
);
QOpenGLShaderProgram
*
init
ComputeShaderProgram
(
QString
&
source
);
void
precomputeTables
(
Mesh
*
mesh
,
QVector
<
QVector
<
unsigned
int
>
>
&
edgeIndices_base
,
void
precomputeTables
(
Mesh
*
mesh
,
QVector
<
QVector
<
unsigned
int
>
>
&
edgeIndices_base
,
QVector
<
unsigned
int
>
&
vertexIndices
,
QVector
<
unsigned
int
>
&
vertexIndicesOffsets
);
QVector
<
unsigned
int
>
&
vertexIndices
,
QVector
<
unsigned
int
>
&
vertexIndicesOffsets
);
void
runShader
(
Mesh
*
mesh
,
QVector
<
QVector
<
unsigned
int
>
>
&
edgeIndices
);
void
runShader
(
Mesh
*
mesh
,
QVector
<
QVector
<
unsigned
int
>
>
&
edgeIndices
);
...
...
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