-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] GLES backend: Map the viewport and scissor rect to GL framebuffer coords #33706
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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.
LGTM on the fix. But I think the render target size should be the same as the color attachment size in the pass data. We could probably get away with not needing an extra capture.
@@ -501,9 +508,11 @@ bool RenderPassGLES::EncodeCommands( | |||
} | |||
|
|||
return reactor_->AddOperation([pass_data, transients_allocator, | |||
commands = commands_](const auto& reactor) { | |||
commands = commands_, | |||
target_size = GetRenderTargetSize()]( |
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.
Isn't this the same as pass_data->color_attachment
s size? I don't think there is a need to add another capture.
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.
Ah, good point. Done.
873cb27
to
a30892a
Compare
a30892a
to
4080253
Compare
The viewport and scissor are specified in framebuffer space. We're standardizing around Metal framebuffer coords (top left origin), and so we need to convert the viewport/scissor to GL framebuffer coords (bottom left origin) to achieve like behavior across backends.
This fixes the clipping problem visible in the imgui backend on GLES.