Click here to Skip to main content
15,888,733 members
Home / Discussions / C#
   

C#

 
GeneralRe: HRESULT in C# Pin
Stephane Rodriguez.25-Feb-03 21:02
Stephane Rodriguez.25-Feb-03 21:02 
GeneralRe: HRESULT in C# Pin
Nicholas Naddaf26-Feb-03 4:08
Nicholas Naddaf26-Feb-03 4:08 
GeneralRe: HRESULT in C# Pin
Stephane Rodriguez.26-Feb-03 4:26
Stephane Rodriguez.26-Feb-03 4:26 
Generalbeginner question in C# Pin
nnnnnnnnnn25-Feb-03 14:38
nnnnnnnnnn25-Feb-03 14:38 
GeneralRe: beginner question in C# Pin
Steven Behnke25-Feb-03 19:33
Steven Behnke25-Feb-03 19:33 
GeneralRe: beginner question in C# Pin
Ryan Cromwell26-Feb-03 3:11
Ryan Cromwell26-Feb-03 3:11 
GeneralRTF Scrolling Pin
Steven Behnke25-Feb-03 12:29
Steven Behnke25-Feb-03 12:29 
QuestionManaged Directx - partially useless or not? Pin
Filip Strugar25-Feb-03 11:28
Filip Strugar25-Feb-03 11:28 
I've been using Managed Directx9 for some time now, and have never resolved one of the first problems I had, and now it's becoming more and more important to see if there is a solution.

It's about dynamic vertex buffering - locking and unlocking, where none of the given solutions provide performance of the unmanaged directx - or I could not find a way.

Locking vertex buffer using two versions of the Lock method that return array is incredibly slow due to the allocation of the new managed array each time lock is called. Somewhat faster is locking with the GraphicsStream - but then setting of the stream is slow.
The fastest way (managed DX samples usually use it) is VertexBuffer.SetData method, however more than a half of it's time is used to execute DXHelp CopyObjectDataToPointer, and I haven't got a slightest clue what the rest of the SetData code looks like.
In my case render method spends 67% time in using SetData and the rest in drawing! And it should be like 10-15% in setting the data, and rest in drawing, like in C++ versions of the similar code.
And there is no unsafe version of the method! Why? I would like to generate my data 'unsafely' and just copy it to the buffer.
This way I generate it, then SetData copies it to unsafe ptr, lock the buffer, copy unsafe data to the buffer, an ulock the buffer, making an excess copy in the process and who knows what else.
It is obvious that in some cases there is more than double performance penality because of this.

Or I am blind to see another way, or somewhere completely wrong? Smile | :)

I'm speaking of the situations like drawing a text or such, where dynamic vertex/index is necessary.
And ofcourse, I have used .Default memory managment and .Discardable lock.
One more thing: DirectX managed demos and tutorials have the same problem and are (sometimes much) slower then their unmanaged counterparts when using dynamic vertex buffering.
I haven't tested DrawUserPrimitives but it's slower and it wouldn't solve my problem - i don't generate vertex buffer every but every 3-9th frame.

Can anyone help?
AnswerRe: Managed Directx - partially useless or not? Pin
Anonymous25-Feb-03 18:20
Anonymous25-Feb-03 18:20 
GeneralOleDbConnection Pin
Jassim Rahma25-Feb-03 9:53
Jassim Rahma25-Feb-03 9:53 
GeneralRe: OleDbConnection Pin
Chris Austin25-Feb-03 13:48
Chris Austin25-Feb-03 13:48 
GeneralRe: OleDbConnection Pin
Jassim Rahma27-Feb-03 7:48
Jassim Rahma27-Feb-03 7:48 
GeneralRe: OleDbConnection Pin
Jassim Rahma27-Feb-03 11:52
Jassim Rahma27-Feb-03 11:52 
QuestionDate/Time change on CDO message? Pin
PianoJazz25-Feb-03 8:30
PianoJazz25-Feb-03 8:30 
GeneralA Windows Service question Pin
Radoslav Bielik25-Feb-03 7:55
Radoslav Bielik25-Feb-03 7:55 
Generalmultiple data access component Pin
..Hubert..25-Feb-03 7:51
..Hubert..25-Feb-03 7:51 
GeneralRe: multiple data access component Pin
Chris Austin25-Feb-03 13:50
Chris Austin25-Feb-03 13:50 
GeneralRe: multiple data access component Pin
..Hubert..26-Feb-03 3:35
..Hubert..26-Feb-03 3:35 
GeneralRe: multiple data access component Pin
Chris Austin26-Feb-03 5:20
Chris Austin26-Feb-03 5:20 
GeneralRe: multiple data access component Pin
..Hubert..26-Feb-03 8:46
..Hubert..26-Feb-03 8:46 
GeneralIs Application Active Pin
OBRon25-Feb-03 7:15
OBRon25-Feb-03 7:15 
GeneralRe: Is Application Active Pin
Stephane Rodriguez.25-Feb-03 8:33
Stephane Rodriguez.25-Feb-03 8:33 
GeneralHere's one for ya Pin
Ryan Cromwell25-Feb-03 6:34
Ryan Cromwell25-Feb-03 6:34 
GeneralRe: Here's one for ya Pin
Ryan Cromwell25-Feb-03 6:40
Ryan Cromwell25-Feb-03 6:40 
GeneralException Handling Pin
jtmtv1825-Feb-03 6:23
jtmtv1825-Feb-03 6:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.