引入 oneTBB 删除taskflow

This commit is contained in:
2026-08-15 16:27:56 +08:00
parent 07c3937779
commit f9db768f72
24 changed files with 583 additions and 616 deletions
+1
View File
@@ -67,6 +67,7 @@ function(renderive_stage_render_3D_runtime target)
if (NOT TARGET "${target}")
message(FATAL_ERROR "Cannot stage render_3D runtime for missing target: ${target}")
endif ()
renderive_stage_kernel_runtime("${target}")
if (WIN32)
get_property(Renderive_render_3D_runtime_files GLOBAL PROPERTY
RENDERIVE_RENDER_3D_RUNTIME_FILES)
+6 -6
View File
@@ -2,7 +2,7 @@
## 线程与数据边界
Renderive 负责状态发布、实时数据交换、Taskflow CPU 数据准备、事件入口、帧调度和像素帧发布。Datoviz 的 scene/visual mutation、FramePlan emission、DRP2 execution、GPU submission 与 readback 全部归单一 `Render_Domain` 所有。
Renderive 负责状态发布、实时数据交换、oneTBB CPU 数据准备、事件入口、帧调度和像素帧发布。Datoviz 的 scene/visual mutation、FramePlan emission、DRP2 execution、GPU submission 与 readback 全部归单一 `Render_Domain` 所有。
当前帧数据流:
@@ -10,7 +10,7 @@ Renderive 负责状态发布、实时数据交换、Taskflow CPU 数据准备、
Scene / Renderable state ----+
Point bulk data -------------+-- frame publication snapshot
|
+-- Taskflow: per-renderable CPU prepare
+-- oneTBB Flow Graph: per-renderable CPU prepare
| |
Kernel Event -----------------+ +-- immutable Prepared_Point
|
@@ -22,14 +22,14 @@ Kernel Event -----------------+ +-- immutable Prepared_Point
immutable Pixel_Frame
```
Taskflow worker 不调用 `dvz_*`。Datoviz FramePlan 继续负责 GPU upload/render/copy/readback 依赖,Renderive RenderPlan 只负责应用级 CPU prepare 依赖和末端单一 render node。
oneTBB worker 不调用 `dvz_*`。Datoviz FramePlan 继续负责 GPU upload/render/copy/readback 依赖,Renderive RenderPlan 只负责应用级 CPU prepare 依赖和末端单一 render node。
## 帧快照
- `Scene_Base::publish_frame_state(Abstract_Frame&)` 在 frame-control 的发布边界交换 Scene、Renderable 与实时数据。
- `Frame_Render_Snapshot` 保存对应帧的 Scene 状态、Renderable 元数据和类型安全的大数据共享快照。
- Manual、Low Latency、Playback 保存同一类快照;Playback 出队不会读取后来版本的数据。
- Taskflow prepare 只从帧快照读取输入并发布不可变 prepared output。
- oneTBB prepare 只从帧快照读取输入并发布不可变 prepared output。
- Scene render node 等待所有末端 prepare 依赖,然后在 `Render_Domain` 串行消费 prepared output。
## Point 封装
@@ -37,7 +37,7 @@ Taskflow worker 不调用 `dvz_*`。Datoviz FramePlan 继续负责 GPU upload/re
- `Point_Visual` 的小状态由 Renderable 状态策略管理。
- 点集的唯一权威来源是 `Multi_Double_Buffer_Strategy`;帧只持有已发布版本的不可变共享快照。
- positions、colors、sizes、sigma、angles、radii、normals 等派生数组只存在于 `Prepared_Point`,不保存为 Visual 成员。
- `Point_Scene` 复用 Kernel `Scene3D_Context`、frame-control、RenderPlan、Taskflow、capture 和 observer。
- `Point_Scene` 复用 Kernel `Scene3D_Context`、frame-control、RenderPlan、oneTBB Flow Graph、capture 和 observer。
- Pointer、wheel、key 直接保留 Kernel Event 语义并投递到 `Render_Domain`,没有第二套输入命令或收集队列。
- 后端只应用 prepared data,并负责 Datoviz/Vulkan 资源和不可变 `Pixel_Frame` 输出。
@@ -49,7 +49,7 @@ Taskflow worker 不调用 `dvz_*`。Datoviz FramePlan 继续负责 GPU upload/re
| Point 大批量数据 | `Point_Visual` 双缓冲策略 | 不可变共享快照 |
| viewport、clear color、visual family | `Scene3D_Context` 状态策略 | 发布帧快照 |
| 输入 | Kernel Event | `Render_Domain` 直接处理 |
| CPU 派生数组 | 当前帧 Taskflow prepare | `Prepared_Point` |
| CPU 派生数组 | 当前帧 oneTBB prepare | `Prepared_Point` |
| Datoviz/Vulkan 资源 | `Datoviz_Visual_Backend` | 仅 `Render_Domain` |
| 输出像素 | 最近完成的 render node | `Point_Scene::latest_frame()` |
+21 -9
View File
@@ -1,6 +1,9 @@
param(
[string]$DatovizBuildDirectory,
[string]$CTestExecutable = 'ctest'
[string]$CTestExecutable = 'ctest',
[ValidateSet('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel')]
[string]$BuildType = 'Debug',
[string]$Toolchain = 'vs2022'
)
$ErrorActionPreference = 'Stop'
@@ -8,10 +11,14 @@ $ErrorActionPreference = 'Stop'
$render3DRoot = $PSScriptRoot
$workspaceRoot = Split-Path -Parent $render3DRoot
$aeRoot = Split-Path -Parent (Split-Path -Parent $workspaceRoot)
$cacheVariant = "${Toolchain}_${BuildType}"
$pthreadsRuntimeDirectory = Join-Path $aeRoot "cached_external_library\${cacheVariant}_render_3D\install\PThreads4W\x86_64\${BuildType}\bin"
$oneTBBRuntimeDirectory = Join-Path $aeRoot "cached_external_library\${cacheVariant}_render_kernel\install\oneTBB\bin"
$windowsSdkRuntimeDirectory = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64'
$runtimeDirectories = @(
(Join-Path $aeRoot 'cached_external_library\vs2022_Debug_render_3D\install\PThreads4W\x86_64\Debug\bin')
'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64'
$pthreadsRuntimeDirectory
$oneTBBRuntimeDirectory
$windowsSdkRuntimeDirectory
)
$vulkanSdkRoot = if ($env:VULKAN_SDK) {
@@ -20,9 +27,13 @@ $vulkanSdkRoot = if ($env:VULKAN_SDK) {
'C:\VulkanSDK\1.4.357.0'
}
$runtimeDirectories += Join-Path $vulkanSdkRoot 'Bin'
$pthreadRuntimeName = if ($BuildType -eq 'Debug') { 'pthreadVC3d.dll' } else { 'pthreadVC3.dll' }
$oneTBBRuntimeName = if ($BuildType -eq 'Debug') { 'tbb12_debug.dll' } else { 'tbb12.dll' }
$shadercRuntimeLibrary = Join-Path $vulkanSdkRoot 'Bin\shaderc_shared.dll'
$runtimeLibraries = @(
(Join-Path $runtimeDirectories[0] 'pthreadVC3d.dll')
(Join-Path $vulkanSdkRoot 'Bin\shaderc_shared.dll')
(Join-Path $pthreadsRuntimeDirectory $pthreadRuntimeName)
(Join-Path $oneTBBRuntimeDirectory $oneTBBRuntimeName)
$shadercRuntimeLibrary
)
$linkDirectories = @(
'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\lib\x64'
@@ -60,7 +71,7 @@ foreach ($linkDirectory in $linkDirectories) {
$env:LIB = $libEntries -join ';'
$env:VULKAN_SDK = $vulkanSdkRoot
$env:DVZ_SHADERC_RUNTIME_LIBRARY = $runtimeLibraries[1]
$env:DVZ_SHADERC_RUNTIME_LIBRARY = $shadercRuntimeLibrary
$env:DVZ_WHEEL_RUNTIME_DIRS = Join-Path $vulkanSdkRoot 'Bin'
# Datoviz's upstream tests use POSIX-style absolute /tmp paths. On Windows those paths resolve
@@ -72,8 +83,9 @@ $env:TEMP = $windowsTempDirectory
$env:TMP = $windowsTempDirectory
Write-Host 'Renderive render_3D runtime environment is ready.'
Write-Host " PThreads4W: $($runtimeDirectories[0])"
Write-Host " Windows SDK: $($runtimeDirectories[1])"
Write-Host " PThreads4W: $pthreadsRuntimeDirectory"
Write-Host " oneTBB: $oneTBBRuntimeDirectory"
Write-Host " Windows SDK: $windowsSdkRuntimeDirectory"
Write-Host " Link roots: $($linkDirectories -join '; ')"
Write-Host " Vulkan SDK: $vulkanSdkRoot"
Write-Host " shaderc: $env:DVZ_SHADERC_RUNTIME_LIBRARY"
+1 -1
View File
@@ -25,7 +25,7 @@ struct Captured_Point {
std::uint64_t data_revision{};
};
// Immutable, frame-local CPU output. Taskflow workers create this data; only
// Immutable, frame-local CPU output. oneTBB workers create this data; only
// the Datoviz render-domain task consumes it.
struct Prepared_Point {
Point_State state;