Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
update on Mac bgfx and accel questions #116395 11/12/19 02:39 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
In a previous thread I reported that mame 0.215 was crashing immediately with bgfx enabled.

I compiled the latest git to find that issue was resolved... as long as I use metal as the backend. OpenGL only uses ¼ of the monitor with a Retina display.

However I am finding a lot of older games show a mostly red screen. This is dkong, I've seen it with mario, centiped, polepos, phoenix, etc.

[img]https://photos.app.goo.gl/iZ3PSKJ55cnv6mVM8[/img]

I remembered that SDL supports -video accel and that works fine, as does -video soft.

However I cannot seem to select video accel in the mame.ini file as it seems to fall back to bgfx. Is there anyway to default to accel or will I have to type the command every time?
I seem to recall before bgfx came along that you could choose soft, OpenGL, or accel as options for video in the .ini file.

thanks!


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116396 11/12/19 02:46 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
Additionally, when using mame F12 to take a screenshot the image looks normal.

I had to take a Mac screenshot to show the mostly red screen.


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116397 11/12/19 02:54 PM
Joined: Mar 2004
Posts: 648
belegdol Offline
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 648
Which screen chains are you using? Is it with metal or OpenGL or vulkan? Is your bgfx folder up-to-date? Thanks for the info!

Re: update on Mac bgfx and accel questions [Re: will] #116398 11/12/19 03:02 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
Chains are set to none. Issue is with metal or vulkan - I believe vulkan runs on top of metal. OpenGL works fine but has known bug with Retina displays only takes up ¼ of the screen. bgfx folder is always up to date. thanks!


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116399 11/12/19 03:08 PM
Joined: Mar 2004
Posts: 648
belegdol Offline
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 648
Setting shaders to none is wrong. You need to set them to default or unfiltered. Setting to none disables shader pipeline entirely which is required for colorspace conversion now.
If you try a game using rgb32 output natively (e.g. invqix or any cps3 game) colours will be normal with none.

Re: update on Mac bgfx and accel questions [Re: will] #116400 11/12/19 03:21 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
THANK YOU! That fixed it. I created a fresh mame.ini which has chains set to default which is working fine now.


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116401 11/12/19 03:41 PM
Joined: Mar 2004
Posts: 648
belegdol Offline
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 648
Glad I could help. If you don't mind, could you do me a favour and test metal backend and hlsl chain both with stock bgfx folder and with one attached to https://github.com/mamedev/mame/pull/5875? Thanks!
Please use -bgfx_debug to be sure metal is actually being used.

Last edited by belegdol; 11/12/19 03:42 PM.
Re: update on Mac bgfx and accel questions [Re: will] #116402 11/12/19 04:37 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
OK tried with stock bgfx folder it crashes:

2019-11-12 11:21:30.188 mame64[65803:10341117] ../../../../../3rdparty/bgfx/src/renderer_mtl.mm (2465): BGFX 0x00000001: Failed to create Fragment shader.
zsh: abort ./mame64 dkong -bgfx_screen_chains hlsl

Tried with the new bgfx folder and it works! Verified it is using Metal. Colors are normal. Display looks like scan lines, CRT effect. Here's a screenshot:

[img]https://photos.app.goo.gl/vRP1mzc45Ds42At76[/img]


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116404 11/12/19 04:51 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
Update - dual screen games are not working with or without chains.
Only the 1st screen renders normally, the others are red.

Also tried using -bgfx_screen_chains hlsl:hlsl

Darius
[img]https://photos.app.goo.gl/t3Mc8WE3Ux6qmExG8[/img]

Super Punchout with chains
[img]https://photos.app.goo.gl/aNFn1gBh7vpaEoEWA[/img]

without chains
[img]https://photos.app.goo.gl/Wz8iSNTZxKTTxqub7[/img]


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116405 11/12/19 04:52 PM
Joined: Mar 2001
Posts: 16,391
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,391
Thanks Will. I imagine this is probably an easy fix for Moogly.

Re: update on Mac bgfx and accel questions [Re: will] #116406 11/12/19 05:11 PM
Joined: Mar 2004
Posts: 648
belegdol Offline
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 648
Thanks for testing will! I have now added the rebuilt chain to the PR and marked it as ready for review, hopefully it will get merged soon.

Re: update on Mac bgfx and accel questions [Re: will] #116407 11/12/19 05:12 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
This reminds me, will bgfx support multiple monitors on Macs? I've tried various options and right now it seems no dual screens at all.

I have an iMac with an external Cinema Display. Using OpenGL, it blacks out both screens and I have to toggle full screen in and out multiple times to get it to work somewhat.

It's quite a messy experience and I end up playing in windowed mode. Now with OpenGL messing up on a Retina display, it is even worse.

Fingers crossed you guys can fix it with bgfx supporting metal. Thanks!


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116408 11/12/19 05:25 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
OK I figured out something with the multiscreen games like Darius. You have to specify each monitor:

darius -bgfx_screen_chains default,default,default
[img]https://photos.app.goo.gl/kNu8ReiPt5TdPpfC6[/img]

darius -bgfx_screen_chains hlsl,hlsl,hlsl
[img]https://photos.app.goo.gl/WwgnhEjUYQpWuL1b7[/img]

So the problem is if you don't specify default or unfiltered or hlsl then it shows that screen in all red.

That should be fixed so that it defaults to default smile


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116409 11/12/19 05:29 PM
Joined: Mar 2001
Posts: 16,391
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,391
Indeed. "default" seems like a more reasonable default than "none" smile

Re: update on Mac bgfx and accel questions [Re: will] #116410 11/12/19 06:10 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
So just to recap: ./mame64 darius results in 2 out of 3 screens in all red.

In order to play darius without issue, the correct command is:

./mame64 darius -bgfx_screen_chains default,default,default


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116411 11/12/19 07:18 PM
Joined: Mar 2004
Posts: 648
belegdol Offline
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 648
Do you have any chains configured in the ini? Even default? if yes, can you try renaming the ini so that it is not used? What *could* be happening is that if ini has default set as screen chain, it does what it says: passes -bgfx_screen_chains default to the executable. What is needed for darius is -bgfx_screen_chains default,default,default.
This would be not really a bug, but just an unfortunate consequence of the literal interpretation of the ini and the fact that the screen chain is called default.

Last edited by belegdol; 11/12/19 07:21 PM.
Re: update on Mac bgfx and accel questions [Re: will] #116412 11/12/19 07:33 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
I renamed my ini so mame is only using default settings. The second and third screen are still red.

./mame64 darius -video bgfx -bgfx_debug

[img]https://photos.app.goo.gl/6kGe4dLW1w6CiXNG8[/img]


=will=
Re: update on Mac bgfx and accel questions [Re: will] #116414 11/12/19 07:43 PM
Joined: Mar 2004
Posts: 648
belegdol Offline
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 648
Thanks, it was worth a shot.

Re: update on Mac bgfx and accel questions [Re: will] #116416 11/12/19 08:59 PM
Joined: Sep 2000
Posts: 224
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 224
Incidentally, bgfx_backend opengl is failing with any game I try.

illegal hardware instruction ./mame64 dkong -bgfx_backend opengl


=will=
Page 1 of 2 1 2

Moderated by  R. Belmont 

Who's Online Now
0 registered members (), 54 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,722
Posts114,638
Members4,873
Most Online510
Aug 26th, 2019
Powered by UBB.threads™ PHP Forum Software 7.7.3