Commit Graph

1534 Commits

Author SHA1 Message Date
Bill Currie 3a17e062da [renderer] Merge sprite billboarding code
As the sw renderer's implementation was the closest to id's, it was used
as the model (thus a fair bit of cleanup is still needed). This fixes
some incorrect implementations in glsl and gl.
2021-12-24 06:45:13 +09:00
Bill Currie 8c5c39cbe4 [vulkan] Mix turb full-brights into main color
I'd forgotten (when doing the original brush texture loader) that
turbulent surfaces were unlit and thus always full-bright, then never
wrote the turb shader to take care of it. The best solution seems to be
to just mix the two colors in the shader as it will allow turb surfaces
to be lit in the future (probably with severely limited light counts due
to being a forward renderer).
2021-12-24 06:45:13 +09:00
Bill Currie d5b824a47c [vulkan] Switch alias pipeline to multi-texture
This gets the alias pipeline in line with the bsp pipeline, and thus
everything is about as functional as it was before the rework (minus
dealing with large texture sets).
2021-12-24 06:45:13 +09:00
Bill Currie 11492d77ce [vulkan] Switch bsp renderer to multi-texture
I guess it's not quite bindless as the texture index is a push constant,
but it seems to work well (and I may have fixed some full-bright issues
by accident, though I suspect that's just my imagination, but they do
look good).
2021-12-24 06:45:13 +09:00
Bill Currie 6fbce335bb [vulkan] Add an array view for default_magenta
The validation layers get very picky about image view types (rightfully
so, I imagine).
2021-12-24 06:45:13 +09:00
Bill Currie 2740f6093b [vulkan] Update shaders and layouts for new scheme
Still need to work on the code, though.
2021-12-24 06:45:13 +09:00
Bill Currie 8422732505 [vulkan] Move matrices into per-frame buffers
This should fix the horrid frame rate dependent behavior of the view
model.

They are also in their own descriptor set so they can be easily shared
between pipelines. This has been verified to work for Draw.
2021-12-24 06:45:13 +09:00
Bill Currie e8961342d5 [vulkan] Fix some mostly harmless typos 2021-12-24 06:45:13 +09:00
Bill Currie d7f588ecfe [vulkan] Rework bsp texture loader
BSP textures are now two-layered with the albedo and emission in the two
layers rather than two separate images. While this does increase memory
usage for the textures themselves (most do not have fullbright pixels),
it cuts down on image and image view handles (and shader resources).
2021-12-24 06:45:13 +09:00
Bill Currie ff6d6f6dd6 [vulkan] Rework shaders and pipelines for bindless textures
Smashing everything in the process :P (need to work on the C side).
However, while bindless is supposedly good for performance, the biggest
gain this will bring is portability: the texture counts are
automatically limited to what the hardware can handle, and the reliance
on push descriptors is removed (though they were nice and did help get
things up and running).
2021-12-24 06:45:13 +09:00
Bill Currie 3a742f59f7 [vulkan] Copy array() parameters correctly
I had forgotten that the parameters are in reverse order, and even if I
had remembered, I forgot to reset offset before the second loop.
Pre-decrementing offset takes care of both issues at once.
2021-12-24 06:45:13 +09:00
Bill Currie a0c935e8bc [vulkan] Make lighting samplers configurable
My VersaPro doesn't support more than 32 per-stage samplers (lavapipe).
This is a small part of getting Vulkan to run on lavapipe and even in
itself is rather incomplete.
2021-12-24 06:45:13 +09:00
Bill Currie f6cc138f48 [vulkan] Provide access to VkPhysicalDeviceLimits
Fixes the warning about parse_fixed_array not being used (oops, the
problem with partial commits), but more importantly, gives access to
things like maxDescriptorSetSamplers.
2021-12-24 06:45:13 +09:00
Bill Currie cff23ac93c [vulkan] Connect up the cexpr library
This will make property list expressions easier to work with. The
library is rather limited right now (trig, dot, min/max/bound) but even
just min adds a lot of functionality.
2021-12-24 06:45:12 +09:00
Bill Currie 8271860fb3 [vkgen] Add support for fixed arrays
I want to support reading VkPhysicalDeviceLimits but it has some arrays.
While I don't need to parse them (VkPhysicalDeviceLimits should be
treated as read-only), I do need to be able to access them in property
list expressions, and vkgen generates the cexpr type descriptors too.

However, I will probably want to parse arrays some time in the future.
2021-12-24 06:45:12 +09:00
Bill Currie c73e4efcb7 [vkgen] Don't queue types for fields with custom parsers
This ensures that unused parser blocks do not get emitted. In the
testing of the upcoming support for fixed arrays, the blend color
constants were being double emitted (both as custom and normal parser)
due to being an array. gcc did not like that (what with all those
warning flags).
2021-12-24 06:45:12 +09:00
Bill Currie a522464fc1 [vkgen] Clean up an unnecessary function redirect
I think it was mostly a holdover from early development, but it
certainly makes sense to tuck the functionality away in Struct.
2021-12-24 06:45:12 +09:00
Bill Currie c402275112 [vulkan] Add some more debug stack contexts 2021-12-24 06:45:12 +09:00
Bill Currie 75d06c4f98 [vulkan] Clean out some expired FIXME comments 2021-12-24 06:45:12 +09:00
Bill Currie 928408bad9 [vulkan] Support multiple render passes
Multiple render passes are needed for supporting shadow mapping, and
this is a huge step towards breaking the Vulkan render free of Quake,
and hopefully will lead the way for breaking the GL renderers free as
well.
2021-12-24 06:45:12 +09:00
Bill Currie 84a24dbb34 [renderer] Make R_RenderView private
This is actually a better solution to the renderer directly accessing
client code than provided by 7e078c7f9c.

