8#ifndef GrD3DGpuDescriptorTableManager_DEFINED
9#define GrD3DGpuDescriptorTableManager_DEFINED
21 ID3D12DescriptorHeap*
heap, D3D12_DESCRIPTOR_HEAP_TYPE
type)
22 : fDescriptorTableCpuStart(baseCPU)
23 , fDescriptorTableGpuStart(baseGPU)
28 return &fDescriptorTableCpuStart;
32 return fDescriptorTableGpuStart;
35 ID3D12DescriptorHeap*
heap()
const {
return fHeap; }
36 D3D12_DESCRIPTOR_HEAP_TYPE
type()
const {
return fType; }
39 D3D12_CPU_DESCRIPTOR_HANDLE fDescriptorTableCpuStart;
40 D3D12_GPU_DESCRIPTOR_HANDLE fDescriptorTableGpuStart;
41 ID3D12DescriptorHeap* fHeap;
42 D3D12_DESCRIPTOR_HEAP_TYPE fType;
58 unsigned int numDescriptors);
61 bool canAllocate(
unsigned int count)
const {
62 return (fDescriptorCount - fNextAvailable) >=
count;
64 ID3D12DescriptorHeap* d3dDescriptorHeap()
const {
return fHeap->descriptorHeap(); }
65 D3D12_DESCRIPTOR_HEAP_TYPE
type()
const {
return fType; }
66 unsigned int descriptorCount() {
return fDescriptorCount; }
67 bool used() {
return fNextAvailable > 0; }
74 Heap(
GrD3DGpu* gpu, std::unique_ptr<GrD3DDescriptorHeap>& heap,
75 D3D12_DESCRIPTOR_HEAP_TYPE
type,
unsigned int descriptorCount)
78 , fHeap(std::move(heap))
80 , fDescriptorCount(descriptorCount)
84 void freeGPUData()
const override {}
85 void onRecycle()
const override;
87#ifdef SK_TRACE_MANAGED_RESOURCES
88 void dumpInfo()
const override {
89 SkDebugf(
"GrD3DDescriptorTable::Heap: %p (%d refs)\n", fHeap.get(), this->getRefCnt());
94 std::unique_ptr<GrD3DDescriptorHeap> fHeap;
95 D3D12_DESCRIPTOR_HEAP_TYPE fType;
96 unsigned int fDescriptorCount;
97 unsigned int fNextAvailable;
104 HeapPool(
GrD3DGpu*, D3D12_DESCRIPTOR_HEAP_TYPE);
112 inline static constexpr int kInitialHeapDescriptorCount = 256;
114 std::vector<sk_sp<Heap>> fDescriptorHeaps;
115 D3D12_DESCRIPTOR_HEAP_TYPE fHeapType;
116 unsigned int fCurrentHeapDescriptorCount;
121 HeapPool fShaderViewDescriptorPool;
122 HeapPool fSamplerDescriptorPool;
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define INHERITED(method,...)
sk_sp< GrD3DDescriptorTable > createShaderViewTable(GrD3DGpu *, unsigned int count)
void prepForSubmit(GrD3DGpu *gpu)
sk_sp< GrD3DDescriptorTable > createSamplerTable(GrD3DGpu *, unsigned int count)
GrD3DDescriptorTableManager(GrD3DGpu *)
const D3D12_CPU_DESCRIPTOR_HANDLE * baseCpuDescriptorPtr()
GrD3DDescriptorTable(D3D12_CPU_DESCRIPTOR_HANDLE baseCPU, D3D12_GPU_DESCRIPTOR_HANDLE baseGPU, ID3D12DescriptorHeap *heap, D3D12_DESCRIPTOR_HEAP_TYPE type)
const D3D12_GPU_DESCRIPTOR_HANDLE baseGpuDescriptor()
ID3D12DescriptorHeap * heap() const
D3D12_DESCRIPTOR_HEAP_TYPE type() const
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)