Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
GrayScott Reloaded - Rust practical
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
Container Registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GRASLAND Hadrien
GrayScott Reloaded - Rust practical
Commits
cebcad5e
Commit
cebcad5e
authored
9 months ago
by
Hadrien Grasland
Browse files
Options
Downloads
Patches
Plain Diff
Small corrections from writing the solution
parent
98201f36
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
handouts/src/24-resourceful.md
+30
-29
30 additions, 29 deletions
handouts/src/24-resourceful.md
with
30 additions
and
29 deletions
handouts/src/24-resourceful.md
+
30
−
29
View file @
cebcad5e
...
...
@@ -375,7 +375,7 @@ pub fn create_parameters(
## Concentration images
###
Setting the st
age
###
Did you say im
age
s?
As previously mentioned, Vulkan images give us access to the power of GPU
texturing units, which were designed to speed up and simplify the chore of
...
...
@@ -684,32 +684,33 @@ use vulkano::{
Validated
,
VulkanError
,
};
|[
in_u
,
in_v
,
out_u
,
out_v
]:
[
Arc
<
Image
>
;
4
]|
->
Result
<
_
,
Validated
<
VulkanError
>>
{
let
layout
=
pipeline
.layout
()
.set_layouts
()[
IMAGES_SET
as
usize
]
.clone
();
let
binding
=
|
binding
,
image
:
Arc
<
Image
>
,
usage
|
->
Result
<
_
,
Validated
<
VulkanError
>>
{
let
view_info
=
ImageViewCreateInfo
{
usage
,
..
ImageViewCreateInfo
::
from_image
(
&
image
)
let
create_set
=
|[
in_u
,
in_v
,
out_u
,
out_v
]:
[
Arc
<
Image
>
;
4
]|
->
Result
<
_
,
Validated
<
VulkanError
>>
{
let
layout
=
pipeline
.layout
()
.set_layouts
()[
IMAGES_SET
as
usize
]
.clone
();
let
binding
=
|
binding
,
image
:
Arc
<
Image
>
,
usage
|
->
Result
<
_
,
Validated
<
VulkanError
>>
{
let
view_info
=
ImageViewCreateInfo
{
usage
,
..
ImageViewCreateInfo
::
from_image
(
&
image
)
};
Ok
(
WriteDescriptorSet
::
image_view
(
binding
,
ImageView
::
new
(
image
,
view_info
)
?
,
))
};
Ok
(
WriteDescriptorSet
::
image_view
(
binding
,
ImageView
::
new
(
image
,
view_info
)
?
,
))
};
let
descriptor_set
=
PersistentDescriptorSet
::
new
(
&
context
.descriptor_alloc
,
layout
,
[
binding
(
IN_U
,
in_u
,
ImageUsage
::
SAMPLED
)
?
,
binding
(
IN_V
,
in_v
,
ImageUsage
::
SAMPLED
)
?
,
binding
(
OUT_U
,
out_u
,
ImageUsage
::
STORAGE
)
?
,
binding
(
OUT_V
,
out_v
,
ImageUsage
::
STORAGE
)
?
,
],
[],
)
?
;
Ok
(
descriptor_set
)
};
let
descriptor_set
=
PersistentDescriptorSet
::
new
(
&
context
.descriptor_alloc
,
layout
,
[
binding
(
IN_U
,
in_u
,
ImageUsage
::
SAMPLED
)
?
,
binding
(
IN_V
,
in_v
,
ImageUsage
::
SAMPLED
)
?
,
binding
(
OUT_U
,
out_u
,
ImageUsage
::
STORAGE
)
?
,
binding
(
OUT_V
,
out_v
,
ImageUsage
::
STORAGE
)
?
,
],
[],
)
?
;
Ok
(
descriptor_set
)
};
```
...and then we will use it to build our double-buffered descriptor set
...
...
@@ -721,11 +722,11 @@ fn create_concentration_sets(
pipeline
:
&
ComputePipeline
,
images
:
&
[
Arc
<
Image
>
],
)
->
Result
<
[
Arc
<
PersistentDescriptorSet
>
;
2
],
Validated
<
VulkanError
>>
{
let
new_images
_set
=
/* ... as above ... */
;
let
create
_set
=
/* ... as above ... */
;
let
[
u1
,
v1
,
u2
,
v2
]
=
[
&
images
[
0
],
&
images
[
1
],
&
images
[
2
],
&
images
[
3
]];
let
descriptor_sets
=
[
new_images
_set
([
u1
.clone
(),
v1
.clone
(),
u2
.clone
(),
v2
.clone
()])
?
,
new_images
_set
([
u2
.clone
(),
v2
.clone
(),
u1
.clone
(),
v1
.clone
()])
?
,
create
_set
([
u1
.clone
(),
v1
.clone
(),
u2
.clone
(),
v2
.clone
()])
?
,
create
_set
([
u2
.clone
(),
v2
.clone
(),
u1
.clone
(),
v1
.clone
()])
?
,
];
Ok
(
descriptor_sets
)
}
...
...
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