30 std::string_view label)
36 , fColorRenderTargetView(colorRenderTargetView)
37 , fResolveRenderTargetView(resolveRenderTargetView) {
53 std::string_view label)
59 , fColorRenderTargetView(colorRenderTargetView)
60 , fResolveRenderTargetView(resolveRenderTargetView) {
73 std::string_view label)
77 , fMSAATextureResource(nullptr)
78 , fColorRenderTargetView(renderTargetView) {
89 std::string_view label)
93 , fMSAATextureResource(nullptr)
94 , fColorRenderTargetView(renderTargetView) {}
103 int wrappedTextureSampleCnt =
static_cast<int>(
info.fSampleCount);
104 if (sampleCnt != wrappedTextureSampleCnt && wrappedTextureSampleCnt != 1) {
113 if (sampleCnt != wrappedTextureSampleCnt) {
118 std::tie(msInfo, msState) =
125 std::move(msState), msaaRenderTargetView, renderTargetView,
127 "MakeWrappedRenderTargetWithMSAASurface");
131 "MakeWrappedRenderTarget");
147 if (fMSAATextureResource) {
148 return fMSAATextureResource.get();
159void GrD3DRenderTarget::releaseInternalObjects() {
162 if (fMSAATextureResource) {
163 fMSAATextureResource->releaseResource(gpu);
164 fMSAATextureResource.reset();
172 this->releaseInternalObjects();
178 this->releaseInternalObjects();
187GrD3DGpu* GrD3DRenderTarget::getD3DGpu()
const {
197 return DXGI_FORMAT_UNKNOWN;
206 SkASSERT(stencil->numSamples() == this->numSamples());
215 if (fMSAATextureResource) {
216 SkASSERT(fMSAATextureResource->d3dResource());
218 const std::wstring msaaLabel =
L"_Skia_MSAA_" +
suffix;
219 fMSAATextureResource->d3dResource()->SetName(msaaLabel.c_str());
220 const std::wstring resolveLabel =
L"_Skia_Resolve_" +
suffix;
221 this->
d3dResource()->SetName(resolveLabel.c_str());
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
std::wstring GrD3DMultiByteToWide(const std::string &str)
GrD3DResourceProvider & resourceProvider()
void genKey(skgpu::KeyBuilder *b) const
DXGI_FORMAT stencilDxgiFormat() const
void onRelease() override
static sk_sp< GrD3DRenderTarget > MakeWrappedRenderTarget(GrD3DGpu *, SkISize, int sampleCnt, const GrD3DTextureResourceInfo &, sk_sp< GrD3DResourceState >)
const GrD3DTextureResource * msaaTextureResource() const
~GrD3DRenderTarget() override
GrBackendRenderTarget getBackendRenderTarget() const override
void onAbandon() override
void onSetLabel() override
GrD3DDescriptorHeap::CPUHandle createRenderTargetView(ID3D12Resource *textureResource)
void recycleRenderTargetView(const GrD3DDescriptorHeap::CPUHandle &)
DXGI_FORMAT dxgiFormat() const
GrD3DTextureResourceInfo fInfo
friend class GrD3DRenderTarget
ID3D12Resource * d3dResource() const
void releaseResource(GrD3DGpu *gpu)
sk_sp< GrD3DResourceState > grD3DResourceState() const
static std::pair< GrD3DTextureResourceInfo, sk_sp< GrD3DResourceState > > CreateMSAA(GrD3DGpu *gpu, SkISize dimensions, int sampleCnt, const GrD3DTextureResourceInfo &info, SkColor4f clearColor)
unsigned int sampleQualityPattern() const
std::string getLabel() const
bool wasDestroyed() const
void registerWithCacheWrapped(GrWrapCacheable)
GrAttachment * getStencilAttachment() const
void onAbandon() override
void onRelease() override
SkISize dimensions() const
void add32(uint32_t v, std::string_view label="unknown")
EMSCRIPTEN_KEEPALIVE void empty()
gr_cp< ID3D12Resource > fResource
skgpu::Protected fProtected