-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
VtxOffset offset related fix (fixes blown up triangles on the screen) #3232
Conversation
Is there anything preventing this small fix to get merged ? |
Hello,
Regardless, #3163 is rather complex and tricky, I have asked thedmd to write more formal automated/regression tests for it because it's a rarely exercised path. I expect this to be solved shortly! |
It's just two line of code, what coding style issues are there ? few spaces missing ? |
…ized with buffers state
In Dear ImGui we place curly braces either on all |
Just for your information, this project suffers from a bug in ImGui this PR fixes. |
To weigh in here, Omar, we are trying to ensure ImPlot works as expected when using 16-bit indices and plotting more than 64k points (not that uncommon for our users). We know supporting 16-bit indices would be most useful for you per #2591 and so that is a part of our motivation. For performance reasons (you can see the results here), we bypass DrawList.AddLine and fill the idx/vtx buffers ourselves. Our render loop upfront PrimReserves for the total number of segments in a line strip, iterates the segments buffering only those visible on screen, and then PrimUnreserves for the number of segments that were culled and not added to the buffers. As it is, we see artifacting like this. This is in-line with the issue I spoke of in #3245 (comment) @sergeyn has suggested that this PR will solve our issues, but understandably there may be a more systemic issue at play given the other two PRs linked above. I just personally test #3163 and it did NOT resolve our issue. Artifacting is still happening just as above. Let us know how we can help move this along. Cheers! |
@sergeyn Would you be able to submit a minimal repro code for this issue? |
Thanks all! |
That's great news! It's very well possible that I mixed up git commits when testing it. I'll give it another shot. |
I confirm 3163 does not fix this problem. |
To reproduce - grab latest implot and use following code to do a plot. This is spiral shifted 200,200 up-right so that it is completely culled. You can also remove a 200 shift and shift it with a mouse to observe same behavior:
I see following image with #3163: |
Thanks for the details, we will investigate again tomorrow. |
@ocornut, I just did another round of tests, and it would seem that #3163 does work for me. I'm not sure why it didn't work for me on my first attempt, or why it's not working for @sergeyn, but here are some points to consider:
I suspect my issue was simply git incompetence, but I'm still not sure why it wouldn't be working for @sergeyn. Screenshots ... Master#3163@ocornut, note the spiral being truncated even when |
Well, I can try again to eliminate any git screw-up |
Would you good if you tried... It would be really weird if both of you did a git screw-up. Although I would prefer if that was the case since it would mean we don't have this issue with 3163... All of this is so confusing we'll just write more regression tests for it now. |
It looks like it works.
|
Great! @ocornut, sorry for the confusion. |
I merged a fix for this specific issue because it is simpler: Note that #3163 cover other issues which haven't been merged yet, related to the channel splitter Thanks all for your help. This code is particularly tricky so I'm still untangling it and writing more/better regression tests. |
Thank you Omar! |
It is possible to get VtxCurrentOffset and VtxCurrentIdx out of sync with buffers state. This scenario triggers it: Do PrimReserve , which thinks you are reserving too many vertices and triggers new draw command and vtxoffset update. Then you do unreserve same amount (leaving emptry draw command). Next clip rect update this draw command gets poped but does not restore vtx/idx buffer offset, resulting all following draw commands reference incorrect vertex data