Commit graph

3171 commits

Author SHA1 Message Date
Yamagi
886ce1525e Port missing !vk_frameStarted guards from vulkanQ2.
Without these guards draw calls may be emitted without having a working
or sane context, leading to crashes in the Vulkan driver.
2021-04-11 11:17:52 +02:00
BjossiAlfreds
47c99cc7a3 Documentation for the map fixes 2021-04-11 02:56:40 +00:00
Yamagi
33148a3085 Revert "unix network little change proposal. socket port fits within unsigned 16 bits type."
This reverts commit df3b2307f2.
2021-04-10 17:40:03 +02:00
BjossiAlfreds
7a92382b96 Fixed spawnflags of DM-only super shotgun in map train 2021-04-08 14:47:05 +00:00
BjossiAlfreds
23f55b72c7 Map fixes for old and newly discovered bugs + removed code hacks 2021-04-08 13:42:18 +00:00
Yamagi
4fd0369f47
Merge pull request #697 from 0lvin/for_review
soft: fix m8 image load
2021-04-08 11:05:56 +02:00
Yamagi
56754ff8b8
Merge pull request #696 from devnexen/segfault_with_console_at_launch
Fix segfault when turning the console before the game is launched
2021-04-08 11:04:17 +02:00
Yamagi
916515182f
Merge pull request #690 from devnexen/savegame_data_packing
game data packing representation of the headers
2021-04-08 11:02:28 +02:00
Denis Pauk
5cc959e501 soft: fix m8 image 2021-04-07 22:58:46 +03:00
David CARLIER
f66d7a9540 Fix segfault when turning the console before the game is launched
(thus audio backend not yet initialised).
2021-04-07 20:17:27 +01:00
Yamagi
26bda18549
Merge pull request #694 from 0lvin/for_review
Vulkan code improvements and cleanup
2021-04-07 09:56:07 +02:00
Yamagi
1bae4e679f
Merge pull request #695 from devnexen/arm_runfast_mode
Little optimisation attempt targeted only for ARM 32 bits,
2021-04-07 09:32:18 +02:00
Yamagi
d4bf1415b7
Merge pull request #691 from devnexen/network_unix_chg
unix network little change proposal. socket port fits within unsigned…
2021-04-07 09:16:41 +02:00
Denis Pauk
68a0605582 sw: support full size retextured it_pic 2021-04-07 00:03:04 +03:00
David Carlier
159f5e3ae4 Little optimisation attempt targeted only for ARM 32 bits,
enabling "RunFast" mode ; benefits might depend on the board
 at hand.
2021-04-04 13:15:42 +01:00
Denis Pauk
e8105810d7 vk: rework lefthand pipeline logic 2021-04-04 13:36:47 +03:00
Denis Pauk
456acfda05 vk: Reuse TriangledFan logic for TriangleStrip 2021-04-04 12:11:11 +03:00
Denis Pauk
f8708a0f76 vk: rename triangle_{fan}_index_count 2021-04-04 10:46:35 +03:00
Denis Pauk
b2ff95249e vk: fix water on jail1 level 2021-04-03 13:31:21 +03:00
Denis Pauk
ec013874a0 check vert realloc in vk and vert list overflow in model 2021-04-03 13:31:05 +03:00
David Carlier
df3b2307f2 unix network little change proposal. socket port fits within unsigned 16 bits type. 2021-04-01 19:39:23 +01:00
David Carlier
4bbf7ef27a game data packing representation of the headers 2021-04-01 12:18:13 +01:00
Denis Pauk
0b821a49c3 ref_vk: Reallocate mesh verts 2021-04-01 00:26:55 +03:00
Denis Pauk
bef9485859 Fix vulkan validation warning
VK_WARNING: Validation Performance Warning: [ UNASSIGNED-BestPractices-vkCreateRenderPass-image-requires-memory ] Object 0: handle = 0x58e7d23ea0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x4003982 | Attachment 2 in the VkRenderPass is a multisampled image with 4 samples, but it uses loadOp/storeOp which requires accessing data from memory. Multisampled images should always be loadOp = CLEAR or DONT_CARE, storeOp = DONT_CARE. This allows the implementation to use lazily allocated memory effectively. (performance)
2021-03-31 22:20:01 +03:00
Yamagi
557668c35e
Merge pull request #680 from rg3/vk_restart_tweaks
Vulkan restart tweaks
2021-03-31 19:36:18 +02:00
Yamagi
ee945625d3 Add a cvar g_commanderbody_nogod to make the com. body destructable.
The commanders body entity is special, because it's spawned in god mode.
That's no problem in the baseq2 and addons campaigns. But it may break
some custom maps and prevents some hacks, one example is putting the
entity inside an killbox.

