Skip to content

Commit

Permalink
switch before requiring
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Jan 2, 2025
1 parent b819240 commit 6c64137
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GLMakie/src/GLAbstraction/GLTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion GLMakie/src/glwindow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions GLMakie/src/postprocessing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion GLMakie/src/rendering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 6c64137

Please sign in to comment.