beetle-psx-libretro icon indicating copy to clipboard operation
beetle-psx-libretro copied to clipboard

[OpenGL] [dithering] / several glitches / dots & lines

Open 5schatten opened this issue 6 years ago • 11 comments

When I use the beetle psx hw core I have a lot of graphical glitches. Depending on the content of the screen these are lines or dots. GT2 has beside the dots some heavy flickering while driving. The beetle psx core without hw acceleration runs fine as all other libretro-cores & standalone emulators that rely on OpenGL. I use the latest 528036a and build it as a core for my LE 9.0 fork Switching between 16bpp & 32bpp dithering reduces the glitches but does not fully resolve this problem.

Have a look at these screenshots:

https://imgur.com/a/pgyRpxJ

RA log: https://pastebin.com/ArrJavwK

System specs: i3-6100 + IGP Mesa 18.2.2 Linux kernel 4.18.2

5schatten avatar Oct 07 '18 10:10 5schatten

You said that you changed the "Internal Color Depth" setting between 16bpp and 32 bpp but have you tried changing the "Dithering Pattern" setting to OFF or Internal Resolution?

wesker265 avatar Jan 06 '19 09:01 wesker265

@webgeek1234 I tried both and I still have these glitches. The Vulkan renderer doesn't draw those artifacts so I guess it's related the OpenGL renderers color handling ¯_(ツ)_/¯

5schatten avatar Jan 06 '19 10:01 5schatten

is this still happening on the last builds?

eeee87 avatar Jun 11 '19 18:06 eeee87

Last time I updated the core I added a patch with https://github.com/libretro/beetle-psx-libretro/pull/504 but still have these problems. I guess it's also related to the Intel drivers because it runs fine on a Nvidia card. Anyway it's the only core with these problems.

5schatten avatar Jun 11 '19 18:06 5schatten

@5schatten - If this bug still happens on Intel + Mesa DRI, it would be interesting to forwarding this to the Intel Mesa driver developers. I assume the Intel Mesa driver devs are strictly following the spec. And it's known that AMD and Nvidia GL drivers have their own particularities, ranging from lax interpretation of the spec to outright broken features.

EDIT: Also, since you are using the #504 changes, please consider testing the games listed there, to confirm bug fixes and catch regressions.

rz5 avatar Jun 11 '19 21:06 rz5

I updated to the latest version but still get these weird dots. Happens for me on my i3-6100 / J3455 & on older i5-2520m based systems but not on my workstation with a GTX 1060.

