From: divverent divverent@d7cf8633-e32d-0410-b094-e92efae38249 <> Date: Tue, 31 Aug 2010 07:28:24 +0000 (+0000) Subject: UNMERGE X-Git-Tag: xonotic-v0.1.0preview~202 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=70ef94f38fa9d65d85ce816b217beb01d89b47e5;p=xonotic%2Fdarkplaces.git UNMERGE get rid of calculating vertexmesh animcache buffers if we do not need the vertexmesh... fixes performance of steel storm git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10431 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::unmerge=010f524039d1780063484288f9a832b473709a6b --- diff --git a/gl_rmain.c b/gl_rmain.c index 1d6571fd..5745f55b 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -7761,52 +7761,14 @@ void R_AnimCache_ClearCache(void) void R_AnimCache_UpdateEntityMeshBuffers(entity_render_t *ent, int numvertices) { int i; - - // identical memory layout, so no need to allocate... - // this also provides the vertexposition structure to everything, e.g. - // depth masked rendering currently uses it even if having separate - // arrays - // NOTE: get rid of this optimization if changing it to e.g. 4f - ent->animcache_vertexposition = (r_vertexposition_t *)ent->animcache_vertex3f; - - // TODO: - // get rid of following uses of VERTEXPOSITION, change to the array: - // R_DrawTextureSurfaceList_Sky if skyrendermasked - // R_DrawSurface_TransparentCallback if r_transparentdepthmasking.integer - // R_DrawTextureSurfaceList_DepthOnly - // R_Q1BSP_DrawShadowMap - - switch(vid.renderpath) - { - case RENDERPATH_GL20: - case RENDERPATH_CGGL: - // need the meshbuffers if !gl_mesh_separatearrays.integer - if (gl_mesh_separatearrays.integer) - return; - break; - case RENDERPATH_D3D9: - case RENDERPATH_D3D10: - case RENDERPATH_D3D11: - // always need the meshbuffers - break; - case RENDERPATH_GL13: - case RENDERPATH_GL11: - // never need the meshbuffers - return; - } - if (!ent->animcache_vertexmesh && ent->animcache_normal3f) ent->animcache_vertexmesh = (r_vertexmesh_t *)R_FrameData_Alloc(sizeof(r_vertexmesh_t)*numvertices); - /* if (!ent->animcache_vertexposition) ent->animcache_vertexposition = (r_vertexposition_t *)R_FrameData_Alloc(sizeof(r_vertexposition_t)*numvertices); - */ if (ent->animcache_vertexposition) { - /* for (i = 0;i < numvertices;i++) VectorCopy(ent->animcache_vertex3f + 3*i, ent->animcache_vertexposition[i].vertex3f); - */ // TODO: upload vertex buffer? } if (ent->animcache_vertexmesh)