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
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
- vk_molten_metalbuffers: enable/disable Metal buffers to bind textures
more efficiently (>= Big Sur).
- vk_molten_fastmath: enable/disable float point op optimisations.
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.
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.
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.
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
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
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.