Closed tanc closed 1 year ago
You do have a very curious GPU. 😅 Questions:
HKEY_CURRENT_USER\Software\Microsoft\Avalon.Graphics
what keys and values do you see? For instance, I only have DISPLAY1
there and it looks like that:
If you have multiple displays there, I'd unfortunately need all unique sets of values (= you can skip those displays that have identical registry values like another one; I'm just interested in the possible combinations that you have as they affect the text shader.)Note to self:
ID2D1DeviceContext::DrawGlyphRun
. It doesn't do that for other users though so it's unlikely.I know right! Why is it always me with the rendering problems? 😬😉
Do you use something like MacType? Nothing like that, just standard Windows rendering
Does it happen if you disable ClearType Anti-Aliasing? Same issue with ClearType disabled
Registry values for this single display:
This is the dialog when opening the options:
I then picked Power saving NVIDIA 2070 Super and re-opened Terminal Preview but the black background to the characters is still there.
I also tried adjusting the clear type options until the registry values were the same as yours but the result is the same in Terminal preview.
Ugh... I was hoping that it's a bug with the Avalon settings. If it's not too much to ask, could you please install PIX? You can find it here: https://devblogs.microsoft.com/pix/download/ It'll ask you a couple questions on the first launch and it doesn't really matter what you pick. It's just for their user/market research.
You then need to launch it as Admin (it'll allow you to launch as non-Admin but silently won't record any GPU metrics). Quit all instances of Windows Terminal Preview. Then, do this (the important bits are "Launch UWP" and "Launch for GPU capture"):
After clicking "Launch", it'd be nice if you could choose a light theme like you did before, insert an emoji like 🌯, and then press Ctrl+A to select all text. Like so:
Back in PIX, press Ctrl+Shift+N. Make sure the green box looks like this:
Then press Ctrl+N (or click the camera icon) and then focus the terminal again. It should quickly create a capture like so:
Double click the capture and then press Ctrl+S. If you could send this file to <my github username>@microsoft.com
, that'd be really helpful! (I hope it works when I analyze it on a different GPU though. I never tried that.)
You can also investigate it yourself if you're curious or just prefer that. To do that, after opening the capture, click on the little start arrow in the top right:
Then pick graphics queue 1 (WinUI unfortunately uses its own graphics queue = 0):
Click on the "Pipeline" tab, and click on the blue DrawIndexedInstanced
entry in the list. At the bottom you'll see all the GPU stages.
CBV
are the Constant Buffer Values, i.e. the values that are constant across one entire shader invocation for all pixels. You won't be able to read the CBV unless you tell PIX its layout (I think this is a limitation due to the use of D3D11on12). To read it, double click on the CBV entry on the left and it'll pop up an Active Resource tab. There, you need to enter the struct definition which in case of the Pixel Shader is:
float4 backgroundColor;
float2 backgroundCellSize;
float2 backgroundCellCount;
float4 gammaRatios;
float enhancedContrast;
float underlineWidth;
Expand item [0]
and it'll show you all relevant values. In my case:
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
@lhecker I've emailed you the wpix file directly. I didn't analyse the file but it here is a screen capture of the pix screenshot next to the actual terminal window. Is the pix screenshot supposed to be black like that?
@tanc The PIX dump and your settings.json file helped me a lot! Quick workaround:
Update to the latest Windows Terminal (even non-Preview is fine) and remove the passthrough.hlsl
shader from your settings.json (Ctrl+Shift+,). 🙂
I haven't 100% understood yet why it happens but I know what causes this effect. Once I open a PR, I'll comment there what caused this issue.
@lhecker ah of course! It was the passthrough.hlsl
we added to debug #15199
Removing that has fixed the issue. I'll close this issue as I don't think it'll affect anyone else.
I'm glad it fixed it! For now I'd like to keep the issue open however, since this shouldn't happen if you use a shader and so I still got something to fix. 😅 (Please feel free to unsubscribe if you'd like!)
Windows Terminal version
1.18.1462.0
Windows build number
10.0.22622.0
Other Software
No response
Steps to reproduce
I'm not sure yet what the reproduction steps but the rendering issue seems to present itself immediately upon opening the terminal application.
Expected Behavior
Rendering of text to be normal
Actual Behavior
Each character has a black background which is very noticeable if using a light colour scheme, for example:
Changing the font or font size does not seem to have any effect.