floppyhammer / pathfinder-cpp

A C++ port of the Rust Pathfinder GPU rasterizer
MIT License
9 stars 2 forks source link

dx11 rendering paris-30k.svg #9

Open AnuraDev opened 1 year ago

AnuraDev commented 1 year ago

https://github.com/google/forma/blob/main/assets/svgs/paris-30k.svg

if you increase the mask texture size then it seems to work "fine" except there are rendering artifacts, btw i think mask texture should be allocated dynamically depending on alpha_tile_count count. otherwise heavier scenes won't work.

https://i.imgur.com/60hYMls.jpeg

but renders ok in dx9

https://i.imgur.com/UIjTque.jpeg

floppyhammer commented 1 year ago

The SVG image produces fewer alpha tiles in dx9 than in dx11. That's why it renders OK in the former. The PR should solve this. However, the mentioned artifacts still exist, which is probably caused by other issues.

AnuraDev commented 1 year ago

@floppyhammer bump. any progress on this? now the artefacts look bit different in dx11 https://i.imgur.com/upw2v9s.png and process memory consumption is like x3 compared to dx9 this is probably due to more alpha tiles? seems like a major issue.

floppyhammer commented 1 year ago

I haven't looked into it closely, but this would be a hard one to crack.

For comparison:

Dx9 dx9

Dx11 dx11

AnuraDev commented 1 year ago

i checked and the "good" news are i get flickering on the same location (in my case Y is flipped https://i.imgur.com/E3h8Ugo.png) so it has something to do with the specific paths there, it would be a real problem if it would flicker randomly. i covered this area with a blue rect (on top) and no more flickering https://i.imgur.com/XR4mUJX.png

floppyhammer commented 1 year ago

You won't see any flickers if you don't scale it. This might be a good point to start investigation from.

Dx9

dx9

Dx11

dx11

In addition, as you can see there's another issue with the Dx11 level. The image gets mirrored somehow.