What is "layer"?

Studying Vulkan is not easy
All the reference guides and books are unfriendly

I found the beginning of studying this will be the concept “layer”

  1. What is the layer? Is this similar to the “extension”?

  2. How many possible kinds of layers exist ? I want to know the full list
    Does Khronos determine the full list?

  3. On my NVIDIA 4060 ti card, it is said there are 10 possible layers
    VK_LAYER_LUNARG_override, aip_dump, profiles, shader_object, validation … so on
    Please explain to me what these are
    and how to choose and how many to choose as requested layers among them
    For example, can I choose all of those 10 layers as requested ?
    Oh really I have no idea what they are talking about on the books and manuals

Thank you in advance

FYI: the word “layer” is used in many places in Vulkan to refer to several concepts: array layers, etc. Until your 3rd question, I hadn’t realized you were talking about Vulkan implementation layers.

An implementation layer is a piece of code that can be inserted between your application and the Vulkan implementation. It can therefore see every call your program makes and record information.

For example, Vulkan implementations do not do error checking. Any misues of the API on your end lead to undefined behavior, which is not easy to diagnose. The validation layer exists to do error checking (to the best of its abilities. It can’t cover everything). It records all the information about the current state of things and tests that against all the valid usage rules. If it detects invalid use of the API, it generates an error.

The API dump layer just writes text for each function call for debugging purposes. Etc.

The Vulkan SDK comes with a bunch of layers, but other code can inject itself in through the layer system. Most layers (particularly those of the SDK) are opt-in; you specify at instance/device creation time which layers you want. But some external code can use the layer system without your knowledge.

1 Like

Hello, Alfonse
Thank you for your detailed explanation and kindness
Your advise helped me a lot !
See you and have a great weekend, Alfonse