-
Notifications
You must be signed in to change notification settings - Fork 11
[WIP] fs2 explore #54
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
Conversation
| arr | ||
|
|
||
| extension (buf: ByteBuffer) | ||
| def put[C <: Value: FromExpr: Tag, S: ClassTag](chunk: Chunk[S])(using bridge: Bridge[C, S]): ByteBuffer = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend we just use fromByteBuffer, toByteBuffer directly from Bridge. Those extension methods can be slightly misleading, as they appear to come from the original java API and add an extra step to follow when reading the code.
|
|
||
| def fromByteBuffer(outBuf: ByteBuffer, arr: Array[fRGBA]): Array[fRGBA] = | ||
| val res = outBuf.asFloatBuffer() | ||
| for i <- 0 until arr.size do arr(i) = (res.get(), res.get(), res.get(), res.get()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will definitely be the slowest part of the program, we have to think about a way to speed up those memory transfers - So in the essence do that somehow without the iteration. Maybe we should treat RGBA as Array[Float] not a tuple.
The same goes for the toByteBuffer.
|
I think there is a bug in LayoutStruct, where izumi tags are summoned, probably for GBuffers. |
No description provided.