-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandSubmission.h
65 lines (53 loc) · 1.58 KB
/
CommandSubmission.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include <map>
#include "CppUtils.h"
#include "RadeonMemory.h"
#include "Syncobj.h"
#include "RingBuffer.h"
#include "ExternalAllocator.h"
#include "SADomains/Domains.h"
class TeamState;
struct IndirectBufferDef {
BReference<BufferObject> buf;
uint64 offset;
uint64 va;
uint64 vaRemapped;
uint64 size;
};
struct CommandSubmission {
struct WaitHandler: public Fence::Handler {
inline CommandSubmission &Base() {return ContainerOf(*this, &CommandSubmission::waitHandler);}
void Do(Fence *fence) final;
} waitHandler;
struct FenceHandler: public Fence::Handler {
inline CommandSubmission &Base() {return ContainerOf(*this, &CommandSubmission::handler);}
void Do(Fence *fence) final;
} handler;
struct FenceResolvedReq: public AsyncRequest {
inline CommandSubmission &Base() {return ContainerOf(*this, &CommandSubmission::fenceResolvedReq);}
using AsyncRequest::AsyncRequest;
virtual ~FenceResolvedReq() {}
void Do(Object *ptr) final;
void Resolved() final;
} fenceResolvedReq;
TeamState *teamState;
uint32 seq;
BReference<RingFence> fence;
BReference<Fence> waitFenceGroup;
// filled by client
int32 ringId;
uint32 bufferCnt = 0, indBufCnt = 0;
uint32 waitCnt = 0, signalCnt = 0;
ArrayDeleter<BReference<BufferObject>> buffers;
ArrayDeleter<IndirectBufferDef> indBufs;
ArrayDeleter<SyncobjRef> waitSyncobjs, signalSyncobjs;
ArrayDeleter<uint64> waitPoints, signalPoints;
struct {
BReference<BufferObject> buffer;
uint64 offset;
} userFence;
CommandSubmission(TeamState *teamState);
~CommandSubmission();
status_t Schedule();
status_t Remap();
};