News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

DirectX performance with MASM

Started by Lonewolff, March 16, 2016, 09:49:27 AM

Previous topic - Next topic

Lonewolff

Hi Guys,

I am slowly getting my feet back on the ground with MASM (just for the fun of it mainly) and am working towards making a very basic DirectX9 application to start out with.

I am pretty proficient in DX9 and 11, so I doubt there will be too many questions there.

Even though I will know the answer soon enough (through testing), I am interested on hearing thoughts about DX performance in MASM as opposed to C++.

I know most of the bottleneck will be in the DX calls and video card performance. But will a well coded MASM project yield a higher framerate than a well coded C++ application?

I'd imagine that the performance will be on par with each other, but I'd love to be proven wrong here :)

Siekmanski

Hi Lonewolff,

All basic d3d9 api calls from the d3d9.lib are sent to the d3d9.dll and is the same for Assembly as for C++.
One thing you can speed up is not using the d3dx9.lib which is just a wrapper library.
You could write your own Math.lib to code faster routines.
And code your own Texture loader etc.
Then you can create very small and fast Direct3D9 apps.
Maybe I can help you if you have questions.
I have coded some d3d9 Masm examples if you need any ?

Marinus
Creative coders use backward thinking techniques as a strategy.

Lonewolff

Cool, thanks Siekmanski.

I'll take a look :)

So generally speaking, if you set up you project code the same way as you would in C++ performance would be around the same then? That would certainly make sense to me.

Siekmanski

Yeah, using the api calls in C++ or Assembly are equal in performance.
Creative coders use backward thinking techniques as a strategy.

K_F

Nice something to play with
Thanks
:t
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

Siekmanski

Here are some Direct3D9 examples I posted before with source code:

heightmap: http://masm32.com/board/index.php?topic=1890.msg20256#msg20256
3dstars: http://masm32.com/board/index.php?topic=4123.msg43687#msg43687
Color cubes: http://masm32.com/board/index.php?topic=4410.msg47103#msg47103
Webcam: http://masm32.com/board/index.php?topic=4858.msg52908#msg52908

And an Empty project:
Creative coders use backward thinking techniques as a strategy.