1
0
forked from 0ad/0ad
Commit Graph

48 Commits

Author SHA1 Message Date
6d4fd01a59 Separates allocated vertex buffers into groups for data locality.
Tested By: Langbart, OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D3522
This was SVN commit r24860.
2021-02-08 22:34:10 +00:00
5eb7fba3bd Further VertexBuffer improvements after b3cbee6ba9.
Chunk merging is based on patch D2528 by @dm.

This was SVN commit r24835.
2021-02-04 23:48:30 +00:00
b3cbee6ba9 Performance improvements to VertexBuffer.
Patch By: dm
Tested By: OptimusShepard, Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D2528
This was SVN commit r24834.
2021-02-04 23:26:37 +00:00
417c84870c Actually remove trailing tabs from source/.
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
fb92761c92 Use explicit types instead of auto.
This was SVN commit r17642.
2016-01-13 00:42:55 +00:00
b6bcfdbb2e Fixes missing newlines in debug_printf, patch by elexis, fixes #3056
This was SVN commit r16534.
2015-04-12 19:38:31 +00:00
e06a7b37d8 Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.

Fixes #3021.

This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
bb99c42aa5 Increase max VBO size back to 4MB.
Some meshes (e.g. pers_gardens_struct with gentangents enabled) have
>32K vertexes, and won't fit in a 2MB VBO. 0ef6c7555e had reduced them
from 4MB to 2MB. So just make the VBOs bigger again, and try not to
worry about the waste of memory.

Fixes #3026, #3042.

This was SVN commit r16309.
2015-02-08 23:39:02 +00:00
0ef6c7555e Optimise VBO updates.
Some drivers (at least the Intel drivers on Windows) are slow at
incrementally updating a VBO with hundreds of calls to glBufferSubData
every frame. Performance is significantly better if you use
glBufferData(NULL) to tell it to discard all the previous contents, and
then re-upload all the data at once.

Update CVertexBuffer so that GL_DYNAMIC_DRAW/GL_STREAM_DRAW buffers are
handled with the new mechanism. This requires the caller to hold onto
the backing store so it can be re-uploaded when necessary, and needs a
bit more signalling to indicate exactly what needs uploading.

I see an improvement from roughly 60 to 75 fps on Intel HD Graphics
3000, Windows, 1024x768, Siwa Oasis.

This was SVN commit r16241.
2015-01-28 00:48:00 +00:00
17bb997e0e Fixes memory leak in CVertexBuffer::Release, patch by Markus, fixes #1933
This was SVN commit r13423.
2013-05-23 23:16:36 +00:00
vts
34fc883317 Pretty unit selection overlay rings. Fixes #824.
This was SVN commit r11623.
2012-04-22 04:04:02 +00:00
fbff0aa98d Fix printf argument types
This was SVN commit r10529.
2011-11-13 18:31:06 +00:00
8fee3d8ef8 # New territory border rendering.
Add textured line overlay rendering.
Change terrain height calculations to be triangulation-dependent for
improved accuracy.
Add triangulation-dependent terrain normal function.
Support separate S/T wrap modes for textures.
Rename CVector2D_Maths since it no longer conflicts with simulation
CVector2D.
Coalesce freed chunks in vertex buffers, to avoid excessive
fragmentation.
Add some things to help debug vertex buffer allocation a little.

This was SVN commit r9929.
2011-07-30 00:56:45 +00:00
4663ac0fe7 split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows
down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new
ASSERT behaves like assert and ENSURE like the old debug_assert. Let's
change any time-critical but not-super-important ENSURE to ASSERT to
speed up release builds. (already done in bits.h and unique_range.h)

This was SVN commit r9362.
2011-04-30 13:01:45 +00:00
fc2c54c39f # Optimise terrain renderer.
Batch patch splats by texture match.
Use VBOs for patch indices.
Fixes #722.

This was SVN commit r9053.
2011-03-13 19:06:33 +00:00
2f28b07356 Support storing index data in VBOs.
Use index VBOs in model renderers, for performance.
Be more explicit about static/dynamic VBOs.
Add VBO usage to renderer stats.
Clean up some obsolete unused code.

This was SVN commit r9052.
2011-03-13 18:58:09 +00:00
52851faeb6 cleanup - remove old cpu_memcpy and cpu_i64FromDouble that are no longer needed
This was SVN commit r8517.
2010-11-01 11:09:03 +00:00
7dca91f26b # Various changes to the text rendering system.
Rewrite font builder tool to be much simpler and to support more text
effects.
Change GUI to use new set of fonts.
Switch font textures from TGA to PNG so they're easier for the font
builder to create.
Support RGBA font textures (for e.g. stroked text).
Greatly improve text rendering performance by using vertex arrays.
Fix rendering code leaving vertex buffers bound.
Add 'clip' property to GUI text objects, to disable clipping when
rendering.
Delete part of unused console function registration system.

This was SVN commit r7595.
2010-05-30 13:42:56 +00:00
7c2e9027c2 # Rewrite of the game's simulation system
Giant merge from
http://svn.wildfiregames.com/hg-source/file/5fb522019d5e
Infrastructure is largely complete, gameplay is largely missing
Disabled by default; use command-line flag "-sim2"
(Second attempt at commit...)

This was SVN commit r7259.
2010-01-09 19:20:14 +00:00
1743645fd3 Simplify the overly-complex CppDoc-breaking file headers
This was SVN commit r6832.
2009-04-18 17:51:05 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
73683b6109 # SwEng
. the massive renaming undertaking: camelCase functions -> PascalCase.
. add some cppdoc.
. minor additional renaming improvements: e.g. GetIsClosed -> IsClosed
. in entity code, replace constructs like "pvec = new vector; return
pvec; use *pvec; delete pvec" with a simple stack variable passed as
output parameter (avoid unnecessary dynamic allocs)
. timer: simpler handling of raw ticks vs normal timer (less #if)

This was SVN commit r5017.
2007-05-02 12:07:08 +00:00
623e649acb # big refactoring in CPU-specific code, fix for dual core vs. HT detection
all cpu-related stuff is now defined in cpu.h (with cpu_ prefix and
fully encapsulated). fix quite brittle core/HT unit/package detection.
implement mkdir on VC8, where it is deprecated
add strdup on MacOSX
move ia32 code into separate subdir. functions implemented in asm are
called ia32_asm_*.
add some unix versions of sysdep functions (cannot test them)
timer: fix for amd64 linux

This was SVN commit r4995.
2007-04-25 18:19:35 +00:00
f4d1ad77c2 # Better error tolerance
Fail more nicely (no repeated error dialogs, no crashes) when unable to
create VBOs.

This was SVN commit r4931.
2007-02-28 20:09:19 +00:00
ee3243ff92 # Fixes for simulation speed in scenario edtior. Various code cleanups.
Game, Simulation, etc: Separated 'update' and 'interpolate', and made
'update' return whether it's going fast enough (so callers can decide to
do more updates per render). Changed some time variables to 'double' so
they have enough precision in long games.
Atlas: Added "Fast" playback button. Made simulation sometimes go at
real-time speed, if it's just slightly too slow at rendering.
VertexBuffer: Removed some non-useful glGetError calls.
Entity: Commented out redundant Tick code. Fixed syntax error in
disabled code that confused the IDE.
Aura: Changed string code again, to simply use ASCII instead of UTF-16.
(SpiderMonkey seems to handle it just as efficiently, for small
strings.)
Misc: Some more minor header-file cleanup.
SVN log: Added feed link.

This was SVN commit r4807.
2007-01-24 20:17:28 +00:00
5f7855f7f0 Simplification of #Include paths: relative names are used only for included files in the same directory as the including file; everything else uses the full path relative to source/.
This was SVN commit r3930.
2006-06-02 02:10:27 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
fcfa746244 Linux compat changes, fix for (really old) bug in VertexBufferManager shutdown, GUI header reorganization for gcc 4.0
This was SVN commit r3437.
2006-01-29 18:23:47 +00:00
20d038efda profiling indicates memcpy is a bottleneck, so globally replace all of them with memcpy2 (hand-optimized). depending on transfer size, this is 10%..300% faster. also made memcpy2 into a macro instead of thunk function because vc7 was still generating a jump.
This was SVN commit r3057.
2005-10-30 16:19:20 +00:00
501acc65f5 Extension function pointers are renamed from glXyzARB to pglXyzARB
to avoid conflicts with system header files.

