snes9xgit / snes9x

Snes9x - Portable Super Nintendo Entertainment System (TM) emulator
http://www.snes9x.com
Other
2.67k stars 460 forks source link

Fullscreen borders flickering when using Direct 3D #531

Closed syndenbock closed 5 years ago

syndenbock commented 5 years ago

As the title says the black borders in fullscreen mode flicker when I select Direct 3D as the rendering engine. Snes9x version: 1.60 Win32/x64 Platform: Windows 7

OV2 commented 5 years ago

This doesn't happen for me - can you post your snes9x.conf file?

syndenbock commented 5 years ago

Here it is. Had to zip it cause github does not support .conf files. conf.zip

syndenbock commented 5 years ago

I also just tested version 1.59.2 again using the snes9x.conf I posted. With that version there is no flickering for me.

OV2 commented 5 years ago

I don't see any changes that could cause this, and have so far been unable to reproduce it on two different systems. Maybe I can find a windows 7 system at work.

bearoso commented 5 years ago

I think it's because the fullscreen flags changed in the "true fullscreen" mode. One of the buffers probably isn't being cleared properly, so it's flickering between garbage and black. This could be fixed by doing Clear, Present, Clear instead of just Clear. But we should probably just clear before every frame.

syndenbock commented 5 years ago

The issue seems to be related to the color depth in the Fullscreen Display Settings. If I select 1920 x 1080 x 32bit 144hz, it flickers. If I change to 1920 x 1080 x 16bit 144hz, the flickering stops.

bearoso commented 5 years ago

@semecan, I think that's just random, whether or not the GPU memory has zeroes or garbage in it at the time of creation. It's just lack of initialization.

syndenbock commented 5 years ago

@bearoso that could be true too, I have no knowledge of how all of that works. But another observation I just made is that when enabling Windows Aero, the flickering stops on 32 bits. As soon as I switch back to the classic theme, it goes back to flickering.

OV2 commented 5 years ago

Try disabling the "enable triple buffering" checkbox - if it's the issue bearoso mentioned that should affect it.

syndenbock commented 5 years ago

@OV2 sadly, changing that option does not affect the flickering.

syndenbock commented 5 years ago

I have not been able to reproduce the problem on a second system, so I assume it is tied to specific graphics cards, making it a very niche case propably not worth investing too much effort in fixing. I will just use the emulated fullscreen mode which already removes all flickering for me.

themalu866 commented 5 years ago

I tested on Windows 7 and what happens is:

Nicholas-Steel commented 5 years ago

I don't observe flickering but when using Direct3D Fullscreen anything that appears in the black space on either side of the 4:3 game will not clear up/black bars will retain the last displayed image in that space.

Noticeable when seeing notifications from Geforce Experience for example. When the notification slides out of view you're left with a green box stuck in the black space.

I mentioned this here (with an image example): http://www.snes9x.com/phpbb3/viewtopic.php?p=59154#p59154 (forgive me if my issue ends up being unrelated to Op)

bearoso commented 5 years ago

It's totally related. We just need to clear that area every frame.

OV2 commented 5 years ago

We're already calling clear each frame. Maybe the viewport needs to be reset before clearing.

OV2 commented 5 years ago

I've reproduced this at work, and the committed change fixed it.