RE: Exception raised when drawing many circles



This exception occurs in my full-size application and I have not been able
yet to reduce the code to a few lines. As indicated, I have generated a PIX
file where the problem occurs. I can send it to you.

If I look inside this PIX file, I can see that at one moment, a call to
DrawIndexedPrimitive made by the Line class returns a D3DERR_INVALIDCALL.
This seems to be caused by a vertex buffer that has not been unlocked by
Line. Here is the point where the problem occurs in the PIX file :

--- We are here inside the last successful Line.DrawTransform ---

Call,71123,"<0x0ECEE578> IDirect3DVertexBuffer9::Lock(37728, 8160,
0x0012DB7C, D3DLOCK_NOOVERWRITE)",19508213474,,,
Call,71124,<0x0ECEC980>
IDirect3DDevice9::GetViewport(0x0012DB08),19508221016,,,
Call,71125,<0x0ECEE578> IDirect3DVertexBuffer9::Unlock(),19508284712,,,
Call,71126,"<0x0ECEC980>
IDirect3DDevice9::DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 1572, 336,
2358, 168)",19508607937,,,

--- IDirect3DDevice9::DrawIndexedPrimitive has returned S_OK

Call,71127,"<0x0ECEE578> IDirect3DVertexBuffer9::Lock(45888, 3264,
0x0012DB7C, D3DLOCK_NOOVERWRITE)",19508630845,,,
Call,71128,<0x0ECEC980>
IDirect3DDevice9::GetViewport(0x0012DB08),19508638667,,,

--- Something strange has occurred here : the buffer has not been unlocked !

--- We call here Line.End ---

Call,71129,DebugSetMute(TRUE),19509027264,,,
Call,71130,<0x0ECEDF38> IDirect3DStateBlock9::Apply(),19509038439,,,
Call,71131,DebugSetMute(FALSE),19509075036,,,

--- Now this is some of my code ---

Call,71132,"<0x0ECEC980>
IDirect3DDevice9::SetRenderState(D3DRS_TEXTUREFACTOR,
D3DCOLOR_ARGB(0xff,0x00,0x00,0x00))",19509088445,,,
Call,71133,<0x0ECEC980>
IDirect3DDevice9::GetMaterial(0x0012DAFC),19509106883,,,
Call,71134,<0x0ECEC980>
IDirect3DDevice9::SetMaterial(0x0012DA34),19509113867,,,
Call,71135,"<0x0ECEDE28> IDirect3DVertexBuffer9::Lock(7104, 5184,
0x0217E6C8, D3DLOCK_NOOVERWRITE)",19509161080,,,
Call,71136,<0x0ECEDE28> IDirect3DVertexBuffer9::Unlock(),19509220585,,,
Call,71137,<0x0ECEC980>
IDirect3DDevice9::GetSoftwareVertexProcessing(),19509366972,,,
Call,71138,"<0x0ECEC980> IDirect3DDevice9::SetStreamSource(0, 0x0ECEDE28, 0,
12)",19509374236,,,
Call,71139,<0x0ECEC980> IDirect3DDevice9::SetFVF(D3DFVF_XYZ),19509382058,,,
Call,71140,"<0x0ECEC980> IDirect3DDevice9::DrawPrimitive(D3DPT_LINESTRIP,
592, 2)",19509402172,,,
Call,71141,"<0x0ECEC980> IDirect3DDevice9::DrawPrimitive(D3DPT_LINESTRIP,
595, 3)",19509423683,,,
Call,71142,"<0x0ECEC980> IDirect3DDevice9::DrawPrimitive(D3DPT_LINESTRIP,
599, 3)",19509430109,,,

--- Here, we call again Line.Open() ---

Call,71143,DebugSetMute(TRUE),19509459442,,,
Call,71144,<0x0ECEDF38> IDirect3DStateBlock9::Capture(),19509466705,,,
Call,71145,<0x0ECEF860> IDirect3DStateBlock9::Apply(),19509484585,,,
Call,71146,DebugSetMute(FALSE),19509503302,,,

--- We call Line.DrawTransform() ---

Call,71147,<0x0ECEC980>
IDirect3DDevice9::GetViewport(0x0012DAF8),19509508052,,,
Call,71148,"<0x0ECEC980> IDirect3DDevice9::SetTransform(D3DTS_PROJECTION,
0x0012DB10)",19509514756,,,
Call,71149,"<0x0ECEE578> IDirect3DVertexBuffer9::Lock(0, 192, 0x0012DB54,
D3DLOCK_DISCARD)",19509523417,,,
Call,71150,<0x0ECEC980>
IDirect3DDevice9::GetViewport(0x0012DAE0),19509551353,,,
Call,71151,<0x0ECEE578> IDirect3DVertexBuffer9::Unlock(),19509561690,,,
Call,71152,"<0x0ECEC980>
IDirect3DDevice9::DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 4, 0,
2)",19509576775,,,

--- Here, DrawIndexedPrimitive() has returned D3DERR_INVALIDCALL and will
always return D3DERR_INVALIDCALL after... ---

I hope this will help you.

--
Olivier Lauffenburger
Missler Software


"Rhett Gong [MSFT]" wrote:

> Hello Olivier,
> I understand that you get an av excption when calling Line.DrawTransform, but I am not sure what your scenario is and how to reproduce the issue.
> So that I could better understand your problem, can you post a simple repro code here and let me know how to reproduce this problem please?
>
> I look forward to hearing back from you with and then I will begin testing the code and finding the cause of the problem.
>
> Thanks for your patience,
> Rhett Gong [MSFT]
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp&SD=msdn
>
> This posting is provided "AS IS" with no warranties and confers no rights.
>
>
.


Loading