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 clip state corruption #4157

Merged
merged 7 commits into from
Aug 24, 2024
Merged

Fix clip state corruption #4157

merged 7 commits into from
Aug 24, 2024

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Aug 21, 2024

Description

Re-enables the glDisable(GL_CLIP_DISTANCE<N>) lines without which OpenGL can get into a state where clipping is enabled but the values are not set. In that state plots will randomly get clipped.

I got to this state in #4131 with some tests that include multiple Axis3, each setting 6 clip planes via ax.scene.theme.clip_planes. I don't think I managed to reproduce it by just setting one clip plane in a plot.

In #3958 I had some trouble with this code and had it disabled because of that. I'm not sure what exactly the problem was, but now I have no issues with it on my Laptop or PC.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@MakieBot
Copy link
Collaborator

MakieBot commented Aug 21, 2024

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(fig)
using create display create display
GLMakie 4.38s (4.33, 4.48) 0.06+- 105.68ms (104.36, 107.31) 1.26+- 551.14ms (546.81, 560.10) 5.27+- 9.35ms (8.83, 9.53) 0.25+- 26.06ms (25.71, 26.45) 0.33+-
master 4.40s (4.30, 4.54) 0.08+- 107.55ms (106.29, 109.58) 1.40+- 548.19ms (532.32, 561.17) 9.22+- 8.81ms (8.74, 8.90) 0.05+- 26.14ms (25.82, 26.42) 0.19+-
evaluation 1.00x invariant, -0.02s (-0.29d, 0.60p, 0.07std) 1.02x faster ✓, -1.87ms (-1.40d, 0.02p, 1.33std) 0.99x invariant, 2.95ms (0.39d, 0.48p, 7.24std) 0.94x slower❌, 0.54ms (3.02d, 0.00p, 0.15std) 1.00x invariant, -0.08ms (-0.31d, 0.58p, 0.26std)
CairoMakie 3.72s (3.67, 3.79) 0.04+- 105.98ms (104.34, 107.82) 1.34+- 168.37ms (163.29, 180.93) 6.17+- 9.25ms (9.14, 9.41) 0.09+- 1.14ms (1.13, 1.15) 0.01+-
master 3.88s (3.78, 3.97) 0.07+- 109.19ms (105.58, 114.62) 3.72+- 169.17ms (164.44, 176.99) 5.19+- 8.95ms (8.57, 9.23) 0.27+- 1.14ms (1.12, 1.16) 0.01+-
evaluation 1.04x faster ✓, -0.16s (-2.78d, 0.00p, 0.06std) 1.03x invariant, -3.21ms (-1.15d, 0.07p, 2.53std) 1.00x invariant, -0.8ms (-0.14d, 0.80p, 5.68std) 0.97x slower X, 0.3ms (1.52d, 0.02p, 0.18std) 1.00x invariant, 0.0ms (0.33d, 0.55p, 0.01std)
WGLMakie 4.58s (4.55, 4.62) 0.03+- 106.13ms (104.70, 107.90) 1.16+- 9.09s (8.99, 9.15) 0.06+- 11.11ms (10.78, 12.47) 0.61+- 117.81ms (112.41, 121.74) 2.90+-
master 4.53s (4.47, 4.58) 0.04+- 105.24ms (104.31, 106.22) 0.66+- 8.99s (8.89, 9.14) 0.09+- 10.85ms (10.63, 11.10) 0.19+- 119.44ms (116.50, 123.22) 2.49+-
evaluation 0.99x slower X, 0.06s (1.61d, 0.01p, 0.03std) 0.99x invariant, 0.9ms (0.95d, 0.11p, 0.91std) 0.99x slower X, 0.1s (1.33d, 0.03p, 0.08std) 0.98x invariant, 0.26ms (0.58d, 0.31p, 0.40std) 1.01x invariant, -1.63ms (-0.60d, 0.28p, 2.70std)

@ffreyer ffreyer marked this pull request as ready for review August 21, 2024 14:11
Copy link
Member

@asinghvi17 asinghvi17 left a comment

Choose a reason for hiding this comment

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

I can't speak to the OpenGL stuff, this looks good to me after trying it locally though.

MakieCore/src/basic_plots.jl Outdated Show resolved Hide resolved
Co-authored-by: Anshul Singhvi <[email protected]>
@SimonDanisch SimonDanisch merged commit 4160c10 into master Aug 24, 2024
18 checks passed
@SimonDanisch SimonDanisch deleted the ff/fix_clip_planes branch August 24, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

4 participants