Skip to content

Conversation

@spamegg1
Copy link
Collaborator

No description provided.

@spamegg1 spamegg1 marked this pull request as draft June 27, 2025 07:06
arr

extension (buf: ByteBuffer)
def put[C <: Value: FromExpr: Tag, S: ClassTag](chunk: Chunk[S])(using bridge: Bridge[C, S]): ByteBuffer =
Copy link
Member

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())
Copy link
Member

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.

@spamegg1
Copy link
Collaborator Author

spamegg1 commented Jul 5, 2025

I think there is a bug in LayoutStruct, where izumi tags are summoned, probably for GBuffers.

@spamegg1 spamegg1 closed this Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants