309 VkImageSubresourceLayers subresource = {
310 .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
316 VkOffset3D offset_UL = {
322 VkOffset3D offset_LR_mip_0 = {
328 VkOffset3D offset_LR_mip_1 = {
334 VkOffset3D offset_LR_mip_2 = {
340 VkImageBlit blit_mip_0_to_1 = {
341 .srcSubresource = subresource,
342 .srcOffsets[0] = offset_UL,
343 .srcOffsets[1] = offset_LR_mip_0,
344 .dstSubresource = subresource,
345 .dstOffsets[0] = offset_UL,
346 .dstOffsets[1] = offset_LR_mip_1,
349 VkImageBlit blit_mip_1_to_2 = {
350 .srcSubresource = subresource,
351 .srcOffsets[0] = offset_UL,
352 .srcOffsets[1] = offset_LR_mip_1,
353 .dstSubresource = subresource,
354 .dstOffsets[0] = offset_UL,
355 .dstOffsets[1] = offset_LR_mip_2,
361 vkCmdBlitImage(cmd_buf,
362 qvk.
images[VKPT_IMG_TAA_OUTPUT], VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
363 qvk.
images[VKPT_IMG_BLOOM_DOWNSCALE_MIP_1], VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
364 1, &blit_mip_0_to_1, VK_FILTER_LINEAR);
372 vkCmdBlitImage(cmd_buf,
373 qvk.
images[VKPT_IMG_BLOOM_DOWNSCALE_MIP_1], VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
374 qvk.
images[VKPT_IMG_BLOOM_VBLUR], VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
375 1, &blit_mip_1_to_2, VK_FILTER_LINEAR);
381 VkDescriptorSet desc_sets[] = {
391 vkCmdBindPipeline(cmd_buf, VK_PIPELINE_BIND_POINT_COMPUTE,
pipelines[
BLUR]);
392 vkCmdBindDescriptorSets(cmd_buf, VK_PIPELINE_BIND_POINT_COMPUTE,
397 vkCmdDispatch(cmd_buf,
407 vkCmdDispatch(cmd_buf,
416 VkImageSubresourceLayers subresource = {
417 .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
423 VkOffset3D offset_UL = {
429 VkOffset3D offset_LR_input = {
435 VkImageBlit blit_region = {
436 .srcSubresource = subresource,
437 .srcOffsets[0] = offset_UL,
438 .dstSubresource = subresource,
439 .dstOffsets[0] = offset_UL,
440 .dstOffsets[1] = offset_LR_input,
449 vis_img = VKPT_IMG_BLOOM_DOWNSCALE_MIP_1;
450 blit_region.srcOffsets[1].x =
IMG_WIDTH / 2;
455 vis_img = VKPT_IMG_BLOOM_HBLUR;
456 blit_region.srcOffsets[1].x =
IMG_WIDTH / 4;
461 vis_img = VKPT_IMG_BLOOM_VBLUR;
462 blit_region.srcOffsets[1].x =
IMG_WIDTH / 4;
467 vkCmdBlitImage(cmd_buf,
468 qvk.
images[vis_img], VK_IMAGE_LAYOUT_GENERAL,
469 qvk.
images[VKPT_IMG_TAA_OUTPUT], VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
470 1, &blit_region, VK_FILTER_LINEAR);
476 vkCmdBindDescriptorSets(cmd_buf, VK_PIPELINE_BIND_POINT_COMPUTE,
478 vkCmdDispatch(cmd_buf,