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

Implement debug CanvasItem redraw in GLES3 #103018

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Feb 18, 2025

GLES3 version of #79169.
Based also on #98652 which reimplemented it after batching.
Includes fix from #103017.

I'm absolutely not sure if I got all batch state reseting etc. correctly so please check thoroughly. Well, of course it works as far as I've tested. 🙃

@kleonc kleonc added this to the 4.x milestone Feb 18, 2025
@kleonc kleonc requested a review from a team as a code owner February 18, 2025 22:52
@kleonc kleonc force-pushed the canvas_item_debug_redraw_gles3_implementation branch from e7c4633 to 1938b6f Compare February 18, 2025 22:55
@kleonc kleonc force-pushed the canvas_item_debug_redraw_gles3_implementation branch from 1938b6f to 4f8c26e Compare February 19, 2025 00:26
@@ -1294,8 +1364,6 @@ _FORCE_INLINE_ static uint32_t _indices_to_primitives(RS::PrimitiveType p_primit
}

void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index, RenderingMethod::RenderInfo *r_render_info) {
ERR_FAIL_NULL(state.canvas_instance_batches[state.current_batch_index].command);
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing it to allow .command_type = Item::Command::TYPE_RECT with .command = nullptr used for debug redraw, added null checks for cases where .command is actually dereferenced.

Also seems the check here was faulty anyway, as state.canvas_instance_batches[p_index] should be checked instead of state.canvas_instance_batches[state.current_batch_index].

@kleonc kleonc requested a review from clayjohn March 22, 2025 13:48
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.

1 participant