From 7997b50952db80b4707d07c4052271d0332eeb0e Mon Sep 17 00:00:00 2001 From: Matej Fandl Date: Thu, 20 Jul 2023 17:57:35 +0200 Subject: [PATCH] GLTexture.Texture constructor with image parameter of type LinearAlgebra.Adjoint (#2626) * Added GLTexture.Texture constructor that accepts and collects the image parameter of type LinearAlgebra.Adjoint{T, Array{T, NDim}}, where T <: GLArrayElTypes. This fixes an error thrown in case Texture was created with a transposed Float32 array, such as heatmap(randn(Float32, 2, 3)'). * Update GLTexture.jl --------- Co-authored-by: Simon --- GLMakie/src/GLAbstraction/GLTexture.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GLMakie/src/GLAbstraction/GLTexture.jl b/GLMakie/src/GLAbstraction/GLTexture.jl index 472a611071b..ae3f596bfac 100644 --- a/GLMakie/src/GLAbstraction/GLTexture.jl +++ b/GLMakie/src/GLAbstraction/GLTexture.jl @@ -137,6 +137,9 @@ Colors from Colors.jl should mostly work as well Texture(image::Array{T, NDim}; kw_args...) where {T <: GLArrayEltypes, NDim} = Texture(pointer(image), size(image); kw_args...)::Texture{T, NDim} +Texture(image::AbstractArray{T, NDim}; kw_args...) where {T <: GLArrayEltypes, NDim} = + Texture(collect(image); kw_args...) + function Texture(s::ShaderAbstractions.Sampler{T, N}; kwargs...) where {T, N} tex = Texture( pointer(s.data), size(s.data),