Skip to content

Commit

Permalink
fix incorrect number of vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Jan 6, 2025
1 parent e33e3d8 commit 98e1b9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions GLMakie/src/GLAbstraction/GLRender.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ renderinstanced(vao::GLVertexArray, a, primitive=GL_TRIANGLES) = renderinstanced
Renders `amount` instances of an indexed geometry
"""
function renderinstanced(vao::GLVertexArray{GLBuffer{T}}, amount::Integer, primitive=GL_TRIANGLES) where T <: Union{Integer,AbstractFace}
N_elements = length(vao)
N_elements * amount == 0 && return nothing
glDrawElementsInstanced(primitive, N_elements, julia2glenum(T), C_NULL, amount)
N = length(vao.indices) * cardinality(vao.indices)
N * amount == 0 && return nothing
glDrawElementsInstanced(primitive, N, julia2glenum(T), C_NULL, amount)
return nothing
end

Expand Down

0 comments on commit 98e1b9a

Please sign in to comment.