mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 09:25:45 +00:00
Compare commits
2 commits
0c6ed79398
...
7cf2b860b4
Author | SHA1 | Date | |
---|---|---|---|
|
7cf2b860b4 | ||
|
6ccca5a0cf |
2 changed files with 22 additions and 10 deletions
|
@ -21,6 +21,25 @@
|
|||
|
||||
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
|
||||
static_assert(sizeof(BufferInfo) == 0x1C,
|
||||
"BufferInfo is an invalid size");
|
||||
|
||||
class IConsumerListener;
|
||||
class IProducerListener;
|
||||
|
||||
|
@ -73,13 +92,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<BufferInfo> history;
|
||||
};
|
||||
|
||||
|
|
|
@ -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<const u8> parcel_data,
|
|||
|
||||
auto buffer_history_count = std::min(parcel_in.Read<s32>(), (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<const u8> parcel_data,
|
|||
pos--;
|
||||
}
|
||||
|
||||
parcel_out.WriteFlattenedObject<BufferQueueCore::BufferInfo>(info);
|
||||
parcel_out.WriteFlattenedObject<BufferInfo>(info);
|
||||
status = Status::NoError;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue