Commit Graph

24 Commits

Author SHA1 Message Date
Bill Currie 793525a50a [sw] Free alias model cache memory when clearing models
This fixes a Sys_Error when loading the level for the first demo (and
probably many other times). It was mod_numknown getting set to 0 that
triggered the issue, but that seems to be necessary for the other
renderers. I think the whole model loading and caching system needs an
overhaul as this doesn't feel quite right due to removing part of the
advantage of caching the model data.
2023-03-20 17:45:28 +09:00
Bill Currie 9ad4f57348 [glsl] Fix a pile of memory leaks
For the most part harmless, but fixing the leaks has been uncovering
bugs.
2023-03-05 18:31:30 +09:00
Bill Currie a28488d2e1 [vulkan] Move both alias color maps into the one layer
This cuts down on the memory requirements for skins by 25%, and
simplifies the shader a bit more, too. While at it, I made alias skins
nominally compatible with bsp textures: layer 0 is color, 1 is emissive,
and 2 is the color map (emissive was on 3).
2022-11-15 13:09:41 +09:00
Bill Currie c86cb0ac54 [renderer] Clean up some unwanted dependencies
Nothing outside of the renderer should be including d_iface.h (locs.c
does still for particle defines), and plugin/vid_render.h is more
independent.
2022-05-26 14:41:08 +09:00
Bill Currie aabf3e14f8 [model] Support freeing of skin data
I doubt it's enough, but it does seem to cover what's needed for glsl
(maybe not the actual textures, unsure there, but I think they're
recycled).
2022-05-12 22:46:31 +09:00
Bill Currie e40f3f4f93 [model] Make alias skin loading a batch operation
Really, this won't make all that much difference because alias models
with more than one skin are quite rare, and those with animated skin
groups are even rarer. However, for those models that do have more than
one skin, it will allow for reduced allocation overheads, and when
supported (glsl, vulkan, maybe gl), loading all the skins into an array
texture (since all skins are the same size, though external skins may
vary), but that's not implemented yet, this just wraps the old one skin
at a time code.
2022-04-04 15:38:27 +09:00
Bill Currie 5a57280aa9 [gl] Use glGenTextures to allocate texture numbers
While the scheme of using our own allocated did work just fine, fisheye
rendering uses glGenTextures which caused a texture id clash and thus
invalid operations (the cube map texture happened to be the same as the
console background texture). Sure, I could have just "fixed" the fisheye
init code, but this brings gl closer in line with glsl (which makes
extensive use of glGenTextures and glDeleteTextures). This doesn't fix
any texture leaks gl has (plenty, I imagine), but it's a step in the
right direction.
2022-03-15 13:29:05 +09:00
Bill Currie c5cfcc7bfd [sprite] Separate model and texture loading
As much as it can be since the texture data is interleaved with the
model data in the files (I guess not that bad a design for 25 years ago
with the tight memory constraints), but this paves the way for
supporting sprites in Vulkan.
2021-12-24 06:45:13 +09:00
Bill Currie ea4ac894d8 [model] Swap fullbright/top/bottom color func params
This makes them semantically compatible with memcpy.
2021-12-24 06:45:13 +09:00
Bill Currie ea72d0c60e [model] Clean up the globals for alias models 2021-02-01 21:11:45 +09:00
Bill Currie bb6c6963d2 [model] Clean up the globals around model loading
Covers only the generic load code (alias etc to follow), but this should
take care of a lot of issues in the future.
2021-02-01 14:39:00 +09:00
Bill Currie 826e650c27 [models] Do full alias skin loading
This includes base, glow and two color maps (pants and shorts).
2021-01-26 20:33:51 +09:00
Bill Currie 0f81432090 [model] Load bsp textures into vulkan
The textures for an entire model are loaded into a single memory object
with shared between multiple images.
2021-01-20 00:37:37 +09:00
Bill Currie 6e0cb7b917 [model] Isolate renderer specific texture data
This cleans up texture_t and possibly even improves locality of
reference when running through texture chains (not profiled, and not
actually the goal).
2021-01-19 13:07:31 +09:00
Bill Currie 40fc9f0000 [model] Make Mod_LoadExternalTextures private
It never really needed to be externally accessible as it has always been
gl-specific and can be called by Mod_ProcessTexture anyway.
2021-01-19 12:56:05 +09:00
Bill Currie 23a38738fc Massive whitespace cleanup.
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie c0df07b607 Enable loading of iqm models in gl.
They don't render yet, but the engine doesn't segfault.
The vertex blend indices are rewritten with blend palette indices.
2012-05-17 15:55:38 +09:00
Bill Currie 23284536b5 Move IQM freeing into common code. 2012-05-16 18:09:44 +09:00
Bill Currie 1375c3cf03 Finally, load textures for iqm :) 2012-05-15 21:08:47 +09:00
Bill Currie 26a878da48 Stub out the iqm loader. 2012-05-15 21:08:43 +09:00
Bill Currie 1d864521e9 Fix the sprite model loader for plugins. 2012-04-11 14:58:55 +09:00
Bill Currie cbdbfdd12f Fix the alias model loader for plugins. 2012-04-11 14:58:55 +09:00
Bill Currie 52e518bb1b Fix skin functions for plugins. 2012-04-11 14:58:55 +09:00
Bill Currie 8530959752 Link the model libs to the render plugins. 2012-04-11 14:58:53 +09:00