Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial call to RenderGraph::resized() causes RenderGraph.renderArea to be zeroed out #1356

Open
dov opened this issue Jan 5, 2025 · 0 comments

Comments

@dov
Copy link

dov commented Jan 5, 2025

Describe the bug

After calling renderGraph->resized() the first time, the value of renderGraph.renderArea = {{0,0},{0,0}}.

To Reproduce

  1. Modify vsgoffscreenshot.cpp as follows:
                 offscreenRenderGraph->resized();
+                vsg::info("offscreenRenderGraph->renderArea=(",
+                          offscreenRenderGraph->renderArea.offset.x, ",",
+                          offscreenRenderGraph->renderArea.offset.y, "),(",
+                          offscreenRenderGraph->renderArea.extent.width, ",",
+                          offscreenRenderGraph->renderArea.extent.height, ")");
  1. Compile and run
  2. Resize the window
  3. Press 'e'

Expected behavior
The offscreenRenderGraph->renderArea should be equal to the offscreenExtent.

Screenshots
Not relevant

Desktop (please complete the following information):

  • OS: Fedora Linux 41

Additional context
The zeroed out renderArea may cause subsequential vulkan validation errors of the type:

VUID-VkRenderPassBeginInfo-None-08996(ERROR / SPEC): msgNum: 1495210966 - Validation Error:
  [ VUID-VkRenderPassBeginInfo-None-08996 ] Object 0: handle = 0x2b3bf510,
  type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x591f1bd6 | vkCmdBeginRenderPass():
  pRenderPassBegin->renderArea.extent.width is zero.
The Vulkan spec states: If the pNext chain does not contain VkDeviceGroupRenderPassBeginInfo
  or its deviceRenderAreaCount member is equal to 0, renderArea.extent.width must be greater
  than 0 (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkRenderPassBeginInfo-None-08996)

I admit that I don't understand why it does not always happen.

The reason for the zeroed out renderArea seems to be due to the uninitialized variable WindowResizeHandler.previous_extent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant