mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[dxvk] Introduce concept of transfer-only views
This commit is contained in:
parent
fd439c3e54
commit
ae90e74a5a
@ -296,8 +296,20 @@ namespace dxvk {
|
||||
|
||||
|
||||
VkImageView DxvkImageView::createView(VkImageViewType type) const {
|
||||
constexpr VkImageUsageFlags ViewUsage =
|
||||
VK_IMAGE_USAGE_SAMPLED_BIT |
|
||||
VK_IMAGE_USAGE_STORAGE_BIT |
|
||||
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
|
||||
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
|
||||
// Legalize view usage. We allow creating transfer-only view
|
||||
// objects so that some internal APIs can be more consistent.
|
||||
DxvkImageViewKey key = m_key;
|
||||
key.viewType = type;
|
||||
key.usage &= ViewUsage;
|
||||
|
||||
if (!key.usage)
|
||||
return VK_NULL_HANDLE;
|
||||
|
||||
// Only use one layer for non-arrayed view types
|
||||
if (type == VK_IMAGE_VIEW_TYPE_1D || type == VK_IMAGE_VIEW_TYPE_2D)
|
||||
|
Loading…
x
Reference in New Issue
Block a user