Numerous performance fixes.

This commit is contained in:
Justin Marshall
2026-05-21 15:36:02 -07:00
parent 2e4265f5a1
commit a89d43628c
29 changed files with 1632 additions and 636 deletions
+8 -1
View File
@@ -628,6 +628,7 @@ typedef struct {
float maxLightValue; // for light scale
int msec; // total msec for backend run
int cpuMsecNoSwap; // backend CPU excluding swap/present wait
} backEndCounters_t;
// all state modified by the back end is separated
@@ -860,6 +861,8 @@ extern idCVar r_useNodeCommonChildren; // stop pushing reference bounds early wh
extern idCVar r_useSilRemap; // 1 = consider verts with the same XYZ, but different ST the same for shadows
extern idCVar r_useCulling; // 0 = none, 1 = sphere, 2 = sphere + box
extern idCVar r_useLightCulling; // 0 = none, 1 = box, 2 = exact clip of polyhedron faces
extern idCVar r_useMaskedOcclusionCulling; // one-frame-late threaded MOC light culling
extern idCVar r_mocResolutionScale; // software occlusion resolution relative to view size
extern idCVar r_useLightScissors; // 1 = use custom scissor rectangle for each light
extern idCVar r_useClippedLightScissors;// 0 = full screen when near clipped, 1 = exact when near clipped, 2 = exact always
extern idCVar r_useEntityCulling; // 0 = none, 1 = box
@@ -1142,6 +1145,9 @@ MAIN
*/
void R_RenderView( viewDef_t *parms );
void R_MaskedOcclusionCulling_ProcessView( viewDef_t *parms );
bool R_MaskedOcclusionCulling_LightIsVisible( const viewDef_t *viewDef, const idRenderLightLocal *light );
void R_MaskedOcclusionCulling_Shutdown( void );
// performs radius cull first, then corner cull
bool R_CullLocalBox( const idBounds &bounds, const float modelMatrix[16], int numPlanes, const idPlane *planes );
@@ -1195,7 +1201,8 @@ void R_AddDrawSurf( const srfTriangles_t *tri, const viewEntity_t *space, const
void R_LinkLightSurf( const drawSurf_t **link, const srfTriangles_t *tri, const viewEntity_t *space,
const idRenderLightLocal *light, const idMaterial *shader, const idScreenRect &scissor, bool viewInsideShadow );
bool R_CreateAmbientCache( srfTriangles_t *tri, bool needsLighting );
bool R_CreateAmbientCache( srfTriangles_t *tri, bool needsLighting, bool staticCache = true );
bool R_CreateIndexCache( srfTriangles_t *tri );
bool R_CreateLightingCache( const idRenderEntityLocal *ent, const idRenderLightLocal *light, srfTriangles_t *tri );
void R_CreatePrivateShadowCache( srfTriangles_t *tri );
void R_CreateVertexProgramShadowCache( srfTriangles_t *tri );