RFC: wined3d: Implementing depth/stencil buffer locking

Octavian Voicu octavian.voicu at gmail.com
Wed Nov 2 05:59:23 CDT 2011


Hi,

Here is a first shot at implementing depth/stencil buffer locking in wined3d.

Currently depth/stencil buffer locations are onscreen and offscreen,
with transitions between the two states done in load_ds_location. I
added another location, sysmem, and implemented transitions from
offscreen to sysmem and from sysmem to offscreen. If buffer is
onscreen, it will be moved offscreen first, then to sysmem.

Some issues with this implementation:

1) make dsurface.ok in ddraw/tests crashes in context_acquire
(wined3d/context.c:2456) called from surface_load_location
(wined3d/surface.c:6323), I'm guessing  in because there is no
swapchain. How can I prevent this crash and still get a context?
Loading from offscreen to sysmem shouldn't require a swapchain.

2) When running my test app [1] I also get this error:

err:d3d_surface:surface_load_ds_location >>>>>>>>>>>>>>>>>
GL_INVALID_VALUE (0x501) from glTexSubImage2D @
../../../../wine/dlls/wined3d/surface.c / 5877

3) There are other issues with my test app (looks like it's related to
textures), so can't be sure if locking works correctly. There is an
improvement over the unpatched version, but can't be sure until the
other issue is resolved. Game uses pre-rendered backgrounds and
probably loads the Z-buffer by locking the surface, so it can render
3D characters correctly over the pre-rendered backgrounds.

It happens in the "if (surface->flags & SFLAG_DS_SYSMEM)" branch of
the surface_load_ds_location function. Uploading happens on each
frame, this error only happens for the first upload.

I'm quite new to wined3d code so I might have missed some obvious
things. Any comments and suggestions are welcome.

Thanks.

Octavian


[1] The demo of The Longest Journey, available for download here (to
reproduce, click on the Begin Journey, press ESC to skip intro movies;
notice how rendered characters look):
http://games.softpedia.com/get/Games-Demo/The-Longest-Journey-161-Demo.shtml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wined3d-Implement-depth-stencil-locking-support.patch
Type: text/x-patch
Size: 8250 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20111102/b02098fe/attachment-0001.bin>


More information about the wine-devel mailing list