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

Line color regression causing shader error in Makie 0.21, GLMakie 0.10 #3851

Closed
Octogonapus opened this issue May 10, 2024 · 2 comments
Closed
Labels

Comments

@Octogonapus
Copy link
Contributor

Using Makie 0.21.0, GLMakie 0.10.0, Julia 1.10.3.
Creating a line with more color elements than data elements causes a shader error:

julia> lines!(ax, 1:1, 1:1, color = 1:2)
ERROR: Buffer vertex does not have the same length as the other buffers.
	color has length 2
	vertex has length 1
	valid_vertex has length 1
	lastlen has length 1
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] GLMakie.GLAbstraction.GLVertexArray(bufferdict::Dict{Symbol, Any}, program::GLMakie.GLAbstraction.GLProgram)
    @ GLMakie.GLAbstraction ~/.julia/packages/GLMakie/UPa0N/src/GLAbstraction/GLTypes.jl:220
  [3] GLMakie.GLAbstraction.RenderObject(data::Dict{Symbol, Any}, program::GLMakie.GLVisualizeShader, pre::GLMakie.GLAbstraction.StandardPrerender, post::GLFW.Window, context::GLFW.Window)
    @ GLMakie.GLAbstraction ~/.julia/packages/GLMakie/UPa0N/src/GLAbstraction/GLTypes.jl:402
  [4] GLMakie.GLAbstraction.RenderObject(data::Dict{Symbol, Any}, program::GLMakie.GLVisualizeShader, pre::GLMakie.GLAbstraction.StandardPrerender, post::GLFW.Window)
    @ GLMakie.GLAbstraction ~/.julia/packages/GLMakie/UPa0N/src/GLAbstraction/GLTypes.jl:346
  [5] assemble_shader(data::Dict{Symbol, Any})
    @ GLMakie ~/.julia/packages/GLMakie/UPa0N/src/glshaders/visualize_interface.jl:108
  [6] draw_lines(screen::Any, position::Observable{Vector{Point{2, Float32}}}, data::Dict)
    @ GLMakie ~/.julia/packages/GLMakie/UPa0N/src/glshaders/lines.jl:91
  [7] (::GLMakie.var"#237#241"{GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float64}}}}})(gl_attributes::Dict{Symbol, Any})
    @ GLMakie ~/.julia/packages/GLMakie/UPa0N/src/drawing_primitives.jl:483
  [8] (::GLMakie.var"#205#212"{GLMakie.var"#237#241"{GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float64}}}}}, GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float64}}}}})()
    @ GLMakie ~/.julia/packages/GLMakie/UPa0N/src/drawing_primitives.jl:306
  [9] get!(default::GLMakie.var"#205#212"{GLMakie.var"#237#241"{GLMakie.Screen{}, Scene, Lines{}}, GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{}}}, h::Dict{UInt64, GLMakie.GLAbstraction.RenderObject}, key::UInt64)
    @ Base ./dict.jl:479
 [10] cached_robj!(robj_func::GLMakie.var"#237#241"{GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float64}}}}}, screen::GLMakie.Screen{GLFW.Window}, scene::Scene, plot::Lines{Tuple{Vector{Point{2, Float64}}}})
    @ GLMakie ~/.julia/packages/GLMakie/UPa0N/src/drawing_primitives.jl:235
 [11] draw_atomic(screen::GLMakie.Screen{GLFW.Window}, scene::Scene, plot::Lines)
    @ GLMakie ~/.julia/packages/GLMakie/UPa0N/src/drawing_primitives.jl:444
 [12] insert!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene, x::Plot)
    @ GLMakie ~/.julia/packages/GLMakie/UPa0N/src/drawing_primitives.jl:323
 [13] #invokelatest#2
    @ ./essentials.jl:892 [inlined]
 [14] invokelatest
    @ ./essentials.jl:889 [inlined]
 [15] push!(scene::Scene, plot::AbstractPlot)
    @ Makie ~/.julia/packages/Makie/eziUH/src/scenes.jl:460
 [16] plot!
    @ ~/.julia/packages/Makie/eziUH/src/interfaces.jl:390 [inlined]
 [17] plot!(ax::Axis, plot::Lines{Tuple{Vector{Point{2, Float64}}}})
    @ Makie ~/.julia/packages/Makie/eziUH/src/figureplotting.jl:412
 [18] _create_plot!(::Function, ::Dict{Symbol, Any}, ::Axis, ::UnitRange{Int64}, ::Vararg{UnitRange{Int64}})
    @ Makie ~/.julia/packages/Makie/eziUH/src/figureplotting.jl:381
 [19] lines!(::Axis, ::Vararg{Any}; kw::@Kwargs{color::UnitRange{Int64}})
    @ MakieCore ~/.julia/packages/MakieCore/zeHIC/src/recipes.jl:440
 [20] top-level scope
    @ REPL[29]:1
Some type information was truncated. Use `show(err)` to see complete types.

With Makie 0.20.10, GLMakie 0.9.11, this error does not happen.

@jkrumbiegel
Copy link
Member

hm but you're not supposed to have mismatched lengths, so isn't the old behavior the bug?

@ffreyer
Copy link
Collaborator

ffreyer commented May 10, 2024

Yea, I would expect this to fail in 0.20.10 too. I don't think anything changed on the backend side with respect to the buffers, so maybe it's attribute conversions or the color sampling code in Makie.jl instead?

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

No branches or pull requests

3 participants