Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
probe_view.h
Go to the documentation of this file.
1// probe_view.h — 仮の世界(sim/probe_sim の 64³ の熱)のデバッグ表示を描く(shaders/render/probe_view.hlsl。T-0004・T-0015)。
2//
3// データの流れ: シミュの抽出(3 組。compute キューが書く。全部のセル + ブロックの活性の印)
4// + フレームの定数(CPU がフレームごとに書く: どの抽出を読むか・大きさ・表示・カメラ。render/probe_view_constants.h)
5// → 画面いっぱいの三角形 1 枚(画素ごとに格子を光線で辿る)→ バックバッファ。
6// Record() はフレームのループ(frame/frame_loop)がバックバッファごとに 1 度だけ呼び、そのリストを毎フレーム使い回す。
7// 本物の描画(10-rendering.md)は M7 から。これは原理の確認(M1)の間、世界の中を見るための道具。
8#pragma once
9
10#include <cstdint>
11#include <expected>
12#include <string>
13
14#include "gpu/com_ptr.h"
16
17namespace bicameral::render {
18
20 ID3D12Resource* backBuffer = nullptr;
21 D3D12_CPU_DESCRIPTOR_HANDLE renderTargetView{};
22 uint32_t width = 0;
23 uint32_t height = 0;
24 };
25
27 D3D12_GPU_VIRTUAL_ADDRESS extraction0 = 0;
28 D3D12_GPU_VIRTUAL_ADDRESS extraction1 = 0;
29 D3D12_GPU_VIRTUAL_ADDRESS extraction2 = 0;
30 D3D12_GPU_VIRTUAL_ADDRESS constants = 0; // ProbeViewConstants
31 };
32
33 class ProbeView {
34 public:
35 [[nodiscard]] static std::expected<ProbeView, std::string> Create(ID3D12Device* device,
36 DXGI_FORMAT renderTargetFormat);
37
38 // PRESENT → RENDER_TARGET → 描く → PRESENT を記録する
39 void Record(ID3D12GraphicsCommandList* list, const ProbeViewTarget& target,
40 const ProbeViewInputs& inputs) const;
41
42 private:
43 ProbeView() = default;
44
45 ComPtr<ID3D12RootSignature> m_rootSignature;
46 ComPtr<ID3D12PipelineState> m_pipeline;
47 };
48
49} // namespace bicameral::render
void Record(ID3D12GraphicsCommandList *list, const ProbeViewTarget &target, const ProbeViewInputs &inputs) const
static std::expected< ProbeView, std::string > Create(ID3D12Device *device, DXGI_FORMAT renderTargetFormat)
ComPtr< ID3D12RootSignature > m_rootSignature
Definition probe_view.h:45
ComPtr< ID3D12PipelineState > m_pipeline
Definition probe_view.h:46
D3D12_GPU_VIRTUAL_ADDRESS extraction2
Definition probe_view.h:29
D3D12_GPU_VIRTUAL_ADDRESS constants
Definition probe_view.h:30
D3D12_GPU_VIRTUAL_ADDRESS extraction0
Definition probe_view.h:27
D3D12_GPU_VIRTUAL_ADDRESS extraction1
Definition probe_view.h:28
D3D12_CPU_DESCRIPTOR_HANDLE renderTargetView
Definition probe_view.h:21