@@ -358,7 +358,7 @@ VulkanRenderTarget::VulkanRenderTarget(VkDevice device, VkPhysicalDevice physica
358
358
// Constrain the sample count according to both kinds of sample count masks obtained from
359
359
// VkPhysicalDeviceProperties. This is consistent with the VulkanTexture constructor.
360
360
auto const & limits = context.getPhysicalDeviceLimits ();
361
- samples = samples = fvkutils::reduceSampleCount (samples,
361
+ samples = fvkutils::reduceSampleCount (samples,
362
362
limits.framebufferDepthSampleCounts & limits.framebufferColorSampleCounts );
363
363
364
364
auto & rpkey = mInfo ->rpkey ;
@@ -372,7 +372,7 @@ VulkanRenderTarget::VulkanRenderTarget(VkDevice device, VkPhysicalDevice physica
372
372
fbkey.samples = samples;
373
373
374
374
std::vector<VulkanAttachment>& attachments = mInfo ->attachments ;
375
- std::vector<VulkanAttachment> msaa ;
375
+ std::vector<VulkanAttachment> msaaAttachments ;
376
376
377
377
for (int index = 0 ; index < MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT; index++) {
378
378
VulkanAttachment& attachment = color[index];
@@ -415,13 +415,13 @@ VulkanRenderTarget::VulkanRenderTarget(VkDevice device, VkPhysicalDevice physica
415
415
};
416
416
}
417
417
fbkey.color [index] = msaaAttachment.getImageView ();
418
- msaa .push_back (msaaAttachment);
418
+ msaaAttachments .push_back (msaaAttachment);
419
419
}
420
420
}
421
421
422
- if (attachments.size () > 0 && samples > 1 && msaa .size () > 0 ) {
422
+ if (attachments.size () > 0 && samples > 1 && msaaAttachments .size () > 0 ) {
423
423
mInfo ->msaaIndex = (uint8_t ) attachments.size ();
424
- attachments.insert (attachments.end (), msaa .begin (), msaa .end ());
424
+ attachments.insert (attachments.end (), msaaAttachments .begin (), msaaAttachments .end ());
425
425
}
426
426
427
427
if (depth.texture ) {
@@ -436,10 +436,15 @@ VulkanRenderTarget::VulkanRenderTarget(VkDevice device, VkPhysicalDevice physica
436
436
uint8_t const msLevel = 1 ;
437
437
// Create sidecar MSAA texture for the depth attachment if it does not already
438
438
// exist.
439
- auto msaa = initMsaaTexture (depthTexture, device, physicalDevice, context,
439
+ auto msaaTexture = initMsaaTexture (depthTexture, device, physicalDevice, context,
440
440
allocator, commands, resourceManager, msLevel, samples, stagePool);
441
441
mInfo ->msaaDepthIndex = (uint8_t ) attachments.size ();
442
- attachments.push_back ({ .texture = msaa, .layerCount = layerCount });
442
+ VulkanAttachment msaaAttachment = {
443
+ .texture = msaaTexture,
444
+ .layerCount = layerCount,
445
+ };
446
+ attachments.push_back (msaaAttachment);
447
+ fbkey.depth = msaaAttachment.getImageView ();
443
448
}
444
449
}
445
450
}
0 commit comments