Commit Graph

1468 Commits

Author SHA1 Message Date
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
652a946e09 ref_gl: update gl4es submodule 2021-01-29 03:33:36 +03:00
d6d90f03a0 wscript: refactoring, split optimization flags selection and fpic control into standalone modules 2021-01-29 03:33:14 +03:00
d7b3c7b681 engine: proper order for XASH_LOW_MEMORY definitions 2021-01-29 03:24:41 +03: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
c158771f59 ref_gl: gl_rsurf.c: don't use asserts to prevent engine from stopping when vbo is disabled. 2021-01-17 23:11:59 +03: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
63c4b2748c platform: win32: sdl: Fix zombie processes after early Sys_Error on windows+sdl 2021-01-16 01:13:57 +03: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
9bc3d6d315 utils: mdldec: better validity checks. 2021-01-10 02:31:19 +03:00
1a59389261 utils: mdldec: STUDIO_NF_SMOOTH texture flag means "smooth" texrendermode. 2021-01-10 02:30:56 +03: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
221a9bab54 Fix screenshots on gles1
> format must be either GL_RGBA or the value of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES.
2021-01-09 18:36:46 +03:00
102fb8ec40 mainui: update submodule 2021-01-08 07:43:06 +03:00
db89c4236a vgui-dev: update submodule 2021-01-08 07:42:57 +03:00
b1048556c6 gitignore: fix waf ignores 2021-01-08 00:25:14 +03:00
Gleb Mazovetskiy
11194f339d game_launch: Add a --disable-menu-changegame build option
This option is useful when xash3d is launched externally by a script
that performs additional setup.
2021-01-07 22:27:21 +03:00
Gleb Mazovetskiy
c95e847890 Fix joystick trigger thresholds
They were negative by default but they should've been positive:

> a value ranging from -32768 to 32767. Triggers, however, range from 0 to 32767 (they never return a negative value).
https://wiki.libsdl.org/SDL_GameControllerGetAxis

This fixes LTRIGGER and RTRIGGER (L2/Zl and R2/Zr on most gamepads)
2021-01-07 17:37:37 +03:00
Gleb Mazovetskiy
4daa7c23a0 SDL2 GameController: Map axes to engine explicitly 2021-01-07 17:37:37 +03:00
Gleb Mazovetskiy
3e8e751dc7 GameController: Add separate D-Pad bindings
1. Adds separate D-Pad bindings so that they don't conflict with arrow
   keys on the keyboard.
2. Also adds some basic defaults for gamepad buttons.
2021-01-07 17:37:37 +03:00
Gleb Mazovetskiy
239474b01e .clang-format: SpaceBeforeParens: Never
This is more consistent with how xash3d formats its `if` and `switch` statements
2021-01-07 17:34:51 +03:00
Gleb Mazovetskiy
12b579bc34 Fix R_CollectRendererNames
Previously R_CollectRendererNames left gaps in the `ref` subarrays.
This caused `R_Init` to fail in some cases because it iterates between `0` and `ref.numRenderers`.
2021-01-07 17:34:34 +03:00
Gleb Mazovetskiy
6d614e028a Fix COM_LibraryError newline handling
1. Do not append a trailing newline to the result of COM_GetLibraryError.
2. Fix call sites.
2021-01-07 17:33:09 +03:00
Gleb Mazovetskiy
a234888d44 Remove DEFAULT_(ACCELERATED|SOFTWARE)_RENDERER
This is no longer needed as we now use DEFAULT_RENDERERS order priority
and only try to load the detected renderers.
2021-01-07 17:31:56 +03: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
Gleb Mazovetskiy
5e0a0765ce Trim all trailing whitespace
The `.editorconfig` file in this repo is configured to trim all trailing
whitespace regardless of whether the line is modified.

Trims all trailing whitespace in the repository to make the codebase easier
to work with in editors that respect `.editorconfig`.

`git blame` becomes less useful on these lines but it already isn't very useful.

Commands:

```
find . -type f -name '*.h' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
find . -type f -name '*.c' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
```
2021-01-04 20:55:10 +03: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