-
Notifications
You must be signed in to change notification settings - Fork 2
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
WGPUCore working and refactor metaissue #18
Comments
Yeah its quite complex. Its not supposed to be. There could be better ways. But sure. I can help you. Its actually me who needs help and I would gladly accept any refactoring suggestions you can come up with. I don't recall much of the code so I cannot help you with I can help you with
So Inshort |
There is also third reason. This is an embarassing issue I struggled for months together. I struggle to keep object references alive consistently. GC kicks in randomly destroys few objects which are still needed. You can check test folder for hints on it. Fragmentstate, vertexBufferlayout, renderpipeline test files are always trouble makers for each minor change. Even now I disabled finalizer for |
https://github.com/JuliaObjects/Accessors.jl seems like the best tool for this. I'd recommend checking out its documentation.
That might explain the random crashings we sometimes got while running the examples. |
I think I checked Accessors.jl. We also need a way to get pointer and create opaque structs. while cstruct |> ptr gets you pointer. |
I am fairly certain that |
By the way |
@arhik We took a stab at trying to remove the Would you be interested in rethinking the API? I was thinking about using https://github.com/MasonProtter/Bumper.jl massively to deal with the GC issues somehow. |
Nice. Yeah. |
@arhik We simply removed There's also a few bits in the Core library which we're not understanding (for example We believe the abstractions there are a good model to follow. If you're interested, we can make the effort public. If you've no issues with that, we think that the new API should live inside a new branch (lets call it "rewrite") in this repo, and should eventually replace the current API, after we're done adapting other repos to the new API. Tell us what do you think. |
Sure. Go ahead. I went through exhaustion of reiterating more than four times. So, I will have to recollect patience again to go through this code and contribute. Fresh eyes will definitely make difference. Go will use |
You see stale code because of multi rewrites of API. Its common. I thought of writing a package that can check for stale code. So, I didn't bother to do manual work. Sometimes I also put placeholders. |
@arhik One thing we're pretty confused about is: Here, As such, when I do the same in Julia, i.e., write MethodError: Cannot `convert` an object of type WGPUNative.LibWGPU.WGPUNativeSType to an object of type WGPUNative.LibWGPU.WGPUSType
Closest candidates are:
convert(::Type{T}, !Matched::T) where T
@ Base Base.jl:84 I'm not quite sure whats going on here. Do you have any ideas? |
We do explicit conversion I think. |
Can you give me an example of how to do that ? |
Both are enums. Ints are common type. So cast to int32 and back. |
I don't really know why that's the case. It was like that since first version of API we tried. May be file an issue. I wanted to but I found work around and forgot about it. |
Line 59 in 33207ff
like this |
Don't bother with casting either. I wrote that to see explicitly. Just pass int. That works too. Its like inverse lookup.
|
We have a static compileable example in WGPUNative.jl now. Only works on Mac M series I think. I tried it on windows and linux with no luck. static compileabel example |
I couldn't adapt path to user location. So you need to set path to |
I've been trying to go through the code of WGPUCore and its quite complex.
I think I don't understand the workings of a few functions.
For example, setting
getDefaultBackendType
to returnWGPUBackendType_OpenGL
doesn't seem to work at all.I also don't understand the function of cstruct all around the code.
@arhik I'd like to help with the refactor, with some help from you.
The text was updated successfully, but these errors were encountered: