Skip to content

Commit e7bc3b9

Browse files
committed
sync on 2026/04/30, rev de41bcbfb17ce9699b9e3a0c42ae6042624d2905
1 parent 3922ff3 commit e7bc3b9

621 files changed

Lines changed: 20374 additions & 4809 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DagorEngine.rev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6ce20af09a08986d4932e3182f3a5c27457aff50
1+
de41bcbfb17ce9699b9e3a0c42ae6042624d2905

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ Restart the command line console to make the new environment variables available
4949

5050
## How to Build: Prebuilt Binaries
5151

52-
You will need to download and extract additional binary files from the repository [https://github.com/GaijinEntertainment/DagorEngine/releases](https://github.com/GaijinEntertainment/DagorEngine/releases) into the X:\develop\DagorEngine folder:
52+
You will need to download and extract additional binary files (as of 2026/04/30) from the CDN into the X:\develop\DagorEngine folder:
53+
* [tools-base.7z](https://dagorenginedata.cdn.gaijin.net/head-2026.04.30/tools-base.7z) - contains initial data for tools
54+
* [samples-base.7z](https://dagorenginedata.cdn.gaijin.net/head-2026.04.30/samples-base.7z) - contains initial assets that will be compiled into binary files that will be loaded by the game (samples)
55+
* [outerSpace-devsrc.7z](https://dagorenginedata.cdn.gaijin.net/head-2026.04.30/outerSpace-devsrc.7z) - contains initial assets for OuterSpace sample project
56+
* [dngSceneViewer.7z](https://dagorenginedata.cdn.gaijin.net/head-2026.04.30/dngSceneViewer.7z) - contains binary data for east_district sample with dngSceneViewer (windows-x86_64 executables also included)
57+
58+
More downloads in the repository [https://github.com/GaijinEntertainment/DagorEngine/releases](https://github.com/GaijinEntertainment/DagorEngine/releases) with prebuilt binaries (may be a bit outdate):
5359

54-
* [tools-base.7z](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/tools-base.7z) - contains initial data for tools
55-
* [samples-base.7z](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/samples-base.7z) - contains initial assets that will be compiled into binary files that will be loaded the game
5660
* [tools-prebuilt-windows-x86_64.7z](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/tools-prebuilt-windows-x86_64.7z),
5761
[tools-prebuilt-linux-x86_64.tar.gz](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/tools-prebuilt-linux-x86_64.tar.gz),
5862
[tools-prebuilt-macOS.tar.gz](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/tools-prebuilt-macOS.tar.gz) - contains the prebuilt engine toolkit
@@ -76,11 +80,11 @@ X:\develop\DagorEngine\samples\testGI\game
7680

7781
## How to Build: Build from Source Code
7882

79-
First unpack [tools-base.7z](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/tools-base.7z) to DagorEngine root to get mandatory binary files in their place.
83+
First unpack [tools-base.7z](https://dagorenginedata.cdn.gaijin.net/head-2026.04.30/tools-base.7z) to DagorEngine root to get mandatory binary files in their place.
8084

81-
If you are going to run samples unpack [samples-base.7z](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/samples-base.7z) to DagorEngine root (if you plan to only build EXE and shaders these binary data are not mandatory).
85+
If you are going to run samples unpack [samples-base.7z](https://dagorenginedata.cdn.gaijin.net/head-2026.04.30/samples-base.7z) to DagorEngine root (if you plan to only build EXE and shaders these binary data are not mandatory).
8286

83-
To build and run OuterSpace sample project unpack also [outerSpace-devsrc.7z](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/outerSpace-devsrc.7z) to DagorEngine root.
87+
To build and run OuterSpace sample project unpack also [outerSpace-devsrc.7z](https://dagorenginedata.cdn.gaijin.net/head-2026.04.30/outerSpace-devsrc.7z) to DagorEngine root.
8488

8589
Then run `build_all.py` in DagorEngine root.
8690

@@ -121,7 +125,7 @@ Example: `build_all.py project:dngSceneViewer code shaders` will build only code
121125
[Demos of a new Gaijin’s game showcase Dagor Engine power](https://gaijinent.com/news/demos-of-a-new-gaijins-game-showcase-dagor-engine-power)<br>
122126
[East District review on YouTube](https://youtu.be/miABl6aekBA)
123127
* Multiplayer sample: **Outer Space**<br>
124-
[Code](https://github.com/GaijinEntertainment/DagorEngine/tree/main/outerSpace/prog) and source (develop) files [outerSpace-devsrc.7z](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/outerSpace-devsrc.7z) to be unpacked to DagorEngine root<br>
128+
[Code](https://github.com/GaijinEntertainment/DagorEngine/tree/main/outerSpace/prog) and source (develop) files [outerSpace-devsrc.7z](https://dagorenginedata.cdn.gaijin.net/head-2026.04.30/outerSpace-devsrc.7z) to be unpacked to DagorEngine root<br>
125129
Prebuilt game (executables, shaders, vromfs, gameres) is available as [outerSpace-prebuilt-fullsrc.tar.gz](https://dagorenginedata.cdn.gaijin.net/rel-fea0a2b3ae5acdb25e088e57a8fb1f77d5ba3e1d/outerSpace-prebuilt-fullsrc.tar.gz)
126130

127131
### Documentation
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Compute Shaders
2+
=================================================
3+
4+
Overview
5+
--------
6+
7+
The compute shader API provides two classes for dispatching GPU compute work:
8+
9+
- :cpp:class:`ComputeShaderElement` -- low-level compute shader element with full control
10+
over parameter binding, dispatch modes, and GPU pipeline selection.
11+
- :cpp:class:`ComputeShader` -- lightweight RAII wrapper for the common case of
12+
creating a shader by name and dispatching work.
13+
14+
.. warning::
15+
16+
Avoid using :cpp:class:`ComputeShaderElement` directly. It returns a raw
17+
pointer from :cpp:func:`new_compute_shader` that must be manually deleted,
18+
making it easy to leak memory. Prefer :cpp:class:`ComputeShader` which
19+
manages lifetime automatically via ``eastl::unique_ptr``.
20+
21+
Usage
22+
-----
23+
24+
Creating a compute shader
25+
~~~~~~~~~~~~~~~~~~~~~~~~~
26+
27+
Use the :cpp:class:`ComputeShader` RAII wrapper:
28+
29+
.. code-block:: cpp
30+
31+
#include <shaders/dag_computeShaders.h>
32+
33+
ComputeShader cs("my_compute_shader");
34+
if (cs)
35+
cs.dispatchThreads(width, height, 1);
36+
37+
Setting parameters
38+
~~~~~~~~~~~~~~~~~~
39+
40+
Shader parameters are set via variable IDs obtained from
41+
:cpp:func:`get_shader_variable_id`:
42+
43+
.. code-block:: cpp
44+
45+
int varId = get_shader_variable_id("some_param");
46+
cs->set_color4_param(varId, Color4(1, 0, 0, 1));
47+
cs->set_texture_param(texVarId, textureId);
48+
49+
Dispatching work
50+
~~~~~~~~~~~~~~~~
51+
52+
There are three dispatch modes:
53+
54+
- **By thread groups** -- :cpp:func:`ComputeShaderElement::dispatch` dispatches
55+
the specified number of thread groups directly.
56+
- **By total threads** -- :cpp:func:`ComputeShaderElement::dispatchThreads`
57+
takes the desired total thread count and automatically divides by the shader's
58+
thread group sizes (rounding up).
59+
- **Indirect** -- :cpp:func:`ComputeShaderElement::dispatch_indirect` reads
60+
dispatch arguments from a GPU buffer. The buffer must contain 3 ``uint32_t``
61+
values (``groupCountX``, ``groupCountY``, ``groupCountZ``) at the given byte
62+
offset. The buffer must be created with ``SBCF_BIND_UNORDERED`` and
63+
``SBCF_MISC_DRAWINDIRECT`` flags (e.g. via ``d3d::buffers::create_ua_indirect``
64+
with ``Indirect::Dispatch``). When storing multiple dispatch entries in a single
65+
buffer, the byte offset should be a multiple of ``DISPATCH_INDIRECT_BUFFER_SIZE``
66+
(12 bytes).
67+
68+
.. code-block:: cpp
69+
70+
// Dispatch by thread groups
71+
cs->dispatch(groupsX, groupsY, groupsZ);
72+
73+
// Dispatch by total thread count (auto-divides by thread group size)
74+
cs->dispatchThreads(totalX, totalY, totalZ);
75+
76+
// Indirect dispatch from a GPU buffer
77+
cs->dispatch_indirect(argsBuffer, byteOffset);
78+
79+
API Reference
80+
-------------
81+
82+
.. doxygenfile:: dag_computeShaders.h
83+
:project: shaders

prog/1stPartyLibs/daScript/daslib/debug.das

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,9 @@ def private auto_start_debug() {
24802480
if ((is_in_aot() && loads_itself()) || is_in_debug_agent_creation() || !is_compiling_macros_in_module("debug") || is_in_completion()) {
24812481
return
24822482
}
2483+
let args <- get_command_line_arguments()
2484+
if (has_value(args, "--no-das-debug")) return
2485+
24832486
this_context().category |= context_category_flags.debugger_attached
24842487
set_single_step(this_context(), !use_instruments() || wait_debugger())
24852488
if (!has_debug_agent_context("~debug")) {

prog/1stPartyLibs/quirrel/brick_fuzzer/code_bricks.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5115,6 +5115,126 @@ class Brick:
51155115
" let $out0_th = newthread($out0_obj.do_yield)\n"
51165116
" $out0 = $out0_th.call($out0_obj)\n"
51175117
" } catch($out0_e) { $out0 = $in0 }"),
5118+
5119+
# ---- foreach destructuring (parser desugars to surrogate val + body destr) ----
5120+
Brick("foreach_destruct_table",
5121+
[Slot("in0", INT), Slot("in1", INT)],
5122+
[Slot("out0", INT)],
5123+
"local $out0 = 0\n"
5124+
" foreach ({a, b} in [{a = $in0, b = $in1}, {a = $in1, b = $in0}])\n"
5125+
" $out0 += a + b"),
5126+
5127+
Brick("foreach_destruct_array",
5128+
[Slot("in0", INT), Slot("in1", INT)],
5129+
[Slot("out0", INT)],
5130+
"local $out0 = 0\n"
5131+
" foreach ([a, b] in [[$in0, $in1], [$in1, $in0]])\n"
5132+
" $out0 += a - b"),
5133+
5134+
Brick("foreach_destruct_idx_table",
5135+
[Slot("in0", INT), Slot("in1", INT)],
5136+
[Slot("out0", INT)],
5137+
"local $out0 = 0\n"
5138+
" foreach (i, {x} in [{x = $in0}, {x = $in1}])\n"
5139+
" $out0 += i * 10 + x"),
5140+
5141+
Brick("foreach_destruct_default",
5142+
[Slot("in0", INT)],
5143+
[Slot("out0", INT)],
5144+
"local $out0 = 0\n"
5145+
" foreach ({m = $INT} in [{m = $in0}, {}, {m = $in0 + 1}])\n"
5146+
" $out0 += m"),
5147+
5148+
Brick("foreach_destruct_typed_default",
5149+
[Slot("in0", INT)],
5150+
[Slot("out0", INT)],
5151+
"local $out0 = 0\n"
5152+
" foreach ({k: int = $INT} in [{}, {k = $in0}, {}])\n"
5153+
" $out0 += k"),
5154+
5155+
Brick("foreach_destruct_array_default",
5156+
[Slot("in0", INT)],
5157+
[Slot("out0", INT)],
5158+
"local $out0 = 0\n"
5159+
" foreach ([a, b = $INT] in [[$in0], [$in0, $in0 + 1]])\n"
5160+
" $out0 += a + b"),
5161+
5162+
Brick("foreach_destruct_empty_table",
5163+
[Slot("in0", INT)],
5164+
[Slot("out0", INT)],
5165+
"local $out0 = 0\n"
5166+
" foreach ({} in [{a = $in0}, {b = $in0}, {}])\n"
5167+
" $out0++"),
5168+
5169+
Brick("foreach_destruct_empty_array",
5170+
[Slot("in0", INT)],
5171+
[Slot("out0", INT)],
5172+
"local $out0 = 0\n"
5173+
" foreach ([] in [[$in0, $in0], [$in0]])\n"
5174+
" $out0++"),
5175+
5176+
Brick("foreach_destruct_nested",
5177+
[Slot("in0", INT), Slot("in1", INT)],
5178+
[Slot("out0", INT)],
5179+
"local $out0 = 0\n"
5180+
" let $out0_rows = [{xs = [{v = $in0}, {v = $in1}]}, {xs = [{v = $in1}]}]\n"
5181+
" foreach ({xs} in $out0_rows)\n"
5182+
" foreach ({v} in xs) $out0 += v"),
5183+
5184+
# ---- per-iter capture: closures store v / i and call after loop ----
5185+
Brick("foreach_capture_val",
5186+
[Slot("in0", INT)],
5187+
[Slot("out0", INT)],
5188+
"local $out0 = 0\n"
5189+
" let $out0_fns = []\n"
5190+
" foreach (v in [$in0, $in0 + 1, $in0 + 2])\n"
5191+
" $out0_fns.append(@() v)\n"
5192+
" foreach (f in $out0_fns) $out0 += f()"),
5193+
5194+
Brick("foreach_capture_idx_val",
5195+
[Slot("in0", INT)],
5196+
[Slot("out0", INT)],
5197+
"local $out0 = 0\n"
5198+
" let $out0_fns = []\n"
5199+
" foreach (i, v in [$in0, $in0 * 2, $in0 * 3])\n"
5200+
" $out0_fns.append(@() i * 100 + v)\n"
5201+
" foreach (f in $out0_fns) $out0 += f()"),
5202+
5203+
Brick("foreach_capture_destruct_field",
5204+
[Slot("in0", INT)],
5205+
[Slot("out0", INT)],
5206+
"local $out0 = 0\n"
5207+
" let $out0_fns = []\n"
5208+
" foreach ({v} in [{v = $in0}, {v = $in0 + 1}, {v = $in0 + 2}])\n"
5209+
" $out0_fns.append(@() v)\n"
5210+
" foreach (f in $out0_fns) $out0 += f()"),
5211+
5212+
Brick("foreach_capture_idx_destruct",
5213+
[Slot("in0", INT)],
5214+
[Slot("out0", INT)],
5215+
"local $out0 = 0\n"
5216+
" let $out0_fns = []\n"
5217+
" foreach (i, {x} in [{x = $in0}, {x = $in0 + 1}])\n"
5218+
" $out0_fns.append(@() i + x)\n"
5219+
" foreach (f in $out0_fns) $out0 += f()"),
5220+
5221+
Brick("foreach_capture_no_inner_capture",
5222+
[Slot("in0", INT)],
5223+
[Slot("out0", INT)],
5224+
"local $out0 = 0\n"
5225+
" let $out0_fns = []\n"
5226+
" foreach (v in [$in0, $in0 + 1])\n"
5227+
" $out0_fns.append(function() { let local_v = $INT; return local_v })\n"
5228+
" foreach (f in $out0_fns) $out0 += f()"),
5229+
5230+
Brick("foreach_destruct_default_with_closure",
5231+
[Slot("in0", INT)],
5232+
[Slot("out0", INT)],
5233+
"local $out0 = 0\n"
5234+
" let $out0_factor = $in0\n"
5235+
" foreach ({n = (function(){ return $out0_factor + $INT })()}\n"
5236+
" in [{n = $in0}, {}, {n = $in0 + 1}])\n"
5237+
" $out0 += n"),
51185238
]
51195239

51205240

prog/1stPartyLibs/quirrel/quirrel/doc/source/reference/language/destructuring_assignment.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,41 @@ Example
5454
Default values in destructured parameters are applied when the corresponding
5555
slot is missing in the passed argument. Type annotations may be used on individual
5656
destructured elements in the same way as for regular parameters.
57+
58+
Empty patterns ``{}`` and ``[]`` are accepted and simply discard the argument.
59+
60+
61+
Destructuring in ``foreach`` loops
62+
==================================
63+
64+
The iteration value of a ``foreach`` loop may be a destructuring pattern. Both
65+
table-style ``{...}`` and array-style ``[...]`` patterns are supported, with or
66+
without an index variable. Default values and type annotations work the same
67+
way as in :ref:`destructuring_assignment` and in function parameters.
68+
69+
Example
70+
::
71+
72+
let pairs = [[1, 2], [3, 4]]
73+
foreach ([a, b] in pairs)
74+
println(a, b)
75+
76+
let rows = [{x = 1, y = 2}, {x = 3, y = 4}]
77+
foreach (i, {x, y} in rows)
78+
println(i, x, y)
79+
80+
// defaults applied when a slot is missing
81+
foreach ({x = -1, y = -2} in [{x = 10}, {y = 20}, {}])
82+
println(x, y)
83+
84+
// typed defaults
85+
foreach ({x: int = 0, y: int|null = null} in [{x = 5}, {y = 7}])
86+
println(x, y)
87+
88+
// empty patterns are allowed (the iteration value is discarded)
89+
foreach ({} in rows)
90+
println("tick")
91+
92+
The destructured bindings are scoped to the loop body. Each iteration produces
93+
fresh bindings, so closures captured inside the body observe the value from
94+
their own iteration.

prog/1stPartyLibs/quirrel/quirrel/doc/source/reference/language/statements.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ foreach
212212

213213
::
214214

215-
'foreach' '(' [index_id','] value_id 'in' exp ')' stat
215+
value_pat := id | '[' destr_fields ']' | '{' destr_fields '}'
216+
'foreach' '(' [index_id','] value_pat 'in' exp ')' stat
216217

217218
Executes a statement for every element contained in an array, table, class, string or generator.
218219
If exp is a generator it will be resumed every iteration as long as it is alive; the value will
@@ -226,6 +227,22 @@ from 0.::
226227
foreach (val in a)
227228
println ($"value={val}")
228229

230+
The iteration value may also be a destructuring pattern, in which case the
231+
yielded value is unpacked into the named bindings on each iteration.
232+
Default values and type annotations are supported in the same way as for
233+
:ref:`destructuring assignments <destructuring_assignment>`.::
234+
235+
foreach ([a, b] in [[1, 2], [3, 4]])
236+
println(a, b)
237+
238+
foreach (i, {x, y} in [{x = 1, y = 2}, {x = 3, y = 4}])
239+
println(i, x, y)
240+
241+
foreach ({n: int = 0} in [{n = 5}, {}])
242+
println(n)
243+
244+
See :ref:`destructuring_assignment` for the full pattern syntax.
245+
229246
-------
230247
break
231248
-------

prog/1stPartyLibs/quirrel/quirrel/include/squirrel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ namespace SQCompilation
6666
#include <stdio.h>
6767

6868
#define SQUIRREL_VERSION_NUMBER_MAJOR 4
69-
#define SQUIRREL_VERSION_NUMBER_MINOR 19
69+
#define SQUIRREL_VERSION_NUMBER_MINOR 20
7070
#define SQUIRREL_VERSION_NUMBER_PATCH 0
7171

7272
#define SQ_STRINGIFY_HELPER(x) #x

prog/1stPartyLibs/quirrel/quirrel/sq/sq_test_natives.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Test native module for native field testing.
22
// Registers "test.native" module with NativeVec class.
33

4-
#include <sqmodules/sqmodules.h>
4+
#include <sqmodules.h>
55
#include <sqrat.h>
66
#include <string.h>
77
#include <stdio.h>

prog/1stPartyLibs/quirrel/quirrel/sqrat/include/sqrat/sqratUtil.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ EA_DISABLE_ALL_VC_WARNINGS()
7070
#else
7171
# include <string>
7272
# include <string_view>
73+
# include <vector>
7374
# include <unordered_map>
7475
# include <unordered_set>
7576
# include <memory>

0 commit comments

Comments
 (0)