Queue or Buffer for DX11 Texture2D

Hey all!

I’m trying to do simple recording and playback in DX11
(i need to record about 1-5secs of kinect frames)
the ideal way would be just to keep them in GPU memory, e.g. in a texture spread (or texture array if necessary)

has anybody tackled this already?
i see sebl’s RingBuffer, but this outputs a 3D texture. I can imagine being able to make this work
but my guess is there are more direct solutions already

thank you
elliot

hey Elliot,
here is a patch based on sebl RingBuffer and texture array,
not easy as it was with the Queue node in Ex9
but it should work

RingBufferDX11.zip (8.9 KB)

hi there,

yes, the ringbuffer shader can be used for that, but there are 2 nodes exactly for that stuff:
SetSlice (DX11.Texture2D) and GetSlice (DX11.Texture2D)

sorry, for the missing helppatches. Here’s a queue-like helppatch explaining their usage:
SetSlice (DX11.Texture2D) help.v4p (34.8 KB)

if your queues are not too big (like bigger than free vram) i think this is the fastest approach.

thanks @sebl, @circuitb

SetSlice and sebl’s GetSlice seems to be exactly what I want (even though it seems to have the wrong name :)

to double check, what’s the exact meaning of Depth pin on SetSlice?

  • Depth of Volume texture which the slices are stored in
  • Size of Texture Array which the textures are stored in (aka Count, Length)

it seems it’s probably the second, correct?

yes, second.

Hmm I’m getting a lot of issues with SetSlice
I’m always getting black output when i use it in a live scenario
and often get exception:

00:06:33 ERR : Exception caused by node during update :/74/98/0/1
00:06:33 ERR : System.NullReferenceException in VVVV.DX11.Nodes: Object reference not set to an instance of an 
object.

Stacktrace:
   at VVVV.DX11.Nodes.TextureArraySetSlice.Reset(DX11Texture2D texture, Int32 w, Int32 h, Int32 d, Format format)
   at VVVV.DX11.Nodes.TextureArraySetSliceNode.Update(DX11RenderContext context)
   at VVVV.DX11.Lib.RenderGraph.DX11DeviceRenderer.ProcessNode(DX11Node node)

00:06:33  -  : Stack Trace
00:06:33  -  :    at VVVV.DX11.Nodes.TextureArraySetSlice.Reset(DX11Texture2D texture, Int32 w, Int32 h, Int32 d, 
Format format)
   at VVVV.DX11.Nodes.TextureArraySetSliceNode.Update(DX11RenderContext context)
   at VVVV.DX11.Lib.RenderGraph.DX11DeviceRenderer.ProcessNode(DX11Node node)

I’m going to have to try and make a plugin tomorrow for this case instead

is that also with the patch, I uploaded above? I have no issues with that…

btw. performance of setslice workflow is kinda unusable.
@elliot pls get intouch via skype

just for reference, I made this module some time ago Queue (DX11.texture 2d).zip (4.8 KB)

@milo and @elliotwoods how bad is the performance for you?
i experience high framerates on my notebook (not a good reference)…

can you provide a simple patch that behaves slow?

@sebl unfotunately i cant. this was my fault. i just forgot a getslice ad the readers side… so then this thing is solved

i’m still trying to debug here

also looking into using Renderer TextureArray instead
is there an easy way to render to select which output slide to render to?
i remember hearing somewhere that it’s possible with geometry shader semantics

Solved one issue:

If you disconnect the SetSlice from the renderer (i was using a switch downstream) then it invalidates the internal data, hence the exceptions being thrown.

You can use SV_RenderTargetArrayIndex as semantic for the output of geometry shader to specify witch slice will go to witch array index this will be on shaders ws

1 Like

thanks @antokhio !

also after some refactoring my SetSlice usage was fixed
it seemed the main error was that the output must always stay actively connected to a renderer otherwise its storage becomes invalidated and the node must be reset

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.