made an account to reply here..
if your desctop resolution isnt in the dafault available resolutions, (example, you created a 4:3 1400x1050 resolution using nvidias custom resolutions tool for an arcade cabinet.) mame will fail to render the window and will spit out a directx error.
if you absolutley need to make a custom resolution for your cabinet, edit the edid data your pc sees for your monitor so that resolution becomes a default resolution or preferably the native resolution.
the easiest way to do that is to use CRU (custom resoltion utility)
just had the same issue exactly as i described above. and thats how i fixed it..
The strange thing is, it worked fine when i set it up last week, but then we went on a long weekend trip so i powered the cabinet down.. when i came back mame had the above errors. (i knew i had the runtimes installed. but installed them again along with gpu drivers and other runtimes i knew i needed.
Finally i decided it had to be the resolution, and when i saw it wasnt available as an option in mame i figured out what the issue was.
so there ya go. hope that helps people, you dont need to reinstall your OS.
OMG ! thats it !
I have this exact problem.
I'm using a 4k TV with a custom resolution for years (1728 x 2160, the TV is verticaly placed in my cabinet and I'm only using the center part.)
I've alway used the nvidia custom resolution to do so.
I've tried you CRU software, but I can't make it work too:
I've made my custom resolution in CRU, and the windows desktop is working fine.
But as soon as I launch MAME, the TV goes black, then says "no signal"
With a remote control VNC, I can see that MAME is running on my screen, and as soon as I exit MAME, the desktop come back on the TV.