Essentially, V_RenderView should not have been calling R_RenderView, and
CL_UpdateScreen should have been calling V_RenderView directly. The
issue was that the renderers expected the world entity model to be valid
at all times. Now, R_RenderView checks the world entity model's validity
and immediately bails if it is not, and R_ClearState (which is called
whenever the client disconnects and thus no longer has a world to
render) clears the world entity model. Thus R_RenderView can (and is)
now called unconditionally from within the renderer, simplifying
renderer-specific variants.
2021-12-24 06:45:12 +09:00
Bill Currie eb828007e9 [vulkan] Add a comment about next pass timing 2021-12-24 06:45:12 +09:00
Bill Currie b1ba87e5aa [vulkan] Use the short name for the image types
Yay for coming up with a solution for enums short names that start with
a number, makes things more readable.
2021-12-24 06:45:12 +09:00
Bill Currie 9e755f270e [vulkan] Set staging fence timeout to 5 seconds
0.5s seemes to be unreliable on my VersaPro, particularly after a large
build.
2021-12-24 06:45:12 +09:00
Bill Currie 02ba3da0ba [vulkan] Ease writing of specialization data
While using binary data objects for specialization data works for bools
(as they can be 0 or -1), they don't work so well for numeric values due
to having to get the byte order correct and thus are not portable, and
difficult to get right.

Binary data is still supported, but the data can be written as a string
with an array(...) "constructor" expression taking any number of
parameters, with each parameter itself being an expression (though
values are limited at this stage).

Due to the plist format, quotes are required around the expression
("array(...)")
2021-12-24 06:45:12 +09:00
Bill Currie 422ad2a6c9 [vulkan] Recreate lighting pvs sets when loading lights
Sets never shrink, so assigning a dynamically created set to a
statically created set after the working size has reduced (going from
demo2 to demo3) causes the set code to attempt to resize the statically
created set, which leads to libc having a bad time.
2021-12-24 06:45:12 +09:00
Bill Currie 0c0fce2f03 [vulkan] Drop lights with size 0
They can't contribute any light, so no point in keeping them. Fixes the
erroneous size-0 shadow maps in the second nq demo.
2021-12-24 06:45:12 +09:00
Bill Currie 08721f7a21 [vulkan] Destroy the right framebuffers
Why nvidia's drivers accepted double-destroyed framebuffers is beyond
me, but this fixes the Intel drivers complaining about such (and the
subsequent segfault).
2021-12-24 06:45:12 +09:00
Bill Currie 5b1052087a [vulkan] Calculate matrix offset correctly
When I changed the matrices from an array of floats to an array of
vec4f_t, I forgot to update the flush offsets. Yay for having a
Vulkan-capable Intel device with its different alignment requirements.
2021-12-24 06:45:12 +09:00
Bill Currie 25559243ae [vulkan] Add function to compute next offset
When allocating memory for multiple objects that have alignment
requirements, it gets tedious keeping track of the offset and the
alignment. This is a simple function for walking the offset respecting
size and alignment requirements, and doubles as a size calculator.
2021-12-24 06:45:12 +09:00
Bill Currie 8b85e422d7 [vulkan] Add a debug stack to the vulkan instance
The stack is arbitrary strings that the validation layer debug callback
prints in reverse order after each message. This makes it easy to work
out what nodes in a pipeline/render pass plist are causing validation
errors. Still have to narrow down the actual line, but the messages seem
to help with that.
Putting qfvPushDebug/qfvPopDebug around other calls to vulkan should
help out a lot, tool.
As a bonus, the stack is printed before debug_breakpoint is called, so
it's immediately visible in gdb.
2021-11-30 18:10:48 +09:00
Bill Currie 2334798432 [vulkan] Make vulkan_use_validation easier more useful
Rather than just 0/1, it now acts as flags to control what messages are
printed. In addition to the Vulkan enum names (long and short), none and
all are supported (as well as raw numbers, but they're not checked for
validity). This makes vulkan_use_validation a bit easier to use and less
verbose by default.

