Skip to content

Commit

Permalink
add some more context switches, idk
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Dec 29, 2024
1 parent 772db38 commit 5eeb34d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions GLMakie/src/postprocessing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ GLRenderPipeline() = GLRenderPipeline(Makie.Pipeline(), AbstractRenderStep[])

function render_frame(screen, glscene, pipeline::GLRenderPipeline)
for step in pipeline.steps
ShaderAbstractions.switch_context!(screen.glscreen)
run_step(screen, glscene, step)
end
return
Expand Down
1 change: 1 addition & 0 deletions GLMakie/src/render_pipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function gl_render_pipeline!(screen::Screen, pipeline::Makie.Pipeline)
# Maybe safer to wait on rendertask to finish and replace the GLRenderPipeline
# with an empty one while we mess with it?
wait(screen)
ShaderAbstractions.switch_context!(screen.glscreen)
screen.render_pipeline = GLRenderPipeline()

# Resolve pipeline
Expand Down
3 changes: 2 additions & 1 deletion GLMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,10 @@ function destroy!(screen::Screen)
window = screen.glscreen
GLFW.SetWindowRefreshCallback(window, nothing)
GLFW.SetWindowContentScaleCallback(window, nothing)
destroy!(window)
ShaderAbstractions.switch_context!(screen.glscreen)
destroy!(screen.framebuffer_factory)
destroy!(screen.render_pipeline)
destroy!(window)
# Since those are sets, we can just delete them from there, even if they weren't in there (e.g. reuse=false)
delete!(SCREEN_REUSE_POOL, screen)
delete!(ALL_SCREENS, screen)
Expand Down

0 comments on commit 5eeb34d

Please sign in to comment.