Comments (3)
xref #51962?
from julia.
It's probably a different issue, as cconvert
is defined for a ReinterpretArray
and a pointer
may be obtained from it, but a direct unsafe_convert
isn't defined anymore. It may simply be a matter of redefining the method, but I wonder if it was removed for a reason.
from julia.
I ran into this just now as well.
Error: Error in render loop!
│ exception = conversion to pointer not defined for Base.ReinterpretArray{ColorTypes.RGB{Float32}, 2, Float32, Array{Float32, 3}, true}
└ @ NeuralGraphicsGL ~/.julia/packages/NeuralGraphicsGL/5ny5N/src/NeuralGraphicsGL.jl:285
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] unsafe_convert(::Type{Ptr{ColorTypes.RGB{Float32}}}, a::Base.ReinterpretArray{ColorTypes.RGB{Float32}, 2, Float32, Array{Float32, 3}, true})
@ Base ./pointer.jl:68
[3] unsafe_convert(::Type{Ptr{Nothing}}, a::Base.ReinterpretArray{ColorTypes.RGB{Float32}, 2, Float32, Array{Float32, 3}, true})
@ Base ./pointer.jl:66
[4] glTexImage2D(target::UInt32, level::Int64, internalformat::UInt32, width::UInt32, height::UInt32, border::Int64, format::UInt32, type_::UInt32, pixels::Base.ReinterpretArray{ColorTypes.RGB{Float32}, 2, Float32, Array{Float32, 3}, true})
@ ModernGL ~/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:64
[5] macro expansion
@ ~/.julia/packages/NeuralGraphicsGL/5ny5N/src/NeuralGraphicsGL.jl:72 [inlined]
[6] set_data!(t::NeuralGraphicsGL.Texture, data::Base.ReinterpretArray{ColorTypes.RGB{Float32}, 2, Float32, Array{Float32, 3}, true})
@ NeuralGraphicsGL ~/.julia/packages/NeuralGraphicsGL/5ny5N/src/texture.jl:89
[7] set_data!
@ ~/.julia/packages/NeuralGraphicsGL/5ny5N/src/quad.jl:77 [inlined]
[8] render!(ngui::NerfGUI.NGUI)
@ NerfGUI ~/src/NerfGUI/src/NerfGUI.jl:206
[9] loop!(ngui::NerfGUI.NGUI)
@ NerfGUI ~/src/NerfGUI/src/NerfGUI.jl:446
[10] #32
@ ~/src/NerfGUI/src/NerfGUI.jl:213 [inlined]
[11] render_loop(draw_function::NerfGUI.var"#32#33"{NerfGUI.NGUI}, c::NeuralGraphicsGL.Context; destroy_context::Bool)
@ NeuralGraphicsGL ~/.julia/packages/NeuralGraphicsGL/5ny5N/src/NeuralGraphicsGL.jl:281
[12] render_loop
@ ~/.julia/packages/NeuralGraphicsGL/5ny5N/src/NeuralGraphicsGL.jl:278 [inlined]
[13] launch!
@ ~/src/NerfGUI/src/NerfGUI.jl:211 [inlined]
[14] main()
@ NerfGUI ~/src/NerfGUI/src/NerfGUI.jl:487
Weirdly enough there is no direct call to unsafe_convert
in sight.
julia> @macroexpand ModernGL.@glfunc glTexImage2D(target::GLenum, level::GLint, internalformat::GLint, width::GLsizei, height::GLsizei, border::GLint, format::GLenum, type_::GLenum, pixels::Ptr{Cvoid})::Cvoid
quote
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:59 =#
const var"##glTexImage2D_func_pointer#231" = Ref{Ptr{Cvoid}}(C_NULL)
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:60 =#
function glTexImage2D(target, level, internalformat, width, height, border, format, type_, pixels)
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:60 =#
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:61 =#
if var"##glTexImage2D_func_pointer#231"[]::Ptr{Cvoid} == C_NULL
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:62 =#
var"##glTexImage2D_func_pointer#231"[]::Ptr{Cvoid} = getprocaddress_e("glTexImage2D")
end
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:64 =#
result = ccall(var"##glTexImage2D_func_pointer#231"[]::Ptr{Cvoid}, Cvoid, (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, Ptr{Cvoid}), target, level, internalformat, width, height, border, format, type_, pixels)
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:65 =#
()
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:66 =#
result
end
#= /home/vchuravy/.julia/packages/ModernGL/yNrOu/src/functionloading.jl:68 =#
export glTexImage2D
end
-- edit:
cconvert
julia/base/reinterpretarray.jl
Line 375 in 8791d54
Ptr{T}
from julia.
Related Issues (20)
- Assertion failure inside rr causing test x86_64-linux-gnuassertrr to fail HOT 2
- Impossible values of allunique() and allequal() HOT 3
- `permute_dims` fails in edge case because of use if `1:length`
- Documentation example not behaving as displayed - behavior of "const" on immutable objects. HOT 1
- Make precise semantics of world-age increments in top-level thunks
- New precompilation crashes on Julia 1.11-rc1 HOT 15
- introduce a function to check whether a value can be represented as a type HOT 5
- Plots package doesn't work HOT 2
- suboptimal abstract return type inference involving `getindex(::Tuple)`
- Improvements to `JULIA_CPU_TARGET` and its documentation
- [WONTFIX] `fill()` is a footgun HOT 2
- The relative precedence of `::` and `where` is strangely context dependent HOT 3
- Allow Adding Runtime Precompiles to Module Image HOT 11
- Parsing Int32 bitstring fails for very negative number HOT 3
- SVD's `propertynames` method doesn't respect private argument.
- does `methodswith` always return public API methods in v1.11?
- TTFX regression with Comonicon CLI on Julia 1.11 HOT 2
- possible dispatch bug: method static parameter matching fails
- `LinearAlgebra` with `BigFloat` edgecases crash Julia HOT 3
- `make JULIA_PRECOMPILE=0` doesn't skip precompilation of stdlibs anymore HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.