[vulkan] Use cleaner bsp glow texture handling

It was always a bit of a hack, and it didn't work for 32-bit builds.
This commit is contained in:
Bill Currie 2021-04-02 08:46:22 +09:00
parent b2ec1aaf37
commit 2d67bcacd7
2 changed files with 4 additions and 6 deletions

View file

@ -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

View file

@ -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