Hi,
We experiencing image tearing (Windowed application on Windows XP using
DX9).
We think that we can solve the problem by writing a gfx driver for a virtual
display.
We asked support from Microsoft and they advice us NOT to write a driver.
They state that writing a device driver will be difficult and that only a
few people have
managed to get such a solution to work (they claim 4 working implementation
around the world).
However MS did not come up with a different solution for the image tearing
problem :-(.
Furthermore the MS guys do not have much experience writing drivers.
So what the OSR community think about this solution.
Context:
We are creating an application that has to display images in real-time
(streaming).
The viewer must output four independent image streams to four attached
monitors
(2 graphics cards each having 2 dual link DVI outputs). The rendering must
keep up with 60 FPS frame
rates and must have as little latency as possible.
Problem:
When rendering to a Window (so not full screen) the graphics card does a
memory
copy from back to front buffer in the vertical retrace period and
when the copy takes longer than the vertical retrace period image tearing
will occur.
This is especially visible when rendering to high resolution displays
(2000x2000) because the amount of data to be copied
from back to front buffer is four times the amount of data for a 1000x1000
monitor.
DX9 has the ability to render full screen and this changes the mode
on the graphics card from buffer copy to buffer flip. This means
that during the vertical retrace period the pointers of the back and
front buffer are swapped. This always takes the same amount of time
regardless of the output size. When rendering full screen tearing is solved.
The problem with a full screen rendering application is that it does
not allow ‘other’ windowed applications to draw there windows with
controls on that same target and still be on top.
Solution:
We came up with the solution of a virtual display device which does
not write to a display but actually writes to shared memory and our
viewing application gets the data from the shared memory and blends
it with the image on the graphics card and renders it to
the physically connected display.
The advantage of this is that the windowed ‘client’ applications (legacy
code)
don’t have to change anything because they are rendering to virtual
display which behaves like a normal display.