12GrD3DAttachment::GrD3DAttachment(
GrD3DGpu* gpu,
14 UsageFlags supportedUsages,
16 const D3D12_RESOURCE_DESC&
desc,
20 std::string_view label)
24 desc.SampleDesc.Count,
38 D3D12_RESOURCE_DESC resourceDesc = {};
39 resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
40 resourceDesc.Alignment = 0;
43 resourceDesc.DepthOrArraySize = 1;
44 resourceDesc.MipLevels = 1;
45 resourceDesc.Format =
format;
46 resourceDesc.SampleDesc.Count = sampleCnt;
47 resourceDesc.SampleDesc.Quality = DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN;
48 resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
49 resourceDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
51 D3D12_CLEAR_VALUE clearValue = {};
52 clearValue.Format =
format;
53 clearValue.DepthStencil.Depth = 0;
54 clearValue.DepthStencil.Stencil = 0;
58 D3D12_RESOURCE_STATE_DEPTH_WRITE,
72 "D3DAttachment_MakeStencil"));
89GrD3DGpu* GrD3DAttachment::getD3DGpu()
const {
94void GrD3DAttachment::onSetLabel() {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
std::wstring GrD3DMultiByteToWide(const std::string &str)
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
void onAbandon() override
void onRelease() override
D3D12_CPU_DESCRIPTOR_HANDLE view() const
static sk_sp< GrD3DAttachment > MakeStencil(GrD3DGpu *gpu, SkISize dimensions, int sampleCnt, DXGI_FORMAT format)
GrD3DResourceProvider & resourceProvider()
GrD3DDescriptorHeap::CPUHandle createDepthStencilView(ID3D12Resource *textureResource)
ID3D12Resource * d3dResource() const
void releaseResource(GrD3DGpu *gpu)
static bool InitTextureResourceInfo(GrD3DGpu *gpu, const D3D12_RESOURCE_DESC &desc, D3D12_RESOURCE_STATES initialState, GrProtected, D3D12_CLEAR_VALUE *, GrD3DTextureResourceInfo *)
std::string getLabel() const
bool wasDestroyed() const
SkISize dimensions() const
void onAbandon() override
void onRelease() override
EMSCRIPTEN_KEEPALIVE void empty()
uint32_t uint32_t * format
constexpr int32_t width() const
constexpr int32_t height() const