Since my OS is based on LibreELEC master (https://github.com/5schatten/LibreELEC-RR/tree/libreelec-9.x-rr-working-tree) basically every base package is updated to the latest stable version which means latest Xorg server, xf86-video-intel driver, mesa 19.1.0 & Kernel 5.1.9.

The point is if Intel devs follow the specs I don't see what they exactly should change/fix if you consider that basically everything else works flawless and without glitches. It must be somewhat related to the dithering function because when I switch to 32bit dithering it slightly lessens the glitches but they are still present.

5schatten avatar Jun 14 '19 12:06 5schatten

Right, you would assume that by virtue of Mesa and the Intel driver on Linux being open-source, it would be all written in a spec-abiding way to the point of being reference material. Yet, this bug only seems to happen on Intel GPUs and only when using the Intel Linux driver. It doesn't happen on several Nvidia and AMD GPUs on both Windows and Linux. It also doesn't happen on my Intel GPU under Windows and that particular driver is infamously bad.

Have you tried replicating this bug under some other distro other than LibreELEC?

rz5 avatar Jun 14 '19 14:06 rz5

The bug happens for Sandy Bridge, Skylake & Apollo Lake based systems even on latest Mesa 19.1.2 with both available drivers i965 & Iris. So then it's probably a kernel i915 bug? Even in Linux 5.2.1? I have no clue. The fact that it only happens for Linux and not Windows basically doesn't matter because these drivers have probably nothing in common beside some OpenGL support.

In fact I have roughly ~40 systems in my LibreELEC fork which could be emulated and none shows a similar behavior. Neither libretro cores nor standalone, neither OpenGL nor Vulkan has any glitches in any emulator. Well beside beetle-psx & even the Vulkan renderer of beetle-psx has no glitches. I also tried to run it with KMS or X11 but I still get the same result. So yes it's possible that this is somewhat an upstream Linux kernel driver bug or something like that but I wouldn't exactly bet my money on this.

I haven't tried other distros yet but this won't make much sense either because none of them uses recent software. Well maybe Arch of course but then again we talk about a completely different way the packages were build.

When you change the dithering option from 16bit to 32bit it slightly lessens the glitches so well I guess the way dithering is handled is the reason for those glitches.

5schatten avatar Jul 18 '19 12:07 5schatten

@Sschatten Have you tried the following combination of options?

beetle_psx_hw_dither_mode = "disabled"
beetle_psx_hw_depth = "32bpp"

nezumisama avatar Dec 03 '19 20:12 nezumisama

@nezumisama still the same glitches, even after years & new kernel 5.10.17, mesa 21.0.0-rc4, iris instead of i915 driver. So this is most likely related to the core.

core settings:

beetle_psx_hw_adaptive_smoothing = "enabled"
beetle_psx_hw_analog_calibration = "disabled"
beetle_psx_hw_analog_toggle = "disabled"
beetle_psx_hw_aspect_ratio = "corrected"
beetle_psx_hw_cd_access_method = "sync"
beetle_psx_hw_cd_fastload = "2x(native)"
beetle_psx_hw_core_timing_fps = "force_progressive"
beetle_psx_hw_cpu_dynarec = "disabled"
beetle_psx_hw_cpu_freq_scale = "100%(native)"
beetle_psx_hw_crop_overscan = "enabled"
beetle_psx_hw_depth = "32bpp"
beetle_psx_hw_display_internal_fps = "disabled"
beetle_psx_hw_display_vram = "disabled"
beetle_psx_hw_dither_mode = "disabled"
beetle_psx_hw_dump_textures = "disabled"
beetle_psx_hw_dynarec_eventcycles = "128"
beetle_psx_hw_dynarec_invalidate = "full"
beetle_psx_hw_enable_memcard1 = "enabled"
beetle_psx_hw_enable_multitap_port1 = "disabled"
beetle_psx_hw_enable_multitap_port2 = "disabled"
beetle_psx_hw_filter = "nearest"
beetle_psx_hw_filter_exclude_2d_polygon = "disable"
beetle_psx_hw_filter_exclude_sprite = "disable"
beetle_psx_hw_frame_duping = "disabled"
beetle_psx_hw_gpu_overclock = "1x(native)"
beetle_psx_hw_gte_overclock = "disabled"
beetle_psx_hw_gun_cursor = "cross"
beetle_psx_hw_gun_input_mode = "lightgun"
beetle_psx_hw_image_crop = "disabled"
beetle_psx_hw_image_offset = "disabled"
beetle_psx_hw_image_offset_cycles = "0"
beetle_psx_hw_initial_scanline = "0"
beetle_psx_hw_initial_scanline_pal = "0"
beetle_psx_hw_internal_resolution = "1x(native)"
beetle_psx_hw_last_scanline = "239"
beetle_psx_hw_last_scanline_pal = "287"
beetle_psx_hw_line_render = "default"
beetle_psx_hw_lineRender = "default"
beetle_psx_hw_mdec_yuv = "disabled"
beetle_psx_hw_memcard_left_index = "0"
beetle_psx_hw_memcard_right_index = "1"
beetle_psx_hw_mouse_sensitivity = "100%"
beetle_psx_hw_msaa = "1x"
beetle_psx_hw_negcon_deadzone = "0%"
beetle_psx_hw_negcon_response = "linear"
beetle_psx_hw_pal_video_timing_override = "disabled"
beetle_psx_hw_pgxp_2d_tol = "disabled"
beetle_psx_hw_pgxp_mode = "disabled"
beetle_psx_hw_pgxp_nclip = "disabled"
beetle_psx_hw_pgxp_texture = "disabled"
beetle_psx_hw_pgxp_vertex = "disabled"
beetle_psx_hw_renderer = "hardware"
beetle_psx_hw_renderer_software_fb = "enabled"
beetle_psx_hw_replace_textures = "disabled"
beetle_psx_hw_scaled_uv_offset = "enabled"
beetle_psx_hw_shared_memory_cards = "disabled"
beetle_psx_hw_skip_bios = "disabled"
beetle_psx_hw_super_sampling = "disabled"
beetle_psx_hw_track_textures = "disabled"
beetle_psx_hw_use_mednafen_memcard0_method = "libretro"
beetle_psx_hw_widescreen_hack = "disabled"
beetle_psx_hw_widescreen_hack_aspect_ratio = "16:9"
beetle_psx_hw_wireframe = "disabled"

SupervisedThinking avatar Feb 19 '21 14:02 SupervisedThinking

Several years later, I've seen this bug on many systems. Right now I'm seeing it on Windows 11 system with 13th Intel Core i5 and Intel Iris XE and RA 1.16.x. It seems to only affect OpenGL renderer and Intel graphics. It affects both Linux (LibreELEC) and Windows. Also it affects every game, even the BIOS boot logo.

KOPRajs avatar Dec 28 '23 22:12 KOPRajs