Nikolay Sivov (@nsivov) commented about dlls/d2d1/bitmap.c:
bitmap->options = desc->bitmapOptions; if (d2d_device_context_is_dxgi_target(context))
ID3D11Resource_QueryInterface(resource, &IID_IDXGISurface, (void **)&bitmap->surface);
d2d_get_surface_from_resource(resource, subresource_idx, &IID_IDXGISurface, (void **)&bitmap->surface);
ID3D11Resource_GetDevice(resource, &d3d_device); if (bitmap->options & D2D1_BITMAP_OPTIONS_TARGET) {
if (FAILED(hr = ID3D11Device_CreateRenderTargetView(d3d_device, resource, NULL, &bitmap->rtv)))
if (d2d_resource_need_view_desc(resource))
We could use ~0u for subresource index to indicate whole resource, this will make this check unnecessary.