本文介绍了如何使用“DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT”选项进行多次采样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了swapChain,如下面的源代码。


//////////////////////// ////////////////////////////////////////////////// //////////////////////////////////////////////

  DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};


  swapChainDesc.Width = static_cast< UINT>(m_d3dRenderTargetSize.cx); //匹配窗口的大小。

  swapChainDesc.Height = static_cast< UINT>(m_d3dRenderTargetSize.cy);

  swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; //这是最常见的交换链格式。

  swapChainDesc.Stereo = false;

  swapChainDesc.SampleDesc.Count = 1; //不要使用多重采样。

  swapChainDesc.SampleDesc.Quality = 0;

  swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;

  swapChainDesc.BufferCount = 2; //使用双缓冲来最小化延迟。

  swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; //所有Windows应用商店应用必须使用此SwapEffect。

  swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT; //启用GetFrameLatencyWaitableObject()。

  swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE; //使用XAML互操作时,此值不能为DXGI_ALPHA_MODE_PREMULTIPLIED。

///////////////////////////// ////////////////////////////////////////////////// /////////////////////////////////////////
$
SwapChain成功创建。


我想使用多次采样,所以设置swapChainDesc.SampleDesc.Count 2或3.
$
SwapChain这次创建为假。


似乎'DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT'标志导致SwapChain创建为假。

有没有办法在'DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT'标志下使用多次采样?

解决方案


I Created the swapChain like the source below.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 DXGI_SWAP_CHAIN_DESC1 swapChainDesc = { 0 };

 swapChainDesc.Width = static_cast<UINT>(m_d3dRenderTargetSize.cx); // Match the size of the window.
 swapChainDesc.Height = static_cast<UINT>(m_d3dRenderTargetSize.cy);
 swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // This is the most common swap chain format.
 swapChainDesc.Stereo = false;
 swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling.
 swapChainDesc.SampleDesc.Quality = 0;
 swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
 swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency.
 swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Windows Store apps must use this SwapEffect.
 swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT; // Enable GetFrameLatencyWaitableObject().
 swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_IGNORE; // When using XAML interop, this value cannot be DXGI_ALPHA_MODE_PREMULTIPLIED.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SwapChain created sucessfully.

I want to use multi-sampling, so set swapChainDesc.SampleDesc.Count 2 or 3.
SwapChain create false this time.

It seems that 'DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT' flag cause the SwapChain create false.
Is there any way to use multi-sampling with 'DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT' flag?

解决方案


这篇关于如何使用“DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT”选项进行多次采样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:33