Ogre Version: 3.0.0unstable (E)
Operating System: Windows 10
Render System: Vulkan
Hi, i have a compositor script that does operations in a particular order.
I'm rendering a RenderQueue A only on depth/Stencil buffer, I only need the Stencil buffer content after this Pass. So I'm doing these Passes on a rtt_depthbuffer target.
After getting the Stencil content I want. I'm prepping the rtt target which is the colour texture. Before executing the colour render_scene pass I'm clearing only depth buffer ( Why ? depth buffer content written on the depth/stencil only pass would be different from the one that is going to be populated on the render_scene pass on rtt target ) , where i get a Validation Error on Vulkan RenderSystem.
Validation Error:
Code: Select all
ERROR: [Validation] Code 0 : Validation Error: [ VUID-VkAttachmentDescription-format-06700 ] Object 0: handle = 0x17424a4d680, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x55b5cca5 | vkCreateRenderPass: pCreateInfo->pAttachments[1] format is VK_FORMAT_D32_SFLOAT_S8_UINT and stencilLoadOp is VK_ATTACHMENT_LOAD_OP_LOAD, but initialLayout is VK_IMAGE_LAYOUT_UNDEFINED. The Vulkan spec states: If format includes a stencil aspect and stencilLoadOp is VK_ATTACHMENT_LOAD_OP_LOAD, then initialLayout must not be VK_IMAGE_LAYOUT_UNDEFINED (https://vulkan.lunarg.com/doc/view/1.3.216.0/windows/1.3-extensions/vkspec.html#VUID-VkAttachmentDescription-format-06700)
Pseudo code for the compositor script:
Code: Select all
compositor_node TestNode
{
in 0 rt_renderwindow
texture rtt target_width target_height PFG_RGBA8_UNORM_SRGB msaa_auto
texture rtt_depthbuffer target_width target_height PFG_D32_FLOAT_S8X24_UINT msaa_auto
rtv rtt
{
depth_stencil rtt_depthbuffer
}
target rtt
{
pass clear
{
// clearing all buffers
}
}
target rtt_depthbuffer
{
pass stencil
{
// some stencil operation
}
pass render_scene
{
// rendering a paricular RenderQueue, lets call it A
// depth content after this pass is not needed
// only need stencil buffer content after this pass
}
}
target rtt
{
pass clear
{
// depth contents of the previous pass is not needed
buffers depth
// Getting Validation Error on this Pass
}
pass stencil
{
check false
}
pass render_scene
{
// Rendering A Queue's colour and depth
}
// Other passes
}
// Finally copying rtt texture and render it as a Quad on rt_renderwindow
}
Result-Wise this script works I get the final output I want on all RenderSystems. But I'm afraid I would be facing problems in the future since it is throwing Validation Error.