Closed wallstudio closed 3 years ago
DirectX11 の同期方法がよくわからない
ID3D11DeviceContext::Flush
して終わり)::Present
して終わり)]()DX12の場合
…と思ったけど、DX12で同期をかけてるのは、実行中のCommandList(CommandQueue)に新規でコマンドを積んではいけないからかな。IDXGISwapChain::Presentについては、BackBuffer->FrontBufferへの転送はCommandList(DeviceContext)が完了してから実行されるし、オフスクリーンやComputeの場合は、Map時に同期されるということだろうか。
技術的課題はクリア
目的のRTだけピンポイントでとりたい…
ExternalPreviewView.dll!Graphics::AddRenderTexture(
Microsoft::WRL::ComPtr<ID3D11Resource> resource={...})
ExternalPreviewView.dll!``OnPluginStart...
ExternalPreviewView.dll!_Closure_wrapper_133686e3_4::<lambda_invoker_cdecl>(
ID3D11Device* __p1=0x000001b4fbe164d0,
ID3D11Resource* __p2=0x000001b48c0d6c70,
const D3D11_RENDER_TARGET_VIEW_DESC* __p3=0x000000609bcfb558,
ID3D11RenderTargetView** __p4=0x000001b48168cbc8)
RecotteStudio.exe!00007ff7b57827f1()
> RecotteStudio.exe!00007ff7b55fb821()
RecotteStudio.exe!00007ff7b55fb6e4()
RecotteStudio.exe!00007ff7b564412c()
RecotteStudio.exe!00007ff7b56537ad()
RecotteStudio.exe!00007ff7b558c2a2()
RecotteStudio.exe!00007ff7b556c39c()
RecotteStudio.exe!00007ff7b55d367c()
ExternalPreviewView.dll!Graphics::AddRenderTexture(
Microsoft::WRL::ComPtr<ID3D11Resource> resource={...})
ExternalPreviewView.dll!``OnPluginStart...
ExternalPreviewView.dll!_Closure_wrapper_133686e3_4::<lambda_invoker_cdecl>(
ID3D11Device* __p1=0x000001b4fbe164d0,
ID3D11Resource* __p2=0x000001b48ca6e440,
const D3D11_RENDER_TARGET_VIEW_DESC* __p3=0x000000609bcfb558,
ID3D11RenderTargetView** __p4=0x000001b48168bdb8)
RecotteStudio.exe!00007ff7b57827f1()
RecotteStudio.exe!00007ff7b55fbb4d()
RecotteStudio.exe!00007ff7b55fb6e4()
RecotteStudio.exe!00007ff7b564412c()
RecotteStudio.exe!00007ff7b56537ad()
RecotteStudio.exe!00007ff7b558c2a2()
RecotteStudio.exe!00007ff7b556c39c()
RecotteStudio.exe!00007ff7b55d367c()
ExternalPreviewView.dll!Graphics::AddRenderTexture(
Microsoft::WRL::ComPtr<ID3D11Resource> resource={...})
ExternalPreviewView.dll!``OnPluginStart...
ExternalPreviewView.dll!_Closure_wrapper_133686e3_4::<lambda_invoker_cdecl>(
ID3D11Device* __p1=0x000001b4fbe164d0,
ID3D11Resource* __p2=0x000001b484a38fa0,
const D3D11_RENDER_TARGET_VIEW_DESC* __p3=0x000000609bcfb558,
ID3D11RenderTargetView** __p4=0x000001b48168bea8)
RecotteStudio.exe!00007ff7b57827f1()
RecotteStudio.exe!00007ff7b55fbb64()
RecotteStudio.exe!00007ff7b55fb6e4()
RecotteStudio.exe!00007ff7b564412c()
RecotteStudio.exe!00007ff7b56537ad()
RecotteStudio.exe!00007ff7b558c2a2()
RecotteStudio.exe!00007ff7b556c39c()
RecotteStudio.exe!00007ff7b55d367c()
ExternalPreviewView.dll!Graphics::AddRenderTexture(
Microsoft::WRL::ComPtr<ID3D11Resource> resource={...})
ExternalPreviewView.dll!``OnPluginStart...
ExternalPreviewView.dll!_Closure_wrapper_133686e3_4::<lambda_invoker_cdecl>(
ID3D11Device* __p1=0x000001b4fbe164d0,
ID3D11Resource* __p2=0x000001b484a3a980,
const D3D11_RENDER_TARGET_VIEW_DESC* __p3=0x000000609bcfb558,
ID3D11RenderTargetView** __p4=0x000001b48168c538)
RecotteStudio.exe!00007ff7b57827f1()
RecotteStudio.exe!00007ff7b55fbd74()
RecotteStudio.exe!00007ff7b55fb6e4()
RecotteStudio.exe!00007ff7b564412c()
RecotteStudio.exe!00007ff7b56537ad()
RecotteStudio.exe!00007ff7b558c2a2()
RecotteStudio.exe!00007ff7b556c39c()
RecotteStudio.exe!00007ff7b55d367c()
# | Address | DPS | Func | _ |
---|---|---|---|---|
0 | ID3D11DeviceVtbl[9] | ID3D11Device::CreateRenderTargetView | ||
1 | 00007ff7b57827f1 | 160 | CreateRTV | TextureResource, SRV, RTVのバンドルオブジェクトを作成し、戻り値で返却 |
2 | 00007ff7b55fb821 | 097 | CreateRTVs | RTV, DSVをいくつか作成している、またD2D系の文言も、一つ目のRTVがFinalRTV、戻り値&Out引数で返却 |
3 | 00007ff7b55fb6e4 | 040 | CreateRTVs_Wrap | CreateRTVsがデータを詰める用のOut引数を初期化 |
4 | 00007ff7b564412c | 274 | CreatePreview | PreviewView用の色々初期化、"PreviewAntialias"の文字列直後がCreateRTVs_Wrap、恐らくDX以外も含む |
5 | 00007ff7b56537ad | 480 | CreateUIs | 各WindowViewの初期化、"videoPreview", "ObjPropSetting", "FileExplorer", "videoTimeLine" などの文字列含む |
6 | 00007ff7b558c2a2 | 181 | VideoEditorSetup | "EditorDialog" ~ "updateTimelineByCurrentTimeChanged" でCreateUIs、初期化→ループ? |
7 | 00007ff7b556c39c | 009 | VideoEditorMain | VideoEditorSetupしてShowWindowAndBlockLoop |
8 | 00007ff7b55d367c | 184 | VideoEditorFeature | ロード中のプログレスバー出してVEMainへ |
9 | 00007FF7B5548854 | 034 | SelectFeature | ビデオエディタ、画面録画、ベンチマークなどで分岐 |
A | 00007FF7B54BE636 | 952 | WinMain |
https://gist.github.com/wallstudio/5d8bf59194bd949750ec5280842ed482
結局は最初の一枚目を取ってこればOKだった
タイマーベースだと、何故か字幕が出ると滅茶苦茶重くなる…
→ 本体のPresentに同期で解決
https://twitter.com/mao_akiutagames/status/1426579699333955590?s=19
DX11 APIの上書きだけでいけそう