IGCIT / Intel-GPU-Community-Issue-Tracker-IGCIT

IGCIT is a Community-driven issue tracker for Intel GPUs.
GNU General Public License v3.0
116 stars 4 forks source link

D3D12: Dual source blending behaves wrongly if the second source is only used on a disabled output #214

Open Pokechu22 opened 1 year ago

Pokechu22 commented 1 year ago

Checklist [README]

Application [Required]

Dolphin Emulator

Processor / Processor Number [Required]

Intel Core i7-10750H CPU

GPU Driver Version [Required]

Rendering API [Required]

Windows Build Number [Required]

Other Windows build number

No response

Intel System Support Utility report

igcit_ssu.txt

As a side note the anonymization doesn't seem to remove Network Name/Profile, nor does it remove it remove the username/machine name from log messages (e.g. "A new BITS job could not be created"). I haven't manually removed them either as I don't think it's an issue in my case, but this is something you may want to change.

The "The system has rebooted without cleanly shutting down first." line at the top was due to me needing to force shut down my laptop after updating the driver (I was previously on 30.0.100.9684); after the updating finished I was left with a completely black screen. I'm not entirely sure why that happened, but things were fine after it booted again.

Description and steps to reproduce [Required]

Super Mario Sunshine draws its skyboxes by first drawing clouds and sun flare in greyscale and then drawing the sky afterwards with a source factor of 1 and a dest factor of 1-src_color (this results in the clouds being tinted blue). This process is done on an RGB888 framebuffer, so alpha update is disabled. Dolphin converts this to SrcBlend = D3D12_BLEND_ONE, DestBlend = D3D12_BLEND_INV_SRC_COLOR, SrcBlendAlpha = D3D12_BLEND_ONE, DestBlendAlpha = D3D12_BLEND_INV_SRC1_ALPHA, RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_RED | D3D12_COLOR_WRITE_ENABLE_GREEN | D3D12_COLOR_WRITE_ENABLE_BLUE. In this case, the Intel driver does the wrong thing, acting as if the source factor were 0 and the dest factor 1. This only affects D3D12, and also does not affect my Nvidia GPU.

I have found a few things that give correct results:

The DestBlendAlpha approach seems like it should be free of side effects, and is what I'm doing in https://github.com/dolphin-emu/dolphin/pull/11406. However, this still seems like a driver bug that behaviors differ depending on SrcBlendAlpha/DestBlendAlpha when D3D12_COLOR_WRITE_ENABLE_ALPHA is not enabled.

Here are detailed reproduction steps:

There are screenshots on https://github.com/dolphin-emu/dolphin/pull/11406.

Device / Platform

No response

Crash dumps [Required, if applicable]

No response

Application / Windows logs

No response

IntelSupport-Rozilah commented 1 year ago

hi @Pokechu22, Thanks for the clear explanation, we have started to verify the issue and couldn't find the screenshot from the link you provided. please confirm that image I attached is like the issue you observed.

  1. black sky issue observed(tested with Intel UHD graphic) image
  2. issue is not observed and a blue sky appears correctly.(tested with Nvidia RTX 3060) image
Pokechu22 commented 1 year ago

Yes, those images match what I am seeing. On my link, the images are inside of <details> tags which you need to click on to show the screenshots though; sorry for the lack of clarity about that.

IntelSupport-Rozilah commented 1 year ago

hi @Pokechu22, The case has been verified on our side and we are able to reproduce it with our configurations as below: Processor: Intel(R) Core(TM) i7-11700K OS build: Windows 10 Home 19044(21H2) Graphic device: Intel UHD Graphic 750 Graphic Driver version: 31.0.101.3790 We will be working on a fix. I want to give you a heads-up that the fix may take 3 to 6 months to be included.

Pokechu22 commented 1 year ago

Thanks for the heads-up. I'll look into getting the workaround of changing SrcBlendAlpha/DestBlendAlpha to Zero/One if updates are disabled (https://github.com/dolphin-emu/dolphin/pull/11406) merged in the mean time. If we discover any situations where that workaround doesn't work I'll let you know. I'll edit the comment when the workaround is merged. (This does also mean that when confirming it's fixed, you'll want to use a version without the workaround, such as 5.0-17995).


EDIT: Workaround was merged as 5.0-18663. The issue should still be reproducible in earlier versions, including 5.0-18661 and the beta version 5.0-18498.