Subpass does not take render area into account


I have the following setup in which I try to run occlusion queries:

  • A pre-recorded secondary command buffer with some draw calls
  • A primary command buffer, in which I define the render area (in RenderPassBeginInfo) and execute the secondary command buffer.

Now the problem is that on the dedicated GPU (nvidia), this works fine, but the integrated Intel does not care about the render area and draws in the whole framebuffer…

Any idea what’s wrong? Could it be driver related?

According to the spec:

The application must ensure (using scissor if necessary) that all rendering is contained within the render area.

It is not Vulkan’s job to constrain your rendering to the renderArea; it’s your job. You only provided renderArea as a hint to Vulkan about what you’re doing. It’s a promise you made to the implementation that you won’t affect any pixels outside of this area.

When the Vulkan specification says that the user “must” do something, if you fail to do it, you get undefined behavior. Which means you can see different things on different platforms.

Aah ok I get it, thanks!

So if I understood well, each time I want to draw within a different area, I should encode a new secondary command buffer with the proper scissor test?

Why would you need a new command buffer just to change the scissor box? Also, were you using a different render pass just to draw to a different area? You should always try to make the smallest change to achieve the desired effect.

To be more concrete, I use this for selectively rendering a mouse selected area, so every time the cursor moves, the scissor box is updated. So isn’t it necessary to re-encode the scissor box?

What I did now is to encode all draw operations in a secondary command buffer (1 render pass), and I thought it would be nice to just set the render area in the primary command buffer and then just execute the secondary one (so that I don’t have to encode all the draw calls again).

Oh, I see. You’re trying to use static command buffers, where you build them once and use them multiple times.

Yes, you’ll need to build a new static command buffer.

Ah, alright then, I’ll create new ones. Thanks for your help!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.