• Advertisement
Sign in to follow this  

DrawIndexedPrimitive causes unhandled exception

This topic is 4711 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi altogether, I'm just trying to code some kind of engine which is able to show terrains. Due to the fact that I need some Windows-GUI-Objects, too, I built this project upon a MFC-Editor Project from VC++6. Additionally, the Game-Loop doesn not run in the Main-Thread of the application but in some extra Thread I created. This Thread is created After the main Thread has initialized Direct3D, the Shell-window and so on, so there should not be access from anything else beside my Render Thread to any DirectX-Contents from its beginning on. Anyway, running the application causes Unhandled Exception in ScanView.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception. everytime when DrawIndexedPrimitive is called. As far as I can see, the Index- and Vertexbuffer is totally ok after being created, so I think it has to do with either MFC or the multiple Threads. Has anybody an idea how to solve that?

Share this post


Link to post
Share on other sites
Advertisement
1) Does the debug Direct3D runtime have anything to say in its output?


2) As a test, try using SOFTWARE vertex processing, and make sure the D3D device isn't a PURE device - then run it through the debug D3D runtime.


3) If you require D3D to be thread safe, pass D3DCREATE_MULTITHREADED to the CreateDevice() call.


4) What type of thread synchronisation primitives are you using to access resources which are shared between the main and worker thread? - particularly stuff that accesses data that's being passed to D3D.


5) IIRC the thread that makes D3D calls should be the same as the thread which created and handles messages for the window passed to D3D.


6) Does the program crash at all when you get the exception? if so, what's in the call stack?


7) Try getting the symbols for KERNEL32.DLL to see what function the exception is failing in. http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx
MSVC 2003.NET can use the symbol server directly (so you don't need to use WinDbg or download the whole package); there may also be a way to do it in MSVC 6.

Share this post


Link to post
Share on other sites
Thx very much for the fast response!

Well, thats how far I have proceeded:

1) Don't understand that really...
Do you want me to change the kind of DX installation? If so, how to do that?

2)Used Software Processing - no luck...

3)Used D3DCREATE_MULTITHREADED - no luck...

4)I'm using CCriticalSection. Most times I'm just using it to copy data which is shared between the threads to a place from where D3D can use it safely, so D3D methods only use copyed data which other threads don't access.

5) Changed the design a bit: Only one thread uses D3D things even if the main thread stopped using D3D before the render-Thread was created. Well, the render loop is still running and running, but the window in which the things should be rendered is frozen now. The exception still appeares...

6) The Program doesn not crash because of the exception. The DrawIndexedPrimitive-method does not return D3D_OK...

7) Thats what I'm doing currently...


Well, thx again, a hint on 1) would be nice :-)

Share this post


Link to post
Share on other sites
Quote:
Original post by -mainframe-
1) Don't understand that really...
Do you want me to change the kind of DX installation? If so, how to do that?

...

6) The Program doesn not crash because of the exception. The DrawIndexedPrimitive-method does not return D3D_OK...

...

Well, thx again, a hint on 1) would be nice :-)


A nice handy article about using the debug Direct3D runtime [smile]:

http://nexe.gamedev.net/directKnowledge/default.asp?p=Debugging

Share this post


Link to post
Share on other sites
Ou damn...

Just forgot "BeginScene()"!!!

Ok, at least I know how to use the debug-Version of DX9... Used Runtime for Developing 2 Years before...


Well, thx for your time and sorry that I wasted it...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement