microsoft / WPFDXInterop

Repo for WPF DX Interop support
MIT License
307 stars 98 forks source link

Flicker on rendering large datasets #42

Open juergenboehm opened 3 years ago

juergenboehm commented 3 years ago

I changed the example code with the rotating cube into a set of routines for fast GPU-bound rendering of polygonal paths with the stencil method. It worked out quite well but now, with big datasets and especially when a certain proportion of rendered foreground/path pixels is surpassed (so the image must also be big enough), flickering occurs.

From another issue posted here it was proposed to solve this by introducing locking. Now my questions are:

Where is this locking code to be placed? In the C# code? Around the render code in my C++ module?

It seems to me that whereas D3DImage contains "lock" memberfunctions D3D11Image has no such "lock" memberfunctions any more. Is that true? So shall I sandwich the render C++ code with mutexes? Shall I use Windows specific ones for that or can I use such from C++ natively? Or are there even further other kinds of locks to be used here?

Any guidance for solving this flicker problem would be much appreciated!