Commit Graph

71 Commits

Author SHA1 Message Date
Ivan Avdeev
9b8af6d28b shaders: add compute shaders; fix shaders install dir 2021-03-01 23:34:20 -08:00
Ivan Avdeev
dc71afd08a Merge remote-tracking branch 'upstream/vulkan' into vulkan-glslc 2021-03-01 23:22:40 -08:00
Ivan Avdeev
74bcb56abf
Merge pull request #5 from FWGS/vulkan-upstream-move-cvars
upstream sync: move cvars that are expected from render to engine
2021-03-01 22:59:40 -08:00
Ivan 'provod' Avdeev
e0ee4b756b rtx: make it draw yellow screen
this basically checks that acceleration structurs are building without
any vulkan errors (we still don't know whether they are bulding with
correct geometry though).

we also have compute shader pipeline ready for ray tracing (yay)
but it doesn't do any raytracing yet
2021-03-01 11:22:58 -08:00
Ivan Avdeev
5e3010489b rtx: blindly add tlas and compute rendering
it's unknown whether it works at all
no real ray tracing yet
2021-03-01 10:52:08 -08:00
af48821eec ref_vk: move cvars that expected to exist by client.dll from render dll to engine 2021-03-01 20:09:37 +03:00
Ivan 'provod' Avdeev
c77f39e353 rtx: fix blas creation validation/memory errors 2021-02-27 15:40:57 -08:00
Ivan Avdeev
9954288450 rtx: add blas building skeleton 2021-02-27 13:43:49 -08:00
Ivan Avdeev
973ef4c677 separate buffer space allocation from buffer uploading
Now each geometry is first allocated a slot with VK_RenderBufferAlloc,
and then VK_RenderBufferLock/Unlock are used to upload buffer contents.

This allow for two things:
1. Uploading buffer data to GPU memory on/after Unlock.
2. (Re)building BLAS for RTX on/after Unlock.

These buffers are now directly referenced by render_draw_t, which also
will be helpful in the future for both renderers.
2021-02-22 18:57:46 -08:00
Ivan 'provod' Avdeev
4349d6b7fa rtx: update vulkan version req to 1.2 2021-02-22 10:16:58 -08:00
Ivan Avdeev
46da9ad457 rtx: request RTX device extensions when -rtx argument is present
It doesn't do anything yet.
2021-02-22 09:46:29 -08:00
Ivan 'provod' Avdeev
ded8442993 auto-detect VULKAN_SDK path on windows 2021-02-21 23:28:33 -08:00
Ivan Avdeev
3f70b76208 engage scene rendering in VK_RenderFrame and not in EndFrame
Rework a bit how matrices are computed. More global state dependencies
;_;

Buffer-up draw commands, and only schedule them for drawing at EndFrame.
2021-02-20 14:54:57 -08:00
Ivan Avdeev
a5e279f580 fix sprite blending
Disable depth test and set dst blend factor to 1 for kRenderGlow mode.
Sprites are occluded in software.

(does this break any other code depending on Glow mode? who knows)
2021-02-20 12:46:16 -08:00
Ivan Avdeev
8dc0d4256d add VK_RenderDebugLabelBegin/End calls; fix studio model labeling 2021-02-20 12:35:04 -08:00
Ivan Avdeev
e66810a05b remove ubo management from "public" vk_render api
Now rendering submodules specify their colors and matrices using
VK_RenderState global stat api. This is a trade-off between making all
submodules track their state on their own, or managing that state
centrally.
2021-02-20 12:00:31 -08:00
Ivan Avdeev
15fdcab5fe add plan for stream 2021-02-19 23:07:45 -08:00
Ivan Avdeev
56c68dea0b fix beam entities piling up 2021-02-17 13:48:41 -08:00
Ivan Avdeev
3b1e7be112 add beams rendering
not all beam types are supported yet

also changes studio api init sequence, fixes missing cvars
vertex type struct is no longer names as brush-specific
uniform buffer allocation is now in vk_render

blending issues still remain
2021-02-17 13:26:09 -08:00
Ivan Avdeev
b22cd90184 add initial sprite rendering
alpha blending is broken
animations are weird, but we do draw them nonetheless somehow
2021-02-15 12:20:25 -08:00
Ivan Avdeev
538ae9191f coalesce studio model draw calls
it's easier to debug, and supposedly is faster to render too
2021-02-15 10:11:12 -08:00
Ivan Avdeev
c53bfaf484 add view(weapon) models 2021-02-15 09:55:42 -08:00
Ivan Avdeev
6fbd63bd1f fix models rendering and animation
RI.drawMode affects how time is interpreted for models, so make sure it
uses the correct time

implement indexing for model rendering -- this fixes weird holes
2021-02-13 23:24:21 -08:00
Ivan Avdeev
778cc60453 add broken studio models drawing
there are several issues with it:
- there are holes in models
- movement is jerky
- no lighting applied
2021-02-13 17:19:59 -08:00
Ivan Avdeev
e14f004785 Merge remote-tracking branch 'upstream/vulkan-anim-textures' into vulkan 2021-02-10 11:08:49 -08:00
Ivan Avdeev
5ebe36c54c move buffer allocation to vk_render.c from vk_bruh.c 2021-02-10 10:33:44 -08:00
074e4fd540 glslc: rework tool, support dependency scan, preliminary work on making tool dependless from compiler(like ccroot) 2021-02-10 03:51:11 +03:00
c1ef953672 waf: add glslc module 2021-02-10 03:50:55 +03:00
cbdca0abf9 implement texture animation and random tiling 2021-02-10 03:45:38 +03:00
Ivan Avdeev
ad5d515200 move entity enumeration from vk_brush to vk_scene 2021-02-08 10:57:27 -08:00
Ivan Avdeev
e5b14c0393 fix glitches on intel gpus due to misaligned uniform buffer offsets
Use VkPhysicalDeviceLimits.minUniformBufferOffsetAlignment to align dynamic uniform buffer offsets used per brush.
2021-02-07 23:19:22 -08:00
Ivan Avdeev
2704f442e9 fix lightmap corruption 2021-02-06 13:51:23 -08:00
Ivan Avdeev
45ad261129 make unimplemented message less verbose 2021-02-06 13:38:38 -08:00
Ivan Avdeev
14db07f985 draw HUD sprites 2021-02-06 13:13:08 -08:00
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