Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphical glitches when using hardware rendering #15199

Closed
tanc opened this issue Apr 18, 2023 · 24 comments · Fixed by #15904
Closed

Graphical glitches when using hardware rendering #15199

tanc opened this issue Apr 18, 2023 · 24 comments · Fixed by #15904
Labels
Area-AtlasEngine Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.

Comments

@tanc
Copy link

tanc commented Apr 18, 2023

Windows Terminal version

1.17.1023

Windows build number

22H2 22622.608

Other Software

No response

Steps to reproduce

  1. Open Terminal stable or preview
  2. Open Powershell or WSL2 tab
  3. Start typing and notice the odd rendering
  4. Switch to software rendering
  5. Return to terminal tab
  6. Start typing and notice no rendering glitches

Expected Behavior

Expect that the rendering is the same as software mode where there are no glitches.

Actual Behavior

Glitches appear where the cursor appears to lag or doesn't render the character or multiple characters until another key is pressed.

See video for example:

Graphic.glitches.mp4
@tanc tanc added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Apr 18, 2023
@tanc
Copy link
Author

tanc commented Apr 18, 2023

I've tried changing the font and colour scheme but they all produce the same result. The only way to stop the glitch is software rendering.

@lhecker
Copy link
Member

lhecker commented Apr 18, 2023

You say

Open Terminal stable or preview

but those two use entirely different text renderers by default. Do you have "AtlasEngine" in the "Rendering" settings enabled in Windows Terminal stable (1.16.10262.0)? If so, could you disable that setting? If the issue still happens then, then it's possible your hardware is faulty, because the two text renderers were written independent of each other and have an entirely different architecture.

@lhecker lhecker added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 18, 2023
@tanc
Copy link
Author

tanc commented Apr 19, 2023

I did have AtlasEngine enabled in both. I've now disabled AtlasEngine in Windows Terminal stable and I'll see if the problem occurs during work today. Current settings in Windows Terminal stable:
image

The issue only started happening about a week ago and I'm wondering whether it coincided with a graphics card update (NVidia Geforce 2070 Super). I updated the drivers again today with the latest release and can confirm the issue still happens on Windows Terminal preview with AtlasEngine on or off and software rendering off.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Apr 19, 2023
@tanc
Copy link
Author

tanc commented Apr 20, 2023

After a full work day using Windows Terminal stable with AtlasEngine off I can say that I haven't seen the graphical glitch. I'm now trying with AtlasEngine on and after 10 minutes the glitch hasn't appeared.

Using Windows Terminal preview with Atlas Engine at first it all seems good. Then the glitch appears after a short time using the terminal, maybe a minute. Once the glitch appears it stays in that terminal and affects all splits.

@lhecker
Copy link
Member

lhecker commented Apr 26, 2023

Hmm... the version of AtlasEngine in stable and preview is identical. I wonder if it's maybe a compiler bug? (It wouldn't be our first!) Or some other form of race condition? 1.18 will release with an entirely new version of AtlasEngine, so I'm cautiously optimistic that the issue will be resolved as a side effect.

@zadjii-msft
Copy link
Member

I'll tag this one up as "We think it's fixed in 1.18, and we'll come back to validate"

@zadjii-msft zadjii-msft added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Apr 26, 2023
@zadjii-msft zadjii-msft added this to the Terminal v1.18 milestone Apr 26, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Tag-Fix Doesn't match tag requirements labels Apr 26, 2023
@Moqume

This comment was marked as resolved.

@zadjii-msft

This comment was marked as resolved.

@lhecker

This comment was marked as resolved.

@Moqume

This comment was marked as resolved.

@03juan

This comment was marked as resolved.

@lhecker

This comment was marked as resolved.

@03juan

This comment was marked as resolved.

@jx
Copy link

jx commented May 30, 2023

I'm also having an issue when using hardware rendering, all text will either render black or as lines about 35% of the time. It'll all render as vertical pipe characters, then sometimes a reflow/refresh will fix it, or typing CLEAR in Ubuntu. NVidia latest drivers, 3080Ti, Win10, happy to help trouble shoot. It stops when disabling hardware rendering.

@lhecker
Copy link
Member

lhecker commented May 30, 2023

@jx Does the issue reproduce on Windows Terminal Preview v1.18.1462.0?
If it does, could you please try to describe any steps I would have to take to reproduce it on my machine if I were to start from a clean state? I mean things like your font family, font size, what shell you use, an application or some text string that reproduces the issue, etc. Anything you think is necessary to reproduce it basically. That way I could run it under a debugger to see what’s going on. 🙂

