Hello,
I set viewport and scissor dynamic when creating pipeline
Also, set 2 viewports and 2 scissors
In BuildCommandBuffers function, I did below
VkViewport viewports[2] = {
{ (float)width / 2.0f, 0, (float)width / 2.0f, (float)height, 0.0, 1.0f },
{ 0, 0, (float)width / 2.0f, (float)height, 0.0, 1.0f },
};
vkCmdSetViewport(drawCmdBuffers[i], 0, 2, viewports);
VkRect2D scissorRects[2] = {
vks::initializers::rect2D(width/2, height, width / 2, 0),
vks::initializers::rect2D(width/2, height, 0, 0),
};
vkCmdSetScissor(drawCmdBuffers[i], 0, 2, scissorRects);
and Draw something ...
But this does not work. The screen only draw one among two viewports
However, in the tutorial ViewportArray.cpp
this tutorial can draw two viewports at the same time with shader programming
Moreover, though I can use two different viewports in one commandbuffer recording
I can only use one scissor working in one recording
If I try to use two different scissors in one recording, the second scissor is ignored
So my question is
without following ViewportArray tutorial
can I draw multi-viewports and multi-scissors ?
Thank you