mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
No issue - Avoid WebGL crash on Mesa
This prevents too high vert-count draws that Mesa doesn't handle.
This commit is contained in:
parent
7de4e86727
commit
943d76fa91
1 changed files with 9 additions and 0 deletions
|
|
@ -1066,6 +1066,15 @@ WebGLContext::DoFakeVertexAttrib0(const char* funcName, GLuint vertexCount)
|
|||
vertexCount = 1;
|
||||
}
|
||||
|
||||
if (gl->WorkAroundDriverBugs() && gl->IsMesa()) {
|
||||
// Padded/strided to vec4, so 4x4bytes.
|
||||
const auto effectiveVertAttribBytes = CheckedInt<int32_t>(vertexCount) * 4 * 4;
|
||||
if (!effectiveVertAttribBytes.isValid()) {
|
||||
ErrorOutOfMemory("`offset + count` too large for Mesa.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const auto whatDoesAttrib0Need = WhatDoesVertexAttrib0Need();
|
||||
if (MOZ_LIKELY(whatDoesAttrib0Need == WebGLVertexAttrib0Status::Default))
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue