metal: disable direct scanout if blending would change the appearance
This commit is contained in:
parent
fc6dda9c24
commit
b6ef623643
1 changed files with 6 additions and 1 deletions
|
|
@ -626,6 +626,7 @@ impl MetalConnector {
|
|||
&self,
|
||||
pass: &GfxRenderPass,
|
||||
plane: &Rc<MetalPlane>,
|
||||
blend_cd: &Rc<ColorDescription>,
|
||||
cd: &Rc<ColorDescription>,
|
||||
) -> Option<DirectScanoutData> {
|
||||
let ct = 'ct: {
|
||||
|
|
@ -647,6 +648,10 @@ impl MetalConnector {
|
|||
// Direct scanout requires embeddable color descriptions.
|
||||
return None;
|
||||
}
|
||||
if !ct.opaque && !ct.cd.embeds_into(blend_cd) {
|
||||
// Blending changes the appearance of translucent buffers.
|
||||
return None;
|
||||
}
|
||||
if ct.alpha.is_some() {
|
||||
// Direct scanout with alpha factor is not supported.
|
||||
return None;
|
||||
|
|
@ -818,7 +823,7 @@ impl MetalConnector {
|
|||
&& self.dev.is_render_device();
|
||||
let mut direct_scanout_data = None;
|
||||
if try_direct_scanout {
|
||||
direct_scanout_data = self.prepare_direct_scanout(&latched.pass, plane, cd);
|
||||
direct_scanout_data = self.prepare_direct_scanout(&latched.pass, plane, blend_cd, cd);
|
||||
}
|
||||
let direct_scanout_active = direct_scanout_data.is_some();
|
||||
if self.direct_scanout_active.replace(direct_scanout_active) != direct_scanout_active {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue