diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-22 05:45:58 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-22 05:45:58 -0500 |
| commit | 4cfde416f85c60cafe5c2d7329f4c0e028006562 (patch) | |
| tree | ddbeed5b59589d305595cc38bcf0314f81c5520f /runtime/src/predicated_copy.comp | |
| parent | 70178d307cb87146a42414eefa19aa4ff0e0c40a (diff) | |
| parent | f85582e23d4ab9e19acbf694358f137d6b8531b1 (diff) | |
Merge main (f85582e) into runtime/compute-path
On top of the merge candidate 70178d3 (Ryx69/Leonida#6, which merged main at
426023a): the 219 commits main gained since. Three hunks conflicted, in two
files; both follow the notes on #291 (ItsNotRexed 08:27 UTC, Vonsek 09:58 UTC
on 2026-11-22).
runtime/shims/d3d12_vulkan_device.cpp, device setup after the VulkanContext:
- the branch's GPU address arena is created first, as before;
- main's block that configures predication and the predicated byte copy
(#1277) follows it;
- one load_host_image_copy call and main's lazy D24 converter (enabled only
where D24_UNORM_S8_UINT is not usable) replace the branch's unconditional
enable_depth24, which was the same code before main changed it.
runtime/src/vulkan_replay.h:
- CopyBuffer: main's version. It already adds ResourceBinding::buffer_offset
to both offsets, as the branch did, and adds the overflow and overlap
checks and the predicated copy. With the arena, source and destination are
often the same VkBuffer; the overlap check compares the adjusted ranges.
- Predication: main's version. prepare() passes buffer_offset + the command's
offset to prepare_predicate, so a default-heap buffer inside the arena is
read at its own range; emit() captures the word and tests the capture's
scratch slot, not the application's buffer.
Everything else merged without conflicts. Nothing in main's 219 commits adds
a caller that takes a buffer's Vulkan device address for its GPU VA.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/predicated_copy.comp')
| -rw-r--r-- | runtime/src/predicated_copy.comp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/src/predicated_copy.comp b/runtime/src/predicated_copy.comp new file mode 100644 index 000000000..0a105554d --- /dev/null +++ b/runtime/src/predicated_copy.comp | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | // Synthetic byte-granular buffer copy, executed inside the captured conditional-rendering scope. | ||
| 2 | #version 450 | ||
| 3 | #extension GL_EXT_shader_8bit_storage : require | ||
| 4 | layout(local_size_x=64) in; | ||
| 5 | layout(set=0,binding=0,std430) readonly buffer Source { uint8_t bytes[]; } source; | ||
| 6 | layout(set=0,binding=1,std430) buffer Destination { uint8_t bytes[]; } destination; | ||
| 7 | layout(push_constant) uniform Copy { uint source_offset; uint destination_offset; uint size; } copy; | ||
| 8 | void main() { | ||
| 9 | uint i=gl_GlobalInvocationID.x; | ||
| 10 | if(i<copy.size) destination.bytes[copy.destination_offset+i]=source.bytes[copy.source_offset+i]; | ||
| 11 | } | ||