vsgoffscreenshot exports the image data to 0 #1397
-
Hi, I am developing a project using vsg and I need to use off-screen rendering, i.e. provide a vsg::Node to return a PNG-like image. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Looks like there is a regression in vsgoffscreenshot, I have just run: vsgoffscreenshot models/teapot.vsgt -d And get the following errors: UID-vkCmdDrawIndexed-renderPass-02684(ERROR / SPEC): msgNum: -1934215230 - Validation Error: [ VUID-vkCmdDrawIndexed-renderPass-02684 ] Object 0: handle = 0x5ef1450dfd40, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfab64d0000000002, type = VK_OBJECT_TYPE_RENDER_PASS; Object 2: handle = 0x3a6cbb0000000025, type = VK_OBJECT_TYPE_PIPELINE; Object 3: handle = 0xec4bec000000000b, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x8cb637c2 | vkCmdDrawIndexed(): pSubpasses[0].pColorAttachments[0].attachment is incompatible between VkRenderPass 0xfab64d0000000002[] (from VkCommandBuffer 0x5ef1450dfd40[]) and VkRenderPass 0xec4bec000000000b[] (from VkPipeline 0x3a6cbb0000000025[]), pAttachments[0].format (VK_FORMAT_B8G8R8A8_SRGB) != pAttachments[0].format (VK_FORMAT_R8G8B8A8_UNORM). The Vulkan spec states: The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS (https://vulkan.lunarg.com/doc/view/1.3.290.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-renderPass-02684)
Objects: 4
[0] 0x5ef1450dfd40, type: 6, name: NULL
[1] 0xfab64d0000000002, type: 18, name: NULL
[2] 0x3a6cbb0000000025, type: 19, name: NULL
[3] 0xec4bec000000000b, type: 18, name: NULL
VUID-vkCmdDrawIndexed-renderPass-02684(ERROR / SPEC): msgNum: -1934215230 - Validation Error: [ VUID-vkCmdDrawIndexed-renderPass-02684 ] Object 0: handle = 0x5ef1450dfd40, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfab64d0000000002, type = VK_OBJECT_TYPE_RENDER_PASS; Object 2: handle = 0x3a6cbb0000000025, type = VK_OBJECT_TYPE_PIPELINE; Object 3: handle = 0xec4bec000000000b, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x8cb637c2 | vkCmdDrawIndexed(): pSubpasses[0].pColorAttachments[0].attachment is incompatible between VkRenderPass 0xfab64d0000000002[] (from VkCommandBuffer 0x5ef1450dfd40[]) and VkRenderPass 0xec4bec000000000b[] (from VkPipeline 0x3a6cbb0000000025[]), pAttachments[0].format (VK_FORMAT_B8G8R8A8_SRGB) != pAttachments[0].format (VK_FORMAT_R8G8B8A8_UNORM). The Vulkan spec states: The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS (https://vulkan.lunarg.com/doc/view/1.3.290.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-renderPass-02684)
Objects: 4
[0] 0x5ef1450dfd40, type: 6, name: NULL
[1] 0xfab64d0000000002, type: 18, name: NULL
[2] 0x3a6cbb0000000025, type: 19, name: NULL
[3] 0xec4bec000000000b, type: 18, name: NULL I also get black image when I press 's' then run 'vsgviewer screenshot.vsgt'. My best guess is one of the settings is incompatible with the new default of sRGB framebuffer that was merged with v.1.1.10 dev release. I will look into this. W.r.t png write is support be vsgXchange::stbi, you can list the supported features using: $ vsgconv --features vsgXchange::stbi
vsgXchange::stbi provides support for 9 extensions, and 0 protocols.
Extensions Supported ReaderWriter methods
---------- ------------------------------
.bmp read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
.jpe read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
.jpeg read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
.jpg read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
.pgm read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.png read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
.ppm read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.psd read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..)
.tga read(vsg::Path, ..) read(std::istream, ..) read(uint8_t* ptr, size_t size, ..) write(vsg::Path, ..) write(std::ostream, ..)
vsg::Options::Value type
------------------- ----
image_format vsg::CoordinateSpace
jpeg_quality int To test it I ran vsgscreenshot example, then pressed 's' then converted to png with: vsgconv screenshot.vsgt screenshot.png The final screenshot.png works fine when loading back into vsgviewer. |
Beta Was this translation helpful? Give feedback.
-
I have created Issue #1398 for this regression. |
Beta Was this translation helpful? Give feedback.
-
I have fixed the issues with the vsgoffscreenshot example: |
Beta Was this translation helpful? Give feedback.
-
I tested the new vsgoffscreenshot last night, and unfortunately there are still problems with it. |
Beta Was this translation helpful? Give feedback.
Looks like there is a regression in vsgoffscreenshot, I have just run:
And get the following errors: