Why do we only create one render target view?

32 Views Asked by At

I'm new to DirectX 11, and I have a question about render target views. Suppose the swap chain has two buffers, A and B. During initialization, we call 'GetBuffer' and then create one render target view on the back buffer. Suppose at that time the backbuffer is A. Now consider a scenario where we only call

context->ClearRenderTargetView(RTV, color);
swap->present(1u, 0u);

in our main loop, the color will change in time, to mimic the actual render process. The first time is fine; since A is the backbuffer, it gets cleared with the color and then swapped to the front. However, in the second iteration, A becomes the front buffer, and unintentionally, we clear it again instead of clearing B. Will this cause a problem? And it seems like B will never get cleared.

So why is that we only use one render target view?

0

There are 0 best solutions below