On Mon Jul 14 12:59:39 2025 +0000, Zhiyi Zhang wrote:
The reason why DrawBitmap() with bitmaps created from subresource surfaces with more than one subresource doesn't work is because `Texture2D` is used in `shape_ps_code`. When the texture is a 2d texture array. `Texture2DArray` needs to be used in the pixel shader. As for DrawBitmap() with a bitmap created from CreateBitmapFromDxgiSurface() has no effect on Windows, I think it's a special behavior. I don't see any issue in my tests. I also tried a few other things, like changing texture format, using ID2D1RenderTarget instead of ID2D1DeviceContext. A bitmap brush from such a bitmap also doesn't work when used to fill. See [d2d_bitmap_from_dxgi_surface.txt](/uploads/3f94bbfd78a4748a7528cf6c4919b916/d2d_bitmap_from_dxgi_surface.txt). However, I am not sure we want to mimic this behavior on Wine. If we want to change it, then we need to disallow creating an SRV for bitmaps from CreateBitmapFromDxgiSurface(). We also need to disable any drawing operations when such a bitmap is used, for example, opacity brushes shouldn't have any effect as well. Overall, I prefer leaving it unchanged for now.
So, does it work on Windows for a case with more than one subresource or not? If All we need to support index == 0, we don't need that many changes.