Commit Graph

10 Commits

Author SHA1 Message Date
Hugo Locurcio 898f655f92
Use `VK_LOD_CLAMP_NONE` constant to set mipmap max LOD level in sampler (#354)
This allows for using different texture sizes without having to
know the mipmap count in advance.

All conformant Vulkan implementations should be able to handle this
constant, which is equal to `1000.0f`.
2023-08-09 21:35:09 +02:00
Charles Giessen 9fe64f9747 Edit tutorial to reset & record command buffers each frame (#255)
* Update tutorial for command buffer re-recording

Means the code now calls recordCommandBuffer every frame instead of ahead of time

Many changes to the structure of chapters 14 & 15, with small changes to subsequent
chapters.

Primary focus was shifting everything away from 'swapchain image count' to
MAX_FRAMES_IN_FLIGHT. This has caused a lot of chapter 15 to need to be rewritten.
Such as: Introducing fences alongside semaphores and not later; Waiting on a fence
at the start of the frame before introducing acquireNextImage; consolidating the
Frames In Flight concepts to apply to command buffers, fences, and semaphores at
the same time.

Chapter 14 saw command buffer allocation reduced to 1 at a time. This allows the
concept of Frames in Flight to not need introduction before having a triangle
drawing on the screen.

* Update introduction to semaphores and fences

Greatly improve the descriptions of semaphores and fences before their
introduction into the code. Provide examples with psuedo code.

By using max_frames_in_flight command buffers & semaphores, we dont
need to keep track of previously sumitted frames' fences and wait
on them "just in case". This removes a lot of the confusion I had
when I first was trying to understand the vulkan update loop.

* Remove accidental code changes

Un-comment vkDeviceWaitIdle and remove resizing of imagesInFlight (which was removed)

* Use uint32_t instead of size_t for currentFrame

* Address typos and fixup changes for re-recording command buffers PR

* Add description of fences needing explicit resetting while semaphores are automatic
* Elaborate on why 2 frames in flight are chosen

* Fix deadlock in resizing from resetting the fence too early

Because acquiring the swapchain image index may cause drawFrame to return early,
it was possible to cause the next vkWaitForFences to deadlock. By delaying fence
resetting till after acquiring, it prevents the deadlock.
2022-02-21 20:55:30 +01:00
Alexander Overvoorde b94d09037b Merge pull request #206 from maltekliemann/ref/dedicated-transfer-queue-vkCmdBlitImage 2020-09-17 21:42:37 +02:00
maltekliemann 20fa35ef62 Add remark regarding queue type for vkCmdBlitImage 2020-09-13 17:41:24 +02:00
maltekliemann ef70f04545 Fix typo 2020-09-13 17:21:40 +02:00
Pablo Delgado Krämer c05bff3b68 Fix wrong VkSamplerCreateInfo type assignments.
The four members of VkSamplerCreateInfo maxAnisotropy, mipLodBias,
minLod and maxLod are floats, but actually assigned integer values.
2020-05-05 15:05:37 +02:00
Alexander Overvoorde 8843f338cd Replace example 3D model with permissively licensed one
The existing model had a permissive license at the time this tutorial
was written, but the artist has since started selling the model so I've
decided to switch to a different one to respect their wishes.
2020-04-28 22:41:09 +02:00
Alexander Overvoorde 4f8b81d234 Change code to use value initialization 2020-04-19 13:39:36 +02:00
Alexander Overvoorde 4c08f3961d Fix tutorial mixing up linear and SRGB colors (fixes #163) 2020-02-05 21:58:48 +01:00
feyleth 7404a3f8a6 add generation for multy language 2019-06-17 18:17:59 +02:00