27#ifndef NV_FLOW_CONTEXT_H
28#define NV_FLOW_CONTEXT_H
30#include "NvFlowReflect.h"
35typedef struct NvFlowContext NvFlowContext;
37NV_FLOW_REFLECT_STRUCT_OPAQUE_IMPL(NvFlowContext)
39typedef enum NvFlowTextureBindingType
41 eNvFlowTextureBindingType_separateSampler = 0,
42 eNvFlowTextureBindingType_combinedSampler = 1,
44 eNvFlowTextureBindingType_count = 2,
45 eNvFlowTextureBindingType_maxEnum = 0x7FFFFFFF
46}NvFlowTextureBindingType;
51 NvFlowTextureBindingType textureBinding;
57 NvFlowUint64 sizeInBytes;
61typedef struct NvFlowBuffer NvFlowBuffer;
63struct NvFlowBufferTransient;
64typedef struct NvFlowBufferTransient NvFlowBufferTransient;
66struct NvFlowBufferAcquire;
67typedef struct NvFlowBufferAcquire NvFlowBufferAcquire;
69typedef enum NvFlowMemoryType
71 eNvFlowMemoryType_device = 0,
72 eNvFlowMemoryType_upload = 1,
73 eNvFlowMemoryType_readback = 2,
75 eNvFlowMemoryType_maxEnum = 0x7FFFFFFF
78typedef NvFlowUint NvFlowBufferUsageFlags;
80typedef enum NvFlowBufferUsage
82 eNvFlowBufferUsage_constantBuffer = 0x01,
83 eNvFlowBufferUsage_structuredBuffer = 0x02,
84 eNvFlowBufferUsage_buffer = 0x04,
85 eNvFlowBufferUsage_rwStructuredBuffer = 0x08,
86 eNvFlowBufferUsage_rwBuffer = 0x10,
88 eNvFlowBufferUsage_indirectBuffer = 0x20,
89 eNvFlowBufferUsage_bufferCopySrc = 0x40,
90 eNvFlowBufferUsage_bufferCopyDst = 0x80,
92 eNvFlowBufferUsage_maxEnum = 0x7FFFFFFF
97 NvFlowBufferUsageFlags usageFlags;
99 NvFlowUint structureStride;
100 NvFlowUint64 sizeInBytes;
104typedef struct NvFlowTexture NvFlowTexture;
106struct NvFlowTextureTransient;
107typedef struct NvFlowTextureTransient NvFlowTextureTransient;
109struct NvFlowTextureAcquire;
110typedef struct NvFlowTextureAcquire NvFlowTextureAcquire;
113typedef struct NvFlowSampler NvFlowSampler;
115typedef enum NvFlowTextureType
117 eNvFlowTextureType_1d = 0,
118 eNvFlowTextureType_2d = 1,
119 eNvFlowTextureType_3d = 2,
121 eNvFlowTextureType_maxEnum = 0x7FFFFFFF
124typedef NvFlowUint NvFlowTextureUsageFlags;
126typedef enum NvFlowTextureUsage
128 eNvFlowTextureUsage_texture = 0x01,
129 eNvFlowTextureUsage_rwTexture = 0x02,
130 eNvFlowTextureUsage_textureCopySrc = 0x04,
131 eNvFlowTextureUsage_textureCopyDst = 0x08,
133 eNvFlowTextureUsage_maxEnum = 0x7FFFFFFF
138 NvFlowTextureType textureType;
139 NvFlowTextureUsageFlags usageFlags;
144 NvFlowUint mipLevels;
145 NvFlowFloat4 optimizedClearValue;
148typedef enum NvFlowSamplerAddressMode
150 eNvFlowSamplerAddressMode_wrap = 0,
151 eNvFlowSamplerAddressMode_clamp = 1,
152 eNvFlowSamplerAddressMode_mirror = 2,
153 eNvFlowSamplerAddressMode_border = 3,
155 eNvFlowSamplerAddressMode_count = 4,
156 eNvFlowSamplerAddressMode_maxEnum = 0x7FFFFFFF
157}NvFlowSamplerAddressMode;
159typedef enum NvFlowSamplerFilterMode
161 eNvFlowSamplerFilterMode_point = 0,
162 eNvFlowSamplerFilterMode_linear = 1,
164 eNvFlowSamplerFilterMode_count = 2,
165 eNvFlowSamplerFilterMode_maxEnum = 0x7FFFFFFF
166}NvFlowSamplerFilterMode;
170 NvFlowSamplerAddressMode addressModeU;
171 NvFlowSamplerAddressMode addressModeV;
172 NvFlowSamplerAddressMode addressModeW;
173 NvFlowSamplerFilterMode filterMode;
176typedef enum NvFlowDescriptorType
178 eNvFlowDescriptorType_unknown = 0,
181 eNvFlowDescriptorType_constantBuffer = 1,
182 eNvFlowDescriptorType_structuredBuffer = 2,
183 eNvFlowDescriptorType_buffer = 3,
184 eNvFlowDescriptorType_texture = 4,
185 eNvFlowDescriptorType_sampler = 5,
186 eNvFlowDescriptorType_rwStructuredBuffer = 6,
187 eNvFlowDescriptorType_rwBuffer = 7,
188 eNvFlowDescriptorType_rwTexture = 8,
191 eNvFlowDescriptorType_textureSampler = 9,
194 eNvFlowDescriptorType_indirectBuffer = 10,
195 eNvFlowDescriptorType_bufferCopySrc = 11,
196 eNvFlowDescriptorType_bufferCopyDst = 12,
197 eNvFlowDescriptorType_textureCopySrc = 13,
198 eNvFlowDescriptorType_textureCopyDst = 14,
200 eNvFlowDescriptorType_count = 15,
201 eNvFlowDescriptorType_maxEnum = 0x7FFFFFFF
202}NvFlowDescriptorType;
206 NvFlowBufferTransient* bufferTransient;
207 NvFlowTextureTransient* textureTransient;
208 NvFlowSampler* sampler;
211typedef enum NvFlowRegisterHlsl
213 eNvFlowRegisterHlsl_unknown = 0,
214 eNvFlowRegisterHlsl_b = 1,
215 eNvFlowRegisterHlsl_t = 2,
216 eNvFlowRegisterHlsl_s = 3,
217 eNvFlowRegisterHlsl_u = 4,
219 eNvFlowRegisterHlsl_count = 5,
220 eNvFlowRegisterHlsl_maxEnum = 0x7FFFFFFF
225 NvFlowRegisterHlsl registerHlsl;
226 NvFlowUint registerIndex;
233 NvFlowUint arrayIndex;
245 NvFlowDescriptorType type;
251 NvFlowRegisterHlsl registerHlsl;
252 NvFlowUint registerBegin;
253 NvFlowUint numRegisters;
260 NvFlowUint descriptorCount;
272 NvFlowDescriptorType type;
276struct NvFlowComputePipeline;
277typedef struct NvFlowComputePipeline NvFlowComputePipeline;
281 NvFlowUint numBindingDescs;
289 NvFlowComputePipeline* pipeline;
292 NvFlowUint numDescriptorWrites;
296 const char* debugLabel;
301 NvFlowUint64 srcOffset;
302 NvFlowUint64 dstOffset;
303 NvFlowUint64 numBytes;
305 NvFlowBufferTransient* src;
306 NvFlowBufferTransient* dst;
308 const char* debugLabel;
313 NvFlowUint64 bufferOffset;
314 NvFlowUint bufferRowPitch;
315 NvFlowUint bufferDepthPitch;
317 NvFlowUint textureMipLevel;
318 NvFlowUint3 textureOffset;
319 NvFlowUint3 textureExtent;
321 NvFlowBufferTransient* src;
322 NvFlowTextureTransient* dst;
324 const char* debugLabel;
329 NvFlowUint64 bufferOffset;
330 NvFlowUint bufferRowPitch;
331 NvFlowUint bufferDepthPitch;
333 NvFlowUint textureMipLevel;
334 NvFlowUint3 textureOffset;
335 NvFlowUint3 textureExtent;
337 NvFlowTextureTransient* src;
338 NvFlowBufferTransient* dst;
340 const char* debugLabel;
345 NvFlowUint srcMipLevel;
346 NvFlowUint3 srcOffset;
348 NvFlowUint dstMipLevel;
349 NvFlowUint3 dstOffset;
353 NvFlowTextureTransient* src;
354 NvFlowTextureTransient* dst;
356 const char* debugLabel;
359typedef void(*NvFlowContextThreadPoolTask_t)(NvFlowUint taskIdx, NvFlowUint threadIdx,
void* sharedMem,
void* userdata);
363 NV_FLOW_REFLECT_INTERFACE();
367 NvFlowUint64(NV_FLOW_ABI* getCurrentFrame)(NvFlowContext*
context);
369 NvFlowUint64(NV_FLOW_ABI* getLastFrameCompleted)(NvFlowContext*
context);
371 NvFlowUint64(NV_FLOW_ABI* getCurrentGlobalFrame)(NvFlowContext*
context);
373 NvFlowUint64(NV_FLOW_ABI* getLastGlobalFrameCompleted)(NvFlowContext*
context);
375 NvFlowLogPrint_t(NV_FLOW_ABI* getLogPrint)(NvFlowContext*
context);
378 void(NV_FLOW_ABI* executeTasks)(NvFlowContext*
context, NvFlowUint taskCount, NvFlowUint taskGranularity, NvFlowContextThreadPoolTask_t task,
void* userdata);
381 NvFlowBuffer*(NV_FLOW_ABI* createBuffer)(NvFlowContext*
context, NvFlowMemoryType memoryType,
const NvFlowBufferDesc* desc);
383 void(NV_FLOW_ABI* destroyBuffer)(NvFlowContext*
context, NvFlowBuffer* buffer);
387 NvFlowBufferTransient*(NV_FLOW_ABI* registerBufferAsTransient)(NvFlowContext*
context, NvFlowBuffer* buffer);
389 NvFlowBufferAcquire*(NV_FLOW_ABI* enqueueAcquireBuffer)(NvFlowContext*
context, NvFlowBufferTransient* buffer);
391 NvFlowBool32(NV_FLOW_ABI* getAcquiredBuffer)(NvFlowContext*
context, NvFlowBufferAcquire* acquire, NvFlowBuffer** outBuffer);
393 void*(NV_FLOW_ABI* mapBuffer)(NvFlowContext*
context, NvFlowBuffer* buffer);
395 void(NV_FLOW_ABI* unmapBuffer)(NvFlowContext*
context, NvFlowBuffer* buffer);
397 NvFlowBufferTransient*(NV_FLOW_ABI* getBufferTransientById)(NvFlowContext*
context, NvFlowUint64 bufferId);
402 void(NV_FLOW_ABI* destroyTexture)(NvFlowContext*
context, NvFlowTexture* texture);
406 NvFlowTextureTransient*(NV_FLOW_ABI* registerTextureAsTransient)(NvFlowContext*
context, NvFlowTexture* texture);
408 NvFlowTextureAcquire*(NV_FLOW_ABI* enqueueAcquireTexture)(NvFlowContext*
context, NvFlowTextureTransient* texture);
410 NvFlowBool32(NV_FLOW_ABI* getAcquiredTexture)(NvFlowContext*
context, NvFlowTextureAcquire* acquire, NvFlowTexture** outTexture);
412 NvFlowTextureTransient*(NV_FLOW_ABI* getTextureTransientById)(NvFlowContext*
context, NvFlowUint64 textureId);
417 NvFlowSampler*(NV_FLOW_ABI* getDefaultSampler)(NvFlowContext*
context);
419 void(NV_FLOW_ABI* destroySampler)(NvFlowContext*
context, NvFlowSampler* sampler);
424 void(NV_FLOW_ABI* destroyComputePipeline)(NvFlowContext*
context, NvFlowComputePipeline* pipeline);
438#define NV_FLOW_REFLECT_TYPE NvFlowContextInterface
439NV_FLOW_REFLECT_BEGIN()
440NV_FLOW_REFLECT_FUNCTION_POINTER(getContextConfig, 0, 0)
441NV_FLOW_REFLECT_FUNCTION_POINTER(getCurrentFrame, 0, 0)
442NV_FLOW_REFLECT_FUNCTION_POINTER(getLastFrameCompleted, 0, 0)
443NV_FLOW_REFLECT_FUNCTION_POINTER(getCurrentGlobalFrame, 0, 0)
444NV_FLOW_REFLECT_FUNCTION_POINTER(getLastGlobalFrameCompleted, 0, 0)
445NV_FLOW_REFLECT_FUNCTION_POINTER(getLogPrint, 0, 0)
446NV_FLOW_REFLECT_FUNCTION_POINTER(executeTasks, 0, 0)
447NV_FLOW_REFLECT_FUNCTION_POINTER(createBuffer, 0, 0)
448NV_FLOW_REFLECT_FUNCTION_POINTER(destroyBuffer, 0, 0)
449NV_FLOW_REFLECT_FUNCTION_POINTER(getBufferTransient, 0, 0)
450NV_FLOW_REFLECT_FUNCTION_POINTER(registerBufferAsTransient, 0, 0)
451NV_FLOW_REFLECT_FUNCTION_POINTER(enqueueAcquireBuffer, 0, 0)
452NV_FLOW_REFLECT_FUNCTION_POINTER(getAcquiredBuffer, 0, 0)
453NV_FLOW_REFLECT_FUNCTION_POINTER(mapBuffer, 0, 0)
454NV_FLOW_REFLECT_FUNCTION_POINTER(unmapBuffer, 0, 0)
455NV_FLOW_REFLECT_FUNCTION_POINTER(getBufferTransientById, 0, 0)
456NV_FLOW_REFLECT_FUNCTION_POINTER(createTexture, 0, 0)
457NV_FLOW_REFLECT_FUNCTION_POINTER(destroyTexture, 0, 0)
458NV_FLOW_REFLECT_FUNCTION_POINTER(getTextureTransient, 0, 0)
459NV_FLOW_REFLECT_FUNCTION_POINTER(registerTextureAsTransient, 0, 0)
460NV_FLOW_REFLECT_FUNCTION_POINTER(enqueueAcquireTexture, 0, 0)
461NV_FLOW_REFLECT_FUNCTION_POINTER(getAcquiredTexture, 0, 0)
462NV_FLOW_REFLECT_FUNCTION_POINTER(getTextureTransientById, 0, 0)
463NV_FLOW_REFLECT_FUNCTION_POINTER(createSampler, 0, 0)
464NV_FLOW_REFLECT_FUNCTION_POINTER(getDefaultSampler, 0, 0)
465NV_FLOW_REFLECT_FUNCTION_POINTER(destroySampler, 0, 0)
466NV_FLOW_REFLECT_FUNCTION_POINTER(createComputePipeline, 0, 0)
467NV_FLOW_REFLECT_FUNCTION_POINTER(destroyComputePipeline, 0, 0)
468NV_FLOW_REFLECT_FUNCTION_POINTER(addPassCompute, 0, 0)
469NV_FLOW_REFLECT_FUNCTION_POINTER(addPassCopyBuffer, 0, 0)
470NV_FLOW_REFLECT_FUNCTION_POINTER(addPassCopyBufferToTexture, 0, 0)
471NV_FLOW_REFLECT_FUNCTION_POINTER(addPassCopyTextureToBuffer, 0, 0)
472NV_FLOW_REFLECT_FUNCTION_POINTER(addPassCopyTexture, 0, 0)
473NV_FLOW_REFLECT_END(0)
474NV_FLOW_REFLECT_INTERFACE_IMPL()
475#undef NV_FLOW_REFLECT_TYPE
Definition NvFlowContext.h:250
Definition NvFlowContext.h:265
Definition NvFlowContext.h:258
Definition NvFlowContext.h:271
Definition NvFlowContext.h:96
Definition NvFlowContext.h:55
Definition NvFlowContext.h:280
Definition NvFlowContext.h:49
Definition NvFlowContext.h:362
Definition NvFlowContext.h:224
Definition NvFlowContext.h:238
Definition NvFlowContext.h:231
Definition NvFlowContext.h:244
Definition NvFlowContext.h:288
Definition NvFlowContext.h:300
Definition NvFlowContext.h:312
Definition NvFlowContext.h:344
Definition NvFlowContext.h:328
Definition NvFlowContext.h:205
Definition NvFlowContext.h:169
Definition NvFlowContext.h:137