Fix crash when a user pass declares no color attachment


A top-level RenderPass without ColorAttachment commands is supposed to
get a default color attachment, but the render target build loop
indexed the command list for every attachment it created,
asserting in debug builds and reading out of bounds in release builds.
The compatibility check had the same problem, it compared the render
target's attachment count against the command count, forcing a full
render target rebuild every frame, and would then have indexed the
empty command list when validating the attachment formats.

Amends 7d64f0b942f4535abc4d4302ed3dc7a58041563d.

Pick-to: 6.12 6.11
Change-Id: I614750dbbca9fc839038e832ee39b1599a29d0a0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
commit7f1b1238718075ce43af5043c4757a794e664c67
parentb0071601a879f98eda814ac76bfd00eface99f0e
authorChristian Strømme <christian.stromme@qt.io>
committerChristian Strømme <christian.stromme@qt.io>
commit timeMon, 24 Aug 2026 08:56:42 +0000