9#ifndef GrD3DCaps_DEFINED
10#define GrD3DCaps_DEFINED
39 int sampleCount = 1)
const override;
63 return fPreferredStencilFormat;
67 case DXGI_FORMAT_D24_UNORM_S8_UINT:
69 case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
84 DXGI_FORMAT srcFormat,
int srcSamplecnt)
const;
87 DXGI_FORMAT srcFormat,
int srcSamplecnt)
const;
93 return fColorTypeToFormatTable[idx];
111#if defined(GR_TEST_UTILS)
112 std::vector<GrTest::TestFormatColorTypeCombination> getTestingCombinations()
const override;
117 kAMD_D3DVendor = 0x1002,
118 kARM_D3DVendor = 0x13B5,
119 kImagination_D3DVendor = 0x1010,
120 kIntel_D3DVendor = 0x8086,
121 kNVIDIA_D3DVendor = 0x10DE,
122 kQualcomm_D3DVendor = 0x5143,
125 void init(
const GrContextOptions& contextOptions, IDXGIAdapter1*, ID3D12Device*);
127 void initGrCaps(
const D3D12_FEATURE_DATA_D3D12_OPTIONS&,
129 void initShaderCaps(
int vendorID,
const D3D12_FEATURE_DATA_D3D12_OPTIONS& optionsDesc);
131 void initFormatTable(
const DXGI_ADAPTER_DESC&, ID3D12Device*);
132 void initStencilFormat(ID3D12Device*);
134 void applyDriverCorrectnessWorkarounds(
int vendorID);
136 bool onSurfaceSupportsWritePixels(
const GrSurface*)
const override;
149 struct ColorTypeInfo {
152 kUploadData_Flag = 0x1,
155 kRenderable_Flag = 0x2,
158 kWrappedOnly_Flag = 0x4,
168 for (
int i = 0;
i < fColorTypeInfoCount; ++
i) {
170 return fColorTypeInfos[
i].fFlags;
176 void init(
const DXGI_ADAPTER_DESC&, ID3D12Device*, DXGI_FORMAT);
177 static void InitFormatFlags(
const D3D12_FEATURE_DATA_FORMAT_SUPPORT&, uint16_t*
flags);
178 void initSampleCounts(
const DXGI_ADAPTER_DESC& adapterDesc, ID3D12Device*, DXGI_FORMAT);
181 kTexturable_Flag = 0x1,
182 kRenderable_Flag = 0x2,
185 kUnorderedAccess_Flag = 0x10,
197 std::unique_ptr<ColorTypeInfo[]> fColorTypeInfos;
198 int fColorTypeInfoCount = 0;
200 static const size_t kNumDxgiFormats = 15;
201 FormatInfo fFormatTable[kNumDxgiFormats];
203 FormatInfo& getFormatInfo(DXGI_FORMAT);
204 const FormatInfo& getFormatInfo(DXGI_FORMAT)
const;
207 void setColorType(
GrColorType, std::initializer_list<DXGI_FORMAT> formats);
209 int fMaxPerStageShaderResourceViews;
210 int fMaxPerStageUnorderedAccessViews;
212 DXGI_FORMAT fPreferredStencilFormat;
214 bool fResolveSubresourceRegionSupport : 1;
215 bool fStandardSwizzleLayoutSupport : 1;
static const int kGrColorTypeCnt
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
GrCaps(const GrContextOptions &)
GrProgramDesc makeDesc(GrRenderTarget *, const GrProgramInfo &, ProgramDescOverrideFlags) const override
GrColorType getFormatColorType(DXGI_FORMAT) const
DXGI_FORMAT getFormatFromColorType(GrColorType colorType) const
bool isFormatSRGB(const GrBackendFormat &) const override
bool canCopyTexture(DXGI_FORMAT dstFormat, int dstSampleCnt, DXGI_FORMAT srcFormat, int srcSamplecnt) const
int maxRenderTargetSampleCount(const GrBackendFormat &) const override
GrD3DCaps(const GrContextOptions &contextOptions, IDXGIAdapter1 *, ID3D12Device *)
uint64_t computeFormatKey(const GrBackendFormat &) const override
bool standardSwizzleLayoutSupport() const
bool isFormatRenderable(const GrBackendFormat &format, int sampleCount) const override
bool isFormatAsColorTypeRenderable(GrColorType ct, const GrBackendFormat &format, int sampleCount=1) const override
void addExtraSamplerKey(skgpu::KeyBuilder *, GrSamplerState, const GrBackendFormat &) const override
SupportedWrite supportedWritePixelsColorType(GrColorType surfaceColorType, const GrBackendFormat &surfaceFormat, GrColorType srcColorType) const override
DXGI_FORMAT preferredStencilFormat() const
bool canCopyAsResolve(DXGI_FORMAT dstFormat, int dstSampleCnt, DXGI_FORMAT srcFormat, int srcSamplecnt) const
bool isFormatTexturable(const GrBackendFormat &, GrTextureType) const override
GrBackendFormat getBackendFormatFromCompressionType(SkTextureCompressionType) const override
bool isFormatCopyable(const GrBackendFormat &) const override
static int GetStencilFormatTotalBitCount(DXGI_FORMAT format)
SurfaceReadPixelsSupport surfaceSupportsReadPixels(const GrSurface *) const override
int getRenderTargetSampleCount(int requestedCount, const GrBackendFormat &) const override
bool resolveSubresourceRegionSupport() const
bool isFormatUnorderedAccessible(DXGI_FORMAT) const
skgpu::Swizzle getWriteSwizzle(const GrBackendFormat &, GrColorType) const override
FlutterSemanticsFlag flags
uint32_t uint32_t * format