From 6c64137e652a256533d2a30e09d0e813fa34e872 Mon Sep 17 00:00:00 2001 From: ffreyer Date: Fri, 3 Jan 2025 00:50:51 +0100 Subject: [PATCH] switch before requiring --- GLMakie/src/GLAbstraction/GLTypes.jl | 2 +- GLMakie/src/glwindow.jl | 2 +- GLMakie/src/postprocessing.jl | 4 ++-- GLMakie/src/rendering.jl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GLMakie/src/GLAbstraction/GLTypes.jl b/GLMakie/src/GLAbstraction/GLTypes.jl index 6d9ff365f3f..1641f90a37b 100644 --- a/GLMakie/src/GLAbstraction/GLTypes.jl +++ b/GLMakie/src/GLAbstraction/GLTypes.jl @@ -346,8 +346,8 @@ function RenderObject( pre::Pre, post, context=current_context() ) where Pre - require_context(context) switch_context!(context) + require_context(context) # This is a lazy workaround for disabling updates of `requires_update` when # not rendering on demand. A cleaner implementation should probably go diff --git a/GLMakie/src/glwindow.jl b/GLMakie/src/glwindow.jl index aaa399589ea..1c006e8aa5d 100644 --- a/GLMakie/src/glwindow.jl +++ b/GLMakie/src/glwindow.jl @@ -87,8 +87,8 @@ function check_framebuffer() end Makie.@noconstprop function GLFramebuffer(context, fb_size::NTuple{2, Int}) - require_context(context) ShaderAbstractions.switch_context!(context) + require_context(context) # Create framebuffer frambuffer_id = glGenFramebuffers() diff --git a/GLMakie/src/postprocessing.jl b/GLMakie/src/postprocessing.jl index 8746a08389d..fded72f1cf5 100644 --- a/GLMakie/src/postprocessing.jl +++ b/GLMakie/src/postprocessing.jl @@ -79,8 +79,8 @@ end function ssao_postprocessor(framebuffer, shader_cache) - require_context(shader_cache.context) ShaderAbstractions.switch_context!(shader_cache.context) + require_context(shader_cache.context) # Add missing buffers if !haskey(framebuffer, :position) glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.id[1]) @@ -207,8 +207,8 @@ end Returns a PostProcessor that handles fxaa. """ function fxaa_postprocessor(framebuffer, shader_cache) - require_context(shader_cache.context) ShaderAbstractions.switch_context!(shader_cache.context) + require_context(shader_cache.context) # Add missing buffers if !haskey(framebuffer, :color_luma) diff --git a/GLMakie/src/rendering.jl b/GLMakie/src/rendering.jl index a0448341937..ee717ea950e 100644 --- a/GLMakie/src/rendering.jl +++ b/GLMakie/src/rendering.jl @@ -28,8 +28,8 @@ Renders a single frame of a `window` """ function render_frame(screen::Screen; resize_buffers=true) nw = to_native(screen) - GLAbstraction.require_context(nw) ShaderAbstractions.switch_context!(nw) + GLAbstraction.require_context(nw) function sortby(x) robj = x[3]