aboutsummaryrefslogtreecommitdiff
path: root/demo/DemoAppD3D11/NvFlowInteropD3D11.cpp
blob: 23aaf9c63c468a2cbbed6e4103647da61b39c596 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 * Copyright (c) 2014-2017, NVIDIA CORPORATION.  All rights reserved.
 *
 * NVIDIA CORPORATION and its licensors retain all intellectual property
 * and proprietary rights in and to this software, related documentation
 * and any modifications thereto.  Any use, reproduction, disclosure or
 * distribution of this software and related documentation without an express
 * license agreement from NVIDIA CORPORATION is strictly prohibited.
 */

#include <d3d11.h>

#include "../DemoApp/NvFlowInterop.h"

#include "NvFlowContextD3D11.h"
#include "appD3D11Ctx.h"

NvFlowContext* NvFlowInteropCreateContext(AppGraphCtx* appctx)
{
	NvFlowContextDescD3D11 desc = {};
	desc.device = appctx->m_device;
	desc.deviceContext = appctx->m_deviceContext;
	return NvFlowCreateContextD3D11(NV_FLOW_VERSION, &desc);
}

NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilView(AppGraphCtx* appctx, NvFlowContext* flowctx)
{
	NvFlowDepthStencilViewDescD3D11 desc = {};
	desc.dsv = appctx->m_dsv;
	desc.srv = appctx->m_depthSRV;
	desc.viewport = appctx->m_viewport;
	return NvFlowCreateDepthStencilViewD3D11(flowctx, &desc);
}

NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetView(AppGraphCtx* appctx, NvFlowContext* flowctx)
{
	NvFlowRenderTargetViewDescD3D11 desc = {};
	desc.rtv = appctx->m_rtv;
	desc.viewport = appctx->m_viewport;
	return NvFlowCreateRenderTargetViewD3D11(flowctx, &desc);
}

void NvFlowInteropUpdateContext(NvFlowContext* context, AppGraphCtx* appctx)
{
	NvFlowContextDescD3D11 desc = {};
	desc.device = appctx->m_device;
	desc.deviceContext = appctx->m_deviceContext;
	NvFlowUpdateContextD3D11(context, &desc);
}

void NvFlowInteropUpdateDepthStencilView(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx)
{
	NvFlowDepthStencilViewDescD3D11 desc = {};
	desc.dsv = appctx->m_dsv;
	desc.srv = appctx->m_depthSRV;
	desc.viewport = appctx->m_viewport;
	NvFlowUpdateDepthStencilViewD3D11(flowctx, view, &desc);
}

void NvFlowInteropUpdateRenderTargetView(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx)
{
	NvFlowRenderTargetViewDescD3D11 desc = {};
	desc.rtv = appctx->m_rtv;
	desc.viewport = appctx->m_viewport;
	NvFlowUpdateRenderTargetViewD3D11(flowctx, view, &desc);
}