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

Inexact error when plotting >256 subplots #665

Closed
IanButterworth opened this issue Jul 29, 2020 · 4 comments · Fixed by #2389
Closed

Inexact error when plotting >256 subplots #665

IanButterworth opened this issue Jul 29, 2020 · 4 comments · Fixed by #2389

Comments

@IanButterworth
Copy link
Contributor

IanButterworth commented Jul 29, 2020

It seems some aspect of the subplot indexing is held in a UInt8, where it's plausible for more than 256 subplots to be used.

The following errors during the display(scene)

using AbstractPlotting
using AbstractPlotting.MakieLayout
using GLMakie
scene, layout = layoutscene()
for i in 1:257
    layout[1, i] = LAxis(scene)
end
display(scene)
ERROR: LoadError: InexactError: trunc(UInt8, 256)
Stacktrace:
 [1] throw_inexacterror(::Symbol, ::Type{UInt8}, ::Int64) at ./boot.jl:558
 [2] checked_trunc_uint at ./boot.jl:588 [inlined]
 [3] toUInt8 at ./boot.jl:650 [inlined]
 [4] UInt8 at ./boot.jl:710 [inlined]
 [5] convert at ./number.jl:7 [inlined]
 [6] convert at ./essentials.jl:310 [inlined]
 [7] push! at ./array.jl:934 [inlined]
 [8] #27 at /Users/ian/.julia/packages/GLMakie/Y3YHT/src/screen.jl:50 [inlined]
 [9] get!(::GLMakie.var"#27#29"{GLMakie.Screen,Scene}, ::Dict{WeakRef,UInt8}, ::WeakRef) at ./dict.jl:450
 [10] insertplots!(::GLMakie.Screen, ::Scene) at /Users/ian/.julia/packages/GLMakie/Y3YHT/src/screen.jl:48
 [11] (::GLMakie.var"#28#30"{GLMakie.Screen})(::Scene) at /Users/ian/.julia/packages/GLMakie/Y3YHT/src/screen.jl:56
 [12] foreach(::GLMakie.var"#28#30"{GLMakie.Screen}, ::Array{Scene,1}) at ./abstractarray.jl:2009
 [13] insertplots!(::GLMakie.Screen, ::Scene) at /Users/ian/.julia/packages/GLMakie/Y3YHT/src/screen.jl:56
 [14] backend_display(::GLMakie.Screen, ::Scene) at /Users/ian/.julia/packages/GLMakie/Y3YHT/src/screen.jl:124
 [15] backend_display at /Users/ian/.julia/packages/GLMakie/Y3YHT/src/gl_backend.jl:59 [inlined]
 [16] display(::AbstractPlotting.PlotDisplay, ::Scene) at /Users/ian/.julia/packages/AbstractPlotting/tHSnG/src/display.jl:45
 [17] display(::Any) at ./multimedia.jl:328
@ffreyer
Copy link
Collaborator

ffreyer commented May 31, 2021

This still errors btw

@SBuercklin
Copy link

SBuercklin commented Oct 4, 2022

+1, I have a similar case in CairoMakie that breaks in GLMakie

@Moelf
Copy link
Contributor

Moelf commented Oct 4, 2022

let's bump it to UInt16??

@ffreyer
Copy link
Collaborator

ffreyer commented Oct 4, 2022

It's not as easy as just changing a UInt8 to a UInt16. These integers are connected to the stencil buffer and (if I understand correctly) are used to figure out which scene is relevant to which area of the screen. I'm not sure if the element size of the stencil buffer can even be changed. If it can it probably requires stencil and depth buffers to be separate which might also mean the depth buffer needs to be smaller or larger. If it can't it requires reworking the rendering pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants