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

Fix framebuffer created for reflection probe in mobile renderer #87505

Merged

Conversation

BastiaanOlij
Copy link
Contributor

In the mobile renderer, if reflection probes are used, we were getting the following GPU validation error:

VUID-vkCmdEndRenderPass-None-00910(ERROR / SPEC): msgNum: 2050775817 - Validation Error: [ VUID-vkCmdEndRenderPass-None-00910 ] Object 0: handle = 0x1aa2db36d50, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x3e5a36000000fffc, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x7a3c5b09 | vkCmdEndRenderPass():  Called before reaching final subpass. The Vulkan spec states: The current subpass index must be equal to the number of subpasses in the render pass minus one (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdEndRenderPass-None-00910)
    Objects: 2
       [0]  0x1aa2db36d50, type: 6, name: NULL
       [1]  0x3e5a36000000fffc, type: 18, name: NULL
drivers\vulkan\vulkan_context.cpp:267 - VALIDATION - Message Id Number: 2050775817 | Message Id Name: VUID-vkCmdEndRenderPass-None-00910
	Validation Error: [ VUID-vkCmdEndRenderPass-None-00910 ] Object 0: handle = 0x1aa2db36d50, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x3e5a36000000fffc, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x7a3c5b09 | vkCmdEndRenderPass():  Called before reaching final subpass. The Vulkan spec states: The current subpass index must be equal to the number of subpasses in the render pass minus one (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdEndRenderPass-None-00910)
	Objects - 2
		Object[0] - VK_OBJECT_TYPE_COMMAND_BUFFER, Handle 1830422801744
		Object[1] - VK_OBJECT_TYPE_RENDER_PASS, Handle 4492962951883456508

This is due to a recent improvement in the mobile renderer where we no longer use subpasses to render the opaque, sky and transparent passes but join them into a single pass if possible.

I however forgot to update the code for reflection probes to remove the subpasses here as well.

@BastiaanOlij BastiaanOlij force-pushed the fix_mobile_refprobe_validation branch from 308f288 to 914eeca Compare January 23, 2024 13:52
@@ -1049,10 +1032,6 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color

rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_ALPHA, p_render_data, radiance_texture, samplers, true);

if (rb_data.is_valid()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also removing this, as we've now merged our passes, we can just reuse the framebuffer we fetched at the start.

@BastiaanOlij BastiaanOlij marked this pull request as ready for review January 23, 2024 13:52
@BastiaanOlij BastiaanOlij requested a review from a team as a code owner January 23, 2024 13:52
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@DarioSamo
Copy link
Contributor

Tested, can confirm this fixes the validation error I was running into.

@YuriSizov YuriSizov merged commit b698204 into godotengine:master Jan 24, 2024
16 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@YuriSizov YuriSizov added the bug label Jan 24, 2024
@BastiaanOlij BastiaanOlij deleted the fix_mobile_refprobe_validation branch February 27, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants