100 Commits
Author SHA1 Message Date
Vladislav Belov cedd5e89a0 Uses make_unique_for_overwrite in LinearAllocator
We don't need to initialize that memory. libcxx currently doesn't support
that. Also fixed wrong initialization order in the constructor.
2026-10-30 21:27:33 +01:00
Vladislav Belov 750fbe44bd Removes legacy allocator functionality from lib 2026-10-22 23:22:37 +02:00
Vladislav Belov 3d8a808b21 Replaces DynamicArena by LinearAllocator for GUI
Also DynamicArena causes an assertion when there are too many GUI
elements. LinearAllocator consumes similar amount of memory in total
but reduces a chance to get the assertion.
2026-10-22 23:22:35 +02:00
Vladislav Belov ddc07f92b9 Replaces legacy ProxyAllocator by AllocatorAdapter 2026-10-22 23:22:33 +02:00
Vladislav Belov 38dff62cff Adds AllocatorAdapter written against C++20 2026-10-22 23:22:30 +02:00
Vladislav Belov 61534d63a1 Removes unused lib CPU functions
All needed information is already provided by SDL.

Refs: #9136, #8855.
2026-10-19 20:48:10 +02:00
Vladislav Belov 72e12ddd6a Removes unused sysdep functions and macro
Removed:

