title: Fullscreen mode not working in D3D12 raytracing samples
body: <p>Presently I'm learning the basics of real-time raytracing with the DXR API in DirectX 12 Ultimate. I'm studying the D3D12 raytracing samples on the official GitHub and am using an i9/Intel Iris Xe/RTX3070 laptop and building the programs in VS2022.</p>
  <p>Since the samples were written for Windows 10 and I'm using a hybrid graphics PC, a Debug build will run in Windows 11 after adding <code>D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE</code> to <strong>D3D12_INFO_QUEUE_FILTER</strong> during device creation (see <a href="https://stackoverflow.com/questions/69805245/directx-12-application-is-crashing-in-windows-11">DirectX 12 application is crashing in Windows 11</a>). The only trouble is that none of the sample programs change to fullscreen (i.e. borderless windowed) mode when pressing the Alt+Enter key combination. The programs always stay in windowed mode.</p>
  <p>This hasn't worried me so far, because I've been copying the raytracing code over to a template (based on DirectX Tool Kit for Windows desktop) where fullscreen toggling works properly. In this way, I was able to run the <em>HelloWorld</em> and <em>SimpleLighting</em> samples successfully in both windowed mode and fullscreen (2560x1440 monitor resolution).</p>
  <p>However, this hasn't been so successful for the <em>ProceduralGeometry</em> sample, which introduces intersection shaders. Once again, the original sample program renders the scene properly, but only in a bordered window. But when the code is reproduced in the template where I can toggle to fullscreen, the raytraced scene does not render properly.</p>
  <p>In the scene, the triangle geometry used for the ground plane of the scene renders ok, but a translucent bounding box around the fractal pyramid is visible, and all other procedural geometry also appears translucent. Every couple of seconds, the bounding box for the metaballs also appears briefly, then vanishes.</p>
  <p>I was able to determine that by freezing the scene, the reason for the translucency was that the following frames were being presented in sequence:</p>
  <ul>
  <li>triangle ground plane quad only</li>
  <li>floor geometry plus opaque fractal pyramid bounding box</li>
  <li>all of the above plus opaque metaball bounding box</li>
  <li>completed scene with opaque geometry and no bounding boxes</li>
  </ul>
  <p>At the native framerate (165Hz on my machine), this results in both the procedural geometry and bounding boxes always being visible, but 'see-through' due to all the partially complete frames being presented to the display. This happens in both windowed and fullscreen modes, but it's worse in fullscreen, because the scene gets affected by random image corruption not seen in windowed mode.</p>
  <p>I've been grappling with this issue for a few days and can't work out the problem. The only changes I've made to the sample program are the Windows 11 fix, and using a template for proper fullscreen rendering, which the original sample ignores or doesn't implement properly.</p>
  <p>Hopefully someone can shed light on this perplexing issue!</p>