From 2d67bcacd75845d8ddf8ae59517b20ee4259e813 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 2 Apr 2021 08:46:22 +0900 Subject: [PATCH] [vulkan] Use cleaner bsp glow texture handling It was always a bit of a hack, and it didn't work for 32-bit builds. --- include/r_internal.h | 1 + libs/models/brush/vulkan_model_brush.c | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/r_internal.h b/include/r_internal.h index 89a8d9cb4..58a4e7599 100644 --- a/include/r_internal.h +++ b/include/r_internal.h @@ -35,6 +35,7 @@ typedef struct vulktex_s { struct elechain_s **elechain_tail; struct qfv_tex_s *tex; struct qfv_tex_s *glow; + byte *glow_pixels; } vulktex_t; extern viddef_t vid; // global video state diff --git a/libs/models/brush/vulkan_model_brush.c b/libs/models/brush/vulkan_model_brush.c index 9527a2abe..711027b7c 100644 --- a/libs/models/brush/vulkan_model_brush.c +++ b/libs/models/brush/vulkan_model_brush.c @@ -236,7 +236,7 @@ load_textures (model_t *mod, vulkan_ctx_t *ctx) va (ctx->va_ctx, "iview:%s:%s:tex", mod->name, tx->name)); transfer_mips (buffer + tex->tex->offset, tx + 1, tx, palette); - if (tex->glow) { + if (tex->glow_pixels) { dfunc->vkBindImageMemory (device->dev, tex->glow->image, mem, tex->glow->offset); // skys are unlit so never have a glow texture thus glow @@ -249,7 +249,7 @@ load_textures (model_t *mod, vulkan_ctx_t *ctx) tex->glow->view, va (ctx->va_ctx, "iview:%s:%s:glow", mod->name, tx->name)); - transfer_mips (buffer + tex->glow->offset, tex->glow->memory, tx, + transfer_mips (buffer + tex->glow->offset, tex->glow_pixels, tx, palette); } } @@ -380,10 +380,7 @@ Vulkan_Mod_ProcessTexture (model_t *mod, texture_t *tx, vulkan_ctx_t *ctx) tex->glow->image, va (ctx->va_ctx, "image:%s:%s:glow", mod->name, tx->name)); - // store the pointer to the fullbright data: memory will never be set to - // actual device memory because all of the textures will be loaded in one - // big buffer - tex->glow->memory = (VkDeviceMemory) pixels; + tex->glow_pixels = pixels; } void