directx - CreateBitmapFromDxgiSurface() failed (0x88990003, D2DERR_UNSUPPORTED_OPERATION) -
i want share texture dx11
d2d
:
// dxgi surface version d3d texture. idxgisurface1* pdxgisurface = nullptr; auto hresult = irisd3dresourcemanager::instance()->getd3d10device()->opensharedresource(hresourcesharehandle, __uuidof(idxgisurface1), reinterpret_cast<lpvoid*>(&pdxgisurface)); if (failed(hresult)) { goto failed_release; } float fdpix = 0.0f; float fdpiy = 0.0f; m_pd2dfactory->getdesktopdpi(&fdpix, &fdpiy); d2d1_bitmap_properties1 dbbp1; dbbp1.dpix = fdpix; dbbp1.dpiy = fdpiy; dbbp1.pixelformat = d2d1::pixelformat(dxgi_format_b8g8r8a8_unorm, d2d1_alpha_mode_premultiplied); dbbp1.colorcontext = nullptr; dbbp1.bitmapoptions = d2d1_bitmap_options_target | d2d1_bitmap_options_cannot_draw; // create shared id2dbitmap1 id2d1bitmap1* pbitmap = nullptr; hresult = m_pd2ddevicecontex->createbitmapfromdxgisurface(pdxgisurface, dbbp1, &pbitmap);
however, createbitmapfromdxgisurface() still returns 0x88990003(d2derr_unsupported_operation)
, cannot create shared bitmap.
does know how can work? thanks.
Comments
Post a Comment