13 : fShaderViewDescriptorPool(gpu, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV)
14 , fSamplerDescriptorPool(gpu, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER) {}
29 fShaderViewDescriptorPool.prepForSubmit(gpu);
30 fSamplerDescriptorPool.prepForSubmit(gpu);
33void GrD3DDescriptorTableManager::recycle(Heap* heap) {
38 switch (heap->type()) {
39 case D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV:
40 fShaderViewDescriptorPool.recycle(std::move(wrappedHeap));
42 case D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER:
43 fSamplerDescriptorPool.recycle(std::move(wrappedHeap));
53 GrD3DGpu* gpu, D3D12_DESCRIPTOR_HEAP_TYPE
type,
unsigned int descriptorCount) {
54 std::unique_ptr<GrD3DDescriptorHeap> heap =
56 D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE);
67 unsigned int startIndex = fNextAvailable;
68 fNextAvailable +=
count;
71 fHeap->getGPUHandle(startIndex).fHandle,
72 fHeap->descriptorHeap(), fType));
75void GrD3DDescriptorTableManager::Heap::onRecycle()
const {
76 fGpu->resourceProvider().descriptorTableMgr()->recycle(
const_cast<Heap*
>(
this));
81GrD3DDescriptorTableManager::HeapPool::HeapPool(
GrD3DGpu* gpu, D3D12_DESCRIPTOR_HEAP_TYPE heapType)
83 , fCurrentHeapDescriptorCount(kInitialHeapDescriptorCount) {
85 fDescriptorHeaps.push_back(heap);
94 while (fDescriptorHeaps.size() > 0) {
95 auto& heap = fDescriptorHeaps[fDescriptorHeaps.size() - 1];
96 if (heap->canAllocate(
count)) {
100 return heap->allocateTable(
count);
103 fDescriptorHeaps.pop_back();
107 fCurrentHeapDescriptorCount =
std::min(2*fCurrentHeapDescriptorCount, 2048u);
111 fDescriptorHeaps.push_back(heap);
112 return fDescriptorHeaps[fDescriptorHeaps.size() - 1]->allocateTable(
count);
116 GrD3DDescriptorTableManager::HeapPool::currentDescriptorHeap() {
117 SkASSERT(fDescriptorHeaps.size() > 0);
118 return fDescriptorHeaps[fDescriptorHeaps.size() - 1];
121void GrD3DDescriptorTableManager::HeapPool::prepForSubmit(
GrD3DGpu* gpu) {
123 if (fDescriptorHeaps[fDescriptorHeaps.size() - 1]->used()) {
124 fDescriptorHeaps.pop_back();
127 if (fDescriptorHeaps.size() == 0) {
128 fCurrentHeapDescriptorCount =
std::min(fCurrentHeapDescriptorCount, 2048u);
131 fDescriptorHeaps.push_back(heap);
135void GrD3DDescriptorTableManager::HeapPool::recycle(
sk_sp<Heap> heap) {
139 if (heap->descriptorCount() == fCurrentHeapDescriptorCount) {
141 fDescriptorHeaps.push_back(heap);
void addRecycledResource(sk_sp< GrRecycledResource > resource)
static std::unique_ptr< GrD3DDescriptorHeap > Make(GrD3DGpu *gpu, D3D12_DESCRIPTOR_HEAP_TYPE, unsigned int numDescriptors, D3D12_DESCRIPTOR_HEAP_FLAGS)
sk_sp< GrD3DDescriptorTable > createShaderViewTable(GrD3DGpu *, unsigned int count)
void prepForSubmit(GrD3DGpu *gpu)
sk_sp< GrD3DDescriptorTable > createSamplerTable(GrD3DGpu *, unsigned int count)
GrD3DDescriptorTableManager(GrD3DGpu *)
GrD3DDirectCommandList * currentCommandList() const
void reset(T *ptr=nullptr)
static float min(float r, float g, float b)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size