@@ -249,46 +249,44 @@ void lunaWriteDescriptorSets(const uint32_t writeCount, const LunaWriteDescripto
249249 writes.reserve (writeCount);
250250 for (uint32_t i = 0 ; i < writeCount; i++)
251251 {
252- const auto &[descriptorSet,
253- bindingName,
254- descriptorArrayElement,
255- descriptorCount,
256- imageInfo,
257- bufferInfo] = descriptorWrites[i];
252+ const LunaWriteDescriptorSet &descriptorWrite = descriptorWrites[i];
253+ const LunaDescriptorSet descriptorSet = descriptorWrite.descriptorSet ;
258254 const DescriptorSetIndex *descriptorSetIndex = static_cast <const DescriptorSetIndex *>(descriptorSet);
259- const DescriptorSetLayout::Binding &binding = descriptorSetIndex->layout ->binding (bindingName);
260- if (imageInfo != nullptr )
255+ const DescriptorSetLayout::Binding &binding = descriptorSetIndex->layout ->binding (descriptorWrite. bindingName );
256+ if (descriptorWrite. imageInfo != nullptr )
261257 {
262- const Image *image = static_cast <const Image *>(imageInfo->image );
258+ const Image *image = static_cast <const Image *>(descriptorWrite. imageInfo ->image );
263259 descriptorImageInfo = {
264- .sampler = image->sampler (imageInfo->sampler ),
260+ .sampler = image->sampler (descriptorWrite. imageInfo ->sampler ),
265261 .imageView = image->imageView (),
266- .imageLayout = imageInfo->imageLayout ,
262+ .imageLayout = descriptorWrite. imageInfo ->imageLayout ,
267263 };
268264 writes.emplace_back (VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET ,
269265 nullptr ,
270266 *descriptorSetIndex->set ,
271267 binding.index ,
272- descriptorArrayElement,
273- descriptorCount,
268+ descriptorWrite. descriptorArrayElement ,
269+ descriptorWrite. descriptorCount ,
274270 binding.type ,
275271 &descriptorImageInfo,
276272 nullptr ,
277273 nullptr );
278- } else if (bufferInfo != nullptr )
274+ } else if (descriptorWrite. bufferInfo != nullptr )
279275 {
280- const auto *bufferRegionIndex = static_cast <const buffer::BufferRegionIndex *>(bufferInfo->buffer );
276+ const LunaBuffer buffer = descriptorWrite.bufferInfo ->buffer ;
277+ const BufferRegionIndex *bufferRegionIndex = static_cast <const BufferRegionIndex *>(buffer);
281278 const VkDescriptorBufferInfo descriptorBufferInfo = {
282279 .buffer = *bufferRegionIndex->buffer (),
283- .offset = bufferInfo->offset + bufferRegionIndex->offset (),
284- .range = bufferInfo->range == 0 ? bufferRegionIndex->size () : bufferInfo->range ,
280+ .offset = descriptorWrite.bufferInfo ->offset + bufferRegionIndex->offset (),
281+ .range = descriptorWrite.bufferInfo ->range == 0 ? bufferRegionIndex->size ()
282+ : descriptorWrite.bufferInfo ->range ,
285283 };
286284 writes.emplace_back (VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET ,
287285 nullptr ,
288286 *descriptorSetIndex->set ,
289287 binding.index ,
290- descriptorArrayElement,
291- descriptorCount,
288+ descriptorWrite. descriptorArrayElement ,
289+ descriptorWrite. descriptorCount ,
292290 binding.type ,
293291 nullptr ,
294292 &descriptorBufferInfo,
0 commit comments