Document the vk::DescriptorSet memory layout

We currently implement descriptor set objects using a single allocation
for its metadata (aka. its header) and its payload of actual descriptor
data. This simplifies the descriptor pool implementation and avoids
indirections. But since C++ does not support variable sized classes,
we use placement new to construct the object consisting of just the
header, and rely on pointer arithmetic to get the address of the
descriptors that follow it.

This change just adds clarifying comments and uses camelCase for the
non-static member function for obtaining the descriptor data pointer.

Bug: b/229992990
Change-Id: I40b703665a20e77e949b21453f405efb4f0cd810
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/65469
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
diff --git a/src/Vulkan/VkDescriptorSet.cpp b/src/Vulkan/VkDescriptorSet.cpp
index d081567..98eb010 100644
--- a/src/Vulkan/VkDescriptorSet.cpp
+++ b/src/Vulkan/VkDescriptorSet.cpp
@@ -42,7 +42,7 @@
 				VkDescriptorType type = layout->getDescriptorType(i, j);
 				uint32_t descriptorCount = layout->getDescriptorCount(i, j);
 				uint32_t descriptorSize = layout->getDescriptorSize(i, j);
-				uint8_t *descriptorMemory = descriptorSet->GetDataAddress() + layout->getBindingOffset(i, j);
+				uint8_t *descriptorMemory = descriptorSet->getDataAddress() + layout->getBindingOffset(i, j);
 
 				for(uint32_t k = 0; k < descriptorCount; k++)
 				{
@@ -88,9 +88,13 @@
 	ParseDescriptors(descriptorSets, layout, device, PREPARE_FOR_SAMPLING);
 }
 
-uint8_t *DescriptorSet::GetDataAddress()
+uint8_t *DescriptorSet::getDataAddress()
 {
-	static_assert(sizeof(DescriptorSetHeader) == sizeof(DescriptorSet));
+	// Descriptor sets consist of a header followed by a variable amount of descriptor data, depending
+	// on the descriptor set layout. Therefore the size of this class must match the size of the header.
+	static_assert(sizeof(DescriptorSet) == sizeof(DescriptorSetHeader));
+
+	// Return a pointer to the first byte after the header.
 	return reinterpret_cast<uint8_t *>(this) + sizeof(DescriptorSetHeader);
 }