Flutter Engine
The Flutter Engine
GrD3DRootSignature.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrD3DRootSignature_DEFINED
9#define GrD3DRootSignature_DEFINED
10
13
14class GrD3DGpu;
15
17public:
18 static sk_sp<GrD3DRootSignature> Make(GrD3DGpu* gpu, int numTextureSamplers, int numUAVs);
19
20 enum class ParamIndex {
21 kConstantBufferView = 0,
22 kShaderViewDescriptorTable = 1,
23 kSamplerDescriptorTable = 2,
24
25 kLast = kSamplerDescriptorTable
26 };
27 inline static constexpr unsigned int kParamIndexCount = (unsigned int)(ParamIndex::kLast) + 1;
28
29 bool isCompatible(int numTextureSamplers, int numUAVs) const;
30
31 ID3D12RootSignature* rootSignature() const { return fRootSignature.get(); }
32
33#ifdef SK_TRACE_MANAGED_RESOURCES
34 /** Output a human-readable dump of this resource's information
35 */
36 void dumpInfo() const override {
37 SkDebugf("GrD3DRootSignature: %p, numTextures: %d (%d refs)\n",
38 fRootSignature.get(), fNumTextureSamplers, this->getRefCnt());
39 }
40#endif
41
42private:
43 GrD3DRootSignature(gr_cp<ID3D12RootSignature> rootSig, int numTextureSamplers, int numUAVs);
44
45 // This will be called right before this class is destroyed and there is no reason to explicitly
46 // release the fRootSignature cause the gr_cp will handle that in the dtor.
47 void freeGPUData() const override {}
48
49 gr_cp<ID3D12RootSignature> fRootSignature;
50 int fNumTextureSamplers;
51 int fNumUAVs;
52};
53
54#endif
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
bool isCompatible(int numTextureSamplers, int numUAVs) const
static sk_sp< GrD3DRootSignature > Make(GrD3DGpu *gpu, int numTextureSamplers, int numUAVs)
ID3D12RootSignature * rootSignature() const
static constexpr unsigned int kParamIndexCount
T * get() const
Definition: GrD3DTypes.h:108