Commit Graph

1356 Commits

Author SHA1 Message Date
Ivan Avdeev bf8a50f4fa recreate swapchain if it's stale on acquire 2021-02-06 11:52:10 -08:00
Ivan Avdeev 6b2c8977ae add pipeline cache 2021-02-06 11:38:21 -08:00
Ivan Avdeev 8c1c418b35 rename map to brush 2021-02-06 11:38:08 -08:00
Ivan Avdeev b11501e4ef improve blending; add alpha test
Set blending modes according to existing GL renderer.
Cull back faces.
Implement alpha test.

Add TODO.md file
2021-02-06 11:07:00 -08:00
Ivan Avdeev eb14e858a6 add transparency for brush models
Doesn't do alpha test yet though.
2021-02-03 12:24:04 -08:00
Ivan Avdeev fc9eedbd9d apply proper lightstyles on map load
Lightstyles remain fixed for the entire map duration. Need to implement either texture reupload in VK, or devise some other scheme of updating ligtmaps w/o texture reupload (lightstylevalues uniform buffers?).
2021-02-03 10:06:21 -08:00
Ivan Avdeev 8870650466 split vk_map into vk_scene and vk_brush
Scene controls entity list for scenes
Brush is only responsible for drawing brush models
2021-02-01 11:05:04 -08:00
Ivan Avdeev fc6cb27723 clear list of entites to render on clear scene
We were missing this, and as a result entities list got filled up within
a few frames, which resulted in:
- too many draw calls per frame, same entities were drawn many times
  over
- missing entities: if an entity didn't get to that list within a few
  first frames, then it wouldn't be rendered ever
2021-01-31 16:53:24 -08:00
Ivan Avdeev e848e312d3 add VK_EXT_debug_utils labels
This extension allows adding labels to vulkan objects and insert string
labels into command buffers. This is visible in tools like RenderDoc and
helps with debugging a lot.

When running with -vkdebug:
- mark all texture VkImages and VkImageViews with corresponding names
- label brush model draw calls accordingly
2021-01-31 16:50:27 -08:00
Ivan Avdeev 12c8f00885 add lightmaps; improve performance
1. Improve performance by coalescing multiple surfaces/draw calls with
   the same textures (within a single brush model).
2. Add lightmaps. We don't support lightstyles yet, though, so they seem
   a bit wrong at times. Also gamma handling is not great.

Oh well.
2021-01-30 15:31:23 -08:00
Ivan Avdeev eaa3d4295d draw brush surface textures
it's now *very slow* because every surface (which is just a few polys)
gets its own draw call and descriptor bind. F

we also had to make default sampler repeating, so now 2d textures in
menu have weird edge artifacts. also F

making progress i guess
2021-01-30 12:12:41 -08:00
Ivan Avdeev 0fc79bf90d Draw some of the brush models
Load all brush models in R_NewMap
Only opaque models are drawn.

