Fix render to texture


The GL helpers have a drawBuffer and drawBuffers functions.
drawBuffer takes in a GLenum (GL_COLOR_ATTACHMENT0 + n) and drawBuffers
took in QRenderTargetOutput::AttachmentPoint (0 - 15).

When changes were made to support stereo rendering (QTBUG-123483)
we endup in a case where if we have a single color attachment we would
end up calling drawBuffer and if we have multiple attachments drawBuffers.
In both cases though, we end up calling with AttachmentPoint values instead
of GLEnum which broken render to texture since
drawBuffer(0) is not the same as drawBuffer(GL_COLOR_ATTACHMENT0 + 0). The
first actually disables the color attachment.

To solve this and reduce confusion, drawBuffer and drawBuffers now both
take GLEnum values. In the AttachmentPack we only store AttachmentPoint values
(since AttachmentPack is Graphics API agnostic) and we take care of converting
the AttachmentPoint values to GLenum values when calling drawBuffer or
drawBuffers.

Also remove duplicate activateDrawBuffers function in GraphicsContext as
we only need the one in SubmissionContext

Pick-to: 6.7.2 6.7 6.8
Task-number: QTBUG-126251
Change-Id: I00966c07902699450854d3d8327422967872a985
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
commitdeb5800429f130db39258e21b99e5d72a4429820
parent0c1bc77a46d410f58a19f55b0721d1cd3a1e05b0
authorPaul Lemire <paul.lemire@kdab.com>
committerPaul Lemire <paul.lemire@kdab.com>
commit timeTue, 18 Jun 2024 16:47:26 +0200