Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixing a crash in the wgpu backend when ClipRect is unclipped #7191

Closed
wants to merge 1 commit into from

Conversation

aparis69
Copy link

@aparis69 aparis69 commented Jan 3, 2024

When opening a popup using Dear imgui, a grey transparent layer is rendered below the actual popup. This layer seems to have a size superior to the framebuffer size by a 1 pixel amount - which causes a crash in the wgpu backend one frame later.

Clamping the clip_min/clip_max to force them to be within [0, FrameBufferSize] is enough to fix the issue.

@ocornut ocornut changed the title Fixing a crash in the wgpu backend Fixing a crash in the wgpu backend when ClipRect is unclipped Jan 3, 2024
@ocornut ocornut added the clipper label Jan 3, 2024
ocornut pushed a commit that referenced this pull request Jan 3, 2024
@ocornut
Copy link
Owner

ocornut commented Jan 3, 2024

Thanks!

That's correct, the dimming layer injected below a modal popup use an odd ClipRect value (due to ahem, reasons):
image

I took the liberty to rework your commit into e8dd47e, matching the style and comments used by Metal, Vulkan and SDL_Renderer backends which need the same thing.
This amend the work done in 2b0bd40

Thank you!

@ocornut ocornut closed this Jan 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants