]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
r_shadow: work around a realtime world light crash
[xonotic/darkplaces.git] / gl_rsurf.c
index 723e9fb4ce3ee2028ffcc20b6924f1e02955dedd..a68daf5b68e539e032441a0d715e48d3977e0a5d 100644 (file)
@@ -1295,7 +1295,10 @@ void R_Mod_CompileShadowMap(entity_render_t *ent, vec3_t relativelightorigin, ve
        // exceeding the number of triangles in a single mesh) we have to make sure
        // that we make only a single mesh - so over-estimate the size of the mesh
        // to match the model.
-       r_shadow_compilingrtlight->static_meshchain_shadow_shadowmap = Mod_ShadowMesh_Begin(r_main_mempool, model->surfmesh.num_vertices, model->surfmesh.num_triangles);
+       // bones_was_here: +128 works around BUG https://github.com/DarkPlacesEngine/darkplaces/issues/119
+       // +64 was enough to start the map without triggering ASan, +96 was enough to also edit the light.
+       // See also: warning in Mod_ShadowMesh_AddMesh
+       r_shadow_compilingrtlight->static_meshchain_shadow_shadowmap = Mod_ShadowMesh_Begin(r_main_mempool, model->surfmesh.num_vertices, model->surfmesh.num_triangles + 128);
        R_Shadow_PrepareShadowSides(model->surfmesh.num_triangles);
        for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
        {