| 668 | ResourceUsageTag AccessContext::AsyncReference::StartTag() const { return (tag_ == kInvalidTag) ? context_->StartTag() : tag_; } |
| 669 | |
| 670 | AttachmentViewGen::AttachmentViewGen(const vvl::ImageView* image_view, const VkOffset3D& offset, const VkExtent3D& extent) |
| 671 | : view_(image_view) { |
| 672 | gen_store_[Gen::kViewSubresource].emplace(MakeImageRangeGen(*image_view)); |
| 673 | |
| 674 | const bool has_depth = vkuFormatHasDepth(image_view->create_info.format); |
| 675 | const bool has_stencil = vkuFormatHasStencil(image_view->create_info.format); |
| 676 | |
| 677 | // For depth-stencil attachment, the view's aspect flags are ignored according to the spec. |
| 678 | // MakeImageRangeGen works with the aspect flags. Derive aspect from format. |
| 679 | VkImageAspectFlags override_aspect_flags = 0; |
| 680 | if (has_depth || has_stencil) { |
| 681 | override_aspect_flags |= has_depth ? VK_IMAGE_ASPECT_DEPTH_BIT : 0; |
| 682 | override_aspect_flags |= has_stencil ? VK_IMAGE_ASPECT_STENCIL_BIT : 0; |
| 683 | } |
| 684 | |
| 685 | // Range gen for attachment's render area |
| 686 | gen_store_[Gen::kRenderArea].emplace(MakeImageRangeGen(*image_view, offset, extent, override_aspect_flags)); |
| 687 | |
| 688 | // If attachment has both depth and stencil aspects then add range gens to represent each aspect separately. |
| 689 | if (has_depth && has_stencil) { |
| 690 | gen_store_[Gen::kDepthOnlyRenderArea].emplace(MakeImageRangeGen(*image_view, offset, extent, VK_IMAGE_ASPECT_DEPTH_BIT)); |
| 691 | gen_store_[Gen::kStencilOnlyRenderArea].emplace( |
| 692 | MakeImageRangeGen(*image_view, offset, extent, VK_IMAGE_ASPECT_STENCIL_BIT)); |
| 693 | } |
| 694 | } |
| 695 | |
| 696 | ImageRangeGen AttachmentViewGen::GetRangeGen(AttachmentViewGen::Gen type, uint32_t view_index) const { |
| 697 | // Restrict image view's subresource range to a specific multiview layer |
nothing calls this directly
no test coverage detected