mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 13:48:36 +00:00
The ExecuteIndirect argument clamp (indirect_clamp.comp) cut every dispatch
record at a fixed 65,535 groups per dimension, Vulkan's guaranteed minimum.
Devices report far more in x (NVIDIA: 2^31 - 1), so a one-dimensional
indirect dispatch of more than 65,535 groups ran only its first 65,535
groups; the rest never wrote their output.
The clamp now takes the device's maxComputeWorkGroupCount per axis in its
push constants (88 bytes, was 72) and bounds dispatch records by that. The
2^20 groups-per-dispatch cap, the list budget and LEONIDA_INDIRECT_GROUP_BUDGET
are unchanged; the product check now divides instead of multiplying, since x
alone may exceed 65,535. Mesh dispatches keep 65,535 in x.
indirect_clamp_test runs real indirect dispatches through the clamped
scratch with a marker shader (one atomic per group): 70,000 x 1 x 1 ran
65,535 groups and left 4,465 unrun on main, and runs all 70,000 exactly once
now; 65,535 x 1 x 1 and 1 x 65,535 x 1 (at the old limit) run exactly once
on both. A size past the device's own limit is skipped.
Idea from codec-d/cool_fox docs/findings.md ("Blocky patches: indirect
dispatches cut at 65,535 groups"); idea only, no code taken.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
4.0 KiB
C++
44 lines
4.0 KiB
C++
// Generated with glslangValidator -V --target-env vulkan1.2 -Os --spirv-val cs_group_marker.comp
|
|
#pragma once
|
|
#include <cstdint>
|
|
namespace leonida {
|
|
inline constexpr std::uint32_t cs_group_marker_spirv[] = {
|
|
0x07230203u, 0x00010500u, 0x0008000bu, 0x0000002du, 0x00000000u, 0x00020011u, 0x00000001u, 0x00020011u,
|
|
0x000014e3u, 0x0006000bu, 0x00000001u, 0x4c534c47u, 0x6474732eu, 0x3035342eu, 0x00000000u, 0x0003000eu,
|
|
0x000014e4u, 0x00000001u, 0x0007000fu, 0x00000005u, 0x00000004u, 0x6e69616du, 0x00000000u, 0x0000000bu,
|
|
0x0000001du, 0x00060010u, 0x00000004u, 0x00000011u, 0x00000001u, 0x00000001u, 0x00000001u, 0x00030003u,
|
|
0x00000002u, 0x000001ccu, 0x00070004u, 0x455f4c47u, 0x625f5458u, 0x65666675u, 0x65725f72u, 0x65726566u,
|
|
0x0065636eu, 0x00040005u, 0x00000004u, 0x6e69616du, 0x00000000u, 0x00060005u, 0x0000000bu, 0x575f6c67u,
|
|
0x476b726fu, 0x70756f72u, 0x00004449u, 0x00040005u, 0x00000019u, 0x61726150u, 0x0000736du, 0x00050006u,
|
|
0x00000019u, 0x00000000u, 0x6b72616du, 0x00000073u, 0x00050006u, 0x00000019u, 0x00000001u, 0x756f7267u,
|
|
0x00007370u, 0x00040005u, 0x0000001bu, 0x6b72614du, 0x00000073u, 0x00050006u, 0x0000001bu, 0x00000000u,
|
|
0x61746164u, 0x00000000u, 0x00030005u, 0x0000001du, 0x00000070u, 0x00040047u, 0x0000000bu, 0x0000000bu,
|
|
0x0000001au, 0x00030047u, 0x00000019u, 0x00000002u, 0x00050048u, 0x00000019u, 0x00000000u, 0x00000023u,
|
|
0x00000000u, 0x00050048u, 0x00000019u, 0x00000001u, 0x00000023u, 0x00000008u, 0x00040047u, 0x0000001au,
|
|
0x00000006u, 0x00000004u, 0x00030047u, 0x0000001bu, 0x00000002u, 0x00050048u, 0x0000001bu, 0x00000000u,
|
|
0x00000023u, 0x00000000u, 0x00040047u, 0x0000002cu, 0x0000000bu, 0x00000019u, 0x00020013u, 0x00000002u,
|
|
0x00030021u, 0x00000003u, 0x00000002u, 0x00040015u, 0x00000006u, 0x00000020u, 0x00000000u, 0x00040017u,
|
|
0x00000009u, 0x00000006u, 0x00000003u, 0x00040020u, 0x0000000au, 0x00000001u, 0x00000009u, 0x0004003bu,
|
|
0x0000000au, 0x0000000bu, 0x00000001u, 0x0004002bu, 0x00000006u, 0x0000000cu, 0x00000000u, 0x00040020u,
|
|
0x0000000du, 0x00000001u, 0x00000006u, 0x0004002bu, 0x00000006u, 0x00000010u, 0x00000001u, 0x0004002bu,
|
|
0x00000006u, 0x00000014u, 0x00000002u, 0x00030027u, 0x00000018u, 0x000014e5u, 0x0004001eu, 0x00000019u,
|
|
0x00000018u, 0x00000006u, 0x0003001du, 0x0000001au, 0x00000006u, 0x0003001eu, 0x0000001bu, 0x0000001au,
|
|
0x00040020u, 0x00000018u, 0x000014e5u, 0x0000001bu, 0x00040020u, 0x0000001cu, 0x00000009u, 0x00000019u,
|
|
0x0004003bu, 0x0000001cu, 0x0000001du, 0x00000009u, 0x00040015u, 0x0000001eu, 0x00000020u, 0x00000001u,
|
|
0x0004002bu, 0x0000001eu, 0x0000001fu, 0x00000000u, 0x00040020u, 0x00000020u, 0x00000009u, 0x00000018u,
|
|
0x0004002bu, 0x0000001eu, 0x00000024u, 0x00000001u, 0x00040020u, 0x00000025u, 0x00000009u, 0x00000006u,
|
|
0x00040020u, 0x00000029u, 0x000014e5u, 0x00000006u, 0x0006002cu, 0x00000009u, 0x0000002cu, 0x00000010u,
|
|
0x00000010u, 0x00000010u, 0x00050036u, 0x00000002u, 0x00000004u, 0x00000000u, 0x00000003u, 0x000200f8u,
|
|
0x00000005u, 0x00050041u, 0x0000000du, 0x0000000eu, 0x0000000bu, 0x0000000cu, 0x0004003du, 0x00000006u,
|
|
0x0000000fu, 0x0000000eu, 0x00050041u, 0x0000000du, 0x00000011u, 0x0000000bu, 0x00000010u, 0x0004003du,
|
|
0x00000006u, 0x00000012u, 0x00000011u, 0x00050080u, 0x00000006u, 0x00000013u, 0x0000000fu, 0x00000012u,
|
|
0x00050041u, 0x0000000du, 0x00000015u, 0x0000000bu, 0x00000014u, 0x0004003du, 0x00000006u, 0x00000016u,
|
|
0x00000015u, 0x00050080u, 0x00000006u, 0x00000017u, 0x00000013u, 0x00000016u, 0x00050041u, 0x00000020u,
|
|
0x00000021u, 0x0000001du, 0x0000001fu, 0x0004003du, 0x00000018u, 0x00000022u, 0x00000021u, 0x00050041u,
|
|
0x00000025u, 0x00000026u, 0x0000001du, 0x00000024u, 0x0004003du, 0x00000006u, 0x00000027u, 0x00000026u,
|
|
0x0007000cu, 0x00000006u, 0x00000028u, 0x00000001u, 0x00000026u, 0x00000017u, 0x00000027u, 0x00060041u,
|
|
0x00000029u, 0x0000002au, 0x00000022u, 0x0000001fu, 0x00000028u, 0x000700eau, 0x00000006u, 0x0000002bu,
|
|
0x0000002au, 0x00000010u, 0x0000000cu, 0x00000010u, 0x000100fdu, 0x00010038u,
|
|
};
|
|
} // namespace leonida
|