Skip to content

VK_IMAGE_LAYOUT_PREINITIALIZED is not necessary #59

@vazgriz

Description

@vazgriz

In the "Images" chapter of the Texture Mapping section, the createImage function creates an image with an initial layout of VK_IMAGE_LAYOUT_PREINITIALIZED. The reason given for this is so that the contents of the image are preserved by the first transition. However, data is not placed into the image before the first transition in any part of the tutorial. I think this was left over from when the tutorial used a staging image to transfer the texture, but since it uses a staging buffer now, VK_IMAGE_LAYOUT_PREINITIALIZED is not necessary.

For reference, section 11.4 of the spec says

VK_IMAGE_LAYOUT_PREINITIALIZED does not support device access.
...
Currently, VK_IMAGE_LAYOUT_PREINITIALIZED is only useful with VK_IMAGE_TILING_LINEAR images because there is not a standard layout defined for VK_IMAGE_TILING_OPTIMAL images.

VK_IMAGE_TILING_LINEAR is also never used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions