33 : fSharedContext(sharedContext)
40 }
else if (!fOutstandingSubmissions.
empty()) {
41 SKGPU_LOG_F(
"When ContextOptions::fNeverYieldToWebGPU is specified all GPU work must be "
42 "finished before destroying Context.");
48 if (fAvailableCommandBuffers.size()) {
50 fAvailableCommandBuffers.pop_back();
70 if (
info.fFinishedProc) {
75 if (!
info.fRecording) {
79 SKGPU_LOG_E(
"No valid Recording passed into addRecording call");
84 uint32_t* recordingID = fLastAddedRecordingIDs.
find(
info.fRecording->priv().recorderID());
86 info.fRecording->priv().uniqueID() != *recordingID+1) {
90 SKGPU_LOG_E(
"Recordings are expected to be replayed in order");
95 fLastAddedRecordingIDs.
set(
info.fRecording->priv().recorderID(),
96 info.fRecording->priv().uniqueID());
99 if (
info.fTargetSurface &&
104 info.fRecording->priv().setFailureResultForFinishedProcs();
105 SKGPU_LOG_E(
"Target surface passed into addRecording call is not graphite-backed");
110 if (!this->setupCommandBuffer(resourceProvider)) {
114 info.fRecording->priv().setFailureResultForFinishedProcs();
119 if (
info.fRecording->priv().hasNonVolatileLazyProxies()) {
120 if (!
info.fRecording->priv().instantiateNonVolatileLazyProxies(resourceProvider)) {
124 info.fRecording->priv().setFailureResultForFinishedProcs();
125 SKGPU_LOG_E(
"Non-volatile PromiseImage instantiation has failed");
130 if (
info.fRecording->priv().hasVolatileLazyProxies()) {
131 if (!
info.fRecording->priv().instantiateVolatileLazyProxies(resourceProvider)) {
135 info.fRecording->priv().setFailureResultForFinishedProcs();
136 info.fRecording->priv().deinstantiateVolatileLazyProxies();
137 SKGPU_LOG_E(
"Volatile PromiseImage instantiation has failed");
143 if (!
info.fRecording->priv().addCommands(context,
146 info.fTargetTranslation)) {
150 info.fRecording->priv().setFailureResultForFinishedProcs();
151 info.fRecording->priv().deinstantiateVolatileLazyProxies();
152 SKGPU_LOG_E(
"Adding Recording commands to the CommandBuffer has failed");
156 if (
info.fTargetTextureState) {
158 info.fTargetTextureState);
165 info.fRecording->priv().deinstantiateVolatileLazyProxies();
174 SKGPU_LOG_E(
"No valid Task passed into addTask call");
184 SKGPU_LOG_E(
"Adding Task commands to the CommandBuffer has failed");
195 if (
info.fFinishedProc) {
199 if (!this->setupCommandBuffer(resourceProvider)) {
222 SKGPU_LOG_D(
"Submit called with no active command buffer!");
266 front->~OutstandingSubmission();
273 fAvailableCommandBuffers.push_back(std::move(commandBuffer));
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define SKGPU_LOG_E(fmt,...)
#define SKGPU_LOG_F(fmt,...)
#define SKGPU_LOG_D(fmt,...)
const void * front() const
const void * back() const
bool isGraphiteBacked() const
static sk_sp< RefCntedCallback > Make(Callback proc, Context ctx)
bool requireOrderedRecordings() const
bool allowCpuSync() const
ResourceProvider * resourceProvider() const
void addUploadBufferManagerRefs(UploadBufferManager *)
const SharedContext * fSharedContext
void checkForFinishedWork(SyncToCpu)
bool addRecording(const InsertRecordingInfo &, Context *)
std::unique_ptr< GpuWorkSubmission > OutstandingSubmission
virtual OutstandingSubmission onSubmitToGpu()=0
bool addFinishInfo(const InsertFinishInfo &, ResourceProvider *, SkSpan< const sk_sp< Buffer > > buffersToAsyncMap={})
bool addTask(Task *, Context *)
std::unique_ptr< CommandBuffer > fCurrentCommandBuffer
QueueManager(const SharedContext *sharedContext)
void returnCommandBuffer(std::unique_ptr< CommandBuffer >)
virtual std::unique_ptr< CommandBuffer > getNewCommandBuffer(ResourceProvider *)=0
bool hasUnfinishedGpuWork()
const Caps * caps() const
virtual Status addCommands(Context *, CommandBuffer *, ReplayTargetData)=0
void transferToCommandBuffer(CommandBuffer *)
V * find(const K &key) const
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
static constexpr int kDefaultOutstandingAllocCnt
#define TRACE_EVENT0(category_group, name)
#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val)