glgsg: Set maximum vertex attrib stride for WebGL

This commit is contained in:
rdb 2023-02-03 15:17:55 +01:00
parent 805fa5a36a
commit 6075307e66
3 changed files with 9 additions and 2 deletions

View File

@ -186,7 +186,10 @@ has_fixed_function_pipeline() const {
*/
INLINE int CLP(GraphicsStateGuardian)::
get_max_vertex_attrib_stride() const {
#ifdef OPENGLES_1
#ifdef __EMSCRIPTEN__
// WebGL has a static limit of 255 (yeah, that low).
return 255;
#elif defined(OPENGLES_1)
// Best guess.
return 2048;
#else

View File

@ -3522,7 +3522,7 @@ reset() {
}
#endif
#ifndef OPENGLES_1
#if !defined(OPENGLES_1) && !defined(__EMSCRIPTEN__)
_max_vertex_attrib_stride = -1;
#ifdef OPENGLES
if (is_at_least_gles_version(3, 1))

View File

@ -753,7 +753,11 @@ protected:
bool _use_vertex_attrib_binding;
CPT(GeomVertexFormat) _current_vertex_format;
const GeomVertexColumn *_vertex_attrib_columns[32];
#ifdef __EMSCRIPTEN__
static const int _max_vertex_attrib_stride = 255;
#else
int _max_vertex_attrib_stride = INT_MAX;
#endif
GLuint _current_sbuffer_index;
pvector<GLuint> _current_sbuffer_base;