lwjglgamedev / vulkanbook

Online book which introduces the main concepts required to write graphics games or any other applications using Vulkan in Java by using the LWJGL library.
MIT License
252 stars 13 forks source link

Too many texture descriptors created in Chapter 16 #74

Closed Mjrlun closed 10 months ago

Mjrlun commented 10 months ago

In Chapter 16, the class GeometryRenderActivity's createDescriptorPool method creates a descriptor pool with the number of image descriptors equal to engineProps.getMaxMaterials() * 3, rather than 1, which is what would be expected with a texture array.

lwjglgamedev commented 10 months ago

I think this is not right. You need to create one descriptor set per texture even if they are in an array. They are accessed through an array of sampler2D elements not by a sampler2DArray. In the later case that would be correct. Do you agree?

Mjrlun commented 10 months ago

I took a moment to confirm it, I apologize; you are correct: each texture is considered its own descriptor.