-
Notifications
You must be signed in to change notification settings - Fork 191
Fix ROI edits disappearing on MacOS #3195
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
Conversation
|
clang-tidy review says "All clean, LGTM! 👍" |
|
If it's a bug fix, then it should be targeting I worry here that the fix is being applied at the wrong end & in the wrong direction. The ROI tool deals exclusively with bitwise data and no interpolation. It would make a lot more sense to be using 8-bit integer data. It's more likely that it's the upstream texture data type that's the bug, not the downstream sampler. |
Will rebase this on top of
We could use an integer texture, but more changes would be needed. |
|
Given that the various tools operate sequentially and independently with their own shaders, I would have thought it not too difficult, but I'm admittedly highly out of practise with the GUI code. Maybe have a dig at it, but if you encounter anything that looks like it could gobble up a lot of time revert back to the one-line fix? |
Use an unsigned integer 3D texture for the ROI (GL_R8UI) to store a 0/1 mask without normalization. Previously, we were using an integer sampler with a GL_R8 texture leading to erraneous behaviour on MacOS. Any future code interacting with the ROI texture must avoid trying to enable filtering and use integer sampler to read from it.
5747919 to
df58dc8
Compare
|
This is now targeting I changed the format for the ROI texture from |
This small change fixes #2319.
After the discussion this morning with @bjeurissen, I decided to investigate this long-standing issue in the viewer. So this wasn't really a driver issue as discussed in the relevant issue, but an error in our code.
After tinkering with OpenGL code a bit, I noticed that the undo/redo shader in
undoentry.cppwas using an integer sampler to read the values from the texture.Our texture data type is
GL_R8, which is an 8-bit normalised fixed-point format. It needs a float sampler, because integer samplers are for integer formats likeGL_R8I.@MRtrix3/mrtrix3-devs should we include this fix in 3.0.8?