D1135: Bitmap Option Must Be Subset
The bitmap options [value] must be a subset of the flags associated with the DXGI surface.
-
value
-
The UINT value of the bitmap options enumeration.
While interoperating Direct3D textures with Direct2D as ID2D1Bitmaps, the options specified in the D2D1_BITMAP_OPTIONS field should match the texture’s Direct3D attributes. In particular:
- The D2D1_BITMAP_OPTIONS_CPU_READ option requires the Direct3D CPU_ACCESS_READ option.
- The D2D1_BITMAP_OPTIONS_TARGET option requires the BIND_RENDER_TARGET option.
- The D2D1_BITMAP_OPTIONS_NONE option is not compatible with the Direct3D USAGE_STAGING option with CPU_ACCESS_WRITE only.
To address this problem, ensure that the creation of ID2D1Bitmap uses D2D1_BITMAP_OPTIONS specifiers that agree with the properties of the underlying Direct3D texture. In order to use D2D1_BITMAP_OPTIONS, this may entail the use of ID2D1DeviceContext::CreateBitmap instead of ID2D1RenderTarget::CreateBitmap, because it is a member of D2D1_BITMAP_PROPERTIES1.