Now, if only it was easier to remember the name :P
2021-11-30 18:10:48 +09:00
Bill Currie 901619235b [vulkan] Split out cvar enum parsing code
Need to reuse it :)
2021-11-30 18:10:48 +09:00
Bill Currie 52f86adb84 [vulkan] Fail gracefully if vulkan driver init fails
Well, a little more gracefully than a segfault, at least.
2021-11-30 18:10:48 +09:00
Bill Currie c9508f7261 [vkgen] Name-shorten extension enum flag bits
The prefix was being stripped, but not the _BIT_EXT suffix. This makes
extension flags a little easier to use.
2021-11-30 18:10:48 +09:00
Bill Currie 1efeac6d60 [vkgen] Support specifying enum "searches" directly
Being able to parse enums that aren't part of a specified struct is
handy for cvars.
2021-11-30 18:10:18 +09:00
Bill Currie d1153be594 [build] Move plist rules to root Makefile
They are globally useful rather than specific to the vulkan renderer.
2021-11-25 20:23:18 +09:00
Bill Currie 88b3965794 [vulkan] Pick up vulkan.h from correct location
Well... it could be done better, but this works for now assuming it's in
/usr/include (and it's correct for mxe builts). Does need proper
autoconfiscation, though.
2021-11-19 22:36:19 +09:00
Bill Currie a4f71cb4d5 [renderer] Clean out unneeded input.h includes
I really don't know how it goot into the gl/glsl vid_common files, but I
imagine it propogated to vulkan because I copied one then cloned from
there.
2021-10-01 13:11:14 +09:00
Bill Currie a6a273bb07 [vulkan] Fix up test function api
Whil I can't automatically run the tests in windows builds, at least I
can make sure they build (and run individual ones by hand as necessary).
2021-08-11 12:31:03 +09:00
Bill Currie 42dc30ec29 [vulkan] Increase main staging buffer to 32MB
1k 32bpp sky textures need 24MB to load. Though there's always better
handling of running out of stating buffer (ie, flushing and trying
again).
2021-08-02 23:17:55 +09:00
Bill Currie ec54c54226 [build] Fix some windows bitrot 2021-08-02 14:02:41 +09:00
Bill Currie d99fb01b65 [build] Fix some distcheck bitrot 2021-08-02 13:47:00 +09:00
Bill Currie 674ffa0941 [util] Make bsp_t counts size_t
and other bsp data counts unsigned, and clean up the resulting mess.
2021-08-01 21:54:05 +09:00
Bill Currie 54604d9aa2 [util] Make hunk (optionally) thread-safe
For now, the functions check for a null hunk pointer and use the global
hunk (initialized via Memory_Init) if necessary. However, Hunk_Init is
available (and used by Memory_Init) to create a hunk from any arbitrary
memory block. So long as that block is 64-byte aligned, allocations
within the hunk will remain 64-byte aligned.
2021-07-29 11:43:27 +09:00
Bill Currie 50740c1014 [model] Remove the confusion about numleafs
The fact that numleafs did not include leaf 0 actually caused in many
places due to never being sure whether to add 1. Hopefully this fixes
some of the confusion. (and that comment in sv_init didn't last long :P)
2021-07-27 12:38:08 +09:00
Bill Currie 2e33503c4c [vulkan] Fix a missed array index edit
Caused by the view model implementation, and missed because gcc needs
optimization to cache such errors (and my own error, of course).
2021-07-26 11:43:31 +09:00
Bill Currie f47e03e606 [model] Remove 64k limit on visible leafs
Modern maps can have many more leafs (eg, ad_tears has 98983 leafs).
Using set_t makes dynamic leaf counts easy to support and the code much
easier to read (though set_is_member and the iterators are a little
slower). The main thing to watch out for is the novis set and the set
returned by Mod_LeafPVS never shrink, and may have excess elements (ie,
indicate that nonexistent leafs are visible).
2021-07-26 11:32:05 +09:00
Bill Currie 7995f59a90 [vulkan] Set the 2d near distance to 0
-999999 seems to be a hold-over from the software renderer passed
through both gl renderers. I guess it didn't matter in the gl renderers
due to various draw hacks, but it made quite a difference in vulkan.
Fixes the view model covering the hud.
2021-07-25 14:21:37 +09:00
Bill Currie 56c2fa380b [vulkan] Implement view model rendering
Quake just looked wrong without the view model. I can't say I like the
way the depth range is hacked, but it was necessary because the view
model needs to be processed along with the rest of the alias models
(didn't feel like adding more command buffers, which I imagine would be
expensive with the pipeline switching).
2021-07-25 14:03:25 +09:00
Bill Currie 7868936b96 [vulkan] Correct the skysheet scaling
Dunno where that 8 came from, but it's quite a bit different from 189/64
(2.953125). Fixes the excessively high skies in vulkan.
2021-07-24 14:23:06 +09:00
Bill Currie 40a26e4bc8 [scene] Rename libQFentity to libQFscene
And start working on scene management.
2021-07-24 14:20:59 +09:00
Bill Currie c134e9d348 [renderer] Remove R_EnqueueEntity from the plugin funcs
Forgot about this when fixing the ctf flags.
2021-07-23 12:46:53 +09:00
Bill Currie 49afdde77f [vulkan] Add some comments and clean some code
Figuring out bsp rendering for shadows is a fair bit harder than
expected :P
2021-07-22 16:15:14 +09:00
Bill Currie f1ac8f2460 [renderer] Remove currententity from non-sw renderers
Really needed only for vulkan, but removing currententity from gl and
glsl made testing easier.
2021-07-22 16:15:14 +09:00
Bill Currie 3351b62318 [renderer] Move driver specific texture chain defs
The GL/GLSL/Vulklan texture chaining defs never should have been in
r_internal.h in the first place. They still need a better name, though.
2021-07-21 16:36:51 +09:00
Bill Currie 0f259c647b [vulkan] Clean out some dead code
While I might want to support lightmaps in the future (eg, for ambient
occlusion), the commented out code is confusing.
2021-07-21 14:54:07 +09:00
Bill Currie 5864406f4d [vulkan] Enable all lights when camera out of map
Without shadows, this is quite the cheat, but noclip is a cheat anyway,
so probably not that big a deal. It does, however, make noclip usable
for debugging.
2021-07-21 14:15:56 +09:00
Bill Currie 6962c5948a [vulkan] Clean up some more unused bsp data
Since vulkan supports 32-bit indexes, there's no need for the
shenanigans the EGL-based glsl renderer had to go through to render bsp
models (maps often had quite a bit more than 65536 vertices), though the
reduced GPU memory requirements of 16-bit indices does have its
advantages.
2021-07-19 23:38:09 +09:00
Bill Currie 924c970868 [vulkan] Pre-compute the sun's PVS
Any sun (a directional light) is in the outside node, which due to not
having its own PVS data is visible to all nodes, but that's a tad
excessive. However, any leaf node with sky surfaces will potentially see
any suns, and leaf nodes with no sky surfaces will see the sun only if
they can see a leaf that does have sky surfaces. This can be quite
expensive to calculate (already known to be moderately expensive for
just the camera leaf node (singular!) when checking for in-map lights)
2021-07-19 22:36:51 +09:00
Bill Currie 87dc35e2fd [renderer] Be more consistent with msurface_t names
Use "surf" everywhere in gl, glsl and vulkan. Not worried about sw/sw32
at this stage (I don't poke around in there anywhere near as much).
2021-07-19 06:55:36 +09:00
Bill Currie 3c93d555e3 [gl] Correct calculation of screen aspect
vrect_t's fields are ints, and it was vid.aspect that prevented the
quotient being truncated. Fixes the rather squashed looking world.
2021-07-19 06:55:36 +09:00
Bill Currie f7efcde7ab [vulkan] Clean up and document some of the bsp code
Getting close to understanding (again) how it all works. I only just
barely understood when I got vulkan's renderer running, but I really
need to understand for when I modify things for shadows. The main thing
hurdle was tinst, but that was dealt with in the previous commit, and
now it's just sorting out the mess of elechains and elementss.
2021-07-13 22:59:51 +09:00
Bill Currie c8e6f71a30 [renderer] Remove tinst from msurface_t
Its sole purpose was to pass the newly allocated instsurf when chaining
an instance model (ammo box, etc) surface, but using expresion
statements removes the need for such shenanigans, and even makes
msurface_t that little bit smaller (though a separate array would be
much better for cache coherence).

More importantly, the relevant code is actually easier to understand: I
spent way too long working out what tinst was for and why it was never
cleared.
2021-07-13 16:02:47 +09:00
Bill Currie 12450fe6b8 [vid] Remove redundant direct, conbuffer and conrowbytes 2021-07-11 13:44:00 +09:00
Bill Currie 91eeae5186 [qw] Clean up netgraph somewhat
The renderer's LineGraph now takes a height parameter, and netgraph now
uses cl_* cvars instead of r_* (which never really made sense),
including it's own height cvar (the render graphs still use
r_graphheight).
2021-07-11 10:59:27 +09:00
Bill Currie c4cc5b2756 [sw32] Fix the over-tall netgraph lines 2021-07-11 00:12:03 +09:00
Bill Currie a05210d864 [video] Get 16 and 32 bit sw32 mostly working in x11
Lighting on alias models seems to be borked, and skies are borked in
both sw renderers (seems to be nothing to do with this commit, though).
2021-07-11 00:09:41 +09:00
Bill Currie ed606fb670 [render] Fix some incorrect r_data references
The render plugins have made a bit of a mess of getting at the data and
thus it's a tad confusing how to get at it in different places. Really
needs a proper cleanup :(
2021-07-10 18:30:46 +09:00
Bill Currie 755ef524e4 [video] Use views instead of conwidth and conheight
conwidth and conheight have been moved into vid.conview (probably change
the name at some time), and scr_vrect has been replaced by a view as
well. This makes it much easier to create 2d elements that follow the
screen size (taking advantage of a view's gravity) which will, in the
end, make changing the window size easier.
2021-07-10 18:04:34 +09:00
Bill Currie 4b1eb0d760 [sw] Speed up Draw_FadeScreen
It now processes 4 pixels at a time and uses a bit mask instead of a
conditional to set 3 of the 4 pixels to black. On top of the 4:1 pixel
processing and avoiding inner-loop conditional jumps, gcc unrolls the
loop, so Draw_FadeScreen itself is more than 4x as fast as it was. The
end result is about 5% (3fps) speedup to timedemo demo1 on my 900MHz
EEE Pc when nq has been hacked to always draw the fade-screen.
2021-07-08 14:18:06 +09:00
Bill Currie f18e1366ba [vulkan] Silence vkgen's debug output
It was hidden by qwaq-curses, but the switch to using qwaq-cmd made it
pretty obvious.
2021-07-06 12:27:21 +09:00
Bill Currie ae58a8ba5d [qwaq] Create a commandline-only version of qwaq
qwaq-curses has its place, but its use for running vkgen was really a
placeholder because I didn't feel like sorting out the different
initialization requirements at the time. qwaq-cmd has the (currently
unnecessary) threading power of qwaq-curses, but doesn't include any UI
stuff and thus doesn't need curses. The work also paves the way for
qwaq-x11 to become a proper engine (though sorting out its init will be
taken care of later).

Fixes #15.
2021-07-06 12:25:24 +09:00
Bill Currie 490cf966f9 [vulkan] Fix compiling on 32-bit systems
Casting between ints and pointers can be awkward.
2021-07-06 11:54:12 +09:00
Bill Currie e81d690b51 [input] Create QF input library using keys.c
This refactors (as such) keys.c so that it no longer depends on console
or gib, and pulls keys out of video targets. The eventual plan is to
move all high-level general input handling into libQFinput, and probably
low-level (eg, /dev/input handling for joysticks etc on Linux).

Fixes #8
2021-07-05 16:26:07 +09:00
Bill Currie 139a6aee87
Merge pull request #17 from ionenwks/noexecstack
Add GNU-stack notes to assembly files
2021-06-28 10:16:46 +09:00
Bill Currie 0be609e0fd [util] Make PI_LoadPlugin always call general init function
As the root cause for #16 was something else, this fixes only the basic
cvar initialization, but does fix #19 (for now, at least).
2021-06-26 16:18:05 +09:00
Bill Currie c9319966ce [plugin] Clean up the rest of the plugin structs 2021-06-22 19:47:20 +09:00
Ionen Wolkens 881add2c51
Add GNU-stack notes to assembly files
Prevents GCC from assuming an executable stack is needed.

Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
2021-06-13 10:12:03 -04:00
Bill Currie 813497a1aa [ui] Create library for UI support code
Currently this has text buffer, input line, vrect and view code.
2021-06-12 22:50:51 +09:00
Bill Currie 204578772d [gl] Move clearing to screen's render frame
This allows 2d-only to be cleared properly.
2021-06-04 16:32:42 +09:00
Bill Currie 897f8ebfbe [vulkan] Fix vkgen linking
I had missed the edit while getting qf to build on my eeepc due to not
having vulkan.
2021-06-01 19:10:01 +09:00
Bill Currie 758a44a946 [vulkan] Fix an uninitialized variable warning
semi-bogus, but I prefer false positives to false negatives.
2021-06-01 19:09:03 +09:00
Bill Currie c5f2aca07d [vulkan] Conditionalize vulkan tests 2021-06-01 18:53:53 +09:00
Bill Currie 85087177bf [vulkan] Conditionalize build of vkgen
vkgen cannot be built if vulkan headers are unavailable.
2021-06-01 18:53:53 +09:00
Bill Currie 1cf40be484 [vulkan] Create shadow maps and basic data
I will definitely need to look into sparse images later (2.3GB for
marcher) but the shadow map images, views and matrices are created.
2021-04-29 20:54:38 +09:00
Bill Currie 562f3c2fe2 [vulkan] Add tan and cos perspective projection
The tan and cos versions allow specifying the fov directly from the tan
or cos of the half angle, useful for dealing with lights.
2021-04-29 19:27:01 +09:00
Bill Currie c86f0c9449 [vulkan] Move projection matrix code to its own file
And move more stuff over to simd.
2021-04-25 15:48:21 +09:00
Bill Currie 590f0f18bc [vulkan] Check leaf sky visibility for suns
And fix some out-by-one errors for leaf visibility (pvs index 0 is
actually leaf index 1)
2021-04-25 12:27:07 +09:00
Bill Currie ae231319ea [vulkan] Implement all the extended light models
Standard quake has just linear, but the modding community added inverse,
inverse-square (raw and offset (1/(r^2+1)), infinite (sun), and
ambient (minlight). Other than the lack of shadows, marcher now looks
really good.
2021-04-25 12:27:07 +09:00
Bill Currie 52168da93e [vulkan] Don't lose other sky cube faces
Because LoadImage uses Hunk_TempAlloc, the face images need to be copied
individually. Really, what's neeeded is to be able to load the image
data into a pre-allocated buffer (ideally, the staging buffer for
vulkan, but that's for later).
2021-04-25 08:38:48 +09:00
Bill Currie 785be9d340 [vulkan] Clean up buffer barriers a bit
This even fixes a couple of minor issues that snuck past validation.
2021-04-24 15:47:31 +09:00
Bill Currie dc9b64fadd [vulkan] Clean up image barriers a bit
Mostly, this gets the stage flags in with the barrier, but also adds a
couple more barrier templates. It should make for slightly less verbose
code, and one less opportunity for error (mismatched barrier/stages).
2021-04-24 12:42:29 +09:00
Bill Currie 8c03ed8be5 [vulkan] Start work on shadows
This gets the shaders needed for creating shadow maps, and the changes
to the lighting pipeline for binding the shadow maps, but no generation
or reading is done yet. It feels like parts of various systems are
getting a little big for their britches and I need to do an audit of
various things.
2021-04-24 10:40:39 +09:00
Bill Currie c29e9828b6 [vulkan] Clean up misuse of va for vulkan handles
The built up "path" name of the handle resource was not always surviving
the intervening call to cexpr_eval_string (in particular, when other
handles were created in the process of creating a handle). Rather than
simply increase the number of va buffers (where would it end?), just
regenerate the path when adding the new handle. It's probably quick
enough, and the code is not usually not on a critical path.
2021-04-22 19:47:42 +09:00
Bill Currie 140425be33 [vulkan] Name some more objects
Shaders and descriptor set layouts.
2021-04-19 18:07:45 +09:00
Bill Currie 2918410b30 [vulkan] Fix a couple of minor issues
Magic number for compose descriptors and mistaken masking of vulkan
plist parse errors.
2021-04-19 18:07:45 +09:00
Bill Currie 52bfb0aeb0 [vulkan] Label the drawing command buffers 2021-04-19 18:07:45 +09:00
Bill Currie da39bb2df3 [vulkan] Use more correct dependency flags
I was reading about multi-pass rendering on mobile devices
(https://developer.oculus.com/blog/loads-stores-passes-and-advanced-gpu-pipelines/)
and discovered that I had used the wrong flags (but then, I think Graham
Sellers had, too, since used his Vulkan Programming Guide as a
reference). Doesn't seem to make any difference on desktop, but as
there's no loss there, but potential gains on mobile, I'd say it's a
win.
2021-04-18 18:56:31 +09:00
Bill Currie 64bfaeca6c [vulkan] Skip values array for empty enum symtabs
Fixes an unused warning/error when the enum has no interesting values
(eg, VkRenderPassCreateFlagBits on older versions of the vulkan api).
2021-04-03 00:06:54 +09:00
Bill Currie 39103cc8a3 [sw] Fix some 32-bit assembly issues
I'm not sure that the mismatch between refdef_t and the assembly defines
was a problem (many fields unused), but the main problem was due to
execute permission on the pages: one chunk of asm was in the data
section, and the patched code was not marked as being executable (due to
such a thing not existing when quake was written).
2021-04-02 22:17:32 +09:00
Bill Currie e50a079f72 [vulkan] Fix some 32-bit compatibility issues
mostly dealing with vulkan's handles always being 64-bit, but pointers
being either 32 or 64.
2021-04-02 08:48:11 +09:00
Bill Currie 612eb49d9c [render] Separate fov x and y calculations
This ensures that fov_y is not calculated until after the render view
size is known and thus doesn't become some crazy angle (that happens to
result in a negative tan). Fixes upside-down-quake :)
2021-04-01 19:40:25 +09:00
Bill Currie 37d35811e3 [vid,render] Clean up fov and aspect
vid.aspect is removed (for now) as it was not really the right idea (I
really didn't know what I was doing at the time). Nicely, this *almost*
fixes the fov bug on fresh installs: the view is now properly
upside-down rather than just flipped vertically (ie, it's now rotated
180 degrees).
2021-04-01 19:17:19 +09:00
Bill Currie f13af65b32 [vulkan] Move viewport and scissor into vulkan_ctx
Not only does it makes sense to centralize the setting of viewport and
scissor, but it's actually necessary in order to fix the upside-down
rendering on windows.
2021-04-01 11:44:30 +09:00
Bill Currie 63e30e6ae0 [win] Fix a handful of small bugs for windows
Only 64-bit windows is tested, and there are still various failures, but
QF is limping along in windows again.

nq-sdl works for sw, and sw32, gl and glsl are mostly black (but not
entirely for gl?),  vulkan is not supported with sdl.

nq-win works for sw and sw32, and sort of for vulkan (very dark and
upside-down?). gl and glsl complain about vid mode,

qw-client-[sdl,win] seem to be the same, but something is wrong with the
console (reading keyboard input).
2021-03-30 20:19:20 +09:00
Bill Currie ae78c81b3a [render] Fail gracefully on unsupported render targets
Ideally, this won't be the case, but it currently is for Vulkan and SDL.
2021-03-30 18:29:18 +09:00
Bill Currie 5f93c115ff [util] Make developer flag names easier to manage
They're now an enum, and the flag part of the name is all lowercase, but
now the flag definitions and names list will never get out of sync.
2021-03-29 22:38:47 +09:00
Bill Currie 64f51bda6e [build] Get make distcheck working again
again...

This covers only the basic check with a build in debian, but it's a good
start.
2021-03-29 17:35:30 +09:00
Bill Currie 6fea5f5e1a [build] Add -Wformat-non-literal option
While this caused some trouble for pr_strings and configurable strftime
(evil hacks abound), it's the result of discovering an ancient (from
maybe as early as 2004, definitely before 2012) bug in qwaq's printing
that somehow got past months of trial-by-fire testing (origin understood
thanks to the warning finding it).
2021-03-29 17:27:06 +09:00
Bill Currie 88ff254f42 Get QF cross-compiling using MXE/mingw32
This includes -win clients (no clue if anything actually works yet).
2021-03-27 20:09:37 +09:00
Bill Currie 5b1ee0e6f6 [vulkan] Fix an inappropriate cast
I'm surprised that worked at all (and more surprised it got past linux
gcc).
2021-03-27 19:55:43 +09:00
Bill Currie a9bd436837 [build] Autoconfiscate printf format attribute
I don't know if gnu_printf is appropriate for all cases, but it is
needed for mingw32.
2021-03-27 19:52:59 +09:00
Bill Currie a32e2319e2 Merge branch 'master' into win-merge 2021-03-25 22:42:16 +09:00
Bill Currie c9f1d770e0 Merge master into csqc-improvements
That was a mess
2021-03-25 22:01:31 +09:00
Bill Currie 67c220de76 Make R_SetVrect const-correct. 2021-03-25 18:14:17 +09:00
Bill Currie 91e3769c05 Recalculate the fov when the cvar changes.
This separate the FOV calculations from other refdef calcs, cleaning up the
renderer proper and making it easier for other parts of the engine (eg,
csqc) to update the fov.
2021-03-25 18:14:03 +09:00
Bill Currie 32c2e013ca [vulkan] Add missed screen capture files
Rather critical to the build (and screenshots)
2021-03-25 16:00:19 +09:00
Bill Currie 999dd8248b [vulkan] Implement sky box loading and rendering
Loading is broken for multi-file image sets due to the way images are
loaded (this needs some thought for making it effecient), but the
Blender environment map loading works.
2021-03-25 15:54:34 +09:00
Bill Currie c5c44da727 [vulkan] Implement screenshot
Finally, I can brag about my progress on irc :)
2021-03-24 19:20:53 +09:00
Bill Currie 51d6ec7c8c [vulkan] Fix what looks like a thinko
It looked like the code would have deleted a replacement swapchain
instead of the one being replaced.
2021-03-24 12:04:09 +09:00
Bill Currie a0d47de439 [vulkan] Suppress all the debug output
silence is golden
2021-03-23 13:04:22 +09:00
Bill Currie 7e946a4de9 [vulkan] Implement water surface rendering
They're unlit (fullbright, but that's nothing new for quake), but
working nicely. As a bonus, sort out the sky pass (forced to due to the
way command buffers are used).
2021-03-23 12:24:24 +09:00
Bill Currie 6e0312658d [vulkan] Fix sky depth issues
There were actually several problems: translucency wasn't using or
depending on the depth buffer, and the depth buffer wasn't marked as
read-only in the g-buffer pass. Getting that correct seems to have given
bigass1 a 0.5% boost (hard to say, could be the usual noise).
2021-03-23 11:26:24 +09:00
Bill Currie 5ac807d4b2 [vulkan] Remove the old forward renderpass spec
I doubt I'll go back to it, and it was in the wrong place anyway.
2021-03-23 10:12:26 +09:00
Bill Currie d4e1bfb8b8 [vulkan] Clean up the pipeline specifications
While being able to write pipeline specs like this was the end goal of
the parsing sub-project, I didn't realize it was already usable. This
sure makes going through the pipeline specs much easier.
2021-03-23 10:01:13 +09:00
Bill Currie 81956095f1 [vulkan] Use correct vertex shader for skys
This gets skys rendering again, but their depth is incorrect.
2021-03-23 08:25:56 +09:00
Bill Currie de581501fb [vulkan] Early out from lights that are too distant
Gives a 43% speed boost to bigass1 timedemo (366 -> 525 fps).
2021-03-22 20:33:42 +09:00
Bill Currie 4eecbe867d [vulkan] Implement deferred emission (fullbrights)
That was... easier than expected. A little more tedious that I would
have liked, but my scripting system isn't perfect (I suspect it's best
suited as the output of a code generator), and the C side could do with
a little more automation.
2021-03-22 19:08:16 +09:00
Bill Currie 5173414d97 [vulkan] Implement light styles
Other than dealing with shader data alignment issues, that went well :).
Nicely, the implementation gets the explicit scaling out of the shader,
and allows for a directional flag.
2021-03-22 13:13:26 +09:00
Bill Currie 56cf181a11 [gamecode] Make PR_RESMAP macros more function-like
I never liked that some of the macros needed the type as a parameter
(yay typeof and __auto_type) or those that returned a value hid the
return statement so they couldn't be used in assignments.
2021-03-21 21:26:36 +09:00
Bill Currie cc4167668c Fix a pile of leaks and uninit errors
Still "some" more to go: a pile to do with transforms and temporary
entities, and a nasty one with host_cbuf. There's also all the static
block-alloc lists :/
2021-03-21 19:56:17 +09:00
Bill Currie a3c1b2e992 [util] Rename qfplist.[ch]
The name is a hold-over from before the current quakeforge tree and the
QF include directory.
2021-03-21 16:13:03 +09:00
Bill Currie 66e6627780 [vulkan] Use the correct character data
I got tired of not being able to read 90% of quake's output :P
2021-03-21 11:37:36 +09:00
Bill Currie 0a79348ce9 [vulkan] Tweak the lighting to look a bit better
Reduced the gamma correction a bit and increased the intensity of
dynamic lights. Not sure the latter is correct, but it looks much
better.
2021-03-20 19:15:06 +09:00
Bill Currie cadea27577 [vulkan] Disable lightmap support
Hopefully, it won't be needed.
2021-03-20 18:02:27 +09:00
Bill Currie 0246e55983 [vulkan] Support colored lights
Now my dizzy map looks like it used to (more or less, possibly too dark,
but I suspect I used some command-line settings to qflight).
2021-03-20 16:50:37 +09:00
Bill Currie dccd6989b2 [vulkan] Implement gamma correction
Currently hard-coded to 0.67 (1/1.5), but it does the job for now.
2021-03-20 16:50:11 +09:00
Bill Currie bab3e0720f [vulkan] Implement real-time lighting
Light styles and shadows aren't implemented yet.

