Sign in to follow this  
juhav81

Marshalling C# structures into Direct3D 11 cbuffers using SharpDX

Recommended Posts

juhav81    100
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:

[url="http://timjones.tw/blog/archive/2011/03/08/marshalling-c-structures-into-directd--cbuffers-using"]http://timjones.tw/blog/archive/2011/03/08/marshalling-c-structures-into-directd--cbuffers-using[/url]

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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this