GL Galore brush speed test (for tilemapped games)
Posted: Wed Oct 02, 2024 4:18 pm
The only way on Amiga to display perfect synchronization with the monitor vertical refresh is GLGalore. So using it to display tilemapped game backgrounds for scrolling is inevitable.
I have two problems with it:
- low performance
- uneven performance
You can check the w.i.p. executables for some platforms here: http://kezdobetu.hu/software/downloads/ra/
Of course only OS4/MOS using GLGalore.
So to check the raw performance of GLGalore i made a simple test.
It displays numbers which shows how many times it can fill the display with the brushes in one vertical frame.

The source is lower there.
My Peg2/Radeon9200 result is this:
I would like to ask for help to check the code to see that is it the best mode for the problem, and please drop here the results on different systems.
There is a precompiled Hollywood applet here to test it with the free Hollywood player: http://kezdobetu.hu/software/downloads/ra/test.hwa
I have two problems with it:
- low performance
- uneven performance
You can check the w.i.p. executables for some platforms here: http://kezdobetu.hu/software/downloads/ra/
Of course only OS4/MOS using GLGalore.
So to check the raw performance of GLGalore i made a simple test.
It displays numbers which shows how many times it can fill the display with the brushes in one vertical frame.

The source is lower there.
My Peg2/Radeon9200 result is this:
Code: Select all
Hollywood openGL HW brush test
------------------------------
CPU: ppc
Platform: AmigaOS4
HW kernel: 10.0
Display: 800 x 600 / 24 @ 61
Brushes: 48 x 54
Result: 3 pages/frame.There is a precompiled Hollywood applet here to test it with the free Hollywood player: http://kezdobetu.hu/software/downloads/ra/test.hwa
Code: Select all
;speedtest
@REQUIRE "glgalore", {link=True}
@DISPLAY 1,{hidden=True, mode="fullscreen", width=800, height=600, DisableBlanker=True}
Function get_verticalfrequency()
Local f=0
If Not GetAttribute(#DISPLAY,1,#ATTRDOUBLEBUFFER) Then Return(-1,"Not a doublebuffer display")
Local timer=StartTimer(#NIL,999)
While Not timerelapsed(timer)
f=f+1
Flip(True)
Wend
StopTimer(timer)
Return(f,"ok")
EndFunction
Function gen_brush(id,col,sw,sh)
Local tid=CreateTextObject(Nil,id)
ScaleTextObject(tid,sw,sh)
Local bid=CreateBrush(Nil,sw,sh,col,{hardware=False})
SelectBrush(bid)
DisplayTextObject(tid,0,0)
EndSelect
CopyBrush(bid,id,{hardware=True})
FreeBrush(bid)
FreeTextObject(tid)
EndFunction
w,h,sw,sh=800,600,48,54
sw=StringRequest("test","Display width/height:"..w.."/"..h.."\nScreen freq:"..freq.."\nEnter tile size",sw,#NUMERICAL,3)
sh=StringRequest("test","Display width/height:"..w.."/"..h.."\nScreen freq:"..freq.."\nEnter tile size",sh,#NUMERICAL,3)
If Val(sw)<1 Or Val(sh)<1 Then End
OpenDisplay(1)
BeginDoubleBuffer(True)
w=GetAttribute(#DISPLAY,1,#ATTRWIDTH)
h=GetAttribute(#DISPLAY,1,#ATTRHEIGHT)
d=GetAttribute(#DISPLAY,1,#ATTRDEPTH)
freq=get_verticalfrequency()
TextOut(#CENTER,#CENTER-20,"Display size: " .. w .. " x " .. h .. " / " ..d)
TextOut(#CENTER,#CENTER-10,"Testing with brush size: " .. sw .. " x " .. sh)
TextOut(#CENTER,#CENTER,"Calculated display frequency (Hz): " .. freq)
TextOut(#CENTER,#CENTER+10,"LMB to start. It will exit after 15 seconds.")
Flip()
WaitLeftMouse()
gen_brush(1,$c02020,sw,sh)
gen_brush(2,$20c020,sw,sh)
gen_brush(3,$2020c0,sw,sh)
gen_brush(4,$c0c0c0,sw,sh)
gen_brush(5,$c0c020,sw,sh)
gen_brush(6,$20c0c0,sw,sh)
gen_brush(7,$2020c0,sw,sh)
gen_brush(8,$202020,sw,sh)
gen_brush(9,$008000,sw,sh)
gen_brush(10,$c02020,sw,sh)
gen_brush(11,$20c020,sw,sh)
gen_brush(12,$2020c0,sw,sh)
gen_brush(13,$c0c0c0,sw,sh)
gen_brush(14,$c0c020,sw,sh)
gen_brush(15,$20c0c0,sw,sh)
gen_brush(16,$2020c0,sw,sh)
gen_brush(17,$202020,sw,sh)
gen_brush(18,$008000,sw,sh)
f,frame=0,1000\freq
StartTimer(2,20000)
Repeat
x,y,br=0,0,1
StartTimer(1)
While GetTimer(1)<frame
DisplayBrush(br,x,y)
x=x+sw
If x>w Then x,y=0,y+sh
If y>h Then br,x,y=Min(br+1,18),0,0
Wend
ResetTimer(1)
Flip
Until timerelapsed(2)=True
StopTimer(1)
StopTimer(2)
Cls
TextOut(#CENTER,#CENTER-10,"Test completed.")
TextOut(#CENTER,#CENTER,"Displayed pages per frame @ freq: " .. br .. " @ " .. freq)
TextOut(#CENTER,#CENTER+10,"Results on the clipboard. LMB to exit.")
Flip()
t=GetVersion()
res$=
"Hollywood openGL HW brush test\n"..
"------------------------------\n"..
"CPU: ".. t.cpu .. "\n"..
"Platform: " .. t.platform .. "\n"..
"HW kernel: " .. t.kernel .. "\n"..
"Display: " .. w .. " x " .. h .. " / " .. d .. " @ " .. freq .. "\n" ..
"Result: " .. br .. " pages/frame."
SetClipboard(#CLIPBOARD_TEXT,res$)
WaitLeftMouse()