* os_cpu_QueryMemorySize
* os_cpu_MemorySize
* GetCapBits
* rdtsc
* CONFIG2_TIMER_ALLOW_RDTSC
2026-10-19 01:09:22 +02:00
Vladislav Belov 086f9317e0 Removes wfirmware 2026-10-17 15:53:23 +02:00
Vladislav Belov 354232eddf Removes CPU affinity functionality
It was unused and not implemented for some platforms.
2026-10-17 15:53:21 +02:00
Vladislav Belov 1c27664b42 Removes ACPI functionality 2026-10-17 15:53:19 +02:00
Vladislav Belov 8c7dd6f85b Removes APIC functionality 2026-10-17 15:53:16 +02:00
Vladislav Belov dcc66fdc57 Removes CPU frequency calculating functionality 2026-10-17 15:53:14 +02:00
Vladislav Belov 7fcecda91b Removes NUMA functionality 2026-10-17 15:53:12 +02:00
Vladislav Belov a8d31f4353 Increases HW report version 2026-10-17 15:53:09 +02:00
Vladislav Belov 24d9658f44 Replaces x86-64 only cpu features by SDL calls 2026-10-17 15:53:07 +02:00
Vladislav Belov 3f557c7833 Removes os_cpu_NumProcessors from HW reports
The number of possible threads is already reported by SDL and STL.
2026-10-17 15:53:05 +02:00
Vladislav Belov a5b5a57b9c Removes CPU frequency from HW reports
It wasn't represeting maximumum or average CPU frequency. Just a
frequency calculated at the time of HW report. Also it was
working only for Windows and x86-64.
2026-10-17 15:53:03 +02:00
Vladislav Belov f9d4333e4c Removes custom memory counters from HW report
We already count memory reported by SDL.
2026-10-17 15:53:01 +02:00
Vladislav Belov 3d93cf7b4c Removes NUMA from HW reports
NUMA is needed for multiprocessors systems like server ones. We don't
target such platform. OS shouldn't handle that for us.
Also we had NUMA support only for Windows.
2026-10-17 15:52:59 +02:00
Vladislav Belov 8bda1d8642 Removes dynamic loading on Windows
All required functions are available on all supported Windows versions.
2026-10-17 01:50:46 +02:00
Vladislav Belov b75edb9b3f Replaces HostHasSSE by SDL_HasSSE
SDL also includes fixes for E2K:
https://github.com/libsdl-org/SDL/commit/67f0b9b86dd16c38b8d4c6e16cceaa166d31a83e
2026-09-22 21:57:57 +02:00
Vladislav Belov 9dec9c1d53 Removes SMBIOS
It was implemented on Windows only. It doesn't really contain a useful
for us information which can not be obtained by diagnostic tools like
dxdiag when needed.
2026-09-21 01:10:35 +02:00
Vladislav Belov 63016196ce Removes unused code from lib/bits.h 2026-09-21 00:47:17 +02:00
Vladislav Belov 2c68f7e426 Replaces ceil_log2 by std::bit_width
Also removes unused floor_log2.
2026-09-21 00:47:15 +02:00
Vladislav Belov 0650721b19 Replaces round to closest power of two by std ones 2026-09-21 00:47:13 +02:00
Vladislav Belov 0b90eea56b Replaces is_pow2 by std::has_single_bit 2026-09-21 00:47:11 +02:00
Vladislav Belov 93eb35a618 Replaces PopulationCount by std::popcount 2026-09-21 00:47:09 +02:00
Vladislav Belov 58e2c59466 Adds Load with unique_ptr to VFS
Also replaces some usages of Load with shared_ptr by unique_ptr.
2026-09-10 16:39:29 +02:00
Vladislav Belov aecd2b4245 Uses span for vfs instead of passing shared_ptr 2026-09-10 16:39:24 +02:00
Vladislav Belov 1b4397d2ae Adds final to VFS 2026-09-10 16:39:18 +02:00
Vladislav Belov 571047a64a Adds explicit check for VFS create alignment 2026-09-10 16:39:14 +02:00
Vladislav Belov 4ae50fd4a4 Reduces memory peak during window resize 2026-09-10 15:38:55 +02:00
Vladislav Belov 63e05d3c65 Removes unused updateFlags from GPU skinning 2026-09-10 15:27:18 +02:00
Vladislav Belov 100a13343a Uses default group for vertex buffer for skinning 2026-09-10 15:27:14 +02:00
Vladislav Belov e933d18a36 Moves tracking of requiring update models to upper
We need to track models to update in a single place. SceneRenderer in
that case. It allows us to make ModelVertexRenderer implementations more
straightforward.
2026-09-10 15:27:09 +02:00
Vladislav Belov a374411279 Separates preparing for rendering of CPU skinned
Only CPU skinned models require preparing for rendering to mark vertex
buffer chunks as needed.
2026-09-10 15:27:04 +02:00
Vladislav Belov 39c0dc69e4 Uses std::filesystem to get a file_size 2026-09-10 13:58:28 +02:00
Vladislav Belov 551071c5a4 Replaces shared_ptr by span for LoadFile and Store 2026-09-05 12:33:46 +02:00
Vladislav Belov c4e7364802 Removes unused BuildColor4ub from ModelRenderer
We don't need to calculate shading on CPU since we always use shaders.

Refs: a9c27b412b
2026-08-06 11:32:02 +02:00
Vladislav Belov 867bdf318b Fixes missing material reference in ModelRenderer
Missed in 18a16aa135
2026-08-06 10:31:16 +02:00
Vladislav Belov e64a138f92 Fixes outdated state on disabling GPU skinning 2026-08-04 23:06:12 +02:00
Vladislav Belov 4a7b7e7df1 Removes smart pointers from ModelRenderer
We don't need to use pointers because we know lifetimes of all
renderers. And its list statically defined. A new renderer should follow
DOD and use a separate submission list with a separate inplace renderer.
2026-08-04 23:06:10 +02:00
Vladislav Belov fa90ddc8b6 Refactors ModelRenderer and makes it closer to DOD
Separates submitted models and moder renderer and makes relations
explicit. Now it's clear that we don't need separate ModelRenderer and
ModelVertexRenderer.
2026-08-04 23:06:09 +02:00
Vladislav Belov 764a420797 Merges ModelRenderer and ShaderModelRenderer
We use only shaders to render models so we don't need a separate class.

