blob: eb80d78d066f62f52d8635f4009d0e8a328bdf4b (
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
/*
* 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.
*/
#pragma once
#include "NvFlowTypes.h"
#define NV_FLOW_VERSION 0x00010000
//! NvFlowContext: A framework for fluid simulation
struct NvFlowContext;
//! API type
enum NvFlowContextAPI
{
eNvFlowContextD3D11 = 1,
eNvFlowContextD3D12 = 2
};
//! import interop buffers
struct NvFlowDepthStencilView;
struct NvFlowRenderTargetView;
//! export interop buffers
struct NvFlowResource;
struct NvFlowResourceRW;
struct NvFlowBuffer;
struct NvFlowTexture3D;
// --------------------------- NvFlowContext -------------------------------
///@defgroup NvFlowContext
///@{
/**
* Get the API type of the current context
*
* @param[in] context The Flow context to get the type of.
*
* @return context The Flow context to be released.
*/
NV_FLOW_API NvFlowContextAPI NvFlowContextGetContextType(NvFlowContext* context);
/**
* Push a request for the Flow context to request a flush to queue
*
* @param[in] context The Flow context to make the request on.
*/
NV_FLOW_API void NvFlowContextFlushRequestPush(NvFlowContext* context);
/**
* Pop any pending requests for the Flow context to flush to queue, resets the request state
*
* @param[in] context The Flow context to check for requests on.
*
* @return true if a flush is requested
*/
NV_FLOW_API bool NvFlowContextFlushRequestPop(NvFlowContext* context);
/**
* Process pending GPU wait on fence, on deviceQueue associated with this context
*
* @param[in] context The Flow context to submit fence waits on.
*/
NV_FLOW_API void NvFlowContextProcessFenceWait(NvFlowContext* context);
/**
* Process pending GPU fence signals, on deviceQueue associated with this context
*
* @param[in] context The Flow context to submit fence signals on.
*/
NV_FLOW_API void NvFlowContextProcessFenceSignal(NvFlowContext* context);
/**
* Releases a Flow context.
*
* @param[in] context The Flow context to be released.
*/
NV_FLOW_API void NvFlowReleaseContext(NvFlowContext* context);
/**
* Releases a Flow depth stencil view.
*
* @param[in] view The Flow depth stencil view to be released.
*/
NV_FLOW_API void NvFlowReleaseDepthStencilView(NvFlowDepthStencilView* view);
/**
* Releases a Flow render target view.
*
* @param[in] view The Flow render target view to be released.
*/
NV_FLOW_API void NvFlowReleaseRenderTargetView(NvFlowRenderTargetView* view);
/**
* Pushes graphics/compute pipeline state for later restoration by NvFlowContextPop.
*
* @param[in] context The Flow context to push.
*/
NV_FLOW_API void NvFlowContextPush(NvFlowContext* context);
/**
* Restores graphics/compute pipeline state pushed by NvFlowContextPush.
*
* @param[in] context The Flow context to restore.
*/
NV_FLOW_API void NvFlowContextPop(NvFlowContext* context);
/**
* An optional callback to allow the application to control how Flow allocates CPU memory.
*
* @param[in] malloc The allocation function for Flow to use.
*/
NV_FLOW_API void NvFlowSetMallocFunc(void*(*malloc)(size_t size));
/**
* An optional callback to allow the application to control how Flow releases CPU memory.
*
* @param[in] free The free function for Flow to use.
*/
NV_FLOW_API void NvFlowSetFreeFunc(void(*free)(void* ptr));
/**
* Should be called before DLL unload, to ensure complete cleanup.
*
* @param[in] timeoutMS Wait timeout, in milliseconds
*
* @return The current number of active deferred release units.
*/
NV_FLOW_API NvFlowUint NvFlowDeferredRelease(float timeoutMS);
///@}
|