Project

General

Profile

Actions

Emulator Issues #13563

open

A few bugs with the shader/postfx system

Added by lucasm 6 months ago.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name?

N/A

Game ID? (right click the game in the game list, Properties, Info tab)

N/A

MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)

N/A

What's the problem? Describe what went wrong.

  1. Multi value options seem to break some internal parser, causing all sorts of undefined behaviors:
  • First value may not be read.
  • Sometimes seems to crash? Only had it happen once, but worth looking into.
  • Seems to put the parser in a buggy state which causes options that come alphabetically after it to be read as zero, though not always, it entirely depends on the name/order.
  1. General lack of error handling, here are some things that cause the emulator to crash or freeze:
    • Using the wrong amount of values when declaring a multi value option, i.e. MaxValue = 1, 1, 1 followed by StepAmount = 0.05.
    • Setting DependentOption to a nonexistent option.

What steps will reproduce the problem?

Here's a very simple shader where these issues can be observed:

/*
[configuration]

[OptionRangeFloat]
GUIName = Brightness
OptionName = BRIGHTNESS
MinValue = 0
MaxValue = 2
StepAmount = 0.05
DefaultValue = 1

[OptionRangeFloat]
GUIName = Color Filter
OptionName = COLOR_FILTER
MinValue = 0, 0, 0
MaxValue = 2, 2, 2
StepAmount = 0.05, 0.05, 0.05
DefaultValue = 1, 1, 1

[OptionRangeFloat]
GUIName = Contrast
OptionName = CONTRAST
MinValue = 0
MaxValue = 2
StepAmount = 0.05
DefaultValue = 1

[/configuration]
*/

void main() {
	float4 color = SampleLocation(GetCoordinates());
	color.rgb *= GetOption(BRIGHTNESS);
	color.rgb *= GetOption(COLOR_FILTER);
	color.rgb = lerp(float3(0.5), color.rgb, GetOption(CONTRAST));
	SetOutput(color);
}

If you rename CONTRAST to, for example, BRIGHTNESS2, it actually works around the issue.
COLOR_FILTER never reads the first value and actually shifts the values to the right, so that float3(R, G, B) becomes float3(0, R, G).

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes, tested on 2407.r3.gdd67b77 from dolphin-emu-git on Arch.
Branch: master
Revision: dd67b7760137a7c383f3b326accb94be09ad6f9f

Is the issue present in the latest stable version?

Yes, tested on 5.0-21582 from the Arch Linux repos.
Branch: makepkg
Revision: c8ea116658ab814751c514d9062d694547bf3a6d

What are your PC specifications? (CPU, GPU, Operating System, more)

CPU: AMD Ryzen 7 3800X (16) @ 4.909GHz
GPU: AMD ATI Radeon RX 6800/6800 XT / 6900 XT
Memory: 6354MiB / 32001MiB
OS: Arch Linux x86_64
Kernel: 6.9.7-zen1-1-zen
GPU driver: amdgpu (open source kernel drivers)
Desktop: KDE Plasma 6.1.1 on Wayland

No data to display

Actions

Also available in: Atom PDF