Commit graph

181 commits

Author SHA1 Message Date
Vladislav Belov
e8a5103f8c
Fixes #8057 by properly initializing atlas texture.
Fixes #8057
Fixes #8184
Fixes #8345
2025-09-17 14:31:16 +02:00
Vladislav Belov
e2d9450d0d
Revert "Font: make atlas uploads queue-aware on Vulkan"
This reverts commit 256dff7fd4.
2025-09-17 12:32:08 +02:00
Ralph Sennhauser
2cedb48de2
Remove custom span and use std::span
With C++20 the custom container PS:span, which was a backport of
std::span is no longer needed.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-24 11:09:57 +02:00
Ralph Sennhauser
2daa5385a8
Remove obsolete warning suppression
This was needed for old Visualstudio and is no longer needed with
VS2022.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-24 11:09:57 +02:00
Ralph Sennhauser
5b5f678e3f
Fix some includes all over the place
Make include-what-you-use happy with some files in source and fix what
needs to be fixed.

Add markers to precompiled.h header includes to avoid
include-what-you-use wanting them to be removed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-14 20:15:30 +02:00
phosit
eb3f0166f8 Prefer [[maybe_unused]] over UNUSED2
`[[maybe_unused]]` is in the C++ standard.
2025-07-28 13:16:37 +02:00
phosit
5be02743fa Don't use UNUSED2 on always unused variables
Not introducing a variable enforces that the variable is not used.
`UNUSED2` on the other hand is used to silence the warning.
2025-07-28 13:16:37 +02:00
phosit
c0f20171f8 Remove wrong UNUSED2
Some variable are marked unused even though they are used.
2025-07-28 13:16:37 +02:00
Ralph Sennhauser
f9e1e742bf
Fix includes in source/renderer
Make include-what-you-use happy with files in source/renderer and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-27 16:07:14 +02:00
Stan
ef69c37f66
Add VS2022 support with the v143 toolset 2025-07-23 09:19:29 +02:00
Ralph Sennhauser
47b2733183
Fix some includes in source/renderer
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-12 12:19:41 +02:00
trompetin17
256dff7fd4
Font: make atlas uploads queue-aware on Vulkan
Goal
----
Avoid corrupting the dynamic font-atlas on Vulkan by blocking any
re-uploads until the command buffer that created / last updated the
texture has actually been submitted.

What changed
------------
* **Queue-aware textures**
  * Added `queueSubmitAware` flag to `IDevice::CreateTexture*` APIs.
  * `Vulkan::CTexture` now stores two booleans:
      - `m_QueueSubmitAware` – opt-in per texture.
      - `m_PendingQueueSubmit` – set to *true* the moment an upload
        is recorded, cleared once the submit scheduler has flushed.
  * `CRingCommandContext::ScheduleUpload` marks the texture as
    pending (`SetPendingQueueSubmit(true)`).

* **Device-side watcher**
  * `Vulkan::CDevice` keeps a
    `m_TextureUploadWatcherQueue`. Each frame it checks textures that
    were uploaded ≥ `NUMBER_OF_FRAMES_IN_FLIGHT` frames ago and
    clears their pending flag.
  * New helpers
    `ScheduleTextureUploadWatch `,
    `ProcessTextureUploadWatchQueue()`.

* **Font code**
  * Atlas texture is now created with
    `queueSubmitAware = true`.
  * `CFont::UploadTextureAtlasToGPU()` early-outs when
    `IsPendingQueueSubmit()` returns *true*, instead of tracking a
    submit-handle or the manual `m_IsLoadingTextureToGPU` flag
    (removed).

Why this is better
------------------
The logic to wait for a flush is localised inside the rendering
backend, so `CFont` only needs to ask *“is my texture busy?”*.
This removes the fragile submit-handle bookkeeping and works even if
the scheduler issues multiple submits per frame in future.

