@@ -2332,14 +2332,7 @@ void DeviceContextVkImpl::CopyTexture(const CopyTextureAttribs& CopyAttribs)
23322332
23332333 auto GetAspectMak = [](TEXTURE_FORMAT Format) -> VkImageAspectFlags {
23342334 const TextureFormatAttribs& FmtAttribs = GetTextureFormatAttribs (Format);
2335- switch (FmtAttribs.ComponentType )
2336- {
2337- // clang-format off
2338- case COMPONENT_TYPE_DEPTH: return VK_IMAGE_ASPECT_DEPTH_BIT;
2339- case COMPONENT_TYPE_DEPTH_STENCIL: return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
2340- // clang-format on
2341- default : return VK_IMAGE_ASPECT_COLOR_BIT;
2342- }
2335+ return ComponentTypeToVkAspectMask (FmtAttribs.ComponentType );
23432336 };
23442337 VkImageAspectFlags aspectMask = GetAspectMak (SrcTexDesc.Format );
23452338 DEV_CHECK_ERR (aspectMask == GetAspectMak (DstTexDesc.Format ), " Vulkan spec requires that dst and src aspect masks must match" );
@@ -2543,7 +2536,7 @@ static VkBufferImageCopy GetBufferImageCopyInfo(Uint64 BufferOffset,
25432536 // that is a (mostly) tightly packed representation of the depth or stencil data.
25442537 // To copy both the depth and stencil aspects of a depth/stencil format, two entries in
25452538 // pRegions can be used, where one specifies the depth aspect in imageSubresource, and the
2546- // other specifies the stencil aspect (18.4)
2539+ // other specifies the stencil aspect.
25472540 }
25482541 else
25492542 CopyRegion.imageSubresource .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
@@ -3020,7 +3013,7 @@ void DeviceContextVkImpl::TransitionTextureState(TextureVkImpl& Textur
30203013 {
30213014 // If image has a depth / stencil format with both depth and stencil components, then the
30223015 // aspectMask member of subresourceRange must include both VK_IMAGE_ASPECT_DEPTH_BIT and
3023- // VK_IMAGE_ASPECT_STENCIL_BIT (6.7.3)
3016+ // VK_IMAGE_ASPECT_STENCIL_BIT
30243017 pSubresRange->aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
30253018 }
30263019 else
@@ -4083,14 +4076,7 @@ void DeviceContextVkImpl::BindSparseResourceMemory(const BindSparseResourceMemor
40834076 const TextureDesc& TexDesc = pTexVk->GetDesc ();
40844077 const SparseTextureProperties& TexSparseProps = pTexVk->GetSparseProperties ();
40854078 const TextureFormatAttribs& FmtAttribs = GetTextureFormatAttribs (TexDesc.Format );
4086-
4087- VkImageAspectFlags aspectMask = 0 ;
4088- if (FmtAttribs.ComponentType == COMPONENT_TYPE_DEPTH)
4089- aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
4090- else if (FmtAttribs.ComponentType == COMPONENT_TYPE_DEPTH_STENCIL)
4091- aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
4092- else
4093- aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
4079+ const VkImageAspectFlags aspectMask = ComponentTypeToVkAspectMask (FmtAttribs.ComponentType );
40944080
40954081 Uint32 NumImageBindsInRange = 0 ;
40964082 for (Uint32 r = 0 ; r < TexBind.NumRanges ; ++r)
0 commit comments