Marshalling C# structures into Direct3D 11 cbuffers using SharpDX

Started by
0 comments, last by juhav81 12 years ago
I'm looking for a good way to update shader cbuffers from C# (using D3D10 and SharpDX). I found an interesting blog post and I have some questions about the ConstantBuffer class that was introduced in the blog:

http://timjones.tw/blog/archive/2011/03/08/marshalling-c-structures-into-directd--cbuffers-using

1. Is this going to work with D3D10 also?
2. Is it possible to avoid DataBox creation every time UpdateValue is called?
3. Would it be better to put the actual struct (T) inside the class as a public field instead of passing it as a parameter in UpdateValue method?
Advertisement
After some digging and testing:

1. Yes.
2. Yes.
3. That's one way to do it.

This topic is closed to new replies.

Advertisement