Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
skgpu::graphite::DispatchGroup::Builder Class Referencefinal

#include <DispatchGroup.h>

Classes

struct  OutputTable
 

Public Member Functions

 Builder (Recorder *)
 
const OutputTableoutputTable () const
 
bool appendStep (const ComputeStep *, std::optional< WorkgroupSize > globalSize=std::nullopt)
 
bool appendStepIndirect (const ComputeStep *, BufferView indirectBuffer)
 
void assignSharedBuffer (BufferView buffer, unsigned int slot, ClearBuffer cleared=ClearBuffer::kNo)
 
void assignSharedTexture (sk_sp< TextureProxy > texture, unsigned int slot)
 
std::unique_ptr< DispatchGroupfinalize ()
 
BindBufferInfo getSharedBufferResource (unsigned int slot) const
 
sk_sp< TextureProxygetSharedTextureResource (unsigned int slot) const
 

Detailed Description

Definition at line 115 of file DispatchGroup.h.

Constructor & Destructor Documentation

◆ Builder()

skgpu::graphite::Builder::Builder ( Recorder recorder)
explicit

Definition at line 97 of file DispatchGroup.cpp.

97 : fObj(new DispatchGroup()), fRecorder(recorder) {
98 SkASSERT(fRecorder);
99}
#define SkASSERT(cond)
Definition SkAssert.h:116

Member Function Documentation

◆ appendStep()

bool skgpu::graphite::Builder::appendStep ( const ComputeStep step,
std::optional< WorkgroupSize globalSize = std::nullopt 
)

Definition at line 101 of file DispatchGroup.cpp.

101 {
102 return this->appendStepInternal(step,
103 globalSize ? *globalSize : step->calculateGlobalDispatchSize());
104}
static int step(int x, SkScalar min, SkScalar max)
Definition BlurTest.cpp:215

◆ appendStepIndirect()

bool skgpu::graphite::Builder::appendStepIndirect ( const ComputeStep step,
BufferView  indirectBuffer 
)

Definition at line 106 of file DispatchGroup.cpp.

106 {
107 return this->appendStepInternal(step, indirectBuffer);
108}

◆ assignSharedBuffer()

void skgpu::graphite::Builder::assignSharedBuffer ( BufferView  buffer,
unsigned int  slot,
ClearBuffer  cleared = ClearBuffer::kNo 
)

Definition at line 243 of file DispatchGroup.cpp.

243 {
244 SkASSERT(fObj);
245 SkASSERT(buffer.fInfo);
246 SkASSERT(buffer.fSize);
247
248 fOutputTable.fSharedSlots[slot] = buffer;
249 if (cleared == ClearBuffer::kYes) {
250 fObj->fClearList.push_back({buffer.fInfo.fBuffer, buffer.fInfo.fOffset, buffer.fSize});
251 }
252}
static const uint8_t buffer[]
DispatchResourceOptional fSharedSlots[kMaxComputeDataFlowSlots]

◆ assignSharedTexture()

void skgpu::graphite::Builder::assignSharedTexture ( sk_sp< TextureProxy texture,
unsigned int  slot 
)

Definition at line 254 of file DispatchGroup.cpp.

254 {
255 SkASSERT(fObj);
257
258 fObj->fTextures.push_back(std::move(texture));
259 fOutputTable.fSharedSlots[slot] = TextureIndex{fObj->fTextures.size() - 1u};
260}
FlTexture * texture

◆ finalize()

std::unique_ptr< DispatchGroup > skgpu::graphite::Builder::finalize ( )

Definition at line 262 of file DispatchGroup.cpp.

262 {
263 auto obj = std::move(fObj);
264 fOutputTable.reset();
265 return obj;
266}

◆ getSharedBufferResource()

BindBufferInfo skgpu::graphite::Builder::getSharedBufferResource ( unsigned int  slot) const

Definition at line 275 of file DispatchGroup.cpp.

275 {
276 SkASSERT(fObj);
277
278 BindBufferInfo info;
279 if (const BufferView* slotValue = std::get_if<BufferView>(&fOutputTable.fSharedSlots[slot])) {
280 info = slotValue->fInfo;
281 }
282 return info;
283}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213

◆ getSharedTextureResource()

sk_sp< TextureProxy > skgpu::graphite::Builder::getSharedTextureResource ( unsigned int  slot) const

Definition at line 285 of file DispatchGroup.cpp.

285 {
286 SkASSERT(fObj);
287
288 const TextureIndex* idx = std::get_if<TextureIndex>(&fOutputTable.fSharedSlots[slot]);
289 if (!idx) {
290 return nullptr;
291 }
292
293 SkASSERT(idx->fValue < SkToSizeT(fObj->fTextures.size()));
294 return fObj->fTextures[idx->fValue];
295}
constexpr size_t SkToSizeT(S x)
Definition SkTo.h:31

◆ outputTable()

const OutputTable & skgpu::graphite::DispatchGroup::Builder::outputTable ( ) const
inline

Definition at line 130 of file DispatchGroup.h.

130{ return fOutputTable; }

The documentation for this class was generated from the following files: