Benchmark of state changes 2d vs 3d hw

BlitzMax Forums/BlitzMax Programming/Benchmark of state changes 2d vs 3d hw

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Nobody
 #1
This is a far better benchmark. It should take under a minute to run (my GF2 MX runs it in about 70 seconds, but most of you will have a more powerful card).

'benchmarking state changes

graphics 640,480
bglSetSwapInterval( 0 )

SetColor 255, 255, 255

'two *different* 512x512 pngs
i1:TImage=loadimage("i1.png")
i2:TImage=loadimage("i2.png")

DrawImage i1, 0, 0
DrawImage i2, 0, 0

Flip
Cls

t1=millisecs()
	
For loop = 1 To 100
'test 2 - drawing to the screen bearing in mind it's using 3D hardware...


for reps=1 to 100
	drawimage i1,0,0
Next

for reps=1 to 100
	drawimage i2,0,0
Next

Flip
Cls	

Next

t2=millisecs()
print "grouped: "+(t2-t1)


t1=millisecs()
	
For loop = 1 To 100


'test 1 - drawing to the screen as if you were doing 2D

for reps=1 to 100
	drawimage i1,0,0
	drawimage i2,0,0
Next

Flip
Cls

Next

t2=millisecs()

print "default:"+(t2-t1)

print

End