diff --git a/src/core/hle/service/nvnflinger/buffer_queue_core.h b/src/core/hle/service/nvnflinger/buffer_queue_core.h index 7d03dc07a6..4098c23ddf 100644 --- a/src/core/hle/service/nvnflinger/buffer_queue_core.h +++ b/src/core/hle/service/nvnflinger/buffer_queue_core.h @@ -21,6 +21,23 @@ namespace Service::android { +#ifdef _MSC_VER +#pragma pack(push, 1) +#endif +struct BufferInfo { + u64 frame_number; + s64 queue_time; + s64 presentation_time{}; + BufferState state{BufferState::Free}; +} +#if defined(__GNUC__) || defined(__clang__) +__attribute__((packed)) +#endif +; +#ifdef _MSC_VER +#pragma pack(pop) +#endif + class IConsumerListener; class IProducerListener; @@ -73,13 +90,6 @@ private: bool is_allocating{}; mutable std::condition_variable_any is_allocating_condition; - class BufferInfo final { - public: - u64 frame_number{}; - s64 queue_time{}, presentation_time{}; - BufferState state{BufferState::Free}; - }; - std::vector history; }; diff --git a/src/core/hle/service/nvnflinger/buffer_queue_producer.cpp b/src/core/hle/service/nvnflinger/buffer_queue_producer.cpp index 4daa22bd16..80497aaaf7 100644 --- a/src/core/hle/service/nvnflinger/buffer_queue_producer.cpp +++ b/src/core/hle/service/nvnflinger/buffer_queue_producer.cpp @@ -534,7 +534,7 @@ Status BufferQueueProducer::QueueBuffer(s32 slot, const QueueBufferInput& input, position = (position + 1) % 8; LOG_WARNING(Service_Nvnflinger, "position={}", position); core->history[position] = {.frame_number = core->frame_counter, - .queue_time = slots[slot].queue_time, + .queue_time = timestamp, .state = BufferState::Queued}; sticky_transform = sticky_transform_; @@ -942,7 +942,7 @@ void BufferQueueProducer::Transact(u32 code, std::span parcel_data, auto buffer_history_count = std::min(parcel_in.Read(), (s32)core->history.size()); - BufferQueueCore::BufferInfo* info = new BufferQueueCore::BufferInfo[buffer_history_count]; + BufferInfo* info = new BufferInfo[buffer_history_count]; auto pos = position; for (int i = 0; i < buffer_history_count; i++) { info[i] = core->history[(pos - i) % core->history.size()]; @@ -952,7 +952,7 @@ void BufferQueueProducer::Transact(u32 code, std::span parcel_data, pos--; } - parcel_out.WriteFlattenedObject(info); + parcel_out.WriteFlattenedObject(info); status = Status::NoError; break; }