Commit graph

4116 commits

Author SHA1 Message Date
Andrei Alexeyev
8b09cca7c2
src/entity: simplify sort comparison function 2024-09-22 21:18:31 +02:00
Andrei Alexeyev
22e6f9b4de
renderer/common/sprite_batch: r_draw_sprite optimizations 2024-09-22 21:18:31 +02:00
Andrei Alexeyev
7f570d2338
renderer/common/sprite_batch: remove string fields from SpriteParams 2024-09-22 21:18:31 +02:00
Andrei Alexeyev
2b21ee0e3f
util/assert: remove __builtin_unreachable() after assert trap 2024-09-22 21:18:31 +02:00
Andrei Alexeyev
d84a94d2f8
util/stringops: add strfmt_arena() 2024-09-10 14:32:22 +02:00
Andrei Alexeyev
787773a53b
memory/arena: add snapshot and rollback APIs 2024-09-10 14:31:55 +02:00
Andrei Alexeyev
5e0d85af1b
memory/arena: add opportunistic free and realloc functions 2024-09-10 14:31:55 +02:00
Andrei Alexeyev
1fc752531a
memory/arena: fix alignment offset calculation
Previously would add an unnecessary padding equal to alignment if the
pointer is already sufficiently aligned
2024-09-10 14:31:55 +02:00
Andrei Alexeyev
1ca51a6690
memory/arena: fix page size calculation 2024-09-10 14:31:55 +02:00
Andrei Alexeyev
ba840bedeb
resources/shader: fix certain shaders to work without texture swizzle support 2024-09-10 14:31:55 +02:00
Andrei Alexeyev
56f0fde7c6
util/compat: fix windows UNICODE defines 2024-09-10 14:31:55 +02:00
Andrei Alexeyev
8ad74bf62f
rwops/rwops_segment: fix missing include 2024-09-10 14:31:55 +02:00
Andrei Alexeyev
fda8556a39
src: deprecate strdup(), use mem_strdup() explicitly
This fixes a nasty bug that manifests on windows when building without
precompiled headers. util/stringops.h used to silently replace strdup
with a macro that's compatible with mem_free(). This header would
typically be included everywhere due to PCH, but without it the strdup
from libc would sometimes be in scope. On most platforms mem_free() is
equivalent to free(), but not on windows, because we have to use
_aligned_free() there. Attempting to mem_free() the result of a libc
strdup() would segfault in such a configuration.

Avoid the footgun by banning strdup() entirely. Maybe redefining libc
names isn't such a great idea, who knew?
2024-09-10 14:31:55 +02:00
Andrei Alexeyev
c8a2fb1418
memory: fix mem_realloc edge case on windows 2024-09-10 14:28:36 +02:00
Andrei Alexeyev
c150f4cd13
gl33: fix gl33_framebuffer_finalize_read_requests() 2024-09-03 01:52:50 +02:00
Andrei Alexeyev
c73aa60b0d
util/stringops: constify hexdigest() 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
7e5a7fa513
util/strbuf: make UBSan happy 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
a77dc789de
test/renderer: move load_texture into test_renderer.h 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
023a6b31e6
test/renderer/texture: add a basic textured quad test 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
98888a461b
test/renderer/triangle: use GLSL 420
330 doesn't allow explicit locations for vertex outputs/fragment inputs
2024-08-30 11:52:47 +02:00
Andrei Alexeyev
df5d68f253
test/renderer: add thread system to basic init 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
dcac5d9ec9
test/renderer: clean shutdown sequence 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
49bcbac838
renderer: remove PRIM_LINE_LOOP 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
48568b9227
renderer: add r_unclaim_window API
Must be called before destroying a window. Implementation is optional.
2024-08-30 11:52:47 +02:00
Andrei Alexeyev
7acdad7531
dynarray: make UBSan happy 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
47c8f5bee3
gl33: don't try to fall back to r_shader_standard() if active shader is deleted
This prevents clean shutdown in tests that don't bring up the whole
resource system, and is not really a sane fallback anyway.
2024-08-30 11:52:47 +02:00
Andrei Alexeyev
043f09c668
gl33: remove magic _SIZE uniform handling
Only FXAA ever used this, and it's trivial to implement in client code
2024-08-30 11:52:47 +02:00
Andrei Alexeyev
85eff81c7f
resources/shader/fxaa: don't rely on magic _SIZE uniform 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
141c942432
resource/font: disable mipmap generation
The mipmaps were never used
2024-08-30 11:52:47 +02:00
Andrei Alexeyev
be06946a31
renderer/api: add NUM_TEXTURE_CLASSES constant 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
718fc9685f
resource/texture_loader: remove bad assert; handle r_texture_create() failure 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
26959c4a1f
renderer/common/sprite_batch: replace tex_aux array in shaders with plain samplers
SDL_gpu doesn't support sampler arrays
2024-08-30 11:52:47 +02:00
Andrei Alexeyev
cbdff3ca41
stage1: use correct depth function in background
It's a mystery that this worked in opengl…
2024-08-30 11:52:47 +02:00
Andrei Alexeyev
7cd47e9404
renderer: move magic uniform definitions to common 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
4ebd7ba14b
gl33: remove trailing [0] from array uniform names 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
50056eb41a
renderer: decouple models and sprite_batch init/shutdown from main render system 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
2fdf9baf36
renderer/api: remove dead struct 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
fa2c13d116
util/compat: workaround for clangd in gcc-based build dirs 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
d676808ad1
memory/arena: add ARENA_ALLOC series of macros 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
a15b193c0b
memory/arena: add marena_memdup() and marena_strdup() 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
1f05199456
memory/arena: add marena_alloc_array_aligned() 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
b48e4e7714
build,renderer: dispose of gles20's rotting corpse 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
6a84f1aee3
shaderlib/lang_spirv_aux: support SPIR-V output in spirv_transpile 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
b7025a4d4c
util/stringops: strappend: make src param const 2024-08-30 11:52:47 +02:00
Andrei Alexeyev
2afc7f90ec
scripts: yeet pull and checkout 2024-08-30 11:52:47 +02:00
4226739869
scripts: optimize-img.sh: msg(): process arguments as a single string 2024-08-30 11:52:44 +02:00
c7df571a91
scripts: optimize-img.sh: simplify 1>&2
Simplify `1>&2` to `>&2`
2024-08-30 11:52:42 +02:00
d69b5ab55a
scripts: all: command read: use -r flag
Use the `-r` option with `read` to prevent backslash escaping and preserve
literal backslashes in input strings
2024-08-30 11:52:37 +02:00
64744d092b
scripts: all: put double quotes where they're needed
Put double quotation marks where they're needed to prevent word splitting of
strings and paths
2024-08-30 11:52:34 +02:00
8365529eba
scripts: all: guard all echo uses
Use `printf --` instead
2024-08-30 11:52:30 +02:00