Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXGI WARNING: IDXGIFactory::CreateSwapChain: Blt-model swap effects are legacy swap effects. #8

Open
ghost opened this issue Aug 21, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 21, 2021

Blt-model swap effects are legacy swap effects that are predominantly superseded by their flip-model counterparts. Adjustment to the resize event is required to avoid flickering with the flip model. http://aka.ms/dxgiflipmodel

Component
QDirect3D10Widget
QDirect3D11Widget

diff --git a/source/QDirect3D10Widget/ImGui/QDirect3D10Widget.cpp b/source/QDirect3D10Widget/ImGui/QDirect3D10Widget.cpp
index 253b3c7..47de9f7 100644
--- a/source/QDirect3D10Widget/ImGui/QDirect3D10Widget.cpp
+++ b/source/QDirect3D10Widget/ImGui/QDirect3D10Widget.cpp
@@ -110,7 +110,7 @@ bool QDirect3D10Widget::init()
     sd.SampleDesc.Count                   = 1;
     sd.SampleDesc.Quality                 = 0;
     sd.Windowed                           = TRUE;
-    sd.SwapEffect                         = DXGI_SWAP_EFFECT_DISCARD;
+    sd.SwapEffect                         = DXGI_SWAP_EFFECT_FLIP_DISCARD;
 
     UINT iCreateFlags = 0;
 #if defined(DEBUG) || defined(_DEBUG)
diff --git a/source/QDirect3D10Widget/QDirect3D10Widget.cpp b/source/QDirect3D10Widget/QDirect3D10Widget.cpp
index 0d3ecea..c9b4512 100644
--- a/source/QDirect3D10Widget/QDirect3D10Widget.cpp
+++ b/source/QDirect3D10Widget/QDirect3D10Widget.cpp
@@ -102,7 +102,7 @@ bool QDirect3D10Widget::init()
     sd.SampleDesc.Count                   = 1;
     sd.SampleDesc.Quality                 = 0;
     sd.Windowed                           = TRUE;
-    sd.SwapEffect                         = DXGI_SWAP_EFFECT_DISCARD;
+    sd.SwapEffect                         = DXGI_SWAP_EFFECT_FLIP_DISCARD;
 
     UINT iCreateFlags = 0;
 #if defined(DEBUG) || defined(_DEBUG)
diff --git a/source/QDirect3D11Widget/ImGui/QDirect3D11Widget.cpp b/source/QDirect3D11Widget/ImGui/QDirect3D11Widget.cpp
index 1b8c705..a462fd4 100644
--- a/source/QDirect3D11Widget/ImGui/QDirect3D11Widget.cpp
+++ b/source/QDirect3D11Widget/ImGui/QDirect3D11Widget.cpp
@@ -112,7 +112,7 @@ bool QDirect3D11Widget::init()
     sd.SampleDesc.Count                   = 1;
     sd.SampleDesc.Quality                 = 0;
     sd.Windowed                           = TRUE;
-    sd.SwapEffect                         = DXGI_SWAP_EFFECT_DISCARD;
+    sd.SwapEffect                         = DXGI_SWAP_EFFECT_FLIP_DISCARD;
 
     UINT iCreateFlags = 0;
 #if defined(DEBUG) || defined(_DEBUG)
diff --git a/source/QDirect3D11Widget/QDirect3D11Widget.cpp b/source/QDirect3D11Widget/QDirect3D11Widget.cpp
index e901039..4c966a6 100644
--- a/source/QDirect3D11Widget/QDirect3D11Widget.cpp
+++ b/source/QDirect3D11Widget/QDirect3D11Widget.cpp
@@ -104,7 +104,7 @@ bool QDirect3D11Widget::init()
     sd.SampleDesc.Count                   = 1;
     sd.SampleDesc.Quality                 = 0;
     sd.Windowed                           = TRUE;
-    sd.SwapEffect                         = DXGI_SWAP_EFFECT_DISCARD;
+    sd.SwapEffect                         = DXGI_SWAP_EFFECT_FLIP_DISCARD;
 
     UINT iCreateFlags = 0;
 #if defined(DEBUG) || defined(_DEBUG)
@giladreich
Copy link
Owner

Hi @wroy-ca,

Good catch and this indeed sounds reasonable to me. I think the main reason it was set like this was in order to stick to the official examples as in ImGui. I will be very happy to receive a PR from you for that. :)

Thanks a lot and appreciate your contributions! 🍻

@ghost
Copy link
Author

ghost commented Aug 23, 2021

Hi @wroy-ca,

Good catch and this indeed sounds reasonable to me. I think the main reason it was set like this was in order to stick to the official examples as in ImGui. I will be very happy to receive a PR from you for that. :)

Thanks a lot and appreciate your contributions! 🍻

It appears that DXGI_SWAP_EFFECT_FLIP_DISCARD is affected by #10 and will in fact makes it worst. Perhaps the three issues should be merged in one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant