upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/shims/d3d12_com.cpp
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-25 18:36:19 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-25 18:36:19 -0500
commit3a2820b3bff812ff3cff6a4d4087912edb0541bb (patch)
treeab2522760b3930781a3531f7ded56ba449041e77 /runtime/shims/d3d12_com.cpp
parent75f6890bb98214d5112c7eb1126f67f9e2948a0a (diff)
parentc1e1ef0b81234ac46ca25a810ab81219408ea6ba (diff)
Merge main c1e1ef0b8 into RT-POST-LOAD-GPU-MEMORY (#2098)
Two conflicts: - d3d12_com.cpp, note_direct_heap_indexing: main's console_descriptor_table_va(cbv_srv_uav_base_) for the tracked table, with this branch's per-site once() flag instead of note_once on every draw. - d3d12_vulkan_device.cpp, PipelineState::build_compute: this branch's body (build_compute_pipeline, journal, compile helper). main's dev_status::Build around the compute create moves into build_compute_pipeline, next to the pipeline_profile::DriverCall, so the status line still names the compute pipeline in the driver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
-rw-r--r--runtime/shims/d3d12_com.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp
index d59fc0e73..4a61ffadb 100644
--- a/runtime/shims/d3d12_com.cpp
+++ b/runtime/shims/d3d12_com.cpp
@@ -1779,7 +1779,8 @@ private:
1779 if (!cbv_srv_uav_heap_) 1779 if (!cbv_srv_uav_heap_)
1780 once(0, "draw/dispatch uses CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED with no CBV/SRV/UAV heap bound"); 1780 once(0, "draw/dispatch uses CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED with no CBV/SRV/UAV heap bound");
1781 else { 1781 else {
1782 remember_table(cbv_srv_uav_base_, cbv_srv_uav_heap_->GetDesc().NumDescriptors); 1782 const auto shader_va = console_descriptor_table_va(cbv_srv_uav_base_);
1783 remember_table(shader_va, cbv_srv_uav_heap_->GetDesc().NumDescriptors);
1783 once(1, "CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED heap base tracked on list"); 1784 once(1, "CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED heap base tracked on list");
1784 } 1785 }
1785 } 1786 }
@@ -1884,10 +1885,14 @@ private:
1884 void write_direct_heaps(const RootState& state, std::uint32_t slot, 1885 void write_direct_heaps(const RootState& state, std::uint32_t slot,
1885 std::array<std::uint32_t, rt::rootsig::kMaxUserSgprs>& data) const { 1886 std::array<std::uint32_t, rt::rootsig::kMaxUserSgprs>& data) const {
1886 const auto flags = state.layout->flags; 1887 const auto flags = state.layout->flags;
1887 if ((flags & D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED) && slot < data.size()) 1888 if ((flags & D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED) && slot < data.size()) {
1888 data[slot++] = static_cast<std::uint32_t>(cbv_srv_uav_base_); 1889 const D3D12_GPU_VIRTUAL_ADDRESS va = console_descriptor_table_va(cbv_srv_uav_base_);
1889 if ((flags & D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED) && slot < data.size()) 1890 data[slot++] = static_cast<std::uint32_t>(va);
1890 data[slot] = static_cast<std::uint32_t>(sampler_base_); 1891 }
1892 if ((flags & D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED) && slot < data.size()) {
1893 const D3D12_GPU_VIRTUAL_ADDRESS va = console_descriptor_table_va(sampler_base_);
1894 data[slot] = static_cast<std::uint32_t>(va);
1895 }
1891 } 1896 }
1892 1897
1893 std::array<std::uint32_t, rt::rootsig::kMaxUserSgprs> with_direct_heaps(const RootState& state, 1898 std::array<std::uint32_t, rt::rootsig::kMaxUserSgprs> with_direct_heaps(const RootState& state,
@@ -1956,13 +1961,17 @@ private:
1956 const bool resource = layout.flags & D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED; 1961 const bool resource = layout.flags & D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED;
1957 const bool sampler = layout.flags & D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED; 1962 const bool sampler = layout.flags & D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED;
1958 char resource_at[48] = "none", sampler_at[48] = "none"; 1963 char resource_at[48] = "none", sampler_at[48] = "none";
1959 if (resource) 1964 if (resource) {
1965 const auto va = console_descriptor_table_va(cbv_srv_uav_base_);
1960 std::snprintf(resource_at, sizeof resource_at, "0x%llx at s%u", 1966 std::snprintf(resource_at, sizeof resource_at, "0x%llx at s%u",
1961 static_cast<unsigned long long>(std::uint32_t(cbv_srv_uav_base_)), end); 1967 static_cast<unsigned long long>(std::uint32_t(va)), end);
1962 if (sampler && end + (resource ? 1u : 0u) < rt::rootsig::kMaxUserSgprs) 1968 }
1969 if (sampler && end + (resource ? 1u : 0u) < rt::rootsig::kMaxUserSgprs) {
1970 const auto va = console_descriptor_table_va(sampler_base_);
1963 std::snprintf(sampler_at, sizeof sampler_at, "0x%llx at s%u", 1971 std::snprintf(sampler_at, sizeof sampler_at, "0x%llx at s%u",
1964 static_cast<unsigned long long>(std::uint32_t(sampler_base_)), 1972 static_cast<unsigned long long>(std::uint32_t(va)),
1965 end + (resource ? 1u : 0u)); 1973 end + (resource ? 1u : 0u));
1974 }
1966 std::fprintf(stderr, 1975 std::fprintf(stderr,
1967 "[rt] d3d12: graphics direct heaps: resource heap %s, sampler heap %s, after %u dwords of " 1976 "[rt] d3d12: graphics direct heaps: resource heap %s, sampler heap %s, after %u dwords of "
1968 "explicit arguments from s8 (first draw; LEONIDA_GRAPHICS_DIRECT_HEAPS=0 " 1977 "explicit arguments from s8 (first draw; LEONIDA_GRAPHICS_DIRECT_HEAPS=0 "