Commit Graph

134 Commits

Author SHA1 Message Date
Bill Currie ca63c0360a Do an audit of hunk mark usage
I realized that after making the hunk 64-bit clean, I had forgotten to
go through and convert all the saved marks to size_t.
2021-07-29 11:43:27 +09:00
Bill Currie 54604d9aa2 [util] Make hunk (optionally) thread-safe
For now, the functions check for a null hunk pointer and use the global
hunk (initialized via Memory_Init) if necessary. However, Hunk_Init is
available (and used by Memory_Init) to create a hunk from any arbitrary
memory block. So long as that block is 64-byte aligned, allocations
within the hunk will remain 64-byte aligned.
2021-07-29 11:43:27 +09:00
Bill Currie 785be9d340 [vulkan] Clean up buffer barriers a bit
This even fixes a couple of minor issues that snuck past validation.
2021-04-24 15:47:31 +09:00
Bill Currie dc9b64fadd [vulkan] Clean up image barriers a bit
Mostly, this gets the stage flags in with the barrier, but also adds a
couple more barrier templates. It should make for slightly less verbose
code, and one less opportunity for error (mismatched barrier/stages).
2021-04-24 12:42:29 +09:00
Bill Currie e2f545eb23 [vulkan] Wait on device idle before deleting models
This fixes the textures (and presumably mesh data) being deleted while
still in use. Oddly, the wait was needed in both brush and alias models
(I expected brush to always come first).
2021-04-03 01:14:44 +09:00
Bill Currie 6e9ee98e88 [models] Add floodfill.c to the vulkan alias lib
Many thanks to JohnnyonFlame for his testing on a different system.
2021-04-03 00:16:25 +09:00
Bill Currie 5f93c115ff [util] Make developer flag names easier to manage
They're now an enum, and the flag part of the name is all lowercase, but
now the flag definitions and names list will never get out of sync.
2021-03-29 22:38:47 +09:00
Bill Currie cc4167668c Fix a pile of leaks and uninit errors
Still "some" more to go: a pile to do with transforms and temporary
entities, and a nasty one with host_cbuf. There's also all the static
block-alloc lists :/
2021-03-21 19:56:17 +09:00
Bill Currie d6b678ac78 [vulkan] Implement team colors
It's not quite as expected, but that may be due to one of msaa, the 0-15
range in the palette not being all the way to white, the color gradients
being not quite linear (haven't checked yet) or some combination of the
above. However, it's that what should be yellow is more green. At least
the zombies are no longer white and the ogres don't look like they're
wearing skeleton suits.
2021-02-02 19:53:36 +09:00
Bill Currie 8e63ab9f94 [vulkan] Use 4 layer arrays for alias skins
Doesn't seem to make much difference performance-wise, but speed does
seem to be fill-rate limited due to the 8x msaa. Still, it does mean
fewer bindings to worry about.
2021-02-02 00:11:47 +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 eeda04e3c9 [vulkan] Name most resources
This makes debugging with renderdoc and validation messages much easier
(no more "what buffer is that?").
2021-01-31 19:58:55 +09:00
Bill Currie 7970525ef4 [util] Make va thread-safe
It now takes a context pointer (opaque data) that holds the buffers it
uses for the temporary strings. If the context pointer is null, a static
context is used (making those uses of va NOT thread-safe). Most calls to
va use the static context, but all such calls have been formatted
consistently so they are easy to find when it comes time to do a full
audit.
2021-01-31 16:05:48 +09:00
Bill Currie 28652c4d59 [vulkan] Implement alias model texturing
I had messed up my index array creation, but once that was fixed the
textures worked well other than a lot of pixels are shades of grey due
to being in the top or bottom color map range.
2021-01-28 14:14:21 +09:00
Bill Currie 4da8feca36 [models] Fix some vulkan alias upload errors
Fixes the bogus vertex/index data and does barriers for all three
buffers.
2021-01-27 16:13:37 +09:00
Bill Currie a64f477796 [vulkan] Get alias texture loading working
That was a mess, partly premature optimizations, and some silly
mistakes.
2021-01-27 12:15:45 +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 69a8b984a5 [vulkan] Sort out alias model load and unload 2021-01-26 13:59:15 +09:00
Bill Currie 57968249fe [vulkan] Start work on the alias pipeline 2021-01-26 10:20:50 +09:00
Bill Currie d8b81e8678 [models] Remove MAXALIASFRAMES
The dynamic array macros made this much easier than last time I looked
at it, especially when it came to figuring out the bad memory accesses
that I seem to remember from my last attempt 9 years ago.
2021-01-25 13:33:42 +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 7a353d5aee [model] Build vulkan model libs
The contents are currently empty (required .c files), but this gets the
build system updated.
2021-01-19 14:12:49 +09:00
Bill Currie e50430e00c [image] Add parameter to load only the header
I want to be able to calculate texture sizes without actually loading
the images.
2021-01-19 10:15:57 +09:00
Bill Currie dacda50130 [renderer] Stub out all the vulkan functions
nq-x11 now gets through all three demos without crashing (but without
rendering anything useful, though).
2021-01-18 12:46:06 +09:00
Bill Currie ab04a1915e [build] Fix a pile of gcc 10 issues
gcc got stricter about array accesses, complicating progs macros, and
much better at detecting buffer overflows.
2020-12-21 14:14:29 +09:00
Bill Currie 6d5ffa9f8e [build] Move to non-recursive make
There's still some cleanup to do, but everything seems to be working
nicely: `make -j` works, `make distcheck` passes. There is probably
plenty of bitrot in the package directories (RPM, debian), though.

The vc project files have been removed since those versions are way out
of date and quakeforge is pretty much dependent on gcc now anyway.

Most of the old Makefile.am files  are now Makemodule.am.  This should
allow for new Makefile.am files that allow local building (to be added
on an as-needed bases).  The current remaining Makefile.am files are for
standalone sub-projects.a

The installable bins are currently built in the top-level build
directory. This may change if the clutter gets to be too much.

While this does make a noticeable difference in build times, the main
reason for the switch was to take care of the growing dependency issues:
now it's possible to build tools for code generation (eg, using qfcc and
ruamoko programs for code-gen).
2020-06-25 11:35:37 +09:00
Bill Currie 4f58429137 Fix an unhealthy pile of gcc 8 warnings.
While some of the warnings were merely annoying, some where actual bugs or
unearthed bugs in related code.
2018-08-20 00:05:00 +09:00
Bill Currie 3efb0c538f Separate file search from loading.
QFS_LoadFile (and its wrappers) now  take a file handle rather than a
path. This will make vpath usage a little cleaner to implement.
2014-01-28 16:22:05 +09:00
Bill Currie f5501fbf24 Fix a pile of automake deprecation warnings.
s/INCLUDES/AM_CPPFLAGS/g

I <3 sed :)
2013-11-24 13:11:50 +09:00
Bill Currie 31dead3dcd Fix 16-bit mdl loading for glsl.
The extra precision verts are offset by numverts, not numposes :P
2012-08-07 17:06:01 +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 95cef4a73e Correct a spelling error. 2012-04-24 14:12:54 +09:00
Bill Currie bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +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 d445b4ef88 Rename the glsl qfgl functions to qfegl.
Keep them separate from the gl renderer :)
2012-04-11 14:58:54 +09:00
Bill Currie 8530959752 Link the model libs to the render plugins. 2012-04-11 14:58:53 +09:00
Bill Currie ef37ed39a9 Clean up global symbols for the glsl renderer.
Where possible, symbols have been made static, prefixed with glsl_/GLSL_ or
moved into the code shared by all renderers. This will make doing plugins
easier but done now for link testing. The moving was done via the gl
commit.
2012-02-18 11:48:52 +09:00
Bill Currie 4707706f5d Use QF_NEED for the renderer and model libraries.
This breaks RPM building, but I can fix that later.
2012-02-10 13:29:45 +09:00
Bill Currie 497718cc40 Plug the memory/texture/vbo leaks.
QF still leaks about 3MB/run on demo1, but even 100 runs didn't show any
render issues.
2012-01-29 22:32:35 +09:00
Bill Currie 5dcaeae97b Fix custom skins in GL for QW. 2012-01-26 12:50:37 +09:00
Bill Currie df87cffe15 Start working on the new GL skin code. 2012-01-24 23:06:07 +09:00
Bill Currie 3669e3aa2e Make alias model caching optional.
For now, only the glsl loader disables caching, but it stores the frame
vertices in GL memory, so its hunk usage is relatively lower (and will be
lower still when I get skins sorted out).
2012-01-17 19:31:50 +09:00
Bill Currie fb428f8067 Rename mod_flood.c to floodfill.c 2012-01-17 19:31:50 +09:00
Bill Currie 6f18035c12 Fix up alias-16 support.
After getting in contact with serplord, I now know that the sw alias
loading was correct. Turns out the gl loaders was mostly correct, just a
mistaken subtract rather than add. And with that, I can implement alias-16
support in glsl. better yet, since all the work is done in the loader, the
renderer doesn't know anything about it :) However, I need to create some
16-bit models for testing.
2012-01-05 12:52:12 +09:00
Bill Currie add5440ad1 Upload the normals with the vertex data.
Not all hardware can access a texture sampler from the vertex shader, and I
don't want multiple paths this early in the game. Now, vertex normals are
uploaded as shorts. Should be 14 bytes per vertex (was 10, could have been
8 if I had put the normal index with the vertex rather than st).
2012-01-04 09:42:00 +09:00
Bill Currie 2a3151cecd Hook in alias model drawing.
Nothing is visible yet.
2012-01-02 20:28:40 +09:00
Bill Currie 540bccbc27 Load all the alias vertex data as bytes.
I had forgotten I wanted to do it this way.
2012-01-02 13:41:12 +09:00
Bill Currie 2ad5aa7aed Unbind the array and element array buffers when done.
Not doing so wreaked havoc on my 2d rendering (what's he doing here, and
why's he messing with my redering? ;)
2012-01-02 10:08:56 +09:00