KhronosGroup / KhronosGroup/Vulkan-Tutorial

Wrong fields specified in image layout transition in Chapter06 Texture Mapping.

Open
#316 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
418
Forks
126
Avg merge
11d 6h
Merged PRs (30d)
31

Description

In [line 352 of 06_Texture_mapping/00_Images.adoc](https://github.com/KhronosGroup/Vulkan-Tutorial/blob/fef98131e744addae167848cb0f524bc107e9116/en/06_Texture_mapping/00_Images.adoc?plain=1#L352-L353), it says:

> If you are using the barrier to transfer queue family ownership, then `oldLayout` and `newLayout` fields should be the indices of the queue families. They must be set to `VK_QUEUE_FAMILY_IGNORED` if you don't want to do this (not the default value!).

But actually, `vk::ImageMemoryBarrier` should use fields `.srcQueueFamilyIndex` and `.dstQueueFamilyIndex` in this case. And it should be explained why provided code in `transitionImageLayout` doesn't do so:

https://github.com/KhronosGroup/Vulkan-Tutorial/blob/fef98131e744addae167848cb0f524bc107e9116/attachments/24_texture_image.cpp#L521

while `transition_image_layout` (yes, it's a different function, with inconsistent naming convention) does so:
https://github.com/KhronosGroup/Vulkan-Tutorial/blob/fef98131e744addae167848cb0f524bc107e9116/attachments/24_texture_image.cpp#L742-L772

This function is used in [03_Drawing_a_triangle](https://docs.vulkan.org/tutorial/latest/03_Drawing_a_triangle/03_Drawing/01_Command_buffers.html#_image_layout_transitions). I think a better way is to canonicalize these two functions instead.

Contributor guide

Open the contributing guide

Research direction

Read the linked passage at line 352 of 06_Texture_mapping/00_Images.adoc and compare the two transition functions in attachments/24_texture_image.cpp, especially lines 521 and 742-772. Correct the queue-family field explanation and assess whether the functions should be canonicalized, then check the Chapter03 image-layout-transition reference for consistency.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.