How to accelerate copying a matrixset to a textureset?

Diemo Schwarz's icon

Diemo Schwarz

5月 30 2024 | 12:48 午後

Hi, I need to transfer a jit.matrixset with 315 HD images to a jit.gl.textureset, but I must be doing something wrong here, since loading the matrixset from jxf takes only 3512 ms CPU time, but the copy to the textureset takes 10015 ms !!!!

Can I better prepare the textureset or the matrixset to speed up copying?

(the matrixset is 3 plane rgb for saving space; I don't need transparency in the textures, only while compositing layers. I stumbled over mentions of uyvy being faster than argb. Is this relevant here?)

Do I need to do the copy asynchronously (loading does lock up the graphics for ~15s)?

Is there a way to load a jxf from disk into the textureset directly?

I'm still on Intel MBP 13" with Intel Iris Plus Graphics 655 with only 1536 MB VRAM. I understand that this problem is completely moot with AppleSilicon's unified memory, but my M3 is only arriving after the next gig... =-(

Sorry for my incomplete background knowledge on graphics and OpenGL, always willing to learn!

Cheers!

Rob Ramirez's icon

Rob Ramirez

5月 30 2024 | 5:14 午後

Here's a possibly silly suggestion: export your images to a single movie file (e.g. using ffmpeg), then use jit.movie @engine viddll @output_texture 1 @cache_size 10 (or whatever amount of memory makes sense for your setup and content). Then utilize the loadram message to load the movie into memory, which should happen in a background thread, and should then give you similar functionality as textureset.

Diemo Schwarz's icon

Diemo Schwarz

6月 01 2024 | 8:17 午前

Wow, not silly at all, rather genius, Rob! Loading takes now ~50ms, and decoding seems to be of the same speed, plus the mjpeg movies take much less space (80%) than the (uncompressed) jxfs.

To get this 100%:

  • is jit.movie's (viddll) mjpeg decoding hardware-accelerated?

  • what are the best settings to be sure jit.movie does nothing else than giving me true_frame $1, bang:

    autostart 0 or 1, automatic 0 or 1?

Cheers!

Julien Bayle's icon

Julien Bayle

6月 02 2024 | 3:55 午後

How do you copy it?

Recently work with something similar.

Diemo Schwarz's icon

Diemo Schwarz

6月 03 2024 | 7:27 午前

Now I can avoid the copy by using jit.movie, but before, I naively used uzi and outputmatrix from the matrixset. That would take ~30 ms per HD matrix, which is clearly too long. I suspect that with a proper one-time pre-allocation of the whole VRAM needed for the textures (but how?) this ought to be faster.

LSka's icon

LSka

6月 03 2024 | 9:39 午前

@autostart 0 @automatic 0 @unique 1