UpdateSubresource issues. #297
Replies: 4 comments 15 replies
-
UpdateSubresource had source and destination inverted, Vortice follow DirectX conventions, I'm not backward compatible with SharpDX |
Beta Was this translation helpful? Give feedback.
-
I use this in my code all the time and it works with Vortice
Forgive some names, the code was a port from Sharpdx. |
Beta Was this translation helpful? Give feedback.
-
@amerkoleci If you look at the following code in DirectXTex...
and compare it to Vortice...
It looks live you've transcribed numRows incorrectly to slicePitch - they are not the same. numRows = y resolution |
Beta Was this translation helpful? Give feedback.
-
So it turns out there is still an issue. I can use the DeviceContext.WriteTexture method to update a texture. But if I try to use UpdateSubresource method directly, I get the following error...
(note: I also saw this crash when I tried creating a texture with initial data of size that didn't match the texture size - maybe a clue). Here's the function that fails...
And here's some calling code, which should give a black to blue transition.
Update : The following method based upon @h1cks code suggestion above does work...
|
Beta Was this translation helpful? Give feedback.
-
I'm updating a region of a texture using UpdateSubresource. I've had this code working in SharpDX but I can't get it to work in Vortice. If I pass pitch values the call to UpdateSubresource crashes with the following exception...
If I pass no pitch values as in the following code, the texture region written to, but it's corrupted - as if the data is misaligned..
Here's the state of the arguments in the following code...
texture
Format = R8G8B8A8_UNorm
Size = 1802 x 956
MSCount = 1
x,y,w,h = 0,0,50,50
data
Color8[2500] // data is good upon inspection
Color8...
Texture writing function ...
Beta Was this translation helpful? Give feedback.
All reactions