The map's entities are used to create the lights, and the PVS used to
determine which lights might be visible (ie, the surfaces they light).
That could do with some more improvements (eg, checking if a leaf is
outside a spotlight's cone), but the concept seems to work.
2021-03-20 16:08:44 +09:00
Bill Currie 8f7d6b1d02 [vulkan] Initialize skins
This allows the qw client to run with Vulkan.
2021-03-20 00:08:21 +09:00
Bill Currie 5bf21931c7 [renderer] Remove more old fields from entity_t
The only transform related field remaining is old_origin. This also
brings the renderer closer to using simd (lots of stuff to fix still,
though).
2021-03-20 00:08:21 +09:00
Bill Currie 5158cc5527 [util] Add normal and magnitude float vector functions 2021-03-19 11:09:57 +09:00
Bill Currie 2015474468 Move and clean up clview.h
Redundant or dead prototypes deleted, and the client/view.h seems a good
place for the file.
2021-03-12 11:48:53 +09:00
Bill Currie abaccbec53 [client] Move qw's loc code into client
This makes the location code available to nq (not used yet) but more
importantly moves some definitely client-side code into the right place.
2021-03-11 11:53:38 +09:00
Bill Currie c05a15dec5 [glsl] Use vec4f_t in a few more places
No idea if it makes a noticeable speed difference, but it makes a huge
readability difference.
2021-03-10 21:17:34 +09:00
Bill Currie 169e0192f2 [gl] Use the correct value for sqrt(0.5)
707106781 looks right, but isn't quite.
2021-03-10 19:06:15 +09:00
Bill Currie 56d84ef63e [gl] Fix the compressed sprites
Seems to be an ancient bug.
2021-03-10 18:35:35 +09:00
Bill Currie fbc1bd9f6e [renderer] Clean up entity_t to a certain extent
This is the first step towards component-based entities.

There's still some transform-related stuff in the struct that needs to
be moved, but it's all entirely client related (rather than renderer)
and will probably go into a "client" component. Also, the current
components are directly included structs rather than references as I
didn't want to deal with the object management at this stage.

As part of the process (because transforms use simd) this also starts
the process of moving QF to using simd for vectors and matrices. There's
now a mess of simd and sisd code mixed together, but it works
surprisingly well together.
2021-03-10 00:01:41 +09:00
Bill Currie 2c5742a076 [renderer] Remove some variable warts
Ugh, Hungarian notation is still lurking...
2021-03-09 11:37:47 +09:00
Bill Currie 0366b72d4a [vulkan] remove the fps printing
Now that pixels are rendered, there's no need to print the fps
separately as the in-game display works quite nicely.
2021-03-03 18:16:27 +09:00
Bill Currie 4d8ce22c17 [vulkan] Load the map's lights into an array
It's not used yet as work needs to be done to better support generic
entities, but this is the next step to real-time lighting (though, to be
honest, I expect it will be too slow to be usable).
2021-03-03 18:14:16 +09:00
Bill Currie eb0aa2dcea [renderer] Clean up most globals in efrags
There's still the memory management itself to clean up, but the main
code no longer uses any static/global variables (holdover from when the
function was recursive rather).
2021-03-03 16:34:16 +09:00
Bill Currie 9617bbef97 [build] Create static libs for render targets
The static libs are used to build the plugins, but make it easy to use
only those modules needed for tests. Fixes the link error when running
"make check" with non-static plugins.
2021-03-03 16:34:16 +09:00
Bill Currie fd97bb1456 [vulkan] Implement linear falloff
It's possibly too bright, but it might be the lights themselves. Still,
it looks better than the no-falloff implementation.
2021-02-25 16:11:47 +09:00
Bill Currie 33575f93d5 [vulkan] Implement deferred lighting for dlights
Static lights are yet to come (so the screen is black most of the time),
but dynamic lights work very nicely (and look very good) despite the
falloff being incorrect.
2021-02-25 15:51:54 +09:00
Bill Currie 918c3af095 [vulkan] Add a position buffer to the g-buffer
While I could reconstruct the position from the screen coords and depth,
this is easier and good enough for now. Reconstruction is an
optimization thing.
2021-02-25 13:46:33 +09:00
Bill Currie 6c1d6666b4 [vulkan] Actually write the alias g-buffer commands
It seems to help for some reason.
2021-02-24 20:24:46 +09:00
Bill Currie 10a1b99a92 [vulkan] Implement lighting and compose passes
Lighting doesn't actually do lights yet, but it's producing pixels.
Translucent seems to be working (2d draw uses it), and compose seems to
be working.
2021-02-24 19:58:31 +09:00
Bill Currie 9229b67633 [vulkan] Clean up the new render pass and framebuffers 2021-02-24 16:27:56 +09:00
Bill Currie e6ecf5e855 [vulkan] Fix up commands for deferred rendering
Nothing gets output yet (lighting and composite passes not implemented),
but everything passes validation until exit (not destroying everything).
2021-02-23 15:43:02 +09:00
Bill Currie 82eabb5ca2 [vulkan] Parse clear values
And get the render pass working in general. Note that this is only the
render pass and frame buffers: actual commands still have problems.
2021-02-23 14:37:48 +09:00
Bill Currie cbc8ad271a [vulkan] Convert bsp and draw to deferred
This has bsp and draw passing muster with the validation layers.
2021-02-19 11:14:54 +09:00
Bill Currie 4245c6ad3b [vulkan] Specify subpass number in pipeline def
This gets the alias model render pass and pipeline passing validation.

I don't know why I didn't add the subpass field to the
VkGraphicsPipelineCreateInfo parser def, though it could be I simply
missed it, or I thought I wouldn't need it at the time.
2021-02-17 13:50:36 +09:00
Bill Currie 64740b0f73 [vulkan] Create shaders for alias deferred rendering
A simple (no uv output) vertex shader that still blends the two frames,
and the relevant g-buffer fragment shader.
2021-02-17 13:35:19 +09:00
Bill Currie b08c3881b9 [vulkan] Add a comment about using size_t
Due to wanting to access array sizes when parsing uint32_t type values,
parse_uint32_t needs to handle size_t values even though it throws out
any excess bits.
2021-02-17 13:32:04 +09:00
Bill Currie a94949c009 [vulkan] Start moving towards a deferred renderer
After getting lights even vaguely working for alias models, I realized
that it just wasn't going to be feasible to do nice lighting with
forward rendering. This gets the bulk of the work done for deferred
rendering, but still need to sort out the shaders before any real
testing can be done.
2021-02-14 11:35:06 +09:00
Bill Currie 121425a75b [vulkan] Allow all struct objects to be referenced 2021-02-14 11:32:57 +09:00
Bill Currie cffd48434c [vulkan] Move the shaders into their own directory 2021-02-10 17:43:11 +09:00
Bill Currie 14e4fd9f6a [util] Pass context to the plist array/symtab parser allocator 2021-02-09 15:01:55 +09:00
Bill Currie dfa7af03c6 [util] Plug a thread-safety hole in plists 2021-02-09 09:57:07 +09:00
Bill Currie 84dc73da2c [test] Get the tests building again
They happen to all pass, which is nice :)
2021-02-05 21:43:12 +09:00
Bill Currie f023675f8c [vulkan] Clean up draw's memory handling a little
Use cmem for pic and cachpic name allocations. If nothing else, it at
least keeps memory a little less fragmented.
2021-02-05 16:25:08 +09:00
Bill Currie c536a363ec [vulkan] Remove namehack.h
Never really wanted in the first place (back when I did the plugin
renderers), but I didn't feel like doing the required work to avoid it
at the time. At least with Vulkan being a fresh start in an environment
that's already plugin-friendly, there was no real work involved. I'll
get to the other renderers eventually (especially now that I know gdb
does the right thing when there are multiple functions with the same
name).
2021-02-05 11:10:43 +09:00
Bill Currie f633a846a1 [vulkan] Make the frames in flight configurable 2021-02-05 11:06:18 +09:00
Bill Currie 1275067655 [vulkan] Rename vulkan_framebuffer_t
It turns out I had conflated frame buffers with frames and wound up
making a minor mess when separating the number of frames the renderer
could have in flight from the number of swap-chain images. This is the
first step towards correcting that mistake.
2021-02-05 10:22:32 +09:00
Bill Currie 7ffe197564 [vulkan] Remove some dead code
I forgot to delete that block of code after getting the new code working.
2021-02-05 10:19:57 +09:00
Bill Currie e929dca300 [util] Auto-cast plist string items
The casting uses a recursive call to the expression parser, so the
expressions are type-checked automatically.
2021-02-04 22:37:20 +09:00
Bill Currie a54de63fee [vulkan] Take care of the duplicate handles 2021-02-04 20:40:28 +09:00
Bill Currie 8179c44042 [vulkan] Rework pipeline parsing for better reuse
It's not entirely there yet, but the basics are working. Work is still
needed for avoiding duplication of objects (different threads will have
different contexts and thus different tables, so necessary per-thread
duplication should not become a problem) and general access to arbitrary
fields (mostly just parsing the strings)
2021-02-04 17:03:49 +09:00
Bill Currie bc7858bb87 [model] Move parent pointer out of leaf/node struct
The node struct was 72 bytes thus two cache line. Moving the pointer
into the brush model data block allows nodes to fit in a single cache
line (not that they're aligned yet, but that's next). It doesn't seem to
have made any difference to performance (at least in the vulkan
renderer), but it hasn't hurt, either, as the only place that needed the
parent pointer was R_MarkLeaves.
2021-02-03 11:41:38 +09:00
Bill Currie ebb73e19b2 [vulkan] Use the msaaSamples cvar
That took a bit of fiddling with the render pass to get things working
for both sampling and no sampling (ie, msaaSamples = 1).
2021-02-03 00:08:33 +09:00
Bill Currie d6b678ac78 [vulkan] Implement team colors
It's not quite as expected, but that may be due to one of msaa, the 0-15
range in the palette not being all the way to white, the color gradients
being not quite linear (haven't checked yet) or some combination of the
above. However, it's that what should be yellow is more green. At least
the zombies are no longer white and the ogres don't look like they're
wearing skeleton suits.
2021-02-02 19:53:36 +09:00
Bill Currie 8e63ab9f94 [vulkan] Use 4 layer arrays for alias skins
Doesn't seem to make much difference performance-wise, but speed does
seem to be fill-rate limited due to the 8x msaa. Still, it does mean
fewer bindings to worry about.
2021-02-02 00:11:47 +09:00
Bill Currie 0d4ca46923 [vulkan] Move mip map generation commands to image 2021-02-02 00:04:45 +09:00
Bill Currie ea72d0c60e [model] Clean up the globals for alias models 2021-02-01 21:11:45 +09:00
Bill Currie 34dc7cf2df [models] Move brush data into its own struct
This is a big step towards a cleaner api. The struct reference in
model_t really should be a pointer, but bsp submodel(?) loading messed
that up, though that's just a matter of taking more care in the loading
code. It seems sensible to make that a separate step.
2021-02-01 19:31:11 +09:00
Bill Currie bb6c6963d2 [model] Clean up the globals around model loading
Covers only the generic load code (alias etc to follow), but this should
take care of a lot of issues in the future.
2021-02-01 14:39:00 +09:00
Bill Currie afe8e9633e [vulkan] Silence the matrix dump
It got annoying and has served its purpose. However, the code is still
there (#if 0) in case it's needed again.
2021-02-01 12:24:27 +09:00
Bill Currie c7eafd9254 [vulkan] Make the mip map generation public
I've decided that alias model skins should be in a single four-level
array texture rather than spread over four textures, but there's no way
I want to write that code again: getting it right was hard enough the
first time :P
2021-02-01 12:16:05 +09:00
Bill Currie eeda04e3c9 [vulkan] Name most resources
This makes debugging with renderdoc and validation messages much easier
(no more "what buffer is that?").
2021-01-31 19:58:55 +09:00
Bill Currie 7970525ef4 [util] Make va thread-safe
It now takes a context pointer (opaque data) that holds the buffers it
uses for the temporary strings. If the context pointer is null, a static
context is used (making those uses of va NOT thread-safe). Most calls to
va use the static context, but all such calls have been formatted
consistently so they are easy to find when it comes time to do a full
audit.
2021-01-31 16:05:48 +09:00
Bill Currie 7ee02f3965 [vulkan] Sort of implement ambient lighting
It works, but as it uses the camera position rather than the lit
entity's position, it is incorrect. I have some interim ideas to handle
it, though.
2021-01-28 19:17:40 +09:00
Bill Currie 206c631811 [vulkan] Get alias lighting mostly working
It's not so much that parts aren't working, but rather there's no
base-level lighting so everything is black until a dlight is in the
vicinity
2021-01-28 15:20:24 +09:00
Bill Currie 28652c4d59 [vulkan] Implement alias model texturing
I had messed up my index array creation, but once that was fixed the
textures worked well other than a lot of pixels are shades of grey due
to being in the top or bottom color map range.
2021-01-28 14:14:21 +09:00
Bill Currie 64904e2b27 [vulkan] Switch over to pushed descriptors
I don't really know why (I need to do some research), but this fixes the
lockups when accessing the matrices UBO. It has made a mess of my
carefully designed uniform binding layout, so I hope I can get bound
descriptor sets working the way I want, but I really need to progress on
the rest of the project.
2021-01-28 10:49:23 +09:00
Bill Currie caa7623a35 [vulkan] Clean up alias light buffer
Still wedging, but it seems to be something to do with the matrix
buffer.
2021-01-27 17:59:09 +09:00
Bill Currie 9f64416846 [vulkan] Create the lights buffer
It's a tad bogus as it's the lights close to the camera, but it should
at least be a good start once things are working. There's currently
something very wrong with the state of things.
2021-01-27 16:16:28 +09:00
Bill Currie a64f477796 [vulkan] Get alias texture loading working
That was a mess, partly premature optimizations, and some silly
mistakes.
2021-01-27 12:15:45 +09:00
Bill Currie 748217b438 [vulkan] Start work on alias model rendering 2021-01-26 20:58:24 +09:00
Bill Currie 56573d09e4 [vulkan] Get Vulkan_LoadTex working
Finally managed to actually use and thus sort out its issues.
2021-01-26 13:46:04 +09:00