Jump to content
  • Advertisement

DX12 D3D12 project template, StepTimer, and tripple buffering

This topic is 508 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

The D3D12 project template for creating a c++ directx 12 project aka File>New>Project>Visual C++> DirectX 12 App(Universal Windows) creates a project with a spinning cube.   This cube is rendered using 3 RTV, writing to the backbuffer, and presenting based on the current frame.  This works great as long as you are running 60 frames a second.  If I change the steptimer to 1/30, or 30 frames a second as a lot of production games run because of shadow drawing, lighting, reflections, the cube starts to jitter. I believe this jitter comes from the Update not copying the constant buffer data fast enough for render to read it so render is actually calling some previous constant buffer data.  You can fix it easily by updating all the constant buffers every update instead of by frame.

		for ( i = ; i < DX::c_frameCount; i++)
			UINT8* destination = m_mappedConstantBuffer + (i * c_alignedConstantBufferSize);
			memcpy(destination, &m_constantBufferData, sizeof(m_constantBufferData));


My question is, is this the best way to handle this?  what is the best way?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!