Villacaleb / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

Direct3D 11 ImmediateContext.UpdateSubresource() unusable ? #703

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

It seem that it's not possible to update a buffer value (contant shader buffer 
by exemple) using the UpdateSubresource(). On the GameDev forum  Mike Popoloski 
told me that :

"Looks like we don't check for null data box input. File an issue on our issue 
tracker and we'll have it fixed for the next release."

I don't really understand what is the problem, by looking at the SlimDX code it 
seemed that using it like this should work but it's not :

DataBox db = new DataBox(0, 0, cbStream);
m_D3dDevice.ImmediateContext.UpdateSubresource(db, m_ConstantBuffer, 0);
(where cbStream is a DataStream containing data to update the buffer).

Thank to let me know.

Original issue reported on code.google.com by Karna...@gmail.com on 13 Jul 2010 at 8:00

GoogleCodeExporter commented 9 years ago
Mainly as pointed out by dieter, you should be able to pass "null" for the 
DataBox parameter to specify the whole surface, but right now slimdx will throw 
an exception if you do.

Original comment by Mike.Popoloski on 13 Jul 2010 at 9:49

GoogleCodeExporter commented 9 years ago
I looked into this a bit more, and found at the source of your problem by 
looking at the debug output. In the future, you should check this whenever you 
have a problem:

D3D11: ERROR: ID3D11DeviceContext::UpdateSubresource: Can only invoke 
UpdateSubresource when the destination Resource was created with 
D3D11_USAGE_DEFAULT and is not a multisampled Resource. The destination 
Resource has (1) samples. [ RESOURCE_MANIPULATION ERROR #289: 
UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE ]

As such, this isn't an actual issue.

Original comment by Mike.Popoloski on 30 Aug 2010 at 6:32