Submitted by Евгений T.
2021-03-31 19:28:20 +02:00
Yamagi
635f6ffb16
Merge pull request #685 from BjossiAlfreds/bad-triggered
Console warning and fix for triggered monsters with no targetname
2021-03-31 10:07:06 +02:00
Ricardo Garcia
6c3261180b Use vid_renderer instead of vid_refresh to re-register clients 2021-03-29 22:15:28 +02:00
BjossiAlfreds
fe517fd755 Console warning and fix for triggered monsters with no targetname 2021-03-28 17:16:36 +00:00
Yamagi
baae6bed89 Send protocol version to client.
Knightmare of KMQ2 requested this as an easy way to support client site
prtocol auto detection.

While here fix the protocol version number in the error string.
2021-03-28 18:48:38 +02:00
Yamagi
1c8077cf61
Merge pull request #683 from devnexen/mapids_code_simpl
map list/little code changes proposal.
2021-03-28 18:32:00 +02:00
Yamagi
3371cf3014
Merge pull request #681 from rg3/aniso_rework
Vulkan anisotropic filter tweaks
2021-03-28 18:30:11 +02:00
David Carlier
7492fd875d map list/little code changes proposal. 2021-03-27 08:10:15 +00:00
Ricardo Garcia
17c2c94f07 Fix memory leak when restarting the Vulkan renderer
models_known needs to be freed after freeing its contents.
2021-03-21 18:30:06 +01:00
Ricardo Garcia
e362e0280e Restart Vulkan renderer at EndFrame instead of BeginFrame
This brings yquake2 closer to vkQuake2 regarding renderer restarts when
the swapchain is out of date, among other situations that trigger a
Vulkan renderer restart.

Basically, the current behavior has the problem that when the renderer
is restarted at the beginning of the frame, the models are lost and we
end up with "ERROR: Mod_PointInLeaf: bad model" when attempting to
render anything after that restart.

To solve this, we move the restart logic to EndFrame and add a twist to
it: we use a vid_refresh variable to signal the server that the client
needs re-registration before starting the next frame cleanly, which will
trigger the registration logic to prepare the models again.
2021-03-21 18:29:38 +01:00
Ricardo Garcia
8891319bc1 Do not reset r_anisotropic to 1 from GL renderers
r_anisotropic can be zero in Vulkan to indicate anisotropic filtering
needs to be completely disabled, instead of enabled with value 1.0.
2021-03-21 11:08:09 +01:00
Ricardo Garcia
f601ffddfc Use the real anisotropic filtering value in Vulkan
When creating the Vulkan texture samplers, make them have the real
anisotropic filtering value selected by the user. This has two side
effects:

* We no longer need two sets of texture samplers in Vulkan (one with and
  another one without anisotropic filtering).

* The anisotropic filter value in Vulkan is no longer an on/off switch
  and we use the value as chosen by the user.
