Can't read from a 3D texture in Vulkan

I am using the texture tutorial from Sascha Willems and it works without any problems. Then I change the texture from a 2D texture to a 3D texture unsigned 16 bits.

I set the correct depth and then change these values:

and just one component ->   view.components = { VK_COMPONENT_SWIZZLE_R };

In the shader:

sampler2D -> sampler3D

But all the values I get from texture(volumeTexture, textPos).r are now zero. Is the format suppose to VK_FORMAT_R16_UINT for the VkImageViewCreateInfo, or should that be something else, like a float?

If I open RenderDoc the texture looks good.

I got an answer from stackoverflow on this question.

OK, then… ask it. What mistakes are you referring to? Because this particular problem has been solved.