[renderer] Allow render config to be specified

The config is a pre-parsed property list. Currently unsupported by
anything but Vulkan (but only a warning is given, not a hard error at
this stage), and Vulkan doesn't use it yet.
This commit is contained in:
Bill Currie 2024-01-28 12:59:46 +09:00
parent db46dc8a55
commit f5e39ba263
11 changed files with 24 additions and 15 deletions

View file

@ -117,7 +117,7 @@ typedef struct vid_render_funcs_s {
struct psystem_s *(*ParticleSystem) (void); struct psystem_s *(*ParticleSystem) (void);
struct psystem_s *(*TrailSystem) (void); struct psystem_s *(*TrailSystem) (void);
void (*R_Init) (void); void (*R_Init) (struct plitem_s *config);
void (*R_ClearState) (void); void (*R_ClearState) (void);
void (*R_LoadSkys) (const char *); void (*R_LoadSkys) (const char *);
void (*R_NewScene) (struct scene_s *scene); void (*R_NewScene) (struct scene_s *scene);

View file

@ -187,7 +187,8 @@ typedef struct {
extern struct texture_s *r_notexture_mip; extern struct texture_s *r_notexture_mip;
void R_Init (void); struct plitem_s;
void R_Init (struct plitem_s *config);
struct vid_internal_s; struct vid_internal_s;
void R_LoadModule (struct vid_internal_s *vid_internal); void R_LoadModule (struct vid_internal_s *vid_internal);
struct progs_s; struct progs_s;
@ -195,7 +196,6 @@ void R_Progs_Init (struct progs_s *pr);
void Fog_Update (float density, float red, float green, float blue, void Fog_Update (float density, float red, float green, float blue,
float time); float time);
struct plitem_s;
void Fog_ParseWorldspawn (struct plitem_s *worldspawn); void Fog_ParseWorldspawn (struct plitem_s *worldspawn);
vec4f_t Fog_Get (void) __attribute__((pure)); vec4f_t Fog_Get (void) __attribute__((pure));

View file

@ -27,10 +27,10 @@ extern int r_viewsize;
void R_LineGraph (int x, int y, int *h_vals, int count, int height); void R_LineGraph (int x, int y, int *h_vals, int count, int height);
void gl_R_Init (void); void gl_R_Init (struct plitem_s *config);
void glsl_R_Init (void); void glsl_R_Init (struct plitem_s *config);
void glsl_R_Shutdown (void); void glsl_R_Shutdown (void);
void sw_R_Init (void); void sw_R_Init (struct plitem_s *config);
void R_RenderFrame (SCR_Func *scr_funcs); void R_RenderFrame (SCR_Func *scr_funcs);
void R_Init_Cvars (void); void R_Init_Cvars (void);
void R_InitEfrags (void); void R_InitEfrags (void);

View file

@ -115,8 +115,11 @@ gl_R_TimeRefresh_f (void)
} }
void void
gl_R_Init (void) gl_R_Init (struct plitem_s *config)
{ {
if (config) {
Sys_Printf (ONG"WARNING"DFL": gl_R_Init: render config ignored\n");
}
r_notexture_mip->render = &gl_notexture; r_notexture_mip->render = &gl_notexture;
R_Init_Cvars (); R_Init_Cvars ();

View file

@ -174,8 +174,11 @@ glsl_R_TimeRefresh_f (void)
} }
void void
glsl_R_Init (void) glsl_R_Init (struct plitem_s *config)
{ {
if (config) {
Sys_Printf (ONG"WARNING"DFL": glsl_R_Init: render config ignored\n");
}
Cmd_AddCommand ("timerefresh", glsl_R_TimeRefresh_f, Cmd_AddCommand ("timerefresh", glsl_R_TimeRefresh_f,
"Test the current refresh rate for the current location."); "Test the current refresh rate for the current location.");
R_Init_Cvars (); R_Init_Cvars ();

View file

@ -101,10 +101,10 @@ R_LoadModule (vid_internal_t *vid_internal)
} }
VISIBLE void VISIBLE void
R_Init (void) R_Init (struct plitem_s *config)
{ {
qfZoneScoped (true); qfZoneScoped (true);
r_funcs->R_Init (); r_funcs->R_Init (config);
R_ClearEfrags (); //FIXME force link of r_efrag.o for qwaq R_ClearEfrags (); //FIXME force link of r_efrag.o for qwaq
Fog_Init (); Fog_Init ();
R_Trails_Init (); R_Trails_Init ();

View file

@ -105,8 +105,11 @@ float r_viewmatrix[3][4];
float r_aliastransition, r_resfudge; float r_aliastransition, r_resfudge;
void void
sw_R_Init (void) sw_R_Init (struct plitem_s *config)
{ {
if (config) {
Sys_Printf (ONG"WARNING"DFL": sw_R_Init: render config ignored\n");
}
int dummy; int dummy;
// get stack position so we can guess if we are going to overflow // get stack position so we can guess if we are going to overflow

View file

@ -90,7 +90,7 @@ vulkan_ParticleSystem (void)
} }
static void static void
vulkan_R_Init (void) vulkan_R_Init (struct plitem_s *config)
{ {
QFV_Render_Init (vulkan_ctx); QFV_Render_Init (vulkan_ctx);

View file

@ -735,7 +735,7 @@ CL_Init (cbuf_t *cbuf)
VID_Init (basepal, colormap); VID_Init (basepal, colormap);
IN_Init (); IN_Init ();
GIB_Key_Init (); GIB_Key_Init ();
R_Init (); R_Init (nullptr);
r_data->lightstyle = cl.lightstyle; r_data->lightstyle = cl.lightstyle;
S_Init (&cl.viewentity, &host_frametime); S_Init (&cl.viewentity, &host_frametime);
Font_Init (); //FIXME not here Font_Init (); //FIXME not here

View file

@ -1472,7 +1472,7 @@ CL_Init (void)
VID_Init (basepal, colormap); VID_Init (basepal, colormap);
IN_Init (); IN_Init ();
Mod_Init (); Mod_Init ();
R_Init (); R_Init (nullptr);
r_data->lightstyle = cl.lightstyle; r_data->lightstyle = cl.lightstyle;
Font_Init (); //FIXME not here Font_Init (); //FIXME not here

View file

@ -383,7 +383,7 @@ BI_Graphics_Init (progs_t *pr)
VID_Init (default_palette[0], default_colormap); VID_Init (default_palette[0], default_colormap);
IN_Init (); IN_Init ();
Mod_Init (); Mod_Init ();
R_Init (); R_Init (nullptr);
Font_Init (); Font_Init ();
R_Progs_Init (pr); R_Progs_Init (pr);