2021-03-21 11:08:09 +01:00
Ricardo Garcia
6f8949fd95 Apply anisotropic filter only when hitting "Apply"
Making the anisotropic filter value only be applied after hitting Apply
in the video menu will make it more natural for the Vulkan renderer to
restart itself when a new anisotropic value is selected, paving the way
to use the actual anisotropic filtering value in Vulkan.
2021-03-21 02:31:09 +01:00
Ricardo Garcia
15e9c5499d Remove documentation for nonexisting vk_aniso variable 2021-03-21 00:33:16 +01:00
Yamagi
11bcb785d0 Force SDL to minimize the window when focus is lost.
This was the default until 2.0.12 and is what the expects. It changed
with 2.0.14, casing problems with window ordering under windows and
some X11 window managers like kwin.

Do it unconditionally. So we're shure that we're ending with a minimized
windows, no matter what SDL does.

Fixes part of #647.
2021-03-17 09:21:48 +01:00
Yamagi
51746d6980
Merge pull request #678 from 0lvin/fullscreen_hacks
Fix fullscreen value in hacks (f1b6b827)
2021-03-11 06:55:48 +01:00
Denis Pauk
56a8ab6d4d Fix fullscreen value in hacks (f1b6b827) 2021-03-10 23:25:59 +02:00
Yamagi
2a18f02186 Don't build the vk renderer when WITH_REFVK is no.
This is the third or forth try, already. *grrr* WITH_REFVK isn't enough,
as long as the target is there. Wrap the whole target in an if-block.
2021-03-10 10:50:02 +01:00
Yamagi
18a9827b74 When drawing the renderer list, move vk before soft.
The software renderer should be the last option offered to the user,
because it is the weakest renderer.
2021-03-10 10:45:36 +01:00
Yamagi
f1b6b82721 Pull the major release card and switch the semantics of vid_fullscreen
One of the most common bug reports is, that the fullscreen mode doesn't
behave like users expect. This is caused by `vid_fullscreen 1` setting
desktop fullscreen mode (a fullscreen windows) and not the native
fullscreen mode. This commits switches the semantics:

* 1: Native fullscreen, like Vanilla Quake II.
* 2: Desktop fullscreen.

With this alt-tab reverts to native fullscreen. While at it improve the
documentation, suggest setting `r_mode -2` when using `vid_fullscreen
2`. Change the menu strings to make things clearer, set `r_mode -2` when
selecting 'fullscreen window' in the menu.

I pondered several other options:

* Introducing a second cvar for the desktop fullscreen, like we did in
  dhewm3. This has the problem, that in Quake II vi_fullscreen is
  special and used to communicate changed to the renderer configuration
  between the client and renderer. A second fullscreen cvar would
  complicate this already shaky mechanism even more.
* Setting `r_mode -2` when `vid_fullscreen 2`. This might not be what
  the user wants and causes problems when we're unable to get the
  desktop resolution.
2021-03-10 10:30:21 +01:00
Yamagi
51caf5b85e
Merge pull request #676 from rg3/vk_restart_fixes
Avoid restarting the whole video on VK_ERROR_OUT_OF_DATE_KHR
2021-03-10 10:01:47 +01:00
Yamagi
3c4dfcbba8 Switch the r_fixsurfsky default value to 0.
Switching this back to Vanilla Q2 behavior fixes at least one lightning
problem in the space map in baseq2. It'll break the lighting in some
addon maps, but is more correct from a global standpoint. You can't
have everything...

Closes #677.
2021-03-10 09:49:03 +01:00
Yamagi
4ef0a71b63 Fix another mapbug in city2.bsp.
There's a floater spawned in but never triggered, messing up the monster
count on medium and hard difficulty.

Closes #674.
2021-03-10 09:42:54 +01:00
Yamagi
e8107b4c64 Add else case missed / not committed in 9a17eb9a. 2021-03-08 21:30:34 +01:00
Ricardo Garcia
6989d22a2e Avoid restarting the whole video on VK_ERROR_OUT_OF_DATE_KHR
If an error is detected in vkAcquireNextImageKHR or vkQueuePresentKHR,
avoid restarting the whole video system and the game window. Instead,
shut down the Vulkan subsystem as gracefully as possible and restart it
without touching the window.

This fixes the problem with infinite video restarts under the Gnome
desktop environment.
2021-03-07 23:11:10 +01:00