baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
8.62k stars 1.3k forks source link

(OpenGL) HDR corrupts textures and freezes the software after a capture #3292

Closed AlphSpirit closed 3 months ago

AlphSpirit commented 3 months ago

Description

This all happens on Windows when HDR is enabled on your main display with a RTX GPU. Everything works fine if your main display is not HDR enabled.

image

When taking a capture, the application freezes and stops responding (here is a screenshot of the application):

image

The capture's thumbnail looks normal:

image

But when you go to the texture viewer, textures are all corrupted:

image

image

image

Only textures seem to be affected:

image

The capture file can be sent if needed.

Steps to reproduce

Environment

baldurk commented 3 months ago

This sounds like it may be a driver bug as I don't think GL even has any awareness of HDR or not and it's not something that RenderDoc supports if it does exist. Are you able to test and see if this reproduces on a non-AMD GPU?

I don't have an HDR display so I'm unable to test or reproduce this unfortunately, if it only happens with HDR enabled.

AlphSpirit commented 3 months ago

It may even be a problem with GLFW as far as I know. I use OpenTK Beta 5.0.0-pre.10 for reference, which uses GLFW version 3.3.8.

It has been happening on 3 different driver versions so the chance that this is the problem is low.

I will try and have it tested by someone with a non-AMD GPU. If you don't mind, the game can be downloaded from https://buffergame.com/download, but Windows flags it heavily as a trojan virus so I would understand if you don't want to touch it.

baldurk commented 3 months ago

Driver versions aren't as good a test as trying a different vendor, since it could exist in many versions before it gets fixed - for example if it hasn't been reported or found until now.

I tried it on an NV GPU, but as I mention I don't have an HDR display so even if the bug weren't driver specific I wouldn't be able to reproduce it.

AlphSpirit commented 3 months ago

I have a friend with an HDR screen and a RTX 2070 SUPER, we're going to test it later today. I'll come back to you with the results. In the meantime I've downloaded the source and will do some tests on my end.

AlphSpirit commented 3 months ago

In gl_common.cpp image image

When I check for red size directly in my game, I get 8: image

No other errors

Returned color encoding is 9729

baldurk commented 3 months ago

Yes I've seen the AMD driver return bad data here as well. You can ignore that error.

AlphSpirit commented 3 months ago

Tested on a RTX 2070 SUPER and everything works perfectly, so it is an AMD issue.

baldurk commented 3 months ago

Thanks for testing that. I've passed the information on to AMD but I don't think there's anything else I can do from RenderDoc's side on this.