This was SVN commit r3054.
2005-10-30 01:18:15 +00:00
04650efe7a Lots of gcc -Wall fixes. The common ones:
- switch() statements don't handle all values in an enum
- missing \n at end of file
- non-virtual destructors in classes containing virtual functions
- order of initializers in constructor initializer lists
... some other stuff (signedness, nested comments, unused variables) as
well.

This was SVN commit r2864.
2005-10-07 15:24:29 +00:00
a05e712319 Added VertexArray & co. classes to simplify a flexible, render path dependent
vertex array layout.
Add CModelDefRData, a per-CModelDef render data class.

This was SVN commit r2826.
2005-10-02 21:11:11 +00:00
a69ac0dee9 - fix w4 warnings
- add convenience macros for config_db(CFG_GET_SYS_VAL)
- VFSUtil::EnumDirEnts now uses flags instead of bool recursive
- UNUSED() for params, UNUSED2 (<- need better name) for variables
- config.h defines must be tested with #if (always defined) -> allows
detecting misspellings thanks to compiler warnings
- replace debug_assert(0) with debug_warn (its sole purpose)
- replace ScriptingHost::ValueToInt et al with ToPrimitive
- use nommgr.h to disable both mmgr and VC debug heap

This was SVN commit r2585.
2005-08-09 15:55:44 +00:00
ec6b78b252 rename assert2 debug_assert; use instead of all plain assert(), since there are no longer any issues (e.g. can't use while handling an exception)
This was SVN commit r2447.
2005-06-28 04:06:25 +00:00
d24fd1b0c9 Use gl*ARB wherever possible. They are mapped onto the core gl* function if the driver's version is high enough, else onto the extension's gl*ARB function.
(Just for fun, compressed texture uploads are mapped onto a
decompression function if the user's system doesn't understand S3TC
textures.)
Corrected (unless I'm wrong) GL version identification logic.

This was SVN commit r2384.
2005-06-14 03:33:16 +00:00
2077698156 New JavaScript interface for the network client, plus some linux/gcc/misc fixes
This was SVN commit r1730.
2005-01-17 04:52:02 +00:00
f7e82dbc16 add ps/Errors.h and/or lib/types.h headers (shouldn't rely on precompiled.h to pull those in).
also prepended ps/ to make location clear.

This was SVN commit r1652.
2005-01-07 00:47:44 +00:00
fe1bee706b Fixed loads of /W4 warnings, because it's easier than doing anything useful. Added some asserts to check potentially dangerous assumptions, implemented a few missing bits of code, adjusted some comments, etc.
This was SVN commit r814.
2004-07-24 14:04:40 +00:00
f171a2faf0 Fixed something that looked a bit like a bug. Added controlled crashing when VBO creation fails (though it doesn't seem to help at all).
This was SVN commit r791.
2004-07-21 11:50:23 +00:00
561299f899 Memory leak fix
This was SVN commit r565.
2004-06-19 20:54:36 +00:00
614420615e walk freelist and free the chunks (fixes mem leak)
This was SVN commit r510.
2004-06-14 16:01:38 +00:00
15ca5cbf21 newline stomper and fixed warnings
This was SVN commit r473.
2004-06-11 02:14:18 +00:00
MarkT
e4fe4ed602 JS Interface to entities. It even partially works now.
This was SVN commit r469.
2004-06-10 22:24:03 +00:00
e4378ffbdc added precompiled.h. these need to be newline-fixed also!
This was SVN commit r421.
2004-06-08 11:50:52 +00:00
notpete
4f8ce4b1d4 Initial revision.
This was SVN commit r410.
2004-06-07 19:52:37 +00:00