Return appropriate fences in surfaceflinger queue buffer

This commit is contained in:
Billy Laws 2022-12-27 19:11:02 +00:00
parent afef6c5123
commit 966c31810a
2 changed files with 3 additions and 1 deletions

View File

@ -141,7 +141,7 @@ namespace skyline::service::hosbinder {
} }
buffer->state = BufferState::Dequeued; buffer->state = BufferState::Dequeued;
fence = AndroidFence{}; // We just let the presentation engine return a buffer which is ready to be written into, there is no need for further synchronization fence = buffer->fence; // We just let the presentation engine return a buffer which is ready to be written into, there is no need for further synchronization
Logger::Debug("#{} - Dimensions: {}x{}, Format: {}, Usage: 0x{:X}, Is Async: {}", slot, width, height, ToString(format), usage, async); Logger::Debug("#{} - Dimensions: {}x{}, Format: {}, Usage: 0x{:X}, Is Async: {}", slot, width, height, ToString(format), usage, async);
return AndroidStatus::Ok; return AndroidStatus::Ok;
@ -385,6 +385,7 @@ namespace skyline::service::hosbinder {
buffer.state = BufferState::Queued; buffer.state = BufferState::Queued;
buffer.frameNumber = ++frameNumber; buffer.frameNumber = ++frameNumber;
buffer.fence = fence;
width = defaultWidth; width = defaultWidth;
height = defaultHeight; height = defaultHeight;

View File

@ -44,6 +44,7 @@ namespace skyline::service::hosbinder {
u64 frameNumber{}; //!< The amount of frames that have been queued using this slot u64 frameNumber{}; //!< The amount of frames that have been queued using this slot
bool wasBufferRequested{}; //!< If GraphicBufferProducer::RequestBuffer has been called with this buffer bool wasBufferRequested{}; //!< If GraphicBufferProducer::RequestBuffer has been called with this buffer
bool isPreallocated{}; //!< If this slot's graphic buffer has been preallocated or attached bool isPreallocated{}; //!< If this slot's graphic buffer has been preallocated or attached
AndroidFence fence{};
std::shared_ptr<gpu::TextureView> texture{}; std::shared_ptr<gpu::TextureView> texture{};
std::unique_ptr<GraphicBuffer> graphicBuffer{}; std::unique_ptr<GraphicBuffer> graphicBuffer{};
}; };