MetalSurface: correctly handle the window resizing.
In metal the size of the drawable (the texture use to render to the
window) is decoupled from the window's size:
- When the first drawable is created, its size is given by
layer.bounds.size * layer.contentsScale.
- Once set the drawableSize never changes without the user setting the
layer.drawableSize explicitly.
This means that the code checking for OUT_OF_DATE_KHR needs to be
updated to check the texture size against the drawable's size (and not
the current scaled window size).
Also Swiftshader needs to set the drawableSize to the correct value when
the window is resized. The best moment to do this is when querying the
capabilities as that's done when a new swapchain is created (which
happens when the application is handling the window's resize).
Bug: dawn:269
Change-Id: Icf1c3df63d42e0fa9211893f6b89d8709dfd942e
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49328Tested-by:
Corentin Wallez <cwallez@google.com>
Reviewed-by:
Alexis Hétu <sugoi@google.com>
Showing
Please
register
or
sign in
to comment