diff options
| author | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 19:08:54 +0100 |
|---|---|---|
| committer | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 19:08:54 +0100 |
| commit | 3af42c619253941610d9809e8a28a07e8dfdfdf2 (patch) | |
| tree | a675793195f8bc69c3caebb0e9614ecfb65e1c4c /runtime/src/vulkan_backend.h | |
| parent | e6af0a0931639ff33cdd4a28289da984f194c87e (diff) | |
| parent | ec8ec4c9a46c6623f1a9c125afd3566da97f1e0c (diff) | |
merge: preserve upstream changes alongside the asset fix
Diffstat (limited to 'runtime/src/vulkan_backend.h')
| -rw-r--r-- | runtime/src/vulkan_backend.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h index 93d7e5259..140d7234b 100644 --- a/runtime/src/vulkan_backend.h +++ b/runtime/src/vulkan_backend.h | |||
| @@ -1017,6 +1017,12 @@ public: | |||
| 1017 | replay_.zero_offset = offset; | 1017 | replay_.zero_offset = offset; |
| 1018 | replay_.zero_size = size; | 1018 | replay_.zero_size = size; |
| 1019 | } | 1019 | } |
| 1020 | |||
| 1021 | // Physical-device COLOR_ATTACHMENT format check for reinterpreted UAV clears. | ||
| 1022 | void set_color_attachment_format(std::function<bool(VkFormat)> check) { | ||
| 1023 | std::unique_lock lock(resource_mutex_); | ||
| 1024 | replay_.color_attachment_format = std::move(check); | ||
| 1025 | } | ||
| 1020 | std::uint64_t heap_base() { | 1026 | std::uint64_t heap_base() { |
| 1021 | std::shared_lock lock(resource_mutex_); | 1027 | std::shared_lock lock(resource_mutex_); |
| 1022 | return replay_.heap_base; | 1028 | return replay_.heap_base; |
| @@ -1238,10 +1244,10 @@ private: | |||
| 1238 | info.format = r.format; | 1244 | info.format = r.format; |
| 1239 | info.subresourceRange = range; | 1245 | info.subresourceRange = range; |
| 1240 | // Attachment views need only color-attachment usage. Inheriting STORAGE usage from a mutable/extended | 1246 | // Attachment views need only color-attachment usage. Inheriting STORAGE usage from a mutable/extended |
| 1241 | // resource (typeless RGBA8 sRGB views, or R32_UINT-backed R9G9B9E5 UAV images) would require unrelated usages. | 1247 | // resource (typeless views such as RGBA8 sRGB, or R32_UINT-backed R9G9B9E5 UAV images) would require unrelated usages. |
| 1242 | VkImageViewUsageCreateInfo usage{VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO}; | 1248 | VkImageViewUsageCreateInfo usage{VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO}; |
| 1243 | usage.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; | 1249 | usage.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; |
| 1244 | if (r.rgba8_typeless || (range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT && r.color_attachment)) | 1250 | if (r.typeless || (range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT && r.color_attachment)) |
| 1245 | info.pNext = &usage; | 1251 | info.pNext = &usage; |
| 1246 | VkImageView view = VK_NULL_HANDLE; | 1252 | VkImageView view = VK_NULL_HANDLE; |
| 1247 | if (vk.vkCreateImageView(device_, &info, nullptr, &view) != VK_SUCCESS) return VK_NULL_HANDLE; | 1253 | if (vk.vkCreateImageView(device_, &info, nullptr, &view) != VK_SUCCESS) return VK_NULL_HANDLE; |