[sw] Take advantage of the ECS for edge rendering

This fixes the segfault due to the world entity not actually existing,
without adding a world entity. It takes advantage of the ECS in that the
edge renderer needs only the world matrix, brush model pointer, and the
animation frame number (which is just 0/1 for brush models), thus the
inherent SOA of ECS helps out, though benchmarking is needed to see if
it made any real difference.

With this, all 4 renderers are working again.
This commit is contained in:
Bill Currie 2022-10-25 19:36:09 +09:00
parent 2a9fcf4f5f
commit 20c861027e
18 changed files with 168 additions and 82 deletions

View file

@ -99,7 +99,7 @@ typedef struct surf_s {
// start)
int flags; // currentface flags
void *data; // associated data like msurface_t
entity_t entity;
uint32_t render_id;
float nearzi; // nearest 1/z on surface, for mipmapping
qboolean insubmodel;
float d_ziorigin, d_zistepu, d_zistepv;
@ -163,4 +163,6 @@ typedef struct edge_s
extern float r_avertexnormals[NUMVERTEXNORMALS][3];
extern vec3_t ambientcolor;
uint32_t SW_AddEntity (entity_t ent);
#endif // _R_SHARED_H