Title: Errors for a Clear Attachment for Stencil values if first in a vsg::View · Issue #1514 · vsg-dev/VulkanSceneGraph · GitHub
Open Graph Title: Errors for a Clear Attachment for Stencil values if first in a vsg::View · Issue #1514 · vsg-dev/VulkanSceneGraph
X Title: Errors for a Clear Attachment for Stencil values if first in a vsg::View · Issue #1514 · vsg-dev/VulkanSceneGraph
Description: I have a stencil clear attachment that I initialize like so: VkClearValue clearStencilValue{}; clearStencilValue.depthStencil = { 0.0f, 0 }; VkClearAttachment stencil_attachment{ VK_IMAGE_ASPECT_STENCIL_BIT, 1, clearStencilValue }; VkCle...
Open Graph Description: I have a stencil clear attachment that I initialize like so: VkClearValue clearStencilValue{}; clearStencilValue.depthStencil = { 0.0f, 0 }; VkClearAttachment stencil_attachment{ VK_IMAGE_ASPECT_ST...
X Description: I have a stencil clear attachment that I initialize like so: VkClearValue clearStencilValue{}; clearStencilValue.depthStencil = { 0.0f, 0 }; VkClearAttachment stencil_attachment{ VK_IMAGE_ASPECT_ST...
Opengraph URL: https://github.com/vsg-dev/VulkanSceneGraph/issues/1514
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Errors for a Clear Attachment for Stencil values if first in a vsg::View","articleBody":"I have a stencil clear attachment that I initialize like so:\n\n **VkClearValue clearStencilValue{};\n clearStencilValue.depthStencil = { 0.0f, 0 };\n VkClearAttachment stencil_attachment{ VK_IMAGE_ASPECT_STENCIL_BIT, 1, clearStencilValue };\n VkClearRect rect{ m_camera-\u003egetRenderArea(), 0, 1 };\n m_stencil_clear_attachments = vsg::ClearAttachments::create(vsg::ClearAttachments::Attachments{ stencil_attachment }, vsg::ClearAttachments::Rects{ rect });**\n\nIf I add this as my first child to my main vsg::View, I will get the errors showing to the console if I turn on debugLayer:\n\n**Validation Error: [ VUID-vkCmdClearAttachments-aspectMask-07885 ] | MessageID = 0x5baaed1d\nvkCmdClearAttachments(): pAttachments[0] in pSubpasses[0] has VK_IMAGE_ASPECT_STENCIL_BIT and is backed by an image view with format (VK_FORMAT_D32_SFLOAT).\nThe Vulkan spec states: If the current render pass instance does not use dynamic rendering, and the aspectMask member of any element of pAttachments contains VK_IMAGE_ASPECT_STENCIL_BIT, the current subpass instance's depth-stencil attachment must be either VK_ATTACHMENT_UNUSED or the attachment format must contain a stencil component (https://vulkan.lunarg.com/doc/view/1.4.309.0/windows/antora/spec/latest/chapters/clears.html#VUID-vkCmdClearAttachments-aspectMask-07885)\nObjects: 3\n [0] VkCommandBuffer 0x1b71fecdef0\n [1] VkRenderPass 0xba7514000000002a\n [2] VkImageView 0xb9181f0000000029**\n\nThis appears to be because I have the view dependent shadows on and I get more than one (maybe because I have requested more than one shadowmap?)\n\nIf Instead, I add a large scene group node to the view, and somewhere down in the group I add this clear attachment, I will not see these errors.\n\nEither way, the results look fine on the screen - I think it's just complaining that the clear stencil isn't going to work for the shadow image which is a depth-only image (VK_FORMAT_D32_SFLOAT) I believe.\n\nI expected that it wouldn't matter where I place this attachment. I'm trying to place it as a separate first child in my main view because I also have an off-screen view which needs a DIFFERENT attachment because it will have a different rect for it's offscreen image size. If I try to share this attachment in a single scene with both vsg::Views, I get the mismatch size error because this clear attachment won't work for both views. Any thoughts? Should I just ignore them?\n\n - OS: Windows 11 x64\n","author":{"url":"https://github.com/hytel","@type":"Person","name":"hytel"},"datePublished":"2025-06-25T16:34:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1514/VulkanSceneGraph/issues/1514"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5cda093a-f626-bccc-96e9-edd1dce93a82 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D09A:2FC02B:1B03271:2368181:698C2FA4 |
| html-safe-nonce | 6f6bed121233803b275fcec830f7b9606e9a08711ce2cf8056f977a04940f988 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDlBOjJGQzAyQjoxQjAzMjcxOjIzNjgxODE6Njk4QzJGQTQiLCJ2aXNpdG9yX2lkIjoiMTUyMzYwODE1NTAzMTYxMzM0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 61906d6c7341ef327a85cc88b92079ea614f89b179a6d736563d7b8af3b62534 |
| hovercard-subject-tag | issue:3176273231 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/vsg-dev/VulkanSceneGraph/1514/issue_layout |
| twitter:image | https://opengraph.githubassets.com/53ec41550dcf457a5f25f7e027c3cbbfb8ebbcfe45b6ed8f8ded201f3bb08879/vsg-dev/VulkanSceneGraph/issues/1514 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/53ec41550dcf457a5f25f7e027c3cbbfb8ebbcfe45b6ed8f8ded201f3bb08879/vsg-dev/VulkanSceneGraph/issues/1514 |
| og:image:alt | I have a stencil clear attachment that I initialize like so: VkClearValue clearStencilValue{}; clearStencilValue.depthStencil = { 0.0f, 0 }; VkClearAttachment stencil_attachment{ VK_IMAGE_ASPECT_ST... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hytel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/vsg-dev/VulkanSceneGraph git https://github.com/vsg-dev/VulkanSceneGraph.git |
| octolytics-dimension-user_id | 44898258 |
| octolytics-dimension-user_login | vsg-dev |
| octolytics-dimension-repository_id | 148609004 |
| octolytics-dimension-repository_nwo | vsg-dev/VulkanSceneGraph |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 148609004 |
| octolytics-dimension-repository_network_root_nwo | vsg-dev/VulkanSceneGraph |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3d444f0a47beeeac94cddbb51c91ab408befe8d4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width