szeged / webrender

A GPU-based renderer for the web
https://doc.servo.org/webrender/
Mozilla Public License 2.0
45 stars 7 forks source link

Fix blitting with different image formats #261

Closed zakorgy closed 5 years ago

zakorgy commented 5 years ago

We need to call blit_image instead of copy_image if the bytes per pixel differs on the source and target image. This fixes a crash with the basic example on dx12.

kvark commented 5 years ago

We need to call blit_image instead of copy_image if the bytes per pixel differs on the source and target image.

You'd want to use blit instead of copy whenever the layout of the textures is different, which is more general than the bytes per pixel difference. For example, copying from RGBA8 to BGRA8 will swizzle the components - not something you want there.