BatchModelRenderer was renamed in 6bc33fe8bd.
m_Renderer became unused in 0346ba1b18.
2026-08-04 23:06:07 +02:00
Vladislav Belov 8a2bb10827 Renames ShaderModelRenderer instances 2026-08-04 23:06:06 +02:00
Vladislav Belov af9d102126 Removes legacy logic of reused ModelRendererPtr
It became unused in 4a69e9117e.
2026-08-04 23:06:04 +02:00
Vladislav Belov 4125e5b645 Adds sRGB support to GLES 2026-07-29 01:29:11 +02:00
Vladislav Belov f781181899 Adds sRGB support for proper lighting
Currently we're incorrectly using sRGB colors as raw inputs for lighting
instead of conversion to linear space. For proper PBR we need linear
values.
2026-07-29 01:29:09 +02:00
Vladislav Belov e2f5b20922 Fixes GL internal format of textures in compute
In compute shaders load/store operations requires sized formats.
2026-07-28 23:32:23 +02:00
Vladislav Belov b3165505b6 Fixes possible artifacts with GPU skinning on GL
std140 requires 16 bytes alignment and it makes alignment of uvec2 in
SkinData be equal to 16 bytes instead of 8 bytes.
2026-07-28 18:12:21 +02:00
Vladislav Belov 7ee476928b Fixes missing window preview on Alt+Tab
There was a crash on Alt+Tab in fullscreen for some specific driver:

https://code.wildfiregames.com/D1212

It was related only to post processing so it's time to try to enable
rendering again (but with provided option to disable it). Also without
rendering we might have some bugs in other components. See:

https://github.com/libsdl-org/SDL/issues/5033#issuecomment-981819661

The issue is reported here (first one):

https://wildfiregames.com/forum/topic/129061-two-vulkan-issues-in-a27-and-unrelated-choppiness-caused-by-control-groups/
2026-07-14 19:54:00 +02:00
Vladislav Belov 2a6f17fbae Uses std::string_view for UTF-8 conversions 2026-07-14 00:14:27 +02:00
Vladislav Belov ef5088e595 Uses std::string_view for Script::Interface::Eval 2026-07-13 23:53:24 +02:00
Vladislav Belov 5778ef6cac Removes std::shared_ptr usages from particles 2026-07-13 01:01:03 +02:00
Vladislav Belov d2375de187 Splits PrepareScene and remove intermediates
We don't need to have intermediate functions as they don't add something
useful.
2026-07-13 00:40:36 +02:00
Vladislav Belov 43dd988ee7 Removes render methods from GameView 2026-07-13 00:40:34 +02:00
Vladislav Belov a2798b733f Splits render frame function 2026-07-13 00:40:32 +02:00
Vladislav Belov abf444d91c Reduces vertex maximum stride to 16
https://wikis.khronos.org/opengl/Vertex_Specification_Best_Practices

> The alignment of any attribute's data should be no less than 4 bytes.

But to make it a bit safer for older drivers we prefer to use 16 bytes
alignment (vec4) for now to match std140.
2026-07-12 17:54:26 +02:00
Vladislav Belov db8c05572f Adds Vulkan vertex format verification 2026-07-12 17:09:11 +02:00
Vladislav Belov fd99348d56 Fixes AMD Vulkan drivers crash with GPU skinning
R16G16B16_SFLOAT isn't guaranteed to be supported:
https://docs.vulkan.org/spec/latest/chapters/formats.html
See Table 17. Mandatory Format Support: 16-bit Components

It's safe to use less components:
https://docs.vulkan.org/spec/latest/chapters/fxvertex.html

> The number of components in the vertex shader input variable
> need not exactly match the number of components in the format.
> If the vertex shader has fewer components, the extra components
> are discarded.

The issue is reported here (second one):

https://wildfiregames.com/forum/topic/129061-two-vulkan-issues-in-a27-and-unrelated-choppiness-caused-by-control-groups/
2026-07-12 17:09:09 +02:00
Vladislav Belov 92ee2dba9e Removes unused OGL legacy 2026-07-09 22:53:30 +02:00
Vladislav Belov 552d91e92a Removes legacy GL error handling
We have GL_KHR_debug for proper error handling. ogl_WarnIfError isn't
really useful since it doesn't provide per-call granularity and requires
recompilation. So if it'll be really needed we can wrap all GL calls
into a macro like GL_CALL.
2026-07-09 22:53:29 +02:00
Vladislav Belov 63b4b35bd3 Removes unused code about GL version from OGL 2026-07-08 20:54:11 +02:00
Vladislav Belov 11f78e5c1a Uses GLAD to get GL version 2026-07-08 20:52:23 +02:00
Vladislav Belov cd872e38d7 Removes functions about extension from OGL
We use GLAD directly now.
2026-07-08 20:06:36 +02:00
Vladislav Belov 4ca83fa071 Uses GLAD to check extensions
If GLAD failed to load an extension then we can't use it. Because all
its functions are nullptr.
2026-07-08 20:06:18 +02:00
Vladislav Belov 2bc674cbaa Removes extensions prior 2.1
Since we generate GL headers using GLAD with 2.1 version we don't need
to check extensions prior that.
2026-07-08 09:28:52 +02:00
Vladislav Belov eb3f55ae27 Removes unused ogl_SquelchError 2026-07-08 08:13:48 +02:00
Vladislav Belov 0a22bc66f7 Makes GL error handling explicit in report 2026-07-08 08:13:46 +02:00
Vladislav Belov 0168f45a65 Refactors GL device report
It makes the report function easier to read.
2026-07-08 08:13:44 +02:00
Vladislav Belov 46af67b5bd Removes RenderPath
We can render the game only with shaders so we don't need to support
fixed function pipeline as a separate render path. We only need to know
when to warn a user.

Fixes #6244
2026-07-07 23:12:45 +02:00
Vladislav Belov 8491b7f084 Removes Unattach from emitter
We don't really need that proxy. As the main idea is to move the
ownership from a model to the particle manager.
2026-07-06 01:05:09 +02:00
Vladislav Belov 0538e95793 Makes GameView::GetCamera constant 2026-06-28 17:57:26 +02:00
Vladislav Belov e0d131854d Makes GameView returning reference on camera 2026-06-28 17:57:16 +02:00
Vladislav Belov 0cc07aa209 Removes legacy glEnable of GL_TEXTURE_2D
It needs to bo enabled only for fixed-function pipeline.

https://registry.khronos.org/OpenGL-Refpages/gl2.1/

