mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-21 11:11:37 +00:00
[vulkan] Clean up some more unused bsp data
Since vulkan supports 32-bit indexes, there's no need for the shenanigans the EGL-based glsl renderer had to go through to render bsp models (maps often had quite a bit more than 65536 vertices), though the reduced GPU memory requirements of 16-bit indices does have its advantages.
This commit is contained in:
parent
924c970868
commit
6962c5948a
2 changed files with 3 additions and 12 deletions
|
@ -54,7 +54,6 @@ typedef struct elements_s {
|
||||||
typedef struct elechain_s {
|
typedef struct elechain_s {
|
||||||
struct elechain_s *_next;
|
struct elechain_s *_next;
|
||||||
struct elechain_s *next;
|
struct elechain_s *next;
|
||||||
int model_index; ///< < 0: instance, 0 main, > 0: sub
|
|
||||||
elements_t *elements;
|
elements_t *elements;
|
||||||
vec_t *transform;
|
vec_t *transform;
|
||||||
float *color;
|
float *color;
|
||||||
|
|
|
@ -305,13 +305,12 @@ Vulkan_RegisterTextures (model_t **models, int num_models, vulkan_ctx_t *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
static elechain_t *
|
static elechain_t *
|
||||||
add_elechain (vulktex_t *tex, int model_index, bspctx_t *bctx)
|
add_elechain (vulktex_t *tex, bspctx_t *bctx)
|
||||||
{
|
{
|
||||||
elechain_t *ec;
|
elechain_t *ec;
|
||||||
|
|
||||||
ec = get_elechain (bctx);
|
ec = get_elechain (bctx);
|
||||||
ec->elements = get_elements (bctx);
|
ec->elements = get_elements (bctx);
|
||||||
ec->model_index = model_index;
|
|
||||||
ec->transform = 0;
|
ec->transform = 0;
|
||||||
ec->color = 0;
|
ec->color = 0;
|
||||||
*tex->elechain_tail = ec;
|
*tex->elechain_tail = ec;
|
||||||
|
@ -505,18 +504,11 @@ Vulkan_BuildDisplayLists (model_t **models, int num_models, vulkan_ctx_t *ctx)
|
||||||
for (size_t i = 0; i < bctx->texture_chains.size; i++) {
|
for (size_t i = 0; i < bctx->texture_chains.size; i++) {
|
||||||
vulktex_t *tex;
|
vulktex_t *tex;
|
||||||
instsurf_t *is;
|
instsurf_t *is;
|
||||||
elechain_t *ec = 0;
|
|
||||||
|
|
||||||
tex = bctx->texture_chains.a[i];
|
tex = bctx->texture_chains.a[i];
|
||||||
|
|
||||||
for (is = tex->tex_chain; is; is = is->tex_chain) {
|
for (is = tex->tex_chain; is; is = is->tex_chain) {
|
||||||
msurface_t *surf = is->surface;
|
msurface_t *surf = is->surface;
|
||||||
if (!tex->elechain) {
|
|
||||||
ec = add_elechain (tex, surf->model_index, bctx);
|
|
||||||
}
|
|
||||||
if (surf->model_index != ec->model_index) { // next sub-model
|
|
||||||
ec = add_elechain (tex, surf->model_index, bctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
surf->polys = (glpoly_t *) poly;
|
surf->polys = (glpoly_t *) poly;
|
||||||
poly = build_surf_displist (models, surf, vertex_index_base,
|
poly = build_surf_displist (models, surf, vertex_index_base,
|
||||||
|
@ -1056,14 +1048,14 @@ add_surf_elements (vulktex_t *tex, instsurf_t *is,
|
||||||
bsppoly_t *poly = (bsppoly_t *) surf->polys;
|
bsppoly_t *poly = (bsppoly_t *) surf->polys;
|
||||||
|
|
||||||
if (!tex->elechain) {
|
if (!tex->elechain) {
|
||||||
(*ec) = add_elechain (tex, surf->model_index, bctx);
|
(*ec) = add_elechain (tex, bctx);
|
||||||
(*ec)->transform = is->transform;
|
(*ec)->transform = is->transform;
|
||||||
(*ec)->color = is->color;
|
(*ec)->color = is->color;
|
||||||
(*el) = (*ec)->elements;
|
(*el) = (*ec)->elements;
|
||||||
(*el)->first_index = bframe->index_count;
|
(*el)->first_index = bframe->index_count;
|
||||||
}
|
}
|
||||||
if (is->transform != (*ec)->transform || is->color != (*ec)->color) {
|
if (is->transform != (*ec)->transform || is->color != (*ec)->color) {
|
||||||
(*ec) = add_elechain (tex, surf->model_index, bctx);
|
(*ec) = add_elechain (tex, bctx);
|
||||||
(*ec)->transform = is->transform;
|
(*ec)->transform = is->transform;
|
||||||
(*ec)->color = is->color;
|
(*ec)->color = is->color;
|
||||||
(*el) = (*ec)->elements;
|
(*el) = (*ec)->elements;
|
||||||
|
|
Loading…
Reference in a new issue