Commit graph

107 commits

Author SHA1 Message Date
Daniel Gibson
0c4606973e Make basename() fully compliant and simplify it a bit 2022-07-30 15:26:56 +03:00
Daniel Gibson
955944a71a Make it work with VS2015 and newer
the workaround is a bit ugly but should work..
(I only tested VS2017, but I guess 2015 should also work)
2022-07-30 15:26:49 +03:00
Daniel Gibson
914441ff3a CMake: Make the game build with Visual Studio (2019 16.8 or newer)
The easiest way to build this is to check out the dhewm3-libs project
(https://github.com/dhewm/dhewm3-libs/) to provide the dependencies
(SDL2, OpenAL, cURL) and set YQUAKE2LIBS accordingly, by passing
-DYQUAKE2LIBS=c:/path/to/dhewm3-libs/i686-w64-mingw32 to cmake.

I wouldn't really recommend building with MSVC - I just somehow made it
work and ignored all the warnings and I have no idea how portable the
resulting binaries are etc. For binaries you actually want to use, please
continue using MinGW-w64. Especially my workaround for VLAs (C99 variable
length arrays) is kinda fishy, particularly if those arrays are allocated
in a loop (that's inly done in ref_gl1.dll's code).

The only reason I did this is that I had to debug on Windows and, at least
for my specific bug, gdb didn't really work with binaries produced by
MingGW-w64 and MSVC's debugger works well with binaries produced by MSVC.

Currently requires VS 2019 16.8 or newer with C11 (/std:c11) because I
couldn't get YQ2_ALIGNAS_TYPE() to work with MSVC without _Alignas().
If we can get this to work, VS2015 or newer might suffice (but not older
versions, because their so called C standardlib didn't provide exotic
functions like snprintf()).

# Conflicts:
#	CMakeLists.txt
2022-07-30 15:26:40 +03:00
Denis Pauk
36b41fc107 Revert "Temporary fix for MoltenVK"
This reverts commit 41057458e4.
2022-07-24 14:09:05 +03:00
Denis Pauk
e5f7bf7e82 Add additional logic for skip VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
Added checks for:
```
Memory types must not have both VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
and VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set.
```
And
```
A memory type with this flag set is only allowed to be bound to a VkImage
whose usage flags include VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT.
```

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkMemoryPropertyFlagBits.html
2022-07-24 00:10:31 +03:00
Denis Pauk
41057458e4 Temporary fix for MoltenVK
MoltenVK has issues with memory flags, partial revert of #25 and
apply #27
2022-07-23 17:50:31 +03:00
Denis Pauk
dcb6e9f7d0 Hide VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME for non MoltenVK
VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME is a provisional extension
and must be used with caution.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_portability_subset.html
2022-07-23 14:41:51 +03:00
David CARLIER
8ca794ab68 Enables beta extensions for MoltenVK 2022-07-23 12:54:16 +03:00
Denis Pauk
48a73aa92f
Merge pull request #26 from devnexen/drawparticlessig
Apply similar change done for the gl1 renderer here.
2022-07-22 23:31:19 +03:00
Denis Pauk
592f847fca
Merge pull request #25 from yquake2/vma_heuristic
Support memory preferences cost logic
2022-07-22 23:30:52 +03:00
David Carlier
987011e319 Apply similar change done for the gl1 renderer here. 2022-07-22 13:20:13 +01:00
Denis Pauk
f2e439064e Support memory preferences cost logic
Port memory preferences cost logic from VMA allocator.
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/

Code selects memory that has more bits simular to asked preferences.
2022-07-17 20:25:47 +03:00
Denis Pauk
d8beb0ee78 Update messages 2022-07-17 20:09:20 +03:00
David Carlier
d147aa10c3 little memory related changes. 2022-07-11 21:00:58 +01:00
Denis Pauk
29c0fd21cc Update usage information. 2022-07-11 00:12:29 +03:00
David CARLIER
d0e903fd78 Follow-up on MoltenVK changes.
Loading earlier its calls and adding metal device infos to the device.
2022-07-10 00:46:44 +01:00
Denis Pauk
e5739a5a42 Update README 2022-07-09 19:38:16 +03:00
David CARLIER
b1ec44057e MoltenVK/macOs specific variables.
- vk_molten_metalbuffers: enable/disable Metal buffers to bind textures
more efficiently (>= Big Sur).
- vk_molten_fastmath: enable/disable float point op optimisations.
2022-07-09 11:31:30 +01:00
David Carlier
649279b587 reducing a bit more the debug infos scope, differentiate also
a bit more validation 2 level towards 1.
2022-07-02 12:01:04 +01:00
Denis Pauk
1458f68393 Simplify validaton init workaround 2022-07-02 00:20:18 +03:00
Denis Pauk
97be0f92df
Merge pull request #18 from devnexen/vk_instance_noval
Instance handling fallback.
2022-07-01 23:16:30 +03:00
David CARLIER
fe554ca0cc Instance handling fallback.
When the validation layers fails (or not present) then we "surprisingly"
 fallback to a GL renderer losing all settings too.
Here we try to create the instance but without the validation part then.
2022-06-28 22:04:05 +01:00
Denis Pauk
bfd5659abc
Merge pull request #16 from devnexen/volkloadinstance_postpone
QVk_Init: Load instance data only on success.
2022-06-26 13:50:20 +03:00
David Carlier
099fbda371 QVk_Init: Load instance data only on success. 2022-06-26 09:59:09 +01:00
Yamagi
c4fc8c86bb
Merge pull request #15 from devnexen/update_vendors_list
Update the vendors list.
2022-06-25 20:52:00 +02:00
David CARLIER
d374fe1630 Update the vendors list. 2022-06-25 16:21:57 +01:00
Yamagi
6729698611 Switch off STB thread local support.
Quake II is a single threaded application, so we don't require STB to be
thread save. Omitting thread local support prevents mingw from requiring
pthreads.
2022-06-13 07:14:57 +02:00
maraakate
ed0b80a3d4 src/common/shared.c: Check >= maxsize in Info_SetValueForKey(). Found by ASAN. 2022-05-29 15:57:52 +03:00
Denis Pauk
d134f46b59 Select device by type priorities
Code has selected discrete gpu if it has seen several render devices. It does not work if no discrete gpu has attached to device.

As solution device selected by priorities list like:
 * VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU,
 * VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU,
 * VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU,
 * VK_PHYSICAL_DEVICE_TYPE_CPU,
 * VK_PHYSICAL_DEVICE_TYPE_OTHER.
2022-05-09 10:56:55 +03:00
Denis Pauk
6b1c62b512
Merge pull request #13 from devnexen/mem_leak_fix
vulkan extensions possible memory leak fix.
2022-05-03 19:10:12 +03:00
David Carlier
244ca7fdf7 vulkan extensions possible memory leak fix. 2022-05-02 07:25:13 +01:00
RodrigoMedeirosRS
52ef46403d Add windows shaders.bat generate 2022-03-20 22:37:51 +02:00
Denis Pauk
5a133b7304 vk: Add r_lerp_list and r_videos_unfiltered CVars
r_lerp_list is to allow exceptions to r_2D_unfiltered (like for having
pixely UI in general, but filtered console background).

r_videos_unfiltered controls whether videos should be filtered or not

I also made r_nolerp_list CVAR_ARCHIVE, like users probably expect it.

6eb9ca0f65
2022-03-20 22:32:50 +02:00
Denis Pauk
93caaa67e7 Sync Makefile with yquake2
896bb48d36
2022-01-23 13:43:03 +02:00
Denis Pauk
07a53c1bc6 vk: Scale 3x for nolerp 8bit textures
a48c7e1850
2022-01-23 13:34:46 +02:00
Denis Pauk
eeeec10131
Merge pull request #11 from benbeshara/master
Fixed build on arm macOS
2022-01-23 13:34:06 +02:00
Ben Beshara
8a50516b1e Fixed build on arm macOS 2021-12-08 23:06:28 +11:00
Denis Pauk
c66e827e70 vk client Mod_PointInLeaf sig mismatch.
6cb2981c9c
2021-11-04 23:05:31 +02:00
Denis Pauk
5bae9145f4 Update std_image and stb_image_resize to af1a5bc.
This brings a lot of bugfixes, most of them are irrelevant for us. At
least as long as the game is run with standard assets...

67f22cce17
2021-11-02 18:46:36 +02:00
Denis Pauk
0ee36fc801 Add r_2D_unfiltered CVar, improve r_nolerp_list handling
Setting r_2D_unfiltered to 1 (0 is default), 2D elements (GUI, menu,
console) are rendered without texture filtering in GL1 and GL3, while
everything else is still rendered with whatever is set in gl_texturemode

This setting (and now also gl_nolerp_list) is applied immediately,
so no vid_restart is needed.

3873c76e12
2021-10-31 20:31:16 +02:00
Denis Pauk
049f26a212 Use separate r_scale8bittextures for image scale
Rename vk_retexturing variables to r_retexturing in code.

1e0d75857b
2021-10-30 22:17:43 +03:00
Denis Pauk
94954207a1 Add Khronos vendor ID's list 2021-10-03 12:34:09 +03:00
Denis Pauk
8e9933270c add const to Mod_ClusterPVS 2021-10-02 19:59:43 +03:00
Denis Pauk
75b83401dc vk: Use common RadiusFromBounds 2021-10-02 19:59:43 +03:00
Yamagi
6a646d0e4b
Merge pull request #8 from 0lvin/master
Fix xatrix intro image
2021-07-15 07:24:21 +02:00
Denis Pauk
0facda008d Fix xatrix intro image
Recreate image if initiall image has different dimention or aspects.

Possible fix for #7
2021-06-26 16:18:06 +03:00
Yamagi
a7e53dd827
Merge pull request #5 from Spirrwell/master
[WIP] Fixes for Vulkan backend
2021-06-14 17:14:31 +02:00
Spirrwell
f67f53aed3 (Hopefully) Fix restart loop/corruption issues by rebuilding swapchain
To fully explain, for me on KDE, when a window gets created for exclusive fullscreen, the window will be hidden/shown/resized in a weird way that leads to out of data/suboptimal swapchain errors.

The problem with simply recreating the swap chain based on old code was that it was missing QVk_UpdateTextureSampler calls for vk_colorbuffer and vk_colorbufferWarp which update the descriptor sets, which probably lead to a whole lot of problems.
2021-06-08 03:58:15 -04:00
Spirrwell
c79fd42110 Realloc vk_swapchain.images so we don't leak 2021-06-08 03:54:17 -04:00
Yamagi
143cb7711c Print some build information at startup.
* The platform and the architecture.
* The build date.
* Introduce a version number and print it.
2021-06-07 07:48:09 +02:00