DX11 - Preparing for Release Mode

Started by
19 comments, last by Migi0027 10 years, 9 months ago

Hi guys,

a few weeks ago my computer went completely into a Blue Screen of Death, with the WHEA error (Windows Hardware Error Architecture, [that's bad]), but luckily, I kept a backup of everything.

Now as I'm writing, I'm porting my project to the new pc, and the repair shop managed to create a complete backup, but they switched two hard drives, so D:\ was now F:, which messed up some stuff. dry.png

Now, To the POINT!

I re-installed Visual Studio (IDE), but it somehow didn't support the debug version of the runtime c++, which I find wierd (notes obtained from external sources), so now I'm trying to make my Project work in the release mode, which is quite a pain in the ass... laugh.png

I managed to make it run, but at a certain point (found that 'point' by the way), it crashes the NVIDIA Kernel Driver, which isn't exactly what was supposed to happen, unless I was drunk making my application, but I don't remember so. huh.png

The crash seems to occur when I send some shader resources to the pixel shader, as so:


devcon->PSSetShaderResources(3, 1, &random);

The resource is created in a class called C3DEngineObject, which a member called PostProcess, which has a function called Render.

The function render has a paremeter called random, as seen above, but the wierd thing is that in debugging mode (in the dead pc), it worked fine! Perfect actually!

So why fail now? Does it have something to do with the release mode?

So my real question is, how can sending a resource to the pixel shader cause a Graphics Driver crash? ohmy.png

Thanks!

PS. If you need more, please say so.

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Advertisement


I re-installed Visual Studio (IDE), but it somehow didn't support the debug version of the runtime c++, which I find wierd (notes obtained from external sources), so now I'm trying to make my Project work in the release mode, which is quite a pain in the ass...

So your project can't compile and run in debug mode right now?

Strangely no, it says it's missing a MSVCP100d.dll or something like that. (Don't remember the exact name).

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Do you mean it doesn't cmpile in debug, or device creation fails when using the debug dx runtimes? If you mean the latter, and are using vs2010, you need to install the remove vs2012 debugging tools (free), and it will work again.

It compiles fine, but when I run (in debug mode), this message arrives (From memory): The dll MMSVCP100d.dll could not be found.

PS. I'm using VS 2012

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

looks like the debug version has dependencies on a dll that's no longer installed. a Google search should tell you what package its from (earlier version of VS, some MS runtime of some sort, etc). then all you have to do is get the dll.

long ago i learned that games can behave differently in debug a release mode. stuff that works in debug doesn't in release (string pooling in my case - a long time ago). so i don't use debug at all anymore. haven't for years. i start a new project, set it to release mode, set my compiler options, and then code away with no worries.

when i need hardcore debugging i use trace variables and hi-rez timers. used to use trace files for debugging graphics when you can't display stuff on the screen easily, but i have't even needed that in years either. i think the last time i used trace files was when i was writing my own 3d p-correct t-mapped poly engine between the time that MS bought Brender (when i was about to license a copy) and the time they released it as DirectX v1.0 (with no retained mode!).

if you can live without the features of debug mode, you may want to just switch to release mode and be done with it. in the long run, debug mode is irrelevant to the final version of the game, its just a crutch to help get you there.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Working in release mode may be a bit difficult especially if you're working on an experimental or unstable system. Because of the code optimizations, it is almost impossible to debug your code unless you disable those optimization in your project properties. The best way is to probably make sure you have a debug and release version of your application from time to time to make sure everything is working fine and immediately spot any problems that may cause a bigger problem later on.

I have encountered problems similar to that where it would run completely fine in debug but crash in release mode 3-4 times many years ago. Sadly i don't exactly remember what it was. But mine i think was more or uninitialized variables than missing libraries and or dlls.

@Migi0027: I don't really have any solutions but a few simple questions comes into mind:

* Are you sure your device context is a valid pointer? Your device context may be valid in debug mode but you might have a different setting in creating your device context in release mode.

* Is there a possibility of memory leaks? Are you constantly creating graphics resources and possibly not properly releasing or leaking them? I would sometimes do this and feel really stupid after realizing how simple the problem was but insanely hard to track down.

* If you're hundred percent sure your code should work then there may be a bug with your graphics driver. Try updating your graphics driver to the latest one.

* Based on your original post, i'm going to assume you've managed to recover the OS and use that existing OS for your new computer. I normally don't trust my OS after having a problem something like yours. Maybe some of your libraries were deleted or corrupted. Maybe try just to do a fresh install and see if that would work?

Norman: I agree with the information you gave, also because I have previous experience where the debugger automatically initialized variables for me, which, as in your case, was very hard to track down.

Brent: One very important note that you told me (which I am going to experiment with), is to disable code optimization, just for testing, to track down the issue in a simpler manner.

Your Questions:

  1. I'm not sure how a device context can be created differently based on the mode, please tell me how.
  2. I actually haven't paid much attention in my code to this, so thanks for reminding me!
  3. I don't believe that that's the case, but I'll keep that in mind.
  4. I'll keep that in mind, but that will be my last decision.

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Ok, now I've figured out that it doesn't only crash in that function, but also when sending the constant buffers wacko.png

Is there a difference in how you initialize directx in debug and release mode?

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

When you create your device context the D3D11CreateDevice(...) has a parameter that accepts a creation flag. I'm not really doing anything special but adding an extra flag whenever i'm in debug mode.


UINT createFlags = 0;
...

if ( pDesc->bDebug )
	createFlags |= D3D11_CREATE_DEVICE_DEBUG;
...

Having that flag, D3D gives me some additional debug info whenever there is something wrong or any warning messages that i may have. Try doing that in release mode and see if anything unusual shows up in visual studio's output window.

This topic is closed to new replies.

Advertisement