This makes WAGONCHIK (and other doors) visible and animated. yay.
2021-01-27 12:00:11 -08:00
Ivan Avdeev c8aeab2dac remove extra map geometry; draw only modelsurfaces 2021-01-25 10:39:49 -08:00
Ivan Avdeev b9841ed6a8 fix matrices more properly 2021-01-25 09:32:33 -08:00
Ivan Avdeev 5d0146e17a draw static map geometry with debug shader
there are lots of glitches and no textures, but this is a first step!
2021-01-23 19:38:00 -08:00
Ivan Avdeev 4949f6e29e extract pipeline creation helper 2021-01-23 13:23:25 -08:00
Ivan Avdeev 0cd4cebfbb fix depth buffer recreation on resize 2021-01-23 11:11:45 -08:00
Ivan Avdeev 5a2ad5965d add depth buffer and map geometry loading
it's not being drawn yet though
2021-01-23 10:54:44 -08:00
Ivan Avdeev 014d2d272d massage stubs 2021-01-20 11:16:06 -08:00
Ivan Avdeev 4b124e240a fix texture wrapping in menu background 2021-01-18 13:38:33 -08:00
Ivan Avdeev e49591652f add 2d pipelines with blending; menu is drawn almost ok
also switch to non-srgb framebuffer
and remove a bunch of verbose log messages
2021-01-18 13:33:22 -08:00
Ivan Avdeev ef3a1ad4af handle surface resize 2021-01-18 11:15:51 -08:00
Ivan Avdeev d4c463c507 move swapchain to framectl; make validation errors crash process early 2021-01-18 10:54:48 -08:00
Ivan Avdeev 4d6739da0a get it to crappily draw 2d ui menus wtf 2021-01-16 17:02:43 -08:00
Ivan Avdeev 5541bfb541 add loading textures 2021-01-16 15:45:10 -08:00
Ivan Avdeev b9d872f279 increase draw limit; fix deinit validation 2021-01-16 13:49:07 -08:00
Ivan Avdeev 48e6765222 draw uv menu 2021-01-16 13:22:31 -08:00
Ivan Avdeev e7a99c2558 create command pool and buffer 2021-01-13 12:10:36 -08:00
Ivan Avdeev 5600cf45ef create pipeline for 2d rendering 2021-01-13 11:54:34 -08:00
Ivan Avdeev 986d26b8b7 create render pass and framebuffers 2021-01-13 09:58:01 -08:00
Ivan Avdeev c7203d0ecf create swapchain 2021-01-11 11:15:32 -08:00
Ivan Avdeev 0170f3e408 create vulkan device 2021-01-09 17:14:32 -08:00
Ivan Avdeev 0dcedece06 create vulkan instance; fix instance extension ref api 2021-01-09 16:05:55 -08:00
Ivan Avdeev fa683fb882 fix vulkan handles width in 32-bit mode; print vk version 2021-01-09 14:05:34 -08:00
Ivan Avdeev 3e800fa989 start splitting into functional blocks; add vk funcs 2021-01-09 13:21:58 -08:00
Ivan Avdeev ae6ec2e61d add texture loading stubs; messages for other stubs
now it gets to actually trying to paint a menu without crashing
2021-01-04 12:39:09 -08:00
Ivan Avdeev 4a9101cd2a gitignore: ignore waf and vim/coc files 2021-01-02 17:54:58 -08:00
Ivan Avdeev 5c99bb0979 ref_vk: add initial vulkan render stub
It does not work at all, but serves as an exercise to help me figure out
how to make renderers for HL/xash3d.
2021-01-02 17:52:53 -08:00
Gleb Mazovetskiy 3af742f103 in_touch.c: Fix -Wpointer-to-int-cast 2021-01-02 18:01:53 +03:00
Gleb Mazovetskiy 9452a389a5 SDL GameController: Hotplug and multiple gamepads
1. Process events from all game controllers.
2. Support controller hotplug.
2021-01-02 18:00:36 +03:00
Alibek Omarov 766ef84af4 engine: ref: try to bruteforce all available renderers if we're failed to load requested one 2021-01-02 17:59:53 +03:00
Gleb Mazovetskiy 5b8d504817 Add .clang-format
Based on
725fd84b5b/.clang-format
with the following changes:

1. Uncomments `BasedOnStyle: WebKit` to be explicit.
2. Adds:

       AlignConsecutiveDeclarations: true
       AlignConsecutiveMacros: true
2021-01-02 17:56:58 +03:00
Alibek Omarov 61fe9fd1fe engine: fix some left shifts on signed integers 2021-01-02 05:01:51 +03:00
Gleb Mazovetskiy 33ba1f25f3 sys_linux.c: Increase buffer size for /proc/self/status
Fixes #263
2021-01-02 04:21:01 +03:00
Gleb Mazovetskiy 2106eef4b2 system.c: Fix `Sys_Warn/Error` text buffer sizes
This was using the wrong define
E.g. `-dev 2 -help` output did not fit into it
2021-01-02 03:43:17 +03:00
Gleb Mazovetskiy 23998ef720 makepak.py: Skip all filenames starting with .
This makes it much simpler to define a buildroot package for xash-extras
buildroot places various buildroot-internal dot files in the package build directory
2020-12-30 14:40:32 +03:00
Andrey Akhmichin 1332381e2d engine: server: simplified strings operations. 2020-12-29 20:20:25 +03:00
Gleb Mazovetskiy 7f98998765 ref_gl/gl4es: bump
To get this bugfix: 221fa1e67a
2020-12-29 03:25:57 +03:00
Andrey Akhmichin 5aef09ce5d engine: client: simplified strings operations. 2020-12-29 01:07:00 +03:00
Gleb Mazovetskiy 69e15e9c7b gl4es: Fix `so` name and add to renderer collector
1. `libref_gles2_gl4es.so` -> `libref_gl4es.so` because this is what's
    passed to `R_LoadRenderer`.

2. Add `gl4es` to `DEFAULT_RENDERERS` so that `R_CollectRendererNames`
   finds it.
2020-12-29 00:44:42 +03:00