> If enabled and no fragment shader is active, two-dimensional texturing is performed
2026-06-28 15:56:33 +02:00
Vladislav Belov 74f11d2fd2 Adds const to particle emitter type
Emitter type must not be changed during any emitter update.
2026-06-28 14:30:44 +02:00
Vladislav Belov 7790c0972b Removes legacy timers
Modern profiling tools provide more details and more precise
measurements for more platforms. For simpler cases we have our in-game
profiler.
2026-06-28 13:34:01 +02:00
Vladislav Belov fa0e593669 Replaces virtual by override for particle emitters 2026-06-28 12:01:39 +02:00
Vladislav Belov 1709149740 Adds instancing to particles
We use instancing to provide dynamic data for particle only once and not
for each vertex.
2026-06-22 23:18:29 +02:00
Vladislav Belov 50d82810bc Moves UV coordinates to a separate vertex buffer
UV coordinates are constant so we don't need to upload them each frame.
Ideally we shouldn't have UV coordinates at all as we could use
gl_VertexID but it's not available on all supported GLSL versions.
2026-06-22 23:18:27 +02:00
Vladislav Belov 1380a93077 Packs particle size and angle to axes
We need to have per-vertex data to be constant to use instancing.
Now we have only UV coordinates.
2026-06-22 23:18:26 +02:00
Vladislav Belov db9f60b540 Renders only alive and visiable particles
We don't need to update and render dead or invisible particles. The
code still uploads the whole chunk but I'll improve that later.
2026-06-21 18:40:52 +02:00
Vladislav Belov 45cb592f22 Adds ability to enable smooth framerate in Atlas 2026-06-21 11:30:27 +02:00
Vladislav Belov 54b529ddac Fixes crash for too many particles
The maximum number of particles was unbound. It's bound by the
number of maximum vertices per vertex buffer.
2026-06-20 21:45:55 +02:00
Vladislav Belov d23f9e1da3 Adds a storage check for resolve PBR shader
We need to check for storage support because we outpout result into a
storage. Note: it seems we might have a bug inside GL backend or inside
Mesa drivers which prevents us from running resolve on compute.
2026-06-20 13:29:14 +02:00
Vladislav Belov 7a19f38070 Allows floating point textures based on extension 2026-06-20 13:29:13 +02:00
Vladislav Belov f72c0c1c09 Enables fragment PBR resolve shader in PostProc 2026-06-20 13:29:11 +02:00
Vladislav Belov 8c5416e2c5 Adds fragment shader PBR resolve
It allows to have PBR for devices without properly detected compute
shaders.
2026-06-20 13:29:01 +02:00
Vladislav Belov 5ca4c93f55 Reduces canvas2d layout for SPIR-V
It's preferrable to keep push constant under 64 bytes for some vendors.
The layout optimization rule is similar to C++ one.
2026-06-20 11:22:29 +02:00
Vladislav Belov 4259c78150 Removes unused Get/SetDepthTextureBits methods
Methods were added in f903b83674.
Methods became unused in 12e2428495.
2026-06-15 00:35:04 +02:00
Vladislav Belov 62fcb7e042 Removes requirement to restart the game for V-Sync 2026-06-08 18:27:12 +02:00
Vladislav Belov 7607d6bdd8 Decouples acquire/present from SubmitScheduler
SubmitScheduler doesn't have to know anything about Acquire/Present as
its responsibility to schedule and submit command buffers to a queue.
2026-06-08 18:27:10 +02:00
Vladislav Belov 07e5ad5b23 Fixes acquire and submit semaphores syncronization
I forgot to finish CSubmitScheduler synchronization in
7c84c23114. Even ++m_FrameID was
forgotten. And it worked at the time. A proper synchronization is
described in renderer/backend/Vulkan/SwapChain.h.
2026-06-08 18:27:08 +02:00
Vladislav Belov 4d83aa28e5 Uses SwapChain instead of direct Device calls 2026-06-08 18:27:06 +02:00
Vladislav Belov cf4a4d8fd5 Adds SwapChain as an explicit DeviceObject
It allows us more flexibility on how we control swapchain. That includes
toggling V-Sync in real time.
2026-06-08 18:26:58 +02:00
Vladislav Belov 1250ca1dac Replaces FALLTHROUGH macro by attribute
It was forgotten during removing the FALLTHROUGH macro in
b41ca5ad78.
2026-05-22 23:25:31 +02:00
Vladislav Belov a0ecfbaa33 Skips UNIFORM buffers for GLES
Currently we don't support UNIFORM buffers for GLES.

Refs 54701868da
2026-05-22 23:14:30 +02:00
Vladislav Belov 017aa3b736 Adds splitted shader effects to materials 2026-05-10 23:57:27 +02:00
Vladislav Belov 59e36be140 Splits shader effects to reuse in material passes 2026-05-10 23:57:23 +02:00
Vladislav Belov 18a16aa135 Moves all rendering to material passes
Now we should use material passes instead of context and defines to
select a needed shader. It allows us to reduce the number of
shader combinations we use and reduce memory consumption.
2026-05-10 23:57:20 +02:00