I'm experimenting with setting various graphical settings in my Direct3D9 application, and I'm currently facing a curious problem with anti-aliasing. When running under the debug runtime, AA works as expected, and I don't have any errors or warnings. But when running under the retail runtime, the image isn't anti-aliased at all. I don't get any errors, the device creates and executes just fine.

As I honestly have little idea where the problem is, I will simply give a relatively high-level overview of the architecture involved, rather than specific problematic code. Simply put, I render my 3D content to a texture, which I then render to the back buffer.

Why would this be?

  • \$\begingroup\$ Is the D3D runtime the only thing that changes or do you have different targets for your application that use a different runtime (e.g. Debug/Release)? If that's the latter, you might try disabling your Debug features one by one to get closer to your Release target. Maybe you've got an #ifdef _DEBUG somewhere that's screwing things up. \$\endgroup\$ Commented Apr 2, 2012 at 11:34
  • \$\begingroup\$ @lorancou: No, I'm running the Debug build in both cases and just changing the runtime in the D3D control panel. \$\endgroup\$
    – DeadMG
    Commented Apr 2, 2012 at 11:51
  • 4
    \$\begingroup\$ So you might have a non-initialized variable issue. Using the debug runtime, D3D initializes something to 0 and everything works fine. But using the retail runtime this something doesn't get initialized and holds some random data, so your anti-aliasing breaks. My advice is to try initializing everything that's not, and next time to develop directly with the retail runtime; I'd only use the debug runtime once in a while to look for issues. \$\endgroup\$ Commented Apr 2, 2012 at 13:17
  • \$\begingroup\$ @lorancou: I use an always_initialized<T> helper class to guarantee initialization at all times in all modes. \$\endgroup\$
    – DeadMG
    Commented Apr 2, 2012 at 20:40
  • \$\begingroup\$ This doesn't guarantee you're initializing D3D completely. Maybe you didn't initialize your viewport with IDirect3DDevice9::SetViewport. Or one of the parameters you use here is not using your always_initialized helper. Or your helper doesn't do what you think it does. Maybe you called IDirect3DDevice9::BeginScene but not IDirect3DDevice9::EndScene. It's weird that you don't get any errors with the debug runtime though, we might be missing something more obvious. \$\endgroup\$ Commented Apr 3, 2012 at 10:17

1 Answer 1


Anti-aliasing is one of those things GPU vendors like to add explicit controls for in their drivers and control panels. Typically the options in these control panels can be used to override an application's requests to D3D for things like anti-aliasing support, and so on, and typically only work for retail runtimes.

It is consequently possible that the control panel for your GPU drivers has a setting (which is active, either by default or because you toggled it willingly or not) to disable AA.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .