» DDS Ring Buffer
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

DDS Ring Buffer

Credits: elliotwoods


Currently hardcoded for DXT5


I know a few of you are streaming DDS's off the HDD to playback video. Here's a ring buffer to do that.


  • All file loading is performed in off-mainloop threads
  • Pushing to GPU is performed on main thread (as required in DX9)
  • TextureUtils provides a mechanism to create textures from files (e.g. DDS), we use this mechanism for the first frame
  • Remaining frames with same resolution will be copied to GPU with an UpdateTexture function*
  • Keeps persistent memory buffers between frames if the file sizes are the same (i.e. true of DDS)

(*) I've manually coded the UpdateTexture function to parse the DDS file header and contents, and push the contents to the GPU without recreating the texture

DXT5 lookups are slow?

We didn't end up using this plugin, as we found that texture lookups became slower on DXT5 compared to X8R8G8B8 textures (hits the render stage).

I think in general this effect is negligible, but for the amount of texture lookups we're using (7 * HD in PS 3.0 on Radeon 6970's) it became a noticeable hit (dropped to 40fps min framerate vs 60-synced before). This effect continued after the texture was loaded (i.e. the slowdown was purely at render time).

The hypothesis that a texture lookup on DXT5 takes more GPU time than from an X8R8G8B8 makes theoretical sense, but might turn out to be incorrect. However, it is in line with our tests here.


22.08.12 [13:46 UTC] by catweasel | 711 downloads
DDS Ring Buffer v0.1

flux 22/08/2012 - 15:54

Nice, unfortunately it doesn't work on my machine. (Renderer stays black, node gets red when changing the value on the index pin)... any idea why?

elliotwoods 22/08/2012 - 15:59


thanks for the feedback
this is tested on b27. works across 3 machines here.
do you get anything in Renderer TTY?
which vvvv you on?

circuitb 22/08/2012 - 16:33

works here under beta28 with the
\vvvv_45beta28\lib\assets\images\meso_cubemap.dds = DXT format
but not with
\vvvv_45beta28\lib\assets\images\color_cubemap.dds which is a X8R8G8B8 texture

00:05:04 ERR : Exception occured in TMPluginWrapperNode.Evaluate: File format not supported by DDSFile

elliotwoods 22/08/2012 - 17:07

aha yes.
it's hardcoded for DXT5's right now! :)
will add that to the description

flux 22/08/2012 - 17:12


sorry i forgot, i tested it on beta28. And i think it was the same issue circuitb mentioned. A8R8G8B8 dds textures don't seem to work. i got it running with dxt5 compressed ones on b27 and 28.

circuitb 24/08/2012 - 18:29

a spreadable version sounds possible?

elliotwoods 25/08/2012 - 15:58

certainly possible.
it's not going to be very tidy for changing spread-count
accidentally feeding in a large spread is going to either:
a) be capped (i.e. hard cap on number of slices)
b) crash (you'll allocate too much cpu and gpu ram)

is this something immediately useful?
i haven't got the source here anymore

circuitb 25/08/2012 - 18:15

no not really in a hurry just testing best ways to read image sequences
for something like 5 sequences of 200 frames ...
i duplicate the dds ring buffer node
everything is fine with a smooth playback!

but be careful with the buffercount value
vvvv dedicated memory get bigger and bigger each time you change this value (increase or decrease)... when it reaches the memory limit DDS nodes turns red and you need to restart vvvv to clear the allocated memory.

elliotwoods 26/08/2012 - 14:00

i'm using byte arrays for storage which you can't actively flush (the .NET garbage collector is supposed to clean that up when it feels like).
I can provoke the garbage collector to get on with its job whenever you ask as well, so I can do that when the pin's changed
(flushing GC manually results in a temporary pause of the whole app, something like 50ms)

circuitb 26/08/2012 - 15:06

yep could be cool to manually flush the memory without restarting vvvv!

also the plugin doesn't work with the sharedtexture /dx9ex switch

anonymous user login


~4d ago

NoseBleedIndustries: Please, integration with this low cost mechanical display, so beautiful! https://www.vestaboard.com/

~4d ago

NoseBleedIndustries: Please, integration with this low cost mechanical display, so beautiful! https://www.vestaboard.com/

~8d ago

joreg: @mediadog they are here: workshop-videotracking-node10

~9d ago

mediadog: Hmmm slides for node10 video tracking cannot be found: workshop-videotracking-slides

~10d ago

joreg: @mediadog thanks for the pointer, links are updated

~11d ago

mediadog: Where are the 50beta42 offline instalers? The offline installers are still linked to 41, not 42.

~14d ago

id144: thanks @gegenlicht & @bjoern, i hope the festival sorted it.

~16d ago

Patxi7: @joreg done