2021-01-19 16:25:54 +00:00
|
|
|
/*
|
|
|
|
vulkan_main.c
|
|
|
|
|
|
|
|
Vulkan rendering
|
|
|
|
|
|
|
|
Copyright (C) 2021 Bill Currie <bill@taniwha.org>
|
|
|
|
|
|
|
|
Author: Bill Currie <bill@taniwha.org>
|
|
|
|
Date: 2021/1/19
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
# include "string.h"
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_STRINGS_H
|
|
|
|
# include "strings.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "QF/cmd.h"
|
|
|
|
#include "QF/cvar.h"
|
|
|
|
#include "QF/image.h"
|
|
|
|
#include "QF/render.h"
|
|
|
|
#include "QF/screen.h"
|
|
|
|
#include "QF/sys.h"
|
|
|
|
|
2022-03-04 16:48:10 +00:00
|
|
|
#include "QF/scene/entity.h"
|
|
|
|
|
2021-01-26 11:58:24 +00:00
|
|
|
#include "QF/Vulkan/qf_alias.h"
|
2021-01-19 16:25:54 +00:00
|
|
|
#include "QF/Vulkan/qf_bsp.h"
|
2022-05-31 01:41:19 +00:00
|
|
|
#include "QF/Vulkan/qf_compose.h"
|
2022-05-07 01:08:46 +00:00
|
|
|
#include "QF/Vulkan/qf_iqm.h"
|
2021-03-03 09:14:16 +00:00
|
|
|
#include "QF/Vulkan/qf_lighting.h"
|
2021-01-19 16:25:54 +00:00
|
|
|
#include "QF/Vulkan/qf_lightmap.h"
|
|
|
|
#include "QF/Vulkan/qf_main.h"
|
2022-05-31 01:41:19 +00:00
|
|
|
#include "QF/Vulkan/qf_matrices.h"
|
2022-11-25 02:07:08 +00:00
|
|
|
#include "QF/Vulkan/qf_output.h"
|
2021-01-19 16:25:54 +00:00
|
|
|
#include "QF/Vulkan/qf_particles.h"
|
2022-05-25 04:29:11 +00:00
|
|
|
#include "QF/Vulkan/qf_scene.h"
|
2021-12-14 16:22:05 +00:00
|
|
|
#include "QF/Vulkan/qf_sprite.h"
|
2022-11-30 18:00:47 +00:00
|
|
|
#include "QF/Vulkan/qf_translucent.h"
|
2022-05-31 01:41:19 +00:00
|
|
|
#include "QF/Vulkan/qf_vid.h"
|
|
|
|
#include "QF/Vulkan/swapchain.h"
|
2021-01-19 16:25:54 +00:00
|
|
|
|
|
|
|
#include "mod_internal.h"
|
|
|
|
#include "r_internal.h"
|
|
|
|
#include "vid_vulkan.h"
|
|
|
|
|
|
|
|
void
|
2022-05-05 05:41:46 +00:00
|
|
|
Vulkan_NewScene (scene_t *scene, vulkan_ctx_t *ctx)
|
2021-01-19 16:25:54 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 256; i++) {
|
|
|
|
d_lightstylevalue[i] = 264; // normal light value
|
|
|
|
}
|
|
|
|
|
2022-05-05 05:41:46 +00:00
|
|
|
r_refdef.worldmodel = scene->worldmodel;
|
2023-06-22 11:27:55 +00:00
|
|
|
EntQueue_Clear (r_ent_queue);
|
2021-01-19 16:25:54 +00:00
|
|
|
|
2021-12-19 04:08:39 +00:00
|
|
|
R_ClearParticles ();
|
2022-05-05 05:41:46 +00:00
|
|
|
Vulkan_RegisterTextures (scene->models, scene->num_models, ctx);
|
|
|
|
//Vulkan_BuildLightmaps (scene->models, scene->num_models, ctx);
|
|
|
|
Vulkan_BuildDisplayLists (scene->models, scene->num_models, ctx);
|
2022-05-05 05:58:47 +00:00
|
|
|
Vulkan_LoadLights (scene, ctx);
|
2021-01-19 16:25:54 +00:00
|
|
|
}
|