From c3469520f930cdff5ce664f4c217dcafe223b709 Mon Sep 17 00:00:00 2001 From: chyyran Date: Sun, 22 Sep 2024 01:56:12 -0400 Subject: [PATCH] examples(d3d11): fix d3d11 examples --- .../imgui/examples/example_win32_directx11/main.cpp | 10 +++------- .../librashader-capi-tests/dx11-example-2/code.cpp | 13 ++++--------- .../librashader-capi-tests/dx11-example/main.cpp | 10 +++------- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/test/capi-tests/imgui/examples/example_win32_directx11/main.cpp b/test/capi-tests/imgui/examples/example_win32_directx11/main.cpp index 7130e7d..aad75d7 100644 --- a/test/capi-tests/imgui/examples/example_win32_directx11/main.cpp +++ b/test/capi-tests/imgui/examples/example_win32_directx11/main.cpp @@ -174,11 +174,6 @@ int main(int, char**) g_pFramebufferCopy->GetDesc(&framebufferTextureDesc); - libra_source_image_d3d11_t input = {g_framebufferCopySRV, - framebufferTextureDesc.Width, - framebufferTextureDesc.Height}; - - libra_viewport_t vp = { 0, 0, @@ -191,8 +186,9 @@ int main(int, char**) .frame_direction = -1 }; - libra.d3d11_filter_chain_frame(&filter_chain, NULL, frameCount, input, vp, - g_mainRenderTargetView, NULL, &frame_opt); + libra.d3d11_filter_chain_frame( + &filter_chain, NULL, frameCount, g_framebufferCopySRV, + g_mainRenderTargetView, NULL, NULL, &frame_opt); g_pSwapChain->Present(1, 0); // Present with vsync diff --git a/test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp b/test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp index 7aa7dd6..741e642 100644 --- a/test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp +++ b/test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp @@ -478,18 +478,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, deviceContext->CopyResource(framebufferCopy, framebufferTexture); - libra_source_image_d3d11_t input = {framebufferCopySRV, - framebufferVP.Width, - framebufferVP.Height - }; - - libra_viewport_t vp = {0, 0, framebufferVP.Width, framebufferVP.Height,}; frame_d3d11_opt_t frame_opt = {.clear_history = false, .frame_direction = -1}; - libra.d3d11_filter_chain_frame(&filter_chain, deferredContext, frameCount, input, - vp, - framebufferRTV, NULL, &frame_opt); + libra.d3d11_filter_chain_frame(&filter_chain, deferredContext, + frameCount, framebufferCopySRV, + framebufferRTV, NULL, + NULL, &frame_opt); ID3D11CommandList* commandList; deferredContext->FinishCommandList(false, &commandList); diff --git a/test/capi-tests/librashader-capi-tests/dx11-example/main.cpp b/test/capi-tests/librashader-capi-tests/dx11-example/main.cpp index 4d70ab4..876e958 100644 --- a/test/capi-tests/librashader-capi-tests/dx11-example/main.cpp +++ b/test/capi-tests/librashader-capi-tests/dx11-example/main.cpp @@ -398,14 +398,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, assert(copySrv != nullptr); - libra_source_image_d3d11_t input = {copySrv, - viewport.Width, - viewport.Height,}; - libra_viewport_t vp = {0, 0, viewport.Width, viewport.Height, }; - - libra.d3d11_filter_chain_frame(&filter_chain, NULL, frameCount, input, vp, - d3d11FrameBufferView, NULL, NULL); + libra.d3d11_filter_chain_frame(&filter_chain, NULL, frameCount, copySrv, + + d3d11FrameBufferView, NULL, NULL, NULL); copySrv->Release(); framebufferCopy->Release();