graphics: clamp host mip levels and gate layered block views #717
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!717
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-717"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@YuhiAida on GitHub · 2026-09-19 14:46 UTC · original
YuhiAida:vulkan-shared-validations-dq7-issues→main· +225 −42 · 8 files · 6 commits · openSummary
Running Dragon Quest VII Reimagined (PPSA17942) with
VK_LAYER_KHRONOS_validationenabled takesthe emulator down twice during early gameplay, with a fatal validation error each time:
VUID-VkImageCreateInfo-mipLevels-00958— the guest can declare a mip tail deeper than thehost image's mip chain allows, so
vkCreateImageis rejected.VUID-VkImageViewCreateInfo-image-09487— a block-format (BC) view withlayerCount > 1isonly legal with the maintenance6
blockTexelViewCompatibleMultipleLayerscapability.Both abort through
EXIT, so they are fatal, not cosmetic. This PR removes both and keeps theinformation needed to see where guest mip tails get mapped.
What changed
image.{h,cpp}:ImageOps::HostMipChainLength(bit_width(max(w,h,depth))) andImageOps::HostMipLevels(min(guest levels, chain)); the host image is created with theclamped count. Barriers, resolves, copies and image-to-image transfers map a phantom guest
range onto the deepest host level instead of referencing a level that does not exist.
ImageOps::ReportMipClamplogs one line per site (capped at 32 prints) when a range isclamped: address, type, format, extent, guest/host level counts, range, layers, samples,
pitch, tile mode. Source and destination ranges are reported independently, so an out-of-chain
source cannot hide behind a valid destination range.
textureCache.cpp: uploads drop regions above the host chain,ClearImageclamps to thedeepest host level and derives
full_imagefrom the backing count, andSynchronizeBufferFromImagedeclines volume mip tails rather than reading levels the hostimage does not have.
imageView.cpp: view mip ranges are clamped the same way. A multi-layer uncompressed view ofa block-compressed image is rejected before creation when the device lacks the capability,
since the layer count cannot be legalised without maintenance6 and the driver would reject or
misread the view.
vulkanWindow.cpp/graphicContext.h:VK_KHR_maintenance6is enabled andVkPhysicalDeviceMaintenance6Properties::blockTexelViewCompatibleMultipleLayersis queriedat device creation, with the result logged.
Nothing changes for images whose guest mip count already fits the host chain —
HostMipLevelsreturns the guest count in that case.
Evidence
With Vulkan validation, SPIR-V validation and GPU-AV enabled:
VUID-VkImageCreateInfo-mipLevels-00958at guest00:00:25.15800:12:09, still presenting00:00:24.69–25.24The clamp reports land in exactly the window where the unfixed build died, and the post-fix run
carries none of the previous
[Vulkan][E]output. The capability line reportsVulkan block texel view multiple layers support: trueon the development GPU, so the layeredblock view is created natively there; the rejection path covers devices that report
false.A later 120 s run of the current head with validation enabled and no
vk_layer_settings.txtpresent (no VUID muting) reports 0 errors and only the pre-existing
out_mrt_0draw warning(10 lines, the layer's duplicate-message limit), so the result does not depend on muting any
VUID.
Gameplay reaches and passes the second stop on hardware — that is the only confirmation for the
09487site, since the pre-fix abort makes an automated A/B of that exact content pointimpractical.
Tests
kyty_testsbuilds.image_page_table,gpu_tiler,texture_cache_layered_image,host_image_allocation,texture_cache_image_views,texture_cache_storage_sampled,texture_cache_depth_readback,compute_meta_clear_classification,buffer_cache_dirty_gcall pass. (The graphics tests need a real device — they abort with
ErrorIncompatibleDriverin the build container.)
emulator_user_name_cli,emulator_user_name_too_long,emulator_present_mode_cli,emulator_present_mode_invalid) pass in the container.Notes for reviewers
chain does not have, and transfers that would need it are skipped or declined (volume mip
tails), with a report line. If a title is later found to genuinely depend on reading such a
level, that case needs a real fix in the guest mip layout handling rather than this clamp.
ImageOps::ReportMipClampis a diagnostic; it is intentionally not gated behind a configflag, but is capped at 32 lines per site so it cannot flood the log.
@coderabbitai[bot] on GitHub · 2026-09-19 15:00 UTC · original · edited 2026-09-29 20:26 UTC
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
📝 Walkthrough
Walkthrough
Image creation now caps mip levels to the host-supported chain. Image operations, texture transfers, clears, and buffer synchronization account for guest mip ranges beyond that chain. Resolve and copy operations return status, and callers use that status when updating GPU-written state and freeing copy sources. Vulkan setup records Maintenance 6 support for multi-layer block-texel views. Image-view creation clamps mip ranges and stops when the required capability is unavailable.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: 🔵 Low · up to
b79a3A narrow unremapped-volume case can make a buffer copy use stale contents instead of GPU-written image data. Prevent the copy when synchronization fails; the impact is bounded but should be addressed.
Security Architecture Review
Security architecture risk: 🟡 Moderate · up to
b79a3A guest-declared volume mip tail can now prevent an image-to-buffer update while a later buffer copy continues. That may produce stale data. The review found no demonstrated escape beyond the emulator’s graphics data flow.
Retained concerns
Security review details
Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-09-19 15:00 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
0cf252c6-0f35-4985-b98b-57088cac11bb📥 Commits
Reviewing files that changed from the base of the PR and between
f100f785daand2d5e6cde23.📒 Files selected for processing (6)
src/graphics/host_gpu/graphicContext.hsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/image/image.cppsrc/graphics/host_gpu/renderer/image/image.hsrc/graphics/host_gpu/renderer/image/imageView.cppsrc/graphics/presentation/window/vulkanWindow.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@coderabbitai[bot] on GitHub · 2026-09-19 15:00 UTC · original · edited 2026-09-19 15:16 UTC
On
src/graphics/host_gpu/renderer/image/image.cppline 385 (outdated):🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 5655
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 5815
Report source and destination mip overflows separately.
When only
source_range.base_levelis unavailable, the current call reports the valid destination range againstinfo.ReportMipClampcan return without logging, so the source overflow is suppressed. Reportsource_rangeagainstsource.infowhen the source check fails, and reportdestination_rangeagainstinfowhen the destination check fails.✅ Addressed in commit
35de8b9@ -360,0 +371,4 @@if (static_cast<bool>(image.flags & vk::ImageCreateFlagBits::eBlockTexelViewCompatible) &&normalized.layer_count > 1 &&(ImageViewOps::FormatClass(normalized.format) & ImageViewOps::BlockFormatClasses) == 0 &&!m_graphics.supports_block_texel_view_multiple_layers) {@coderabbitai[bot] on GitHub · 2026-09-19 15:00 UTC · original · edited 2026-09-19 15:16 UTC
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 7238
🌐 Web query:
site:registry.khronos.org/vulkan/specs/latest/html VK_KHR_maintenance6 blockTexelViewCompatibleMultipleLayers uncompressed layerCount image view💡 Result:
<search_synthesis>
The requested feature blockTexelViewCompatibleMultipleLayers is not present in the current Vulkan specification documentation provided. Based on the available search results, there is no information confirming the existence or definition of a feature by that name within the VK_KHR_maintenance6 extension or the broader Vulkan specification [1].
</search_synthesis>
<source_evidence>
https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html * 12.3 ... * 12.4. Image Layouts * 12.5. Image Views * 12.6. Acceleration Structures ... * Appendix C: Compressed Image Formats * Block-Compressed Image Formats * ETC Compressed Image Formats * ASTC Compressed Image Formats * PVRTC Compressed Image FormatsCitations:
🌐 Web query:
Vulkan specification VK_KHR_maintenance6 blockTexelViewCompatibleMultipleLayers layerCount uncompressed format VUID💡 Result:
<search_synthesis>
The Vulkan extension VK_KHR_maintenance6 (now part of Vulkan 1.4) introduced the blockTexelViewCompatibleMultipleLayers property to address restrictions on creating image views with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag [1][2][3]. Prior to this extension, the Vulkan specification required that if an image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, the levelCount and layerCount members of the subresourceRange had to be exactly 1 [4]. This restriction was enforced by validation layers, often associated with VUID-VkImageViewCreateInfo-image-01584 [4]. The blockTexelViewCompatibleMultipleLayers property, found in the VkPhysicalDeviceMaintenance6Properties structure, allows an implementation to indicate whether it supports creating such image views with a layerCount greater than 1 [2][3]. If this property is VK_TRUE, the restriction requiring a layerCount of 1 is lifted for that implementation [2][3]. If an application attempts to create an image view with a layerCount greater than 1 while using the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag on an implementation where blockTexelViewCompatibleMultipleLayers is VK_FALSE, it will trigger a validation error [4][2]. Applications should query this property via vkGetPhysicalDeviceProperties2 before attempting to create multi-layer views with block-compressed formats [2][5].
</search_synthesis>
<source_evidence>
https://docs.vulkan.org/features/latest/features/proposals/VK_KHR_maintenance6.html Creating image views with`VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT` and multiple layers is supported by all modern hardware, so this should be exposed by the API. ... ``` typedef struct VkPhysicalDeviceMaintenance6PropertiesKHR { VkStructureType sType; void* pNext; VkBool32 blockTexelViewCompatibleMultipleLayers; uint32_t maxCombinedImageSamplerDescriptorCount; VkBool32 fragmentShadingRateClampCombinerInputs; } VkPhysicalDeviceMaintenance6PropertiesKHR; ... The`blockTexelViewCompatibleMultipleLayers` property indicates whether a`VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT` can be used with a`layerCount` of greater than`1`. ... The`maxCombinedImageSamplerDescriptorCount` property indicates the maximum number of descriptors needed for any of the multi-planar formats supported by the implementation that require`YCbCr` conversion . https://docs.vulkan.org/refpages/latest/refpages/source/VkPhysicalDeviceMaintenance6Properties.html VkPhysicalDeviceMaintenance6Properties(3) :: Vulkan Documentation Project # VkPhysicalDeviceMaintenance6Properties(3) ## Name VkPhysicalDeviceMaintenance6Properties - Structure describing various implementation-defined properties introduced with VK_KHR_maintenance6 ## C Specification The`VkPhysicalDeviceMaintenance6Properties` structure is defined as: ``` // Provided by VK_VERSION_1_4 typedef struct VkPhysicalDeviceMaintenance6Properties { VkStructureType sType; void* pNext; VkBool32 blockTexelViewCompatibleMultipleLayers; uint32_t maxCombinedImageSamplerDescriptorCount; VkBool32 fragmentShadingRateClampCombinerInputs; } VkPhysicalDeviceMaintenance6Properties; ``` c Copied! ``` // Provided by VK_KHR_maintenance6 // Equivalent to VkPhysicalDeviceMaintenance6Properties typedef VkPhysicalDeviceMaintenance6Properties VkPhysicalDeviceMaintenance6PropertiesKHR; ``` c Copied! ## Members `sType` is a VkStructureType value identifying this structure. `pNext` is`NULL` or a pointer to a structure extending this structure. ## Description `blockTexelViewCompatibleMultipleLayers` is a boolean value indicating that an implementation supports creating image views with VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT where the`layerCount` member of`subresourceRange` is greater than`1`. `maxCombinedImageSamplerDescriptorCount` is the maximum number of combined image sampler descriptors that the implementation uses to access any of the formats that require a sampler Y′CBCR conversion supported by the implementation. `fragmentShadingRateClampCombinerInputs` is a boolean value indicating that an implementation clamps the inputs to combiner operations. If the`VkPhysicalDeviceMaintenance6Properties` structure is included in the`pNext` chain of the VkPhysicalDeviceProperties2 structure passed to vkGetPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property. Valid Usage (Implicit) VUID-VkPhysicalDeviceMaintenance6Properties-sType-sType`sType` must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES Structure Chaining ## See Also VK_KHR_maintenance6, VK_VERSION_1_4,`VkBool32`, VkStructureType ## Document Notes For more information, see the Vulkan Specification. This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly. https://vulkan.lunarg.com/doc/view/1.4.335.0/linux/antora/refpages/latest/refpages/source/VkPhysicalDeviceMaintenance6Properties.html VkPhysicalDeviceMaintenance6Properties(3) :: Vulkan Documentation Project # VkPhysicalDeviceMaintenance6Properties(3) ## Name VkPhysicalDeviceMaintenance6Properties - Structure describing various implementation-defined properties introduced with VK_KHR_maintenance6 ## C Specification The`VkPhysicalDeviceMaintenance6Properties` structure is defined as: ``` // Provided by VK_VERSION_1_4 typedef struct VkPhysicalDeviceMaintenance6Properties { VkStructureType sType; void* pNext; VkBool32 blockTexelViewCompatibleMultipleLayers; uint32_t maxCombinedImageSamplerDescriptorCount; VkBool32 fragmentShadingRateClampCombinerInputs; } VkPhysicalDeviceMaintenance6Properties; ``` ``` // Provided by VK_KHR_maintenance6 // Equivalent to VkPhysicalDeviceMaintenance6Properties typedef VkPhysicalDeviceMaintenance6Properties VkPhysicalDeviceMaintenance6PropertiesKHR; ``` ## Members `sType` is a VkStructureType value identifying this structure. `pNext` is`NULL` or a pointer to a structure extending this structure. ## Description `blockTexelViewCompatibleMultipleLayers` is a boolean value indicating that an implementation supports creating image views with`VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT` where the`layerCount` member of`subresourceRange` is greater than`1`. `maxCombinedImageSamplerDescriptorCount` is the maximum number of combined image sampler descriptors that the implementation uses to access any of the formats that require a sampler Y′CBCR conversion supported by the implementation. `fragmentShadingRateClampCombinerInputs` is a boolean value indicating that an implementation clamps the inputs to combiner operations. If the`VkPhysicalDeviceMaintenance6Properties` structure is included in the`pNext` chain of the VkPhysicalDeviceProperties2 structure passed to vkGetPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property. Valid Usage (Implicit) VUID-VkPhysicalDeviceMaintenance6Properties-sType-sType`sType` must be`VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES` ## See Also VK_KHR_maintenance6, VK_VERSION_1_4,`VkBool32`, VkStructureType ## Document Notes For more information, see the Vulkan Specification. This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly. GitHub issue 1495 in KhronosGroup/Vulkan-ValidationLayers (link omitted to avoid creating a cross-reference) `vkCreateImageView(): pCreateInfo->format with tiling VK_IMAGE_TILING_OPTIMAL does not support usage that includes VK_IMAGE_USAGE_STORAGE_BIT. The Vulkan spec states: If usage contains VK_IMAGE_USAGE_STORAGE_BIT, then the image view&`#39`;s format features must contain VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-usage-02275)` ... This is made possible by two flags introduced in [vk_khr_maintenance2](https://github.com/KhronosGroup/Vulkan-Docs/blob/master/appendices/VK_KHR_maintenance2.txt). ... VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag allows to create an image view with an uncompressed format of an image with a compressed format. ... VK_IMAGE_CREATE_EXTENDED_USAGE_BIT allows to create images with incompatible format/usages. This is necessary because compressed formats doesn&`#39`;t allow the storage bit. Which means it would be impossible to create the image, but it would also be impossible to create an image view with the same format as the compressed image, used only for reading. ... This problem is referenced by ... 96. Assuming the above example is correct according to ... specs, there is no way ... validation layers to detect ... . VK_IMAGE_CREATE_EXTENDED_USAGE_BIT should only ... used in order ... , so shouldn&`#39`;t validation ... > ``` > VUID-VkImageCreateInfo-flags-01572 > If flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, then format must be a > block-compressed image format, an ETC compressed image format, or an ASTC > compressed image format. ... > • VUID-VkImageCreateInfo-flags-01573 > If flags contains VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, then flags must also > contain VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT. ... > • VUID-VkImageViewCreateInfo-image-01583 > If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, > format must be compatible with, or must be an uncompressed format that is sizecompatible with, the format used to create image. > • VUID-VkImageViewCreateInfo-image-01584 > If image was created with the VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, the > levelCount and layerCount members of subresourceRange must both be 1. > ``` ... > Sorry, I bumped this one towards the back of the wagon so many times it eventually _fell off_ ... wagon. > > I&`#39`;m not sure the original VUID (02275) can be reproduced, at least not without hitting `02251` first. I&`#39`;ve put up a change (`#3662`) that addresses the CTS error, and I _think_ it should resolve the one `@danginsburg` is seeing as well, but I&`#39`;m having hardware issues at the moment trying to get the original replay to work. I&`#39`;m not 100% sure my change is correct, though; I think it is, but the worry is that by using `VK_IMAGE_CREATE_EXTENDED_USAGE_BIT` one could create an image view later on that fails in the driver without triggering a validation message. I need to do some more testing on my part to try and verify that is working correctly. ... > EDIT: Sorry, I realize there is a `VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT` being used, so a "size-compatible uncompressed" format can be used which can support the format feature flag I guess > > --- > > So I was able to run `dEQP-VK.image.sample_texture.128_bit_compressed_format` and get the `VUID-VkImageCreateInfo-imageCreateMaxMipLevels-02251` error because it doesn&`#39`;t support the `VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT` bit > > > VK_IMAGE_CREATE_EXTENDED_USAGE_BIT allows to create images with incompatible format/usages. This is necessary because compressed formats doesn&`#39`;t allow the storage bit. Which means it would be impossible to create the image, but it would also be impossible to create an image view with the same format as the compressed image, used only for reading. > > I guess I don&`#39`;t see this as a Validation Layer…[truncated] https://vkdoc.net/man/VkPhysicalDeviceMaintenance6Features VkPhysicalDeviceMaintenance6Features - VulkanHub # VkPhysicalDeviceMaintenance6Features Structure describing whether the implementation supports maintenance6 functionality The `VkPhysicalDeviceMaintenance6Features` structure is defined as: C Rust ```c typedef struct VkPhysicalDeviceMaintenance6Features { VkStructureType sType; void* pNext; VkBool32 maintenance6; } VkPhysicalDeviceMaintenance6Features; ``` ```rs pub struct PhysicalDeviceMaintenance6Features { s_type: vk::StructureType, p_next: *mut c_void, maintenance6: vk::Bool32, } ``` ```c typedef VkPhysicalDeviceMaintenance6Features VkPhysicalDeviceMaintenance6FeaturesKHR; ``` ```rs type PhysicalDeviceMaintenance6FeaturesKHR = vk::PhysicalDeviceMaintenance6Features; ``` This structure describes the following feature: - `sType` is a VkStructureType value identifying this structure. - `pNext` is `NULL` or a pointer to a structure extending this structure. - EXTENSION FEATURES MAINTENANCE6 `maintenance6` indicates that the implementation supports the following: - VK_NULL_HANDLE can be used when binding an index buffer - VkBindMemoryStatus can be included in the `pNext` chain of the VkBindBufferMemoryInfo and VkBindImageMemoryInfo structures, enabling applications to retrieve VkResult values for individual memory binding operations. - VkPhysicalDeviceMaintenance6Properties::`blockTexelViewCompatibleMultipleLayers` property to indicate that the implementation supports creating image views with `VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT` where the `layerCount` member of `subresourceRange` is greater than `1`. - VkPhysicalDeviceMaintenance6Properties::`maxCombinedImageSamplerDescriptorCount` property which indicates the maximum descriptor size required for any format that requires a sampler Y′C B C R conversion supported by the implementation. - A VkPhysicalDeviceMaintenance6Properties::`fragmentShadingRateClampCombinerInputs` property which indicates whether the implementation clamps the inputs to fragment shading rate combiner operations. If the `VkPhysicalDeviceMaintenance6Features` structure is included in the `pNext` chain of the VkPhysicalDeviceFeatures2 structure passed to vkGetPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. If the application wishes to use a VkDevice with any features described by `VkPhysicalDeviceMaintenance6Features`, it must add an instance of the structure, with the desired feature members set to `VK_TRUE`, to the `pNext` chain of VkDeviceCreateInfo when creating the VkDevice. #### VUID-VkPhysicalDeviceMaintenance6Features-sType-sType `sType` must be `VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES` Parent VK_VERSION_1_4 Type Structures ExtendsCitations:
🌐 Web query:
site:registry.khronos.org/vulkan/specs/latest/html "blockTexelViewCompatibleMultipleLayers" "layerCount"💡 Result:
<search_synthesis>
The requested term blockTexelViewCompatibleMultipleLayers does not appear in the provided search results from the Vulkan 1.4.362 specification. Consequently, there is no information available in the provided sources regarding its relationship with layerCount.
</search_synthesis>
<source_evidence>
https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html 45.1. Instance and Device Functionality * 45.2. Core Versions * 45.3. Layers * 45.4. Extensions * 45.5. Extension Dependencies * 45.6. Compatibility Guarantees (Informative) ... * Appendix E: Layers & Extensions (Informative) * Extension DependenciesCitations:
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 297
Reject unsupported multi-layer block-texel views before
createImageView.When
supports_block_texel_view_multiple_layersis false, this branch only logs the unsupported request.createImageViewthen receives the unchanged multi-layernormalized.layer_count. Vulkan validation can report this invalid usage, and the implementation can reject image-view creation. This function callsEXITwhen creation fails.Reject the view before creation, or implement a per-layer fallback. Do not clamp
layer_count.Proposed guard
📝 Committable suggestion
✅ Addressed in commit
35de8b9@YuhiAida on GitHub · 2026-09-19 15:37 UTC · original
Outside-diff finding "Do not mark the destination GPU-modified when no copy occurs" (
textureCache.cpp:697-700) — addressed incae4e77.Took the suggested shape:
Image::CopyMipnow returns whether it actually copied (false whenmip >= destination.backing.mip_levels, i.e. the guest mip maps beyond the host mip chain), andTextureCache::CopyImageMipmarks the destination GPU-modified only on success, soResolveDepthOverlap/ExpandImagecan no longer claim ownership of pixels that were never transferred.While tracing the callers I found the same silent return in
Image::Resolve, and it was worse in that case:ResolveColorTargetscalledcache.MarkGpuWritten(dst.image_id)before the resolve, andCommitGpuWriteclearsBufferModified/CpuDirty, so a skipped resolve would additionally mask a missing blit.Resolvealso returns bool now and the mark only happens after a successful resolve. The remaining clamp sites (view,barriers,clear) clamp onto the deepest host level and proceed, so they were left as-is.On reachability:
ReportMipClamphad a single global 32-report budget which theview/barriersreports were saturating, so the other sites' real counts were invisible. It now has a per-site budget (first 4 verbatim, then a log-scale heartbeat with a total). A 120 s replay of the DQ7 sequence withVULKAN_VALIDATION=trueon the fixed build reportscopy-mip=0,resolve=0,view≥32,barriers≥32,create=3— so on this content both skip paths are latent rather than currently corrupting state, and the run finished with no fatal or validation errors. The guard is there for when a guest image does present a mip beyond the host chain on another path.@coderabbitai[bot] on GitHub · 2026-09-29 19:28 UTC · original · edited 2026-09-29 20:15 UTC
On
src/graphics/host_gpu/renderer/cache/textureCache.cppline 668 (outdated):🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Preserve the source when a mip copy is skipped.
If a GPU-modified source maps to a destination mip beyond the host chain,
CopyMipreturnsfalsehere.ResolveOverlapandExpandImagestill callFreeImageon that source.FreeImageclears its GPU-modified flag and deletes the image, so the GPU-written contents are lost. Propagate the copy result to those callers. Retain or write back the source before freeing it.✅ Addressed in commit
b79a361@coderabbitai[bot] on GitHub · 2026-09-29 19:28 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
cac61661-6e52-457f-88e6-3f5149689711📥 Commits
Reviewing files that changed from the base of the PR and between
cae4e77d01and4250a4d322.📒 Files selected for processing (6)
src/graphics/host_gpu/graphicContext.hsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/image/image.cppsrc/graphics/host_gpu/renderer/image/image.hsrc/graphics/host_gpu/renderer/renderDraw.cppsrc/graphics/presentation/window/vulkanWindow.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
@coderabbitai[bot] on GitHub · 2026-09-29 20:23 UTC · original · reviewed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
ec2aefe3-a3e1-4411-90a0-8393dd232dcc📥 Commits
Reviewing files that changed from the base of the PR and between
4250a4d322andb79a361af2.📒 Files selected for processing (2)
src/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.h🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.