• Home
  • Documentation
  • Forum
  • Blog
  • Users
    • Map
    • Userlist
    • Businesses
    • Userpages
    • Connections
  • Contributions
    • All
    • Store
  • Downloads
    • vvvv beta
    • vvvv beta previews
  • Store
Show / Hide Table of Contents

DDS Ring Buffer

Author: catweasel
Date: 22 Aug, 2012
Category: plugin
Credits:

elliotwoods

Download

64bit

0-EX9.TextureDDSBuffer.dll_.zip
22 Aug, 2012 - 11:46
DDS Ring Buffer v0.1

Description

Note: Currently hardcoded for DXT5
  1. Introduction

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

  1. Notes
  • 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
  1. 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.

Comments

Comments are no longer accepted.
Please create a new topic in the vvvv beta forum to discuss this contribution.
flux
22 Aug, 2012 - 13: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 Aug, 2012 - 13:59

@flux

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 Aug, 2012 - 14: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 Aug, 2012 - 15:07

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

flux
22 Aug, 2012 - 15:12

@elliot

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 Aug, 2012 - 16:29

a spreadable version sounds possible?

elliotwoods
25 Aug, 2012 - 13:58

yes. 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 Aug, 2012 - 16: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 Aug, 2012 - 12:00

interesting. 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 Aug, 2012 - 13:06

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

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

  • Improve this Doc

© 2020 by vvvv group. Imprint | Privacy Policy.
Thanks to DocFX for building this website. Analytics by Plausible.

Back to top