Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
8bf8f8e0
Commit
8bf8f8e0
authored
3 years ago
by
Mara Vogt
Browse files
Options
Downloads
Patches
Plain Diff
[
#94
] fixed alignment issues and descriptorwrite overwrite issues
parent
1bed07e8
No related branches found
No related tags found
1 merge request
!77
Resolve "SAF-R Module"
Pipeline
#26900
passed
3 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
projects/saf_r/shaders/raytracing.comp
+4
-4
4 additions, 4 deletions
projects/saf_r/shaders/raytracing.comp
projects/saf_r/src/main.cpp
+5
-3
5 additions, 3 deletions
projects/saf_r/src/main.cpp
projects/saf_r/src/safrScene.hpp
+1
-1
1 addition, 1 deletion
projects/saf_r/src/safrScene.hpp
with
10 additions
and
8 deletions
projects/saf_r/shaders/raytracing.comp
+
4
−
4
View file @
8bf8f8e0
...
@@ -2,19 +2,19 @@
...
@@ -2,19 +2,19 @@
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_separate_shader_objects : enable
struct Material {
struct Material {
vec3 diffuse_color;
vec3 albedo;
vec3 albedo;
vec3 diffuse_color;
float specular_exponent;
float specular_exponent;
};
};
layout(std430, binding = 0) coherent buffer Lights{
layout(std430, binding = 0) coherent buffer Lights{
vec3 position
[]
;
vec3 position;
float intensity
[]
;
float intensity;
};
};
layout(std430, binding = 1) coherent buffer Materials{
layout(std430, binding = 1) coherent buffer Materials{
vec3 diffuse_color;
vec3 albedo;
vec3 albedo;
vec3 diffuse_color;
float specular_exponent;
float specular_exponent;
};
};
...
...
This diff is collapsed.
Click to expand it.
projects/saf_r/src/main.cpp
+
5
−
3
View file @
8bf8f8e0
...
@@ -119,19 +119,19 @@ int main(int argc, const char** argv) {
...
@@ -119,19 +119,19 @@ int main(int argc, const char** argv) {
vkcv
::
Buffer
<
safrScene
::
Light
>
lightsBuffer
=
core
.
createBuffer
<
safrScene
::
Light
>
(
vkcv
::
Buffer
<
safrScene
::
Light
>
lightsBuffer
=
core
.
createBuffer
<
safrScene
::
Light
>
(
vkcv
::
BufferType
::
STORAGE
,
vkcv
::
BufferType
::
STORAGE
,
lights
.
size
()
lights
.
size
()
);
);
lightsBuffer
.
fill
(
lights
);
lightsBuffer
.
fill
(
lights
);
vkcv
::
Buffer
<
safrScene
::
Sphere
>
sphereBuffer
=
core
.
createBuffer
<
safrScene
::
Sphere
>
(
vkcv
::
Buffer
<
safrScene
::
Sphere
>
sphereBuffer
=
core
.
createBuffer
<
safrScene
::
Sphere
>
(
vkcv
::
BufferType
::
STORAGE
,
vkcv
::
BufferType
::
STORAGE
,
spheres
.
size
()
spheres
.
size
()
);
);
sphereBuffer
.
fill
(
spheres
);
sphereBuffer
.
fill
(
spheres
);
vkcv
::
Buffer
<
safrScene
::
Material
>
materialBuffer
=
core
.
createBuffer
<
safrScene
::
Material
>
(
vkcv
::
Buffer
<
safrScene
::
Material
>
materialBuffer
=
core
.
createBuffer
<
safrScene
::
Material
>
(
vkcv
::
BufferType
::
STORAGE
,
vkcv
::
BufferType
::
STORAGE
,
materials
.
size
()
materials
.
size
()
);
);
materialBuffer
.
fill
(
materials
);
materialBuffer
.
fill
(
materials
);
...
@@ -142,7 +142,9 @@ int main(int argc, const char** argv) {
...
@@ -142,7 +142,9 @@ int main(int argc, const char** argv) {
vkcv
::
DescriptorWrites
computeWrites
;
vkcv
::
DescriptorWrites
computeWrites
;
computeWrites
.
storageBufferWrites
=
{
vkcv
::
BufferDescriptorWrite
(
0
,
lightsBuffer
.
getHandle
())
};
computeWrites
.
storageBufferWrites
=
{
vkcv
::
BufferDescriptorWrite
(
0
,
lightsBuffer
.
getHandle
())
};
core
.
writeDescriptorSet
(
computeDescriptorSet
,
computeWrites
);
computeWrites
.
storageBufferWrites
=
{
vkcv
::
BufferDescriptorWrite
(
1
,
materialBuffer
.
getHandle
())
};
computeWrites
.
storageBufferWrites
=
{
vkcv
::
BufferDescriptorWrite
(
1
,
materialBuffer
.
getHandle
())
};
core
.
writeDescriptorSet
(
computeDescriptorSet
,
computeWrites
);
computeWrites
.
storageBufferWrites
=
{
vkcv
::
BufferDescriptorWrite
(
2
,
sphereBuffer
.
getHandle
())
};
computeWrites
.
storageBufferWrites
=
{
vkcv
::
BufferDescriptorWrite
(
2
,
sphereBuffer
.
getHandle
())
};
core
.
writeDescriptorSet
(
computeDescriptorSet
,
computeWrites
);
core
.
writeDescriptorSet
(
computeDescriptorSet
,
computeWrites
);
...
...
This diff is collapsed.
Click to expand it.
projects/saf_r/src/safrScene.hpp
+
1
−
1
View file @
8bf8f8e0
...
@@ -39,8 +39,8 @@ public:
...
@@ -39,8 +39,8 @@ public:
struct
Material
{
struct
Material
{
Material
(
const
glm
::
vec3
&
a
,
const
glm
::
vec3
&
color
,
const
float
&
spec
)
:
albedo
(
a
),
diffuse_color
(
color
),
specular_exponent
(
spec
)
{}
Material
(
const
glm
::
vec3
&
a
,
const
glm
::
vec3
&
color
,
const
float
&
spec
)
:
albedo
(
a
),
diffuse_color
(
color
),
specular_exponent
(
spec
)
{}
Material
()
:
albedo
(
1
,
0
,
0
),
diffuse_color
(),
specular_exponent
()
{}
Material
()
:
albedo
(
1
,
0
,
0
),
diffuse_color
(),
specular_exponent
()
{}
glm
::
vec3
diffuse_color
;
glm
::
vec3
albedo
;
glm
::
vec3
albedo
;
alignas
(
16
)
glm
::
vec3
diffuse_color
;
float
specular_exponent
;
float
specular_exponent
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment