upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/command_list.h
diff options
context:
space:
mode:
authorDennis Schöneberg <schoenebergde@gmail.com>2026-11-23 19:32:05 +0100
committerGitHub <noreply@github.com>2026-11-23 12:32:05 -0600
commit1599683cafa5d046c5e2bc91b5f3d8ad2b9caa5f (patch)
tree8f03e0b827afa1686a1f6af5a8abf4edcc87cd03 /runtime/src/command_list.h
parent23060e0877d608a9f3273b89797dc802cfa2face (diff)
d3d12: reset predication in ClearState and align SetPredication / AtomicCopyBuffer validation (#6815)
Squash-merged after diff review of PR #6815
Diffstat (limited to 'runtime/src/command_list.h')
-rw-r--r--runtime/src/command_list.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/src/command_list.h b/runtime/src/command_list.h
index 4b384bdc1..0d5ae922f 100644
--- a/runtime/src/command_list.h
+++ b/runtime/src/command_list.h
@@ -485,7 +485,8 @@ struct WriteImmediate {
485 std::uint32_t mode; 485 std::uint32_t mode;
486}; 486};
487 487
488// D3D12_SUBRESOURCE_RANGE_UINT64 of a dependent resource: [begin, end) in bytes of one subresource. 488// D3D12_SUBRESOURCE_RANGE_UINT64 of a dependent resource: [begin, end) in bytes of one subresource
489// (end == UINT64_MAX is the D3D12 sentinel meaning through the end of the subresource).
489struct DependentRange { 490struct DependentRange {
490 ResourceId resource; 491 ResourceId resource;
491 std::uint32_t subresource; 492 std::uint32_t subresource;
@@ -786,16 +787,15 @@ public:
786 return append(write); 787 return append(write);
787 } 788 }
788 789
789 // AtomicCopyBufferUINT/UINT64, with the rules of the D3D12 debug layer's ATOMICCOPYBUFFER_* messages (IDs 790 // AtomicCopyBufferUINT/UINT64: both offsets aligned to the copy's size and each dependency on a named resource with
790 // 1027-1040 in d3d12sdklayers.h): both offsets aligned to the copy's size and at least one dependency, each on a 791 // a non-empty, non-inverted range (zero dependencies is accepted by the Windows 11 WARP and RTX 5090 D3D12
791 // named resource. A copy of a value onto itself (vkCmdCopyBuffer forbids the overlap) is refused too. 792 // runtimes). A copy of a value onto itself (vkCmdCopyBuffer forbids the overlap) is refused too.
792 bool atomic_copy(const AtomicCopyBuffer& copy) { 793 bool atomic_copy(const AtomicCopyBuffer& copy) {
793 if ((copy.bytes != 4 && copy.bytes != 8) || !copy.dst || !copy.src) return false; 794 if ((copy.bytes != 4 && copy.bytes != 8) || !copy.dst || !copy.src) return false;
794 if (copy.dst == copy.src && copy.dst_offset == copy.src_offset) return false; 795 if (copy.dst == copy.src && copy.dst_offset == copy.src_offset) return false;
795 if (copy.dst_offset % copy.bytes || copy.src_offset % copy.bytes) return false; 796 if (copy.dst_offset % copy.bytes || copy.src_offset % copy.bytes) return false;
796 if (copy.dependencies.empty()) return false;
797 for (const auto& d : copy.dependencies) 797 for (const auto& d : copy.dependencies)
798 if (!d.resource) return false; 798 if (!d.resource || d.begin >= d.end) return false;
799 return append(copy); 799 return append(copy);
800 } 800 }
801 801