Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Vulkan Workshop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
KSZK
DevTeam
Vulkan Workshop
Commits
ef467c2d
Commit
ef467c2d
authored
11 months ago
by
n0F4x
Browse files
Options
Downloads
Patches
Plain Diff
Fix some code snippets
parent
a7bb875e
No related branches found
No related tags found
No related merge requests found
Pipeline
#50732
passed
11 months ago
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/lectures/01/index.md
+7
-7
7 additions, 7 deletions
docs/lectures/01/index.md
docs/lectures/02/index.md
+1
-1
1 addition, 1 deletion
docs/lectures/02/index.md
with
8 additions
and
8 deletions
docs/lectures/01/index.md
+
7
−
7
View file @
ef467c2d
...
@@ -130,9 +130,9 @@ Ezeket a `vk::Instance::enumeratePhysicalDevices` függvénnyel le is kérhetjü
...
@@ -130,9 +130,9 @@ Ezeket a `vk::Instance::enumeratePhysicalDevices` függvénnyel le is kérhetjü
!!! example ""
!!! example ""
```cpp
```cpp
[[nodiscard]] static auto choose_physical_device(vk::Instance
t_
instance) -> vk::PhysicalDevice
[[nodiscard]] static auto choose_physical_device(vk::Instance instance) -> vk::PhysicalDevice
{
{
const auto physical_devices{
t_
instance.enumeratePhysicalDevices() };
const auto physical_devices{ instance.enumeratePhysicalDevices() };
if (std::ranges::empty(physical_devices)) {
if (std::ranges::empty(physical_devices)) {
throw std::runtime_error{ "No Vulkan physical device is available." };
throw std::runtime_error{ "No Vulkan physical device is available." };
...
@@ -234,13 +234,13 @@ Adott minden, hogy a *Device*-t is létrehozzuk.
...
@@ -234,13 +234,13 @@ Adott minden, hogy a *Device*-t is létrehozzuk.
```cpp
```cpp
[[nodiscard]]
[[nodiscard]]
static auto create_device(const vk::PhysicalDevice
t_
physical_device)
static auto create_device(const vk::PhysicalDevice physical_device)
-> vk::UniqueDevice
-> vk::UniqueDevice
{
{
constexpr static std::array queue_priorities{ 1.f };
constexpr static std::array queue_priorities{ 1.f };
const vk::DeviceQueueCreateInfo queue_create_info{
const vk::DeviceQueueCreateInfo queue_create_info{
.queueFamilyIndex = find_queue_family_index(
t_
physical_device),
.queueFamilyIndex = find_queue_family_index(physical_device)
.value()
,
.queueCount = 1,
.queueCount = 1,
.pQueuePriorities = queue_priorities.data(),
.pQueuePriorities = queue_priorities.data(),
};
};
...
@@ -250,7 +250,7 @@ Adott minden, hogy a *Device*-t is létrehozzuk.
...
@@ -250,7 +250,7 @@ Adott minden, hogy a *Device*-t is létrehozzuk.
.pQueueCreateInfos = &queue_create_info,
.pQueueCreateInfos = &queue_create_info,
};
};
return
t_
physical_device.createDeviceUnique(device_create_info);
return physical_device.createDeviceUnique(device_create_info);
}
}
```
```
...
@@ -278,8 +278,8 @@ private:
...
@@ -278,8 +278,8 @@ private:
```
cpp title="Renderer.cpp"
```
cpp title="Renderer.cpp"
Renderer::Renderer()
Renderer::Renderer()
: m_instance{ create_instance() },
: m_instance{ create_instance() },
m_physical_device{ choose_physical_device(
*
m_instance) },
m_physical_device{ choose_physical_device(m_instance
.get()
) },
m_queue_family_index{ find_queue_family_index(m_physical_device) },
m_queue_family_index{ find_queue_family_index(m_physical_device)
.value()
},
m_device{ create_device(m_physical_device) },
m_device{ create_device(m_physical_device) },
m_queue{ m_device->getQueue(m_queue_family_index, 0) }
m_queue{ m_device->getQueue(m_queue_family_index, 0) }
{}
{}
...
...
This diff is collapsed.
Click to expand it.
docs/lectures/02/index.md
+
1
−
1
View file @
ef467c2d
...
@@ -464,7 +464,7 @@ Ehhez első lépés, hogy olyan physical_device-t válasszunk, ami támogatja ez
...
@@ -464,7 +464,7 @@ Ehhez első lépés, hogy olyan physical_device-t válasszunk, ami támogatja ez
std::ranges::remove_copy_if(
std::ranges::remove_copy_if(
instance.enumeratePhysicalDevices(),
instance.enumeratePhysicalDevices(),
std::back_inserter(physical_devices),
std::back_inserter(physical_devices),
[
surface
](vk::PhysicalDevice physical_device) {
[](vk::PhysicalDevice physical_device) {
return !(
return !(
supports_required_extensions(physical_device)
supports_required_extensions(physical_device)
&& find_queue_family_index(physical_device).has_value()
&& find_queue_family_index(physical_device).has_value()
...
...
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