• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
ucfchuck

migrating from dx10 to 11 gives me an undebug-able error

6 posts in this topic

I moved my code from using directx10 to 11 so i could use a compute shader to process the data on the gpu multiple times before rendering it. So i made the move and got all the explicit errors/exceptions out.

Now I am running into a "vshost32.exe has stopped working" and it gives me the option to debug but it then tells me " a debugger is attached to myprogram.vshost.exe but not configured to debug this unhandled exception. to debug this exception, detach the current debugger."

so i went digging, i set vs to break on all exceptions thrown, and turned on unmanaged debugging. when it hits the exception there is no available source code for me to see where any of this is happening it only gives me some point buried in the assembly, but it always seems to happen in an nvwgf2um.dll in the call stack.

> nvwgf2um.dll!09bbd565()
[Frames below may be incorrect and/or missing, no symbols loaded for nvwgf2um.dll]
nvwgf2um.dll!09b945fd()
nvwgf2um.dll!09d30f8b()
nvwgf2um.dll!09d12419()
nvwgf2um.dll!09cd82ac()
nvwgf2um.dll!09b68296()
nvwgf2um.dll!09b65b51()
nvwgf2um.dll!09c212f8()
nvwgf2um.dll!0a1de315()
nvwgf2um.dll!0a1de39f()
kernel32.dll!763a3677()
ntdll.dll!776c9f42()
ntdll.dll!776c9f15()

so i dug a little deeper and this seems to happen in bf3 quite a bit where people say that a newish release of the nvidia drivers are the culprit ad to just roll back the drivers. so i did and it did not help, so i installed the latest and again still having the same issue. so i went to laptopvideo2go and installed a modded one, still nvwgf2um.dll crashes.

anyone have any ideas? am i stuck waiting for an update from nvidia, or is it possibly something in my code i did wrong?
0

Share this post


Link to post
Share on other sites
Sometimes your code or your shader code can cause a crash in the driver. It's not particularly easy to track down...I would suggest that you start disabling things until it stops crashing so that you can narrow it down.
2

Share this post


Link to post
Share on other sites

ok so im not sure i have really narrowed it down to this point as the try catch block does not catch the exception, but when i do not allow the texture to be written to, then it stops crashing. the map function is as follows,
[source lang="csharp"]
try
{
// if everything is in order then send data to graphics memory.
if (pTexture != null)
{
DataBox mappedTex = null;
//assign and lock the resource
mappedTex = g_pd3dDevice.ImmediateContext.MapSubresource(pTexture, 0, pTexture.Description.Height * pTexture.Description.Width*4, D3D11.MapMode.WriteDiscard, D3D11.MapFlags.None);
// if unable to hold texture
if (!mappedTex.Data.CanWrite)
{ throw new InvalidOperationException("Cannot Write to the Texture"); }
// write new data to the texture
mappedTex.Data.WriteRange<byte>(NewData);
// unlock the resource
g_pd3dDevice.ImmediateContext.UnmapSubresource(pTexture, 0);
}
}
catch (Exception P)
{
MessageBox.Show("texheight = " + pTexture.Description.Height + " \n" + "texwidth = " + pTexture.Description.Width + "\n" + "data size = " + NewData.Length);
throw;
}
[/source]


could this be some kind of threading issue with the ImmediateContext ? there was some issue with having to move from a datarectangle to a databox as well.

Edited by Michael Tanczos
0

Share this post


Link to post
Share on other sites
I'm guessing this is a dynamic texture that you're mapping? Did you enable debug output when you created the device?
0

Share this post


Link to post
Share on other sites
yes the texture was created with dynamic usage.


no i did not have the debug enabled, but now that i do, i am getting sehexceptions at random places, from the clear render target view, map, write, and unmap,

not in any specific order or consistent place, just literally at random from one of those places. though it is hitting a different exception much faster than it was before. with the debug on i get through about 50-100 frames before it throws the seh exceptions and crashes. weird that it would crash on new exceptions that didnt show up before? Edited by ucfchuck
0

Share this post


Link to post
Share on other sites
Do you get any messages in the native debug output stream? Normally the debug device will put errors and warnings there when you do something wrong.
0

Share this post


Link to post
Share on other sites
D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Draw cannot be invoked while a bound Resource is currently mapped. The Resource bound at Pixel Shader Resource slot (0) is still mapped. [ EXECUTION ERROR #364: DEVICE_DRAW_BOUND_RESOURCE_MAPPED ]

D3D11: ERROR: ID3D11DeviceContext::Draw: Draw cannot be invoked while a bound Resource is currently mapped. The Resource bound at Pixel Shader Resource slot (0) is still mapped. [ EXECUTION ERROR #364: DEVICE_DRAW_BOUND_RESOURCE_MAPPED ]

D3D11: ERROR: ID3D11DeviceContext::DrawIndexed: Draw cannot be invoked while a bound Resource is currently mapped. The Resource bound at Pixel Shader Resource slot (0) is still mapped. [ EXECUTION ERROR #364: DEVICE_DRAW_BOUND_RESOURCE_MAPPED ]

D3D11: CORRUPTION: ID3D11DeviceContext::Unmap: Two threads were found to be executing functions associated with the same Device at the same time. This will cause corruption of memory. Appropriate thread synchronization needs to occur external to the Direct3D API. 2420 and 2432 are the implicated thread ids. [ MISCELLANEOUS CORRUPTION #28: CORRUPTED_MULTITHREADING ]

First-chance exception at 0x75a4c41f in WPControlPanel.exe: 0x0000087D: 0x87d.

D3D11: ERROR: ID3D11DeviceContext::Draw: Draw cannot be invoked while a bound Resource is currently mapped. The Resource bound at Pixel Shader Resource slot (0) is still mapped. [ EXECUTION ERROR #364: DEVICE_DRAW_BOUND_RESOURCE_MAPPED ]


so it is a threading issue. i have a draw function spinning on the main thread and a separate consumer thread trying to pull frames from a usb device as fast as possible which then loads it into the texture. this never was an issue with dx10, it seemed to just wait for one to let go of the resource, seems dx11 does not deal with multiple threads pulling a resource from the device context at the same time. hopefully this is the cause of both exceptions, i think i can just double buffer it into a separate texture and then copyresource on the draw call with a lock to minimize stall time. Edited by ucfchuck
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0