• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By turanszkij
      Hi,
      I finally managed to get the DX11 emulating Vulkan device working but everything is flipped vertically now because Vulkan has a different clipping space. What are the best practices out there to keep these implementation consistent? I tried using a vertically flipped viewport, and while it works on Nvidia 1050, the Vulkan debug layer is throwing error messages that this is not supported in the spec so it might not work on others. There is also the possibility to flip the clip scpace position Y coordinate before writing out with vertex shader, but that requires changing and recompiling every shader. I could also bake it into the camera projection matrices, though I want to avoid that because then I need to track down for the whole engine where I upload matrices... Any chance of an easy extension or something? If not, I will probably go with changing the vertex shaders.
    • By NikiTo
      Some people say "discard" has not a positive effect on optimization. Other people say it will at least spare the fetches of textures.
       
      if (color.A < 0.1f) { //discard; clip(-1); } // tons of reads of textures following here // and loops too
      Some people say that "discard" will only mask out the output of the pixel shader, while still evaluates all the statements after the "discard" instruction.

      MSN>
      discard: Do not output the result of the current pixel.
      clip: Discards the current pixel..
      <MSN

      As usual it is unclear, but it suggests that "clip" could discard the whole pixel(maybe stopping execution too)

      I think, that at least, because of termal and energy consuming reasons, GPU should not evaluate the statements after "discard", but some people on internet say that GPU computes the statements anyways. What I am more worried about, are the texture fetches after discard/clip.

      (what if after discard, I have an expensive branch decision that makes the approved cheap branch neighbor pixels stall for nothing? this is crazy)
    • By NikiTo
      I have a problem. My shaders are huge, in the meaning that they have lot of code inside. Many of my pixels should be completely discarded. I could use in the very beginning of the shader a comparison and discard, But as far as I understand, discard statement does not save workload at all, as it has to stale until the long huge neighbor shaders complete.
      Initially I wanted to use stencil to discard pixels before the execution flow enters the shader. Even before the GPU distributes/allocates resources for this shader, avoiding stale of pixel shaders execution flow, because initially I assumed that Depth/Stencil discards pixels before the pixel shader, but I see now that it happens inside the very last Output Merger state. It seems extremely inefficient to render that way a little mirror in a scene with big viewport. Why they've put the stencil test in the output merger anyway? Handling of Stencil is so limited compared to other resources. Does people use Stencil functionality at all for games, or they prefer discard/clip?

      Will GPU stale the pixel if I issue a discard in the very beginning of the pixel shader, or GPU will already start using the freed up resources to render another pixel?!?!



       
    • By Axiverse
      I'm wondering when upload buffers are copied into the GPU. Basically I want to pool buffers and want to know when I can reuse and write new data into the buffers.
    • By NikiTo
      AMD forces me to use MipLevels in order to can read from a heap previously used as RTV. Intel's integrated GPU works fine with MipLevels = 1 inside the D3D12_RESOURCE_DESC. For AMD I have to set it to 0(or 2). MSDN says 0 means max levels. With MipLevels = 1, AMD is rendering fine to the RTV, but reading from the RTV it shows the image reordered.

      Is setting MipLevels to something other than 1 going to cost me too much memory or execution time during rendering to RTVs, because I really don't need mipmaps at all(not for the 99% of my app)?

      (I use the same 2D D3D12_RESOURCE_DESC for both the SRV and RTV sharing the same heap. Using 1 for MipLevels in that D3D12_RESOURCE_DESC gives me results like in the photos attached below. Using 0 or 2 makes AMD read fine from the RTV. I wish I could sort this somehow, but in the last two days I've tried almost anything to sort this problem, and this is the only way it works on my machine.)


  • Advertisement
  • Advertisement
Sign in to follow this  

DX12 "True immediate independent flip mode"

This topic is 740 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,

 

I am starting to convert my stuff to DX12. Exiting!

 

I am in the process of creating the window and swap chain and I would like to support (some form of) fullscreen mode in my app.

 

The obvious thing I did was to take all my old DXGI setup and copy it in my DX12 app. I had to modify a few things like the swap effect mode (FLIP_DISCARD) and the format of the buffers but it was mostly the same. I noticed that in fullscreen, the frame-rate is capped at the screen refresh rate. (That was not the case with DX11)

 

Reading this:
https://developer.nvidia.com/dx12-dos-and-donts#swapchains

 

And watching this:



I would like to know more about "True immediate independent flip mode". It seems to be the way to go for uncapped fullscreen / smooth vsync.

 

Anyone knows what that means and how to set it up?

 

Cheers,

 

Shnoutz

Share this post


Link to post
Share on other sites
Advertisement
Immediate flip immediate mode is the replacement of the fullscreen exclusive mode. The behaviour is almost the same: DWM bypassing, unleashed frame-rate and possible tearing. The main difference is the "non-exclusive" mode: this allow fast alt-tabbing and desktop switch, as well as the having OS notification (if allowed by the user) and elements over-focused the main application (like volume control). In the last scenario the presented frames are temporarily synchronized with the desktop refresh rate until the OS element disappear from the screen (the other frames are automatically discarded).
 
To enter in fullscreen immediate mode you need to call setfullscreenstate( true) and manually handling WM_SIZE meessage calling resizebuffer(). Current AMD driver should still use DWM composition, so it may not work as expected..
 
edit: here is an example how to handle fullscreen transitions: https://github.com/Microsoft/DirectX-Graphics-Samples (see D3D12Fullscreen)
 
Please note that this mode is not currently supported on WStore (aka UWP) applications. Edited by Alessio1989

Share this post


Link to post
Share on other sites

Thank you!

Its funny you mention that particular sample as its the one I used to modify my code. My stuff right now is pretty much a carbon copy of it.

The thing I do not understand is in window mode I get FPS > 1000 but in fullscreen mode its 60. I have a nVidia, is the mode not supported on my card?

 

When you say manually handle the WM_SIZE is this the only way? I tend to ignore the message and check for size differences at the beginning of the frame.

Share this post


Link to post
Share on other sites
I am not aware of NVIDIA current drivers support about immediate mode, but according to what we can see on the web, they should handle unleashed framerate (at least on ashes of singularity beta)
Did you set the DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH flag? If so you should call ResizeTarget(). I am not sure if checking for difference sizes of the frame is a good practice, because according to MSDN all the frame buffers must have the same size. Edited by Alessio1989

Share this post


Link to post
Share on other sites
Not sure if this is helpful, or even right, but I saw that video and somewhere in there he said it is not possible to have unleashed fps in fullscreen mode. Now if there was a way to check if present was ready or not, you could skip the present call that frame. I think there is a way to do that, he might have also mentioned that in the video. Or maybe it was telling present not to block

Share this post


Link to post
Share on other sites

Hi, guy in the video here. Sorry for taking so long to find this, I don't typically monitor these forums. What you're describing sounds pretty unexpected.

 

First question: Are you running on a secondary monitor? I think there's currently some limitations there, where the optimization progression stops at Direct Flip and doesn't progress to Independent Flip.

 

If no, then second question:

Can you try running PresentMon (https://github.com/GameTechDev/PresentMon) either on a secondary monitor or in the background logging to a CSV, and tell me what you see for the present mode that's being detected?

Share this post


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

  • Advertisement