Previous Thread
Next Thread
Print Thread
HLSL effect crashes locally-compiled MAME #116350 11/05/19 11:57 PM
Joined: Oct 2019
Posts: 21
R
Robert Hildinger Offline OP
Member
OP Offline
Member
R
Joined: Oct 2019
Posts: 21
There is a strange issue with the MacOS version of MAME that has been going on since at least the 209 timeframe. Specifically, using the HLSL effect crashes MAME when I build it on my computer. It also crashes the build at https://choccyhobnob.com/, but does NOT crash the build created at http://sdlmame.lngn.net/.

This is the error that occurs (for both my build and the choccyhobnob build):

Code
RHILDING-M-26W8:mame rhilding$ ./mame_galaga_64 galaga -window -nomax -video bgfx -bgfx_screen_chains hlsl
2019-11-05 17:53:33.455 mame_galaga_64[68895:490990] ../../../../../3rdparty/bgfx/src/renderer_mtl.mm (2465): BGFX 0x00000001: Failed to create Fragment shader.
Abort trap: 6



Note: I'm compiling on MacOS Mojave 10.14.6, and here is the relevant compile information:

Build version: 0.215 (mame0215)
Build architecure:
Build defines 1: SDLMAME_UNIX=1 SDLMAME_MACOSX=1 SDLMAME_DARWIN=1
Build defines 1: LSB_FIRST=1 PTR64=1
SDL/OpenGL defines: SDL_COMPILEDVERSION=2009 USE_OPENGL=1
Compiler defines A: __GNUC__=4 __GNUC_MINOR__=2 __GNUC_PATCHLEVEL__=1 __VERSION__="4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.3)"
Compiler defines B: __amd64__=1 __x86_64__=1
Compiler defines C: _FORTIFY_SOURCE=2

Re: HLSL effect crashes locally-compiled MAME [Re: Robert Hildinger] #116351 11/06/19 12:39 AM
Joined: Mar 2001
Posts: 16,376
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,376
Which BGFX backend are you using? The HLSL chain does fail to compile with the Metal backend (-bgfx_backend metal), but prior to 0.215 it worked with OpenGL (-bgfx_backend opengl). Currently -bgfx_backend opengl doesn't work at all for me.

(Ryan: Is there some way to enable verbose BGFX shader compilation errors so we can track this down?)

Re: HLSL effect crashes locally-compiled MAME [Re: Robert Hildinger] #116353 11/06/19 01:47 AM
Joined: Oct 2019
Posts: 21
R
Robert Hildinger Offline OP
Member
OP Offline
Member
R
Joined: Oct 2019
Posts: 21
sdlmame.lngn.net 215 build:
- hlsl compiles successfully on all bgfx backends (opengl, gles, metal).

my local build and chocyhobnob 215 build:
- hlsl compiles successfully for: opengl
- hlsl fails to compile for: metal and gles

I've noticed in all cases where hlsl successfully compiles that it appears to not be honoring the monitor rotation setting, at least for Galaga. The Galaga scanlines appear horizontal instead of vertical like they should be...

Re: HLSL effect crashes locally-compiled MAME [Re: Robert Hildinger] #116354 11/06/19 01:58 AM
Joined: Mar 2001
Posts: 16,376
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,376
Correct, the scanlines are always horizontal for the HLSL chain.

Re: HLSL effect crashes locally-compiled MAME [Re: Robert Hildinger] #116355 11/06/19 02:04 AM
Joined: Mar 2001
Posts: 16,376
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,376
The sdlmame.lngn.net build actually doesn't allow Metal - it always picks OpenGL for BGFX. I just tried it, you can run with -bgfx_debug to show on-screen what backend it's really using plus some performance data.

Re: HLSL effect crashes locally-compiled MAME [Re: R. Belmont] #116356 11/06/19 02:17 AM
Joined: Oct 2019
Posts: 21
R
Robert Hildinger Offline OP
Member
OP Offline
Member
R
Joined: Oct 2019
Posts: 21
Originally Posted by R. Belmont
The sdlmame.lngn.net build actually doesn't allow Metal - it always picks OpenGL for BGFX. I just tried it, you can run with -bgfx_debug to show on-screen what backend it's really using plus some performance data.


Aha! That would explain it then. Good to know it's not some hard-to-find difference in compilers. Sorry for throwing up a red herring...

Re: HLSL effect crashes locally-compiled MAME [Re: R. Belmont] #116359 11/06/19 10:50 AM
Joined: May 2009
Posts: 1,820
J
Just Desserts Offline
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 1,820
Originally Posted by R. Belmont
(Ryan: Is there some way to enable verbose BGFX shader compilation errors so we can track this down?)


Yes, I'll look at it when I get home from work.

Re: HLSL effect crashes locally-compiled MAME [Re: Robert Hildinger] #116421 11/13/19 03:33 AM
Joined: Mar 2001
Posts: 16,376
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,376
MAME top-of-tree has an updated BGFX where the HLSL shader works fine on the Metal backend. This will be in 0.216, of course.


Moderated by  R. Belmont 

Who's Online Now
2 registered members (AJR, Cpt. Pugwash), 203 guests, and 3 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,712
Posts114,515
Members4,869
Most Online510
Aug 26th, 2019
Powered by UBB.threads™ PHP Forum Software 7.7.3