@jx
Copy link

jx commented Jun 21, 2023

@lhecker I rolled back my video drivers and can't reproduce this at all. Sorry it took me three weeks! But I can't repro it at all now, so I think there was a problem with the nVidia drivers.

I had to roll them back for another reason: one of my monitors kept cutting out and after I swapped the cable and verified nothing was loose, I rolled back the gfx driver. All the issues went away. I'm on 532.03 GR, not Studio drivers. What else would you like me to test?

@lhecker
Copy link
Member

lhecker commented Jun 21, 2023

Wait wait wait…
You also have this issue where your monitor signal is cutting out? I started getting this issue suddenly last week and it weakly correlates with a Nvidia graphics driver update. That’s interesting! I guess I’ll also have to try and downgrade it.

If you’d like to test anything, please let me know if you find any unusual rendering issues in Windows Terminal Preview 1.18, for instance anything like what OP reported.

@jx
Copy link

jx commented Jun 21, 2023

Yes! It all started around the same time but the cutting out of the display was rare and just got worse over a couple of days. Once I rolled back all was golden. Everything works on this version I mentioned including preview. I only run preview builds.

@zadjii-msft
Copy link
Member

Hokay so it sounds like the issue @jx was having was related to some nvidia drivers. Otherwise, we're pretty sure this should be fixed on the latest 1.18 build, https://github.com/microsoft/terminal/releases/tag/v1.18.1462.0. @tanc you want to give that build a try to confirm/?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 5, 2023
@jx
Copy link

jx commented Jul 5, 2023

I'm currently on 1.18.1462.0 presently, no issues here. Hopefully the same is true for @tanc !

@tanc
Copy link
Author

tanc commented Jul 6, 2023

Unfortunately on 1.18.1462.0 I'm still seeing graphical glitches:

Glitches-continued.mp4

Whilst on the stable version I have no issues.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 6, 2023
@zadjii-msft zadjii-msft added Product-Terminal The new Windows Terminal. Area-AtlasEngine and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jul 6, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 6, 2023
@lhecker
Copy link
Member

lhecker commented Jul 7, 2023

@tanc Can you try this for me? Save this as passthrough.hlsl (or similar):

Texture2D shaderTexture;
SamplerState samplerState;

cbuffer PixelShaderSettings {
    float Time;
    float Scale;
    float2 Resolution;
    float4 Background;
};

float4 main(float4 pos : SV_POSITION, float2 tex : TEXCOORD) : SV_TARGET
{
    return shaderTexture.Sample(samplerState, tex);
}

Then open your settings.json and add that file as your shader like so:

{
    "profiles":
    {
        "defaults": {
            "experimental.pixelShaderPath": "C:\\foo\\bar\\passthrough.hlsl"
        }
    }
}

Afterwards restart Windows Terminal (just to be sure). Does it still reproduce then?
Additionally, do you think you could produce some instructions for me how I can reproduce your WSL setup and shell exactly?

@tanc
Copy link
Author

tanc commented Jul 7, 2023

I've just left for holiday for three weeks so I can't test as this only happens on my desktop machine. When I get back I'll test and try to put together as much as I can as repro steps

@tanc
Copy link
Author

tanc commented Jul 27, 2023

@lhecker I've just got back and I've added the passthrough.hlsl to my settings.json and can confirm the glitch no longer presents itself. Commenting out the experimental.pixelShaderPath line and saving settings.json re-activates the display glitch.

@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Aug 30, 2023
microsoft-github-policy-service bot pushed a commit that referenced this issue Sep 5, 2023
`PaintCursor()` is only called when the cursor is visible, but we need
to invalidate the cursor area even if it isn't. Otherwise a transition
from a visible to an invisible cursor wouldn't be rendered.

I'm confident that this closes #15199

## Validation Steps Performed
* Set blink duration extremely high
* Launch pwsh.exe
* Press Enter a few times
* Press Ctrl+L
* There are never 2 cursors visible, not even briefly ✅
DHowett pushed a commit that referenced this issue Sep 22, 2023
`PaintCursor()` is only called when the cursor is visible, but we need
to invalidate the cursor area even if it isn't. Otherwise a transition
from a visible to an invisible cursor wouldn't be rendered.

I'm confident that this closes #15199

## Validation Steps Performed
* Set blink duration extremely high
* Launch pwsh.exe
* Press Enter a few times
* Press Ctrl+L
* There are never 2 cursors visible, not even briefly ✅

(cherry picked from commit 60843fa)
Service-Card-Id: 90438488
Service-Version: 1.18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AtlasEngine Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants