-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
AtlasEngine: Make Direct2D/3D and Present1 configurable #16939
Conversation
@@ -397,8 +397,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation | |||
// GH#11315: Always do this, even if they don't have acrylic on. | |||
_renderEngine->EnableTransparentBackground(_isBackgroundTransparent()); | |||
|
|||
THROW_IF_FAILED(_renderEngine->Enable()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seemed important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't implemented by AtlasEngine! It initializes itself lazily.
@@ -9,7 +9,6 @@ | |||
<Import Project="..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" /> | |||
|
|||
<PropertyGroup Label="Globals"> | |||
<CppWinRTHeapEnforcement>AnyValueHereWillDisableTheOptOut</CppWinRTHeapEnforcement> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whooooooooooaaa what
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I wanted to commit this in a separate PR but forgot to split it off first.
I believe we added this to work around a bug in the XAML compiler (no surprises there I'm sure) because it used std::shared_ptr
instead of winrt::com_ptr
on a WinRT object. This bug seems to have been fixed a while ago so there doesn't seem to be any reason for us to still opt out of these safety checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YESSS
} | ||
} | ||
else | ||
|
||
auto hr = _p.swapChain.swapChain->Present1(1, 0, ¶ms); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so wait, how does this disable present1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By leaving params.DirtyRectsCount
at 0. That way the Present1
call is identical to a Present
call. In fact calling Present
nowadays simply calls Present1
with an empty DXGI_PRESENT_PARAMETERS
.
Co-authored-by: Dustin L. Howett <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just commenting cause automerge is set up but I'm pretty much a ✅
I don't think I really care about migrating the old settings if you think it's fine.
X(bool, ForceFullRepaintRendering, "experimental.rendering.forceFullRepaint", false) \ | ||
X(bool, SoftwareRendering, "experimental.rendering.software", false) \ | ||
X(winrt::Microsoft::Terminal::Control::GraphicsAPI, GraphicsAPI, "rendering.graphicsAPI") \ | ||
X(bool, DisablePartialInvalidation, "rendering.disablePartialInvalidation", false) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meh, IMO "forceFullRepaint" kinda sounded more straightforward IMO, but since it's in the SUI, i'm not sure it really matters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Partial invalidation" is a more common technical term for Present1
and so I felt it's more fitting. Another one is "dirty rectangles", i.e. disableDirtyRectangles
but I wasn't sure whether that's better.
{ | ||
// These experimental options should be removed from the settings file if they're at their default value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is actually... really clever
@@ -24,8 +24,9 @@ Author(s): | |||
X(hstring, WordDelimiters, "wordDelimiters", DEFAULT_WORD_DELIMITERS) \ | |||
X(bool, CopyOnSelect, "copyOnSelect", false) \ | |||
X(bool, FocusFollowMouse, "focusFollowMouse", false) \ | |||
X(bool, ForceFullRepaintRendering, "experimental.rendering.forceFullRepaint", false) \ | |||
X(bool, SoftwareRendering, "experimental.rendering.software", false) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think there are some folks that were using these in the past. Should we be migrating them to the roughly equivalent new settings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
People who have been using ForceFullRepaintRendering
likely have been doing something wrong or accidentally clicked it. SoftwareRendering
did have its uses, but I believe that everyone who used it should try the new AtlasEngine again or migrate to using Direct2D. The exact choice here depends on their exact issues.
|
||
[[nodiscard]] std::wstring_view AtlasEngine::GetPixelShaderPath() noexcept | ||
{ | ||
return _api.s->misc->customPixelShaderPath; | ||
} | ||
|
||
[[nodiscard]] std::wstring_view AtlasEngine::GetPixelShaderImagePath() noexcept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this just entirely disappear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see, it did. But no one was using it. gotcha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup there's another one, related to DPI, which was used but only in a single place so I just inlined it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmk yea I'm cool with that.
This implements
SetForceFullRepaintRendering
and adds a newSetGraphicsAPI
function. The former togglesPresent1
on and offand the latter allows users to explicitly request Direct2D/3D.
On top of these changes I did a minor cleanup of the interface,
because now that DxRenderer is gone we don't need all that anymore.
Closes #14254
Closes #16747
Validation Steps Performed