[model] Initialize r_notexture_mip in the right places

That being in the renderer. This is why qwaq needed that call to
Mod_ProcessTexture (but no longer does :)
This commit is contained in:
Bill Currie 2022-05-05 21:22:44 +09:00
parent 41a12f066b
commit 2818fc12a5
6 changed files with 11 additions and 9 deletions

View file

@ -52,8 +52,6 @@
#include "mod_internal.h"
#include "r_internal.h"
static gltex_t gl_notexture = { };
static tex_t *
Mod_LoadAnExternalTexture (const char *tname, const char *mname)
{
@ -122,7 +120,6 @@ gl_Mod_ProcessTexture (model_t *mod, texture_t *tx)
const char *name;
if (!tx) {
r_notexture_mip->render = &gl_notexture;
return;
}
if (gl_textures_external) {

View file

@ -60,8 +60,6 @@
#include "mod_internal.h"
#include "r_internal.h"
static glsltex_t glsl_notexture = { };
static void
glsl_brush_clear (model_t *m, void *data)
{
@ -105,7 +103,6 @@ void
glsl_Mod_ProcessTexture (model_t *mod, texture_t *tx)
{
if (!tx) {
r_notexture_mip->render = &glsl_notexture;
return;
}
glsltex_t *tex = tx->render;

View file

@ -62,8 +62,6 @@
#include "r_internal.h"
#include "vid_vulkan.h"
static vulktex_t vulkan_notexture = { };
static void
vulkan_brush_clear (model_t *mod, void *data)
{
@ -302,7 +300,6 @@ Vulkan_Mod_ProcessTexture (model_t *mod, texture_t *tx, vulkan_ctx_t *ctx)
mod->clear = vulkan_brush_clear;
mod->data = mctx;
r_notexture_mip->render = &vulkan_notexture;
if (mod->brush.numtextures) {
load_textures (mod, ctx);
}

View file

@ -73,6 +73,8 @@
#include "varrays.h"
#include "vid_gl.h"
static gltex_t gl_notexture = { };
static void
gl_R_LoadSky_f (void)
{
@ -115,6 +117,8 @@ gl_R_TimeRefresh_f (void)
void
gl_R_Init (void)
{
r_notexture_mip->render = &gl_notexture;
R_Init_Cvars ();
Cmd_AddCommand ("timerefresh", gl_R_TimeRefresh_f,

View file

@ -103,6 +103,7 @@ static double sky_time;
static quat_t default_color = { 1, 1, 1, 1 };
static quat_t last_color;
static glsltex_t glsl_notexture = { };
static const char *bsp_vert_effects[] =
{
@ -1282,6 +1283,8 @@ glsl_R_InitBsp (void)
int vert;
int frag;
r_notexture_mip->render = &glsl_notexture;
vert_shader = GLSL_BuildShader (bsp_vert_effects);
frag_shader = GLSL_BuildShader (bsp_lit_effects);
vert = GLSL_CompileShader ("quakebsp.vert", vert_shader,

View file

@ -98,6 +98,8 @@ static float identity[] = {
0, 0, 0, 1,
};
static vulktex_t vulkan_notexture = { };
#define ALLOC_CHUNK 64
typedef struct bsppoly_s {
@ -1342,6 +1344,8 @@ Vulkan_Bsp_Init (vulkan_ctx_t *ctx)
{
qfv_device_t *device = ctx->device;
r_notexture_mip->render = &vulkan_notexture;
qfvPushDebug (ctx, "bsp init");
bspctx_t *bctx = calloc (1, sizeof (bspctx_t));