It is currently Wed Sep 08, 2010 9:37 pm




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
[r1250] missing UnlockBuffers(), I think 
Author Message

Joined: Sun Jul 11, 2010 2:21 pm
Posts: 3
Post [r1250] missing UnlockBuffers(), I think

Problem:

If using debug D3D runtime, and "Break on D3D9 error" set, Doom Builder may hang (if running in the debugger) or bring up the crash dialog (if running outside the debugger) when using brightness mode.

The expected behaviour is that Doom Builder does not produce any Direct3D errors when it is running.

Reproduction steps:

1. Using DirectX Control Panel, Direct3D 9 tab, ensure "Use Debug Version of Direct3D 9" and "Break on D3D9 Error" are both ticked.

2. Load Doom Builder 2 and create new map

3. Enter sector mode, and create new sector

4. Enter brightness mode, and right-click on sector

5. Observe behaviour that may cause loss of work

Fix:

In Sector.CreateSurfaces, there should be a General.Map.CRenderer2D.Surfaces.UnlockBuffers() after the call to UpdateSurfaces. Like so:

Code:
// Update entry
surfaceentry = General.Map.CRenderer2D.Surfaces.UpdateSurfaces(surfaceentry);
General.Map.CRenderer2D.Surfaces.UnlockBuffers();


This is around line 322 on r1250.

Other notes:

Break On Error interacts poorly with the debugger, as VS2005 doesn't support mixed-mode managed/native debugging. Nevertheless, you can see the D3D debug messages using DbgView (http://technet.microsoft.com/en-us/sysi ... 96647.aspx), and when the thing babs itself you can use "Break All" to be taken to the managed call that caused the problem.

There is another error on startup:

[2540] Direct3D9: (WARN) :Vertexbuffer created with POOL_DEFAULT but WRITEONLY not set. Performance penalty could be severe.

I didn't look into this. Presumably the severe performance penalty has not been observed in practice if nobody has mentioned it.


Sun Jul 11, 2010 2:32 pm
Profile
User avatar

Joined: Sun Jan 04, 2009 4:49 pm
Posts: 543
Post Re: [r1250] missing UnlockBuffers(), I think

I was not able to reproduce this in the latest code, but I have looked around in the code and found that UnlockBuffers() could be needed in some other places so I added it there. It is safe to call UnlockBuffers() even when not really needed, but it is unwise to do this (prematurely) when more updates are needed. Please report the bug again if it happens in the latest version.


Sun Aug 01, 2010 4:57 pm
Profile
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group. Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.