SetGraphicsDriver() Fast in DX7 Slow in DX9 (?)

BlitzMax Forums/BlitzMax Programming/SetGraphicsDriver() Fast in DX7 Slow in DX9 (?)

Richard Betson(Posted 2010) [#1]
I have noticed a huge difference in speed when selecting graphic drivers. If I use SetGraphicsDriver D3D7Max2DDriver() (DiectX 7 driver) my game will do 210 fps (flip 0). If I use SetGraphicsDriver D3D9Max2DDriver() (DirectX 9 Driver) my game goes to 63 fps (flip 0).

It also appears that the default for the Graphics() command is the DX9 driver.

Why would this be? What is the difference in these two drivers; that might cause this?

I would add that the openGL driver hits 5 fps. But this could be poor OpenGL support on the video card. Not sure.

EDIT -> Installed the latest Nvidia driver. DX problem NOT fixed. OpenGL improved to the same fps as the DX7 driver.


I just got a new computer:
Win 7 64 bit Premium Home
GeForce 6150 nforce

Last edited 2010


_JIM(Posted 2010) [#2]
I would blame that video card. It's integrated and integrated video cards are to be considered as "special" children of the GPU world.

When dealing with integrated abominations it's better to go as low as possible in terms of technologies used. Hence DX7 runs faster than DX9.

There surely are a lot of other problems with that card, like limited multi-texturing support, maybe no Hardware transform & lightning, very few shader processors (2-4) and so on.

Hope this helps.


Richard Betson(Posted 2010) [#3]
_Jim,

integrated video cards are to be considered as "special" children of the GPU world.

No Doubt! But I can't remember a video card running slower on DX9 (DirectX in general) then OpenGl.

Truly I am not expecting much from the Geforce 6150 chip set. That said I would expect consistent performance while using DX and OpenGL. These "on board" chip sets are a market I would like to include in my game development. It's easy to shunt these types of chip sets into the not very good pile, but they are everywhere.

As to performance Under OpenGL and Driectx-7 (through SetGraphics(dx7)) I am getting descent speed and effects support. Since I am only using Bmax's Max2D module for generating the graphics, shaders and other effects options are not used including multi-texturing. So I do not see how there should be any difference in Dx-7 vs. DX-9 performance.

So I am still interested in why the difference in performance between SettingGraphicsDriver(dx7) vs. SettingGraphicsDriver(dx9). I will try to send an email to Nvidia about this.

Thanks


_JIM(Posted 2010) [#4]
That's true. I'm also targeting system with integrated GPUs.

There would be another possibility, but the thought of it frightens me. It may be that this GPU is not fully compliant with directx 9 (or at least what BlitzMAX uses) which would mean some kind of software fallback is engaged.

Also, have you tried updating DirectX to the latest version? Note that winows 7 does NOT include directx9. I have no idea about what happens to previous versions though. W7 (like Vista) translates all calls to DX11 (or 10 in Vista's case), however it still needs some files in order to run efficiently. Files that are not included by default.

Don't take this info as fully accurate because I may be wrong.

Just try updating DirectX. Maybe Bmax uses one file that's not available and it falls back on software.


Richard Betson(Posted 2010) [#5]
_Jim

Interesting. I assumed Win 7 would just include DX9 support. My system shows Dircetx 11 and I thought that whatever version you had of Dx it was backwardly compatible to previous versions.

So If I understand correctly your saying that Win 7 is not shipping with DX-9 supported fully, at least in the case of BMAX? And, that beacuse of this I may need to update to a new version of DX-11?

I'll do a little google research and see what else I can find on the above.

I also have a thread at the Nvidia forum here:
http://forums.nvidia.com/index.php?showtopic=183215

Thanks,

Last edited 2010


Richard Betson(Posted 2010) [#6]
Installing DX 9 drivers no help.

I went the DX Home Page and dl'ed the latest drivers (looked like dx9 stuff mostly) and no changes to report.

mmmmm...


Czar Flavius(Posted 2010) [#7]
Generally speaking DX9 is better than DX7 on a decent card, but worse on a bad card. With 64-210 fps though, don't worry about it too much.


SLotman(Posted 2010) [#8]
Maybe VSync is forced on the dX9 driver? I'm very suspicious about this 60 fps...

You could also download the dx9 redistributable from Microsoft and try to install that.


Czar Flavius(Posted 2010) [#9]
Well it is 63..


HrdNutz(Posted 2010) [#10]
try flip -1


SLotman(Posted 2010) [#11]
flip -1 won't make the program to run faster, since it uses an internal timer to lock the program at 60 fps.

Being at 63 fps also means nothing - as it could be locked at the monitor refresh rate - which could be anything.

I still think this could be a driver configuration issue - a 'force vsync' setting in the driver configuration; but what just got my attention was the 5 fps on OpenGL.

Even on Intel GMA chipset, I didn't have such a drop from DX7/DX9/OGL.

Now, best way to test this would be an example program. Maybe you're doing something that the old 'dx7' pipeline can benefit (pixel intensive?) and the dx9 or ogl is slower?


Richard Betson(Posted 2010) [#12]
@Slotman,

As far as "Force VSync" it is not set "forced" but application controlled. In fact if I have a lot of applications running in the background it will slow to 50. As mentioned above installing the latest Nvidia drivers fixed the OpenGL problem. Now hits 220 fps which is great.

Now, best way to test this would be an example program.

I have been thinking of doing just that. Since I am just drawing images it will be easy but I am not sure what that will reveal. It would be useful if someone had the same video card. In my game I am only drawing images using Max2D. It a scrolling map engine (360 degree) with clipping so there is not much bleed out of the screen area. I am not even using blends.

The more I look at this problem the more I'm convinced it's a video card (GPU) driver issue. The fact that OpenGL was 5 fps and poof 220 fps after a GPU driver update leads me to believe there are some translation issues when DX-ll is used. Maybe they rushed it for Windows 7?

Anyway. . . :)


Dabhand(Posted 2010) [#13]
OffTopic, but slightly on topic:


Maybe they rushed it for Windows 7?



I had a barney in PC World regarding a laptop, which had a sticker on stating it was 'Vista Ready', I cannot remember the specs but it had a GMA in it, anyway, I asked the assistant if it was 100% Vista Ready, he was like 'Oh yes, this comes with Vista HP, and if you choose to upgrade, it will run Ultimate to', I went 'Okay, can it manage all the new graphical features of Vista?', 'Definitely, Aero is up and running on this machine'

Then I asked about DirectX10, now, I wasnt actually expecting a machine that would give me 2m FPS under DirectX10, but, I would expect a crappy Vista Ready machine to be able to knock out 10fps, which would of done me, as I wanted to have a poke around the DX10 API... Sadly, the word I received was that I wouldnt be able to enjoy the fruits of this API, because of the GMA card.

So, I stated that he told me the laptop was 100% Vista Ready, it had a sticker on stating it was vista ready, and actually, it, erm wasnt!

He explained that since it can handle anything but DirectX10, that that was enough to give it approval and thats why manufacturers place them little stickers on it... Then I hit back with, okay, how many of these Vista Ready machines in here can actually run Vista in all its glory?

There was a line of laptops, and only one machine could run directX10, which cost too, and was probably only future proof for 6 months or something!

I just shock my head, remember mentioning false advertising, load of rubbish etc etc

So, just imagine if I never asked, came home with a £500 laptop and expected it to do things that it couldnt physically do, even though some sticker says it can... Barmy, and my biggest pet hate!

Dabz


Richard Betson(Posted 2010) [#14]
Upgrading to their just released drivers actually gives slower performance over all and no improvement in DX 9.


xlsior(Posted 2010) [#15]
If it makes you feel any better, Microsoft faced a classaction lawsuit regarding the whole 'vista ready' debacle, and lost.


PowerPC603(Posted 2010) [#16]
My laptop (HP Pavilion dv9000) has Vista Home Premium installed by default.
I'm furious that I can't use WinXP on it. HP created drivers for everything on this laptop to run under Vista HP only.
If I would install WinXP, then I don't have any graphics drivers, no sound drivers, no network, nothing. I searched HP's site and could only find drivers for Vista (for this laptop), nothing else.


When I installed my first 3D game, I skipped the DX9 installation as I thought DX9 is included in DX10, which Vista has already.

Surprise: the game didn't run. It complained about not finding DirectX or something like that.
I really had to install DX9, which was on the game's disc. After that, the game ran fine.

So I guess Vista's DX10 and Win7's DX11 are just barebone DirectX libraries which don't include previous versions (you need to install DX9 separately if you want to use DX9).

Last edited 2010


Jesse(Posted 2010) [#17]
sorry off topic:
@PowerPC603
These xp drivers don't work on your system?:
http://h10025.www1.hp.com/ewfrf/wc/softwareCategory?os=228&lc=en&cc=us&dlc=en&sw_lang=&product=1842189#N174


Richard Betson(Posted 2010) [#18]
@PowerPC603

As stated above I have already installed DX-9 drivers from the DX Home Page; no improvement. ;)


orgos(Posted 2010) [#19]
@Richard Betson

I test all the bmax drivers in some PCs and laptops. And that depend on the OS I guess, in many pcs with Win XP the better video driver result to be D3D7 in wind 7 the better driver result is d3d9 and in my laptop the better video driver is MAX2D.
Because that I make a function to test what the better bmax driver for the current computer. I run it the first time the game run on the PC, then I save the status to my config file.


Method betterDriver:TList(width:Int = 800, height:Int = 600, depth:Int = 0, hertz:Int = 60, flags:Int = GRAPHICS_BACKBUFFER)
		?Win32
		Local _max2dFPS:Int = 0
		Local _directx7FPS:Int = 0
		Local _directx9FPS:Int = 0
		Local __itime:Int
		Local __time:Int
		Local i:Int
		Events.timer = MilliSecs()
		Try
			'Directx7
			SetGraphicsDriver D3D7Max2DDriver()
			Graphics(width, height, depth, hertz, flags)
			__itime = MilliSecs()
			__time = __itime + 3000
			i = 0
			While (__time > __itime)
				__itime = MilliSecs()
				Cls
				For i = 0 To 1000
					SetColor(Rand(0, 255), Rand(0, 255), Rand(0, 255))
					SetAlpha(Rand(0.1, 1.0))
					SetRotation(Rand(0, 360))
					DrawRect(Rand(0, width), Rand(0, height), Rand(10, 100), Rand (10, 100))
				Next
				Cls
				SetColor(255, 255, 255)
				SetAlpha(1)
				SetRotation(0)
				Local tw:Int = TextWidth("Testing driver " + DRIVER_D3D7)
				DrawText("Testing driver " + DRIVER_D3D7, width / 2 - tw / 2, height / 2)
				tw = TextWidth("0 seconds to finish")
				DrawText(((__time - __itime) / 1000) + " seconds to finish", width / 2 - tw / 2, height / 2 + 12)
				Flip(VERTICAL_SYNC_DISABLE)
				Events.update()
				_directx7FPS = xFPS.Calc()
			Wend
			EndGraphics
			
			'Directx9
			SetGraphicsDriver D3D9Max2DDriver()
			Graphics(width, height, depth, hertz, flags)
			__itime = MilliSecs()
			__time = __itime + 3000
			While (__time > __itime)
				__itime = MilliSecs()
				Cls
				For i = 0 To 1000
					SetColor(Rand(0, 255), Rand(0, 255), Rand(0, 255))
					SetAlpha(Rand(0.1, 1.0))
					SetRotation(Rand(0, 360))
					DrawRect(Rand(0, width), Rand(0, height), Rand(10, 100), Rand (10, 100))
				Next
				Cls
				SetColor(255, 255, 255)
				SetAlpha(1)
				SetRotation(0)
				Local tw:Int = TextWidth("Testing driver " + DRIVER_D3D9)
				DrawText("Testing driver " + DRIVER_D3D9, width / 2 - tw / 2, height / 2)
				tw = TextWidth("0 seconds to finish")
				DrawText(((__time - __itime) / 1000) + " seconds to finish", width / 2 - tw / 2, height / 2 + 12)
				Flip(VERTICAL_SYNC_DISABLE)
				Events.update()
				_directx9FPS = xFPS.Calc()
			Wend
			EndGraphics
			
			'Max2d
			SetGraphicsDriver GLMax2DDriver()
			Graphics(width, height, depth, hertz, flags)
			__itime = MilliSecs()
			__time = __itime + 3000
			While (__time > __itime)
				__itime = MilliSecs()
				Cls
				For i = 0 To 1000
					SetColor(Rand(0, 255), Rand(0, 255), Rand(0, 255))
					SetAlpha(Rand(0.1, 1.0))
					SetRotation(Rand(0, 360))
					DrawRect(Rand(0, width), Rand(0, height), Rand(10, 100), Rand (10, 100))
				Next
				Cls
				SetColor(255, 255, 255)
				SetAlpha(1)
				SetRotation(0)
				Local tw:Int = TextWidth("Testing driver " + DRIVER_MAX2D)
				DrawText("Testing driver " + DRIVER_MAX2D, width / 2 - tw / 2, height / 2)
				tw = TextWidth("0 seconds to finish")
				DrawText(((__time - __itime) / 1000) + " seconds to finish", width / 2 - tw / 2, height / 2 + 12)
				Flip(VERTICAL_SYNC_DISABLE)
				Events.update()
				_max2dFPS = xFPS.Calc()
			Wend
			EndGraphics
		Catch e:String
		End Try
		
		Local l:TList = New TList
		l.AddLast(xScreenDriver.Create(DRIVER_D3D9, _directx9FPS))
		l.AddLast(xScreenDriver.Create(DRIVER_D3D7, _directx7FPS))
		l.AddLast(xScreenDriver.Create(DRIVER_MAX2D, _max2dFPS))
		l.Sort(True, xScreenDriver.Sort)

		Return l
		?
		
		Return Null
	End Method


Last edited 2010


xlsior(Posted 2010) [#20]
I searched HP's site and could only find drivers for Vista (for this laptop), nothing else.


Yeah, got to love that sometimes. However, most of the machines are still build around common chipsets. Even though HP may not offer a driver, you may still be able to get everything fully functional using the actual manufacturer drivers: e.g. video drivers from Intel, Network drivers from broadcom, motherboard chipset drivers from Intel/nvidia, etc.

I ran into a slightly similar issue when trying to downgrade a Fujitsu laptop from Vista to XP -- Fujitsu had the majority of XP drivers available on their website, but a few were missing which resulted in those fun 'unknown hardware' listings in the hardware device manager.
Ended up looking up the device ID's at http://www.pcidatabase.com , and was able to find some IBM (!) drivers that got the remaining hardware pieces functional as well.


Richard Betson(Posted 2010) [#21]
@orgos

That looks very interesting. I had been considering doing just the same thing in order find the best fit Bmax graphic driver. I will give this a try tonight, but it looks just like what I might need. I will let you know. :)

@everyone
I remember back in the "day" B3D having some issues with Nvidia drivers. It got resolved but for awhile we all had to have a specific Nvidia driver version. Anyone remember what that was about?

Edit - Just reading above post and for the record this computer came with a Microsoft driver for video not HP. 8)

Last edited 2010


Richard Betson(Posted 2010) [#22]
Well,

I have a new, new computer:)

It turns out that BestBuy labeled the first computer I bought from them as an Athlon X2, but it instead was an Athon II 170u (2.0 ghz) single core. So I called and explained it (I guess very well) to the manager and he instantly upgraded me no charge to another system with a 2.8 ghz Athlon II X2 220, more ram (from 2 to 4 gig) and "way" better monitor (50,000-1 from 5000-1 contrast). Go BestBuy.

The system I have now is an Emachines EL1352-07e. This is not the greatest system but I am really impressed with it so far. Now DX 9 works great with the same video card (GeForce 6150 ) as the last system. Both DX 7 and OpenGL work great as well. I am just just glad to be rid of the Compaq/HP system. I have never had much luck with HP. My guess is HP's implementation of the 6150 is a kludge.

There are a "zillion" of theses (EL1352-07e) systems out there so it's perfect for developing for these kinds of entry/mid level platforms.

L8r,

Last edited 2010