Is it possible to create some sort of "custom" stencil buffer?

Started by
2 comments, last by Syntac_ 9 years, 2 months ago

Greeting,

For an algorithm I need to manipulate some buffer similar to stencil buffer. But I want to read/write to it in pixel shader, but it shouldn't be a render target. Ideally this buffer should have uint format (just a single uint value). Is it possible? Most of all I confused about data race - it can happen that several threads want to write at the same time or read while other threads writing.

Advertisement

https://msdn.microsoft.com/en-us/library/windows/desktop/ff476335%28v=vs.85%29.aspx

Check the bottom of that page about unordered access buffers, seems like it would do what you want.

It seems that what I need. Thank you.

P.S.: will highly appreciate any links/tutorials beyond msdn. Quick googling gave zero result.

There's a decent amount of sample applications that use UAVs in pixel shaders in the Hieroglyph 3 source:

https://hieroglyph3.codeplex.com/SourceControl/latest

This topic is closed to new replies.

Advertisement