mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1136428 - Ensure we never create more than the amount supported of color attachments in WebGLFrameBuffer or try to get an attachment point higher than the supported number. r=jgilbert
This commit is contained in:
parent
825ec93fa4
commit
c10b6815a5
@ -509,7 +509,7 @@ WebGLFramebuffer::GetAttachPoint(FBAttachment attachPoint)
|
||||
|
||||
if (attachPoint >= LOCAL_GL_COLOR_ATTACHMENT1) {
|
||||
size_t colorAttachmentId = attachPoint.get() - LOCAL_GL_COLOR_ATTACHMENT0;
|
||||
if (colorAttachmentId < WebGLContext::kMaxColorAttachments) {
|
||||
if (colorAttachmentId < (size_t)mContext->mGLMaxColorAttachments) {
|
||||
EnsureColorAttachPoints(colorAttachmentId);
|
||||
return mMoreColorAttachments[colorAttachmentId - 1];
|
||||
}
|
||||
@ -832,17 +832,19 @@ WebGLFramebuffer::CheckAndInitializeAttachments()
|
||||
|
||||
void WebGLFramebuffer::EnsureColorAttachPoints(size_t colorAttachmentId)
|
||||
{
|
||||
MOZ_ASSERT(colorAttachmentId < WebGLContext::kMaxColorAttachments);
|
||||
size_t maxColorAttachments = mContext->mGLMaxColorAttachments;
|
||||
|
||||
MOZ_ASSERT(colorAttachmentId < maxColorAttachments);
|
||||
|
||||
if (colorAttachmentId < ColorAttachmentCount())
|
||||
return;
|
||||
|
||||
while (ColorAttachmentCount() < WebGLContext::kMaxColorAttachments) {
|
||||
while (ColorAttachmentCount() < maxColorAttachments) {
|
||||
GLenum nextAttachPoint = LOCAL_GL_COLOR_ATTACHMENT0 + ColorAttachmentCount();
|
||||
mMoreColorAttachments.AppendElement(WebGLFBAttachPoint(this, nextAttachPoint));
|
||||
}
|
||||
|
||||
MOZ_ASSERT(ColorAttachmentCount() == WebGLContext::kMaxColorAttachments);
|
||||
MOZ_ASSERT(ColorAttachmentCount() == maxColorAttachments);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user