Skip to content

Commit

Permalink
examples(d3d11): fix d3d11 examples
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Sep 22, 2024
1 parent 175e669 commit 69d1bf3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
10 changes: 3 additions & 7 deletions test/capi-tests/imgui/examples/example_win32_directx11/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
13 changes: 4 additions & 9 deletions test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 3 additions & 7 deletions test/capi-tests/librashader-capi-tests/dx11-example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 69d1bf3

Please sign in to comment.