Ignore new layer creations instead of replacing previous ones while waiting for proper multiple layers support.

This commit is contained in:
mk73ds 2023-02-05 12:54:58 +01:00 committed by Billy Laws
parent 2855d12f31
commit cb62e15748

View File

@ -117,13 +117,13 @@ namespace skyline::service::hosbinder {
u64 IHOSBinderDriver::CreateLayer(DisplayId pDisplayId) {
if (pDisplayId != displayId)
throw exception("Creating layer on unopened display: '{}'", ToString(pDisplayId));
else if (layer) // Fallback to replacing previous layer
Logger::Warn("Creation of multiple layers is not supported");
layerStrongReferenceCount = InitialStrongReferenceCount;
layerWeakReferenceCount = 0;
layer = std::make_shared<GraphicBufferProducer>(state, nvMap);
else if (!layer) {
layerStrongReferenceCount = InitialStrongReferenceCount;
layerWeakReferenceCount = 0;
layer = std::make_shared<GraphicBufferProducer>(state, nvMap);
}
else // Ignore new layer creations if one already exists
Logger::Warn("Creation of multiple layers is not supported. Ignoring creation of new layers.");
return DefaultLayerId;
}