Result
------
Atlas uploads are deferred until the previous submit completes,
eliminating the intermittent glyph corruption on the Vulkan backend
while leaving GL and the dummy backend unchanged.
2025-07-09 13:09:46 -05:00
Ralph Sennhauser
8a8f2596ea
Fix a warning on Windows
5e4b49f65f introduced a warning, silence it as it's in spidermonkey and
only leaks while on vs2017.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-09 19:24:51 +02:00
Ralph Sennhauser
5e4b49f65f
Fix some includes in source/renderer
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-07 17:45:54 +02:00
phosit
891908b801 Remove UNUSED
The `UNUSED` macro is used to mark a variable as unused but with a name.
Those usages are replaced with comments so that `UNUSED` can be removed.

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-unused
2025-06-26 17:25:05 +02:00
phosit
d9795d29fe Remove the name of some unused arguments
Remove some usage of the `UNUSED` macro. Remove only those cases where
the names can be deduced from their type.

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-unused
2025-06-18 12:49:59 +02:00
Ralph Sennhauser
58219b974c
Fix trailing whitespace and add pre-commit hook
Some have their editor configured to remove trailing whitespace and
editing such a file would "fix" it, adding an unrelated change.

Fix whitespace violations excluding third party libs and generated files
like glad or patches.

Enable pre-commit hook trailing-whitespace to enforce it in the future.

Fixes: #8016
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-15 20:08:48 +02:00
Vladislav Belov
6ef6a87287
Adds queries implementation to renderer backends. 2025-04-16 22:38:32 +02:00
Vladislav Belov
0e7d193fcc
Adds an interface for queries. 2025-04-16 22:38:24 +02:00
Vladislav Belov
9c560c36af
Removes ARBShadersShadow IDevice capability.
According to our stats `GL_ARB_fragment_program_shadow` is supported
by all our GL users. Also we're going to remove OpenGL ARB in A29. So
I remove ARBShadersShadow completely.
2025-04-12 23:14:28 +02:00
Vladislav Belov
fa3fb5d064
Allows compute shaders for GL only since 4.3.
It seems current checks for GL 4.2 aren't enough so just disable
compute shaders for GL 4.2. Fixes #7734.
2025-04-12 16:56:18 +02:00
Vladislav Belov
bce6e2c238
Fixes out of bounds during GL buffer binding.
There was an out of bounds access during binding a uniform buffer on
GL. Fixes #7567, #7598.
2025-04-12 16:27:52 +02:00
Dunedan
8482f25800
Fix a bunch of spelling mistakes
This fixes a bunch of spelling mistakes found in user facing strings.

Fixes #7716
2025-04-11 06:24:32 +02:00
phosit
1a8757660f Get config values without using return parameters
Many temporaries can be removed.
2025-04-09 12:51:21 +02:00
phosit
473f8ca72e Remove FALLTHROUGH on empty cases
`#include "lib/code_annotation.h"` can be removed in some places.
2025-01-29 19:34:12 +01:00
Vladislav Belov
a7ead4cf4c
Disables compute shaders for GL ARB backend. 2025-01-28 18:56:15 +01:00
Vladislav Belov
635a268dd9
Disables GL storage buffers on Mesa.
This is a workaround to avoid disabling GL storage buffers completely.
Because they might not work or might lead to a decreased performance.
We need to investigate that further when we have a local reproduce.
2025-01-28 01:40:47 +01:00
Vladislav Belov
0467d27b07
Fixes slow-path texture conversion on RPI4.
RPI4 returns `false` for `textureCompressionBC` because it doesn't
support formats above BC3. As the Vulkan specification requires to
support all BC formats to have `true` for `textureCompressionBC`.
2025-01-05 00:27:02 +01:00
Vladislav Belov
54701868da Fixes GLES compilation. 2025-01-04 18:22:23 +01:00
Vladislav Belov
dba968013f
Fixes Vulkan device selection.
According to #6936 some lower devices (especially virtual ones) might
report more memory than regular ones. So we can't use the memory
amount as a score for now.
2024-12-16 23:18:20 +01:00
Ralph Sennhauser
ead62bba78
Update trac links with gitea links
This replaces all links pointing to trac with their corresponding links
to gitea. Also replace http with https while at it.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-10 11:29:48 +01:00
Vladislav Belov
9e371824c2
Adds storage buffer support to Vulkan and GL.
The idea is similar to the storage images but we need a separate
descriptor set in Vulkan and a program interface to gather used buffer
in GL.

For Vulkan we also need to track buffers to free used descriptor sets.
2024-12-09 22:47:15 +01:00
Vladislav Belov
60b4072b29
Avoids assertions on Vulkan backend device creation in case of driver bugs. 2024-12-05 18:32:15 +01:00
phosit
256152df6d Add CXeromycesEngine
This way the destructor can be used for clean up and `Singleton` can be
used.
2024-11-17 18:03:49 +01:00
Vladislav Belov
0a6703762d
Removes hardcoded Vulkan uniform descriptor set ranges. 2024-11-06 23:24:22 +01:00
Vladislav Belov
3a01d852e2
Adds binding slot type to Vulkan shader program. 2024-11-06 19:09:22 +01:00
Vladislav Belov
eecc5a8fea
Updates the list of GL extensions for glad. 2024-11-03 20:35:28 +01:00
Stan
361a32a7e5
Fix parameter typo in GL backend 2024-11-01 13:30:12 +01:00
Vladislav Belov
2b324fdd94 Avoids recalculating Vulkan pipeline state in case of the same desc. 2024-10-25 21:23:47 +02:00
Vladislav Belov
960b3180e5
Reduces code duplication for Vulkan pipeline state binding. 2024-10-19 19:58:03 +02:00
Vladislav Belov
3eb1da6e5c Fixes incorrect Vulkan buffer usage enum name. 2024-10-19 00:13:50 +02:00
Stan
09e42692bb
Fix GLES 2.0 build after the compute shader addition 2024-10-08 08:13:33 +02:00
Itms
35e0a98940 Avoid a copy in a range-for-loop
This fixes -Wrange-loop-construct with FreeBSD's clang17.
2024-09-28 21:55:30 +02:00
vladislavbelov
6d5dc7f311 Fixes zero usage for Vulkan upload buffer after b9fd6f18f0.
This was SVN commit r28110.
2024-06-14 22:05:32 +00:00
vladislavbelov
b9fd6f18f0 Adds proper IBuffer usage instead of dynamic flag.
Comments By: phosit
Differential Revision: https://code.wildfiregames.com/D5281
This was SVN commit r28107.
2024-06-10 19:31:41 +00:00
vladislavbelov
e9bc76040d Accounts maxAnisotropy for Vulkan samplers.
This was SVN commit r28034.
2024-02-16 18:46:44 +00:00
vladislavbelov
aeeeb2c8d9 Makes pipeline state dirty on Vulkan only when VertexInputLayout was changed.
This was SVN commit r28011.
2024-01-17 19:55:28 +00:00
vladislavbelov
e3f46bb809 Adds compute shaders support and scaling with FSR.
Fixes #6842

Comments By: phosit, Stan
Differential Revision: https://code.wildfiregames.com/D5218
This was SVN commit r28010.
2024-01-17 19:40:27 +00:00
vladislavbelov
ffc4a56b9f Revert non-ASCII characters from source and configuration files introduced in 157c6af18e.
Fixes #6846

Differential Revision: https://code.wildfiregames.com/D5185
This was SVN commit r27965.
2023-12-03 00:30:12 +00:00
vladislavbelov
a905932712 Moves single descriptor set binding management for Vulkan to a separate class.
Differential Revision: https://code.wildfiregames.com/D5163
This was SVN commit r27921.
2023-11-07 21:43:52 +00:00