From 62a1427154131f2387675957c1d2027061f354f0 Mon Sep 17 00:00:00 2001 From: Andrew Reidmeyer Date: Tue, 13 Jun 2017 20:38:29 -0600 Subject: NvFlow 1.0.1 --- NvFlowDemoApp.sln | 15 + README.md | 2 +- bin/win32/DemoAppCodeGenDebug_win32.exe | Bin 0 -> 850432 bytes bin/win32/DemoAppCodeGenRelease_win32.exe | Bin 0 -> 122368 bytes bin/win32/DemoAppD3D11Debug_win32.dll | Bin 936960 -> 941056 bytes bin/win32/DemoAppD3D11Release_win32.dll | Bin 135680 -> 136192 bytes bin/win32/DemoAppD3D12Debug_win32.dll | Bin 1015296 -> 1019904 bytes bin/win32/DemoAppD3D12Release_win32.dll | Bin 117760 -> 118784 bytes bin/win32/DemoAppDebug_win32.exe | Bin 1653760 -> 1644544 bytes bin/win32/DemoAppRelease_win32.exe | Bin 404992 -> 421376 bytes bin/win32/NvFlowLibDebug_win32.dll | Bin 14787952 -> 19391344 bytes bin/win32/NvFlowLibRelease_win32.dll | Bin 1404784 -> 1738608 bytes bin/win64/DemoAppCodeGenDebug_win64.exe | Bin 0 -> 1075712 bytes bin/win64/DemoAppCodeGenRelease_win64.exe | Bin 0 -> 141824 bytes bin/win64/DemoAppD3D11Debug_win64.dll | Bin 1168896 -> 1173504 bytes bin/win64/DemoAppD3D11Release_win64.dll | Bin 158720 -> 159232 bytes bin/win64/DemoAppD3D12Debug_win64.dll | Bin 1268736 -> 1273856 bytes bin/win64/DemoAppD3D12Release_win64.dll | Bin 174080 -> 174592 bytes bin/win64/DemoAppDebug_win64.exe | Bin 2018816 -> 2004992 bytes bin/win64/DemoAppRelease_win64.exe | Bin 408576 -> 356864 bytes bin/win64/NvFlowLibDebug_win64.dll | Bin 15476080 -> 20108656 bytes bin/win64/NvFlowLibRelease_win64.dll | Bin 1512816 -> 1850736 bytes demo/DemoApp/DemoApp.vcxproj | 25 + demo/DemoApp/DemoApp.vcxproj.filters | 3 + demo/DemoApp/NvFlowInteropLoader.cpp | 48 +- demo/DemoApp/NvFlowInteropLoaderGenerated.h | 96 + demo/DemoApp/appGraphCtx.h | 7 +- demo/DemoApp/appGraphCtxLoader.cpp | 77 +- demo/DemoApp/appGraphCtxLoaderGenerated.h | 150 + demo/DemoApp/computeContextLoader.cpp | 132 +- demo/DemoApp/computeContextLoaderGenerated.h | 249 ++ demo/DemoApp/imguiGraphLoader.cpp | 109 +- demo/DemoApp/imguiGraphLoaderGenerated.h | 204 + demo/DemoApp/loader.h | 66 +- demo/DemoApp/main.cpp | 12 +- demo/DemoApp/meshLoader.cpp | 67 +- demo/DemoApp/meshLoaderGenerated.h | 132 + demo/DemoApp/preset0.h | 4 +- demo/DemoApp/preset1.h | 4 +- demo/DemoApp/scene.cpp | 84 +- demo/DemoApp/scene.h | 80 +- demo/DemoApp/scene2DTextureEmitter.cpp | 2 +- demo/DemoApp/sceneCustomEmit.cpp | 2 +- demo/DemoApp/sceneEmitSubStep.cpp | 204 + demo/DemoApp/sceneFlow.cpp | 70 +- demo/DemoApp/sceneSDF.cpp | 4 +- demo/DemoApp/sceneSimpleFlame.cpp | 51 +- demo/DemoApp/sceneSimpleSmoke.cpp | 2 +- demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj | 280 ++ demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj.filters | 33 + demo/DemoAppCodeGen/demoAppCodeGen.cpp | 292 ++ demo/DemoAppCodeGen/functionDefinitionExtract.h | 230 + demo/DemoAppCodeGen/loaderCodeGen.h | 335 ++ demo/DemoAppD3D11/NvFlowInteropD3D11.cpp | 36 +- demo/DemoAppD3D11/appD3D11Ctx.cpp | 129 +- demo/DemoAppD3D11/appD3D11Ctx.h | 46 +- demo/DemoAppD3D11/computeContextD3D11.cpp | 218 +- demo/DemoAppD3D11/computeContextD3D11.h | 86 +- demo/DemoAppD3D11/imguiGraphD3D11.cpp | 38 +- demo/DemoAppD3D11/imguiGraphD3D11.h | 46 +- demo/DemoAppD3D11/imguiInteropD3D11.cpp | 20 +- demo/DemoAppD3D11/meshD3D11.cpp | 99 +- demo/DemoAppD3D11/meshD3D11.h | 31 +- demo/DemoAppD3D11/meshInteropD3D11.cpp | 20 +- demo/DemoAppD3D12/NvFlowInteropD3D12.cpp | 54 +- demo/DemoAppD3D12/appD3D12Ctx.cpp | 131 +- demo/DemoAppD3D12/appD3D12Ctx.h | 44 +- demo/DemoAppD3D12/computeContextD3D12.cpp | 272 +- demo/DemoAppD3D12/computeContextD3D12.h | 86 +- demo/DemoAppD3D12/imguiGraphD3D12.cpp | 40 +- demo/DemoAppD3D12/imguiGraphD3D12.h | 46 +- demo/DemoAppD3D12/imguiInteropD3D12.cpp | 22 +- demo/DemoAppD3D12/meshD3D12.cpp | 105 +- demo/DemoAppD3D12/meshD3D12.h | 31 +- demo/DemoAppD3D12/meshInteropD3D12.cpp | 20 +- docs/api/files/_nv_flow_8h-source.html | 1837 ++++---- docs/api/files/_nv_flow_8h.html | 34 +- docs/api/files/_nv_flow_context_8h-source.html | 4 +- docs/api/files/_nv_flow_context_8h.html | 6 +- .../files/_nv_flow_context_d3_d11_8h-source.html | 2 +- docs/api/files/_nv_flow_context_d3_d11_8h.html | 2 +- .../files/_nv_flow_context_d3_d12_8h-source.html | 158 +- docs/api/files/_nv_flow_context_d3_d12_8h.html | 2 +- docs/api/files/_nv_flow_context_ext_8h-source.html | 643 +++ docs/api/files/_nv_flow_context_ext_8h.html | 4538 ++++++++++++++++++++ docs/api/files/_nv_flow_shader_8h-source.html | 2 +- docs/api/files/_nv_flow_shader_8h.html | 2 +- docs/api/files/_nv_flow_types_8h-source.html | 108 +- docs/api/files/_nv_flow_types_8h.html | 10 +- docs/api/files/annotated.html | 34 +- docs/api/files/classes.html | 4 +- docs/api/files/files.html | 3 +- docs/api/files/functions.html | 14 +- docs/api/files/functions_0x62.html | 16 +- docs/api/files/functions_0x63.html | 11 +- docs/api/files/functions_0x64.html | 37 +- docs/api/files/functions_0x65.html | 6 +- docs/api/files/functions_0x66.html | 24 +- docs/api/files/functions_0x67.html | 21 +- docs/api/files/functions_0x68.html | 9 +- docs/api/files/functions_0x69.html | 4 +- docs/api/files/functions_0x6c.html | 15 +- docs/api/files/functions_0x6d.html | 13 +- docs/api/files/functions_0x6e.html | 12 +- docs/api/files/functions_0x6f.html | 2 +- docs/api/files/functions_0x70.html | 11 +- docs/api/files/functions_0x71.html | 2 +- docs/api/files/functions_0x72.html | 32 +- docs/api/files/functions_0x73.html | 30 +- docs/api/files/functions_0x74.html | 4 +- docs/api/files/functions_0x75.html | 9 +- docs/api/files/functions_0x76.html | 31 +- docs/api/files/functions_0x77.html | 16 +- docs/api/files/functions_0x78.html | 6 +- docs/api/files/functions_0x79.html | 6 +- docs/api/files/functions_0x7a.html | 4 +- docs/api/files/functions_vars.html | 14 +- docs/api/files/functions_vars_0x62.html | 16 +- docs/api/files/functions_vars_0x63.html | 11 +- docs/api/files/functions_vars_0x64.html | 37 +- docs/api/files/functions_vars_0x65.html | 6 +- docs/api/files/functions_vars_0x66.html | 24 +- docs/api/files/functions_vars_0x67.html | 21 +- docs/api/files/functions_vars_0x68.html | 9 +- docs/api/files/functions_vars_0x69.html | 4 +- docs/api/files/functions_vars_0x6c.html | 15 +- docs/api/files/functions_vars_0x6d.html | 13 +- docs/api/files/functions_vars_0x6e.html | 12 +- docs/api/files/functions_vars_0x6f.html | 2 +- docs/api/files/functions_vars_0x70.html | 11 +- docs/api/files/functions_vars_0x71.html | 2 +- docs/api/files/functions_vars_0x72.html | 32 +- docs/api/files/functions_vars_0x73.html | 30 +- docs/api/files/functions_vars_0x74.html | 4 +- docs/api/files/functions_vars_0x75.html | 9 +- docs/api/files/functions_vars_0x76.html | 31 +- docs/api/files/functions_vars_0x77.html | 16 +- docs/api/files/functions_vars_0x78.html | 6 +- docs/api/files/functions_vars_0x79.html | 6 +- docs/api/files/functions_vars_0x7a.html | 4 +- docs/api/files/globals.html | 50 +- docs/api/files/globals_0x6e.html | 330 +- docs/api/files/globals_defs.html | 12 +- docs/api/files/globals_enum.html | 10 +- docs/api/files/globals_eval.html | 50 +- docs/api/files/globals_func.html | 314 +- docs/api/files/globals_type.html | 2 +- docs/api/files/group___nv_flow_context.html | 2 +- docs/api/files/group___nv_flow_context_d3_d11.html | 2 +- docs/api/files/group___nv_flow_context_d3_d12.html | 2 +- docs/api/files/group___nv_flow_cross_section.html | 2 +- docs/api/files/group___nv_flow_device.html | 2 +- docs/api/files/group___nv_flow_grid.html | 2 +- docs/api/files/group___nv_flow_grid_emit.html | 47 +- .../files/group___nv_flow_grid_emit_custom.html | 2 +- docs/api/files/group___nv_flow_grid_export.html | 2 +- docs/api/files/group___nv_flow_grid_import.html | 2 +- docs/api/files/group___nv_flow_grid_material.html | 2 +- docs/api/files/group___nv_flow_grid_proxy.html | 2 +- docs/api/files/group___nv_flow_grid_summary.html | 384 ++ .../files/group___nv_flow_particle_surface.html | 2 +- .../api/files/group___nv_flow_render_material.html | 2 +- .../api/files/group___nv_flow_s_d_f_generator.html | 2 +- docs/api/files/group___nv_flow_shape.html | 2 +- docs/api/files/group___nv_flow_volume_render.html | 2 +- docs/api/files/group___nv_flow_volume_shadow.html | 2 +- docs/api/files/index.html | 2 +- docs/api/files/main.html | 4 +- docs/api/files/modules.html | 3 +- .../api/files/struct_nv_flow_blend_state_desc.html | 160 + docs/api/files/struct_nv_flow_buffer_desc.html | 109 + .../api/files/struct_nv_flow_buffer_view_desc.html | 58 + .../files/struct_nv_flow_color_buffer_desc.html | 92 + docs/api/files/struct_nv_flow_color_map_data.html | 2 +- .../files/struct_nv_flow_compute_shader_desc.html | 92 + .../files/struct_nv_flow_constant_buffer_desc.html | 75 + .../files/struct_nv_flow_context_desc_d3_d11.html | 2 +- .../files/struct_nv_flow_context_desc_d3_d12.html | 2 +- .../files/struct_nv_flow_cross_section_desc.html | 2 +- .../files/struct_nv_flow_cross_section_params.html | 2 +- .../files/struct_nv_flow_depth_buffer_desc.html | 126 + .../api/files/struct_nv_flow_depth_state_desc.html | 92 + .../files/struct_nv_flow_depth_stencil_desc.html | 109 + ...uct_nv_flow_depth_stencil_view_desc_d3_d11.html | 2 +- ...uct_nv_flow_depth_stencil_view_desc_d3_d12.html | 48 +- ...t_nv_flow_descriptor_reserve_handle_d3_d12.html | 2 +- docs/api/files/struct_nv_flow_device_desc.html | 2 +- .../files/struct_nv_flow_device_queue_desc.html | 2 +- .../files/struct_nv_flow_device_queue_status.html | 2 +- docs/api/files/struct_nv_flow_dim.html | 2 +- docs/api/files/struct_nv_flow_dispatch_params.html | 143 + docs/api/files/struct_nv_flow_draw_params.html | 143 + ...uct_nv_flow_dynamic_descriptor_heap_d3_d12.html | 2 +- docs/api/files/struct_nv_flow_fence_desc.html | 58 + docs/api/files/struct_nv_flow_float2.html | 75 + docs/api/files/struct_nv_flow_float3.html | 2 +- docs/api/files/struct_nv_flow_float4.html | 2 +- docs/api/files/struct_nv_flow_float4x4.html | 2 +- .../files/struct_nv_flow_graphics_shader_desc.html | 296 ++ docs/api/files/struct_nv_flow_grid_desc.html | 2 +- ...ruct_nv_flow_grid_emit_custom_alloc_params.html | 2 +- ...nv_flow_grid_emit_custom_emit_layer_params.html | 2 +- ...truct_nv_flow_grid_emit_custom_emit_params.html | 2 +- .../api/files/struct_nv_flow_grid_emit_params.html | 62 +- .../struct_nv_flow_grid_export_debug_vis_view.html | 2 +- .../files/struct_nv_flow_grid_export_handle.html | 2 +- ...t_nv_flow_grid_export_import_layer_mapping.html | 2 +- ...nv_flow_grid_export_import_layered_mapping.html | 2 +- .../struct_nv_flow_grid_export_layer_view.html | 2 +- .../struct_nv_flow_grid_export_layered_view.html | 2 +- .../struct_nv_flow_grid_export_simple_shape.html | 2 +- .../api/files/struct_nv_flow_grid_import_desc.html | 2 +- .../files/struct_nv_flow_grid_import_handle.html | 2 +- .../struct_nv_flow_grid_import_layer_view.html | 2 +- .../struct_nv_flow_grid_import_layered_view.html | 2 +- .../files/struct_nv_flow_grid_import_params.html | 2 +- ...uct_nv_flow_grid_import_state_c_p_u_params.html | 2 +- .../files/struct_nv_flow_grid_material_handle.html | 2 +- .../files/struct_nv_flow_grid_material_params.html | 86 +- ...struct_nv_flow_grid_material_per_component.html | 2 +- docs/api/files/struct_nv_flow_grid_params.html | 22 +- docs/api/files/struct_nv_flow_grid_proxy_desc.html | 2 +- .../struct_nv_flow_grid_proxy_flush_params.html | 2 +- docs/api/files/struct_nv_flow_grid_reset_desc.html | 2 +- ...t_nv_flow_grid_summary_debug_render_params.html | 125 + .../files/struct_nv_flow_grid_summary_desc.html | 68 + .../files/struct_nv_flow_grid_summary_result.html | 184 + .../struct_nv_flow_grid_summary_update_params.html | 88 + .../api/files/struct_nv_flow_heap_sparse_desc.html | 58 + .../files/struct_nv_flow_index_buffer_desc.html | 92 + .../files/struct_nv_flow_input_element_desc.html | 75 + docs/api/files/struct_nv_flow_int2.html | 75 + docs/api/files/struct_nv_flow_int3.html | 92 + docs/api/files/struct_nv_flow_int4.html | 109 + docs/api/files/struct_nv_flow_mapped_data.html | 96 + .../struct_nv_flow_particle_surface_data.html | 2 +- .../struct_nv_flow_particle_surface_desc.html | 2 +- ...truct_nv_flow_particle_surface_emit_params.html | 2 +- .../struct_nv_flow_particle_surface_params.html | 2 +- docs/api/files/struct_nv_flow_query_time.html | 2 +- .../struct_nv_flow_render_material_handle.html | 2 +- .../struct_nv_flow_render_material_params.html | 2 +- .../struct_nv_flow_render_material_pool_desc.html | 2 +- .../files/struct_nv_flow_render_target_desc.html | 75 + ...uct_nv_flow_render_target_view_desc_d3_d11.html | 2 +- ...uct_nv_flow_render_target_view_desc_d3_d12.html | 2 +- ...ruct_nv_flow_resource_r_w_view_desc_d3_d11.html | 2 +- ...ruct_nv_flow_resource_r_w_view_desc_d3_d12.html | 2 +- .../struct_nv_flow_resource_view_desc_d3_d11.html | 2 +- .../struct_nv_flow_resource_view_desc_d3_d12.html | 2 +- docs/api/files/struct_nv_flow_s_d_f_gen_desc.html | 2 +- .../struct_nv_flow_s_d_f_gen_mesh_params.html | 2 +- .../files/struct_nv_flow_shader_linear_params.html | 2 +- .../files/struct_nv_flow_shader_point_params.html | 2 +- docs/api/files/struct_nv_flow_shape_desc_box.html | 2 +- .../files/struct_nv_flow_shape_desc_capsule.html | 2 +- .../api/files/struct_nv_flow_shape_desc_plane.html | 2 +- .../api/files/struct_nv_flow_shape_desc_s_d_f.html | 2 +- .../files/struct_nv_flow_shape_desc_sphere.html | 2 +- .../api/files/struct_nv_flow_shape_s_d_f_data.html | 2 +- .../api/files/struct_nv_flow_shape_s_d_f_desc.html | 2 +- docs/api/files/struct_nv_flow_support.html | 2 +- docs/api/files/struct_nv_flow_texture1_d_desc.html | 92 + docs/api/files/struct_nv_flow_texture2_d_desc.html | 92 + docs/api/files/struct_nv_flow_texture3_d_desc.html | 109 + .../struct_nv_flow_texture3_d_sparse_desc.html | 75 + docs/api/files/struct_nv_flow_uint2.html | 2 +- docs/api/files/struct_nv_flow_uint3.html | 2 +- docs/api/files/struct_nv_flow_uint4.html | 2 +- .../files/struct_nv_flow_vertex_buffer_desc.html | 75 + docs/api/files/struct_nv_flow_viewport.html | 147 + .../struct_nv_flow_volume_lighting_params.html | 2 +- .../files/struct_nv_flow_volume_render_desc.html | 2 +- .../struct_nv_flow_volume_render_l_m_s_params.html | 2 +- ...uct_nv_flow_volume_render_multi_res_params.html | 2 +- .../files/struct_nv_flow_volume_render_params.html | 2 +- .../struct_nv_flow_volume_render_viewport.html | 2 +- ..._nv_flow_volume_shadow_debug_render_params.html | 2 +- .../files/struct_nv_flow_volume_shadow_desc.html | 2 +- .../files/struct_nv_flow_volume_shadow_params.html | 2 +- .../files/struct_nv_flow_volume_shadow_stats.html | 2 +- docs/api/files/tree.html | 210 +- docs/api/files/union_nv_flow_shape_desc.html | 2 +- docs/rest/.buildinfo | 2 +- docs/rest/genindex.html | 39 +- docs/rest/index.html | 39 +- docs/rest/manual.html | 39 +- docs/rest/objects.inv | Bin 209 -> 209 bytes docs/rest/releasenotes.html | 53 +- docs/rest/search.html | 39 +- docs/rest/searchindex.js | 2 +- include/NvFlow.h | 149 +- include/NvFlowContext.h | 2 +- include/NvFlowContextD3D12.h | 8 +- include/NvFlowContextExt.h | 637 +++ include/NvFlowTypes.h | 20 + lib/win32/NvFlowLibDebug_win32.dll | Bin 14787952 -> 19391344 bytes lib/win32/NvFlowLibDebug_win32.lib | Bin 38182 -> 81050 bytes lib/win32/NvFlowLibDebug_win32.pdb | Bin 12333056 -> 12554240 bytes lib/win32/NvFlowLibRelease_win32.dll | Bin 1404784 -> 1738608 bytes lib/win32/NvFlowLibRelease_win32.lib | Bin 38470 -> 81648 bytes lib/win32/NvFlowLibRelease_win32.pdb | Bin 8777728 -> 9097216 bytes lib/win64/NvFlowLibDebug_win64.dll | Bin 15476080 -> 20108656 bytes lib/win64/NvFlowLibDebug_win64.lib | Bin 37526 -> 79608 bytes lib/win64/NvFlowLibDebug_win64.pdb | Bin 12472320 -> 12701696 bytes lib/win64/NvFlowLibRelease_win64.dll | Bin 1512816 -> 1850736 bytes lib/win64/NvFlowLibRelease_win64.lib | Bin 37814 -> 80206 bytes lib/win64/NvFlowLibRelease_win64.pdb | Bin 8376320 -> 8671232 bytes release_notes.txt | 7 + 309 files changed, 16543 insertions(+), 2422 deletions(-) create mode 100644 bin/win32/DemoAppCodeGenDebug_win32.exe create mode 100644 bin/win32/DemoAppCodeGenRelease_win32.exe create mode 100644 bin/win64/DemoAppCodeGenDebug_win64.exe create mode 100644 bin/win64/DemoAppCodeGenRelease_win64.exe create mode 100644 demo/DemoApp/NvFlowInteropLoaderGenerated.h create mode 100644 demo/DemoApp/appGraphCtxLoaderGenerated.h create mode 100644 demo/DemoApp/computeContextLoaderGenerated.h create mode 100644 demo/DemoApp/imguiGraphLoaderGenerated.h create mode 100644 demo/DemoApp/meshLoaderGenerated.h create mode 100644 demo/DemoApp/sceneEmitSubStep.cpp create mode 100644 demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj create mode 100644 demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj.filters create mode 100644 demo/DemoAppCodeGen/demoAppCodeGen.cpp create mode 100644 demo/DemoAppCodeGen/functionDefinitionExtract.h create mode 100644 demo/DemoAppCodeGen/loaderCodeGen.h create mode 100644 docs/api/files/_nv_flow_context_ext_8h-source.html create mode 100644 docs/api/files/_nv_flow_context_ext_8h.html create mode 100644 docs/api/files/group___nv_flow_grid_summary.html create mode 100644 docs/api/files/struct_nv_flow_blend_state_desc.html create mode 100644 docs/api/files/struct_nv_flow_buffer_desc.html create mode 100644 docs/api/files/struct_nv_flow_buffer_view_desc.html create mode 100644 docs/api/files/struct_nv_flow_color_buffer_desc.html create mode 100644 docs/api/files/struct_nv_flow_compute_shader_desc.html create mode 100644 docs/api/files/struct_nv_flow_constant_buffer_desc.html create mode 100644 docs/api/files/struct_nv_flow_depth_buffer_desc.html create mode 100644 docs/api/files/struct_nv_flow_depth_state_desc.html create mode 100644 docs/api/files/struct_nv_flow_depth_stencil_desc.html create mode 100644 docs/api/files/struct_nv_flow_dispatch_params.html create mode 100644 docs/api/files/struct_nv_flow_draw_params.html create mode 100644 docs/api/files/struct_nv_flow_fence_desc.html create mode 100644 docs/api/files/struct_nv_flow_float2.html create mode 100644 docs/api/files/struct_nv_flow_graphics_shader_desc.html create mode 100644 docs/api/files/struct_nv_flow_grid_summary_debug_render_params.html create mode 100644 docs/api/files/struct_nv_flow_grid_summary_desc.html create mode 100644 docs/api/files/struct_nv_flow_grid_summary_result.html create mode 100644 docs/api/files/struct_nv_flow_grid_summary_update_params.html create mode 100644 docs/api/files/struct_nv_flow_heap_sparse_desc.html create mode 100644 docs/api/files/struct_nv_flow_index_buffer_desc.html create mode 100644 docs/api/files/struct_nv_flow_input_element_desc.html create mode 100644 docs/api/files/struct_nv_flow_int2.html create mode 100644 docs/api/files/struct_nv_flow_int3.html create mode 100644 docs/api/files/struct_nv_flow_int4.html create mode 100644 docs/api/files/struct_nv_flow_mapped_data.html create mode 100644 docs/api/files/struct_nv_flow_render_target_desc.html create mode 100644 docs/api/files/struct_nv_flow_texture1_d_desc.html create mode 100644 docs/api/files/struct_nv_flow_texture2_d_desc.html create mode 100644 docs/api/files/struct_nv_flow_texture3_d_desc.html create mode 100644 docs/api/files/struct_nv_flow_texture3_d_sparse_desc.html create mode 100644 docs/api/files/struct_nv_flow_vertex_buffer_desc.html create mode 100644 docs/api/files/struct_nv_flow_viewport.html create mode 100644 include/NvFlowContextExt.h diff --git a/NvFlowDemoApp.sln b/NvFlowDemoApp.sln index 4d37de4..5715722 100644 --- a/NvFlowDemoApp.sln +++ b/NvFlowDemoApp.sln @@ -5,16 +5,23 @@ VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DemoApp", "demo\DemoApp\DemoApp.vcxproj", "{001BA531-503D-4407-AE6B-A42408E17BFF}" ProjectSection(ProjectDependencies) = postProject + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2} = {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2} {A8C5329D-82CC-4D1A-971C-243B65AA3D7B} = {A8C5329D-82CC-4D1A-971C-243B65AA3D7B} {BCBFA7E1-C9CE-4326-A5E3-3A93416BBD90} = {BCBFA7E1-C9CE-4326-A5E3-3A93416BBD90} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DemoAppD3D11", "demo\DemoAppD3D11\DemoAppD3D11.vcxproj", "{A8C5329D-82CC-4D1A-971C-243B65AA3D7B}" ProjectSection(ProjectDependencies) = postProject + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2} = {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2} {BCBFA7E1-C9CE-4326-A5E3-3A93416BBD90} = {BCBFA7E1-C9CE-4326-A5E3-3A93416BBD90} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DemoAppD3D12", "demo\DemoAppD3D12\DemoAppD3D12.vcxproj", "{BCBFA7E1-C9CE-4326-A5E3-3A93416BBD90}" + ProjectSection(ProjectDependencies) = postProject + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2} = {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DemoAppCodeGen", "demo\DemoAppCodeGen\DemoAppCodeGen.vcxproj", "{15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -48,6 +55,14 @@ Global {BCBFA7E1-C9CE-4326-A5E3-3A93416BBD90}.Release|x64.Build.0 = Release|x64 {BCBFA7E1-C9CE-4326-A5E3-3A93416BBD90}.Release|x86.ActiveCfg = Release|Win32 {BCBFA7E1-C9CE-4326-A5E3-3A93416BBD90}.Release|x86.Build.0 = Release|Win32 + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}.Debug|x64.ActiveCfg = Debug|x64 + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}.Debug|x64.Build.0 = Debug|x64 + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}.Debug|x86.ActiveCfg = Debug|Win32 + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}.Debug|x86.Build.0 = Debug|Win32 + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}.Release|x64.ActiveCfg = Release|x64 + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}.Release|x64.Build.0 = Release|x64 + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}.Release|x86.ActiveCfg = Release|Win32 + {15A2730A-1BE6-4A99-BE96-FEB4B8944AC2}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index 776740b..d0a4c94 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -NVIDIA Flow - 1.0.0 +NVIDIA Flow - 1.0.1 =================== Flow is a sparse grid-based fluid simulation library for real-time applications. diff --git a/bin/win32/DemoAppCodeGenDebug_win32.exe b/bin/win32/DemoAppCodeGenDebug_win32.exe new file mode 100644 index 0000000..534eb04 Binary files /dev/null and b/bin/win32/DemoAppCodeGenDebug_win32.exe differ diff --git a/bin/win32/DemoAppCodeGenRelease_win32.exe b/bin/win32/DemoAppCodeGenRelease_win32.exe new file mode 100644 index 0000000..52405fd Binary files /dev/null and b/bin/win32/DemoAppCodeGenRelease_win32.exe differ diff --git a/bin/win32/DemoAppD3D11Debug_win32.dll b/bin/win32/DemoAppD3D11Debug_win32.dll index 95cd102..fc28bdb 100644 Binary files a/bin/win32/DemoAppD3D11Debug_win32.dll and b/bin/win32/DemoAppD3D11Debug_win32.dll differ diff --git a/bin/win32/DemoAppD3D11Release_win32.dll b/bin/win32/DemoAppD3D11Release_win32.dll index 3610047..63828e6 100644 Binary files a/bin/win32/DemoAppD3D11Release_win32.dll and b/bin/win32/DemoAppD3D11Release_win32.dll differ diff --git a/bin/win32/DemoAppD3D12Debug_win32.dll b/bin/win32/DemoAppD3D12Debug_win32.dll index 014dde4..5f20d68 100644 Binary files a/bin/win32/DemoAppD3D12Debug_win32.dll and b/bin/win32/DemoAppD3D12Debug_win32.dll differ diff --git a/bin/win32/DemoAppD3D12Release_win32.dll b/bin/win32/DemoAppD3D12Release_win32.dll index 0b5f5f4..0a1baa6 100644 Binary files a/bin/win32/DemoAppD3D12Release_win32.dll and b/bin/win32/DemoAppD3D12Release_win32.dll differ diff --git a/bin/win32/DemoAppDebug_win32.exe b/bin/win32/DemoAppDebug_win32.exe index 6374756..0fe30fa 100644 Binary files a/bin/win32/DemoAppDebug_win32.exe and b/bin/win32/DemoAppDebug_win32.exe differ diff --git a/bin/win32/DemoAppRelease_win32.exe b/bin/win32/DemoAppRelease_win32.exe index fbeb132..90380a3 100644 Binary files a/bin/win32/DemoAppRelease_win32.exe and b/bin/win32/DemoAppRelease_win32.exe differ diff --git a/bin/win32/NvFlowLibDebug_win32.dll b/bin/win32/NvFlowLibDebug_win32.dll index c4ec06b..21527c7 100644 Binary files a/bin/win32/NvFlowLibDebug_win32.dll and b/bin/win32/NvFlowLibDebug_win32.dll differ diff --git a/bin/win32/NvFlowLibRelease_win32.dll b/bin/win32/NvFlowLibRelease_win32.dll index f97c44d..c882d74 100644 Binary files a/bin/win32/NvFlowLibRelease_win32.dll and b/bin/win32/NvFlowLibRelease_win32.dll differ diff --git a/bin/win64/DemoAppCodeGenDebug_win64.exe b/bin/win64/DemoAppCodeGenDebug_win64.exe new file mode 100644 index 0000000..791cfc8 Binary files /dev/null and b/bin/win64/DemoAppCodeGenDebug_win64.exe differ diff --git a/bin/win64/DemoAppCodeGenRelease_win64.exe b/bin/win64/DemoAppCodeGenRelease_win64.exe new file mode 100644 index 0000000..242a29d Binary files /dev/null and b/bin/win64/DemoAppCodeGenRelease_win64.exe differ diff --git a/bin/win64/DemoAppD3D11Debug_win64.dll b/bin/win64/DemoAppD3D11Debug_win64.dll index 03c74f4..26a709d 100644 Binary files a/bin/win64/DemoAppD3D11Debug_win64.dll and b/bin/win64/DemoAppD3D11Debug_win64.dll differ diff --git a/bin/win64/DemoAppD3D11Release_win64.dll b/bin/win64/DemoAppD3D11Release_win64.dll index 1be3ff8..520e0fd 100644 Binary files a/bin/win64/DemoAppD3D11Release_win64.dll and b/bin/win64/DemoAppD3D11Release_win64.dll differ diff --git a/bin/win64/DemoAppD3D12Debug_win64.dll b/bin/win64/DemoAppD3D12Debug_win64.dll index 861c499..3b0d446 100644 Binary files a/bin/win64/DemoAppD3D12Debug_win64.dll and b/bin/win64/DemoAppD3D12Debug_win64.dll differ diff --git a/bin/win64/DemoAppD3D12Release_win64.dll b/bin/win64/DemoAppD3D12Release_win64.dll index 43dd295..421a9a5 100644 Binary files a/bin/win64/DemoAppD3D12Release_win64.dll and b/bin/win64/DemoAppD3D12Release_win64.dll differ diff --git a/bin/win64/DemoAppDebug_win64.exe b/bin/win64/DemoAppDebug_win64.exe index cf7c671..764404b 100644 Binary files a/bin/win64/DemoAppDebug_win64.exe and b/bin/win64/DemoAppDebug_win64.exe differ diff --git a/bin/win64/DemoAppRelease_win64.exe b/bin/win64/DemoAppRelease_win64.exe index c69a32c..93b8666 100644 Binary files a/bin/win64/DemoAppRelease_win64.exe and b/bin/win64/DemoAppRelease_win64.exe differ diff --git a/bin/win64/NvFlowLibDebug_win64.dll b/bin/win64/NvFlowLibDebug_win64.dll index c3f7e10..17e3627 100644 Binary files a/bin/win64/NvFlowLibDebug_win64.dll and b/bin/win64/NvFlowLibDebug_win64.dll differ diff --git a/bin/win64/NvFlowLibRelease_win64.dll b/bin/win64/NvFlowLibRelease_win64.dll index b893d5c..b66c9ce 100644 Binary files a/bin/win64/NvFlowLibRelease_win64.dll and b/bin/win64/NvFlowLibRelease_win64.dll differ diff --git a/demo/DemoApp/DemoApp.vcxproj b/demo/DemoApp/DemoApp.vcxproj index 4cae61f..ba4e592 100644 --- a/demo/DemoApp/DemoApp.vcxproj +++ b/demo/DemoApp/DemoApp.vcxproj @@ -141,6 +141,12 @@ copy "$(SolutionDir)Lib\$(PlatformName)\*.dll" "$(outDir)" SDL2.dll + + "$(outDir)DemoAppCodeGen$(Configuration)_$(PlatformName).exe" + + + Code Generation + @@ -172,6 +178,12 @@ copy "$(SolutionDir)Lib\$(PlatformName)\*.dll" "$(outDir)" SDL2.dll + + "$(outDir)DemoAppCodeGen$(Configuration)_$(PlatformName).exe" + + + Code Generation + @@ -207,6 +219,12 @@ copy "$(SolutionDir)Lib\$(PlatformName)\*.dll" "$(outDir)" SDL2.dll + + "$(outDir)DemoAppCodeGen$(Configuration)_$(PlatformName).exe" + + + Code Generation + @@ -242,6 +260,12 @@ copy "$(SolutionDir)Lib\$(PlatformName)\*.dll" "$(outDir)" SDL2.dll + + "$(outDir)DemoAppCodeGen$(Configuration)_$(PlatformName).exe" + + + Code Generation + $(OutDir) @@ -276,6 +300,7 @@ copy "$(SolutionDir)Lib\$(PlatformName)\*.dll" "$(outDir)" + diff --git a/demo/DemoApp/DemoApp.vcxproj.filters b/demo/DemoApp/DemoApp.vcxproj.filters index 94b9d93..b6bfb93 100644 --- a/demo/DemoApp/DemoApp.vcxproj.filters +++ b/demo/DemoApp/DemoApp.vcxproj.filters @@ -78,6 +78,9 @@ Source Files + + Source Files + diff --git a/demo/DemoApp/NvFlowInteropLoader.cpp b/demo/DemoApp/NvFlowInteropLoader.cpp index 6224373..082afcf 100644 --- a/demo/DemoApp/NvFlowInteropLoader.cpp +++ b/demo/DemoApp/NvFlowInteropLoader.cpp @@ -14,50 +14,6 @@ #include "NvFlowInterop.h" -namespace -{ - ModuleLoader<16u, SDL_LoadObject, SDL_UnloadObject, SDL_LoadFunction> g_loader; -} +#include -void loadNvFlowInterop(AppGraphCtxType type) -{ - const char* moduleName = demoAppDLLName(type); - - g_loader.loadModule(moduleName); -} - -void unloadNvFlowInterop() -{ - g_loader.unloadModule(); -} - -// Functions -NvFlowContext* NvFlowInteropCreateContext(AppGraphCtx* appctx) -{ - return g_loader.function<0>(NvFlowInteropCreateContext, "NvFlowInteropCreateContext", appctx); -} - -NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilView(AppGraphCtx* appctx, NvFlowContext* flowctx) -{ - return g_loader.function<1>(NvFlowInteropCreateDepthStencilView, "NvFlowInteropCreateDepthStencilView", appctx, flowctx); -} - -NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetView(AppGraphCtx* appctx, NvFlowContext* flowctx) -{ - return g_loader.function<2>(NvFlowInteropCreateRenderTargetView, "NvFlowInteropCreateRenderTargetView", appctx, flowctx); -} - -void NvFlowInteropUpdateContext(NvFlowContext* context, AppGraphCtx* appctx) -{ - return g_loader.function<3>(NvFlowInteropUpdateContext, "NvFlowInteropUpdateContext", context, appctx); -} - -void NvFlowInteropUpdateDepthStencilView(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx) -{ - return g_loader.function<4>(NvFlowInteropUpdateDepthStencilView, "NvFlowInteropUpdateDepthStencilView", view, appctx, flowctx); -} - -void NvFlowInteropUpdateRenderTargetView(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx) -{ - return g_loader.function<5>(NvFlowInteropUpdateRenderTargetView, "NvFlowInteropUpdateRenderTargetView", view, appctx, flowctx); -} \ No newline at end of file +#include "NvFlowInteropLoaderGenerated.h" \ No newline at end of file diff --git a/demo/DemoApp/NvFlowInteropLoaderGenerated.h b/demo/DemoApp/NvFlowInteropLoaderGenerated.h new file mode 100644 index 0000000..dad9989 --- /dev/null +++ b/demo/DemoApp/NvFlowInteropLoaderGenerated.h @@ -0,0 +1,96 @@ +/* +* 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. +*/ + +typedef NvFlowContext* (*NvFlowInteropCreateContext_ptr_t)(AppGraphCtx* appctx); +typedef NvFlowDepthStencilView* (*NvFlowInteropCreateDepthStencilView_ptr_t)(AppGraphCtx* appctx, NvFlowContext* flowctx); +typedef NvFlowRenderTargetView* (*NvFlowInteropCreateRenderTargetView_ptr_t)(AppGraphCtx* appctx, NvFlowContext* flowctx); +typedef void (*NvFlowInteropUpdateContext_ptr_t)(NvFlowContext* context, AppGraphCtx* appctx); +typedef void (*NvFlowInteropUpdateDepthStencilView_ptr_t)(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx); +typedef void (*NvFlowInteropUpdateRenderTargetView_ptr_t)(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx); + +struct NvFlowInteropLoader +{ + void* module = nullptr; + const char* suffix = ""; + char buf[1024u]; + + NvFlowInteropCreateContext_ptr_t NvFlowInteropCreateContext_ptr; + NvFlowInteropCreateDepthStencilView_ptr_t NvFlowInteropCreateDepthStencilView_ptr; + NvFlowInteropCreateRenderTargetView_ptr_t NvFlowInteropCreateRenderTargetView_ptr; + NvFlowInteropUpdateContext_ptr_t NvFlowInteropUpdateContext_ptr; + NvFlowInteropUpdateDepthStencilView_ptr_t NvFlowInteropUpdateDepthStencilView_ptr; + NvFlowInteropUpdateRenderTargetView_ptr_t NvFlowInteropUpdateRenderTargetView_ptr; + +}gNvFlowInteropLoader; + +NvFlowContext* NvFlowInteropCreateContext(AppGraphCtx* appctx) +{ + return gNvFlowInteropLoader.NvFlowInteropCreateContext_ptr(appctx); +} + +NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilView(AppGraphCtx* appctx, NvFlowContext* flowctx) +{ + return gNvFlowInteropLoader.NvFlowInteropCreateDepthStencilView_ptr(appctx, flowctx); +} + +NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetView(AppGraphCtx* appctx, NvFlowContext* flowctx) +{ + return gNvFlowInteropLoader.NvFlowInteropCreateRenderTargetView_ptr(appctx, flowctx); +} + +void NvFlowInteropUpdateContext(NvFlowContext* context, AppGraphCtx* appctx) +{ + return gNvFlowInteropLoader.NvFlowInteropUpdateContext_ptr(context, appctx); +} + +void NvFlowInteropUpdateDepthStencilView(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx) +{ + return gNvFlowInteropLoader.NvFlowInteropUpdateDepthStencilView_ptr(view, appctx, flowctx); +} + +void NvFlowInteropUpdateRenderTargetView(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx) +{ + return gNvFlowInteropLoader.NvFlowInteropUpdateRenderTargetView_ptr(view, appctx, flowctx); +} + +void* nvFlowInteropLoaderLoadFunction(NvFlowInteropLoader* inst, const char* name) +{ + snprintf(inst->buf, 1024u, "%s%s", name, inst->suffix); + + return SDL_LoadFunction(inst->module, inst->buf); +} + +void loadNvFlowInterop(AppGraphCtxType type) +{ + const char* moduleName = demoAppDLLName(type); + + gNvFlowInteropLoader.suffix = demoAppBackendSuffix(type); + + gNvFlowInteropLoader.module = SDL_LoadObject(moduleName); + + gNvFlowInteropLoader.NvFlowInteropCreateContext_ptr = (NvFlowInteropCreateContext_ptr_t)(nvFlowInteropLoaderLoadFunction(&gNvFlowInteropLoader, "NvFlowInteropCreateContext")); + gNvFlowInteropLoader.NvFlowInteropCreateDepthStencilView_ptr = (NvFlowInteropCreateDepthStencilView_ptr_t)(nvFlowInteropLoaderLoadFunction(&gNvFlowInteropLoader, "NvFlowInteropCreateDepthStencilView")); + gNvFlowInteropLoader.NvFlowInteropCreateRenderTargetView_ptr = (NvFlowInteropCreateRenderTargetView_ptr_t)(nvFlowInteropLoaderLoadFunction(&gNvFlowInteropLoader, "NvFlowInteropCreateRenderTargetView")); + gNvFlowInteropLoader.NvFlowInteropUpdateContext_ptr = (NvFlowInteropUpdateContext_ptr_t)(nvFlowInteropLoaderLoadFunction(&gNvFlowInteropLoader, "NvFlowInteropUpdateContext")); + gNvFlowInteropLoader.NvFlowInteropUpdateDepthStencilView_ptr = (NvFlowInteropUpdateDepthStencilView_ptr_t)(nvFlowInteropLoaderLoadFunction(&gNvFlowInteropLoader, "NvFlowInteropUpdateDepthStencilView")); + gNvFlowInteropLoader.NvFlowInteropUpdateRenderTargetView_ptr = (NvFlowInteropUpdateRenderTargetView_ptr_t)(nvFlowInteropLoaderLoadFunction(&gNvFlowInteropLoader, "NvFlowInteropUpdateRenderTargetView")); +} + +void unloadNvFlowInterop() +{ + gNvFlowInteropLoader.NvFlowInteropCreateContext_ptr = nullptr; + gNvFlowInteropLoader.NvFlowInteropCreateDepthStencilView_ptr = nullptr; + gNvFlowInteropLoader.NvFlowInteropCreateRenderTargetView_ptr = nullptr; + gNvFlowInteropLoader.NvFlowInteropUpdateContext_ptr = nullptr; + gNvFlowInteropLoader.NvFlowInteropUpdateDepthStencilView_ptr = nullptr; + gNvFlowInteropLoader.NvFlowInteropUpdateRenderTargetView_ptr = nullptr; + + SDL_UnloadObject(gNvFlowInteropLoader.module); +} diff --git a/demo/DemoApp/appGraphCtx.h b/demo/DemoApp/appGraphCtx.h index 2f41c36..f1f0f75 100644 --- a/demo/DemoApp/appGraphCtx.h +++ b/demo/DemoApp/appGraphCtx.h @@ -16,6 +16,11 @@ struct SDL_Window; struct AppGraphCtx; +struct AppGraphColor +{ + float r, g, b, a; +}; + APP_GRAPH_CTX_API AppGraphCtx* AppGraphCtxCreate(int deviceID); APP_GRAPH_CTX_API bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullscreen); @@ -24,7 +29,7 @@ APP_GRAPH_CTX_API void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context); APP_GRAPH_CTX_API void AppGraphCtxRelease(AppGraphCtx* context); -APP_GRAPH_CTX_API void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4]); +APP_GRAPH_CTX_API void AppGraphCtxFrameStart(AppGraphCtx* context, AppGraphColor clearColor); APP_GRAPH_CTX_API void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync); diff --git a/demo/DemoApp/appGraphCtxLoader.cpp b/demo/DemoApp/appGraphCtxLoader.cpp index f724a93..6aa0f67 100644 --- a/demo/DemoApp/appGraphCtxLoader.cpp +++ b/demo/DemoApp/appGraphCtxLoader.cpp @@ -14,79 +14,6 @@ #include "appGraphCtx.h" -namespace -{ - ModuleLoader<16u, SDL_LoadObject, SDL_UnloadObject, SDL_LoadFunction> g_loader; -} +#include -void loadAppGraphCtx(AppGraphCtxType type) -{ - const char* moduleName = demoAppDLLName(type); - - g_loader.loadModule(moduleName); -} - -void unloadAppGraphCtx() -{ - g_loader.unloadModule(); -} - -AppGraphCtx* AppGraphCtxCreate(int deviceID) -{ - return g_loader.function<0>(AppGraphCtxCreate, "AppGraphCtxCreate", deviceID); -} - -bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullscreen) -{ - return g_loader.function<1>(AppGraphCtxUpdateSize, "AppGraphCtxUpdateSize", context, window, fullscreen); -} - -void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context) -{ - return g_loader.function<2>(AppGraphCtxReleaseRenderTarget, "AppGraphCtxReleaseRenderTarget", context); -} - -void AppGraphCtxRelease(AppGraphCtx* context) -{ - return g_loader.function<3>(AppGraphCtxRelease, "AppGraphCtxRelease", context); -} - -void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4]) -{ - return g_loader.function<4>(AppGraphCtxFrameStart, "AppGraphCtxFrameStart", context, clearColor); -} - -void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync) -{ - return g_loader.function<5>(AppGraphCtxFramePresent, "AppGraphCtxFramePresent", context, fullsync); -} - -void AppGraphCtxWaitForFrames(AppGraphCtx* context, unsigned int maxFramesInFlight) -{ - return g_loader.function<6>(AppGraphCtxWaitForFrames, "AppGraphCtxWaitForFrames", context, maxFramesInFlight); -} - -void AppGraphCtxProfileEnable(AppGraphCtx* context, bool enabled) -{ - return g_loader.function<7>(AppGraphCtxProfileEnable, "AppGraphCtxProfileEnable", context, enabled); -} - -void AppGraphCtxProfileBegin(AppGraphCtx* context, const char* label) -{ - return g_loader.function<8>(AppGraphCtxProfileBegin, "AppGraphCtxProfileBegin", context, label); -} - -void AppGraphCtxProfileEnd(AppGraphCtx* context, const char* label) -{ - return g_loader.function<9>(AppGraphCtxProfileEnd, "AppGraphCtxProfileEnd", context, label); -} - -bool AppGraphCtxProfileGet(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index) -{ - return g_loader.function<10>(AppGraphCtxProfileGet, "AppGraphCtxProfileGet", context, plabel, cpuTime, gpuTime, index); -} - -size_t AppGraphCtxDedicatedVideoMemory(AppGraphCtx* context) -{ - return g_loader.function<11>(AppGraphCtxDedicatedVideoMemory, "AppGraphCtxDedicatedVideoMemory", context); -} \ No newline at end of file +#include "appGraphCtxLoaderGenerated.h" \ No newline at end of file diff --git a/demo/DemoApp/appGraphCtxLoaderGenerated.h b/demo/DemoApp/appGraphCtxLoaderGenerated.h new file mode 100644 index 0000000..7983c29 --- /dev/null +++ b/demo/DemoApp/appGraphCtxLoaderGenerated.h @@ -0,0 +1,150 @@ +/* +* 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. +*/ + +typedef AppGraphCtx* (*AppGraphCtxCreate_ptr_t)(int deviceID); +typedef bool (*AppGraphCtxUpdateSize_ptr_t)(AppGraphCtx* context, SDL_Window* window, bool fullscreen); +typedef void (*AppGraphCtxReleaseRenderTarget_ptr_t)(AppGraphCtx* context); +typedef void (*AppGraphCtxRelease_ptr_t)(AppGraphCtx* context); +typedef void (*AppGraphCtxFrameStart_ptr_t)(AppGraphCtx* context, AppGraphColor clearColor); +typedef void (*AppGraphCtxFramePresent_ptr_t)(AppGraphCtx* context, bool fullsync); +typedef void (*AppGraphCtxWaitForFrames_ptr_t)(AppGraphCtx* context, unsigned int maxFramesInFlight); +typedef void (*AppGraphCtxProfileEnable_ptr_t)(AppGraphCtx* context, bool enabled); +typedef void (*AppGraphCtxProfileBegin_ptr_t)(AppGraphCtx* context, const char* label); +typedef void (*AppGraphCtxProfileEnd_ptr_t)(AppGraphCtx* context, const char* label); +typedef bool (*AppGraphCtxProfileGet_ptr_t)(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index); +typedef size_t (*AppGraphCtxDedicatedVideoMemory_ptr_t)(AppGraphCtx* context); + +struct AppGraphCtxLoader +{ + void* module = nullptr; + const char* suffix = ""; + char buf[1024u]; + + AppGraphCtxCreate_ptr_t AppGraphCtxCreate_ptr; + AppGraphCtxUpdateSize_ptr_t AppGraphCtxUpdateSize_ptr; + AppGraphCtxReleaseRenderTarget_ptr_t AppGraphCtxReleaseRenderTarget_ptr; + AppGraphCtxRelease_ptr_t AppGraphCtxRelease_ptr; + AppGraphCtxFrameStart_ptr_t AppGraphCtxFrameStart_ptr; + AppGraphCtxFramePresent_ptr_t AppGraphCtxFramePresent_ptr; + AppGraphCtxWaitForFrames_ptr_t AppGraphCtxWaitForFrames_ptr; + AppGraphCtxProfileEnable_ptr_t AppGraphCtxProfileEnable_ptr; + AppGraphCtxProfileBegin_ptr_t AppGraphCtxProfileBegin_ptr; + AppGraphCtxProfileEnd_ptr_t AppGraphCtxProfileEnd_ptr; + AppGraphCtxProfileGet_ptr_t AppGraphCtxProfileGet_ptr; + AppGraphCtxDedicatedVideoMemory_ptr_t AppGraphCtxDedicatedVideoMemory_ptr; + +}gAppGraphCtxLoader; + +AppGraphCtx* AppGraphCtxCreate(int deviceID) +{ + return gAppGraphCtxLoader.AppGraphCtxCreate_ptr(deviceID); +} + +bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullscreen) +{ + return gAppGraphCtxLoader.AppGraphCtxUpdateSize_ptr(context, window, fullscreen); +} + +void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context) +{ + return gAppGraphCtxLoader.AppGraphCtxReleaseRenderTarget_ptr(context); +} + +void AppGraphCtxRelease(AppGraphCtx* context) +{ + return gAppGraphCtxLoader.AppGraphCtxRelease_ptr(context); +} + +void AppGraphCtxFrameStart(AppGraphCtx* context, AppGraphColor clearColor) +{ + return gAppGraphCtxLoader.AppGraphCtxFrameStart_ptr(context, clearColor); +} + +void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync) +{ + return gAppGraphCtxLoader.AppGraphCtxFramePresent_ptr(context, fullsync); +} + +void AppGraphCtxWaitForFrames(AppGraphCtx* context, unsigned int maxFramesInFlight) +{ + return gAppGraphCtxLoader.AppGraphCtxWaitForFrames_ptr(context, maxFramesInFlight); +} + +void AppGraphCtxProfileEnable(AppGraphCtx* context, bool enabled) +{ + return gAppGraphCtxLoader.AppGraphCtxProfileEnable_ptr(context, enabled); +} + +void AppGraphCtxProfileBegin(AppGraphCtx* context, const char* label) +{ + return gAppGraphCtxLoader.AppGraphCtxProfileBegin_ptr(context, label); +} + +void AppGraphCtxProfileEnd(AppGraphCtx* context, const char* label) +{ + return gAppGraphCtxLoader.AppGraphCtxProfileEnd_ptr(context, label); +} + +bool AppGraphCtxProfileGet(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index) +{ + return gAppGraphCtxLoader.AppGraphCtxProfileGet_ptr(context, plabel, cpuTime, gpuTime, index); +} + +size_t AppGraphCtxDedicatedVideoMemory(AppGraphCtx* context) +{ + return gAppGraphCtxLoader.AppGraphCtxDedicatedVideoMemory_ptr(context); +} + +void* appGraphCtxLoaderLoadFunction(AppGraphCtxLoader* inst, const char* name) +{ + snprintf(inst->buf, 1024u, "%s%s", name, inst->suffix); + + return SDL_LoadFunction(inst->module, inst->buf); +} + +void loadAppGraphCtx(AppGraphCtxType type) +{ + const char* moduleName = demoAppDLLName(type); + + gAppGraphCtxLoader.suffix = demoAppBackendSuffix(type); + + gAppGraphCtxLoader.module = SDL_LoadObject(moduleName); + + gAppGraphCtxLoader.AppGraphCtxCreate_ptr = (AppGraphCtxCreate_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxCreate")); + gAppGraphCtxLoader.AppGraphCtxUpdateSize_ptr = (AppGraphCtxUpdateSize_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxUpdateSize")); + gAppGraphCtxLoader.AppGraphCtxReleaseRenderTarget_ptr = (AppGraphCtxReleaseRenderTarget_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxReleaseRenderTarget")); + gAppGraphCtxLoader.AppGraphCtxRelease_ptr = (AppGraphCtxRelease_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxRelease")); + gAppGraphCtxLoader.AppGraphCtxFrameStart_ptr = (AppGraphCtxFrameStart_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxFrameStart")); + gAppGraphCtxLoader.AppGraphCtxFramePresent_ptr = (AppGraphCtxFramePresent_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxFramePresent")); + gAppGraphCtxLoader.AppGraphCtxWaitForFrames_ptr = (AppGraphCtxWaitForFrames_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxWaitForFrames")); + gAppGraphCtxLoader.AppGraphCtxProfileEnable_ptr = (AppGraphCtxProfileEnable_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxProfileEnable")); + gAppGraphCtxLoader.AppGraphCtxProfileBegin_ptr = (AppGraphCtxProfileBegin_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxProfileBegin")); + gAppGraphCtxLoader.AppGraphCtxProfileEnd_ptr = (AppGraphCtxProfileEnd_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxProfileEnd")); + gAppGraphCtxLoader.AppGraphCtxProfileGet_ptr = (AppGraphCtxProfileGet_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxProfileGet")); + gAppGraphCtxLoader.AppGraphCtxDedicatedVideoMemory_ptr = (AppGraphCtxDedicatedVideoMemory_ptr_t)(appGraphCtxLoaderLoadFunction(&gAppGraphCtxLoader, "AppGraphCtxDedicatedVideoMemory")); +} + +void unloadAppGraphCtx() +{ + gAppGraphCtxLoader.AppGraphCtxCreate_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxUpdateSize_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxReleaseRenderTarget_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxRelease_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxFrameStart_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxFramePresent_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxWaitForFrames_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxProfileEnable_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxProfileBegin_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxProfileEnd_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxProfileGet_ptr = nullptr; + gAppGraphCtxLoader.AppGraphCtxDedicatedVideoMemory_ptr = nullptr; + + SDL_UnloadObject(gAppGraphCtxLoader.module); +} diff --git a/demo/DemoApp/computeContextLoader.cpp b/demo/DemoApp/computeContextLoader.cpp index 593b2ce..396f8b5 100644 --- a/demo/DemoApp/computeContextLoader.cpp +++ b/demo/DemoApp/computeContextLoader.cpp @@ -14,134 +14,6 @@ #include "computeContext.h" -namespace -{ - ModuleLoader<32u, SDL_LoadObject, SDL_UnloadObject, SDL_LoadFunction> g_loader; -} +#include -void loadComputeContext(AppGraphCtxType type) -{ - const char* moduleName = demoAppDLLName(type); - - g_loader.loadModule(moduleName); -} - -void unloadComputeContext() -{ - g_loader.unloadModule(); -} - -ComputeContext* ComputeContextCreate(ComputeContextDesc* desc) -{ - return g_loader.function<0>(ComputeContextCreate, "ComputeContextCreate", desc); -} - -void ComputeContextUpdate(ComputeContext* context, ComputeContextDesc* desc) -{ - return g_loader.function<1>(ComputeContextUpdate, "ComputeContextUpdate", context, desc); -} - -void ComputeContextRelease(ComputeContext* context) -{ - return g_loader.function<2>(ComputeContextRelease, "ComputeContextRelease", context); -} - -ComputeShader* ComputeShaderCreate(ComputeContext* context, const ComputeShaderDesc* desc) -{ - return g_loader.function<3>(ComputeShaderCreate, "ComputeShaderCreate", context, desc); -} - -void ComputeShaderRelease(ComputeShader* shader) -{ - return g_loader.function<4>(ComputeShaderRelease, "ComputeShaderRelease", shader); -} - -ComputeConstantBuffer* ComputeConstantBufferCreate(ComputeContext* context, const ComputeConstantBufferDesc* desc) -{ - return g_loader.function<5>(ComputeConstantBufferCreate, "ComputeConstantBufferCreate", context, desc); -} - -void ComputeConstantBufferRelease(ComputeConstantBuffer* constantBuffer) -{ - return g_loader.function<6>(ComputeConstantBufferRelease, "ComputeConstantBufferRelease", constantBuffer); -} - -void* ComputeConstantBufferMap(ComputeContext* context, ComputeConstantBuffer* constantBuffer) -{ - return g_loader.function<7>(ComputeConstantBufferMap, "ComputeConstantBufferMap", context, constantBuffer); -} - -void ComputeConstantBufferUnmap(ComputeContext* context, ComputeConstantBuffer* constantBuffer) -{ - return g_loader.function<8>(ComputeConstantBufferUnmap, "ComputeConstantBufferUnmap", context, constantBuffer); -} - -ComputeResource* ComputeResourceCreate(ComputeContext* context, const ComputeResourceDesc* desc) -{ - return g_loader.function<9>(ComputeResourceCreate, "ComputeResourceCreate", context, desc); -} - -void ComputeResourceUpdate(ComputeContext* context, ComputeResource* resource, const ComputeResourceDesc* desc) -{ - return g_loader.function<10>(ComputeResourceUpdate, "ComputeResourceUpdate", context, resource, desc); -} - -void ComputeResourceRelease(ComputeResource* resource) -{ - return g_loader.function<11>(ComputeResourceRelease, "ComputeResourceRelease", resource); -} - -ComputeResourceRW* ComputeResourceRWCreate(ComputeContext* context, const ComputeResourceRWDesc* desc) -{ - return g_loader.function<12>(ComputeResourceRWCreate, "ComputeResourceRWCreate", context, desc); -} - -void ComputeResourceRWUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, const ComputeResourceRWDesc* desc) -{ - return g_loader.function<13>(ComputeResourceRWUpdate, "ComputeResourceRWUpdate", context, resourceRW, desc); -} - -void ComputeResourceRWRelease(ComputeResourceRW* resourceRW) -{ - return g_loader.function<14>(ComputeResourceRWRelease, "ComputeResourceRWRelease", resourceRW); -} - -void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams* params) -{ - return g_loader.function<15>(ComputeContextDispatch, "ComputeContextDispatch", context, params); -} - -ComputeContext* ComputeContextNvFlowContextCreate(NvFlowContext* flowContext) -{ - return g_loader.function<16>(ComputeContextNvFlowContextCreate, "ComputeContextNvFlowContextCreate", flowContext); -} - -void ComputeContextNvFlowContextUpdate(ComputeContext* computeContext, NvFlowContext* flowContext) -{ - return g_loader.function<17>(ComputeContextNvFlowContextUpdate, "ComputeContextNvFlowContextUpdate", computeContext, flowContext); -} - -ComputeResource* ComputeResourceNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource) -{ - return g_loader.function<18>(ComputeResourceNvFlowCreate, "ComputeResourceNvFlowCreate", context, flowContext, flowResource); -} - -void ComputeResourceNvFlowUpdate(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource) -{ - return g_loader.function<19>(ComputeResourceNvFlowUpdate, "ComputeResourceNvFlowUpdate", context, resource, flowContext, flowResource); -} - -ComputeResourceRW* ComputeResourceRWNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) -{ - return g_loader.function<20>(ComputeResourceRWNvFlowCreate, "ComputeResourceRWNvFlowCreate", context, flowContext, flowResourceRW); -} - -void ComputeResourceRWNvFlowUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) -{ - return g_loader.function<21>(ComputeResourceRWNvFlowUpdate, "ComputeResourceRWNvFlowUpdate", context, resourceRW, flowContext, flowResourceRW); -} - -ComputeResource* ComputeResourceRWGetResource(ComputeResourceRW* resourceRW) -{ - return g_loader.function<22>(ComputeResourceRWGetResource, "ComputeResourceRWGetResource", resourceRW); -} \ No newline at end of file +#include "computeContextLoaderGenerated.h" \ No newline at end of file diff --git a/demo/DemoApp/computeContextLoaderGenerated.h b/demo/DemoApp/computeContextLoaderGenerated.h new file mode 100644 index 0000000..b15775e --- /dev/null +++ b/demo/DemoApp/computeContextLoaderGenerated.h @@ -0,0 +1,249 @@ +/* +* 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. +*/ + +typedef ComputeContext* (*ComputeContextCreate_ptr_t)(ComputeContextDesc* desc); +typedef void (*ComputeContextUpdate_ptr_t)(ComputeContext* context, ComputeContextDesc* desc); +typedef void (*ComputeContextRelease_ptr_t)(ComputeContext* context); +typedef ComputeShader* (*ComputeShaderCreate_ptr_t)(ComputeContext* context, const ComputeShaderDesc* desc); +typedef void (*ComputeShaderRelease_ptr_t)(ComputeShader* shader); +typedef ComputeConstantBuffer* (*ComputeConstantBufferCreate_ptr_t)(ComputeContext* context, const ComputeConstantBufferDesc* desc); +typedef void (*ComputeConstantBufferRelease_ptr_t)(ComputeConstantBuffer* constantBuffer); +typedef void* (*ComputeConstantBufferMap_ptr_t)(ComputeContext* context, ComputeConstantBuffer* constantBuffer); +typedef void (*ComputeConstantBufferUnmap_ptr_t)(ComputeContext* context, ComputeConstantBuffer* constantBuffer); +typedef ComputeResource* (*ComputeResourceCreate_ptr_t)(ComputeContext* context, const ComputeResourceDesc* desc); +typedef void (*ComputeResourceUpdate_ptr_t)(ComputeContext* context, ComputeResource* resource, const ComputeResourceDesc* desc); +typedef void (*ComputeResourceRelease_ptr_t)(ComputeResource* resource); +typedef ComputeResourceRW* (*ComputeResourceRWCreate_ptr_t)(ComputeContext* context, const ComputeResourceRWDesc* desc); +typedef void (*ComputeResourceRWUpdate_ptr_t)(ComputeContext* context, ComputeResourceRW* resourceRW, const ComputeResourceRWDesc* desc); +typedef void (*ComputeResourceRWRelease_ptr_t)(ComputeResourceRW* resourceRW); +typedef ComputeResource* (*ComputeResourceRWGetResource_ptr_t)(ComputeResourceRW* resourceRW); +typedef void (*ComputeContextDispatch_ptr_t)(ComputeContext* context, const ComputeDispatchParams* params); +typedef ComputeContext* (*ComputeContextNvFlowContextCreate_ptr_t)(NvFlowContext* flowContext); +typedef void (*ComputeContextNvFlowContextUpdate_ptr_t)(ComputeContext* computeContext, NvFlowContext* flowContext); +typedef ComputeResource* (*ComputeResourceNvFlowCreate_ptr_t)(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource); +typedef void (*ComputeResourceNvFlowUpdate_ptr_t)(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource); +typedef ComputeResourceRW* (*ComputeResourceRWNvFlowCreate_ptr_t)(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW); +typedef void (*ComputeResourceRWNvFlowUpdate_ptr_t)(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW); + +struct ComputeContextLoader +{ + void* module = nullptr; + const char* suffix = ""; + char buf[1024u]; + + ComputeContextCreate_ptr_t ComputeContextCreate_ptr; + ComputeContextUpdate_ptr_t ComputeContextUpdate_ptr; + ComputeContextRelease_ptr_t ComputeContextRelease_ptr; + ComputeShaderCreate_ptr_t ComputeShaderCreate_ptr; + ComputeShaderRelease_ptr_t ComputeShaderRelease_ptr; + ComputeConstantBufferCreate_ptr_t ComputeConstantBufferCreate_ptr; + ComputeConstantBufferRelease_ptr_t ComputeConstantBufferRelease_ptr; + ComputeConstantBufferMap_ptr_t ComputeConstantBufferMap_ptr; + ComputeConstantBufferUnmap_ptr_t ComputeConstantBufferUnmap_ptr; + ComputeResourceCreate_ptr_t ComputeResourceCreate_ptr; + ComputeResourceUpdate_ptr_t ComputeResourceUpdate_ptr; + ComputeResourceRelease_ptr_t ComputeResourceRelease_ptr; + ComputeResourceRWCreate_ptr_t ComputeResourceRWCreate_ptr; + ComputeResourceRWUpdate_ptr_t ComputeResourceRWUpdate_ptr; + ComputeResourceRWRelease_ptr_t ComputeResourceRWRelease_ptr; + ComputeResourceRWGetResource_ptr_t ComputeResourceRWGetResource_ptr; + ComputeContextDispatch_ptr_t ComputeContextDispatch_ptr; + ComputeContextNvFlowContextCreate_ptr_t ComputeContextNvFlowContextCreate_ptr; + ComputeContextNvFlowContextUpdate_ptr_t ComputeContextNvFlowContextUpdate_ptr; + ComputeResourceNvFlowCreate_ptr_t ComputeResourceNvFlowCreate_ptr; + ComputeResourceNvFlowUpdate_ptr_t ComputeResourceNvFlowUpdate_ptr; + ComputeResourceRWNvFlowCreate_ptr_t ComputeResourceRWNvFlowCreate_ptr; + ComputeResourceRWNvFlowUpdate_ptr_t ComputeResourceRWNvFlowUpdate_ptr; + +}gComputeContextLoader; + +ComputeContext* ComputeContextCreate(ComputeContextDesc* desc) +{ + return gComputeContextLoader.ComputeContextCreate_ptr(desc); +} + +void ComputeContextUpdate(ComputeContext* context, ComputeContextDesc* desc) +{ + return gComputeContextLoader.ComputeContextUpdate_ptr(context, desc); +} + +void ComputeContextRelease(ComputeContext* context) +{ + return gComputeContextLoader.ComputeContextRelease_ptr(context); +} + +ComputeShader* ComputeShaderCreate(ComputeContext* context, const ComputeShaderDesc* desc) +{ + return gComputeContextLoader.ComputeShaderCreate_ptr(context, desc); +} + +void ComputeShaderRelease(ComputeShader* shader) +{ + return gComputeContextLoader.ComputeShaderRelease_ptr(shader); +} + +ComputeConstantBuffer* ComputeConstantBufferCreate(ComputeContext* context, const ComputeConstantBufferDesc* desc) +{ + return gComputeContextLoader.ComputeConstantBufferCreate_ptr(context, desc); +} + +void ComputeConstantBufferRelease(ComputeConstantBuffer* constantBuffer) +{ + return gComputeContextLoader.ComputeConstantBufferRelease_ptr(constantBuffer); +} + +void* ComputeConstantBufferMap(ComputeContext* context, ComputeConstantBuffer* constantBuffer) +{ + return gComputeContextLoader.ComputeConstantBufferMap_ptr(context, constantBuffer); +} + +void ComputeConstantBufferUnmap(ComputeContext* context, ComputeConstantBuffer* constantBuffer) +{ + return gComputeContextLoader.ComputeConstantBufferUnmap_ptr(context, constantBuffer); +} + +ComputeResource* ComputeResourceCreate(ComputeContext* context, const ComputeResourceDesc* desc) +{ + return gComputeContextLoader.ComputeResourceCreate_ptr(context, desc); +} + +void ComputeResourceUpdate(ComputeContext* context, ComputeResource* resource, const ComputeResourceDesc* desc) +{ + return gComputeContextLoader.ComputeResourceUpdate_ptr(context, resource, desc); +} + +void ComputeResourceRelease(ComputeResource* resource) +{ + return gComputeContextLoader.ComputeResourceRelease_ptr(resource); +} + +ComputeResourceRW* ComputeResourceRWCreate(ComputeContext* context, const ComputeResourceRWDesc* desc) +{ + return gComputeContextLoader.ComputeResourceRWCreate_ptr(context, desc); +} + +void ComputeResourceRWUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, const ComputeResourceRWDesc* desc) +{ + return gComputeContextLoader.ComputeResourceRWUpdate_ptr(context, resourceRW, desc); +} + +void ComputeResourceRWRelease(ComputeResourceRW* resourceRW) +{ + return gComputeContextLoader.ComputeResourceRWRelease_ptr(resourceRW); +} + +ComputeResource* ComputeResourceRWGetResource(ComputeResourceRW* resourceRW) +{ + return gComputeContextLoader.ComputeResourceRWGetResource_ptr(resourceRW); +} + +void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams* params) +{ + return gComputeContextLoader.ComputeContextDispatch_ptr(context, params); +} + +ComputeContext* ComputeContextNvFlowContextCreate(NvFlowContext* flowContext) +{ + return gComputeContextLoader.ComputeContextNvFlowContextCreate_ptr(flowContext); +} + +void ComputeContextNvFlowContextUpdate(ComputeContext* computeContext, NvFlowContext* flowContext) +{ + return gComputeContextLoader.ComputeContextNvFlowContextUpdate_ptr(computeContext, flowContext); +} + +ComputeResource* ComputeResourceNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource) +{ + return gComputeContextLoader.ComputeResourceNvFlowCreate_ptr(context, flowContext, flowResource); +} + +void ComputeResourceNvFlowUpdate(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource) +{ + return gComputeContextLoader.ComputeResourceNvFlowUpdate_ptr(context, resource, flowContext, flowResource); +} + +ComputeResourceRW* ComputeResourceRWNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) +{ + return gComputeContextLoader.ComputeResourceRWNvFlowCreate_ptr(context, flowContext, flowResourceRW); +} + +void ComputeResourceRWNvFlowUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) +{ + return gComputeContextLoader.ComputeResourceRWNvFlowUpdate_ptr(context, resourceRW, flowContext, flowResourceRW); +} + +void* computeContextLoaderLoadFunction(ComputeContextLoader* inst, const char* name) +{ + snprintf(inst->buf, 1024u, "%s%s", name, inst->suffix); + + return SDL_LoadFunction(inst->module, inst->buf); +} + +void loadComputeContext(AppGraphCtxType type) +{ + const char* moduleName = demoAppDLLName(type); + + gComputeContextLoader.suffix = demoAppBackendSuffix(type); + + gComputeContextLoader.module = SDL_LoadObject(moduleName); + + gComputeContextLoader.ComputeContextCreate_ptr = (ComputeContextCreate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeContextCreate")); + gComputeContextLoader.ComputeContextUpdate_ptr = (ComputeContextUpdate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeContextUpdate")); + gComputeContextLoader.ComputeContextRelease_ptr = (ComputeContextRelease_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeContextRelease")); + gComputeContextLoader.ComputeShaderCreate_ptr = (ComputeShaderCreate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeShaderCreate")); + gComputeContextLoader.ComputeShaderRelease_ptr = (ComputeShaderRelease_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeShaderRelease")); + gComputeContextLoader.ComputeConstantBufferCreate_ptr = (ComputeConstantBufferCreate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeConstantBufferCreate")); + gComputeContextLoader.ComputeConstantBufferRelease_ptr = (ComputeConstantBufferRelease_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeConstantBufferRelease")); + gComputeContextLoader.ComputeConstantBufferMap_ptr = (ComputeConstantBufferMap_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeConstantBufferMap")); + gComputeContextLoader.ComputeConstantBufferUnmap_ptr = (ComputeConstantBufferUnmap_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeConstantBufferUnmap")); + gComputeContextLoader.ComputeResourceCreate_ptr = (ComputeResourceCreate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceCreate")); + gComputeContextLoader.ComputeResourceUpdate_ptr = (ComputeResourceUpdate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceUpdate")); + gComputeContextLoader.ComputeResourceRelease_ptr = (ComputeResourceRelease_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceRelease")); + gComputeContextLoader.ComputeResourceRWCreate_ptr = (ComputeResourceRWCreate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceRWCreate")); + gComputeContextLoader.ComputeResourceRWUpdate_ptr = (ComputeResourceRWUpdate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceRWUpdate")); + gComputeContextLoader.ComputeResourceRWRelease_ptr = (ComputeResourceRWRelease_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceRWRelease")); + gComputeContextLoader.ComputeResourceRWGetResource_ptr = (ComputeResourceRWGetResource_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceRWGetResource")); + gComputeContextLoader.ComputeContextDispatch_ptr = (ComputeContextDispatch_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeContextDispatch")); + gComputeContextLoader.ComputeContextNvFlowContextCreate_ptr = (ComputeContextNvFlowContextCreate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeContextNvFlowContextCreate")); + gComputeContextLoader.ComputeContextNvFlowContextUpdate_ptr = (ComputeContextNvFlowContextUpdate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeContextNvFlowContextUpdate")); + gComputeContextLoader.ComputeResourceNvFlowCreate_ptr = (ComputeResourceNvFlowCreate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceNvFlowCreate")); + gComputeContextLoader.ComputeResourceNvFlowUpdate_ptr = (ComputeResourceNvFlowUpdate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceNvFlowUpdate")); + gComputeContextLoader.ComputeResourceRWNvFlowCreate_ptr = (ComputeResourceRWNvFlowCreate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceRWNvFlowCreate")); + gComputeContextLoader.ComputeResourceRWNvFlowUpdate_ptr = (ComputeResourceRWNvFlowUpdate_ptr_t)(computeContextLoaderLoadFunction(&gComputeContextLoader, "ComputeResourceRWNvFlowUpdate")); +} + +void unloadComputeContext() +{ + gComputeContextLoader.ComputeContextCreate_ptr = nullptr; + gComputeContextLoader.ComputeContextUpdate_ptr = nullptr; + gComputeContextLoader.ComputeContextRelease_ptr = nullptr; + gComputeContextLoader.ComputeShaderCreate_ptr = nullptr; + gComputeContextLoader.ComputeShaderRelease_ptr = nullptr; + gComputeContextLoader.ComputeConstantBufferCreate_ptr = nullptr; + gComputeContextLoader.ComputeConstantBufferRelease_ptr = nullptr; + gComputeContextLoader.ComputeConstantBufferMap_ptr = nullptr; + gComputeContextLoader.ComputeConstantBufferUnmap_ptr = nullptr; + gComputeContextLoader.ComputeResourceCreate_ptr = nullptr; + gComputeContextLoader.ComputeResourceUpdate_ptr = nullptr; + gComputeContextLoader.ComputeResourceRelease_ptr = nullptr; + gComputeContextLoader.ComputeResourceRWCreate_ptr = nullptr; + gComputeContextLoader.ComputeResourceRWUpdate_ptr = nullptr; + gComputeContextLoader.ComputeResourceRWRelease_ptr = nullptr; + gComputeContextLoader.ComputeResourceRWGetResource_ptr = nullptr; + gComputeContextLoader.ComputeContextDispatch_ptr = nullptr; + gComputeContextLoader.ComputeContextNvFlowContextCreate_ptr = nullptr; + gComputeContextLoader.ComputeContextNvFlowContextUpdate_ptr = nullptr; + gComputeContextLoader.ComputeResourceNvFlowCreate_ptr = nullptr; + gComputeContextLoader.ComputeResourceNvFlowUpdate_ptr = nullptr; + gComputeContextLoader.ComputeResourceRWNvFlowCreate_ptr = nullptr; + gComputeContextLoader.ComputeResourceRWNvFlowUpdate_ptr = nullptr; + + SDL_UnloadObject(gComputeContextLoader.module); +} diff --git a/demo/DemoApp/imguiGraphLoader.cpp b/demo/DemoApp/imguiGraphLoader.cpp index 155e9f3..f628196 100644 --- a/demo/DemoApp/imguiGraphLoader.cpp +++ b/demo/DemoApp/imguiGraphLoader.cpp @@ -15,111 +15,6 @@ #include "imguiGraph.h" #include "imguiInterop.h" -namespace -{ - ModuleLoader<24u, SDL_LoadObject, SDL_UnloadObject, SDL_LoadFunction> g_loader; -} +#include -void loadImgui(AppGraphCtxType type) -{ - const char* moduleName = demoAppDLLName(type); - - g_loader.loadModule(moduleName); -} - -void unloadImgui() -{ - g_loader.unloadModule(); -} - -// Below are the functions that must be implemented per graphics API - -void imguiGraphContextInit(const ImguiGraphDesc* desc) -{ - return g_loader.function<0>(imguiGraphContextInit, "imguiGraphContextInit", desc); -} - -void imguiGraphContextUpdate(const ImguiGraphDesc* desc) -{ - return g_loader.function<1>(imguiGraphContextUpdate, "imguiGraphContextUpdate", desc); -} - -void imguiGraphContextDestroy() -{ - return g_loader.function<2>(imguiGraphContextDestroy, "imguiGraphContextDestroy"); -} - -void imguiGraphRecordBegin() -{ - return g_loader.function<3>(imguiGraphRecordBegin, "imguiGraphRecordBegin"); -} - -void imguiGraphRecordEnd() -{ - return g_loader.function<4>(imguiGraphRecordEnd, "imguiGraphRecordEnd"); -} - -void imguiGraphVertex2f(float x, float y) -{ - return g_loader.function<5>(imguiGraphVertex2f, "imguiGraphVertex2f", x, y); -} - -void imguiGraphVertex2fv(const float* v) -{ - return g_loader.function<6>(imguiGraphVertex2fv, "imguiGraphVertex2fv", v); -} - -void imguiGraphTexCoord2f(float u, float v) -{ - return g_loader.function<7>(imguiGraphTexCoord2f, "imguiGraphTexCoord2f", u, v); -} - -void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) -{ - return g_loader.function<8>(imguiGraphColor4ub, "imguiGraphColor4ub", red, green, blue, alpha); -} - -void imguiGraphColor4ubv(const uint8_t* v) -{ - return g_loader.function<9>(imguiGraphColor4ubv, "imguiGraphColor4ubv", v); -} - -void imguiGraphFontTextureEnable() -{ - return g_loader.function<10>(imguiGraphFontTextureEnable, "imguiGraphFontTextureEnable"); -} - -void imguiGraphFontTextureDisable() -{ - return g_loader.function<11>(imguiGraphFontTextureDisable, "imguiGraphFontTextureDisable"); -} - -void imguiGraphEnableScissor(int x, int y, int width, int height) -{ - return g_loader.function<12>(imguiGraphEnableScissor, "imguiGraphEnableScissor", x, y, width, height); -} - -void imguiGraphDisableScissor() -{ - return g_loader.function<13>(imguiGraphDisableScissor, "imguiGraphDisableScissor"); -} - -void imguiGraphFontTextureInit(unsigned char* data) -{ - return g_loader.function<14>(imguiGraphFontTextureInit, "imguiGraphFontTextureInit",data); -} - -void imguiGraphFontTextureRelease() -{ - return g_loader.function<15>(imguiGraphFontTextureRelease, "imguiGraphFontTextureRelease"); -} - -bool imguiInteropGraphInit(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx) -{ - return g_loader.function<16>(imguiInteropGraphInit, "imguiInteropGraphInit", func, fontpath, appctx); -} - -void imguiInteropGraphUpdate(imguiGraphUpdate_t func, AppGraphCtx* appctx) -{ - return g_loader.function<17>(imguiInteropGraphUpdate, "imguiInteropGraphUpdate", func, appctx); -} \ No newline at end of file +#include "imguiGraphLoaderGenerated.h" \ No newline at end of file diff --git a/demo/DemoApp/imguiGraphLoaderGenerated.h b/demo/DemoApp/imguiGraphLoaderGenerated.h new file mode 100644 index 0000000..ab7ae55 --- /dev/null +++ b/demo/DemoApp/imguiGraphLoaderGenerated.h @@ -0,0 +1,204 @@ +/* +* 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. +*/ + +typedef void (*imguiGraphContextInit_ptr_t)(const ImguiGraphDesc* desc); +typedef void (*imguiGraphContextUpdate_ptr_t)(const ImguiGraphDesc* desc); +typedef void (*imguiGraphContextDestroy_ptr_t)(); +typedef void (*imguiGraphRecordBegin_ptr_t)(); +typedef void (*imguiGraphRecordEnd_ptr_t)(); +typedef void (*imguiGraphVertex2f_ptr_t)(float x, float y); +typedef void (*imguiGraphVertex2fv_ptr_t)(const float* v); +typedef void (*imguiGraphTexCoord2f_ptr_t)(float u, float v); +typedef void (*imguiGraphColor4ub_ptr_t)(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha); +typedef void (*imguiGraphColor4ubv_ptr_t)(const uint8_t* v); +typedef void (*imguiGraphFontTextureEnable_ptr_t)(); +typedef void (*imguiGraphFontTextureDisable_ptr_t)(); +typedef void (*imguiGraphEnableScissor_ptr_t)(int x, int y, int width, int height); +typedef void (*imguiGraphDisableScissor_ptr_t)(); +typedef void (*imguiGraphFontTextureInit_ptr_t)(unsigned char* data); +typedef void (*imguiGraphFontTextureRelease_ptr_t)(); +typedef bool (*imguiInteropGraphInit_ptr_t)(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx); +typedef void (*imguiInteropGraphUpdate_ptr_t)(imguiGraphUpdate_t func, AppGraphCtx* appctx); + +struct ImguiLoader +{ + void* module = nullptr; + const char* suffix = ""; + char buf[1024u]; + + imguiGraphContextInit_ptr_t imguiGraphContextInit_ptr; + imguiGraphContextUpdate_ptr_t imguiGraphContextUpdate_ptr; + imguiGraphContextDestroy_ptr_t imguiGraphContextDestroy_ptr; + imguiGraphRecordBegin_ptr_t imguiGraphRecordBegin_ptr; + imguiGraphRecordEnd_ptr_t imguiGraphRecordEnd_ptr; + imguiGraphVertex2f_ptr_t imguiGraphVertex2f_ptr; + imguiGraphVertex2fv_ptr_t imguiGraphVertex2fv_ptr; + imguiGraphTexCoord2f_ptr_t imguiGraphTexCoord2f_ptr; + imguiGraphColor4ub_ptr_t imguiGraphColor4ub_ptr; + imguiGraphColor4ubv_ptr_t imguiGraphColor4ubv_ptr; + imguiGraphFontTextureEnable_ptr_t imguiGraphFontTextureEnable_ptr; + imguiGraphFontTextureDisable_ptr_t imguiGraphFontTextureDisable_ptr; + imguiGraphEnableScissor_ptr_t imguiGraphEnableScissor_ptr; + imguiGraphDisableScissor_ptr_t imguiGraphDisableScissor_ptr; + imguiGraphFontTextureInit_ptr_t imguiGraphFontTextureInit_ptr; + imguiGraphFontTextureRelease_ptr_t imguiGraphFontTextureRelease_ptr; + imguiInteropGraphInit_ptr_t imguiInteropGraphInit_ptr; + imguiInteropGraphUpdate_ptr_t imguiInteropGraphUpdate_ptr; + +}gImguiLoader; + +void imguiGraphContextInit(const ImguiGraphDesc* desc) +{ + return gImguiLoader.imguiGraphContextInit_ptr(desc); +} + +void imguiGraphContextUpdate(const ImguiGraphDesc* desc) +{ + return gImguiLoader.imguiGraphContextUpdate_ptr(desc); +} + +void imguiGraphContextDestroy() +{ + return gImguiLoader.imguiGraphContextDestroy_ptr(); +} + +void imguiGraphRecordBegin() +{ + return gImguiLoader.imguiGraphRecordBegin_ptr(); +} + +void imguiGraphRecordEnd() +{ + return gImguiLoader.imguiGraphRecordEnd_ptr(); +} + +void imguiGraphVertex2f(float x, float y) +{ + return gImguiLoader.imguiGraphVertex2f_ptr(x, y); +} + +void imguiGraphVertex2fv(const float* v) +{ + return gImguiLoader.imguiGraphVertex2fv_ptr(v); +} + +void imguiGraphTexCoord2f(float u, float v) +{ + return gImguiLoader.imguiGraphTexCoord2f_ptr(u, v); +} + +void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) +{ + return gImguiLoader.imguiGraphColor4ub_ptr(red, green, blue, alpha); +} + +void imguiGraphColor4ubv(const uint8_t* v) +{ + return gImguiLoader.imguiGraphColor4ubv_ptr(v); +} + +void imguiGraphFontTextureEnable() +{ + return gImguiLoader.imguiGraphFontTextureEnable_ptr(); +} + +void imguiGraphFontTextureDisable() +{ + return gImguiLoader.imguiGraphFontTextureDisable_ptr(); +} + +void imguiGraphEnableScissor(int x, int y, int width, int height) +{ + return gImguiLoader.imguiGraphEnableScissor_ptr(x, y, width, height); +} + +void imguiGraphDisableScissor() +{ + return gImguiLoader.imguiGraphDisableScissor_ptr(); +} + +void imguiGraphFontTextureInit(unsigned char* data) +{ + return gImguiLoader.imguiGraphFontTextureInit_ptr(data); +} + +void imguiGraphFontTextureRelease() +{ + return gImguiLoader.imguiGraphFontTextureRelease_ptr(); +} + +bool imguiInteropGraphInit(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx) +{ + return gImguiLoader.imguiInteropGraphInit_ptr(func, fontpath, appctx); +} + +void imguiInteropGraphUpdate(imguiGraphUpdate_t func, AppGraphCtx* appctx) +{ + return gImguiLoader.imguiInteropGraphUpdate_ptr(func, appctx); +} + +void* imguiLoaderLoadFunction(ImguiLoader* inst, const char* name) +{ + snprintf(inst->buf, 1024u, "%s%s", name, inst->suffix); + + return SDL_LoadFunction(inst->module, inst->buf); +} + +void loadImgui(AppGraphCtxType type) +{ + const char* moduleName = demoAppDLLName(type); + + gImguiLoader.suffix = demoAppBackendSuffix(type); + + gImguiLoader.module = SDL_LoadObject(moduleName); + + gImguiLoader.imguiGraphContextInit_ptr = (imguiGraphContextInit_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphContextInit")); + gImguiLoader.imguiGraphContextUpdate_ptr = (imguiGraphContextUpdate_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphContextUpdate")); + gImguiLoader.imguiGraphContextDestroy_ptr = (imguiGraphContextDestroy_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphContextDestroy")); + gImguiLoader.imguiGraphRecordBegin_ptr = (imguiGraphRecordBegin_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphRecordBegin")); + gImguiLoader.imguiGraphRecordEnd_ptr = (imguiGraphRecordEnd_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphRecordEnd")); + gImguiLoader.imguiGraphVertex2f_ptr = (imguiGraphVertex2f_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphVertex2f")); + gImguiLoader.imguiGraphVertex2fv_ptr = (imguiGraphVertex2fv_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphVertex2fv")); + gImguiLoader.imguiGraphTexCoord2f_ptr = (imguiGraphTexCoord2f_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphTexCoord2f")); + gImguiLoader.imguiGraphColor4ub_ptr = (imguiGraphColor4ub_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphColor4ub")); + gImguiLoader.imguiGraphColor4ubv_ptr = (imguiGraphColor4ubv_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphColor4ubv")); + gImguiLoader.imguiGraphFontTextureEnable_ptr = (imguiGraphFontTextureEnable_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphFontTextureEnable")); + gImguiLoader.imguiGraphFontTextureDisable_ptr = (imguiGraphFontTextureDisable_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphFontTextureDisable")); + gImguiLoader.imguiGraphEnableScissor_ptr = (imguiGraphEnableScissor_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphEnableScissor")); + gImguiLoader.imguiGraphDisableScissor_ptr = (imguiGraphDisableScissor_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphDisableScissor")); + gImguiLoader.imguiGraphFontTextureInit_ptr = (imguiGraphFontTextureInit_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphFontTextureInit")); + gImguiLoader.imguiGraphFontTextureRelease_ptr = (imguiGraphFontTextureRelease_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiGraphFontTextureRelease")); + gImguiLoader.imguiInteropGraphInit_ptr = (imguiInteropGraphInit_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiInteropGraphInit")); + gImguiLoader.imguiInteropGraphUpdate_ptr = (imguiInteropGraphUpdate_ptr_t)(imguiLoaderLoadFunction(&gImguiLoader, "imguiInteropGraphUpdate")); +} + +void unloadImgui() +{ + gImguiLoader.imguiGraphContextInit_ptr = nullptr; + gImguiLoader.imguiGraphContextUpdate_ptr = nullptr; + gImguiLoader.imguiGraphContextDestroy_ptr = nullptr; + gImguiLoader.imguiGraphRecordBegin_ptr = nullptr; + gImguiLoader.imguiGraphRecordEnd_ptr = nullptr; + gImguiLoader.imguiGraphVertex2f_ptr = nullptr; + gImguiLoader.imguiGraphVertex2fv_ptr = nullptr; + gImguiLoader.imguiGraphTexCoord2f_ptr = nullptr; + gImguiLoader.imguiGraphColor4ub_ptr = nullptr; + gImguiLoader.imguiGraphColor4ubv_ptr = nullptr; + gImguiLoader.imguiGraphFontTextureEnable_ptr = nullptr; + gImguiLoader.imguiGraphFontTextureDisable_ptr = nullptr; + gImguiLoader.imguiGraphEnableScissor_ptr = nullptr; + gImguiLoader.imguiGraphDisableScissor_ptr = nullptr; + gImguiLoader.imguiGraphFontTextureInit_ptr = nullptr; + gImguiLoader.imguiGraphFontTextureRelease_ptr = nullptr; + gImguiLoader.imguiInteropGraphInit_ptr = nullptr; + gImguiLoader.imguiInteropGraphUpdate_ptr = nullptr; + + SDL_UnloadObject(gImguiLoader.module); +} diff --git a/demo/DemoApp/loader.h b/demo/DemoApp/loader.h index 3028325..f0c1aaf 100644 --- a/demo/DemoApp/loader.h +++ b/demo/DemoApp/loader.h @@ -28,6 +28,13 @@ namespace "DemoAppD3D11" XDEMOAPP_STR(DLL_SUFFIX) ".dll"; } + const char* demoAppBackendSuffix(AppGraphCtxType type) + { + return (type == APP_CONTEXT_D3D12) ? + "D3D12" : + "D3D11"; + } + const char* nvFlowDLLName(AppGraphCtxType type) { return (type == APP_CONTEXT_D3D12) ? @@ -52,61 +59,4 @@ void loadImgui(AppGraphCtxType type); void unloadImgui(); void loadComputeContext(AppGraphCtxType type); -void unloadComputeContext(); - -template -struct ModuleLoader -{ - static const int m_functionCount = maxFunctionCount; - void** m_functionPtrs[m_functionCount] = { nullptr }; - const char* m_functionNames[m_functionCount] = { nullptr }; - - void* m_module = nullptr; - - void* loadFunction(const char* name, int uid, void** ptr) - { - m_functionPtrs[uid] = ptr; - m_functionNames[uid] = name; - return SDL_LoadFunction(m_module, name); - } - - template - ret function(ret(*)(Args...args), const char* name, Args...args) - { - static void* func = loadFunction(name, uid, &func); - - return ((ret(*)(Args...args))func)(args...); - } - - void loadModule(const char* moduleName) - { - m_module = loadobject(moduleName); - - // load functions with non-null names - for (int i = 0; i < m_functionCount; i++) - { - const char* name = m_functionNames[i]; - void** funcPtr = m_functionPtrs[i]; - if (name && funcPtr) - { - *funcPtr = loadfunction(m_module, name); - } - } - } - - void unloadModule() - { - unloadobject(m_module); - - for (int i = 0; i < m_functionCount; i++) - { - void** funcPtr = m_functionPtrs[i]; - if (funcPtr) - { - *funcPtr = nullptr; - } - } - } - - ModuleLoader() {} -}; \ No newline at end of file +void unloadComputeContext(); \ No newline at end of file diff --git a/demo/DemoApp/main.cpp b/demo/DemoApp/main.cpp index e35ea43..45ccfa8 100644 --- a/demo/DemoApp/main.cpp +++ b/demo/DemoApp/main.cpp @@ -67,24 +67,18 @@ bool gImguiActive = false; bool g_imguiHide = false; bool gClearDark = false; -float gClearVal[4] = { 0.33f,0.33f,0.33f,1.f }; +AppGraphColor gClearVal = { 0.33f,0.33f,0.33f,1.f }; void toggleDark() { gClearDark = !gClearDark; if (gClearDark) { - gClearVal[0] = 0.f; - gClearVal[1] = 0.f; - gClearVal[2] = 0.f; - gClearVal[3] = 1.f; + gClearVal = { 0.f, 0.f, 0.f, 1.f }; } else { - gClearVal[0] = 0.33f; - gClearVal[1] = 0.33f; - gClearVal[2] = 0.33f; - gClearVal[3] = 1.f; + gClearVal = { 0.33f, 0.33f, 0.33f, 1.f }; } } diff --git a/demo/DemoApp/meshLoader.cpp b/demo/DemoApp/meshLoader.cpp index 99e5e49..2d70414 100644 --- a/demo/DemoApp/meshLoader.cpp +++ b/demo/DemoApp/meshLoader.cpp @@ -15,69 +15,6 @@ #include "mesh.h" #include "meshInterop.h" -namespace -{ - ModuleLoader<16u, SDL_LoadObject, SDL_UnloadObject, SDL_LoadFunction> g_loader; -} +#include -void loadMesh(AppGraphCtxType type) -{ - const char* moduleName = demoAppDLLName(type); - - g_loader.loadModule(moduleName); -} - -void unloadMesh() -{ - g_loader.unloadModule(); -} - -MeshContext* MeshContextCreate(const MeshContextDesc* desc) -{ - return g_loader.function<0>(MeshContextCreate, "MeshContextCreate", desc); -} - -void MeshContextUpdate(MeshContext* context, const MeshContextDesc* desc) -{ - return g_loader.function<1>(MeshContextUpdate, "MeshContextUpdate", context, desc); -} - -void MeshContextRelease(MeshContext* context) -{ - return g_loader.function<2>(MeshContextRelease, "MeshContextRelease", context); -} - -MeshIndexBuffer* MeshIndexBufferCreate(MeshContext* context, MeshUint* indices, MeshUint numIndices) -{ - return g_loader.function<3>(MeshIndexBufferCreate, "MeshIndexBufferCreate", context, indices, numIndices); -} - -void MeshIndexBufferRelease(MeshIndexBuffer* buffer) -{ - return g_loader.function<4>(MeshIndexBufferRelease, "MeshIndexBufferRelease", buffer); -} - -MeshVertexBuffer* MeshVertexBufferCreate(MeshContext* context, MeshVertex* vertices, MeshUint numVertices) -{ - return g_loader.function<5>(MeshVertexBufferCreate, "MeshVertexBufferCreate", context, vertices, numVertices); -} - -void MeshVertexBufferRelease(MeshVertexBuffer* buffer) -{ - return g_loader.function<6>(MeshVertexBufferRelease, "MeshVertexBufferRelease", buffer); -} - -void MeshContextDraw(MeshContext* context, const MeshContextDrawParams* params) -{ - return g_loader.function<7>(MeshContextDraw, "MeshContextDraw", context, params); -} - -MeshContext* MeshInteropContextCreate(AppGraphCtx* appctx) -{ - return g_loader.function<8>(MeshInteropContextCreate, "MeshInteropContextCreate", appctx); -} - -void MeshInteropContextUpdate(MeshContext* context, AppGraphCtx* appctx) -{ - return g_loader.function<9>(MeshInteropContextUpdate, "MeshInteropContextUpdate", context, appctx); -} \ No newline at end of file +#include "meshLoaderGenerated.h" \ No newline at end of file diff --git a/demo/DemoApp/meshLoaderGenerated.h b/demo/DemoApp/meshLoaderGenerated.h new file mode 100644 index 0000000..c931f4f --- /dev/null +++ b/demo/DemoApp/meshLoaderGenerated.h @@ -0,0 +1,132 @@ +/* +* 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. +*/ + +typedef MeshContext* (*MeshContextCreate_ptr_t)(const MeshContextDesc* desc); +typedef void (*MeshContextUpdate_ptr_t)(MeshContext* context, const MeshContextDesc* desc); +typedef void (*MeshContextRelease_ptr_t)(MeshContext* context); +typedef MeshIndexBuffer* (*MeshIndexBufferCreate_ptr_t)(MeshContext* context, MeshUint* indices, MeshUint numIndices); +typedef void (*MeshIndexBufferRelease_ptr_t)(MeshIndexBuffer* buffer); +typedef MeshVertexBuffer* (*MeshVertexBufferCreate_ptr_t)(MeshContext* context, MeshVertex* vertices, MeshUint numVertices); +typedef void (*MeshVertexBufferRelease_ptr_t)(MeshVertexBuffer* buffer); +typedef void (*MeshContextDraw_ptr_t)(MeshContext* context, const MeshContextDrawParams* params); +typedef MeshContext* (*MeshInteropContextCreate_ptr_t)(AppGraphCtx* appctx); +typedef void (*MeshInteropContextUpdate_ptr_t)(MeshContext* context, AppGraphCtx* appctx); + +struct MeshLoader +{ + void* module = nullptr; + const char* suffix = ""; + char buf[1024u]; + + MeshContextCreate_ptr_t MeshContextCreate_ptr; + MeshContextUpdate_ptr_t MeshContextUpdate_ptr; + MeshContextRelease_ptr_t MeshContextRelease_ptr; + MeshIndexBufferCreate_ptr_t MeshIndexBufferCreate_ptr; + MeshIndexBufferRelease_ptr_t MeshIndexBufferRelease_ptr; + MeshVertexBufferCreate_ptr_t MeshVertexBufferCreate_ptr; + MeshVertexBufferRelease_ptr_t MeshVertexBufferRelease_ptr; + MeshContextDraw_ptr_t MeshContextDraw_ptr; + MeshInteropContextCreate_ptr_t MeshInteropContextCreate_ptr; + MeshInteropContextUpdate_ptr_t MeshInteropContextUpdate_ptr; + +}gMeshLoader; + +MeshContext* MeshContextCreate(const MeshContextDesc* desc) +{ + return gMeshLoader.MeshContextCreate_ptr(desc); +} + +void MeshContextUpdate(MeshContext* context, const MeshContextDesc* desc) +{ + return gMeshLoader.MeshContextUpdate_ptr(context, desc); +} + +void MeshContextRelease(MeshContext* context) +{ + return gMeshLoader.MeshContextRelease_ptr(context); +} + +MeshIndexBuffer* MeshIndexBufferCreate(MeshContext* context, MeshUint* indices, MeshUint numIndices) +{ + return gMeshLoader.MeshIndexBufferCreate_ptr(context, indices, numIndices); +} + +void MeshIndexBufferRelease(MeshIndexBuffer* buffer) +{ + return gMeshLoader.MeshIndexBufferRelease_ptr(buffer); +} + +MeshVertexBuffer* MeshVertexBufferCreate(MeshContext* context, MeshVertex* vertices, MeshUint numVertices) +{ + return gMeshLoader.MeshVertexBufferCreate_ptr(context, vertices, numVertices); +} + +void MeshVertexBufferRelease(MeshVertexBuffer* buffer) +{ + return gMeshLoader.MeshVertexBufferRelease_ptr(buffer); +} + +void MeshContextDraw(MeshContext* context, const MeshContextDrawParams* params) +{ + return gMeshLoader.MeshContextDraw_ptr(context, params); +} + +MeshContext* MeshInteropContextCreate(AppGraphCtx* appctx) +{ + return gMeshLoader.MeshInteropContextCreate_ptr(appctx); +} + +void MeshInteropContextUpdate(MeshContext* context, AppGraphCtx* appctx) +{ + return gMeshLoader.MeshInteropContextUpdate_ptr(context, appctx); +} + +void* meshLoaderLoadFunction(MeshLoader* inst, const char* name) +{ + snprintf(inst->buf, 1024u, "%s%s", name, inst->suffix); + + return SDL_LoadFunction(inst->module, inst->buf); +} + +void loadMesh(AppGraphCtxType type) +{ + const char* moduleName = demoAppDLLName(type); + + gMeshLoader.suffix = demoAppBackendSuffix(type); + + gMeshLoader.module = SDL_LoadObject(moduleName); + + gMeshLoader.MeshContextCreate_ptr = (MeshContextCreate_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshContextCreate")); + gMeshLoader.MeshContextUpdate_ptr = (MeshContextUpdate_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshContextUpdate")); + gMeshLoader.MeshContextRelease_ptr = (MeshContextRelease_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshContextRelease")); + gMeshLoader.MeshIndexBufferCreate_ptr = (MeshIndexBufferCreate_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshIndexBufferCreate")); + gMeshLoader.MeshIndexBufferRelease_ptr = (MeshIndexBufferRelease_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshIndexBufferRelease")); + gMeshLoader.MeshVertexBufferCreate_ptr = (MeshVertexBufferCreate_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshVertexBufferCreate")); + gMeshLoader.MeshVertexBufferRelease_ptr = (MeshVertexBufferRelease_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshVertexBufferRelease")); + gMeshLoader.MeshContextDraw_ptr = (MeshContextDraw_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshContextDraw")); + gMeshLoader.MeshInteropContextCreate_ptr = (MeshInteropContextCreate_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshInteropContextCreate")); + gMeshLoader.MeshInteropContextUpdate_ptr = (MeshInteropContextUpdate_ptr_t)(meshLoaderLoadFunction(&gMeshLoader, "MeshInteropContextUpdate")); +} + +void unloadMesh() +{ + gMeshLoader.MeshContextCreate_ptr = nullptr; + gMeshLoader.MeshContextUpdate_ptr = nullptr; + gMeshLoader.MeshContextRelease_ptr = nullptr; + gMeshLoader.MeshIndexBufferCreate_ptr = nullptr; + gMeshLoader.MeshIndexBufferRelease_ptr = nullptr; + gMeshLoader.MeshVertexBufferCreate_ptr = nullptr; + gMeshLoader.MeshVertexBufferRelease_ptr = nullptr; + gMeshLoader.MeshContextDraw_ptr = nullptr; + gMeshLoader.MeshInteropContextCreate_ptr = nullptr; + gMeshLoader.MeshInteropContextUpdate_ptr = nullptr; + + SDL_UnloadObject(gMeshLoader.module); +} diff --git a/demo/DemoApp/preset0.h b/demo/DemoApp/preset0.h index aba3666..5e37ac4 100644 --- a/demo/DemoApp/preset0.h +++ b/demo/DemoApp/preset0.h @@ -13,7 +13,9 @@ const ImserNode g_root[] = { imserNodeValue1f("Velocity", 0.500000f), imserNodeValue1f("Smoke", 0.500000f), imserNodeGroupEnd(), - imserNodeValue1f("Vorticity Strength", 9.000000f), + imserNodeGroupBegin("Vorticity Confinement"), + imserNodeValue1f("Strength", 9.000000f), + imserNodeGroupEnd(), imserNodeGroupBegin("Combustion"), imserNodeValue1f("Ignition Temp", 0.050000f), imserNodeValue1f("Cooling Rate", 1.500000f), diff --git a/demo/DemoApp/preset1.h b/demo/DemoApp/preset1.h index dded481..2f502e6 100644 --- a/demo/DemoApp/preset1.h +++ b/demo/DemoApp/preset1.h @@ -13,7 +13,9 @@ const ImserNode g_root[] = { imserNodeValue1f("Velocity", 0.500000f), imserNodeValue1f("Smoke", 0.500000f), imserNodeGroupEnd(), - imserNodeValue1f("Vorticity Strength", 9.000000f), + imserNodeGroupBegin("Vorticity Confinement"), + imserNodeValue1f("Strength", 9.000000f), + imserNodeGroupEnd(), imserNodeGroupBegin("Combustion"), imserNodeValue1f("Ignition Temp", 0.050000f), imserNodeValue1f("Cooling Rate", 1.500000f), diff --git a/demo/DemoApp/scene.cpp b/demo/DemoApp/scene.cpp index 3ad7cce..399d4d8 100644 --- a/demo/DemoApp/scene.cpp +++ b/demo/DemoApp/scene.cpp @@ -43,8 +43,9 @@ namespace Scenes SceneSimpleFlameFuelMap sceneSimpleFlameFuelMap; SceneSimpleFlameParticleSurface sceneParticleSurface; SceneSimpleFlameBall sceneSimpleFlameBall; + SceneEmitSubStep sceneEmitSubStep; - const int count = 18; + const int count = 19; Scene* list[count] = { &scene2DTextureEmitter1, &scene2DTextureEmitter2, @@ -64,7 +65,8 @@ namespace Scenes &sceneSimpleFlame2, &sceneSimpleFlameFuelMap, &sceneParticleSurface, - &sceneSimpleFlameBall + &sceneSimpleFlameBall, + &sceneEmitSubStep }; }; @@ -115,6 +117,10 @@ void pointsToImage(NvFlowFloat4* image, int imageDim, const CurvePoint* pts, int void Scene::update(float dt) { + m_deltaTime = dt; + + doFrameUpdate(m_deltaTime); + int numSteps = m_timeStepper.getNumSteps(dt); for (int i = 0; i < numSteps; i++) @@ -233,6 +239,22 @@ void SceneFluid::imguiDesc() m_shouldGridReset = true; } + if (imguiCheck("Auto Reset", m_autoResetMode, true)) + { + m_autoResetMode = !m_autoResetMode; + m_autoResetTime = 0.f; + } + if (m_autoResetMode) + { + m_autoResetTime += m_deltaTime; + if (m_autoResetTime > m_autoResetThresh) + { + m_shouldReset = true; + m_autoResetTime = 0.f; + m_autoResetThresh = 5.f * (1.f / 255.f) * float((rand() & 255)); + } + } + float cellSizeLogf = float(m_flowGridActor.m_cellSizeLogScale); if (imguiserSlider("Cell Size Log Scale", &cellSizeLogf, -6.f, 6.f, 1.f, true)) { @@ -271,6 +293,11 @@ void SceneFluid::imguiFluidSim() imguiserSlider("Fuel", &m_flowGridActor.m_materialParams.fuel.fade, 0.f, 1.f, 0.01f, true); imguiserEndGroup(); + if (imguiCheck("Single Pass Advect", m_flowGridActor.m_gridParams.singlePassAdvection, true)) + { + m_flowGridActor.m_gridParams.singlePassAdvection = !m_flowGridActor.m_gridParams.singlePassAdvection; + } + imguiSeparator(); imguiLabel("MacCormack Correction"); imguiserBeginGroup("MacCormack Correction", nullptr); @@ -287,8 +314,16 @@ void SceneFluid::imguiFluidSim() imguiserSlider("Fuel", &m_flowGridActor.m_materialParams.fuel.macCormackBlendThreshold, 0.f, 0.01f, 0.001f, true); imguiserEndGroup(); - imguiserSlider("Vorticity Strength", &m_flowGridActor.m_materialParams.vorticityStrength, 0.f, 20.f, 0.1f, true); - imguiserSlider("Vorticity Vel Mask", &m_flowGridActor.m_materialParams.vorticityVelocityMask, 0.f, 1.f, 0.01f, true); + imguiSeparator(); + imguiLabel("Vorticity Confinement"); + imguiserBeginGroup("Vorticity Confinement", nullptr); + imguiserSlider("Strength", &m_flowGridActor.m_materialParams.vorticityStrength, 0.f, 20.f, 0.1f, true); + imguiserSlider("Velocity Mask", &m_flowGridActor.m_materialParams.vorticityVelocityMask, -1.f, 1.f, 0.01f, true); + imguiserSlider("Temperature Mask", &m_flowGridActor.m_materialParams.vorticityTemperatureMask, -1.f, 1.f, 0.01f, true); + imguiserSlider("Smoke Mask", &m_flowGridActor.m_materialParams.vorticitySmokeMask, -1.f, 1.f, 0.01f, true); + imguiserSlider("Fuel Mask", &m_flowGridActor.m_materialParams.vorticityFuelMask, -1.f, 1.f, 0.01f, true); + imguiserSlider("Constant Mask", &m_flowGridActor.m_materialParams.vorticityConstantMask, -1.f, 1.f, 0.01f, true); + imguiserEndGroup(); if (imguiCheck("Legacy Pressure", m_flowGridActor.m_gridParams.pressureLegacyMode, true)) { @@ -497,6 +532,21 @@ void SceneFluid::imguiFluidRender() imguiserSlider("Vector Length", &m_flowGridActor.m_crossSectionParams.vectorLengthScale, 0.1f, 2.f, 0.01f, true); } + imguiLabel("Grid Summary"); + imguiserBeginGroup("Grid Summary", nullptr); + if (imguiserCheck("Enabled", m_flowGridActor.m_enableGridSummary, true)) + { + m_flowGridActor.m_enableGridSummary = !m_flowGridActor.m_enableGridSummary; + } + if (m_flowGridActor.m_enableGridSummary) + { + if (imguiserCheck("Debug Render", m_flowGridActor.m_enableGridSummaryDebugVis, true)) + { + m_flowGridActor.m_enableGridSummaryDebugVis = !m_flowGridActor.m_enableGridSummaryDebugVis; + } + } + imguiserEndGroup(); + imguiFluidRenderExtra(); imguiserEndGroup(); } @@ -549,6 +599,12 @@ void SceneFluid::imguiFluidAlloc() imguiserSlider("Temp Threshold", &m_flowGridActor.m_materialParams.temperature.allocThreshold, 0.f, 1.f, 0.01f, true); imguiserSlider("Fuel Threshold", &m_flowGridActor.m_materialParams.fuel.allocThreshold, 0.f, 1.f, 0.01f, true); + if (imguiCheck("Translation Test", m_flowGridActor.m_enableTranslationTest, true)) + { + m_flowGridActor.m_enableTranslationTest = !m_flowGridActor.m_enableTranslationTest; + } + imguiSlider("Test Time Scale", &m_flowGridActor.m_translationTimeScale, 0.25f, 8.f, 0.1f, true); + imguiFluidAllocExtra(); imguiserEndGroup(); } @@ -677,38 +733,46 @@ bool SceneFluid::getStats(int lineIdx, int statIdx, char* buf) return true; } case 1: + { + float simRate = (1.f / m_flowContext.m_statUpdateDt) * + float(m_flowContext.m_statUpdateSuccessCount / + m_flowContext.m_statUpdateAttemptCount); + snprintf(buf, 79, "SimRate: %.3f Hz", simRate); + return true; + } + case 2: { NvFlowUint numLayers = m_flowGridActor.m_statNumLayers; snprintf(buf, 79, "NumLayers: %d layers", numLayers); return true; } - case 2: + case 3: { NvFlowUint numBlocks = m_flowGridActor.m_statNumDensityBlocks; NvFlowUint maxBlocks = m_flowGridActor.m_statMaxDensityBlocks; snprintf(buf, 79, "Density: %d blocks active of %d", numBlocks, maxBlocks); return true; } - case 3: + case 4: { NvFlowUint numBlocks = m_flowGridActor.m_statNumVelocityBlocks; NvFlowUint maxBlocks = m_flowGridActor.m_statMaxVelocityBlocks; snprintf(buf, 79, "Velocity: %d blocks active of %d", numBlocks, maxBlocks); return true; } - case 4: + case 5: { NvFlowUint numCells = m_flowGridActor.m_statNumDensityCells; snprintf(buf, 79, "Density: %d cells active", numCells); return true; } - case 5: + case 6: { NvFlowUint numCells = m_flowGridActor.m_statNumVelocityCells; snprintf(buf, 79, "Velocity: %d cells active", numCells); return true; } - case 6: + case 7: { if (m_flowGridActor.m_statVolumeShadowBlocks > 0u) { @@ -718,7 +782,7 @@ bool SceneFluid::getStats(int lineIdx, int statIdx, char* buf) } return false; } - case 7: + case 8: { if (m_flowGridActor.m_statVolumeShadowCells > 0u) { diff --git a/demo/DemoApp/scene.h b/demo/DemoApp/scene.h index fee39e4..da88e1d 100644 --- a/demo/DemoApp/scene.h +++ b/demo/DemoApp/scene.h @@ -31,6 +31,7 @@ struct TimeStepper float m_timeError = 0.f; float m_fixedDt = (1.f / 60.f); int m_maxSteps = 1; + int m_numSteps = 0; TimeStepper() {} @@ -41,14 +42,15 @@ struct TimeStepper // compute time steps m_timeError += m_deltaTime; - int numSteps = int(m_timeError / m_fixedDt); - if (numSteps < 0) numSteps = 0; + m_numSteps = int(floorf((m_timeError / m_fixedDt))); - m_timeError -= m_fixedDt * float(numSteps); + if (m_numSteps < 0) m_numSteps = 0; - if (numSteps > m_maxSteps) numSteps = m_maxSteps; + m_timeError -= m_fixedDt * float(m_numSteps); - return numSteps; + if (m_numSteps > m_maxSteps) m_numSteps = m_maxSteps; + + return m_numSteps; } }; @@ -82,7 +84,10 @@ struct Scene int m_winw = 0; int m_winh = 0; + float m_deltaTime = 0.f; + protected: + virtual void doFrameUpdate(float dt) {} virtual void doUpdate(float dt) = 0; AppGraphCtx* m_context = nullptr; @@ -145,13 +150,17 @@ struct FlowContext int m_maxFramesInFlight = 3u; int m_framesInFlight = 0; + double m_statUpdateAttemptCount = 0.0; + double m_statUpdateSuccessCount = 0.0; + float m_statUpdateDt = 0.f; + FlowContext() {} ~FlowContext() {} void init(AppGraphCtx* appctx); void release(); - bool updateBegin(); + bool updateBegin(float dt); void updateEnd(); void preDrawBegin(); void preDrawEnd(); @@ -174,6 +183,8 @@ struct FlowGridActor NvFlowVolumeRender* m_volumeRender = nullptr; NvFlowVolumeShadow* m_volumeShadow = nullptr; NvFlowCrossSection* m_crossSection = nullptr; + NvFlowGridSummary* m_gridSummary = nullptr; + NvFlowGridSummaryStateCPU* m_gridSummaryStateCPU = nullptr; NvFlowGridDesc m_gridDesc; NvFlowGridParams m_gridParams; @@ -216,6 +227,16 @@ struct FlowGridActor float m_crossSectionBackgroundColor = 0.f; NvFlowFloat3 m_crossSectionLineColor = { 141.f / 255.f, 199.f / 255.f, 63.f / 255.f }; + bool m_enableGridSummary = false; + bool m_enableGridSummaryDebugVis = false; + + bool m_enableTranslationTest = false; + float m_translationTimeScale = 1.f; + bool m_enableTranslationTestOld = false; + float m_translationTestTime = 0.f; + NvFlowFloat3 m_translationOffsetA = { +4.f, 0.f, 0.f }; + NvFlowFloat3 m_translationOffsetB = { -4.f, 0.f, 0.f }; + NvFlowUint m_statNumLayers = 0u; NvFlowUint m_statNumDensityBlocks = 0u; NvFlowUint m_statNumDensityCells = 0u; @@ -341,6 +362,10 @@ struct SceneFluid : public Scene bool m_shouldGridReset = false; bool m_shouldLoadPreset = false; + bool m_autoResetMode = false; + float m_autoResetTime = 0.f; + float m_autoResetThresh = 0.f; + virtual bool shouldReset() { return m_shouldReset; } virtual void reset(); }; @@ -550,6 +575,22 @@ struct SceneSimpleFlameAnimated : public SceneSimpleFlame m_emitParams.bounds.w.x = 2.f * cosf(rate * time); m_emitParams.bounds.w.z = 2.f * sinf(rate * time); + // testing hack + //static int offset = 0; + //offset++; + //if (offset > 4) + //{ + // offset = 0; + //} + //m_emitParams.bounds.w.z += float(offset) - 4.f; + + //NvFlowFloat3 gridLocation = { m_emitParams.bounds.w.x, 0.f, m_emitParams.bounds.w.z }; + //NvFlowGridSetTargetLocation(m_flowGridActor.m_grid, gridLocation); + + //bool parity = (time - floorf(time)) > 0.5f; + //NvFlowFloat3 gridLocation = parity ? NvFlowFloat3{-4.f, 0.f, 0.f} : NvFlowFloat3{+4.f, 0.f, 0.f}; + //NvFlowGridSetTargetLocation(m_flowGridActor.m_grid, gridLocation); + m_emitParams.velocityLinear.x = +8.f * sinf(rate * time); m_emitParams.velocityLinear.y = -2.f; m_emitParams.velocityLinear.z = -8.f * cosf(rate * time); @@ -681,6 +722,8 @@ struct SceneSimpleFlameCapsule : public SceneSimpleFlame float m_capsuleLength = 0.75f; float m_distanceScale = 3.5f; bool m_boxMode = false; + bool m_flameSpread = false; + bool m_flameSpreadOld = false; }; struct Scene2DTextureEmitter : public SceneFluid @@ -831,6 +874,31 @@ struct SceneCustomEmit : public SceneFluid bool m_fullDomain = false; }; +struct SceneEmitSubStep : public SceneFluid +{ + SceneEmitSubStep() : SceneFluid("Emit Sub Step") {} + + virtual void initParams(); + virtual void init(AppGraphCtx* context, int winw, int winh); + virtual void doFrameUpdate(float dt); + virtual void doUpdate(float dt); + virtual void preDraw(); + virtual void draw(DirectX::CXMMATRIX projection, DirectX::CXMMATRIX view); + virtual void release(); + virtual void imgui(int x, int y, int w, int h); + + virtual void imguiFluidEmitterExtra(); + + void emitSubSteps(float t_old, float x_old, float t_new, float x_new, float frame_dt); + void emitImpulse(float x, float impulse_dt); + + float anim_t = 0.f; + float anim_x = -1.f; + float anim_x_old = 0.f; + + TimeStepper m_emitterTimeStepper; +}; + Scene* getScene(int index); void pointsToImage(NvFlowFloat4* image, int imageDim, const CurvePoint* pts, int numPts); diff --git a/demo/DemoApp/scene2DTextureEmitter.cpp b/demo/DemoApp/scene2DTextureEmitter.cpp index c2d3984..c5b0197 100644 --- a/demo/DemoApp/scene2DTextureEmitter.cpp +++ b/demo/DemoApp/scene2DTextureEmitter.cpp @@ -130,7 +130,7 @@ void Scene2DTextureEmitter::init(AppGraphCtx* appctx, int winw, int winh) void Scene2DTextureEmitter::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); diff --git a/demo/DemoApp/sceneCustomEmit.cpp b/demo/DemoApp/sceneCustomEmit.cpp index c52db59..8c97150 100644 --- a/demo/DemoApp/sceneCustomEmit.cpp +++ b/demo/DemoApp/sceneCustomEmit.cpp @@ -120,7 +120,7 @@ void SceneCustomEmit::init(AppGraphCtx* appctx, int winw, int winh) void SceneCustomEmit::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { ComputeContextNvFlowContextUpdate(m_customContext, m_flowContext.m_gridContext); diff --git a/demo/DemoApp/sceneEmitSubStep.cpp b/demo/DemoApp/sceneEmitSubStep.cpp new file mode 100644 index 0000000..76c0115 --- /dev/null +++ b/demo/DemoApp/sceneEmitSubStep.cpp @@ -0,0 +1,204 @@ +/* +* 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 +#include + +#include "loader.h" +#include "imgui.h" +#include "imguiser.h" + +namespace PresetFlame +{ +#include "presetFlame.h" +} + +#include "scene.h" + +#include + +void SceneEmitSubStep::initParams() +{ + m_flowGridActor.initParams(AppGraphCtxDedicatedVideoMemory(m_appctx)); + + // set emitter defaults + NvFlowGridEmitParamsDefaults(&m_emitParams); + + // configure emitter params + m_emitParams.bounds.x.x = 0.25f; + m_emitParams.bounds.y.y = 0.25f; + m_emitParams.bounds.z.z = 0.25f; + m_emitParams.velocityLinear.y = 8.f; + m_emitParams.fuel = 1.9f; + m_emitParams.smoke = 0.5f; + + m_shouldLoadPreset = true; +} + +void SceneEmitSubStep::init(AppGraphCtx* appctx, int winw, int winh) +{ + m_appctx = appctx; + + if (!m_shouldReset || m_isFirstRun) + { + initParams(); + m_isFirstRun = false; + } + + m_flowContext.init(appctx); + + m_flowGridActor.init(&m_flowContext, appctx); + + // create default color map + { + const int numPoints = 5; + const CurvePoint pts[numPoints] = { + { 0.f, 0.f,0.f,0.f,0.f }, + { 0.05f, 0.f,0.f,0.f,0.5f }, + { 0.6f, 213.f / 255.f,100.f / 255.f,30.f / 255.f,0.8f }, + { 0.85f, 255.f / 255.f,240.f / 255.f,0.f,0.8f }, + { 1.f, 1.f,1.f,1.f,0.7f } + }; + + auto& colorMap = m_flowGridActor.m_colorMap; + colorMap.initColorMap(m_flowContext.m_renderContext, pts, numPoints, (colorMap.m_curvePointsDefault.size() == 0)); + } + + m_projectile.init(m_appctx, m_flowContext.m_gridContext); + + resize(winw, winh); +} + +void SceneEmitSubStep::emitImpulse(float x, float impulse_dt) +{ + NvFlowShapeDesc shapeDesc; + shapeDesc.sphere.radius = 0.8f; + + m_emitParams.bounds.w.x = x; + + m_emitParams.localToWorld = m_emitParams.bounds; + m_emitParams.shapeType = eNvFlowShapeTypeSphere; + m_emitParams.deltaTime = impulse_dt; + + NvFlowGridEmit(m_flowGridActor.m_grid, &shapeDesc, 1u, &m_emitParams, 1u); +} + +void SceneEmitSubStep::emitSubSteps(float t_old, float x_old, float t_new, float x_new, float frame_dt) +{ + float emitImpulse_dt = m_emitterTimeStepper.m_fixedDt; + + int numSteps = m_emitterTimeStepper.getNumSteps(frame_dt); + + for (int i = 0; i < numSteps; i++) + { + int substep_i = numSteps - 1 - i; + + float substep_t = emitImpulse_dt * substep_i + m_emitterTimeStepper.m_timeError; + + float s = (substep_t - t_new) / (t_old - t_new); + float x = (1.f - s) * x_new + s * x_old; + + emitImpulse(x, emitImpulse_dt); + } +} + +void SceneEmitSubStep::doFrameUpdate(float frame_dt) +{ + m_emitterTimeStepper.m_fixedDt = 1.f / 1200.f; + m_emitterTimeStepper.m_maxSteps = 1000; + + anim_x_old = anim_x; + + anim_t += frame_dt; + + const float freq = 60.f; + const float k = 2.f * freq; + const float k_dt = 1.f / freq; + + if (anim_t > (2.f * k_dt)) + { + anim_t -= (2.f * k_dt); + } + + anim_x = k * fabs(anim_t - k_dt) - 1.f; + + float t_old = frame_dt; + float t_new = 0.f; + + emitSubSteps(t_old, anim_x_old, t_new, anim_x, frame_dt); +} + +void SceneEmitSubStep::doUpdate(float dt) +{ + bool shouldUpdate = m_flowContext.updateBegin(dt); + if (shouldUpdate) + { + AppGraphCtxProfileBegin(m_appctx, "Simulate"); + + m_flowGridActor.updatePreEmit(&m_flowContext, dt); + + // emit + { + m_projectile.update(m_flowContext.m_gridContext, m_flowGridActor.m_grid, dt); + } + + m_flowGridActor.updatePostEmit(&m_flowContext, dt, shouldUpdate, m_shouldGridReset); + + m_shouldGridReset = false; + + AppGraphCtxProfileEnd(m_appctx, "Simulate"); + } + m_flowContext.updateEnd(); +} + +void SceneEmitSubStep::preDraw() +{ + m_flowContext.preDrawBegin(); + + m_flowGridActor.preDraw(&m_flowContext); + + m_flowContext.preDrawEnd(); +} + +void SceneEmitSubStep::draw(DirectX::CXMMATRIX projection, DirectX::CXMMATRIX view) +{ + m_projectile.draw(projection, view); + + m_flowContext.drawBegin(); + + m_flowGridActor.draw(&m_flowContext, projection, view); + + m_flowContext.drawEnd(); +} + +void SceneEmitSubStep::release() +{ + m_projectile.release(); + + m_flowGridActor.release(); + + m_flowContext.release(); +} + +void SceneEmitSubStep::imgui(int xIn, int yIn, int wIn, int hIn) +{ + SceneFluid::imgui(xIn, yIn, wIn, hIn); + + if (m_shouldLoadPreset) + { + imguiserLoadC(PresetFlame::g_root, sizeof(PresetFlame::g_root)); + m_shouldLoadPreset = false; + } +} + +void SceneEmitSubStep::imguiFluidEmitterExtra() +{ + +} \ No newline at end of file diff --git a/demo/DemoApp/sceneFlow.cpp b/demo/DemoApp/sceneFlow.cpp index 80f87b1..5cdb70a 100644 --- a/demo/DemoApp/sceneFlow.cpp +++ b/demo/DemoApp/sceneFlow.cpp @@ -205,7 +205,7 @@ void FlowContext::computeContextEnd() } } -bool FlowContext::updateBegin() +bool FlowContext::updateBegin(float dt) { m_framesInFlight = computeContextBegin(); bool shouldFlush = (m_framesInFlight < m_maxFramesInFlight); @@ -217,6 +217,12 @@ bool FlowContext::updateBegin() NvFlowContextFlushRequestPush(m_renderCopyContext); } + m_statUpdateAttemptCount += 1.0; + if (shouldFlush) m_statUpdateSuccessCount += 1.0; + m_statUpdateAttemptCount *= 0.99; + m_statUpdateSuccessCount *= 0.99; + m_statUpdateDt = dt; + return shouldFlush; } @@ -357,6 +363,12 @@ void FlowGridActor::init(FlowContext* flowContext, AppGraphCtx* appctx) m_crossSection = NvFlowCreateCrossSection(flowContext->m_renderContext, &crossSectionDesc); + NvFlowGridSummaryDesc gridSummaryDesc = {}; + gridSummaryDesc.gridExport = gridExport; + + m_gridSummary = NvFlowCreateGridSummary(flowContext->m_gridContext, &gridSummaryDesc); + m_gridSummaryStateCPU = NvFlowCreateGridSummaryStateCPU(m_gridSummary); + NvFlowRenderMaterialPoolDesc materialPoolDesc = {}; materialPoolDesc.colorMapResolution = 64u; m_colorMap.m_materialPool = NvFlowCreateRenderMaterialPool(flowContext->m_renderContext, &materialPoolDesc); @@ -393,6 +405,8 @@ void FlowGridActor::release() NvFlowReleaseGridProxy(m_gridProxy); NvFlowReleaseVolumeRender(m_volumeRender); NvFlowReleaseCrossSection(m_crossSection); + NvFlowReleaseGridSummary(m_gridSummary); + NvFlowReleaseGridSummaryStateCPU(m_gridSummaryStateCPU); NvFlowReleaseRenderMaterialPool(m_colorMap.m_materialPool); if (m_volumeShadow) NvFlowReleaseVolumeShadow(m_volumeShadow); m_volumeShadow = nullptr; @@ -405,6 +419,25 @@ void FlowGridActor::updatePreEmit(FlowContext* flowContext, float dt) NvFlowRenderMaterialUpdate(m_colorMap.m_materialDefault, &m_renderMaterialDefaultParams); NvFlowRenderMaterialUpdate(m_colorMap.m_material0, &m_renderMaterialMat0Params); NvFlowRenderMaterialUpdate(m_colorMap.m_material1, &m_renderMaterialMat1Params); + + if (m_enableTranslationTest) + { + m_enableTranslationTestOld = true; + + m_translationTestTime += m_translationTimeScale * dt; + if (m_translationTestTime > 120.f) m_translationTestTime = 0.f; + + bool parity = (m_translationTestTime - floorf(m_translationTestTime)) > 0.5f; + NvFlowFloat3 gridLocation = parity ? m_translationOffsetA : m_translationOffsetB; + NvFlowGridSetTargetLocation(m_grid, gridLocation); + } + else if(m_enableTranslationTestOld) + { + NvFlowFloat3 gridLocation = NvFlowFloat3{ 0.f, 0.f, 0.f }; + NvFlowGridSetTargetLocation(m_grid, gridLocation); + + m_enableTranslationTestOld = false; + } } void FlowGridActor::updatePostEmit(FlowContext* flowContext, float dt, bool shouldUpdate, bool shouldReset) @@ -492,6 +525,27 @@ void FlowGridActor::updatePostEmit(FlowContext* flowContext, float dt, bool shou } auto gridExport = NvFlowGridGetGridExport(flowContext->m_gridContext, m_grid); + + if (m_enableGridSummary) + { + NvFlowGridSummaryUpdateParams updateParams = {}; + updateParams.gridExport = gridExport; + updateParams.stateCPU = m_gridSummaryStateCPU; + + NvFlowGridSummaryUpdate(m_gridSummary, flowContext->m_gridContext, &updateParams); + + NvFlowUint numLayers = NvFlowGridSummaryGetNumLayers(m_gridSummaryStateCPU); + for (NvFlowUint layerIdx = 0u; layerIdx < numLayers; layerIdx++) + { + NvFlowGridSummaryResult* results = nullptr; + NvFlowUint numResults = 0u; + + NvFlowGridSummaryGetSummaries(m_gridSummaryStateCPU, &results, &numResults, layerIdx); + + //printf("GridSummary layer(%d) numResults(%d)", layerIdx, numResults); + } + } + NvFlowGridProxyFlushParams flushParams = {}; flushParams.gridContext = flowContext->m_gridContext; flushParams.gridCopyContext = flowContext->m_gridCopyContext; @@ -686,6 +740,20 @@ void FlowGridActor::draw(FlowContext* flowContext, DirectX::CXMMATRIX projection NvFlowVolumeShadowDebugRender(m_volumeShadow, flowContext->m_renderContext, ¶ms); } + + if (m_enableGridSummary && m_enableGridSummaryDebugVis) + { + NvFlowGridSummaryDebugRenderParams params = {}; + + params.stateCPU = m_gridSummaryStateCPU; + + params.renderTargetView = flowContext->m_rtv; + + memcpy(¶ms.projectionMatrix, &projection, sizeof(NvFlowFloat4x4)); + memcpy(¶ms.viewMatrix, &view, sizeof(NvFlowFloat4x4)); + + NvFlowGridSummaryDebugRender(m_gridSummary, flowContext->m_renderContext, ¶ms); + } } // *********************** Flow Color Map ***************************************** diff --git a/demo/DemoApp/sceneSDF.cpp b/demo/DemoApp/sceneSDF.cpp index 301e260..1e6ad08 100644 --- a/demo/DemoApp/sceneSDF.cpp +++ b/demo/DemoApp/sceneSDF.cpp @@ -138,7 +138,7 @@ void SceneSDFTest::init(AppGraphCtx* appctx, int winw, int winh) void SceneSDFTest::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); @@ -285,7 +285,7 @@ void SceneCustomLighting::init(AppGraphCtx* context, int winw, int winh) void SceneCustomLighting::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { ComputeContextNvFlowContextUpdate(m_computeContext, m_flowContext.m_renderContext); diff --git a/demo/DemoApp/sceneSimpleFlame.cpp b/demo/DemoApp/sceneSimpleFlame.cpp index 60b134b..5cd69cc 100644 --- a/demo/DemoApp/sceneSimpleFlame.cpp +++ b/demo/DemoApp/sceneSimpleFlame.cpp @@ -106,7 +106,7 @@ void SceneSimpleFlame::init(AppGraphCtx* appctx, int winw, int winh) void SceneSimpleFlame::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); @@ -191,6 +191,7 @@ void SceneSimpleFlameDouble::init(AppGraphCtx* context, int winw, int winh) materialParams.vorticityStrength = 5.f; materialParams.vorticityVelocityMask = 0.f; + materialParams.vorticityConstantMask = 1.f; materialParams.velocity.macCormackBlendFactor = 0.f; materialParams.smoke.macCormackBlendFactor = 0.75f; materialParams.buoyancyPerTemp *= 5.f; @@ -203,13 +204,17 @@ void SceneSimpleFlameDouble::init(AppGraphCtx* context, int winw, int winh) void SceneSimpleFlameDouble::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); m_flowGridActor.updatePreEmit(&m_flowContext, dt); + NvFlowGridMaterialHandle emitMaterials[2u] = { m_materialA, m_materialB }; + + NvFlowGridUpdateEmitMaterials(m_flowGridActor.m_grid, emitMaterials, 2u); + // emit { NvFlowShapeDesc shapeDesc; @@ -220,14 +225,14 @@ void SceneSimpleFlameDouble::doUpdate(float dt) m_emitParams.deltaTime = dt; m_emitParamsA = m_emitParams; - m_emitParamsA.material = m_materialA; + m_emitParamsA.emitMaterialIndex = 0u; m_emitParamsA.bounds.w.x = +0.25f; m_emitParamsA.localToWorld = m_emitParamsA.bounds; m_emitParamsA.velocityLinear.x = -8.f; NvFlowGridEmit(m_flowGridActor.m_grid, &shapeDesc, 1u, &m_emitParamsA, 1u); m_emitParamsB = m_emitParams; - m_emitParamsB.material = m_materialB; + m_emitParamsB.emitMaterialIndex = 1u; m_emitParamsB.bounds.w.x = -0.25f; m_emitParamsB.localToWorld = m_emitParamsB.bounds; m_emitParamsB.velocityLinear.x = +8.f; @@ -300,7 +305,7 @@ void SceneSimpleFlameFuelMap::init(AppGraphCtx* context, int winw, int winh) void SceneSimpleFlameFuelMap::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); @@ -452,7 +457,7 @@ void SceneSimpleFlameParticleSurface::doEmitCustomEmitDensityFunc(NvFlowUint* da void SceneSimpleFlameParticleSurface::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { // update emit params @@ -892,7 +897,7 @@ void SceneSimpleFlameCulling::initParams() void SceneSimpleFlameCulling::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); @@ -1005,7 +1010,7 @@ void SceneSimpleFlameConvex::initParams() void SceneSimpleFlameConvex::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); @@ -1083,7 +1088,7 @@ void SceneSimpleFlameCapsule::initParams() void SceneSimpleFlameCapsule::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); @@ -1123,6 +1128,29 @@ void SceneSimpleFlameCapsule::doUpdate(float dt) shapeDesc[0].box.halfSize.z = 0.5f * m_capsuleRadius; } + if (m_flameSpread && !m_flameSpreadOld) + { + m_shouldGridReset = true; + } + m_flameSpreadOld = m_flameSpread; + + if (m_flameSpread) + { + m_emitParams.fuel = 0.f; + m_emitParams.fuelRelease = 2.5f; + m_emitParams.temperature = 0.f; + m_emitParams.temperatureCoupleRate = 0.f; + m_emitParams.velocityLinear.y = 0.f; + } + else + { + m_emitParams.fuel = 2.5f; + m_emitParams.fuelRelease = 0.f; + m_emitParams.temperature = 2.f; + m_emitParams.temperatureCoupleRate = 0.5f; + m_emitParams.velocityLinear.y = 8.f; + } + NvFlowGridEmit(m_flowGridActor.m_grid, shapeDesc, 1u, &m_emitParams, 1u); m_projectile.update(m_flowContext.m_gridContext, m_flowGridActor.m_grid, dt); @@ -1152,5 +1180,10 @@ void SceneSimpleFlameCapsule::imguiFluidEmitterExtra() m_boxMode = !m_boxMode; } + if (imguiserCheck("Flame Spread", m_flameSpread, true)) + { + m_flameSpread = !m_flameSpread; + } + imguiserEndGroup(); } \ No newline at end of file diff --git a/demo/DemoApp/sceneSimpleSmoke.cpp b/demo/DemoApp/sceneSimpleSmoke.cpp index da5440d..4c849b9 100644 --- a/demo/DemoApp/sceneSimpleSmoke.cpp +++ b/demo/DemoApp/sceneSimpleSmoke.cpp @@ -120,7 +120,7 @@ NvFlowFloat3 SceneSimpleSmoke::velocityFunc(float theta, float rate) void SceneSimpleSmoke::doUpdate(float dt) { - bool shouldUpdate = m_flowContext.updateBegin(); + bool shouldUpdate = m_flowContext.updateBegin(dt); if (shouldUpdate) { AppGraphCtxProfileBegin(m_appctx, "Simulate"); diff --git a/demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj b/demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj new file mode 100644 index 0000000..42bb3ae --- /dev/null +++ b/demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj @@ -0,0 +1,280 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + win32 + + + win64 + + + {15a2730a-1be6-4a99-be96-feb4b8944ac2} + Win32Proj + DemoAppCodeGen + 10.0.14393.0 + + + + Application + true + v140 + Unicode + Static + + + Application + false + v140 + true + Unicode + Static + + + Application + true + v140 + Unicode + Static + + + Application + false + v140 + true + Unicode + Static + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\include;$(SolutionDir)\NvFlow;$(SolutionDir)\NvFlowContext;$(SolutionDir)external\SDL2\include;$(VC_IncludePath);$(WindowsSDK_IncludePath) + $(SolutionDir)lib\win32;$(SolutionDir)external\SDL2\lib\x86;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86 + PostBuildEvent + $(SolutionDir)bin\$(PlatformName)\ + interm\$(Configuration)_$(PlatformName)\ + + + true + $(SolutionDir)bin\$(PlatformName)\ + interm\$(Configuration)_$(PlatformName)\ + $(SolutionDir)\include;$(SolutionDir)\NvFlow;$(SolutionDir)\NvFlowContext;$(SolutionDir)external\SDL2\include;$(VC_IncludePath);$(WindowsSDK_IncludePath) + $(SolutionDir)lib\win64;$(SolutionDir)external\SDL2\lib\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + PostBuildEvent + + + false + $(SolutionDir)\include;$(SolutionDir)\NvFlow;$(SolutionDir)\NvFlowContext;$(SolutionDir)external\SDL2\include;$(VC_IncludePath);$(WindowsSDK_IncludePath) + $(SolutionDir)lib\win32;$(SolutionDir)external\SDL2\lib\x86;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86 + PostBuildEvent + $(SolutionDir)bin\$(PlatformName)\ + interm\$(Configuration)_$(PlatformName)\ + + + false + $(SolutionDir)bin\$(PlatformName)\ + interm\$(Configuration)_$(PlatformName)\ + $(SolutionDir)\include;$(SolutionDir)\NvFlow;$(SolutionDir)\NvFlowContext;$(SolutionDir)external\SDL2\include;$(VC_IncludePath);$(WindowsSDK_IncludePath) + $(SolutionDir)lib\win64;$(SolutionDir)external\SDL2\lib\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + PostBuildEvent + + + + + + Level3 + Disabled + DLL_SUFFIX=$(Configuration)_$(PlatformName);WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + mainCRTStartup + + + %(filename) + 5.0 + $(ProjectDir)%(Filename).hlsl.h + + + + + + + + + + + + + + + + + + + + Level3 + Disabled + DLL_SUFFIX=$(Configuration)_$(PlatformName);_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + mainCRTStartup + + + %(filename) + 5.0 + $(ProjectDir)%(Filename).hlsl.h + + + + + + + + + + + + + + + + + + Level3 + + + MaxSpeed + true + true + DLL_SUFFIX=$(Configuration)_$(PlatformName);WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + mainCRTStartup + + + %(filename) + 5.0 + $(ProjectDir)%(Filename).hlsl.h + + + + + + + + + + + + + + + + + + Level3 + + + MaxSpeed + true + true + DLL_SUFFIX=$(Configuration)_$(PlatformName);NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + + + Windows + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + mainCRTStartup + + + %(filename) + 5.0 + $(ProjectDir)%(Filename).hlsl.h + + + + + + + + + + + + + + + + + $(OutDir) + $(ProjectName)$(Configuration)_$(PlatformName) + + + $(OutDir) + $(ProjectName)$(Configuration)_$(PlatformName) + + + $(OutDir) + $(ProjectName)$(Configuration)_$(PlatformName) + + + $(OutDir) + $(ProjectName)$(Configuration)_$(PlatformName) + + + + + \ No newline at end of file diff --git a/demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj.filters b/demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj.filters new file mode 100644 index 0000000..c648f4f --- /dev/null +++ b/demo/DemoAppCodeGen/DemoAppCodeGen.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {12de0363-d75b-4f29-bd10-e8b9832dd449} + + + + + Source Files + + + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/demo/DemoAppCodeGen/demoAppCodeGen.cpp b/demo/DemoAppCodeGen/demoAppCodeGen.cpp new file mode 100644 index 0000000..103e19f --- /dev/null +++ b/demo/DemoAppCodeGen/demoAppCodeGen.cpp @@ -0,0 +1,292 @@ +/* +* 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 +#include +#include + +#include "loaderCodeGen.h" +#include "functionDefinitionExtract.h" + +LoaderType gLoaderType = eLoaderTypeDynamicLink; + +void genLoaderAppGraphCtx() +{ + const unsigned int numFunctions = 12u; + + const char* functionDefinitions[numFunctions] = { + "AppGraphCtx* AppGraphCtxCreate(int deviceID);", + "bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullscreen);", + "void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context);", + "void AppGraphCtxRelease(AppGraphCtx* context);", + "void AppGraphCtxFrameStart(AppGraphCtx* context, AppGraphColor clearColor);", + "void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync);", + "void AppGraphCtxWaitForFrames(AppGraphCtx* context, unsigned int maxFramesInFlight);", + "void AppGraphCtxProfileEnable(AppGraphCtx* context, bool enabled);", + "void AppGraphCtxProfileBegin(AppGraphCtx* context, const char* label);", + "void AppGraphCtxProfileEnd(AppGraphCtx* context, const char* label);", + "bool AppGraphCtxProfileGet(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index);", + "size_t AppGraphCtxDedicatedVideoMemory(AppGraphCtx* context);" + }; + + StrHeap strHeap = allocateStrHeap(functionDefinitions, numFunctions); + + Function functions[numFunctions]; + for (unsigned int functionIdx = 0u; functionIdx < numFunctions; functionIdx++) + { + functions[functionIdx] = genFunction(&strHeap, functionDefinitions[functionIdx]); + } + + GenerateCodeParams genCodeParams = {}; + genCodeParams.loaderType = gLoaderType; + genCodeParams.file = nullptr; + genCodeParams.functions = functions; + genCodeParams.numFunctions = numFunctions; + genCodeParams.filenameTmp = "appGraphCtxLoaderGenerated.tmp.h"; + genCodeParams.filenameDst = "appGraphCtxLoaderGenerated.h"; + genCodeParams.moduleNameUpperCase = "AppGraphCtx"; + genCodeParams.moduleNameLowerCase = "appGraphCtx"; + genCodeParams.instName = "gAppGraphCtxLoader"; + genCodeParams.apiMarker = "APP_GRAPH_CTX_API"; + + fopen_s(&genCodeParams.file, genCodeParams.filenameTmp, "w"); + + generateCode(&genCodeParams); + + fclose(genCodeParams.file); + + freeStrHeap(&strHeap); + + fileDiffAndWriteIfModified(&genCodeParams); +} + +void genLoaderComputeContext() +{ + const unsigned int numFunctions = 23u; + + const char* functionDefinitions[numFunctions] = { + "ComputeContext* ComputeContextCreate(ComputeContextDesc* desc);", + "void ComputeContextUpdate(ComputeContext* context, ComputeContextDesc* desc);", + "void ComputeContextRelease(ComputeContext* context);", + "ComputeShader* ComputeShaderCreate(ComputeContext* context, const ComputeShaderDesc* desc);", + "void ComputeShaderRelease(ComputeShader* shader);", + "ComputeConstantBuffer* ComputeConstantBufferCreate(ComputeContext* context, const ComputeConstantBufferDesc* desc);", + "void ComputeConstantBufferRelease(ComputeConstantBuffer* constantBuffer);", + "void* ComputeConstantBufferMap(ComputeContext* context, ComputeConstantBuffer* constantBuffer);", + "void ComputeConstantBufferUnmap(ComputeContext* context, ComputeConstantBuffer* constantBuffer);", + "ComputeResource* ComputeResourceCreate(ComputeContext* context, const ComputeResourceDesc* desc);", + "void ComputeResourceUpdate(ComputeContext* context, ComputeResource* resource, const ComputeResourceDesc* desc);", + "void ComputeResourceRelease(ComputeResource* resource);", + "ComputeResourceRW* ComputeResourceRWCreate(ComputeContext* context, const ComputeResourceRWDesc* desc);", + "void ComputeResourceRWUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, const ComputeResourceRWDesc* desc);", + "void ComputeResourceRWRelease(ComputeResourceRW* resourceRW);", + "ComputeResource* ComputeResourceRWGetResource(ComputeResourceRW* resourceRW);", + "void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams* params);", + "ComputeContext* ComputeContextNvFlowContextCreate(NvFlowContext* flowContext);", + "void ComputeContextNvFlowContextUpdate(ComputeContext* computeContext, NvFlowContext* flowContext);", + "ComputeResource* ComputeResourceNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource);", + "void ComputeResourceNvFlowUpdate(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource);", + "ComputeResourceRW* ComputeResourceRWNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW);", + "void ComputeResourceRWNvFlowUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW);" + }; + + StrHeap strHeap = allocateStrHeap(functionDefinitions, numFunctions); + + Function functions[numFunctions]; + for (unsigned int functionIdx = 0u; functionIdx < numFunctions; functionIdx++) + { + functions[functionIdx] = genFunction(&strHeap, functionDefinitions[functionIdx]); + } + + GenerateCodeParams genCodeParams = {}; + genCodeParams.loaderType = gLoaderType; + genCodeParams.file = nullptr; + genCodeParams.functions = functions; + genCodeParams.numFunctions = numFunctions; + genCodeParams.filenameTmp = "computeContextLoaderGenerated.tmp.h"; + genCodeParams.filenameDst = "computeContextLoaderGenerated.h"; + genCodeParams.moduleNameUpperCase = "ComputeContext"; + genCodeParams.moduleNameLowerCase = "computeContext"; + genCodeParams.instName = "gComputeContextLoader"; + genCodeParams.apiMarker = "COMPUTE_API"; + + fopen_s(&genCodeParams.file, genCodeParams.filenameTmp, "w"); + + generateCode(&genCodeParams); + + fclose(genCodeParams.file); + + freeStrHeap(&strHeap); + + fileDiffAndWriteIfModified(&genCodeParams); +} + +void genLoaderImgui() +{ + const unsigned int numFunctions = 18u; + + const char* functionDefinitions[numFunctions] = { + "void imguiGraphContextInit(const ImguiGraphDesc* desc);", + "void imguiGraphContextUpdate(const ImguiGraphDesc* desc);", + "void imguiGraphContextDestroy();", + "void imguiGraphRecordBegin();", + "void imguiGraphRecordEnd();", + "void imguiGraphVertex2f(float x, float y);", + "void imguiGraphVertex2fv(const float* v);", + "void imguiGraphTexCoord2f(float u, float v);", + "void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);", + "void imguiGraphColor4ubv(const uint8_t* v);", + "void imguiGraphFontTextureEnable();", + "void imguiGraphFontTextureDisable();", + "void imguiGraphEnableScissor(int x, int y, int width, int height);", + "void imguiGraphDisableScissor();", + "void imguiGraphFontTextureInit(unsigned char* data);", + "void imguiGraphFontTextureRelease();", + "bool imguiInteropGraphInit(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx);", + "void imguiInteropGraphUpdate(imguiGraphUpdate_t func, AppGraphCtx* appctx);" + }; + + StrHeap strHeap = allocateStrHeap(functionDefinitions, numFunctions); + + Function functions[numFunctions]; + for (unsigned int functionIdx = 0u; functionIdx < numFunctions; functionIdx++) + { + functions[functionIdx] = genFunction(&strHeap, functionDefinitions[functionIdx]); + } + + GenerateCodeParams genCodeParams = {}; + genCodeParams.loaderType = gLoaderType; + genCodeParams.file = nullptr; + genCodeParams.functions = functions; + genCodeParams.numFunctions = numFunctions; + genCodeParams.filenameTmp = "imguiGraphLoaderGenerated.tmp.h"; + genCodeParams.filenameDst = "imguiGraphLoaderGenerated.h"; + genCodeParams.moduleNameUpperCase = "Imgui"; + genCodeParams.moduleNameLowerCase = "imgui"; + genCodeParams.instName = "gImguiLoader"; + genCodeParams.apiMarker = "IMGUI_GRAPH_API"; + + fopen_s(&genCodeParams.file, genCodeParams.filenameTmp, "w"); + + generateCode(&genCodeParams); + + fclose(genCodeParams.file); + + freeStrHeap(&strHeap); + + fileDiffAndWriteIfModified(&genCodeParams); +} + +void genLoaderMesh() +{ + const unsigned int numFunctions = 10u; + + const char* functionDefinitions[numFunctions] = { + "MeshContext* MeshContextCreate(const MeshContextDesc* desc);", + "void MeshContextUpdate(MeshContext* context, const MeshContextDesc* desc);", + "void MeshContextRelease(MeshContext* context);", + "MeshIndexBuffer* MeshIndexBufferCreate(MeshContext* context, MeshUint* indices, MeshUint numIndices);", + "void MeshIndexBufferRelease(MeshIndexBuffer* buffer);", + "MeshVertexBuffer* MeshVertexBufferCreate(MeshContext* context, MeshVertex* vertices, MeshUint numVertices);", + "void MeshVertexBufferRelease(MeshVertexBuffer* buffer);", + "void MeshContextDraw(MeshContext* context, const MeshContextDrawParams* params);", + "MeshContext* MeshInteropContextCreate(AppGraphCtx* appctx);", + "void MeshInteropContextUpdate(MeshContext* context, AppGraphCtx* appctx);" + }; + + StrHeap strHeap = allocateStrHeap(functionDefinitions, numFunctions); + + Function functions[numFunctions]; + for (unsigned int functionIdx = 0u; functionIdx < numFunctions; functionIdx++) + { + functions[functionIdx] = genFunction(&strHeap, functionDefinitions[functionIdx]); + } + + GenerateCodeParams genCodeParams = {}; + genCodeParams.loaderType = gLoaderType; + genCodeParams.file = nullptr; + genCodeParams.functions = functions; + genCodeParams.numFunctions = numFunctions; + genCodeParams.filenameTmp = "meshLoaderGenerated.tmp.h"; + genCodeParams.filenameDst = "meshLoaderGenerated.h"; + genCodeParams.moduleNameUpperCase = "Mesh"; + genCodeParams.moduleNameLowerCase = "mesh"; + genCodeParams.instName = "gMeshLoader"; + genCodeParams.apiMarker = "MESH_API"; + + fopen_s(&genCodeParams.file, genCodeParams.filenameTmp, "w"); + + generateCode(&genCodeParams); + + fclose(genCodeParams.file); + + freeStrHeap(&strHeap); + + fileDiffAndWriteIfModified(&genCodeParams); +} + +void genNvFlowInteropLoader() +{ + const unsigned int numFunctions = 6u; + + const char* functionDefinitions[numFunctions] = { + "NvFlowContext* NvFlowInteropCreateContext(AppGraphCtx* appctx);", + "NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilView(AppGraphCtx* appctx, NvFlowContext* flowctx);", + "NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetView(AppGraphCtx* appctx, NvFlowContext* flowctx);", + "void NvFlowInteropUpdateContext(NvFlowContext* context, AppGraphCtx* appctx);", + "void NvFlowInteropUpdateDepthStencilView(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx);", + "void NvFlowInteropUpdateRenderTargetView(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx);" + }; + + StrHeap strHeap = allocateStrHeap(functionDefinitions, numFunctions); + + Function functions[numFunctions]; + for (unsigned int functionIdx = 0u; functionIdx < numFunctions; functionIdx++) + { + functions[functionIdx] = genFunction(&strHeap, functionDefinitions[functionIdx]); + } + + GenerateCodeParams genCodeParams = {}; + genCodeParams.loaderType = gLoaderType; + genCodeParams.file = nullptr; + genCodeParams.functions = functions; + genCodeParams.numFunctions = numFunctions; + genCodeParams.filenameTmp = "NvFlowInteropLoaderGenerated.tmp.h"; + genCodeParams.filenameDst = "NvFlowInteropLoaderGenerated.h"; + genCodeParams.moduleNameUpperCase = "NvFlowInterop"; + genCodeParams.moduleNameLowerCase = "nvFlowInterop"; + genCodeParams.instName = "gNvFlowInteropLoader"; + genCodeParams.apiMarker = "NV_FLOW_API"; + + fopen_s(&genCodeParams.file, genCodeParams.filenameTmp, "w"); + + generateCode(&genCodeParams); + + fclose(genCodeParams.file); + + freeStrHeap(&strHeap); + + fileDiffAndWriteIfModified(&genCodeParams); +} + +int main(int argc, char** argv) +{ + genLoaderAppGraphCtx(); + + genLoaderComputeContext(); + + genLoaderImgui(); + + genLoaderMesh(); + + genNvFlowInteropLoader(); + + return 0; +} \ No newline at end of file diff --git a/demo/DemoAppCodeGen/functionDefinitionExtract.h b/demo/DemoAppCodeGen/functionDefinitionExtract.h new file mode 100644 index 0000000..ca08253 --- /dev/null +++ b/demo/DemoAppCodeGen/functionDefinitionExtract.h @@ -0,0 +1,230 @@ +/* +* 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 + +struct StrHeap +{ + char* data; + unsigned int size; + unsigned int allocIdx; +}; + +StrHeap allocateStrHeap(const char** definitions, unsigned int numFunctions) +{ + unsigned int count = 0u; + for (unsigned int functionIdx = 0u; functionIdx < numFunctions; functionIdx++) + { + count += (unsigned int)strlen(definitions[functionIdx]); + } + + // offset count to cover null terminators + count += numFunctions * (2 * maxFunctionParams + 1 + 1); + + StrHeap heap = {}; + heap.data = (char*)malloc(count); + heap.size = count; + heap.allocIdx = 0u; + return heap; +} + +void freeStrHeap(StrHeap* heap) +{ + free(heap->data); + heap->data = nullptr; + heap->size = 0u; + heap->allocIdx = 0u; +} + +inline bool isSpace(char c) +{ + return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == '\f' || c == '\v'; +} + +inline bool isAlphaNum(char c) +{ + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (c == '_'); +} + +void skipSpace(unsigned int* readIdx, const char* definition) +{ + while (definition[*readIdx] != '\0') + { + if (isSpace(definition[*readIdx])) + { + *readIdx = *readIdx + 1; + } + else + { + break; + } + } +} + +void findChar(unsigned int* readIdx, const char* definition, char c) +{ + while (definition[*readIdx] != '\0') + { + if (definition[*readIdx] == c) + { + break; + } + else + { + *readIdx = *readIdx + 1; + } + } +} + +unsigned int findParamDelimiter(unsigned int readIdx, const char* definition) +{ + while (definition[readIdx] != '\0') + { + if (definition[readIdx] == ',' || definition[readIdx] == ')') + { + return readIdx; + } + else + { + readIdx = readIdx + 1; + } + } + return readIdx; +} + +unsigned int reverseFindAlphaNum(unsigned int maxReadIdx, const char* definition) +{ + int readIdx = (int)maxReadIdx; + readIdx--; + bool hitAlphaNum = false; + while (readIdx >= 0) + { + if (isAlphaNum(definition[readIdx])) + { + hitAlphaNum = true; + readIdx--; + } + else if (definition[readIdx] == '(' || definition[readIdx] == ',') + { + if (hitAlphaNum) + { + return (unsigned int)(readIdx + 1); + } + else + { + return maxReadIdx; + }; + } + else if (isSpace(definition[readIdx])) + { + if (hitAlphaNum) + { + return (unsigned int)(readIdx + 1); + } + else + { + readIdx--; + } + } + else + { + break; + } + } + return maxReadIdx; +} + +void extractAlphaNum(StrHeap* heap, const char** dstPtr, unsigned int* readIdx, const char* definition) +{ + skipSpace(readIdx, definition); + + *dstPtr = heap->data + heap->allocIdx; + + while (heap->allocIdx < heap->size) + { + if (isAlphaNum(definition[(*readIdx)])) + { + heap->data[heap->allocIdx++] = definition[(*readIdx)++]; + } + else + { + break; + } + } + heap->data[heap->allocIdx++] = '\0'; +} + +void extractRegion(StrHeap* heap, const char** dstPtr, unsigned char readIdx, unsigned char maxReadIdx, const char* definition) +{ + *dstPtr = heap->data + heap->allocIdx; + + while (heap->allocIdx < heap->size) + { + if (readIdx < maxReadIdx) + { + heap->data[heap->allocIdx++] = definition[readIdx++]; + } + else + { + break; + } + } + heap->data[heap->allocIdx++] = '\0'; +} + +Function genFunction(StrHeap* heap, const char* definition) +{ + Function function = {}; + + unsigned int readIdx = 0u; + unsigned int tempReadIdx = 0u; + + unsigned int paramStartReadIdx = readIdx; + findChar(¶mStartReadIdx, definition, '('); + + unsigned int methodReadIdx = reverseFindAlphaNum(paramStartReadIdx, definition); + + extractRegion(heap, &function.retType, readIdx, methodReadIdx, definition); + + tempReadIdx = methodReadIdx; + extractAlphaNum(heap, &function.method, &tempReadIdx, definition); + + readIdx = paramStartReadIdx; + + function.numParams = 0; + while (function.numParams < maxFunctionParams) + { + unsigned int maxReadIdx = findParamDelimiter(readIdx, definition); + + unsigned int instNameReadIdx = reverseFindAlphaNum(maxReadIdx, definition); + + // break if no name found + if (instNameReadIdx == maxReadIdx) + { + break; + } + + FunctionParams funcParams = {}; + + // extract type name, found on interval readIdx to instNameReadIdx + extractRegion(heap, &funcParams.typeName, readIdx + 1, instNameReadIdx, definition); + + // extract inst name, found on interval instNameReadIdx to maxReadIdx + tempReadIdx = instNameReadIdx; + extractAlphaNum(heap, &funcParams.instName, &tempReadIdx, definition); + + // advance read index + readIdx = maxReadIdx + 1; + + function.params[function.numParams++] = funcParams; + } + + return function; +} \ No newline at end of file diff --git a/demo/DemoAppCodeGen/loaderCodeGen.h b/demo/DemoAppCodeGen/loaderCodeGen.h new file mode 100644 index 0000000..b92beb1 --- /dev/null +++ b/demo/DemoAppCodeGen/loaderCodeGen.h @@ -0,0 +1,335 @@ +/* +* 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 + +enum LoaderType +{ + eLoaderTypeDynamicLink = 0, + eLoaderTypeStaticLink = 1 +}; + +const unsigned int maxFunctionParams = 8u; + +struct FunctionParams +{ + const char* typeName; + const char* instName; +}; + +struct Function +{ + const char* retType; + const char* method; + unsigned int numParams; + FunctionParams params[maxFunctionParams]; +}; + +struct GenerateCodeParams +{ + LoaderType loaderType; + FILE* file; + Function* functions; + unsigned int numFunctions; + + const char* filenameTmp; + const char* filenameDst; + const char* moduleNameUpperCase; + const char* moduleNameLowerCase; + const char* instName; + const char* apiMarker; +}; + +void typedef_function_ptrs(const GenerateCodeParams* params) +{ + for (unsigned int functionIdx = 0u; functionIdx < params->numFunctions; functionIdx++) + { + auto& function = params->functions[functionIdx]; + + fprintf(params->file, "typedef %s (*%s_ptr_t)(", function.retType, function.method); + + for (unsigned int paramIdx = 0u; paramIdx < function.numParams; paramIdx++) + { + fprintf(params->file, "%s %s", function.params[paramIdx].typeName, function.params[paramIdx].instName); + + if (paramIdx < function.numParams - 1) fprintf(params->file, ", "); + } + + fprintf(params->file, ");\n"); + } + + fprintf(params->file, "\n"); +} + +void declare_function_ptrs(const GenerateCodeParams* params) +{ + for (unsigned int functionIdx = 0u; functionIdx < params->numFunctions; functionIdx++) + { + auto& function = params->functions[functionIdx]; + + fprintf(params->file, "\t%s_ptr_t %s_ptr;\n", function.method, function.method); + } +} + +void implement_pointer_wrappers(const GenerateCodeParams* params) +{ + for (unsigned int functionIdx = 0u; functionIdx < params->numFunctions; functionIdx++) + { + auto& function = params->functions[functionIdx]; + + fprintf(params->file, "%s %s(", function.retType, function.method); + + for (unsigned int paramIdx = 0u; paramIdx < function.numParams; paramIdx++) + { + fprintf(params->file, "%s %s", function.params[paramIdx].typeName, function.params[paramIdx].instName); + + if (paramIdx < function.numParams - 1) fprintf(params->file, ", "); + } + + fprintf(params->file, ")\n{\n"); + + fprintf(params->file, "\treturn %s.%s_ptr(", params->instName, function.method); + + for (unsigned int paramIdx = 0u; paramIdx < function.numParams; paramIdx++) + { + fprintf(params->file, "%s", function.params[paramIdx].instName); + + if (paramIdx < function.numParams - 1) fprintf(params->file, ", "); + } + + fprintf(params->file, ");\n"); + + fprintf(params->file, "}\n\n"); + } +} + +void load_function_ptrs(const GenerateCodeParams* params) +{ + for (unsigned int functionIdx = 0u; functionIdx < params->numFunctions; functionIdx++) + { + auto& function = params->functions[functionIdx]; + + fprintf(params->file, "\t%s.%s_ptr = ", params->instName, function.method); + + fprintf(params->file, "(%s_ptr_t", function.method); + + fprintf(params->file, ")(%sLoaderLoadFunction(&%s, \"%s\")", params->moduleNameLowerCase, params->instName, function.method); + + fprintf(params->file, ");\n"); + } +} + +void load_function_ptrs_static(const GenerateCodeParams* params, const char* suffix) +{ + fprintf(params->file, "\tif (type == APP_CONTEXT_%s)\n\t{\n", suffix); + + for (unsigned int functionIdx = 0u; functionIdx < params->numFunctions; functionIdx++) + { + auto& function = params->functions[functionIdx]; + + fprintf(params->file, "\t\t%s.%s_ptr = ", params->instName, function.method); + + fprintf(params->file, "%s%s;\n", function.method, suffix); + } + + fprintf(params->file, "\t}\n\n"); +} + +void unload_function_ptrs(const GenerateCodeParams* params) +{ + for (unsigned int functionIdx = 0u; functionIdx < params->numFunctions; functionIdx++) + { + auto& function = params->functions[functionIdx]; + + fprintf(params->file, "\t%s.%s_ptr = nullptr;\n", params->instName, function.method); + } +} + +void declare_backend_functions(const GenerateCodeParams* params, const char* suffix) +{ + for (unsigned int functionIdx = 0u; functionIdx < params->numFunctions; functionIdx++) + { + auto& function = params->functions[functionIdx]; + + fprintf(params->file, "%s %s %s%s(", params->apiMarker, function.retType, function.method, suffix); + + for (unsigned int paramIdx = 0u; paramIdx < function.numParams; paramIdx++) + { + fprintf(params->file, "%s %s", function.params[paramIdx].typeName, function.params[paramIdx].instName); + + if (paramIdx < function.numParams - 1) fprintf(params->file, ", "); + } + + fprintf(params->file, ");\n"); + } + + fprintf(params->file, "\n"); +} + +const char* fileHeader = +"/*\n" +"* Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.\n" +"*\n" +"* NVIDIA CORPORATION and its licensors retain all intellectual property\n" +"* and proprietary rights in and to this software, related documentation\n" +"* and any modifications thereto. Any use, reproduction, disclosure or\n" +"* distribution of this software and related documentation without an express\n" +"* license agreement from NVIDIA CORPORATION is strictly prohibited.\n" +"*/\n\n"; + +void generateCode(const GenerateCodeParams* params) +{ + fprintf(params->file, fileHeader); + + typedef_function_ptrs(params); + + const char* loaderBegin = + "struct %sLoader \n" + "{ \n" + " void* module = nullptr; \n" + " const char* suffix = \"\"; \n" + " char buf[1024u]; \n\n"; + fprintf(params->file, loaderBegin, params->moduleNameUpperCase); + + declare_function_ptrs(params); + + const char* loaderEnd = + "\n" + "}%s; \n\n"; + fprintf(params->file, loaderEnd, params->instName); + + implement_pointer_wrappers(params); + + if (params->loaderType == eLoaderTypeDynamicLink) + { + const char* loaderFunction = + "void* %sLoaderLoadFunction(%sLoader* inst, const char* name)\n" + "{\n" + " snprintf(inst->buf, 1024u, \"%s%s\", name, inst->suffix);\n" + "\n" + " return SDL_LoadFunction(inst->module, inst->buf);\n" + "}\n\n"; + fprintf(params->file, loaderFunction, params->moduleNameLowerCase, params->moduleNameUpperCase, "%s", "%s"); + + const char* loadModule = + "void load%s(AppGraphCtxType type)\n" + "{\n" + " const char* moduleName = demoAppDLLName(type);\n" + "\n" + " %s.suffix = demoAppBackendSuffix(type);\n" + "\n" + " %s.module = SDL_LoadObject(moduleName);\n\n"; + fprintf(params->file, loadModule, params->moduleNameUpperCase, params->instName, params->instName); + + load_function_ptrs(params); + + const char* unloadModule = + "}\n" + "\n" + "void unload%s()\n" + "{\n"; + fprintf(params->file, unloadModule, params->moduleNameUpperCase); + + unload_function_ptrs(params); + + const char* unloadModuleEnd = + "\n" + " SDL_UnloadObject(%s.module);\n" + "}\n"; + fprintf(params->file, unloadModuleEnd, params->instName); + } + else if (params->loaderType == eLoaderTypeStaticLink) + { + const unsigned int suffixCount = 2u; + const char* suffix[suffixCount] = { "D3D11", "D3D12" }; + + for (unsigned int suffixIdx = 0u; suffixIdx < 2u; suffixIdx++) + { + declare_backend_functions(params, suffix[suffixIdx]); + } + + const char* loadModule = + "void load%s(AppGraphCtxType type)\n" + "{\n" + " %s.suffix = demoAppBackendSuffix(type);\n" + "\n"; + fprintf(params->file, loadModule, params->moduleNameUpperCase, params->instName); + + for (unsigned int suffixIdx = 0u; suffixIdx < 2u; suffixIdx++) + { + load_function_ptrs_static(params, suffix[suffixIdx]); + } + + const char* unloadModule = + "}\n" + "\n" + "void unload%s()\n" + "{\n"; + fprintf(params->file, unloadModule, params->moduleNameUpperCase); + + unload_function_ptrs(params); + + const char* unloadModuleEnd = + "\n" + "}\n"; + fprintf(params->file, unloadModuleEnd, params->instName); + } +} + +void fileDiffAndWriteIfModified(const GenerateCodeParams* params) +{ + FILE* fileTmp = nullptr; + FILE* fileDst = nullptr; + bool match = true; + + fopen_s(&fileDst, params->filenameDst, "r"); + if (fileDst) + { + fopen_s(&fileTmp, params->filenameTmp, "r"); + if (fileTmp) + { + while (1) + { + int a = fgetc(fileTmp); + int b = fgetc(fileDst); + + if (a == EOF && b == EOF) + { + break; + } + else if (a != b) + { + match = false; + break; + } + } + + fclose(fileTmp); + } + else + { + match = false; + } + fclose(fileDst); + } + else + { + match = false; + } + + if (!match) + { + remove(params->filenameDst); + rename(params->filenameTmp, params->filenameDst); + } + + // always cleanup temp file + remove(params->filenameTmp); +} \ No newline at end of file diff --git a/demo/DemoAppD3D11/NvFlowInteropD3D11.cpp b/demo/DemoAppD3D11/NvFlowInteropD3D11.cpp index 23aaf9c..4f4b1cf 100644 --- a/demo/DemoAppD3D11/NvFlowInteropD3D11.cpp +++ b/demo/DemoAppD3D11/NvFlowInteropD3D11.cpp @@ -15,16 +15,32 @@ #include "NvFlowContextD3D11.h" #include "appD3D11Ctx.h" -NvFlowContext* NvFlowInteropCreateContext(AppGraphCtx* appctx) +NV_FLOW_API NvFlowContext* NvFlowInteropCreateContextD3D11(AppGraphCtx* appctx); + +NV_FLOW_API NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilViewD3D11(AppGraphCtx* appctx, NvFlowContext* flowctx); + +NV_FLOW_API NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetViewD3D11(AppGraphCtx* appctx, NvFlowContext* flowctx); + +NV_FLOW_API void NvFlowInteropUpdateContextD3D11(NvFlowContext* context, AppGraphCtx* appctx); + +NV_FLOW_API void NvFlowInteropUpdateDepthStencilViewD3D11(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx); + +NV_FLOW_API void NvFlowInteropUpdateRenderTargetViewD3D11(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx); + +NvFlowContext* NvFlowInteropCreateContextD3D11(AppGraphCtx* appctxIn) { + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + NvFlowContextDescD3D11 desc = {}; desc.device = appctx->m_device; desc.deviceContext = appctx->m_deviceContext; return NvFlowCreateContextD3D11(NV_FLOW_VERSION, &desc); } -NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilView(AppGraphCtx* appctx, NvFlowContext* flowctx) +NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilViewD3D11(AppGraphCtx* appctxIn, NvFlowContext* flowctx) { + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + NvFlowDepthStencilViewDescD3D11 desc = {}; desc.dsv = appctx->m_dsv; desc.srv = appctx->m_depthSRV; @@ -32,24 +48,30 @@ NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilView(AppGraphCtx* appctx, return NvFlowCreateDepthStencilViewD3D11(flowctx, &desc); } -NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetView(AppGraphCtx* appctx, NvFlowContext* flowctx) +NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetViewD3D11(AppGraphCtx* appctxIn, NvFlowContext* flowctx) { + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + NvFlowRenderTargetViewDescD3D11 desc = {}; desc.rtv = appctx->m_rtv; desc.viewport = appctx->m_viewport; return NvFlowCreateRenderTargetViewD3D11(flowctx, &desc); } -void NvFlowInteropUpdateContext(NvFlowContext* context, AppGraphCtx* appctx) +void NvFlowInteropUpdateContextD3D11(NvFlowContext* context, AppGraphCtx* appctxIn) { + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + NvFlowContextDescD3D11 desc = {}; desc.device = appctx->m_device; desc.deviceContext = appctx->m_deviceContext; NvFlowUpdateContextD3D11(context, &desc); } -void NvFlowInteropUpdateDepthStencilView(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx) +void NvFlowInteropUpdateDepthStencilViewD3D11(NvFlowDepthStencilView* view, AppGraphCtx* appctxIn, NvFlowContext* flowctx) { + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + NvFlowDepthStencilViewDescD3D11 desc = {}; desc.dsv = appctx->m_dsv; desc.srv = appctx->m_depthSRV; @@ -57,8 +79,10 @@ void NvFlowInteropUpdateDepthStencilView(NvFlowDepthStencilView* view, AppGraphC NvFlowUpdateDepthStencilViewD3D11(flowctx, view, &desc); } -void NvFlowInteropUpdateRenderTargetView(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx) +void NvFlowInteropUpdateRenderTargetViewD3D11(NvFlowRenderTargetView* view, AppGraphCtx* appctxIn, NvFlowContext* flowctx) { + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + NvFlowRenderTargetViewDescD3D11 desc = {}; desc.rtv = appctx->m_rtv; desc.viewport = appctx->m_viewport; diff --git a/demo/DemoAppD3D11/appD3D11Ctx.cpp b/demo/DemoAppD3D11/appD3D11Ctx.cpp index 959614c..dd2bd2c 100644 --- a/demo/DemoAppD3D11/appD3D11Ctx.cpp +++ b/demo/DemoAppD3D11/appD3D11Ctx.cpp @@ -45,25 +45,23 @@ namespace } } -AppGraphProfiler* appGraphCreateProfiler(AppGraphCtx* ctx); -void appGraphProfilerFrameBegin(AppGraphProfiler* profiler); -void appGraphProfilerFrameEnd(AppGraphProfiler* profiler); -void appGraphProfilerEnable(AppGraphProfiler* profiler, bool enabled); -void appGraphProfilerBegin(AppGraphProfiler* profiler, const char* label); -void appGraphProfilerEnd(AppGraphProfiler* profiler, const char* label); -bool appGraphProfilerGet(AppGraphProfiler* profiler, const char** plabel, float* cpuTime, float* gpuTime, int index); -void appGraphReleaseProfiler(AppGraphProfiler* profiler); - -void AppGraphCtxInitRenderTarget(AppGraphCtx* context, SDL_Window* window, bool fullscreen); - -AppGraphCtx::AppGraphCtx() +AppGraphProfilerD3D11* appGraphCreateProfilerD3D11(AppGraphCtx* ctx); +void appGraphProfilerD3D11FrameBegin(AppGraphProfilerD3D11* profiler); +void appGraphProfilerD3D11FrameEnd(AppGraphProfilerD3D11* profiler); +void appGraphProfilerD3D11Enable(AppGraphProfilerD3D11* profiler, bool enabled); +void appGraphProfilerD3D11Begin(AppGraphProfilerD3D11* profiler, const char* label); +void appGraphProfilerD3D11End(AppGraphProfilerD3D11* profiler, const char* label); +bool appGraphProfilerD3D11Get(AppGraphProfilerD3D11* profiler, const char** plabel, float* cpuTime, float* gpuTime, int index); +void appGraphReleaseProfiler(AppGraphProfilerD3D11* profiler); + +AppGraphCtxD3D11::AppGraphCtxD3D11() { - m_profiler = appGraphCreateProfiler(this); + m_profiler = appGraphCreateProfilerD3D11(cast_from_AppGraphCtxD3D11(this)); } -AppGraphCtx::~AppGraphCtx() +AppGraphCtxD3D11::~AppGraphCtxD3D11() { - AppGraphCtxReleaseRenderTarget(this); + AppGraphCtxReleaseRenderTargetD3D11(cast_from_AppGraphCtxD3D11(this)); COMRelease(m_device); COMRelease(m_deviceContext); @@ -73,9 +71,9 @@ AppGraphCtx::~AppGraphCtx() m_profiler = nullptr; } -AppGraphCtx* AppGraphCtxCreate(int deviceID) +AppGraphCtx* AppGraphCtxCreateD3D11(int deviceID) { - AppGraphCtx* context = new AppGraphCtx; + AppGraphCtxD3D11* context = new AppGraphCtxD3D11; HRESULT hr = S_OK; @@ -160,11 +158,15 @@ AppGraphCtx* AppGraphCtxCreate(int deviceID) return nullptr; } - return context; + return cast_from_AppGraphCtxD3D11(context); } -bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullscreen) +void AppGraphCtxInitRenderTargetD3D11(AppGraphCtx* context, SDL_Window* window, bool fullscreen); + +bool AppGraphCtxUpdateSizeD3D11(AppGraphCtx* contextIn, SDL_Window* window, bool fullscreen) { + auto context = cast_to_AppGraphCtxD3D11(contextIn); + // TODO: fix iflip fullscreen support fullscreen = false; @@ -204,18 +206,20 @@ bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullsc if (sizeChanged) { - AppGraphCtxReleaseRenderTarget(context); + AppGraphCtxReleaseRenderTargetD3D11(cast_from_AppGraphCtxD3D11(context)); } if (sizeChanged && context->m_valid) { - AppGraphCtxInitRenderTarget(context, window, fullscreen); + AppGraphCtxInitRenderTargetD3D11(cast_from_AppGraphCtxD3D11(context), window, fullscreen); } return context->m_valid; } -void AppGraphCtxInitRenderTarget(AppGraphCtx* context, SDL_Window* window, bool fullscreen) +void AppGraphCtxInitRenderTargetD3D11(AppGraphCtx* contextIn, SDL_Window* window, bool fullscreen) { + auto context = cast_to_AppGraphCtxD3D11(contextIn); + HWND hWnd = nullptr; // get Windows handle to this SDL window SDL_SysWMinfo winInfo; @@ -354,8 +358,10 @@ void AppGraphCtxInitRenderTarget(AppGraphCtx* context, SDL_Window* window, bool } } -void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context) +void AppGraphCtxReleaseRenderTargetD3D11(AppGraphCtx* contextIn) { + auto context = cast_to_AppGraphCtxD3D11(contextIn); + if (context->m_swapChain == nullptr) { return; @@ -376,58 +382,66 @@ void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context) context->m_winH = 0u; } -void AppGraphCtxRelease(AppGraphCtx* context) +void AppGraphCtxReleaseD3D11(AppGraphCtx* context) { if (context == nullptr) return; - delete context; + delete cast_to_AppGraphCtxD3D11(context); } -void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4]) +void AppGraphCtxFrameStartD3D11(AppGraphCtx* contextIn, AppGraphColor clearColor) { - appGraphProfilerFrameBegin(context->m_profiler); + auto context = cast_to_AppGraphCtxD3D11(contextIn); + + appGraphProfilerD3D11FrameBegin(context->m_profiler); context->m_deviceContext->RSSetViewports(1, &context->m_viewport); context->m_deviceContext->RSSetScissorRects(0, nullptr); context->m_deviceContext->OMSetRenderTargets(1, &context->m_rtv, context->m_dsv); - context->m_deviceContext->ClearRenderTargetView(context->m_rtv, clearColor); + context->m_deviceContext->ClearRenderTargetView(context->m_rtv, &clearColor.r); context->m_deviceContext->ClearDepthStencilView(context->m_dsv, D3D11_CLEAR_DEPTH, 1.f, 0u); context->m_deviceContext->OMSetDepthStencilState(context->m_depthState, 0u); } -void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync) +void AppGraphCtxFramePresentD3D11(AppGraphCtx* contextIn, bool fullsync) { + auto context = cast_to_AppGraphCtxD3D11(contextIn); + context->m_swapChain->Present(0, 0); - appGraphProfilerFrameEnd(context->m_profiler); + appGraphProfilerD3D11FrameEnd(context->m_profiler); } -void AppGraphCtxWaitForFrames(AppGraphCtx* context, unsigned int maxFramesInFlight) +void AppGraphCtxWaitForFramesD3D11(AppGraphCtx* context, unsigned int maxFramesInFlight) { // TODO: Implement } -void AppGraphCtxProfileEnable(AppGraphCtx* context, bool enabled) +void AppGraphCtxProfileEnableD3D11(AppGraphCtx* contextIn, bool enabled) { - appGraphProfilerEnable(context->m_profiler, enabled); + auto context = cast_to_AppGraphCtxD3D11(contextIn); + appGraphProfilerD3D11Enable(context->m_profiler, enabled); } -void AppGraphCtxProfileBegin(AppGraphCtx* context, const char* label) +void AppGraphCtxProfileBeginD3D11(AppGraphCtx* contextIn, const char* label) { - appGraphProfilerBegin(context->m_profiler, label); + auto context = cast_to_AppGraphCtxD3D11(contextIn); + appGraphProfilerD3D11Begin(context->m_profiler, label); } -void AppGraphCtxProfileEnd(AppGraphCtx* context, const char* label) +void AppGraphCtxProfileEndD3D11(AppGraphCtx* contextIn, const char* label) { - appGraphProfilerEnd(context->m_profiler, label); + auto context = cast_to_AppGraphCtxD3D11(contextIn); + appGraphProfilerD3D11End(context->m_profiler, label); } -bool AppGraphCtxProfileGet(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index) +bool AppGraphCtxProfileGetD3D11(AppGraphCtx* contextIn, const char** plabel, float* cpuTime, float* gpuTime, int index) { - return appGraphProfilerGet(context->m_profiler, plabel, cpuTime, gpuTime, index); + auto context = cast_to_AppGraphCtxD3D11(contextIn); + return appGraphProfilerD3D11Get(context->m_profiler, plabel, cpuTime, gpuTime, index); } // ******************************* Profiler ********************************* @@ -549,9 +563,9 @@ namespace }; } -struct AppGraphProfiler +struct AppGraphProfilerD3D11 { - AppGraphCtx* m_context; + AppGraphCtxD3D11* m_context; int m_state = 0; bool m_enabled = false; @@ -568,30 +582,30 @@ struct AppGraphProfiler TimerValue m_timerValues[m_timersCap]; int m_timerValuesSize = 0; - AppGraphProfiler(AppGraphCtx* context); - ~AppGraphProfiler(); + AppGraphProfilerD3D11(AppGraphCtx* context); + ~AppGraphProfilerD3D11(); }; -AppGraphProfiler::AppGraphProfiler(AppGraphCtx* context) : m_context(context) +AppGraphProfilerD3D11::AppGraphProfilerD3D11(AppGraphCtx* context) : m_context(cast_to_AppGraphCtxD3D11(context)) { } -AppGraphProfiler::~AppGraphProfiler() +AppGraphProfilerD3D11::~AppGraphProfilerD3D11() { COMRelease(m_disjoint); } -AppGraphProfiler* appGraphCreateProfiler(AppGraphCtx* ctx) +AppGraphProfilerD3D11* appGraphCreateProfilerD3D11(AppGraphCtx* ctx) { - return new AppGraphProfiler(ctx); + return new AppGraphProfilerD3D11(ctx); } -void appGraphReleaseProfiler(AppGraphProfiler* profiler) +void appGraphReleaseProfiler(AppGraphProfilerD3D11* profiler) { delete profiler; } -void appGraphProfilerFrameBegin(AppGraphProfiler* p) +void appGraphProfilerD3D11FrameBegin(AppGraphProfilerD3D11* p) { p->m_frameTime = (float)p->m_frameTimer.getDeltaTime(); @@ -616,7 +630,7 @@ void appGraphProfilerFrameBegin(AppGraphProfiler* p) } } -void appGraphProfilerFrameEnd(AppGraphProfiler* p) +void appGraphProfilerD3D11FrameEnd(AppGraphProfilerD3D11* p) { if (p->m_state == 1) { @@ -628,12 +642,12 @@ void appGraphProfilerFrameEnd(AppGraphProfiler* p) } } -void appGraphProfilerEnable(AppGraphProfiler* p, bool enabled) +void appGraphProfilerD3D11Enable(AppGraphProfilerD3D11* p, bool enabled) { p->m_enabled = enabled; } -void appGraphProfilerBegin(AppGraphProfiler* p, const char* label) +void appGraphProfilerD3D11Begin(AppGraphProfilerD3D11* p, const char* label) { if (p->m_state == 1 && p->m_timersSize < p->m_timersCap) { @@ -657,7 +671,7 @@ void appGraphProfilerBegin(AppGraphProfiler* p, const char* label) } } -void appGraphProfilerEnd(AppGraphProfiler* p, const char* label) +void appGraphProfilerD3D11End(AppGraphProfilerD3D11* p, const char* label) { if (p->m_state == 1) { @@ -681,7 +695,7 @@ void appGraphProfilerEnd(AppGraphProfiler* p, const char* label) } } -bool appGraphProfilerFlush(AppGraphProfiler* p) +bool appGraphProfilerD3D11Flush(AppGraphProfilerD3D11* p) { if (p->m_state == 2) { @@ -740,9 +754,9 @@ bool appGraphProfilerFlush(AppGraphProfiler* p) return false; } -bool appGraphProfilerGet(AppGraphProfiler* p, const char** plabel, float* cpuTime, float* gpuTime, int index) +bool appGraphProfilerD3D11Get(AppGraphProfilerD3D11* p, const char** plabel, float* cpuTime, float* gpuTime, int index) { - appGraphProfilerFlush(p); + appGraphProfilerD3D11Flush(p); { if (index < p->m_timerValuesSize) { @@ -760,7 +774,8 @@ bool appGraphProfilerGet(AppGraphProfiler* p, const char** plabel, float* cpuTim return false; } -size_t AppGraphCtxDedicatedVideoMemory(AppGraphCtx* context) +size_t AppGraphCtxDedicatedVideoMemoryD3D11(AppGraphCtx* contextIn) { + auto context = cast_to_AppGraphCtxD3D11(contextIn); return context->m_dedicatedVideoMemory; } \ No newline at end of file diff --git a/demo/DemoAppD3D11/appD3D11Ctx.h b/demo/DemoAppD3D11/appD3D11Ctx.h index 578413c..c811f8b 100644 --- a/demo/DemoAppD3D11/appD3D11Ctx.h +++ b/demo/DemoAppD3D11/appD3D11Ctx.h @@ -12,9 +12,9 @@ #include "../DemoApp/appGraphCtx.h" -struct AppGraphProfiler; +struct AppGraphProfilerD3D11; -struct AppGraphCtx +struct AppGraphCtxD3D11 { HWND m_hWnd = nullptr; @@ -36,8 +36,42 @@ struct AppGraphCtx ID3D11ShaderResourceView* m_depthSRV = nullptr; ID3D11DepthStencilState* m_depthState = nullptr; - AppGraphProfiler* m_profiler = nullptr; + AppGraphProfilerD3D11* m_profiler = nullptr; - AppGraphCtx(); - ~AppGraphCtx(); -}; \ No newline at end of file + AppGraphCtxD3D11(); + ~AppGraphCtxD3D11(); +}; + +inline AppGraphCtxD3D11* cast_to_AppGraphCtxD3D11(AppGraphCtx* appctx) +{ + return (AppGraphCtxD3D11*)(appctx); +} + +inline AppGraphCtx* cast_from_AppGraphCtxD3D11(AppGraphCtxD3D11* appctx) +{ + return (AppGraphCtx*)(appctx); +} + +APP_GRAPH_CTX_API AppGraphCtx* AppGraphCtxCreateD3D11(int deviceID); + +APP_GRAPH_CTX_API bool AppGraphCtxUpdateSizeD3D11(AppGraphCtx* context, SDL_Window* window, bool fullscreen); + +APP_GRAPH_CTX_API void AppGraphCtxReleaseRenderTargetD3D11(AppGraphCtx* context); + +APP_GRAPH_CTX_API void AppGraphCtxReleaseD3D11(AppGraphCtx* context); + +APP_GRAPH_CTX_API void AppGraphCtxFrameStartD3D11(AppGraphCtx* context, AppGraphColor clearColor); + +APP_GRAPH_CTX_API void AppGraphCtxFramePresentD3D11(AppGraphCtx* context, bool fullsync); + +APP_GRAPH_CTX_API void AppGraphCtxWaitForFramesD3D11(AppGraphCtx* context, unsigned int maxFramesInFlight); + +APP_GRAPH_CTX_API void AppGraphCtxProfileEnableD3D11(AppGraphCtx* context, bool enabled); + +APP_GRAPH_CTX_API void AppGraphCtxProfileBeginD3D11(AppGraphCtx* context, const char* label); + +APP_GRAPH_CTX_API void AppGraphCtxProfileEndD3D11(AppGraphCtx* context, const char* label); + +APP_GRAPH_CTX_API bool AppGraphCtxProfileGetD3D11(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index); + +APP_GRAPH_CTX_API size_t AppGraphCtxDedicatedVideoMemoryD3D11(AppGraphCtx* context); \ No newline at end of file diff --git a/demo/DemoAppD3D11/computeContextD3D11.cpp b/demo/DemoAppD3D11/computeContextD3D11.cpp index 2f25f95..f4b4c3e 100644 --- a/demo/DemoAppD3D11/computeContextD3D11.cpp +++ b/demo/DemoAppD3D11/computeContextD3D11.cpp @@ -21,9 +21,9 @@ void inline COMRelease(T& t) t = nullptr; } -struct ComputeContext +struct ComputeContextD3D11 { - ComputeContextDesc m_desc = {}; + ComputeContextDescD3D11 m_desc = {}; ID3D11SamplerState* m_sampler0 = nullptr; ID3D11SamplerState* m_sampler1 = nullptr; @@ -32,8 +32,10 @@ struct ComputeContext ID3D11SamplerState* m_sampler4 = nullptr; ID3D11SamplerState* m_sampler5 = nullptr; - ComputeContext(const ComputeContextDesc* desc) + ComputeContextD3D11(const ComputeContextDesc* descIn) { + const auto desc = cast_to_ComputeContextDescD3D11(descIn); + m_desc = *desc; auto createSampler = [&](D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE mode) @@ -64,7 +66,7 @@ struct ComputeContext m_sampler4 = createSampler(D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT, D3D11_TEXTURE_ADDRESS_CLAMP); m_sampler5 = createSampler(D3D11_FILTER_MIN_MAG_MIP_POINT, D3D11_TEXTURE_ADDRESS_CLAMP); } - ~ComputeContext() + ~ComputeContextD3D11() { COMRelease(m_sampler0); COMRelease(m_sampler1); @@ -75,43 +77,74 @@ struct ComputeContext } }; -struct ComputeShader +inline ComputeContextD3D11* cast_to_ComputeContextD3D11(ComputeContext* ctx) +{ + return (ComputeContextD3D11*)(ctx); +} + +inline ComputeContext* cast_from_ComputeContextD3D11(ComputeContextD3D11* ctx) +{ + return (ComputeContext*)(ctx); +} + +struct ComputeShaderD3D11 { ID3D11ComputeShader* m_shader = nullptr; - ComputeShader(ID3D11ComputeShader* shader) + ComputeShaderD3D11(ID3D11ComputeShader* shader) { m_shader = shader; } - ~ComputeShader() + ~ComputeShaderD3D11() { COMRelease(m_shader); } }; -struct ComputeConstantBuffer +inline ComputeShaderD3D11* cast_to_ComputeShaderD3D11(ComputeShader* ctx) +{ + return (ComputeShaderD3D11*)(ctx); +} + +inline ComputeShader* cast_from_ComputeShaderD3D11(ComputeShaderD3D11* ctx) +{ + return (ComputeShader*)(ctx); +} + +struct ComputeConstantBufferD3D11 { ID3D11Buffer* m_buffer; - ComputeConstantBuffer(ID3D11Buffer* buffer) + ComputeConstantBufferD3D11(ID3D11Buffer* buffer) { m_buffer = buffer; } - ~ComputeConstantBuffer() + ~ComputeConstantBufferD3D11() { COMRelease(m_buffer); } }; -struct ComputeResource +inline ComputeConstantBufferD3D11* cast_to_ComputeConstantBufferD3D11(ComputeConstantBuffer* ctx) +{ + return (ComputeConstantBufferD3D11*)(ctx); +} + +inline ComputeConstantBuffer* cast_from_ComputeConstantBufferD3D11(ComputeConstantBufferD3D11* ctx) +{ + return (ComputeConstantBuffer*)(ctx); +} + +struct ComputeResourceD3D11 { protected: ID3D11ShaderResourceView* m_srv = nullptr; public: - void update(const ComputeResourceDesc* desc) + void update(const ComputeResourceDesc* descIn) { + const auto desc = cast_to_ComputeResourceDescD3D11(descIn); m_srv = desc->srv; } - ComputeResource(const ComputeResourceDesc* desc) + ComputeResourceD3D11(const ComputeResourceDesc* desc) { update(desc); } @@ -122,20 +155,37 @@ public: } }; -struct ComputeResourceRW : public ComputeResource +inline ComputeResourceD3D11* cast_to_ComputeResourceD3D11(ComputeResource* ctx) +{ + return (ComputeResourceD3D11*)(ctx); +} + +inline ComputeResource* cast_from_ComputeResourceD3D11(ComputeResourceD3D11* ctx) +{ + return (ComputeResource*)(ctx); +} + +struct ComputeResourceRWD3D11 : public ComputeResourceD3D11 { protected: ID3D11UnorderedAccessView* m_uav; public: - void update(const ComputeResourceRWDesc* descRW) + static const ComputeResourceRWDescD3D11* cast(const ComputeResourceRWDesc* descRW) { + return cast_to_ComputeResourceRWDescD3D11(descRW); + } + + void update(const ComputeResourceRWDesc* descRWIn) + { + const auto descRW = cast(descRWIn); m_uav = descRW->uav; - ComputeResource::update(&descRW->resource); + ComputeResourceD3D11::update(cast_from_ComputeResourceDescD3D11(&descRW->resource)); } - ComputeResourceRW(const ComputeResourceRWDesc* descRW): - ComputeResource(&descRW->resource) + ComputeResourceRWD3D11(const ComputeResourceRWDesc* descRWIn): + ComputeResourceD3D11(cast_from_ComputeResourceDescD3D11(&cast(descRWIn)->resource)) { + const auto descRW = cast(descRWIn); m_uav = descRW->uav; } @@ -145,37 +195,54 @@ public: } }; +inline ComputeResourceRWD3D11* cast_to_ComputeResourceRWD3D11(ComputeResourceRW* ctx) +{ + return (ComputeResourceRWD3D11*)(ctx); +} + +inline ComputeResourceRW* cast_from_ComputeResourceRWD3D11(ComputeResourceRWD3D11* ctx) +{ + return (ComputeResourceRW*)(ctx); +} + // ************* API functions **************** -ComputeContext* ComputeContextCreate(ComputeContextDesc* desc) +ComputeContext* ComputeContextCreateD3D11(ComputeContextDesc* desc) { - return new ComputeContext(desc); + return cast_from_ComputeContextD3D11(new ComputeContextD3D11(desc)); } -void ComputeContextUpdate(ComputeContext* context, ComputeContextDesc* desc) +void ComputeContextUpdateD3D11(ComputeContext* contextIn, ComputeContextDesc* descIn) { + auto context = cast_to_ComputeContextD3D11(contextIn); + auto desc = cast_to_ComputeContextDescD3D11(descIn); + context->m_desc = *desc; } -void ComputeContextRelease(ComputeContext* context) +void ComputeContextReleaseD3D11(ComputeContext* context) { - delete context; + delete cast_to_ComputeContextD3D11(context); } -ComputeShader* ComputeShaderCreate(ComputeContext* context, const ComputeShaderDesc* desc) +ComputeShader* ComputeShaderCreateD3D11(ComputeContext* contextIn, const ComputeShaderDesc* desc) { + auto context = cast_to_ComputeContextD3D11(contextIn); + ID3D11ComputeShader* computeShader = nullptr; context->m_desc.device->CreateComputeShader(desc->cs, desc->cs_length, nullptr, &computeShader); - return new ComputeShader(computeShader); + return cast_from_ComputeShaderD3D11(new ComputeShaderD3D11(computeShader)); } -void ComputeShaderRelease(ComputeShader* shader) +void ComputeShaderReleaseD3D11(ComputeShader* shader) { - delete shader; + delete cast_to_ComputeShaderD3D11(shader); } -ComputeConstantBuffer* ComputeConstantBufferCreate(ComputeContext* context, const ComputeConstantBufferDesc* desc) +ComputeConstantBuffer* ComputeConstantBufferCreateD3D11(ComputeContext* contextIn, const ComputeConstantBufferDesc* desc) { + auto context = cast_to_ComputeContextD3D11(contextIn); + ID3D11Buffer* constantBuffer = nullptr; { D3D11_BUFFER_DESC bufDesc; @@ -187,81 +254,94 @@ ComputeConstantBuffer* ComputeConstantBufferCreate(ComputeContext* context, cons context->m_desc.device->CreateBuffer(&bufDesc, nullptr, &constantBuffer); } - return new ComputeConstantBuffer(constantBuffer); + return cast_from_ComputeConstantBufferD3D11(new ComputeConstantBufferD3D11(constantBuffer)); } -void ComputeConstantBufferRelease(ComputeConstantBuffer* constantBuffer) +void ComputeConstantBufferReleaseD3D11(ComputeConstantBuffer* constantBuffer) { - delete constantBuffer; + delete cast_to_ComputeConstantBufferD3D11(constantBuffer); } -void* ComputeConstantBufferMap(ComputeContext* context, ComputeConstantBuffer* constantBuffer) +void* ComputeConstantBufferMapD3D11(ComputeContext* contextIn, ComputeConstantBuffer* constantBufferIn) { + auto context = cast_to_ComputeContextD3D11(contextIn); + auto constantBuffer = cast_to_ComputeConstantBufferD3D11(constantBufferIn); + D3D11_MAPPED_SUBRESOURCE mapped = {}; context->m_desc.deviceContext->Map(constantBuffer->m_buffer, 0u, D3D11_MAP_WRITE_DISCARD, 0u, &mapped); return mapped.pData; } -void ComputeConstantBufferUnmap(ComputeContext* context, ComputeConstantBuffer* constantBuffer) +void ComputeConstantBufferUnmapD3D11(ComputeContext* contextIn, ComputeConstantBuffer* constantBufferIn) { + auto context = cast_to_ComputeContextD3D11(contextIn); + auto constantBuffer = cast_to_ComputeConstantBufferD3D11(constantBufferIn); + context->m_desc.deviceContext->Unmap(constantBuffer->m_buffer, 0u); } -ComputeResource* ComputeResourceCreate(ComputeContext* context, const ComputeResourceDesc* desc) +ComputeResource* ComputeResourceCreateD3D11(ComputeContext* context, const ComputeResourceDesc* desc) { - return new ComputeResource(desc); + return cast_from_ComputeResourceD3D11(new ComputeResourceD3D11(desc)); } -void ComputeResourceUpdate(ComputeContext* context, ComputeResource* resource, const ComputeResourceDesc* desc) +void ComputeResourceUpdateD3D11(ComputeContext* context, ComputeResource* resourceIn, const ComputeResourceDesc* desc) { + auto resource = cast_to_ComputeResourceD3D11(resourceIn); + resource->update(desc); } -void ComputeResourceRelease(ComputeResource* resource) +void ComputeResourceReleaseD3D11(ComputeResource* resource) { - delete resource; + delete cast_to_ComputeResourceD3D11(resource); } -ComputeResourceRW* ComputeResourceRWCreate(ComputeContext* context, const ComputeResourceRWDesc* desc) +ComputeResourceRW* ComputeResourceRWCreateD3D11(ComputeContext* context, const ComputeResourceRWDesc* desc) { - return new ComputeResourceRW(desc); + return cast_from_ComputeResourceRWD3D11(new ComputeResourceRWD3D11(desc)); } -void ComputeResourceRWUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, const ComputeResourceRWDesc* desc) +void ComputeResourceRWUpdateD3D11(ComputeContext* context, ComputeResourceRW* resourceRWIn, const ComputeResourceRWDesc* desc) { + auto resourceRW = cast_to_ComputeResourceRWD3D11(resourceRWIn); + resourceRW->update(desc); } -void ComputeResourceRWRelease(ComputeResourceRW* resourceRW) +void ComputeResourceRWReleaseD3D11(ComputeResourceRW* resourceRW) { - delete resourceRW; + delete cast_to_ComputeResourceRWD3D11(resourceRW); } -ComputeResource* ComputeResourceRWGetResource(ComputeResourceRW* resourceRW) +ComputeResource* ComputeResourceRWGetResourceD3D11(ComputeResourceRW* resourceRWIn) { - return static_cast(resourceRW); + auto resourceRW = cast_to_ComputeResourceRWD3D11(resourceRWIn); + return cast_from_ComputeResourceD3D11(static_cast(resourceRW)); } -void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams* params) +void ComputeContextDispatchD3D11(ComputeContext* contextIn, const ComputeDispatchParams* params) { + auto context = cast_to_ComputeContextD3D11(contextIn); + auto& deviceContext = context->m_desc.deviceContext; - if (params->shader) deviceContext->CSSetShader(params->shader->m_shader, nullptr, 0u); + if (params->shader) deviceContext->CSSetShader(cast_to_ComputeShaderD3D11(params->shader)->m_shader, nullptr, 0u); ID3D11ShaderResourceView* srvs[ComputeDispatchMaxResources] = { nullptr }; ID3D11UnorderedAccessView* uavs[ComputeDispatchMaxResourcesRW] = { nullptr }; for (unsigned int i = 0u; i < ComputeDispatchMaxResources; i++) { - if (params->resources[i]) srvs[i] = params->resources[i]->SRV(); + if (params->resources[i]) srvs[i] = cast_to_ComputeResourceD3D11(params->resources[i])->SRV(); } for (unsigned int i = 0u; i < ComputeDispatchMaxResourcesRW; i++) { - if (params->resourcesRW[i]) uavs[i] = params->resourcesRW[i]->UAV(); + if (params->resourcesRW[i]) uavs[i] = cast_to_ComputeResourceRWD3D11(params->resourcesRW[i])->UAV(); } deviceContext->CSSetShaderResources(0u, ComputeDispatchMaxResources, srvs); deviceContext->CSSetUnorderedAccessViews(0u, ComputeDispatchMaxResourcesRW, uavs, nullptr); - if (params->constantBuffer) deviceContext->CSSetConstantBuffers(0u, 1u, ¶ms->constantBuffer->m_buffer); + if (params->constantBuffer) deviceContext->CSSetConstantBuffers(0u, 1u, &cast_to_ComputeConstantBufferD3D11(params->constantBuffer)->m_buffer); ID3D11SamplerState* samplers[] = { context->m_sampler0, context->m_sampler1, context->m_sampler2, @@ -282,7 +362,7 @@ void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams #include "NvFlow.h" #include "NvFlowContextD3D11.h" -inline void updateComputeContextDesc(NvFlowContext* flowContext, ComputeContextDesc* desc) +inline void updateComputeContextDesc(NvFlowContext* flowContext, ComputeContextDescD3D11* desc) { NvFlowContextDescD3D11 srcDesc = {}; NvFlowUpdateContextDescD3D11(flowContext, &srcDesc); @@ -290,54 +370,54 @@ inline void updateComputeContextDesc(NvFlowContext* flowContext, ComputeContextD desc->deviceContext = srcDesc.deviceContext; } -ComputeContext* ComputeContextNvFlowContextCreate(NvFlowContext* flowContext) +ComputeContext* ComputeContextNvFlowContextCreateD3D11(NvFlowContext* flowContext) { - ComputeContextDesc desc = {}; + ComputeContextDescD3D11 desc = {}; updateComputeContextDesc(flowContext, &desc); - return ComputeContextCreate(&desc); + return ComputeContextCreateD3D11(cast_from_ComputeContextDescD3D11(&desc)); } -void ComputeContextNvFlowContextUpdate(ComputeContext* computeContext, NvFlowContext* flowContext) +void ComputeContextNvFlowContextUpdateD3D11(ComputeContext* computeContext, NvFlowContext* flowContext) { - ComputeContextDesc desc = {}; + ComputeContextDescD3D11 desc = {}; updateComputeContextDesc(flowContext, &desc); - ComputeContextUpdate(computeContext, &desc); + ComputeContextUpdateD3D11(computeContext, cast_from_ComputeContextDescD3D11(&desc)); } -ComputeResource* ComputeResourceNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource) +ComputeResource* ComputeResourceNvFlowCreateD3D11(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource) { NvFlowResourceViewDescD3D11 flowViewDesc = {}; NvFlowUpdateResourceViewDescD3D11(flowContext, flowResource, &flowViewDesc); - ComputeResourceDesc desc = {}; + ComputeResourceDescD3D11 desc = {}; desc.srv = flowViewDesc.srv; - return ComputeResourceCreate(context, &desc); + return ComputeResourceCreateD3D11(context, cast_from_ComputeResourceDescD3D11(&desc)); } -void ComputeResourceNvFlowUpdate(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource) +void ComputeResourceNvFlowUpdateD3D11(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource) { NvFlowResourceViewDescD3D11 flowViewDesc = {}; NvFlowUpdateResourceViewDescD3D11(flowContext, flowResource, &flowViewDesc); - ComputeResourceDesc desc = {}; + ComputeResourceDescD3D11 desc = {}; desc.srv = flowViewDesc.srv; - ComputeResourceUpdate(context, resource, &desc); + ComputeResourceUpdateD3D11(context, resource, cast_from_ComputeResourceDescD3D11(&desc)); } -ComputeResourceRW* ComputeResourceRWNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) +ComputeResourceRW* ComputeResourceRWNvFlowCreateD3D11(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) { NvFlowResourceRWViewDescD3D11 flowViewDesc = {}; NvFlowUpdateResourceRWViewDescD3D11(flowContext, flowResourceRW, &flowViewDesc); - ComputeResourceRWDesc desc = {}; + ComputeResourceRWDescD3D11 desc = {}; desc.resource.srv = flowViewDesc.resourceView.srv; desc.uav = flowViewDesc.uav; - return ComputeResourceRWCreate(context, &desc); + return ComputeResourceRWCreateD3D11(context, cast_from_ComputeResourceRWDescD3D11(&desc)); } -void ComputeResourceRWNvFlowUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) +void ComputeResourceRWNvFlowUpdateD3D11(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) { NvFlowResourceRWViewDescD3D11 flowViewDesc = {}; NvFlowUpdateResourceRWViewDescD3D11(flowContext, flowResourceRW, &flowViewDesc); - ComputeResourceRWDesc desc = {}; + ComputeResourceRWDescD3D11 desc = {}; desc.resource.srv = flowViewDesc.resourceView.srv; desc.uav = flowViewDesc.uav; - ComputeResourceRWUpdate(context, resourceRW, &desc); + ComputeResourceRWUpdateD3D11(context, resourceRW, cast_from_ComputeResourceRWDescD3D11(&desc)); } \ No newline at end of file diff --git a/demo/DemoAppD3D11/computeContextD3D11.h b/demo/DemoAppD3D11/computeContextD3D11.h index 43ad5b1..a8a2189 100644 --- a/demo/DemoAppD3D11/computeContextD3D11.h +++ b/demo/DemoAppD3D11/computeContextD3D11.h @@ -12,19 +12,95 @@ #include "../DemoApp/computeContext.h" -struct ComputeContextDesc +struct ComputeContextDescD3D11 { ID3D11Device* device; ID3D11DeviceContext* deviceContext; }; -struct ComputeResourceDesc +struct ComputeResourceDescD3D11 { ID3D11ShaderResourceView* srv; }; -struct ComputeResourceRWDesc +struct ComputeResourceRWDescD3D11 { - ComputeResourceDesc resource; + ComputeResourceDescD3D11 resource; ID3D11UnorderedAccessView* uav; -}; \ No newline at end of file +}; + +inline const ComputeContextDescD3D11* cast_to_ComputeContextDescD3D11(const ComputeContextDesc* desc) +{ + return (const ComputeContextDescD3D11*)(desc); +} + +inline ComputeContextDesc* cast_from_ComputeContextDescD3D11(ComputeContextDescD3D11* desc) +{ + return (ComputeContextDesc*)(desc); +} + +inline const ComputeResourceDescD3D11* cast_to_ComputeResourceDescD3D11(const ComputeResourceDesc* desc) +{ + return (const ComputeResourceDescD3D11*)(desc); +} + +inline const ComputeResourceDesc* cast_from_ComputeResourceDescD3D11(const ComputeResourceDescD3D11* desc) +{ + return (const ComputeResourceDesc*)(desc); +} + +inline const ComputeResourceRWDescD3D11* cast_to_ComputeResourceRWDescD3D11(const ComputeResourceRWDesc* desc) +{ + return (const ComputeResourceRWDescD3D11*)(desc); +} + +inline ComputeResourceRWDesc* cast_from_ComputeResourceRWDescD3D11(ComputeResourceRWDescD3D11* desc) +{ + return (ComputeResourceRWDesc*)(desc); +} + +COMPUTE_API ComputeContext* ComputeContextCreateD3D11(ComputeContextDesc* desc); + +COMPUTE_API void ComputeContextUpdateD3D11(ComputeContext* context, ComputeContextDesc* desc); + +COMPUTE_API void ComputeContextReleaseD3D11(ComputeContext* context); + +COMPUTE_API ComputeShader* ComputeShaderCreateD3D11(ComputeContext* context, const ComputeShaderDesc* desc); + +COMPUTE_API void ComputeShaderReleaseD3D11(ComputeShader* shader); + +COMPUTE_API ComputeConstantBuffer* ComputeConstantBufferCreateD3D11(ComputeContext* context, const ComputeConstantBufferDesc* desc); + +COMPUTE_API void ComputeConstantBufferReleaseD3D11(ComputeConstantBuffer* constantBuffer); + +COMPUTE_API void* ComputeConstantBufferMapD3D11(ComputeContext* context, ComputeConstantBuffer* constantBuffer); + +COMPUTE_API void ComputeConstantBufferUnmapD3D11(ComputeContext* context, ComputeConstantBuffer* constantBuffer); + +COMPUTE_API ComputeResource* ComputeResourceCreateD3D11(ComputeContext* context, const ComputeResourceDesc* desc); + +COMPUTE_API void ComputeResourceUpdateD3D11(ComputeContext* context, ComputeResource* resource, const ComputeResourceDesc* desc); + +COMPUTE_API void ComputeResourceReleaseD3D11(ComputeResource* resource); + +COMPUTE_API ComputeResourceRW* ComputeResourceRWCreateD3D11(ComputeContext* context, const ComputeResourceRWDesc* desc); + +COMPUTE_API void ComputeResourceRWUpdateD3D11(ComputeContext* context, ComputeResourceRW* resourceRW, const ComputeResourceRWDesc* desc); + +COMPUTE_API void ComputeResourceRWReleaseD3D11(ComputeResourceRW* resourceRW); + +COMPUTE_API ComputeResource* ComputeResourceRWGetResourceD3D11(ComputeResourceRW* resourceRW); + +COMPUTE_API void ComputeContextDispatchD3D11(ComputeContext* context, const ComputeDispatchParams* params); + +COMPUTE_API ComputeContext* ComputeContextNvFlowContextCreateD3D11(NvFlowContext* flowContext); + +COMPUTE_API void ComputeContextNvFlowContextUpdateD3D11(ComputeContext* computeContext, NvFlowContext* flowContext); + +COMPUTE_API ComputeResource* ComputeResourceNvFlowCreateD3D11(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource); + +COMPUTE_API void ComputeResourceNvFlowUpdateD3D11(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource); + +COMPUTE_API ComputeResourceRW* ComputeResourceRWNvFlowCreateD3D11(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW); + +COMPUTE_API void ComputeResourceRWNvFlowUpdateD3D11(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW); \ No newline at end of file diff --git a/demo/DemoAppD3D11/imguiGraphD3D11.cpp b/demo/DemoAppD3D11/imguiGraphD3D11.cpp index a654cf2..0cf619c 100644 --- a/demo/DemoAppD3D11/imguiGraphD3D11.cpp +++ b/demo/DemoAppD3D11/imguiGraphD3D11.cpp @@ -77,7 +77,7 @@ namespace }; } -void imguiGraphContextDestroy() +void imguiGraphContextDestroyD3D11() { COMRelease(m_rasterizerState); COMRelease(m_samplerState); @@ -89,8 +89,10 @@ void imguiGraphContextDestroy() COMRelease(m_vertexBuffer); } -void imguiGraphContextInit(const ImguiGraphDesc* desc) +void imguiGraphContextInitD3D11(const ImguiGraphDesc* descIn) { + const auto desc = cast_to_imguiGraphDescD3D11(descIn); + m_device = desc->device; m_deviceContext = desc->deviceContext; m_winW = desc->winW; @@ -202,15 +204,17 @@ void imguiGraphContextInit(const ImguiGraphDesc* desc) } } -void imguiGraphContextUpdate(const ImguiGraphDesc* desc) +void imguiGraphContextUpdateD3D11(const ImguiGraphDesc* descIn) { + const auto desc = cast_to_imguiGraphDescD3D11(descIn); + m_device = desc->device; m_deviceContext = desc->deviceContext; m_winW = desc->winW; m_winH = desc->winH; } -void imguiGraphRecordBegin() +void imguiGraphRecordBeginD3D11() { Params params = { 2.f / float(m_winW), 0.f, 0.f, -1.f, @@ -318,7 +322,7 @@ static void imguiGraphFlush() } } -void imguiGraphRecordEnd() +void imguiGraphRecordEndD3D11() { ID3D11DeviceContext* context = m_deviceContext; @@ -340,7 +344,7 @@ void imguiGraphRecordEnd() context->RSSetState(nullptr); } -void imguiGraphEnableScissor(int x, int y, int width, int height) +void imguiGraphEnableScissorD3D11(int x, int y, int width, int height) { // mark end of last region m_stateScissor.stopIdx = m_stateVertIdx; @@ -355,7 +359,7 @@ void imguiGraphEnableScissor(int x, int y, int width, int height) m_stateScissor.height = height; } -void imguiGraphDisableScissor() +void imguiGraphDisableScissorD3D11() { if (m_stateVertIdx == 0) return; @@ -372,13 +376,13 @@ void imguiGraphDisableScissor() m_stateScissor.height = m_winH; } -void imguiGraphVertex2f(float x, float y) +void imguiGraphVertex2fD3D11(float x, float y) { float v[2] = { x,y }; - imguiGraphVertex2fv(v); + imguiGraphVertex2fvD3D11(v); } -void imguiGraphVertex2fv(const float* v) +void imguiGraphVertex2fvD3D11(const float* v) { // update state m_stateVert.x = v[0]; @@ -393,13 +397,13 @@ void imguiGraphVertex2fv(const float* v) } } -void imguiGraphTexCoord2f(float u, float v) +void imguiGraphTexCoord2fD3D11(float u, float v) { m_stateVert.u = u; m_stateVert.v = v; } -void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) +void imguiGraphColor4ubD3D11(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) { m_stateVert.rgba[0] = red; m_stateVert.rgba[1] = green; @@ -407,7 +411,7 @@ void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) m_stateVert.rgba[3] = alpha; } -void imguiGraphColor4ubv(const uint8_t* v) +void imguiGraphColor4ubvD3D11(const uint8_t* v) { m_stateVert.rgba[0] = v[0]; m_stateVert.rgba[1] = v[1]; @@ -415,18 +419,18 @@ void imguiGraphColor4ubv(const uint8_t* v) m_stateVert.rgba[3] = v[3]; } -void imguiGraphFontTextureEnable() +void imguiGraphFontTextureEnableD3D11() { } -void imguiGraphFontTextureDisable() +void imguiGraphFontTextureDisableD3D11() { m_stateVert.u = -1.f; m_stateVert.v = -1.f; } -void imguiGraphFontTextureInit(unsigned char* data) +void imguiGraphFontTextureInitD3D11(unsigned char* data) { ID3D11DeviceContext* context = m_deviceContext; @@ -465,7 +469,7 @@ void imguiGraphFontTextureInit(unsigned char* data) } -void imguiGraphFontTextureRelease() +void imguiGraphFontTextureReleaseD3D11() { COMRelease(m_texture); COMRelease(m_textureSRV); diff --git a/demo/DemoAppD3D11/imguiGraphD3D11.h b/demo/DemoAppD3D11/imguiGraphD3D11.h index 54e022f..cb3f864 100644 --- a/demo/DemoAppD3D11/imguiGraphD3D11.h +++ b/demo/DemoAppD3D11/imguiGraphD3D11.h @@ -18,7 +18,7 @@ struct ID3D11Device; struct ID3D11DeviceContext; -struct ImguiGraphDesc +struct ImguiGraphDescD3D11 { ID3D11Device* device = nullptr; ID3D11DeviceContext* deviceContext = nullptr; @@ -27,7 +27,49 @@ struct ImguiGraphDesc uint32_t maxVertices = 64 * 4096u; - ImguiGraphDesc() {} + ImguiGraphDescD3D11() {} }; +inline const ImguiGraphDescD3D11* cast_to_imguiGraphDescD3D11(const ImguiGraphDesc* desc) +{ + return (const ImguiGraphDescD3D11*)(desc); +} + +inline ImguiGraphDesc* cast_from_imguiGraphDescD3D11(ImguiGraphDescD3D11* desc) +{ + return (ImguiGraphDesc*)(desc); +} + +IMGUI_GRAPH_API void imguiGraphContextInitD3D11(const ImguiGraphDesc* desc); + +IMGUI_GRAPH_API void imguiGraphContextUpdateD3D11(const ImguiGraphDesc* desc); + +IMGUI_GRAPH_API void imguiGraphContextDestroyD3D11(); + +IMGUI_GRAPH_API void imguiGraphRecordBeginD3D11(); + +IMGUI_GRAPH_API void imguiGraphRecordEndD3D11(); + +IMGUI_GRAPH_API void imguiGraphVertex2fD3D11(float x, float y); + +IMGUI_GRAPH_API void imguiGraphVertex2fvD3D11(const float* v); + +IMGUI_GRAPH_API void imguiGraphTexCoord2fD3D11(float u, float v); + +IMGUI_GRAPH_API void imguiGraphColor4ubD3D11(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha); + +IMGUI_GRAPH_API void imguiGraphColor4ubvD3D11(const uint8_t* v); + +IMGUI_GRAPH_API void imguiGraphFontTextureEnableD3D11(); + +IMGUI_GRAPH_API void imguiGraphFontTextureDisableD3D11(); + +IMGUI_GRAPH_API void imguiGraphEnableScissorD3D11(int x, int y, int width, int height); + +IMGUI_GRAPH_API void imguiGraphDisableScissorD3D11(); + +IMGUI_GRAPH_API void imguiGraphFontTextureInitD3D11(unsigned char* data); + +IMGUI_GRAPH_API void imguiGraphFontTextureReleaseD3D11(); + #endif \ No newline at end of file diff --git a/demo/DemoAppD3D11/imguiInteropD3D11.cpp b/demo/DemoAppD3D11/imguiInteropD3D11.cpp index 9989aeb..ba8d740 100644 --- a/demo/DemoAppD3D11/imguiInteropD3D11.cpp +++ b/demo/DemoAppD3D11/imguiInteropD3D11.cpp @@ -19,24 +19,32 @@ #include "appD3D11Ctx.h" #include "imguiGraphD3D11.h" -bool imguiInteropGraphInit(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx) +IMGUI_GRAPH_API bool imguiInteropGraphInitD3D11(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx); + +IMGUI_GRAPH_API void imguiInteropGraphUpdateD3D11(imguiGraphUpdate_t func, AppGraphCtx* appctx); + +bool imguiInteropGraphInitD3D11(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctxIn) { - ImguiGraphDesc desc; + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + + ImguiGraphDescD3D11 desc; desc.device = appctx->m_device; desc.deviceContext = appctx->m_deviceContext; desc.winW = appctx->m_winW; desc.winH = appctx->m_winH; - return func(fontpath, &desc); + return func(fontpath, cast_from_imguiGraphDescD3D11(&desc)); } -void imguiInteropGraphUpdate(imguiGraphUpdate_t func, AppGraphCtx* appctx) +void imguiInteropGraphUpdateD3D11(imguiGraphUpdate_t func, AppGraphCtx* appctxIn) { - ImguiGraphDesc desc; + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + + ImguiGraphDescD3D11 desc; desc.device = appctx->m_device; desc.deviceContext = appctx->m_deviceContext; desc.winW = appctx->m_winW; desc.winH = appctx->m_winH; - return func(&desc); + return func(cast_from_imguiGraphDescD3D11(&desc)); } \ No newline at end of file diff --git a/demo/DemoAppD3D11/meshD3D11.cpp b/demo/DemoAppD3D11/meshD3D11.cpp index 2b119bb..5c84cfa 100644 --- a/demo/DemoAppD3D11/meshD3D11.cpp +++ b/demo/DemoAppD3D11/meshD3D11.cpp @@ -31,7 +31,7 @@ namespace } } -struct MeshContext +struct MeshContextD3D11 { ID3D11Device* m_device = nullptr; ID3D11DeviceContext* m_deviceContext = nullptr; @@ -42,8 +42,8 @@ struct MeshContext ID3D11Buffer* m_constantBuffer = nullptr; ID3D11RasterizerState* m_rasterizerStateRH = nullptr; - MeshContext() {} - ~MeshContext() + MeshContextD3D11() {} + ~MeshContextD3D11() { COMRelease(m_inputLayout); COMRelease(m_meshVS); @@ -53,33 +53,65 @@ struct MeshContext } }; -struct MeshIndexBuffer +inline MeshContextD3D11* cast_to_MeshContextD3D11(MeshContext* ctx) +{ + return (MeshContextD3D11*)(ctx); +} + +inline MeshContext* cast_from_MeshContextD3D11(MeshContextD3D11* ctx) +{ + return (MeshContext*)(ctx); +} + +struct MeshIndexBufferD3D11 { ID3D11Buffer* m_buffer = nullptr; MeshUint m_numElements = 0u; - MeshIndexBuffer() {} - ~MeshIndexBuffer() + MeshIndexBufferD3D11() {} + ~MeshIndexBufferD3D11() { COMRelease(m_buffer); } }; -struct MeshVertexBuffer +inline MeshIndexBufferD3D11* cast_to_MeshIndexBufferD3D11(MeshIndexBuffer* buf) +{ + return (MeshIndexBufferD3D11*)(buf); +} + +inline MeshIndexBuffer* cast_from_MeshIndexBufferD3D11(MeshIndexBufferD3D11* buf) +{ + return (MeshIndexBuffer*)(buf); +} + +struct MeshVertexBufferD3D11 { ID3D11Buffer* m_buffer = nullptr; MeshUint m_numElements = 0u; - MeshVertexBuffer() {} - ~MeshVertexBuffer() + MeshVertexBufferD3D11() {} + ~MeshVertexBufferD3D11() { COMRelease(m_buffer); } }; -MeshContext* MeshContextCreate(const MeshContextDesc* desc) +inline MeshVertexBufferD3D11* cast_to_MeshVertexBufferD3D11(MeshVertexBuffer* buf) { - MeshContext* context = new MeshContext; + return (MeshVertexBufferD3D11*)(buf); +} + +inline MeshVertexBuffer* cast_from_MeshVertexBufferD3D11(MeshVertexBufferD3D11* buf) +{ + return (MeshVertexBuffer*)(buf); +} + +MeshContext* MeshContextCreateD3D11(const MeshContextDesc* descIn) +{ + auto desc = cast_to_MeshContextDescD3D11(descIn); + + MeshContextD3D11* context = new MeshContextD3D11; context->m_device = desc->device; context->m_deviceContext = desc->context; @@ -128,25 +160,30 @@ MeshContext* MeshContextCreate(const MeshContextDesc* desc) context->m_device->CreateRasterizerState(&desc, &context->m_rasterizerStateRH); } - return context; + return cast_from_MeshContextD3D11(context); } -void MeshContextUpdate(MeshContext* context, const MeshContextDesc* desc) +void MeshContextUpdateD3D11(MeshContext* contextIn, const MeshContextDesc* descIn) { + auto context = cast_to_MeshContextD3D11(contextIn); + auto desc = cast_to_MeshContextDescD3D11(descIn); + context->m_device = desc->device; context->m_deviceContext = desc->context; } -void MeshContextRelease(MeshContext* context) +void MeshContextReleaseD3D11(MeshContext* context) { if (context == nullptr) return; - delete context; + delete cast_to_MeshContextD3D11(context); } -MeshIndexBuffer* MeshIndexBufferCreate(MeshContext* context, MeshUint* indices, MeshUint numIndices) +MeshIndexBuffer* MeshIndexBufferCreateD3D11(MeshContext* contextIn, MeshUint* indices, MeshUint numIndices) { - MeshIndexBuffer* buffer = new MeshIndexBuffer; + auto context = cast_to_MeshContextD3D11(contextIn); + + MeshIndexBufferD3D11* buffer = new MeshIndexBufferD3D11; buffer->m_numElements = numIndices; // create an index buffer @@ -166,19 +203,21 @@ MeshIndexBuffer* MeshIndexBufferCreate(MeshContext* context, MeshUint* indices, context->m_device->CreateBuffer(&bufDesc, &data, &buffer->m_buffer); } - return buffer; + return cast_from_MeshIndexBufferD3D11(buffer); } -void MeshIndexBufferRelease(MeshIndexBuffer* buffer) +void MeshIndexBufferReleaseD3D11(MeshIndexBuffer* buffer) { if (buffer == nullptr) return; - delete buffer; + delete cast_to_MeshIndexBufferD3D11(buffer); } -MeshVertexBuffer* MeshVertexBufferCreate(MeshContext* context, MeshVertex* vertices, MeshUint numVertices) +MeshVertexBuffer* MeshVertexBufferCreateD3D11(MeshContext* contextIn, MeshVertex* vertices, MeshUint numVertices) { - MeshVertexBuffer* buffer = new MeshVertexBuffer; + auto context = cast_to_MeshContextD3D11(contextIn); + + MeshVertexBufferD3D11* buffer = new MeshVertexBufferD3D11; buffer->m_numElements = numVertices; // create a vertex buffer @@ -198,18 +237,20 @@ MeshVertexBuffer* MeshVertexBufferCreate(MeshContext* context, MeshVertex* verti context->m_device->CreateBuffer(&bufDesc, &data, &buffer->m_buffer); } - return buffer; + return cast_from_MeshVertexBufferD3D11(buffer); } -void MeshVertexBufferRelease(MeshVertexBuffer* buffer) +void MeshVertexBufferReleaseD3D11(MeshVertexBuffer* buffer) { if (buffer == nullptr) return; - delete buffer; + delete cast_to_MeshVertexBufferD3D11(buffer); } -void MeshContextDraw(MeshContext* context, const MeshContextDrawParams* params) +void MeshContextDrawD3D11(MeshContext* contextIn, const MeshContextDrawParams* params) { + auto context = cast_to_MeshContextD3D11(contextIn); + using namespace DirectX; XMMATRIX matrix = XMMatrixTranspose(XMMatrixMultiply(XMMatrixMultiply( @@ -242,8 +283,8 @@ void MeshContextDraw(MeshContext* context, const MeshContextDrawParams* params) UINT vertexStride = sizeof(MeshVertex); UINT offset = 0u; - deviceContext->IASetVertexBuffers(0, 1, ¶ms->vertexBuffer->m_buffer, &vertexStride, &offset); - deviceContext->IASetIndexBuffer(params->indexBuffer->m_buffer, DXGI_FORMAT_R32_UINT, 0u); + deviceContext->IASetVertexBuffers(0, 1, &cast_to_MeshVertexBufferD3D11(params->vertexBuffer)->m_buffer, &vertexStride, &offset); + deviceContext->IASetIndexBuffer(cast_to_MeshIndexBufferD3D11(params->indexBuffer)->m_buffer, DXGI_FORMAT_R32_UINT, 0u); float depthSign = DirectX::XMVectorGetW(params->params->projection.r[2]); if (depthSign < 0.f) @@ -251,7 +292,7 @@ void MeshContextDraw(MeshContext* context, const MeshContextDrawParams* params) deviceContext->RSSetState(context->m_rasterizerStateRH); } - deviceContext->DrawIndexed((UINT)params->indexBuffer->m_numElements, 0, 0); + deviceContext->DrawIndexed((UINT)cast_to_MeshIndexBufferD3D11(params->indexBuffer)->m_numElements, 0, 0); if (depthSign < 0.f) { diff --git a/demo/DemoAppD3D11/meshD3D11.h b/demo/DemoAppD3D11/meshD3D11.h index 86efe6b..c756d76 100644 --- a/demo/DemoAppD3D11/meshD3D11.h +++ b/demo/DemoAppD3D11/meshD3D11.h @@ -12,8 +12,35 @@ #include "../DemoApp/mesh.h" -struct MeshContextDesc +struct MeshContextDescD3D11 { ID3D11Device* device; ID3D11DeviceContext* context; -}; \ No newline at end of file +}; + +inline const MeshContextDescD3D11* cast_to_MeshContextDescD3D11(const MeshContextDesc* desc) +{ + return (const MeshContextDescD3D11*)(desc); +} + +inline MeshContextDesc* cast_from_MeshContextDescD3D11(MeshContextDescD3D11* desc) +{ + return (MeshContextDesc*)(desc); +} + +MESH_API MeshContext* MeshContextCreateD3D11(const MeshContextDesc* desc); + +MESH_API void MeshContextUpdateD3D11(MeshContext* context, const MeshContextDesc* desc); + +MESH_API void MeshContextReleaseD3D11(MeshContext* context); + + +MESH_API MeshIndexBuffer* MeshIndexBufferCreateD3D11(MeshContext* context, MeshUint* indices, MeshUint numIndices); + +MESH_API void MeshIndexBufferReleaseD3D11(MeshIndexBuffer* buffer); + +MESH_API MeshVertexBuffer* MeshVertexBufferCreateD3D11(MeshContext* context, MeshVertex* vertices, MeshUint numVertices); + +MESH_API void MeshVertexBufferReleaseD3D11(MeshVertexBuffer* buffer); + +MESH_API void MeshContextDrawD3D11(MeshContext* context, const MeshContextDrawParams* params); \ No newline at end of file diff --git a/demo/DemoAppD3D11/meshInteropD3D11.cpp b/demo/DemoAppD3D11/meshInteropD3D11.cpp index 5ab9a90..40d2473 100644 --- a/demo/DemoAppD3D11/meshInteropD3D11.cpp +++ b/demo/DemoAppD3D11/meshInteropD3D11.cpp @@ -19,20 +19,28 @@ #include "appD3D11Ctx.h" #include "meshD3D11.h" -MeshContext* MeshInteropContextCreate(AppGraphCtx* appctx) +MESH_API MeshContext* MeshInteropContextCreateD3D11(AppGraphCtx* appctx); + +MESH_API void MeshInteropContextUpdateD3D11(MeshContext* context, AppGraphCtx* appctx); + +MeshContext* MeshInteropContextCreateD3D11(AppGraphCtx* appctxIn) { - MeshContextDesc desc = {}; + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + + MeshContextDescD3D11 desc = {}; desc.device = appctx->m_device; desc.context = appctx->m_deviceContext; - return MeshContextCreate(&desc); + return MeshContextCreateD3D11(cast_from_MeshContextDescD3D11(&desc)); } -void MeshInteropContextUpdate(MeshContext* context, AppGraphCtx* appctx) +void MeshInteropContextUpdateD3D11(MeshContext* context, AppGraphCtx* appctxIn) { - MeshContextDesc desc = {}; + auto appctx = cast_to_AppGraphCtxD3D11(appctxIn); + + MeshContextDescD3D11 desc = {}; desc.device = appctx->m_device; desc.context = appctx->m_deviceContext; - return MeshContextUpdate(context, &desc); + return MeshContextUpdateD3D11(context, cast_from_MeshContextDescD3D11(&desc)); } \ No newline at end of file diff --git a/demo/DemoAppD3D12/NvFlowInteropD3D12.cpp b/demo/DemoAppD3D12/NvFlowInteropD3D12.cpp index ce79bcc..ecb13d8 100644 --- a/demo/DemoAppD3D12/NvFlowInteropD3D12.cpp +++ b/demo/DemoAppD3D12/NvFlowInteropD3D12.cpp @@ -15,9 +15,21 @@ #include "NvFlowContextD3D12.h" #include "appD3D12Ctx.h" +NV_FLOW_API NvFlowContext* NvFlowInteropCreateContextD3D12(AppGraphCtx* appctx); + +NV_FLOW_API NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilViewD3D12(AppGraphCtx* appctx, NvFlowContext* flowctx); + +NV_FLOW_API NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetViewD3D12(AppGraphCtx* appctx, NvFlowContext* flowctx); + +NV_FLOW_API void NvFlowInteropUpdateContextD3D12(NvFlowContext* context, AppGraphCtx* appctx); + +NV_FLOW_API void NvFlowInteropUpdateDepthStencilViewD3D12(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx); + +NV_FLOW_API void NvFlowInteropUpdateRenderTargetViewD3D12(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx); + NvFlowDescriptorReserveHandleD3D12 NvFlowInteropReserveDescriptors(void* userdata, NvFlowUint numDescriptors, NvFlowUint64 lastFenceCompleted, NvFlowUint64 nextFenceValue) { - auto appctx = static_cast(userdata); + auto appctx = cast_to_AppGraphCtxD3D12((AppGraphCtx*)userdata); auto srcHandle = appctx->m_dynamicHeapCbvSrvUav.reserveDescriptors(numDescriptors, lastFenceCompleted, nextFenceValue); NvFlowDescriptorReserveHandleD3D12 handle = {}; handle.heap = srcHandle.heap; @@ -27,8 +39,10 @@ NvFlowDescriptorReserveHandleD3D12 NvFlowInteropReserveDescriptors(void* userdat return handle; } -void NvFlowInteropUpdateContextDesc(NvFlowContextDescD3D12* desc, AppGraphCtx* appctx) +void NvFlowInteropUpdateContextDesc(NvFlowContextDescD3D12* desc, AppGraphCtx* appctxIn) { + auto appctx = cast_to_AppGraphCtxD3D12(appctxIn); + desc->device = appctx->m_device; desc->commandQueue = appctx->m_commandQueue; desc->commandQueueFence = appctx->m_fence; @@ -40,28 +54,36 @@ void NvFlowInteropUpdateContextDesc(NvFlowContextDescD3D12* desc, AppGraphCtx* a desc->dynamicHeapCbvSrvUav.reserveDescriptors = NvFlowInteropReserveDescriptors; } -NvFlowContext* NvFlowInteropCreateContext(AppGraphCtx* appctx) +NvFlowContext* NvFlowInteropCreateContextD3D12(AppGraphCtx* appctx) { NvFlowContextDescD3D12 desc = {}; NvFlowInteropUpdateContextDesc(&desc, appctx); return NvFlowCreateContextD3D12(NV_FLOW_VERSION, &desc); } -NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilView(AppGraphCtx* appctx, NvFlowContext* flowctx) +NvFlowDepthStencilView* NvFlowInteropCreateDepthStencilViewD3D12(AppGraphCtx* appctxIn, NvFlowContext* flowctx) { + auto appctx = cast_to_AppGraphCtxD3D12(appctxIn); + NvFlowDepthStencilViewDescD3D12 desc = {}; desc.dsvHandle = appctx->m_current_dsvHandle; desc.dsvDesc = appctx->m_current_dsvDesc; + desc.dsvResource = appctx->m_depthStencil; + desc.dsvCurrentState = D3D12_RESOURCE_STATE_DEPTH_WRITE; + desc.srvHandle = appctx->m_current_depth_srvHandle; desc.srvDesc = appctx->m_current_depth_srvDesc; - desc.resource = appctx->m_depthStencil; - desc.currentState = D3D12_RESOURCE_STATE_DEPTH_WRITE; + desc.srvResource = appctx->m_depthStencil; + desc.srvCurrentState = D3D12_RESOURCE_STATE_DEPTH_WRITE; + desc.viewport = appctx->m_viewport; return NvFlowCreateDepthStencilViewD3D12(flowctx, &desc); } -NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetView(AppGraphCtx* appctx, NvFlowContext* flowctx) +NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetViewD3D12(AppGraphCtx* appctxIn, NvFlowContext* flowctx) { + auto appctx = cast_to_AppGraphCtxD3D12(appctxIn); + NvFlowRenderTargetViewDescD3D12 desc = {}; desc.rtvHandle = appctx->m_current_rtvHandle; desc.rtvDesc = appctx->m_current_rtvDesc; @@ -72,28 +94,36 @@ NvFlowRenderTargetView* NvFlowInteropCreateRenderTargetView(AppGraphCtx* appctx, return NvFlowCreateRenderTargetViewD3D12(flowctx, &desc); } -void NvFlowInteropUpdateContext(NvFlowContext* context, AppGraphCtx* appctx) +void NvFlowInteropUpdateContextD3D12(NvFlowContext* context, AppGraphCtx* appctx) { NvFlowContextDescD3D12 desc = {}; NvFlowInteropUpdateContextDesc(&desc, appctx); NvFlowUpdateContextD3D12(context, &desc); } -void NvFlowInteropUpdateDepthStencilView(NvFlowDepthStencilView* view, AppGraphCtx* appctx, NvFlowContext* flowctx) +void NvFlowInteropUpdateDepthStencilViewD3D12(NvFlowDepthStencilView* view, AppGraphCtx* appctxIn, NvFlowContext* flowctx) { + auto appctx = cast_to_AppGraphCtxD3D12(appctxIn); + NvFlowDepthStencilViewDescD3D12 desc = {}; desc.dsvHandle = appctx->m_current_dsvHandle; desc.dsvDesc = appctx->m_current_dsvDesc; + desc.dsvResource = appctx->m_depthStencil; + desc.dsvCurrentState = D3D12_RESOURCE_STATE_DEPTH_WRITE; + desc.srvHandle = appctx->m_current_depth_srvHandle; desc.srvDesc = appctx->m_current_depth_srvDesc; - desc.resource = appctx->m_depthStencil; - desc.currentState = D3D12_RESOURCE_STATE_DEPTH_WRITE; + desc.srvResource = appctx->m_depthStencil; + desc.srvCurrentState = D3D12_RESOURCE_STATE_DEPTH_WRITE; + desc.viewport = appctx->m_viewport; NvFlowUpdateDepthStencilViewD3D12(flowctx, view, &desc); } -void NvFlowInteropUpdateRenderTargetView(NvFlowRenderTargetView* view, AppGraphCtx* appctx, NvFlowContext* flowctx) +void NvFlowInteropUpdateRenderTargetViewD3D12(NvFlowRenderTargetView* view, AppGraphCtx* appctxIn, NvFlowContext* flowctx) { + auto appctx = cast_to_AppGraphCtxD3D12(appctxIn); + NvFlowRenderTargetViewDescD3D12 desc = {}; desc.rtvHandle = appctx->m_current_rtvHandle; desc.rtvDesc = appctx->m_current_rtvDesc; diff --git a/demo/DemoAppD3D12/appD3D12Ctx.cpp b/demo/DemoAppD3D12/appD3D12Ctx.cpp index 8d1d7ff..1779ba1 100644 --- a/demo/DemoAppD3D12/appD3D12Ctx.cpp +++ b/demo/DemoAppD3D12/appD3D12Ctx.cpp @@ -45,25 +45,23 @@ namespace } } -AppGraphProfiler* appGraphCreateProfiler(AppGraphCtx* ctx); -void appGraphProfilerFrameBegin(AppGraphProfiler* profiler); -void appGraphProfilerFrameEnd(AppGraphProfiler* profiler); -void appGraphProfilerEnable(AppGraphProfiler* profiler, bool enabled); -void appGraphProfilerBegin(AppGraphProfiler* profiler, const char* label); -void appGraphProfilerEnd(AppGraphProfiler* profiler, const char* label); -bool appGraphProfilerGet(AppGraphProfiler* profiler, const char** plabel, float* cpuTime, float* gpuTime, int index); -void appGraphReleaseProfiler(AppGraphProfiler* profiler); - -void AppGraphCtxInitRenderTarget(AppGraphCtx* context, SDL_Window* window, bool fullscreen); - -AppGraphCtx::AppGraphCtx() +AppGraphProfilerD3D12* appGraphCreateProfilerD3D12(AppGraphCtx* ctx); +void appGraphProfilerD3D12FrameBegin(AppGraphProfilerD3D12* profiler); +void appGraphProfilerD3D12FrameEnd(AppGraphProfilerD3D12* profiler); +void appGraphProfilerD3D12Enable(AppGraphProfilerD3D12* profiler, bool enabled); +void appGraphProfilerD3D12Begin(AppGraphProfilerD3D12* profiler, const char* label); +void appGraphProfilerD3D12End(AppGraphProfilerD3D12* profiler, const char* label); +bool appGraphProfilerD3D12Get(AppGraphProfilerD3D12* profiler, const char** plabel, float* cpuTime, float* gpuTime, int index); +void appGraphReleaseProfiler(AppGraphProfilerD3D12* profiler); + +AppGraphCtxD3D12::AppGraphCtxD3D12() { - m_profiler = appGraphCreateProfiler(this); + m_profiler = appGraphCreateProfilerD3D12(cast_from_AppGraphCtxD3D12(this)); } -AppGraphCtx::~AppGraphCtx() +AppGraphCtxD3D12::~AppGraphCtxD3D12() { - AppGraphCtxReleaseRenderTarget(this); + AppGraphCtxReleaseRenderTargetD3D12(cast_from_AppGraphCtxD3D12(this)); COMRelease(m_device); COMRelease(m_commandQueue); @@ -83,9 +81,9 @@ AppGraphCtx::~AppGraphCtx() m_profiler = nullptr; } -AppGraphCtx* AppGraphCtxCreate(int deviceID) +AppGraphCtx* AppGraphCtxCreateD3D12(int deviceID) { - AppGraphCtx* context = new AppGraphCtx; + AppGraphCtxD3D12* context = new AppGraphCtxD3D12; HRESULT hr = S_OK; @@ -247,11 +245,15 @@ AppGraphCtx* AppGraphCtxCreate(int deviceID) } } - return context; + return cast_from_AppGraphCtxD3D12(context); } -bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullscreen) +void AppGraphCtxInitRenderTargetD3D12(AppGraphCtx* context, SDL_Window* window, bool fullscreen); + +bool AppGraphCtxUpdateSizeD3D12(AppGraphCtx* contextIn, SDL_Window* window, bool fullscreen) { + auto context = cast_to_AppGraphCtxD3D12(contextIn); + // TODO: fix iflip fullscreen support fullscreen = false; @@ -291,18 +293,20 @@ bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullsc if (sizeChanged) { - AppGraphCtxReleaseRenderTarget(context); + AppGraphCtxReleaseRenderTargetD3D12(cast_from_AppGraphCtxD3D12(context)); } if (sizeChanged && context->m_valid) { - AppGraphCtxInitRenderTarget(context, window, fullscreen); + AppGraphCtxInitRenderTargetD3D12(cast_from_AppGraphCtxD3D12(context), window, fullscreen); } return context->m_valid; } -void AppGraphCtxInitRenderTarget(AppGraphCtx* context, SDL_Window* window, bool fullscreen) +void AppGraphCtxInitRenderTargetD3D12(AppGraphCtx* contextIn, SDL_Window* window, bool fullscreen) { + auto context = cast_to_AppGraphCtxD3D12(contextIn); + HWND hWnd = nullptr; // get Windows handle to this SDL window SDL_SysWMinfo winInfo; @@ -473,8 +477,10 @@ void AppGraphCtxInitRenderTarget(AppGraphCtx* context, SDL_Window* window, bool } } -void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context) +void AppGraphCtxReleaseRenderTargetD3D12(AppGraphCtx* contextIn) { + auto context = cast_to_AppGraphCtxD3D12(contextIn); + if (context->m_swapChain == nullptr) { return; @@ -505,15 +511,17 @@ void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context) context->m_winH = 0u; } -void AppGraphCtxRelease(AppGraphCtx* context) +void AppGraphCtxReleaseD3D12(AppGraphCtx* context) { if (context == nullptr) return; - delete context; + delete cast_to_AppGraphCtxD3D12(context); } -void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4]) +void AppGraphCtxFrameStartD3D12(AppGraphCtx* contextIn, AppGraphColor clearColor) { + auto context = cast_to_AppGraphCtxD3D12(contextIn); + // Get back render target index context->m_renderTargetIndex = context->m_swapChain->GetCurrentBackBufferIndex(); @@ -535,7 +543,7 @@ void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4]) // reset command list with this frame's allocator context->m_commandList->Reset(context->m_commandAllocators[context->m_frameIndex], nullptr); - appGraphProfilerFrameBegin(context->m_profiler); + appGraphProfilerD3D12FrameBegin(context->m_profiler); context->m_commandList->RSSetViewports(1, &context->m_viewport); context->m_commandList->RSSetScissorRects(1, &context->m_scissorRect); @@ -555,7 +563,7 @@ void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4]) D3D12_CPU_DESCRIPTOR_HANDLE dsvHandle = context->m_dsvHeap->GetCPUDescriptorHandleForHeapStart(); context->m_commandList->OMSetRenderTargets(1, &rtvHandle, FALSE, &dsvHandle); - context->m_commandList->ClearRenderTargetView(rtvHandle, clearColor, 0, nullptr); + context->m_commandList->ClearRenderTargetView(rtvHandle, &clearColor.r, 0, nullptr); context->m_commandList->ClearDepthStencilView(dsvHandle, D3D12_CLEAR_FLAG_DEPTH, 1.f, 0, 0, nullptr); /// to simplify interop implementation @@ -565,8 +573,10 @@ void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4]) context->m_current_depth_srvHandle = context->m_depthSrvHeap->GetCPUDescriptorHandleForHeapStart(); } -void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync) +void AppGraphCtxFramePresentD3D12(AppGraphCtx* contextIn, bool fullsync) { + auto context = cast_to_AppGraphCtxD3D12(contextIn); + D3D12_RESOURCE_BARRIER barrier = {}; barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; barrier.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE; @@ -590,7 +600,7 @@ void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync) context->m_renderTargetID++; } - appGraphProfilerFrameEnd(context->m_profiler); + appGraphProfilerD3D12FrameEnd(context->m_profiler); // signal for this frame id context->m_frameID++; @@ -615,8 +625,10 @@ void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync) } } -void AppGraphCtxWaitForFrames(AppGraphCtx* context, unsigned int maxFramesInFlight) +void AppGraphCtxWaitForFramesD3D12(AppGraphCtx* contextIn, unsigned int maxFramesInFlight) { + auto context = cast_to_AppGraphCtxD3D12(contextIn); + unsigned int framesActive = maxFramesInFlight; while (framesActive >= maxFramesInFlight) { @@ -668,24 +680,28 @@ void AppGraphCtxWaitForFrames(AppGraphCtx* context, unsigned int maxFramesInFlig } } -void AppGraphCtxProfileEnable(AppGraphCtx* context, bool enabled) +void AppGraphCtxProfileEnableD3D12(AppGraphCtx* contextIn, bool enabled) { - appGraphProfilerEnable(context->m_profiler, enabled); + auto context = cast_to_AppGraphCtxD3D12(contextIn); + appGraphProfilerD3D12Enable(context->m_profiler, enabled); } -void AppGraphCtxProfileBegin(AppGraphCtx* context, const char* label) +void AppGraphCtxProfileBeginD3D12(AppGraphCtx* contextIn, const char* label) { - appGraphProfilerBegin(context->m_profiler, label); + auto context = cast_to_AppGraphCtxD3D12(contextIn); + appGraphProfilerD3D12Begin(context->m_profiler, label); } -void AppGraphCtxProfileEnd(AppGraphCtx* context, const char* label) +void AppGraphCtxProfileEndD3D12(AppGraphCtx* contextIn, const char* label) { - appGraphProfilerEnd(context->m_profiler, label); + auto context = cast_to_AppGraphCtxD3D12(contextIn); + appGraphProfilerD3D12End(context->m_profiler, label); } -bool AppGraphCtxProfileGet(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index) +bool AppGraphCtxProfileGetD3D12(AppGraphCtx* contextIn, const char** plabel, float* cpuTime, float* gpuTime, int index) { - return appGraphProfilerGet(context->m_profiler, plabel, cpuTime, gpuTime, index); + auto context = cast_to_AppGraphCtxD3D12(contextIn); + return appGraphProfilerD3D12Get(context->m_profiler, plabel, cpuTime, gpuTime, index); } // ******************************* Dynamic descriptor heap ****************************** @@ -889,9 +905,9 @@ namespace }; } -struct AppGraphProfiler +struct AppGraphProfilerD3D12 { - AppGraphCtx* m_context; + AppGraphCtxD3D12* m_context; int m_state = 0; bool m_enabled = false; @@ -906,29 +922,29 @@ struct AppGraphProfiler TimerValue m_timerValues[m_timersCap]; int m_timerValuesSize = 0; - AppGraphProfiler(AppGraphCtx* context); - ~AppGraphProfiler(); + AppGraphProfilerD3D12(AppGraphCtx* context); + ~AppGraphProfilerD3D12(); }; -AppGraphProfiler::AppGraphProfiler(AppGraphCtx* context) : m_context(context) +AppGraphProfilerD3D12::AppGraphProfilerD3D12(AppGraphCtx* context) : m_context(cast_to_AppGraphCtxD3D12(context)) { } -AppGraphProfiler::~AppGraphProfiler() +AppGraphProfilerD3D12::~AppGraphProfilerD3D12() { } -AppGraphProfiler* appGraphCreateProfiler(AppGraphCtx* ctx) +AppGraphProfilerD3D12* appGraphCreateProfilerD3D12(AppGraphCtx* ctx) { - return new AppGraphProfiler(ctx); + return new AppGraphProfilerD3D12(ctx); } -void appGraphReleaseProfiler(AppGraphProfiler* profiler) +void appGraphReleaseProfiler(AppGraphProfilerD3D12* profiler) { delete profiler; } -void appGraphProfilerFrameBegin(AppGraphProfiler* p) +void appGraphProfilerD3D12FrameBegin(AppGraphProfilerD3D12* p) { p->m_frameTime = (float)p->m_frameTimer.getDeltaTime(); @@ -940,7 +956,7 @@ void appGraphProfilerFrameBegin(AppGraphProfiler* p) } } -void appGraphProfilerFrameEnd(AppGraphProfiler* p) +void appGraphProfilerD3D12FrameEnd(AppGraphProfilerD3D12* p) { if (p->m_state == 1) { @@ -948,12 +964,12 @@ void appGraphProfilerFrameEnd(AppGraphProfiler* p) } } -void appGraphProfilerEnable(AppGraphProfiler* p, bool enabled) +void appGraphProfilerD3D12Enable(AppGraphProfilerD3D12* p, bool enabled) { p->m_enabled = enabled; } -void appGraphProfilerBegin(AppGraphProfiler* p, const char* label) +void appGraphProfilerD3D12Begin(AppGraphProfilerD3D12* p, const char* label) { if (p->m_state == 1 && p->m_timersSize < p->m_timersCap) { @@ -987,7 +1003,7 @@ void appGraphProfilerBegin(AppGraphProfiler* p, const char* label) } } -void appGraphProfilerEnd(AppGraphProfiler* p, const char* label) +void appGraphProfilerD3D12End(AppGraphProfilerD3D12* p, const char* label) { if (p->m_state == 1) { @@ -1013,7 +1029,7 @@ void appGraphProfilerEnd(AppGraphProfiler* p, const char* label) } } -bool appGraphProfilerFlush(AppGraphProfiler* p) +bool appGraphProfilerD3D12Flush(AppGraphProfilerD3D12* p) { if (p->m_state == 2) { @@ -1071,9 +1087,9 @@ bool appGraphProfilerFlush(AppGraphProfiler* p) return false; } -bool appGraphProfilerGet(AppGraphProfiler* p, const char** plabel, float* cpuTime, float* gpuTime, int index) +bool appGraphProfilerD3D12Get(AppGraphProfilerD3D12* p, const char** plabel, float* cpuTime, float* gpuTime, int index) { - appGraphProfilerFlush(p); + appGraphProfilerD3D12Flush(p); { if (index < p->m_timerValuesSize) { @@ -1091,7 +1107,8 @@ bool appGraphProfilerGet(AppGraphProfiler* p, const char** plabel, float* cpuTim return false; } -size_t AppGraphCtxDedicatedVideoMemory(AppGraphCtx* context) +size_t AppGraphCtxDedicatedVideoMemoryD3D12(AppGraphCtx* contextIn) { + auto context = cast_to_AppGraphCtxD3D12(contextIn); return context->m_dedicatedVideoMemory; } \ No newline at end of file diff --git a/demo/DemoAppD3D12/appD3D12Ctx.h b/demo/DemoAppD3D12/appD3D12Ctx.h index f6d2ba3..a20e44a 100644 --- a/demo/DemoAppD3D12/appD3D12Ctx.h +++ b/demo/DemoAppD3D12/appD3D12Ctx.h @@ -15,7 +15,7 @@ struct IDXGISwapChain3; -struct AppGraphProfiler; +struct AppGraphProfilerD3D12; struct AppDescriptorReserveHandleD3D12 { @@ -41,7 +41,7 @@ struct AppDynamicDescriptorHeapD3D12 ~AppDynamicDescriptorHeapD3D12() { release(); } }; -struct AppGraphCtx +struct AppGraphCtxD3D12 { HWND m_hWnd = nullptr; @@ -104,10 +104,44 @@ struct AppGraphCtx AppDynamicDescriptorHeapD3D12 m_dynamicHeapCbvSrvUav; - AppGraphProfiler* m_profiler = nullptr; + AppGraphProfilerD3D12* m_profiler = nullptr; - AppGraphCtx(); - ~AppGraphCtx(); + AppGraphCtxD3D12(); + ~AppGraphCtxD3D12(); }; +inline AppGraphCtxD3D12* cast_to_AppGraphCtxD3D12(AppGraphCtx* appctx) +{ + return (AppGraphCtxD3D12*)(appctx); +} + +inline AppGraphCtx* cast_from_AppGraphCtxD3D12(AppGraphCtxD3D12* appctx) +{ + return (AppGraphCtx*)(appctx); +} + +APP_GRAPH_CTX_API AppGraphCtx* AppGraphCtxCreateD3D12(int deviceID); + +APP_GRAPH_CTX_API bool AppGraphCtxUpdateSizeD3D12(AppGraphCtx* context, SDL_Window* window, bool fullscreen); + +APP_GRAPH_CTX_API void AppGraphCtxReleaseRenderTargetD3D12(AppGraphCtx* context); + +APP_GRAPH_CTX_API void AppGraphCtxReleaseD3D12(AppGraphCtx* context); + +APP_GRAPH_CTX_API void AppGraphCtxFrameStartD3D12(AppGraphCtx* context, AppGraphColor clearColor); + +APP_GRAPH_CTX_API void AppGraphCtxFramePresentD3D12(AppGraphCtx* context, bool fullsync); + +APP_GRAPH_CTX_API void AppGraphCtxWaitForFramesD3D12(AppGraphCtx* context, unsigned int maxFramesInFlight); + +APP_GRAPH_CTX_API void AppGraphCtxProfileEnableD3D12(AppGraphCtx* context, bool enabled); + +APP_GRAPH_CTX_API void AppGraphCtxProfileBeginD3D12(AppGraphCtx* context, const char* label); + +APP_GRAPH_CTX_API void AppGraphCtxProfileEndD3D12(AppGraphCtx* context, const char* label); + +APP_GRAPH_CTX_API bool AppGraphCtxProfileGetD3D12(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index); + +APP_GRAPH_CTX_API size_t AppGraphCtxDedicatedVideoMemoryD3D12(AppGraphCtx* context); + #endif \ No newline at end of file diff --git a/demo/DemoAppD3D12/computeContextD3D12.cpp b/demo/DemoAppD3D12/computeContextD3D12.cpp index f6cf26e..9e54325 100644 --- a/demo/DemoAppD3D12/computeContextD3D12.cpp +++ b/demo/DemoAppD3D12/computeContextD3D12.cpp @@ -250,9 +250,9 @@ struct ComputeContextUserData virtual void Release() = 0; }; -struct ComputeContext +struct ComputeContextD3D12 { - ComputeContextDesc m_desc = {}; + ComputeContextDescD3D12 m_desc = {}; ID3D12RootSignature* m_rootSignatureCompute = nullptr; ID3D12DescriptorHeap* m_nullHeap = nullptr; @@ -261,8 +261,10 @@ struct ComputeContext ComputeContextUserData* m_computeUserdata = nullptr; - ComputeContext(const ComputeContextDesc* desc) + ComputeContextD3D12(const ComputeContextDesc* descIn) { + auto desc = cast_to_ComputeContextDescD3D12(descIn); + m_desc = *desc; auto createRootSignature = [&](D3D12_ROOT_SIGNATURE_DESC* desc, ID3D12RootSignature** root) @@ -323,7 +325,7 @@ struct ComputeContext m_desc.device->CreateShaderResourceView(nullptr, &srvDesc, m_nullSRV); } } - ~ComputeContext() + ~ComputeContextD3D12() { COMRelease(m_rootSignatureCompute); COMRelease(m_nullHeap); @@ -331,20 +333,40 @@ struct ComputeContext } }; -struct ComputeShader +inline ComputeContextD3D12* cast_to_ComputeContextD3D12(ComputeContext* ctx) +{ + return (ComputeContextD3D12*)(ctx); +} + +inline ComputeContext* cast_from_ComputeContextD3D12(ComputeContextD3D12* ctx) +{ + return (ComputeContext*)(ctx); +} + +struct ComputeShaderD3D12 { ID3D12PipelineState* m_shader = nullptr; - ComputeShader(ID3D12PipelineState* shader) + ComputeShaderD3D12(ID3D12PipelineState* shader) { m_shader = shader; } - ~ComputeShader() + ~ComputeShaderD3D12() { COMRelease(m_shader); } }; -struct ComputeConstantBuffer +inline ComputeShaderD3D12* cast_to_ComputeShaderD3D12(ComputeShader* ctx) +{ + return (ComputeShaderD3D12*)(ctx); +} + +inline ComputeShader* cast_from_ComputeShaderD3D12(ComputeShaderD3D12* ctx) +{ + return (ComputeShader*)(ctx); +} + +struct ComputeConstantBufferD3D12 { ComputeConstantBufferDesc m_desc = {}; @@ -357,38 +379,54 @@ struct ComputeConstantBuffer }; VersionedBuffer m_buffers; - ComputeConstantBuffer(ComputeContext* context, const ComputeConstantBufferDesc* desc) - { - m_desc = *desc; + ComputeConstantBufferD3D12(ComputeContext* context, const ComputeConstantBufferDesc* desc); + ~ComputeConstantBufferD3D12(); +}; - // map and unmap to trigger initial allocation - ComputeConstantBufferMap(context, this); - ComputeConstantBufferUnmap(context, this); - } - ~ComputeConstantBuffer() +inline ComputeConstantBufferD3D12* cast_to_ComputeConstantBufferD3D12(ComputeConstantBuffer* ctx) +{ + return (ComputeConstantBufferD3D12*)(ctx); +} + +inline ComputeConstantBuffer* cast_from_ComputeConstantBufferD3D12(ComputeConstantBufferD3D12* ctx) +{ + return (ComputeConstantBuffer*)(ctx); +} + +ComputeConstantBufferD3D12::ComputeConstantBufferD3D12(ComputeContext* context, const ComputeConstantBufferDesc* desc) +{ + m_desc = *desc; + + // map and unmap to trigger initial allocation + ComputeConstantBufferMapD3D12(context, cast_from_ComputeConstantBufferD3D12(this)); + ComputeConstantBufferUnmapD3D12(context, cast_from_ComputeConstantBufferD3D12(this)); +} + +ComputeConstantBufferD3D12::~ComputeConstantBufferD3D12() +{ + for (ComputeUint i = 0; i < m_buffers.m_buffers.m_size; i++) { - for (ComputeUint i = 0; i < m_buffers.m_buffers.m_size; i++) - { - COMRelease(m_buffers.m_buffers[i].bufferData.m_buffer); - } + COMRelease(m_buffers.m_buffers[i].bufferData.m_buffer); } -}; +} -struct ComputeResource +struct ComputeResourceD3D12 { protected: D3D12_CPU_DESCRIPTOR_HANDLE m_srv; ID3D12Resource* m_resource; D3D12_RESOURCE_STATES* m_currentState; public: - void update(const ComputeResourceDesc* desc) + void update(const ComputeResourceDesc* descIn) { + auto desc = cast_to_ComputeResourceDescD3D12(descIn); + m_srv = desc->srv; m_resource = desc->resource; m_currentState = desc->currentState; } - ComputeResource(const ComputeResourceDesc* desc) + ComputeResourceD3D12(const ComputeResourceDesc* desc) { update(desc); } @@ -409,21 +447,36 @@ public: } }; -struct ComputeResourceRW : public ComputeResource +inline ComputeResourceD3D12* cast_to_ComputeResourceD3D12(ComputeResource* ctx) +{ + return (ComputeResourceD3D12*)(ctx); +} + +inline ComputeResource* cast_from_ComputeResourceD3D12(ComputeResourceD3D12* ctx) +{ + return (ComputeResource*)(ctx); +} + +struct ComputeResourceRWD3D12 : public ComputeResourceD3D12 { protected: D3D12_CPU_DESCRIPTOR_HANDLE m_uav; public: + static const ComputeResourceRWDescD3D12* cast(const ComputeResourceRWDesc* descRW) + { + return cast_to_ComputeResourceRWDescD3D12(descRW); + } + void update(const ComputeResourceRWDesc* descRW) { - m_uav = descRW->uav; - ComputeResource::update(&descRW->resource); + m_uav = cast(descRW)->uav; + ComputeResourceD3D12::update(cast_from_ComputeResourceDescD3D12(&cast(descRW)->resource)); } - ComputeResourceRW(const ComputeResourceRWDesc* descRW) : - ComputeResource(&descRW->resource) + ComputeResourceRWD3D12(const ComputeResourceRWDesc* descRW) : + ComputeResourceD3D12(cast_from_ComputeResourceDescD3D12(&cast(descRW)->resource)) { - m_uav = descRW->uav; + m_uav = cast(descRW)->uav; } D3D12_CPU_DESCRIPTOR_HANDLE UAV() @@ -432,25 +485,41 @@ public: } }; +inline ComputeResourceRWD3D12* cast_to_ComputeResourceRWD3D12(ComputeResourceRW* ctx) +{ + return (ComputeResourceRWD3D12*)(ctx); +} + +inline ComputeResourceRW* cast_from_ComputeResourceRWD3D12(ComputeResourceRWD3D12* ctx) +{ + return (ComputeResourceRW*)(ctx); +} + + // ************* API functions **************** -ComputeContext* ComputeContextCreate(ComputeContextDesc* desc) +ComputeContext* ComputeContextCreateD3D12(ComputeContextDesc* desc) { - return new ComputeContext(desc); + return cast_from_ComputeContextD3D12(new ComputeContextD3D12(desc)); } -void ComputeContextUpdate(ComputeContext* context, ComputeContextDesc* desc) +void ComputeContextUpdateD3D12(ComputeContext* contextIn, ComputeContextDesc* descIn) { + auto context = cast_to_ComputeContextD3D12(contextIn); + auto desc = cast_to_ComputeContextDescD3D12(descIn); + context->m_desc = *desc; } -void ComputeContextRelease(ComputeContext* context) +void ComputeContextReleaseD3D12(ComputeContext* context) { - delete context; + delete cast_to_ComputeContextD3D12(context); } -ComputeShader* ComputeShaderCreate(ComputeContext* context, const ComputeShaderDesc* desc) +ComputeShader* ComputeShaderCreateD3D12(ComputeContext* contextIn, const ComputeShaderDesc* desc) { + auto context = cast_to_ComputeContextD3D12(contextIn); + ID3D12PipelineState* computeShader = nullptr; D3D12_COMPUTE_PIPELINE_STATE_DESC psoDesc = {}; @@ -460,26 +529,29 @@ ComputeShader* ComputeShaderCreate(ComputeContext* context, const ComputeShaderD context->m_desc.device->CreateComputePipelineState(&psoDesc, IID_PPV_ARGS(&computeShader)); - return new ComputeShader(computeShader); + return cast_from_ComputeShaderD3D12(new ComputeShaderD3D12(computeShader)); } -void ComputeShaderRelease(ComputeShader* shader) +void ComputeShaderReleaseD3D12(ComputeShader* shader) { - delete shader; + delete cast_to_ComputeShaderD3D12(shader); } -ComputeConstantBuffer* ComputeConstantBufferCreate(ComputeContext* context, const ComputeConstantBufferDesc* desc) +ComputeConstantBuffer* ComputeConstantBufferCreateD3D12(ComputeContext* context, const ComputeConstantBufferDesc* desc) { - return new ComputeConstantBuffer(context, desc); + return cast_from_ComputeConstantBufferD3D12(new ComputeConstantBufferD3D12(context, desc)); } -void ComputeConstantBufferRelease(ComputeConstantBuffer* constantBuffer) +void ComputeConstantBufferReleaseD3D12(ComputeConstantBuffer* constantBuffer) { - delete constantBuffer; + delete cast_to_ComputeConstantBufferD3D12(constantBuffer); } -void* ComputeConstantBufferMap(ComputeContext* context, ComputeConstantBuffer* constantBuffer) +void* ComputeConstantBufferMapD3D12(ComputeContext* contextIn, ComputeConstantBuffer* constantBufferIn) { + auto context = cast_to_ComputeContextD3D12(contextIn); + auto constantBuffer = cast_to_ComputeConstantBufferD3D12(constantBufferIn); + auto bufferData = constantBuffer->m_buffers.map(context->m_desc.lastFenceCompleted, context->m_desc.nextFenceValue); if (bufferData->m_buffer == nullptr) @@ -500,52 +572,60 @@ void* ComputeConstantBufferMap(ComputeContext* context, ComputeConstantBuffer* c return bufferData->m_mappedData; } -void ComputeConstantBufferUnmap(ComputeContext* context, ComputeConstantBuffer* constantBuffer) +void ComputeConstantBufferUnmapD3D12(ComputeContext* contextIn, ComputeConstantBuffer* constantBufferIn) { + auto context = cast_to_ComputeContextD3D12(contextIn); + auto constantBuffer = cast_to_ComputeConstantBufferD3D12(constantBufferIn); + constantBuffer->m_buffers.unmap(context->m_desc.lastFenceCompleted, context->m_desc.nextFenceValue); } -ComputeResource* ComputeResourceCreate(ComputeContext* context, const ComputeResourceDesc* desc) +ComputeResource* ComputeResourceCreateD3D12(ComputeContext* context, const ComputeResourceDesc* desc) { - return new ComputeResource(desc); + return cast_from_ComputeResourceD3D12(new ComputeResourceD3D12(desc)); } -void ComputeResourceUpdate(ComputeContext* context, ComputeResource* resource, const ComputeResourceDesc* desc) +void ComputeResourceUpdateD3D12(ComputeContext* context, ComputeResource* resourceIn, const ComputeResourceDesc* desc) { + auto resource = cast_to_ComputeResourceD3D12(resourceIn); resource->update(desc); } -void ComputeResourceRelease(ComputeResource* resource) +void ComputeResourceReleaseD3D12(ComputeResource* resource) { - delete resource; + delete cast_to_ComputeResourceD3D12(resource); } -ComputeResourceRW* ComputeResourceRWCreate(ComputeContext* context, const ComputeResourceRWDesc* desc) +ComputeResourceRW* ComputeResourceRWCreateD3D12(ComputeContext* context, const ComputeResourceRWDesc* desc) { - return new ComputeResourceRW(desc); + return cast_from_ComputeResourceRWD3D12(new ComputeResourceRWD3D12(desc)); } -void ComputeResourceRWUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, const ComputeResourceRWDesc* desc) +void ComputeResourceRWUpdateD3D12(ComputeContext* context, ComputeResourceRW* resourceRWIn, const ComputeResourceRWDesc* desc) { + auto resourceRW = cast_to_ComputeResourceRWD3D12(resourceRWIn); resourceRW->update(desc); } -void ComputeResourceRWRelease(ComputeResourceRW* resourceRW) +void ComputeResourceRWReleaseD3D12(ComputeResourceRW* resourceRW) { - delete resourceRW; + delete cast_to_ComputeResourceRWD3D12(resourceRW); } -ComputeResource* ComputeResourceRWGetResource(ComputeResourceRW* resourceRW) +ComputeResource* ComputeResourceRWGetResourceD3D12(ComputeResourceRW* resourceRWIn) { - return static_cast(resourceRW); + auto resourceRW = cast_to_ComputeResourceRWD3D12(resourceRWIn); + return cast_from_ComputeResourceD3D12(static_cast(resourceRW)); } -void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams* params) +void ComputeContextDispatchD3D12(ComputeContext* contextIn, const ComputeDispatchParams* params) { + auto context = cast_to_ComputeContextD3D12(contextIn); + auto& commandList = context->m_desc.commandList; commandList->SetComputeRootSignature(context->m_rootSignatureCompute); - if (params->shader) commandList->SetPipelineState(params->shader->m_shader); + if (params->shader) commandList->SetPipelineState(cast_to_ComputeShaderD3D12(params->shader)->m_shader); auto handles = context->m_desc.dynamicHeapCbvSrvUav.reserveDescriptors(context->m_desc.dynamicHeapCbvSrvUav.userdata, ComputeDispatchMaxResources + ComputeDispatchMaxResourcesRW, @@ -557,14 +637,14 @@ void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams for (ComputeUint i = 0u; i < ComputeDispatchMaxResources; i++) { auto r = params->resources[i]; - D3D12_CPU_DESCRIPTOR_HANDLE srcHandle = r ? r->SRV() : context->m_nullSRV; + D3D12_CPU_DESCRIPTOR_HANDLE srcHandle = r ? cast_to_ComputeResourceD3D12(r)->SRV() : context->m_nullSRV; context->m_desc.device->CopyDescriptorsSimple(1u, handles.cpuHandle, srcHandle, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); handles.cpuHandle.ptr += handles.descriptorSize; } for (ComputeUint i = 0u; i < ComputeDispatchMaxResourcesRW; i++) { auto rw = params->resourcesRW[i]; - D3D12_CPU_DESCRIPTOR_HANDLE srcHandle = rw ? rw->UAV() : context->m_nullUAV; + D3D12_CPU_DESCRIPTOR_HANDLE srcHandle = rw ? cast_to_ComputeResourceRWD3D12(rw)->UAV() : context->m_nullUAV; context->m_desc.device->CopyDescriptorsSimple(1u, handles.cpuHandle, srcHandle, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); handles.cpuHandle.ptr += handles.descriptorSize; } @@ -575,7 +655,7 @@ void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams if (params->constantBuffer) { - auto cbv = params->constantBuffer->m_buffers.front()->m_buffer; + auto cbv = cast_to_ComputeConstantBufferD3D12(params->constantBuffer)->m_buffers.front()->m_buffer; commandList->SetComputeRootConstantBufferView(0u, cbv->GetGPUVirtualAddress()); } @@ -586,17 +666,17 @@ void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams auto r = params->resources[i]; if (r) { - if (!((*r->currentState()) & D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE)) + if (!((*cast_to_ComputeResourceD3D12(r)->currentState()) & D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE)) { D3D12_RESOURCE_BARRIER& bar = barrier[barrierIdx++]; bar.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; bar.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE; - bar.Transition.pResource = r->resource(); + bar.Transition.pResource = cast_to_ComputeResourceD3D12(r)->resource(); bar.Transition.Subresource = 0u; - bar.Transition.StateBefore = *r->currentState(); + bar.Transition.StateBefore = *cast_to_ComputeResourceD3D12(r)->currentState(); bar.Transition.StateAfter = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; - *r->currentState() = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; + *cast_to_ComputeResourceD3D12(r)->currentState() = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; } } } @@ -605,24 +685,24 @@ void ComputeContextDispatch(ComputeContext* context, const ComputeDispatchParams auto rw = params->resourcesRW[i]; if (rw) { - if ((*rw->currentState()) == D3D12_RESOURCE_STATE_UNORDERED_ACCESS) + if ((*cast_to_ComputeResourceRWD3D12(rw)->currentState()) == D3D12_RESOURCE_STATE_UNORDERED_ACCESS) { D3D12_RESOURCE_BARRIER& bar = barrier[barrierIdx++]; bar.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV; bar.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE; - bar.UAV.pResource = rw->resource(); + bar.UAV.pResource = cast_to_ComputeResourceRWD3D12(rw)->resource(); } else { D3D12_RESOURCE_BARRIER& bar = barrier[barrierIdx++]; bar.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; bar.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE; - bar.Transition.pResource = rw->resource(); + bar.Transition.pResource = cast_to_ComputeResourceRWD3D12(rw)->resource(); bar.Transition.Subresource = 0u; - bar.Transition.StateBefore = *rw->currentState(); + bar.Transition.StateBefore = *cast_to_ComputeResourceRWD3D12(rw)->currentState(); bar.Transition.StateAfter = D3D12_RESOURCE_STATE_UNORDERED_ACCESS; - *rw->currentState() = D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + *cast_to_ComputeResourceRWD3D12(rw)->currentState() = D3D12_RESOURCE_STATE_UNORDERED_ACCESS; } } } @@ -647,7 +727,7 @@ struct ComputeContextUserDataNvFlow : public ComputeContextUserData } }; -ComputeDescriptorReserveHandleD3D12 ComputeReserveDescriptors(void* userdata, UINT numDescriptors, UINT64 lastFenceCompleted, UINT64 nextFenceValue) +ComputeDescriptorReserveHandleD3D12 ComputeReserveDescriptorsD3D12(void* userdata, UINT numDescriptors, UINT64 lastFenceCompleted, UINT64 nextFenceValue) { auto data = static_cast(userdata); auto srcHandle = data->flowHeap.reserveDescriptors(data->flowHeap.userdata, numDescriptors, lastFenceCompleted, nextFenceValue); @@ -659,9 +739,9 @@ ComputeDescriptorReserveHandleD3D12 ComputeReserveDescriptors(void* userdata, UI return handle; } -ComputeContext* ComputeContextNvFlowContextCreate(NvFlowContext* flowContext) +ComputeContext* ComputeContextNvFlowContextCreateD3D12(NvFlowContext* flowContext) { - ComputeContextDesc desc = {}; + ComputeContextDescD3D12 desc = {}; NvFlowContextDescD3D12 srcDesc = {}; NvFlowUpdateContextDescD3D12(flowContext, &srcDesc); @@ -677,18 +757,20 @@ ComputeContext* ComputeContextNvFlowContextCreate(NvFlowContext* flowContext) computeUserdata->flowHeap.reserveDescriptors = srcDesc.dynamicHeapCbvSrvUav.reserveDescriptors; desc.dynamicHeapCbvSrvUav.userdata = computeUserdata; - desc.dynamicHeapCbvSrvUav.reserveDescriptors = ComputeReserveDescriptors; + desc.dynamicHeapCbvSrvUav.reserveDescriptors = ComputeReserveDescriptorsD3D12; - auto computeContext = ComputeContextCreate(&desc); + auto computeContext = cast_to_ComputeContextD3D12(ComputeContextCreateD3D12(cast_from_ComputeContextDescD3D12(&desc))); computeContext->m_computeUserdata = computeUserdata; - return computeContext; + return cast_from_ComputeContextD3D12(computeContext); } -void ComputeContextNvFlowContextUpdate(ComputeContext* computeContext, NvFlowContext* flowContext) +void ComputeContextNvFlowContextUpdateD3D12(ComputeContext* computeContextIn, NvFlowContext* flowContext) { - ComputeContextDesc desc = {}; + auto computeContext = cast_to_ComputeContextD3D12(computeContextIn); + + ComputeContextDescD3D12 desc = {}; NvFlowContextDescD3D12 srcDesc = {}; NvFlowUpdateContextDescD3D12(flowContext, &srcDesc); @@ -704,56 +786,56 @@ void ComputeContextNvFlowContextUpdate(ComputeContext* computeContext, NvFlowCon computeUserdata->flowHeap.reserveDescriptors = srcDesc.dynamicHeapCbvSrvUav.reserveDescriptors; desc.dynamicHeapCbvSrvUav.userdata = computeUserdata; - desc.dynamicHeapCbvSrvUav.reserveDescriptors = ComputeReserveDescriptors; + desc.dynamicHeapCbvSrvUav.reserveDescriptors = ComputeReserveDescriptorsD3D12; - ComputeContextUpdate(computeContext, &desc); + ComputeContextUpdateD3D12(cast_from_ComputeContextD3D12(computeContext), cast_from_ComputeContextDescD3D12(&desc)); } -inline void updateComputeResourceDesc(NvFlowResourceViewDescD3D12* flowViewDesc, ComputeResourceDesc* desc) +inline void updateComputeResourceDesc(NvFlowResourceViewDescD3D12* flowViewDesc, ComputeResourceDescD3D12* desc) { desc->srv = flowViewDesc->srvHandle; desc->resource = flowViewDesc->resource; desc->currentState = flowViewDesc->currentState; } -ComputeResource* ComputeResourceNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource) +ComputeResource* ComputeResourceNvFlowCreateD3D12(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource) { NvFlowResourceViewDescD3D12 flowViewDesc = {}; NvFlowUpdateResourceViewDescD3D12(flowContext, flowResource, &flowViewDesc); - ComputeResourceDesc desc = {}; + ComputeResourceDescD3D12 desc = {}; updateComputeResourceDesc(&flowViewDesc, &desc); - return ComputeResourceCreate(context, &desc); + return ComputeResourceCreateD3D12(context, cast_from_ComputeResourceDescD3D12(&desc)); } -void ComputeResourceNvFlowUpdate(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource) +void ComputeResourceNvFlowUpdateD3D12(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource) { NvFlowResourceViewDescD3D12 flowViewDesc = {}; NvFlowUpdateResourceViewDescD3D12(flowContext, flowResource, &flowViewDesc); - ComputeResourceDesc desc = {}; + ComputeResourceDescD3D12 desc = {}; updateComputeResourceDesc(&flowViewDesc, &desc); - ComputeResourceUpdate(context, resource, &desc); + ComputeResourceUpdateD3D12(context, resource, cast_from_ComputeResourceDescD3D12(&desc)); } -inline void updateComputeResourceRWDesc(NvFlowResourceRWViewDescD3D12* flowViewDesc, ComputeResourceRWDesc* desc) +inline void updateComputeResourceRWDesc(NvFlowResourceRWViewDescD3D12* flowViewDesc, ComputeResourceRWDescD3D12* desc) { updateComputeResourceDesc(&flowViewDesc->resourceView, &desc->resource); desc->uav = flowViewDesc->uavHandle; } -ComputeResourceRW* ComputeResourceRWNvFlowCreate(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) +ComputeResourceRW* ComputeResourceRWNvFlowCreateD3D12(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) { NvFlowResourceRWViewDescD3D12 flowViewDesc = {}; NvFlowUpdateResourceRWViewDescD3D12(flowContext, flowResourceRW, &flowViewDesc); - ComputeResourceRWDesc desc = {}; + ComputeResourceRWDescD3D12 desc = {}; updateComputeResourceRWDesc(&flowViewDesc, &desc); - return ComputeResourceRWCreate(context, &desc); + return ComputeResourceRWCreateD3D12(context, cast_from_ComputeResourceRWDescD3D12(&desc)); } -void ComputeResourceRWNvFlowUpdate(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) +void ComputeResourceRWNvFlowUpdateD3D12(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW) { NvFlowResourceRWViewDescD3D12 flowViewDesc = {}; NvFlowUpdateResourceRWViewDescD3D12(flowContext, flowResourceRW, &flowViewDesc); - ComputeResourceRWDesc desc = {}; + ComputeResourceRWDescD3D12 desc = {}; updateComputeResourceRWDesc(&flowViewDesc, &desc); - ComputeResourceRWUpdate(context, resourceRW, &desc); + ComputeResourceRWUpdateD3D12(context, resourceRW, cast_from_ComputeResourceRWDescD3D12(&desc)); } \ No newline at end of file diff --git a/demo/DemoAppD3D12/computeContextD3D12.h b/demo/DemoAppD3D12/computeContextD3D12.h index 0acb489..835e7d7 100644 --- a/demo/DemoAppD3D12/computeContextD3D12.h +++ b/demo/DemoAppD3D12/computeContextD3D12.h @@ -26,7 +26,7 @@ struct ComputeDynamicDescriptorHeapD3D12 ComputeDescriptorReserveHandleD3D12(*reserveDescriptors)(void* userdata, UINT numDescriptors, UINT64 lastFenceCompleted, UINT64 nextFenceValue); }; -struct ComputeContextDesc +struct ComputeContextDescD3D12 { ID3D12Device* device; ID3D12CommandQueue* commandQueue; @@ -38,15 +38,91 @@ struct ComputeContextDesc ComputeDynamicDescriptorHeapD3D12 dynamicHeapCbvSrvUav; }; -struct ComputeResourceDesc +struct ComputeResourceDescD3D12 { D3D12_CPU_DESCRIPTOR_HANDLE srv; ID3D12Resource* resource; D3D12_RESOURCE_STATES* currentState; }; -struct ComputeResourceRWDesc +struct ComputeResourceRWDescD3D12 { - ComputeResourceDesc resource; + ComputeResourceDescD3D12 resource; D3D12_CPU_DESCRIPTOR_HANDLE uav; -}; \ No newline at end of file +}; + +inline const ComputeContextDescD3D12* cast_to_ComputeContextDescD3D12(const ComputeContextDesc* desc) +{ + return (const ComputeContextDescD3D12*)(desc); +} + +inline ComputeContextDesc* cast_from_ComputeContextDescD3D12(ComputeContextDescD3D12* desc) +{ + return (ComputeContextDesc*)(desc); +} + +inline const ComputeResourceDescD3D12* cast_to_ComputeResourceDescD3D12(const ComputeResourceDesc* desc) +{ + return (const ComputeResourceDescD3D12*)(desc); +} + +inline const ComputeResourceDesc* cast_from_ComputeResourceDescD3D12(const ComputeResourceDescD3D12* desc) +{ + return (const ComputeResourceDesc*)(desc); +} + +inline const ComputeResourceRWDescD3D12* cast_to_ComputeResourceRWDescD3D12(const ComputeResourceRWDesc* desc) +{ + return (const ComputeResourceRWDescD3D12*)(desc); +} + +inline const ComputeResourceRWDesc* cast_from_ComputeResourceRWDescD3D12(const ComputeResourceRWDescD3D12* desc) +{ + return (const ComputeResourceRWDesc*)(desc); +} + +COMPUTE_API ComputeContext* ComputeContextCreateD3D12(ComputeContextDesc* desc); + +COMPUTE_API void ComputeContextUpdateD3D12(ComputeContext* context, ComputeContextDesc* desc); + +COMPUTE_API void ComputeContextReleaseD3D12(ComputeContext* context); + +COMPUTE_API ComputeShader* ComputeShaderCreateD3D12(ComputeContext* context, const ComputeShaderDesc* desc); + +COMPUTE_API void ComputeShaderReleaseD3D12(ComputeShader* shader); + +COMPUTE_API ComputeConstantBuffer* ComputeConstantBufferCreateD3D12(ComputeContext* context, const ComputeConstantBufferDesc* desc); + +COMPUTE_API void ComputeConstantBufferReleaseD3D12(ComputeConstantBuffer* constantBuffer); + +COMPUTE_API void* ComputeConstantBufferMapD3D12(ComputeContext* context, ComputeConstantBuffer* constantBuffer); + +COMPUTE_API void ComputeConstantBufferUnmapD3D12(ComputeContext* context, ComputeConstantBuffer* constantBuffer); + +COMPUTE_API ComputeResource* ComputeResourceCreateD3D12(ComputeContext* context, const ComputeResourceDesc* desc); + +COMPUTE_API void ComputeResourceUpdateD3D12(ComputeContext* context, ComputeResource* resource, const ComputeResourceDesc* desc); + +COMPUTE_API void ComputeResourceReleaseD3D12(ComputeResource* resource); + +COMPUTE_API ComputeResourceRW* ComputeResourceRWCreateD3D12(ComputeContext* context, const ComputeResourceRWDesc* desc); + +COMPUTE_API void ComputeResourceRWUpdateD3D12(ComputeContext* context, ComputeResourceRW* resourceRW, const ComputeResourceRWDesc* desc); + +COMPUTE_API void ComputeResourceRWReleaseD3D12(ComputeResourceRW* resourceRW); + +COMPUTE_API ComputeResource* ComputeResourceRWGetResourceD3D12(ComputeResourceRW* resourceRW); + +COMPUTE_API void ComputeContextDispatchD3D12(ComputeContext* context, const ComputeDispatchParams* params); + +COMPUTE_API ComputeContext* ComputeContextNvFlowContextCreateD3D12(NvFlowContext* flowContext); + +COMPUTE_API void ComputeContextNvFlowContextUpdateD3D12(ComputeContext* computeContext, NvFlowContext* flowContext); + +COMPUTE_API ComputeResource* ComputeResourceNvFlowCreateD3D12(ComputeContext* context, NvFlowContext* flowContext, NvFlowResource* flowResource); + +COMPUTE_API void ComputeResourceNvFlowUpdateD3D12(ComputeContext* context, ComputeResource* resource, NvFlowContext* flowContext, NvFlowResource* flowResource); + +COMPUTE_API ComputeResourceRW* ComputeResourceRWNvFlowCreateD3D12(ComputeContext* context, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW); + +COMPUTE_API void ComputeResourceRWNvFlowUpdateD3D12(ComputeContext* context, ComputeResourceRW* resourceRW, NvFlowContext* flowContext, NvFlowResourceRW* flowResourceRW); \ No newline at end of file diff --git a/demo/DemoAppD3D12/imguiGraphD3D12.cpp b/demo/DemoAppD3D12/imguiGraphD3D12.cpp index 9b5f74a..92cbab1 100644 --- a/demo/DemoAppD3D12/imguiGraphD3D12.cpp +++ b/demo/DemoAppD3D12/imguiGraphD3D12.cpp @@ -28,7 +28,7 @@ namespace namespace { - ImguiGraphDesc m_desc = {}; + ImguiGraphDescD3D12 m_desc = {}; struct Vertex { @@ -75,8 +75,10 @@ namespace int frameIndex = 0; } -void imguiGraphContextInit(const ImguiGraphDesc* desc) +void imguiGraphContextInitD3D12(const ImguiGraphDesc* descIn) { + const auto desc = cast_to_imguiGraphDescD3D12(descIn); + m_desc = *desc; // create the root signature @@ -308,12 +310,14 @@ void imguiGraphContextInit(const ImguiGraphDesc* desc) } } -void imguiGraphContextUpdate(const ImguiGraphDesc* desc) +void imguiGraphContextUpdateD3D12(const ImguiGraphDesc* descIn) { + const auto desc = cast_to_imguiGraphDescD3D12(descIn); + m_desc = *desc; } -void imguiGraphContextDestroy() +void imguiGraphContextDestroyD3D12() { COMRelease(m_rootSignature); COMRelease(m_pipelineState); @@ -321,7 +325,7 @@ void imguiGraphContextDestroy() COMRelease(m_vertexBuffer); } -void imguiGraphRecordBegin() +void imguiGraphRecordBeginD3D12() { frameIndex = (frameIndex + 1) % frameCount; @@ -406,7 +410,7 @@ static void imguiGraphFlush() } } -void imguiGraphRecordEnd() +void imguiGraphRecordEndD3D12() { ID3D12GraphicsCommandList* commandList = m_desc.commandList; @@ -424,7 +428,7 @@ void imguiGraphRecordEnd() commandList->RSSetScissorRects(1, &rect); } -void imguiGraphEnableScissor(int x, int y, int width, int height) +void imguiGraphEnableScissorD3D12(int x, int y, int width, int height) { // mark end of last region m_stateScissor.stopIdx = m_stateVertIdx; @@ -439,7 +443,7 @@ void imguiGraphEnableScissor(int x, int y, int width, int height) m_stateScissor.height = height; } -void imguiGraphDisableScissor() +void imguiGraphDisableScissorD3D12() { if (m_stateVertIdx == 0) return; @@ -456,13 +460,13 @@ void imguiGraphDisableScissor() m_stateScissor.height = m_desc.winH; } -void imguiGraphVertex2f(float x, float y) +void imguiGraphVertex2fD3D12(float x, float y) { float v[2] = { x,y }; - imguiGraphVertex2fv(v); + imguiGraphVertex2fvD3D12(v); } -void imguiGraphVertex2fv(const float* v) +void imguiGraphVertex2fvD3D12(const float* v) { // update state m_stateVert.x = v[0]; @@ -477,13 +481,13 @@ void imguiGraphVertex2fv(const float* v) } } -void imguiGraphTexCoord2f(float u, float v) +void imguiGraphTexCoord2fD3D12(float u, float v) { m_stateVert.u = u; m_stateVert.v = v; } -void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) +void imguiGraphColor4ubD3D12(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) { m_stateVert.rgba[0] = red; m_stateVert.rgba[1] = green; @@ -491,7 +495,7 @@ void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) m_stateVert.rgba[3] = alpha; } -void imguiGraphColor4ubv(const uint8_t* v) +void imguiGraphColor4ubvD3D12(const uint8_t* v) { m_stateVert.rgba[0] = v[0]; m_stateVert.rgba[1] = v[1]; @@ -499,18 +503,18 @@ void imguiGraphColor4ubv(const uint8_t* v) m_stateVert.rgba[3] = v[3]; } -void imguiGraphFontTextureEnable() +void imguiGraphFontTextureEnableD3D12() { } -void imguiGraphFontTextureDisable() +void imguiGraphFontTextureDisableD3D12() { m_stateVert.u = -1.f; m_stateVert.v = -1.f; } -void imguiGraphFontTextureInit(unsigned char* data) +void imguiGraphFontTextureInitD3D12(unsigned char* data) { ID3D12GraphicsCommandList* commandList = m_desc.commandList; @@ -653,7 +657,7 @@ void imguiGraphFontTextureInit(unsigned char* data) } -void imguiGraphFontTextureRelease() +void imguiGraphFontTextureReleaseD3D12() { COMRelease(m_texture); COMRelease(m_textureUploadHeap); diff --git a/demo/DemoAppD3D12/imguiGraphD3D12.h b/demo/DemoAppD3D12/imguiGraphD3D12.h index 7eeb538..d011188 100644 --- a/demo/DemoAppD3D12/imguiGraphD3D12.h +++ b/demo/DemoAppD3D12/imguiGraphD3D12.h @@ -29,7 +29,7 @@ struct ImguiDynamicDescriptorHeapD3D12 ImguiDescriptorReserveHandleD3D12(*reserveDescriptors)(void* userdata, UINT numDescriptors, UINT64 lastFenceCompleted, UINT64 nextFenceValue); }; -struct ImguiGraphDesc +struct ImguiGraphDescD3D12 { ID3D12Device* device = nullptr; ID3D12GraphicsCommandList* commandList = nullptr; @@ -42,7 +42,49 @@ struct ImguiGraphDesc ImguiDynamicDescriptorHeapD3D12 dynamicHeapCbvSrvUav = {}; - ImguiGraphDesc() {} + ImguiGraphDescD3D12() {} }; +inline const ImguiGraphDescD3D12* cast_to_imguiGraphDescD3D12(const ImguiGraphDesc* desc) +{ + return (const ImguiGraphDescD3D12*)(desc); +} + +inline ImguiGraphDesc* cast_from_imguiGraphDescD3D12(ImguiGraphDescD3D12* desc) +{ + return (ImguiGraphDesc*)(desc); +} + +IMGUI_GRAPH_API void imguiGraphContextInitD3D12(const ImguiGraphDesc* desc); + +IMGUI_GRAPH_API void imguiGraphContextUpdateD3D12(const ImguiGraphDesc* desc); + +IMGUI_GRAPH_API void imguiGraphContextDestroyD3D12(); + +IMGUI_GRAPH_API void imguiGraphRecordBeginD3D12(); + +IMGUI_GRAPH_API void imguiGraphRecordEndD3D12(); + +IMGUI_GRAPH_API void imguiGraphVertex2fD3D12(float x, float y); + +IMGUI_GRAPH_API void imguiGraphVertex2fvD3D12(const float* v); + +IMGUI_GRAPH_API void imguiGraphTexCoord2fD3D12(float u, float v); + +IMGUI_GRAPH_API void imguiGraphColor4ubD3D12(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha); + +IMGUI_GRAPH_API void imguiGraphColor4ubvD3D12(const uint8_t* v); + +IMGUI_GRAPH_API void imguiGraphFontTextureEnableD3D12(); + +IMGUI_GRAPH_API void imguiGraphFontTextureDisableD3D12(); + +IMGUI_GRAPH_API void imguiGraphEnableScissorD3D12(int x, int y, int width, int height); + +IMGUI_GRAPH_API void imguiGraphDisableScissorD3D12(); + +IMGUI_GRAPH_API void imguiGraphFontTextureInitD3D12(unsigned char* data); + +IMGUI_GRAPH_API void imguiGraphFontTextureReleaseD3D12(); + #endif \ No newline at end of file diff --git a/demo/DemoAppD3D12/imguiInteropD3D12.cpp b/demo/DemoAppD3D12/imguiInteropD3D12.cpp index 322e1b5..30a8760 100644 --- a/demo/DemoAppD3D12/imguiInteropD3D12.cpp +++ b/demo/DemoAppD3D12/imguiInteropD3D12.cpp @@ -21,7 +21,7 @@ ImguiDescriptorReserveHandleD3D12 imguiInteropReserveDescriptors(void* userdata, UINT numDescriptors, UINT64 lastFenceCompleted, UINT64 nextFenceValue) { - auto appctx = static_cast(userdata); + auto appctx = cast_to_AppGraphCtxD3D12((AppGraphCtx*)userdata); auto srcHandle = appctx->m_dynamicHeapCbvSrvUav.reserveDescriptors(numDescriptors, lastFenceCompleted, nextFenceValue); ImguiDescriptorReserveHandleD3D12 handle = {}; handle.heap = srcHandle.heap; @@ -31,8 +31,10 @@ ImguiDescriptorReserveHandleD3D12 imguiInteropReserveDescriptors(void* userdata, return handle; } -void imguiInteropUpdateDesc(ImguiGraphDesc& desc, AppGraphCtx* appctx) +inline void imguiInteropUpdateDesc(ImguiGraphDescD3D12& desc, AppGraphCtx* appctxIn) { + auto appctx = cast_to_AppGraphCtxD3D12(appctxIn); + desc.device = appctx->m_device; desc.commandList = appctx->m_commandList; desc.lastFenceCompleted = appctx->m_lastFenceComplete; @@ -43,18 +45,22 @@ void imguiInteropUpdateDesc(ImguiGraphDesc& desc, AppGraphCtx* appctx) desc.dynamicHeapCbvSrvUav.reserveDescriptors = imguiInteropReserveDescriptors; } -bool imguiInteropGraphInit(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx) +IMGUI_GRAPH_API bool imguiInteropGraphInitD3D12(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx); + +IMGUI_GRAPH_API void imguiInteropGraphUpdateD3D12(imguiGraphUpdate_t func, AppGraphCtx* appctx); + +bool imguiInteropGraphInitD3D12(imguiGraphInit_t func, const char* fontpath, AppGraphCtx* appctx) { - ImguiGraphDesc desc; + ImguiGraphDescD3D12 desc; imguiInteropUpdateDesc(desc, appctx); - return func(fontpath, &desc); + return func(fontpath, cast_from_imguiGraphDescD3D12(&desc)); } -void imguiInteropGraphUpdate(imguiGraphUpdate_t func, AppGraphCtx* appctx) +void imguiInteropGraphUpdateD3D12(imguiGraphUpdate_t func, AppGraphCtx* appctx) { - ImguiGraphDesc desc; + ImguiGraphDescD3D12 desc; imguiInteropUpdateDesc(desc, appctx); - return func(&desc); + return func(cast_from_imguiGraphDescD3D12(&desc)); } \ No newline at end of file diff --git a/demo/DemoAppD3D12/meshD3D12.cpp b/demo/DemoAppD3D12/meshD3D12.cpp index 3b04436..5821c89 100644 --- a/demo/DemoAppD3D12/meshD3D12.cpp +++ b/demo/DemoAppD3D12/meshD3D12.cpp @@ -105,7 +105,7 @@ struct MeshConstantHeap } }; -struct MeshContext +struct MeshContextD3D12 { ID3D12Device* m_device = nullptr; ID3D12GraphicsCommandList* m_commandList = nullptr; @@ -116,8 +116,8 @@ struct MeshContext MeshConstantHeap* m_constantHeap = nullptr; - MeshContext() {} - ~MeshContext() + MeshContextD3D12() {} + ~MeshContextD3D12() { COMRelease(m_rootSignature); COMRelease(m_pipelineStateLH); @@ -130,7 +130,17 @@ struct MeshContext } }; -struct MeshIndexBuffer +inline MeshContextD3D12* cast_to_MeshContextD3D12(MeshContext* ctx) +{ + return (MeshContextD3D12*)(ctx); +} + +inline MeshContext* cast_from_MeshContextD3D12(MeshContextD3D12* ctx) +{ + return (MeshContext*)(ctx); +} + +struct MeshIndexBufferD3D12 { ID3D12Resource* m_buffer = nullptr; MeshUint m_numElements = 0u; @@ -138,15 +148,25 @@ struct MeshIndexBuffer ID3D12Resource* m_upload = nullptr; - MeshIndexBuffer() {} - ~MeshIndexBuffer() + MeshIndexBufferD3D12() {} + ~MeshIndexBufferD3D12() { COMRelease(m_buffer); COMRelease(m_upload); } }; -struct MeshVertexBuffer +inline MeshIndexBufferD3D12* cast_to_MeshIndexBufferD3D12(MeshIndexBuffer* buf) +{ + return (MeshIndexBufferD3D12*)(buf); +} + +inline MeshIndexBuffer* cast_from_MeshIndexBufferD3D12(MeshIndexBufferD3D12* buf) +{ + return (MeshIndexBuffer*)(buf); +} + +struct MeshVertexBufferD3D12 { ID3D12Resource* m_buffer = nullptr; MeshUint m_numElements = 0u; @@ -154,16 +174,28 @@ struct MeshVertexBuffer ID3D12Resource* m_upload = nullptr; - MeshVertexBuffer() {} - ~MeshVertexBuffer() + MeshVertexBufferD3D12() {} + ~MeshVertexBufferD3D12() { COMRelease(m_buffer); COMRelease(m_upload); } }; -MeshConstantHeap::MeshConstantHeap(MeshContext* meshContext, int size) : m_meshContext(meshContext) +inline MeshVertexBufferD3D12* cast_to_MeshVertexBufferD3D12(MeshVertexBuffer* buf) { + return (MeshVertexBufferD3D12*)(buf); +} + +inline MeshVertexBuffer* cast_from_MeshVertexBufferD3D12(MeshVertexBufferD3D12* buf) +{ + return (MeshVertexBuffer*)(buf); +} + +MeshConstantHeap::MeshConstantHeap(MeshContext* meshContextIn, int size) : m_meshContext(meshContextIn) +{ + auto meshContext = cast_to_MeshContextD3D12(meshContextIn); + // create a constant buffer { HRESULT hr = S_OK; @@ -208,9 +240,11 @@ MeshConstantHeap::MeshConstantHeap(MeshContext* meshContext, int size) : m_meshC } } -MeshContext* MeshContextCreate(const MeshContextDesc* desc) +MeshContext* MeshContextCreateD3D12(const MeshContextDesc* descIn) { - MeshContext* context = new MeshContext; + auto desc = cast_to_MeshContextDescD3D12(descIn); + + MeshContextD3D12* context = new MeshContextD3D12; context->m_device = desc->device; context->m_commandList = desc->commandList; @@ -333,30 +367,35 @@ MeshContext* MeshContextCreate(const MeshContextDesc* desc) // create constant heap { - context->m_constantHeap = new MeshConstantHeap(context, 4096u); + context->m_constantHeap = new MeshConstantHeap(cast_from_MeshContextD3D12(context), 4096u); } - return context; + return cast_from_MeshContextD3D12(context); } -void MeshContextUpdate(MeshContext* context, const MeshContextDesc* desc) +void MeshContextUpdateD3D12(MeshContext* contextIn, const MeshContextDesc* descIn) { + auto context = cast_to_MeshContextD3D12(contextIn); + auto desc = cast_to_MeshContextDescD3D12(descIn); + context->m_device = desc->device; context->m_commandList = desc->commandList; context->m_constantHeap->reset(); } -void MeshContextRelease(MeshContext* context) +void MeshContextReleaseD3D12(MeshContext* context) { if (context == nullptr) return; - delete context; + delete cast_to_MeshContextD3D12(context); } -MeshIndexBuffer* MeshIndexBufferCreate(MeshContext* context, MeshUint* indices, MeshUint numIndices) +MeshIndexBuffer* MeshIndexBufferCreateD3D12(MeshContext* contextIn, MeshUint* indices, MeshUint numIndices) { - MeshIndexBuffer* buffer = new MeshIndexBuffer; + auto context = cast_to_MeshContextD3D12(contextIn); + + MeshIndexBufferD3D12* buffer = new MeshIndexBufferD3D12; buffer->m_numElements = numIndices; // create an index buffer @@ -433,19 +472,21 @@ MeshIndexBuffer* MeshIndexBufferCreate(MeshContext* context, MeshUint* indices, buffer->m_view.Format = DXGI_FORMAT_R32_UINT; } - return buffer; + return cast_from_MeshIndexBufferD3D12(buffer); } -void MeshIndexBufferRelease(MeshIndexBuffer* buffer) +void MeshIndexBufferReleaseD3D12(MeshIndexBuffer* buffer) { if (buffer == nullptr) return; - delete buffer; + delete cast_to_MeshIndexBufferD3D12(buffer); } -MeshVertexBuffer* MeshVertexBufferCreate(MeshContext* context, MeshVertex* vertices, MeshUint numVertices) +MeshVertexBuffer* MeshVertexBufferCreateD3D12(MeshContext* contextIn, MeshVertex* vertices, MeshUint numVertices) { - MeshVertexBuffer* buffer = new MeshVertexBuffer; + auto context = cast_to_MeshContextD3D12(contextIn); + + MeshVertexBufferD3D12* buffer = new MeshVertexBufferD3D12; buffer->m_numElements = numVertices; // create a vertex buffer @@ -522,18 +563,20 @@ MeshVertexBuffer* MeshVertexBufferCreate(MeshContext* context, MeshVertex* verti buffer->m_view.SizeInBytes = bufferSize; } - return buffer; + return cast_from_MeshVertexBufferD3D12(buffer); } -void MeshVertexBufferRelease(MeshVertexBuffer* buffer) +void MeshVertexBufferReleaseD3D12(MeshVertexBuffer* buffer) { if (buffer == nullptr) return; - delete buffer; + delete cast_to_MeshVertexBufferD3D12(buffer); } -void MeshContextDraw(MeshContext* context, const MeshContextDrawParams* params) +void MeshContextDrawD3D12(MeshContext* contextIn, const MeshContextDrawParams* params) { + auto context = cast_to_MeshContextD3D12(contextIn); + using namespace DirectX; XMMATRIX matrix = XMMatrixTranspose(XMMatrixMultiply(XMMatrixMultiply( @@ -569,8 +612,8 @@ void MeshContextDraw(MeshContext* context, const MeshContextDrawParams* params) commandList->SetGraphicsRootConstantBufferView(0, cbvHandle); commandList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST); - commandList->IASetVertexBuffers(0, 1, ¶ms->vertexBuffer->m_view); - commandList->IASetIndexBuffer(¶ms->indexBuffer->m_view); + commandList->IASetVertexBuffers(0, 1, &cast_to_MeshVertexBufferD3D12(params->vertexBuffer)->m_view); + commandList->IASetIndexBuffer(&cast_to_MeshIndexBufferD3D12(params->indexBuffer)->m_view); - commandList->DrawIndexedInstanced((UINT)params->indexBuffer->m_numElements, 1, 0, 0, 0); + commandList->DrawIndexedInstanced((UINT)cast_to_MeshIndexBufferD3D12(params->indexBuffer)->m_numElements, 1, 0, 0, 0); } \ No newline at end of file diff --git a/demo/DemoAppD3D12/meshD3D12.h b/demo/DemoAppD3D12/meshD3D12.h index 4bd0fab..94c8994 100644 --- a/demo/DemoAppD3D12/meshD3D12.h +++ b/demo/DemoAppD3D12/meshD3D12.h @@ -12,8 +12,35 @@ #include "../DemoApp/mesh.h" -struct MeshContextDesc +struct MeshContextDescD3D12 { ID3D12Device* device; ID3D12GraphicsCommandList* commandList; -}; \ No newline at end of file +}; + +inline const MeshContextDescD3D12* cast_to_MeshContextDescD3D12(const MeshContextDesc* desc) +{ + return (const MeshContextDescD3D12*)(desc); +} + +inline MeshContextDesc* cast_from_MeshContextDescD3D12(MeshContextDescD3D12* desc) +{ + return (MeshContextDesc*)(desc); +} + +MESH_API MeshContext* MeshContextCreateD3D12(const MeshContextDesc* desc); + +MESH_API void MeshContextUpdateD3D12(MeshContext* context, const MeshContextDesc* desc); + +MESH_API void MeshContextReleaseD3D12(MeshContext* context); + + +MESH_API MeshIndexBuffer* MeshIndexBufferCreateD3D12(MeshContext* context, MeshUint* indices, MeshUint numIndices); + +MESH_API void MeshIndexBufferReleaseD3D12(MeshIndexBuffer* buffer); + +MESH_API MeshVertexBuffer* MeshVertexBufferCreateD3D12(MeshContext* context, MeshVertex* vertices, MeshUint numVertices); + +MESH_API void MeshVertexBufferReleaseD3D12(MeshVertexBuffer* buffer); + +MESH_API void MeshContextDrawD3D12(MeshContext* context, const MeshContextDrawParams* params); \ No newline at end of file diff --git a/demo/DemoAppD3D12/meshInteropD3D12.cpp b/demo/DemoAppD3D12/meshInteropD3D12.cpp index 19c034d..28649a0 100644 --- a/demo/DemoAppD3D12/meshInteropD3D12.cpp +++ b/demo/DemoAppD3D12/meshInteropD3D12.cpp @@ -19,20 +19,28 @@ #include "appD3D12Ctx.h" #include "meshD3D12.h" -MeshContext* MeshInteropContextCreate(AppGraphCtx* appctx) +MESH_API MeshContext* MeshInteropContextCreateD3D12(AppGraphCtx* appctx); + +MESH_API void MeshInteropContextUpdateD3D12(MeshContext* context, AppGraphCtx* appctx); + +MeshContext* MeshInteropContextCreateD3D12(AppGraphCtx* appctxIn) { - MeshContextDesc desc = {}; + auto appctx = cast_to_AppGraphCtxD3D12(appctxIn); + + MeshContextDescD3D12 desc = {}; desc.device = appctx->m_device; desc.commandList = appctx->m_commandList; - return MeshContextCreate(&desc); + return MeshContextCreateD3D12(cast_from_MeshContextDescD3D12(&desc)); } -void MeshInteropContextUpdate(MeshContext* context, AppGraphCtx* appctx) +void MeshInteropContextUpdateD3D12(MeshContext* context, AppGraphCtx* appctxIn) { - MeshContextDesc desc = {}; + auto appctx = cast_to_AppGraphCtxD3D12(appctxIn); + + MeshContextDescD3D12 desc = {}; desc.device = appctx->m_device; desc.commandList = appctx->m_commandList; - return MeshContextUpdate(context, &desc); + return MeshContextUpdateD3D12(context, cast_from_MeshContextDescD3D12(&desc)); } \ No newline at end of file diff --git a/docs/api/files/_nv_flow_8h-source.html b/docs/api/files/_nv_flow_8h-source.html index 87a3bd0..cac855f 100644 --- a/docs/api/files/_nv_flow_8h-source.html +++ b/docs/api/files/_nv_flow_8h-source.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlow.h Source File + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlow.h Source File @@ -110,926 +110,991 @@ 00126 { 00127 NvFlowFloat3 gravity; 00128 -00129 bool pressureLegacyMode; +00129 bool singlePassAdvection; 00130 -00131 bool bigEffectMode; -00132 float bigEffectPredictTime; -00133 -00134 NvFlowGridDebugVisFlags debugVisFlags; -00135 }; -00136 -00142 NV_FLOW_API void NvFlowGridParamsDefaults(NvFlowGridParams* params); -00143 -00150 NV_FLOW_API void NvFlowGridSetParams(NvFlowGrid* grid, const NvFlowGridParams* params); -00151 -00153 struct NvFlowSupport -00154 { -00155 bool supportsVTR; -00156 }; -00157 -00167 NV_FLOW_API NvFlowResult NvFlowGridQuerySupport(NvFlowGrid* grid, NvFlowContext* context, NvFlowSupport* support); -00168 -00170 struct NvFlowQueryTime -00171 { -00172 float simulation; -00173 }; -00174 -00184 NV_FLOW_API NvFlowResult NvFlowGridQueryTime(NvFlowGrid* grid, NvFlowQueryTime* gpuTime, NvFlowQueryTime* cpuTime); -00185 -00192 NV_FLOW_API void NvFlowGridGPUMemUsage(NvFlowGrid* grid, NvFlowUint64* numBytes); -00193 -00201 NV_FLOW_API void NvFlowGridUpdate(NvFlowGrid* grid, NvFlowContext* context, float dt); -00202 -00211 NV_FLOW_API NvFlowGridExport* NvFlowGridGetGridExport(NvFlowContext* context, NvFlowGrid* grid); -00212 -00214 // -------------------------- NvFlowGridMaterial ------------------------------- -00217 -00219 struct NvFlowGridMaterialHandle -00220 { -00221 NvFlowGrid* grid; -00222 NvFlowUint64 uid; -00223 }; -00224 -00226 enum NvFlowGridComponent -00227 { -00228 eNvFlowGridComponentVelocity = 0, -00229 eNvFlowGridComponentSmoke = 1, -00230 eNvFlowGridComponentTemperature = 2, -00231 eNvFlowGridComponentFuel = 3, -00232 -00233 eNvFlowGridNumComponents = 4 -00234 }; -00235 -00237 struct NvFlowGridMaterialPerComponent -00238 { -00239 float damping; -00240 float fade; -00241 float macCormackBlendFactor; -00242 float macCormackBlendThreshold; -00243 float allocWeight; -00244 float allocThreshold; -00245 }; -00246 -00248 struct NvFlowGridMaterialParams -00249 { -00250 NvFlowGridMaterialPerComponent velocity; -00251 NvFlowGridMaterialPerComponent smoke; -00252 NvFlowGridMaterialPerComponent temperature; -00253 NvFlowGridMaterialPerComponent fuel; -00254 -00255 float vorticityStrength; -00256 float vorticityVelocityMask; -00257 -00258 float ignitionTemp; -00259 float burnPerTemp; -00260 float fuelPerBurn; -00261 float tempPerBurn; -00262 float smokePerBurn; -00263 float divergencePerBurn; -00264 float buoyancyPerTemp; -00265 float coolingRate; -00266 }; -00267 -00273 NV_FLOW_API void NvFlowGridMaterialParamsDefaults(NvFlowGridMaterialParams* params); -00274 -00282 NV_FLOW_API NvFlowGridMaterialHandle NvFlowGridGetDefaultMaterial(NvFlowGrid* grid); -00283 -00292 NV_FLOW_API NvFlowGridMaterialHandle NvFlowGridCreateMaterial(NvFlowGrid* grid, const NvFlowGridMaterialParams* params); -00293 -00300 NV_FLOW_API void NvFlowGridReleaseMaterial(NvFlowGrid* grid, NvFlowGridMaterialHandle material); -00301 -00309 NV_FLOW_API void NvFlowGridSetMaterialParams(NvFlowGrid* grid, NvFlowGridMaterialHandle material, const NvFlowGridMaterialParams* params); -00310 -00312 // -------------------------- NvFlowShape ------------------------------- -00315 -00317 enum NvFlowShapeType -00318 { -00319 eNvFlowShapeTypeSDF = 0, -00320 eNvFlowShapeTypeSphere = 1, -00321 eNvFlowShapeTypeBox = 2, -00322 eNvFlowShapeTypeCapsule = 3, -00323 eNvFlowShapeTypePlane = 4 -00324 }; -00325 -00327 struct NvFlowShapeSDF; -00328 -00330 struct NvFlowShapeDescSDF -00331 { -00332 NvFlowUint sdfOffset; -00333 }; +00131 bool pressureLegacyMode; +00132 +00133 bool bigEffectMode; +00134 float bigEffectPredictTime; +00135 +00136 NvFlowGridDebugVisFlags debugVisFlags; +00137 }; +00138 +00144 NV_FLOW_API void NvFlowGridParamsDefaults(NvFlowGridParams* params); +00145 +00152 NV_FLOW_API void NvFlowGridSetParams(NvFlowGrid* grid, const NvFlowGridParams* params); +00153 +00155 struct NvFlowSupport +00156 { +00157 bool supportsVTR; +00158 }; +00159 +00169 NV_FLOW_API NvFlowResult NvFlowGridQuerySupport(NvFlowGrid* grid, NvFlowContext* context, NvFlowSupport* support); +00170 +00172 struct NvFlowQueryTime +00173 { +00174 float simulation; +00175 }; +00176 +00186 NV_FLOW_API NvFlowResult NvFlowGridQueryTime(NvFlowGrid* grid, NvFlowQueryTime* gpuTime, NvFlowQueryTime* cpuTime); +00187 +00194 NV_FLOW_API void NvFlowGridGPUMemUsage(NvFlowGrid* grid, NvFlowUint64* numBytes); +00195 +00203 NV_FLOW_API void NvFlowGridUpdate(NvFlowGrid* grid, NvFlowContext* context, float dt); +00204 +00213 NV_FLOW_API NvFlowGridExport* NvFlowGridGetGridExport(NvFlowContext* context, NvFlowGrid* grid); +00214 +00216 // -------------------------- NvFlowGridMaterial ------------------------------- +00219 +00221 struct NvFlowGridMaterialHandle +00222 { +00223 NvFlowGrid* grid; +00224 NvFlowUint64 uid; +00225 }; +00226 +00228 enum NvFlowGridComponent +00229 { +00230 eNvFlowGridComponentVelocity = 0, +00231 eNvFlowGridComponentSmoke = 1, +00232 eNvFlowGridComponentTemperature = 2, +00233 eNvFlowGridComponentFuel = 3, +00234 +00235 eNvFlowGridNumComponents = 4 +00236 }; +00237 +00239 struct NvFlowGridMaterialPerComponent +00240 { +00241 float damping; +00242 float fade; +00243 float macCormackBlendFactor; +00244 float macCormackBlendThreshold; +00245 float allocWeight; +00246 float allocThreshold; +00247 }; +00248 +00250 struct NvFlowGridMaterialParams +00251 { +00252 NvFlowGridMaterialPerComponent velocity; +00253 NvFlowGridMaterialPerComponent smoke; +00254 NvFlowGridMaterialPerComponent temperature; +00255 NvFlowGridMaterialPerComponent fuel; +00256 +00257 float vorticityStrength; +00258 float vorticityVelocityMask; +00259 float vorticityTemperatureMask; +00260 float vorticitySmokeMask; +00261 float vorticityFuelMask; +00262 float vorticityConstantMask; +00263 +00264 float ignitionTemp; +00265 float burnPerTemp; +00266 float fuelPerBurn; +00267 float tempPerBurn; +00268 float smokePerBurn; +00269 float divergencePerBurn; +00270 float buoyancyPerTemp; +00271 float coolingRate; +00272 }; +00273 +00279 NV_FLOW_API void NvFlowGridMaterialParamsDefaults(NvFlowGridMaterialParams* params); +00280 +00288 NV_FLOW_API NvFlowGridMaterialHandle NvFlowGridGetDefaultMaterial(NvFlowGrid* grid); +00289 +00298 NV_FLOW_API NvFlowGridMaterialHandle NvFlowGridCreateMaterial(NvFlowGrid* grid, const NvFlowGridMaterialParams* params); +00299 +00306 NV_FLOW_API void NvFlowGridReleaseMaterial(NvFlowGrid* grid, NvFlowGridMaterialHandle material); +00307 +00315 NV_FLOW_API void NvFlowGridSetMaterialParams(NvFlowGrid* grid, NvFlowGridMaterialHandle material, const NvFlowGridMaterialParams* params); +00316 +00318 // -------------------------- NvFlowShape ------------------------------- +00321 +00323 enum NvFlowShapeType +00324 { +00325 eNvFlowShapeTypeSDF = 0, +00326 eNvFlowShapeTypeSphere = 1, +00327 eNvFlowShapeTypeBox = 2, +00328 eNvFlowShapeTypeCapsule = 3, +00329 eNvFlowShapeTypePlane = 4 +00330 }; +00331 +00333 struct NvFlowShapeSDF; 00334 -00336 struct NvFlowShapeDescSphere +00336 struct NvFlowShapeDescSDF 00337 { -00338 float radius; +00338 NvFlowUint sdfOffset; 00339 }; 00340 -00342 struct NvFlowShapeDescBox +00342 struct NvFlowShapeDescSphere 00343 { -00344 NvFlowFloat3 halfSize; +00344 float radius; 00345 }; 00346 -00348 struct NvFlowShapeDescCapsule +00348 struct NvFlowShapeDescBox 00349 { -00350 float radius; -00351 float length; -00352 }; -00353 -00355 struct NvFlowShapeDescPlane -00356 { -00357 NvFlowFloat3 normal; -00358 float distance; -00359 }; -00360 -00362 union NvFlowShapeDesc -00363 { -00364 NvFlowShapeDescSDF sdf; -00365 NvFlowShapeDescSphere sphere; -00366 NvFlowShapeDescBox box; -00367 NvFlowShapeDescCapsule capsule; -00368 NvFlowShapeDescPlane plane; -00369 }; -00370 -00372 struct NvFlowShapeSDFDesc -00373 { -00374 NvFlowDim resolution; +00350 NvFlowFloat3 halfSize; +00351 }; +00352 +00354 struct NvFlowShapeDescCapsule +00355 { +00356 float radius; +00357 float length; +00358 }; +00359 +00361 struct NvFlowShapeDescPlane +00362 { +00363 NvFlowFloat3 normal; +00364 float distance; +00365 }; +00366 +00368 union NvFlowShapeDesc +00369 { +00370 NvFlowShapeDescSDF sdf; +00371 NvFlowShapeDescSphere sphere; +00372 NvFlowShapeDescBox box; +00373 NvFlowShapeDescCapsule capsule; +00374 NvFlowShapeDescPlane plane; 00375 }; 00376 -00382 NV_FLOW_API void NvFlowShapeSDFDescDefaults(NvFlowShapeSDFDesc* desc); -00383 -00385 struct NvFlowShapeSDFData -00386 { -00387 float* data; -00388 NvFlowUint rowPitch; -00389 NvFlowUint depthPitch; -00390 NvFlowDim dim; -00391 }; -00392 -00401 NV_FLOW_API NvFlowShapeSDF* NvFlowCreateShapeSDF(NvFlowContext* context, const NvFlowShapeSDFDesc* desc); -00402 -00411 NV_FLOW_API NvFlowShapeSDF* NvFlowCreateShapeSDFFromTexture3D(NvFlowContext* context, NvFlowTexture3D* texture); -00412 -00418 NV_FLOW_API void NvFlowReleaseShapeSDF(NvFlowShapeSDF* shape); -00419 -00428 NV_FLOW_API NvFlowShapeSDFData NvFlowShapeSDFMap(NvFlowShapeSDF* shape, NvFlowContext* context); -00429 -00436 NV_FLOW_API void NvFlowShapeSDFUnmap(NvFlowShapeSDF* shape, NvFlowContext* context); -00437 -00439 // -------------------------- NvFlowGridEmit ------------------------------- -00442 -00444 enum NvFlowGridEmitMode -00445 { -00446 eNvFlowGridEmitModeDefault = 0, -00447 eNvFlowGridEmitModeDisableVelocity = 0x01, -00448 eNvFlowGridEmitModeDisableDensity = 0x02, -00449 eNvFlowGridEmitModeDisableAlloc = 0x04, -00450 eNvFlowGridEmitModeAllocShape = 0x08, -00451 -00452 eNvFlowGridEmitModeAllocShapeOnly = 0x0F, -00453 }; -00454 -00456 struct NvFlowGridEmitParams -00457 { -00458 NvFlowUint shapeRangeOffset; -00459 NvFlowUint shapeRangeSize; -00460 NvFlowShapeType shapeType; -00461 float shapeDistScale; -00462 -00463 NvFlowFloat4x4 bounds; -00464 NvFlowFloat4x4 localToWorld; -00465 NvFlowFloat3 centerOfMass; -00466 -00467 float deltaTime; +00378 struct NvFlowShapeSDFDesc +00379 { +00380 NvFlowDim resolution; +00381 }; +00382 +00388 NV_FLOW_API void NvFlowShapeSDFDescDefaults(NvFlowShapeSDFDesc* desc); +00389 +00391 struct NvFlowShapeSDFData +00392 { +00393 float* data; +00394 NvFlowUint rowPitch; +00395 NvFlowUint depthPitch; +00396 NvFlowDim dim; +00397 }; +00398 +00407 NV_FLOW_API NvFlowShapeSDF* NvFlowCreateShapeSDF(NvFlowContext* context, const NvFlowShapeSDFDesc* desc); +00408 +00417 NV_FLOW_API NvFlowShapeSDF* NvFlowCreateShapeSDFFromTexture3D(NvFlowContext* context, NvFlowTexture3D* texture); +00418 +00424 NV_FLOW_API void NvFlowReleaseShapeSDF(NvFlowShapeSDF* shape); +00425 +00434 NV_FLOW_API NvFlowShapeSDFData NvFlowShapeSDFMap(NvFlowShapeSDF* shape, NvFlowContext* context); +00435 +00442 NV_FLOW_API void NvFlowShapeSDFUnmap(NvFlowShapeSDF* shape, NvFlowContext* context); +00443 +00445 // -------------------------- NvFlowGridEmit ------------------------------- +00448 +00450 enum NvFlowGridEmitMode +00451 { +00452 eNvFlowGridEmitModeDefault = 0, +00453 eNvFlowGridEmitModeDisableVelocity = 0x01, +00454 eNvFlowGridEmitModeDisableDensity = 0x02, +00455 eNvFlowGridEmitModeDisableAlloc = 0x04, +00456 eNvFlowGridEmitModeAllocShape = 0x08, +00457 +00458 eNvFlowGridEmitModeAllocShapeOnly = 0x0F, +00459 }; +00460 +00462 struct NvFlowGridEmitParams +00463 { +00464 NvFlowUint shapeRangeOffset; +00465 NvFlowUint shapeRangeSize; +00466 NvFlowShapeType shapeType; +00467 float shapeDistScale; 00468 -00469 NvFlowGridMaterialHandle material; -00470 NvFlowUint emitMode; -00471 NvFlowUint numSubSteps; +00469 NvFlowFloat4x4 bounds; +00470 NvFlowFloat4x4 localToWorld; +00471 NvFlowFloat3 centerOfMass; 00472 -00473 NvFlowFloat3 allocationScale; -00474 float allocationPredict; -00475 NvFlowFloat3 predictVelocity; -00476 float predictVelocityWeight; +00473 float deltaTime; +00474 +00475 NvFlowUint emitMaterialIndex; +00476 NvFlowUint emitMode; 00477 -00478 float minActiveDist; -00479 float maxActiveDist; -00480 float minEdgeDist; -00481 float maxEdgeDist; -00482 float slipThickness; -00483 float slipFactor; -00484 -00485 NvFlowFloat3 velocityLinear; -00486 NvFlowFloat3 velocityAngular; -00487 NvFlowFloat3 velocityCoupleRate; -00488 -00489 float smoke; -00490 float smokeCoupleRate; -00491 -00492 float temperature; -00493 float temperatureCoupleRate; -00494 -00495 float fuel; -00496 float fuelCoupleRate; -00497 float fuelReleaseTemp; -00498 float fuelRelease; -00499 }; -00500 -00506 NV_FLOW_API void NvFlowGridEmitParamsDefaults(NvFlowGridEmitParams* params); -00507 -00517 NV_FLOW_API void NvFlowGridEmit(NvFlowGrid* grid, const NvFlowShapeDesc* shapes, NvFlowUint numShapes, const NvFlowGridEmitParams* params, NvFlowUint numParams); -00518 -00526 NV_FLOW_API void NvFlowGridUpdateEmitSDFs(NvFlowGrid* grid, NvFlowShapeSDF** sdfs, NvFlowUint numSdfs); -00527 -00529 // -------------------------- NvFlowGridEmitCustom ------------------------------- -00532 -00534 struct NvFlowGridEmitCustomAllocParams -00535 { -00536 NvFlowResourceRW* maskResourceRW; -00537 -00538 NvFlowDim maskDim; -00539 -00540 NvFlowFloat3 gridLocation; -00541 NvFlowFloat3 gridHalfSize; -00542 -00543 NvFlowGridMaterialHandle material; -00544 }; -00545 -00546 typedef void(*NvFlowGridEmitCustomAllocFunc)(void* userdata, const NvFlowGridEmitCustomAllocParams* params); -00547 -00555 NV_FLOW_API void NvFlowGridEmitCustomRegisterAllocFunc(NvFlowGrid* grid, NvFlowGridEmitCustomAllocFunc func, void* userdata); +00478 NvFlowFloat3 allocationScale; +00479 float allocationPredict; +00480 NvFlowFloat3 predictVelocity; +00481 float predictVelocityWeight; +00482 +00483 float minActiveDist; +00484 float maxActiveDist; +00485 float minEdgeDist; +00486 float maxEdgeDist; +00487 float slipThickness; +00488 float slipFactor; +00489 +00490 NvFlowFloat3 velocityLinear; +00491 NvFlowFloat3 velocityAngular; +00492 NvFlowFloat3 velocityCoupleRate; +00493 +00494 float smoke; +00495 float smokeCoupleRate; +00496 +00497 float temperature; +00498 float temperatureCoupleRate; +00499 +00500 float fuel; +00501 float fuelCoupleRate; +00502 float fuelReleaseTemp; +00503 float fuelRelease; +00504 }; +00505 +00511 NV_FLOW_API void NvFlowGridEmitParamsDefaults(NvFlowGridEmitParams* params); +00512 +00522 NV_FLOW_API void NvFlowGridEmit(NvFlowGrid* grid, const NvFlowShapeDesc* shapes, NvFlowUint numShapes, const NvFlowGridEmitParams* params, NvFlowUint numParams); +00523 +00531 NV_FLOW_API void NvFlowGridUpdateEmitMaterials(NvFlowGrid* grid, NvFlowGridMaterialHandle* materials, NvFlowUint numMaterials); +00532 +00540 NV_FLOW_API void NvFlowGridUpdateEmitSDFs(NvFlowGrid* grid, NvFlowShapeSDF** sdfs, NvFlowUint numSdfs); +00541 +00543 // -------------------------- NvFlowGridEmitCustom ------------------------------- +00546 +00548 struct NvFlowGridEmitCustomAllocParams +00549 { +00550 NvFlowResourceRW* maskResourceRW; +00551 +00552 NvFlowDim maskDim; +00553 +00554 NvFlowFloat3 gridLocation; +00555 NvFlowFloat3 gridHalfSize; 00556 -00558 struct NvFlowGridEmitCustomEmitParams -00559 { -00560 NvFlowGrid* grid; -00561 NvFlowUint numLayers; -00562 void* flowInternal; -00563 }; -00564 -00566 struct NvFlowGridEmitCustomEmitLayerParams -00567 { -00568 NvFlowResourceRW* dataRW[2u]; -00569 NvFlowResource* blockTable; -00570 NvFlowResource* blockList; -00571 -00572 NvFlowShaderPointParams shaderParams; -00573 -00574 NvFlowUint numBlocks; -00575 NvFlowUint maxBlocks; -00576 -00577 NvFlowFloat3 gridLocation; -00578 NvFlowFloat3 gridHalfSize; -00579 -00580 NvFlowGridMaterialHandle material; -00581 }; -00582 -00583 typedef void(*NvFlowGridEmitCustomEmitFunc)(void* userdata, NvFlowUint* dataFrontIdx, const NvFlowGridEmitCustomEmitParams* params); -00584 -00593 NV_FLOW_API void NvFlowGridEmitCustomRegisterEmitFunc(NvFlowGrid* grid, NvFlowGridTextureChannel channel, NvFlowGridEmitCustomEmitFunc func, void* userdata); -00594 -00602 NV_FLOW_API void NvFlowGridEmitCustomGetLayerParams(const NvFlowGridEmitCustomEmitParams* emitParams, NvFlowUint layerIdx, NvFlowGridEmitCustomEmitLayerParams* emitLayerParams); -00603 -00605 // -------------------------- NvFlowGridExportImport ------------------------------- -00608 -00610 struct NvFlowGridExportImportLayerMapping -00611 { -00612 NvFlowGridMaterialHandle material; -00613 -00614 NvFlowResource* blockTable; -00615 NvFlowResource* blockList; -00616 -00617 NvFlowUint numBlocks; -00618 }; -00619 -00621 struct NvFlowGridExportImportLayeredMapping -00622 { -00623 NvFlowShaderLinearParams shaderParams; -00624 NvFlowUint maxBlocks; -00625 -00626 NvFlowUint2* layeredBlockListCPU; -00627 NvFlowUint layeredNumBlocks; -00628 -00629 NvFlowFloat4x4 modelMatrix; -00630 }; -00631 -00633 // -------------------------- NvFlowGridExport ------------------------------- -00636 -00638 struct NvFlowGridExportHandle -00639 { -00640 NvFlowGridExport* gridExport; -00641 NvFlowGridTextureChannel channel; -00642 NvFlowUint numLayerViews; -00643 }; -00644 -00646 struct NvFlowGridExportLayerView -00647 { -00648 NvFlowResource* data; -00649 NvFlowGridExportImportLayerMapping mapping; -00650 }; -00651 -00653 struct NvFlowGridExportLayeredView -00654 { -00655 NvFlowGridExportImportLayeredMapping mapping; -00656 }; -00657 -00659 struct NvFlowGridExportSimpleShape -00660 { -00661 NvFlowFloat4x4 localToWorld; -00662 NvFlowShapeDesc shapeDesc; -00663 }; -00664 -00666 struct NvFlowGridExportDebugVisView -00667 { -00668 NvFlowGridDebugVisFlags debugVisFlags; -00669 -00670 NvFlowFloat4x4* bounds; -00671 NvFlowUint numBounds; -00672 NvFlowGridExportSimpleShape* spheres; -00673 NvFlowUint numSpheres; -00674 NvFlowGridExportSimpleShape* capsules; -00675 NvFlowUint numCapsules; -00676 NvFlowGridExportSimpleShape* boxes; -00677 NvFlowUint numBoxes; -00678 }; -00679 -00689 NV_FLOW_API NvFlowGridExportHandle NvFlowGridExportGetHandle(NvFlowGridExport* gridExport, NvFlowContext* context, NvFlowGridTextureChannel channel); -00690 -00698 NV_FLOW_API void NvFlowGridExportGetLayerView(NvFlowGridExportHandle handle, NvFlowUint layerIdx, NvFlowGridExportLayerView* layerView); -00699 -00706 NV_FLOW_API void NvFlowGridExportGetLayeredView(NvFlowGridExportHandle handle, NvFlowGridExportLayeredView* layeredView); -00707 -00714 NV_FLOW_API void NvFlowGridExportGetDebugVisView(NvFlowGridExport* gridExport, NvFlowGridExportDebugVisView* view); -00715 -00717 // -------------------------- NvFlowGridImport ------------------------------- -00720 -00722 struct NvFlowGridImport; -00723 -00725 struct NvFlowGridImportDesc -00726 { -00727 NvFlowGridExport* gridExport; -00728 }; +00557 NvFlowGridMaterialHandle material; +00558 }; +00559 +00560 typedef void(*NvFlowGridEmitCustomAllocFunc)(void* userdata, const NvFlowGridEmitCustomAllocParams* params); +00561 +00569 NV_FLOW_API void NvFlowGridEmitCustomRegisterAllocFunc(NvFlowGrid* grid, NvFlowGridEmitCustomAllocFunc func, void* userdata); +00570 +00572 struct NvFlowGridEmitCustomEmitParams +00573 { +00574 NvFlowGrid* grid; +00575 NvFlowUint numLayers; +00576 void* flowInternal; +00577 }; +00578 +00580 struct NvFlowGridEmitCustomEmitLayerParams +00581 { +00582 NvFlowResourceRW* dataRW[2u]; +00583 NvFlowResource* blockTable; +00584 NvFlowResource* blockList; +00585 +00586 NvFlowShaderPointParams shaderParams; +00587 +00588 NvFlowUint numBlocks; +00589 NvFlowUint maxBlocks; +00590 +00591 NvFlowFloat3 gridLocation; +00592 NvFlowFloat3 gridHalfSize; +00593 +00594 NvFlowGridMaterialHandle material; +00595 }; +00596 +00597 typedef void(*NvFlowGridEmitCustomEmitFunc)(void* userdata, NvFlowUint* dataFrontIdx, const NvFlowGridEmitCustomEmitParams* params); +00598 +00607 NV_FLOW_API void NvFlowGridEmitCustomRegisterEmitFunc(NvFlowGrid* grid, NvFlowGridTextureChannel channel, NvFlowGridEmitCustomEmitFunc func, void* userdata); +00608 +00616 NV_FLOW_API void NvFlowGridEmitCustomGetLayerParams(const NvFlowGridEmitCustomEmitParams* emitParams, NvFlowUint layerIdx, NvFlowGridEmitCustomEmitLayerParams* emitLayerParams); +00617 +00619 // -------------------------- NvFlowGridExportImport ------------------------------- +00622 +00624 struct NvFlowGridExportImportLayerMapping +00625 { +00626 NvFlowGridMaterialHandle material; +00627 +00628 NvFlowResource* blockTable; +00629 NvFlowResource* blockList; +00630 +00631 NvFlowUint numBlocks; +00632 }; +00633 +00635 struct NvFlowGridExportImportLayeredMapping +00636 { +00637 NvFlowShaderLinearParams shaderParams; +00638 NvFlowUint maxBlocks; +00639 +00640 NvFlowUint2* layeredBlockListCPU; +00641 NvFlowUint layeredNumBlocks; +00642 +00643 NvFlowFloat4x4 modelMatrix; +00644 }; +00645 +00647 // -------------------------- NvFlowGridExport ------------------------------- +00650 +00652 struct NvFlowGridExportHandle +00653 { +00654 NvFlowGridExport* gridExport; +00655 NvFlowGridTextureChannel channel; +00656 NvFlowUint numLayerViews; +00657 }; +00658 +00660 struct NvFlowGridExportLayerView +00661 { +00662 NvFlowResource* data; +00663 NvFlowGridExportImportLayerMapping mapping; +00664 }; +00665 +00667 struct NvFlowGridExportLayeredView +00668 { +00669 NvFlowGridExportImportLayeredMapping mapping; +00670 }; +00671 +00673 struct NvFlowGridExportSimpleShape +00674 { +00675 NvFlowFloat4x4 localToWorld; +00676 NvFlowShapeDesc shapeDesc; +00677 }; +00678 +00680 struct NvFlowGridExportDebugVisView +00681 { +00682 NvFlowGridDebugVisFlags debugVisFlags; +00683 +00684 NvFlowFloat4x4* bounds; +00685 NvFlowUint numBounds; +00686 NvFlowGridExportSimpleShape* spheres; +00687 NvFlowUint numSpheres; +00688 NvFlowGridExportSimpleShape* capsules; +00689 NvFlowUint numCapsules; +00690 NvFlowGridExportSimpleShape* boxes; +00691 NvFlowUint numBoxes; +00692 }; +00693 +00703 NV_FLOW_API NvFlowGridExportHandle NvFlowGridExportGetHandle(NvFlowGridExport* gridExport, NvFlowContext* context, NvFlowGridTextureChannel channel); +00704 +00712 NV_FLOW_API void NvFlowGridExportGetLayerView(NvFlowGridExportHandle handle, NvFlowUint layerIdx, NvFlowGridExportLayerView* layerView); +00713 +00720 NV_FLOW_API void NvFlowGridExportGetLayeredView(NvFlowGridExportHandle handle, NvFlowGridExportLayeredView* layeredView); +00721 +00728 NV_FLOW_API void NvFlowGridExportGetDebugVisView(NvFlowGridExport* gridExport, NvFlowGridExportDebugVisView* view); 00729 -00731 enum NvFlowGridImportMode -00732 { -00733 eNvFlowGridImportModePoint = 0, -00734 eNvFlowGridImportModeLinear = 1 -00735 }; -00736 -00738 struct NvFlowGridImportParams -00739 { -00740 NvFlowGridExport* gridExport; -00741 NvFlowGridTextureChannel channel; -00742 NvFlowGridImportMode importMode; -00743 }; -00744 -00746 struct NvFlowGridImportHandle -00747 { -00748 NvFlowGridImport* gridImport; -00749 NvFlowGridTextureChannel channel; -00750 NvFlowUint numLayerViews; -00751 }; -00752 -00754 struct NvFlowGridImportLayerView -00755 { -00756 NvFlowResourceRW* dataRW; -00757 NvFlowResourceRW* blockTableRW; -00758 NvFlowResourceRW* blockListRW; -00759 NvFlowGridExportImportLayerMapping mapping; -00760 }; -00761 -00763 struct NvFlowGridImportLayeredView -00764 { -00765 NvFlowGridExportImportLayeredMapping mapping; -00766 }; -00767 -00776 NV_FLOW_API NvFlowGridImport* NvFlowCreateGridImport(NvFlowContext* context, const NvFlowGridImportDesc* desc); -00777 -00783 NV_FLOW_API void NvFlowReleaseGridImport(NvFlowGridImport* gridImport); -00784 -00794 NV_FLOW_API NvFlowGridImportHandle NvFlowGridImportGetHandle(NvFlowGridImport* gridImport, NvFlowContext* context, const NvFlowGridImportParams* params); -00795 -00803 NV_FLOW_API void NvFlowGridImportGetLayerView(NvFlowGridImportHandle handle, NvFlowUint layerIdx, NvFlowGridImportLayerView* layerView); -00804 -00811 NV_FLOW_API void NvFlowGridImportGetLayeredView(NvFlowGridImportHandle handle, NvFlowGridImportLayeredView* layeredView); -00812 -00820 NV_FLOW_API void NvFlowGridImportReleaseChannel(NvFlowGridImport* gridImport, NvFlowContext* context, NvFlowGridTextureChannel channel); -00821 -00830 NV_FLOW_API NvFlowGridExport* NvFlowGridImportGetGridExport(NvFlowGridImport* gridImport, NvFlowContext* context); -00831 -00833 struct NvFlowGridImportStateCPU; -00834 -00836 struct NvFlowGridImportStateCPUParams -00837 { -00838 NvFlowGridImportStateCPU* stateCPU; -00839 NvFlowGridTextureChannel channel; -00840 NvFlowGridImportMode importMode; -00841 }; -00842 -00850 NV_FLOW_API NvFlowGridImportStateCPU* NvFlowCreateGridImportStateCPU(NvFlowGridImport* gridImport); -00851 -00857 NV_FLOW_API void NvFlowReleaseGridImportStateCPU(NvFlowGridImportStateCPU* stateCPU); -00858 -00866 NV_FLOW_API void NvFlowGridImportUpdateStateCPU(NvFlowGridImportStateCPU* stateCPU, NvFlowContext* context, NvFlowGridExport* gridExport); -00867 -00877 NV_FLOW_API NvFlowGridImportHandle NvFlowGridImportStateCPUGetHandle(NvFlowGridImport* gridImport, NvFlowContext* context, const NvFlowGridImportStateCPUParams* params); -00878 -00880 // -------------------------- NvFlowRenderMaterial ------------------------------- -00883 -00885 struct NvFlowRenderMaterialPool; -00886 -00888 struct NvFlowRenderMaterialPoolDesc -00889 { -00890 NvFlowUint colorMapResolution; -00891 }; +00731 // -------------------------- NvFlowGridImport ------------------------------- +00734 +00736 struct NvFlowGridImport; +00737 +00739 struct NvFlowGridImportDesc +00740 { +00741 NvFlowGridExport* gridExport; +00742 }; +00743 +00745 enum NvFlowGridImportMode +00746 { +00747 eNvFlowGridImportModePoint = 0, +00748 eNvFlowGridImportModeLinear = 1 +00749 }; +00750 +00752 struct NvFlowGridImportParams +00753 { +00754 NvFlowGridExport* gridExport; +00755 NvFlowGridTextureChannel channel; +00756 NvFlowGridImportMode importMode; +00757 }; +00758 +00760 struct NvFlowGridImportHandle +00761 { +00762 NvFlowGridImport* gridImport; +00763 NvFlowGridTextureChannel channel; +00764 NvFlowUint numLayerViews; +00765 }; +00766 +00768 struct NvFlowGridImportLayerView +00769 { +00770 NvFlowResourceRW* dataRW; +00771 NvFlowResourceRW* blockTableRW; +00772 NvFlowResourceRW* blockListRW; +00773 NvFlowGridExportImportLayerMapping mapping; +00774 }; +00775 +00777 struct NvFlowGridImportLayeredView +00778 { +00779 NvFlowGridExportImportLayeredMapping mapping; +00780 }; +00781 +00790 NV_FLOW_API NvFlowGridImport* NvFlowCreateGridImport(NvFlowContext* context, const NvFlowGridImportDesc* desc); +00791 +00797 NV_FLOW_API void NvFlowReleaseGridImport(NvFlowGridImport* gridImport); +00798 +00808 NV_FLOW_API NvFlowGridImportHandle NvFlowGridImportGetHandle(NvFlowGridImport* gridImport, NvFlowContext* context, const NvFlowGridImportParams* params); +00809 +00817 NV_FLOW_API void NvFlowGridImportGetLayerView(NvFlowGridImportHandle handle, NvFlowUint layerIdx, NvFlowGridImportLayerView* layerView); +00818 +00825 NV_FLOW_API void NvFlowGridImportGetLayeredView(NvFlowGridImportHandle handle, NvFlowGridImportLayeredView* layeredView); +00826 +00834 NV_FLOW_API void NvFlowGridImportReleaseChannel(NvFlowGridImport* gridImport, NvFlowContext* context, NvFlowGridTextureChannel channel); +00835 +00844 NV_FLOW_API NvFlowGridExport* NvFlowGridImportGetGridExport(NvFlowGridImport* gridImport, NvFlowContext* context); +00845 +00847 struct NvFlowGridImportStateCPU; +00848 +00850 struct NvFlowGridImportStateCPUParams +00851 { +00852 NvFlowGridImportStateCPU* stateCPU; +00853 NvFlowGridTextureChannel channel; +00854 NvFlowGridImportMode importMode; +00855 }; +00856 +00864 NV_FLOW_API NvFlowGridImportStateCPU* NvFlowCreateGridImportStateCPU(NvFlowGridImport* gridImport); +00865 +00871 NV_FLOW_API void NvFlowReleaseGridImportStateCPU(NvFlowGridImportStateCPU* stateCPU); +00872 +00880 NV_FLOW_API void NvFlowGridImportUpdateStateCPU(NvFlowGridImportStateCPU* stateCPU, NvFlowContext* context, NvFlowGridExport* gridExport); +00881 +00891 NV_FLOW_API NvFlowGridImportHandle NvFlowGridImportStateCPUGetHandle(NvFlowGridImport* gridImport, NvFlowContext* context, const NvFlowGridImportStateCPUParams* params); 00892 -00901 NV_FLOW_API NvFlowRenderMaterialPool* NvFlowCreateRenderMaterialPool(NvFlowContext* context, const NvFlowRenderMaterialPoolDesc* desc); -00902 -00908 NV_FLOW_API void NvFlowReleaseRenderMaterialPool(NvFlowRenderMaterialPool* pool); -00909 -00911 struct NvFlowRenderMaterialHandle -00912 { -00913 NvFlowRenderMaterialPool* pool; -00914 NvFlowUint64 uid; -00915 }; +00894 // -------------------------- NvFlowGridSummary ------------------------------- +00897 +00899 struct NvFlowGridSummary; +00900 +00902 struct NvFlowGridSummaryDesc +00903 { +00904 NvFlowGridExport* gridExport; +00905 }; +00906 +00915 NV_FLOW_API NvFlowGridSummary* NvFlowCreateGridSummary(NvFlowContext* context, const NvFlowGridSummaryDesc* desc); 00916 -00918 enum NvFlowVolumeRenderMode -00919 { -00920 eNvFlowVolumeRenderMode_colormap = 0, -00921 eNvFlowVolumeRenderMode_raw = 1, -00922 eNvFlowVolumeRenderMode_rainbow = 2, -00923 eNvFlowVolumeRenderMode_debug = 3, -00924 -00925 eNvFlowVolumeRenderModeCount -00926 }; -00927 -00929 struct NvFlowRenderMaterialParams -00930 { -00931 NvFlowGridMaterialHandle material; -00932 -00933 float alphaScale; -00934 float additiveFactor; +00922 NV_FLOW_API void NvFlowReleaseGridSummary(NvFlowGridSummary* gridSummary); +00923 +00925 struct NvFlowGridSummaryStateCPU; +00926 +00934 NV_FLOW_API NvFlowGridSummaryStateCPU* NvFlowCreateGridSummaryStateCPU(NvFlowGridSummary* gridSummary); 00935 -00936 NvFlowFloat4 colorMapCompMask; -00937 NvFlowFloat4 alphaCompMask; -00938 NvFlowFloat4 intensityCompMask; -00939 -00940 float colorMapMinX; -00941 float colorMapMaxX; -00942 float alphaBias; -00943 float intensityBias; -00944 }; -00945 -00951 NV_FLOW_API void NvFlowRenderMaterialParamsDefaults(NvFlowRenderMaterialParams* params); -00952 -00960 NV_FLOW_API NvFlowRenderMaterialHandle NvFlowGetDefaultRenderMaterial(NvFlowRenderMaterialPool* pool); -00961 -00971 NV_FLOW_API NvFlowRenderMaterialHandle NvFlowCreateRenderMaterial(NvFlowContext* context, NvFlowRenderMaterialPool* pool, const NvFlowRenderMaterialParams* params); -00972 -00978 NV_FLOW_API void NvFlowReleaseRenderMaterial(NvFlowRenderMaterialHandle handle); +00941 NV_FLOW_API void NvFlowReleaseGridSummaryStateCPU(NvFlowGridSummaryStateCPU* stateCPU); +00942 +00944 struct NvFlowGridSummaryUpdateParams +00945 { +00946 NvFlowGridSummaryStateCPU* stateCPU; +00947 +00948 NvFlowGridExport* gridExport; +00949 }; +00950 +00958 NV_FLOW_API void NvFlowGridSummaryUpdate(NvFlowGridSummary* gridSummary, NvFlowContext* context, const NvFlowGridSummaryUpdateParams* params); +00959 +00961 struct NvFlowGridSummaryDebugRenderParams +00962 { +00963 NvFlowGridSummaryStateCPU* stateCPU; +00964 +00965 NvFlowRenderTargetView* renderTargetView; +00966 +00967 NvFlowFloat4x4 projectionMatrix; +00968 NvFlowFloat4x4 viewMatrix; +00969 }; +00970 +00978 NV_FLOW_API void NvFlowGridSummaryDebugRender(NvFlowGridSummary* gridSummary, NvFlowContext* context, const NvFlowGridSummaryDebugRenderParams* params); 00979 -00986 NV_FLOW_API void NvFlowRenderMaterialUpdate(NvFlowRenderMaterialHandle handle, const NvFlowRenderMaterialParams* params); -00987 -00989 struct NvFlowColorMapData -00990 { -00991 NvFlowFloat4* data; -00992 NvFlowUint dim; -00993 }; -00994 -01003 NV_FLOW_API NvFlowColorMapData NvFlowRenderMaterialColorMap(NvFlowContext* context, NvFlowRenderMaterialHandle handle); -01004 -01011 NV_FLOW_API void NvFlowRenderMaterialColorUnmap(NvFlowContext* context, NvFlowRenderMaterialHandle handle); -01012 -01014 // -------------------------- NvFlowVolumeRender ------------------------------- -01017 -01019 struct NvFlowVolumeRender; -01020 -01022 struct NvFlowVolumeRenderDesc -01023 { -01024 NvFlowGridExport* gridExport; -01025 }; -01026 -01035 NV_FLOW_API NvFlowVolumeRender* NvFlowCreateVolumeRender(NvFlowContext* context, const NvFlowVolumeRenderDesc* desc); -01036 -01042 NV_FLOW_API void NvFlowReleaseVolumeRender(NvFlowVolumeRender* volumeRender); -01043 -01045 enum NvFlowVolumeRenderDownsample -01046 { -01047 eNvFlowVolumeRenderDownsampleNone = 0, -01048 eNvFlowVolumeRenderDownsample2x2 = 1 -01049 }; -01050 -01052 enum NvFlowMultiResRayMarch -01053 { -01054 eNvFlowMultiResRayMarchDisabled = 0, -01055 eNvFlowMultiResRayMarch2x2 = 1, -01056 eNvFlowMultiResRayMarch4x4 = 2, -01057 eNvFlowMultiResRayMarch8x8 = 3, -01058 eNvFlowMultiResRayMarch16x16 = 4, -01059 }; -01060 -01062 struct NvFlowVolumeRenderViewport -01063 { -01064 float topLeftX; -01065 float topLeftY; -01066 float width; -01067 float height; -01068 }; -01069 -01071 struct NvFlowVolumeRenderMultiResParams -01072 { -01073 bool enabled; -01074 float centerWidth; -01075 float centerHeight; -01076 float centerX; -01077 float centerY; -01078 float densityScaleX[3]; -01079 float densityScaleY[3]; -01080 NvFlowVolumeRenderViewport viewport; -01081 float nonMultiResWidth; -01082 float nonMultiResHeight; -01083 }; -01084 -01086 struct NvFlowVolumeRenderLMSParams -01087 { -01088 bool enabled; -01089 float warpLeft; -01090 float warpRight; -01091 float warpUp; -01092 float warpDown; -01093 float sizeLeft; -01094 float sizeRight; -01095 float sizeUp; -01096 float sizeDown; -01097 NvFlowVolumeRenderViewport viewport; -01098 float nonLMSWidth; -01099 float nonLMSHeight; -01100 }; -01101 -01103 struct NvFlowVolumeRenderParams -01104 { -01105 NvFlowFloat4x4 projectionMatrix; -01106 NvFlowFloat4x4 viewMatrix; -01107 NvFlowFloat4x4 modelMatrix; -01108 -01109 NvFlowDepthStencilView* depthStencilView; -01110 NvFlowRenderTargetView* renderTargetView; -01111 -01112 NvFlowRenderMaterialPool* materialPool; -01113 -01114 NvFlowVolumeRenderMode renderMode; -01115 NvFlowGridTextureChannel renderChannel; -01116 -01117 bool debugMode; -01118 -01119 NvFlowVolumeRenderDownsample downsampleFactor; -01120 float screenPercentage; -01121 NvFlowMultiResRayMarch multiResRayMarch; -01122 float multiResSamplingScale; -01123 -01124 bool smoothColorUpsample; -01125 -01126 bool preColorCompositeOnly; -01127 bool colorCompositeOnly; -01128 bool generateDepth; -01129 bool generateDepthDebugMode; -01130 float depthAlphaThreshold; -01131 float depthIntensityThreshold; -01132 -01133 NvFlowVolumeRenderMultiResParams multiRes; -01134 -01135 NvFlowVolumeRenderLMSParams lensMatchedShading; +00981 struct NvFlowGridSummaryResult +00982 { +00983 NvFlowFloat4 worldLocation; +00984 NvFlowFloat4 worldHalfSize; +00985 NvFlowFloat3 averageVelocity; +00986 float averageSpeed; +00987 float averageTemperature; +00988 float averageFuel; +00989 float averageBurn; +00990 float averageSmoke; +00991 }; +00992 +01000 NV_FLOW_API NvFlowUint NvFlowGridSummaryGetNumLayers(NvFlowGridSummaryStateCPU* stateCPU); +01001 +01010 NV_FLOW_API NvFlowGridMaterialHandle NvFlowGridSummaryGetLayerMaterial(NvFlowGridSummaryStateCPU* stateCPU, NvFlowUint layerIdx); +01011 +01020 NV_FLOW_API void NvFlowGridSummaryGetSummaries(NvFlowGridSummaryStateCPU* stateCPU, NvFlowGridSummaryResult** results, NvFlowUint* numResults, NvFlowUint layerIdx); +01021 +01023 // -------------------------- NvFlowRenderMaterial ------------------------------- +01026 +01028 struct NvFlowRenderMaterialPool; +01029 +01031 struct NvFlowRenderMaterialPoolDesc +01032 { +01033 NvFlowUint colorMapResolution; +01034 }; +01035 +01044 NV_FLOW_API NvFlowRenderMaterialPool* NvFlowCreateRenderMaterialPool(NvFlowContext* context, const NvFlowRenderMaterialPoolDesc* desc); +01045 +01051 NV_FLOW_API void NvFlowReleaseRenderMaterialPool(NvFlowRenderMaterialPool* pool); +01052 +01054 struct NvFlowRenderMaterialHandle +01055 { +01056 NvFlowRenderMaterialPool* pool; +01057 NvFlowUint64 uid; +01058 }; +01059 +01061 enum NvFlowVolumeRenderMode +01062 { +01063 eNvFlowVolumeRenderMode_colormap = 0, +01064 eNvFlowVolumeRenderMode_raw = 1, +01065 eNvFlowVolumeRenderMode_rainbow = 2, +01066 eNvFlowVolumeRenderMode_debug = 3, +01067 +01068 eNvFlowVolumeRenderModeCount +01069 }; +01070 +01072 struct NvFlowRenderMaterialParams +01073 { +01074 NvFlowGridMaterialHandle material; +01075 +01076 float alphaScale; +01077 float additiveFactor; +01078 +01079 NvFlowFloat4 colorMapCompMask; +01080 NvFlowFloat4 alphaCompMask; +01081 NvFlowFloat4 intensityCompMask; +01082 +01083 float colorMapMinX; +01084 float colorMapMaxX; +01085 float alphaBias; +01086 float intensityBias; +01087 }; +01088 +01094 NV_FLOW_API void NvFlowRenderMaterialParamsDefaults(NvFlowRenderMaterialParams* params); +01095 +01103 NV_FLOW_API NvFlowRenderMaterialHandle NvFlowGetDefaultRenderMaterial(NvFlowRenderMaterialPool* pool); +01104 +01114 NV_FLOW_API NvFlowRenderMaterialHandle NvFlowCreateRenderMaterial(NvFlowContext* context, NvFlowRenderMaterialPool* pool, const NvFlowRenderMaterialParams* params); +01115 +01121 NV_FLOW_API void NvFlowReleaseRenderMaterial(NvFlowRenderMaterialHandle handle); +01122 +01129 NV_FLOW_API void NvFlowRenderMaterialUpdate(NvFlowRenderMaterialHandle handle, const NvFlowRenderMaterialParams* params); +01130 +01132 struct NvFlowColorMapData +01133 { +01134 NvFlowFloat4* data; +01135 NvFlowUint dim; 01136 }; 01137 -01143 NV_FLOW_API void NvFlowVolumeRenderParamsDefaults(NvFlowVolumeRenderParams* params); -01144 -01146 struct NvFlowVolumeLightingParams -01147 { -01148 NvFlowRenderMaterialPool* materialPool; -01149 -01150 NvFlowVolumeRenderMode renderMode; -01151 NvFlowGridTextureChannel renderChannel; -01152 }; -01153 -01164 NV_FLOW_API NvFlowGridExport* NvFlowVolumeRenderLightGridExport(NvFlowVolumeRender* volumeRender, NvFlowContext* context, NvFlowGridExport* gridExport, const NvFlowVolumeLightingParams* params); -01165 -01174 NV_FLOW_API void NvFlowVolumeRenderGridExport(NvFlowVolumeRender* volumeRender, NvFlowContext* context, NvFlowGridExport* gridExport, const NvFlowVolumeRenderParams* params); -01175 -01184 NV_FLOW_API void NvFlowVolumeRenderTexture3D(NvFlowVolumeRender* volumeRender, NvFlowContext* context, NvFlowTexture3D* density, const NvFlowVolumeRenderParams* params); -01185 -01187 // -------------------------- NvFlowVolumeShadow ------------------------------- -01190 -01192 struct NvFlowVolumeShadow; +01146 NV_FLOW_API NvFlowColorMapData NvFlowRenderMaterialColorMap(NvFlowContext* context, NvFlowRenderMaterialHandle handle); +01147 +01154 NV_FLOW_API void NvFlowRenderMaterialColorUnmap(NvFlowContext* context, NvFlowRenderMaterialHandle handle); +01155 +01157 // -------------------------- NvFlowVolumeRender ------------------------------- +01160 +01162 struct NvFlowVolumeRender; +01163 +01165 struct NvFlowVolumeRenderDesc +01166 { +01167 NvFlowGridExport* gridExport; +01168 }; +01169 +01178 NV_FLOW_API NvFlowVolumeRender* NvFlowCreateVolumeRender(NvFlowContext* context, const NvFlowVolumeRenderDesc* desc); +01179 +01185 NV_FLOW_API void NvFlowReleaseVolumeRender(NvFlowVolumeRender* volumeRender); +01186 +01188 enum NvFlowVolumeRenderDownsample +01189 { +01190 eNvFlowVolumeRenderDownsampleNone = 0, +01191 eNvFlowVolumeRenderDownsample2x2 = 1 +01192 }; 01193 -01195 struct NvFlowVolumeShadowDesc +01195 enum NvFlowMultiResRayMarch 01196 { -01197 NvFlowGridExport* gridExport; -01198 -01199 NvFlowUint mapWidth; -01200 NvFlowUint mapHeight; -01201 NvFlowUint mapDepth; -01202 -01203 float minResidentScale; -01204 float maxResidentScale; -01205 }; -01206 -01208 struct NvFlowVolumeShadowParams -01209 { -01210 NvFlowFloat4x4 projectionMatrix; -01211 NvFlowFloat4x4 viewMatrix; +01197 eNvFlowMultiResRayMarchDisabled = 0, +01198 eNvFlowMultiResRayMarch2x2 = 1, +01199 eNvFlowMultiResRayMarch4x4 = 2, +01200 eNvFlowMultiResRayMarch8x8 = 3, +01201 eNvFlowMultiResRayMarch16x16 = 4, +01202 }; +01203 +01205 struct NvFlowVolumeRenderViewport +01206 { +01207 float topLeftX; +01208 float topLeftY; +01209 float width; +01210 float height; +01211 }; 01212 -01213 NvFlowRenderMaterialPool* materialPool; -01214 -01215 NvFlowVolumeRenderMode renderMode; -01216 NvFlowGridTextureChannel renderChannel; -01217 -01218 float intensityScale; -01219 float minIntensity; -01220 -01221 NvFlowFloat4 shadowBlendCompMask; -01222 float shadowBlendBias; -01223 }; -01224 -01226 struct NvFlowVolumeShadowDebugRenderParams -01227 { -01228 NvFlowRenderTargetView* renderTargetView; -01229 -01230 NvFlowFloat4x4 projectionMatrix; -01231 NvFlowFloat4x4 viewMatrix; -01232 }; -01233 -01235 struct NvFlowVolumeShadowStats -01236 { -01237 NvFlowUint shadowColumnsActive; -01238 NvFlowUint shadowBlocksActive; -01239 NvFlowUint shadowCellsActive; -01240 }; -01241 -01250 NV_FLOW_API NvFlowVolumeShadow* NvFlowCreateVolumeShadow(NvFlowContext* context, const NvFlowVolumeShadowDesc* desc); +01214 struct NvFlowVolumeRenderMultiResParams +01215 { +01216 bool enabled; +01217 float centerWidth; +01218 float centerHeight; +01219 float centerX; +01220 float centerY; +01221 float densityScaleX[3]; +01222 float densityScaleY[3]; +01223 NvFlowVolumeRenderViewport viewport; +01224 float nonMultiResWidth; +01225 float nonMultiResHeight; +01226 }; +01227 +01229 struct NvFlowVolumeRenderLMSParams +01230 { +01231 bool enabled; +01232 float warpLeft; +01233 float warpRight; +01234 float warpUp; +01235 float warpDown; +01236 float sizeLeft; +01237 float sizeRight; +01238 float sizeUp; +01239 float sizeDown; +01240 NvFlowVolumeRenderViewport viewport; +01241 float nonLMSWidth; +01242 float nonLMSHeight; +01243 }; +01244 +01246 struct NvFlowVolumeRenderParams +01247 { +01248 NvFlowFloat4x4 projectionMatrix; +01249 NvFlowFloat4x4 viewMatrix; +01250 NvFlowFloat4x4 modelMatrix; 01251 -01257 NV_FLOW_API void NvFlowReleaseVolumeShadow(NvFlowVolumeShadow* volumeShadow); -01258 -01267 NV_FLOW_API void NvFlowVolumeShadowUpdate(NvFlowVolumeShadow* volumeShadow, NvFlowContext* context, NvFlowGridExport* gridExport, const NvFlowVolumeShadowParams* params); +01252 NvFlowDepthStencilView* depthStencilView; +01253 NvFlowRenderTargetView* renderTargetView; +01254 +01255 NvFlowRenderMaterialPool* materialPool; +01256 +01257 NvFlowVolumeRenderMode renderMode; +01258 NvFlowGridTextureChannel renderChannel; +01259 +01260 bool debugMode; +01261 +01262 NvFlowVolumeRenderDownsample downsampleFactor; +01263 float screenPercentage; +01264 NvFlowMultiResRayMarch multiResRayMarch; +01265 float multiResSamplingScale; +01266 +01267 bool smoothColorUpsample; 01268 -01277 NV_FLOW_API NvFlowGridExport* NvFlowVolumeShadowGetGridExport(NvFlowVolumeShadow* volumeShadow, NvFlowContext* context); -01278 -01286 NV_FLOW_API void NvFlowVolumeShadowDebugRender(NvFlowVolumeShadow* volumeShadow, NvFlowContext* context, const NvFlowVolumeShadowDebugRenderParams* params); +01269 bool preColorCompositeOnly; +01270 bool colorCompositeOnly; +01271 bool generateDepth; +01272 bool generateDepthDebugMode; +01273 float depthAlphaThreshold; +01274 float depthIntensityThreshold; +01275 +01276 NvFlowVolumeRenderMultiResParams multiRes; +01277 +01278 NvFlowVolumeRenderLMSParams lensMatchedShading; +01279 }; +01280 +01286 NV_FLOW_API void NvFlowVolumeRenderParamsDefaults(NvFlowVolumeRenderParams* params); 01287 -01294 NV_FLOW_API void NvFlowVolumeShadowGetStats(NvFlowVolumeShadow* volumeShadow, NvFlowVolumeShadowStats* stats); -01295 -01297 // -------------------------- NvFlowCrossSection ------------------------------- -01300 -01302 struct NvFlowCrossSection; -01303 -01305 struct NvFlowCrossSectionDesc -01306 { -01307 NvFlowGridExport* gridExport; -01308 }; -01309 -01311 struct NvFlowCrossSectionParams -01312 { -01313 NvFlowGridExport* gridExport; -01314 NvFlowGridExport* gridExportDebugVis; -01315 -01316 NvFlowFloat4x4 projectionMatrix; -01317 NvFlowFloat4x4 viewMatrix; +01289 struct NvFlowVolumeLightingParams +01290 { +01291 NvFlowRenderMaterialPool* materialPool; +01292 +01293 NvFlowVolumeRenderMode renderMode; +01294 NvFlowGridTextureChannel renderChannel; +01295 }; +01296 +01307 NV_FLOW_API NvFlowGridExport* NvFlowVolumeRenderLightGridExport(NvFlowVolumeRender* volumeRender, NvFlowContext* context, NvFlowGridExport* gridExport, const NvFlowVolumeLightingParams* params); +01308 +01317 NV_FLOW_API void NvFlowVolumeRenderGridExport(NvFlowVolumeRender* volumeRender, NvFlowContext* context, NvFlowGridExport* gridExport, const NvFlowVolumeRenderParams* params); 01318 -01319 NvFlowDepthStencilView* depthStencilView; -01320 NvFlowRenderTargetView* renderTargetView; -01321 -01322 NvFlowRenderMaterialPool* materialPool; -01323 -01324 NvFlowVolumeRenderMode renderMode; -01325 NvFlowGridTextureChannel renderChannel; -01326 -01327 NvFlowUint crossSectionAxis; -01328 NvFlowFloat3 crossSectionPosition; -01329 float crossSectionScale; -01330 -01331 float intensityScale; -01332 -01333 bool pointFilter; -01334 -01335 bool velocityVectors; -01336 float velocityScale; -01337 float vectorLengthScale; -01338 -01339 bool outlineCells; -01340 -01341 bool fullscreen; -01342 -01343 NvFlowFloat4 lineColor; -01344 NvFlowFloat4 backgroundColor; -01345 NvFlowFloat4 cellColor; -01346 }; -01347 -01353 NV_FLOW_API void NvFlowCrossSectionParamsDefaults(NvFlowCrossSectionParams* params); -01354 -01363 NV_FLOW_API NvFlowCrossSection* NvFlowCreateCrossSection(NvFlowContext* context, const NvFlowCrossSectionDesc* desc); -01364 -01370 NV_FLOW_API void NvFlowReleaseCrossSection(NvFlowCrossSection* crossSection); -01371 -01379 NV_FLOW_API void NvFlowCrossSectionRender(NvFlowCrossSection* crossSection, NvFlowContext* context, const NvFlowCrossSectionParams* params); -01380 -01382 // -------------------------- NvFlowGridProxy ------------------------------- -01385 -01387 struct NvFlowGridProxy; -01388 -01390 enum NvFlowGridProxyType -01391 { -01392 eNvFlowGridProxyTypePassThrough = 0, -01393 eNvFlowGridProxyTypeMultiGPU = 1, -01394 eNvFlowGridProxyTypeInterQueue = 2, -01395 }; -01396 -01398 struct NvFlowGridProxyDesc -01399 { -01400 NvFlowContext* gridContext; -01401 NvFlowContext* renderContext; -01402 NvFlowContext* gridCopyContext; -01403 NvFlowContext* renderCopyContext; -01404 -01405 NvFlowGridExport* gridExport; -01406 -01407 NvFlowGridProxyType proxyType; -01408 }; -01409 -01411 struct NvFlowGridProxyFlushParams -01412 { -01413 NvFlowContext* gridContext; -01414 NvFlowContext* gridCopyContext; -01415 NvFlowContext* renderCopyContext; -01416 }; -01417 -01425 NV_FLOW_API NvFlowGridProxy* NvFlowCreateGridProxy(const NvFlowGridProxyDesc* desc); -01426 -01432 NV_FLOW_API void NvFlowReleaseGridProxy(NvFlowGridProxy* proxy); -01433 -01441 NV_FLOW_API void NvFlowGridProxyPush(NvFlowGridProxy* proxy, NvFlowGridExport* gridExport, const NvFlowGridProxyFlushParams* params); -01442 -01449 NV_FLOW_API void NvFlowGridProxyFlush(NvFlowGridProxy* proxy, const NvFlowGridProxyFlushParams* params); -01450 -01459 NV_FLOW_API NvFlowGridExport* NvFlowGridProxyGetGridExport(NvFlowGridProxy* proxy, NvFlowContext* renderContext); -01460 -01462 // -------------------------- NvFlowDevice ------------------------------- -01465 -01467 struct NvFlowDevice; -01468 -01470 enum NvFlowDeviceMode -01471 { -01472 eNvFlowDeviceModeProxy = 0, -01473 eNvFlowDeviceModeUnique = 1, -01474 }; +01327 NV_FLOW_API void NvFlowVolumeRenderTexture3D(NvFlowVolumeRender* volumeRender, NvFlowContext* context, NvFlowTexture3D* density, const NvFlowVolumeRenderParams* params); +01328 +01330 // -------------------------- NvFlowVolumeShadow ------------------------------- +01333 +01335 struct NvFlowVolumeShadow; +01336 +01338 struct NvFlowVolumeShadowDesc +01339 { +01340 NvFlowGridExport* gridExport; +01341 +01342 NvFlowUint mapWidth; +01343 NvFlowUint mapHeight; +01344 NvFlowUint mapDepth; +01345 +01346 float minResidentScale; +01347 float maxResidentScale; +01348 }; +01349 +01351 struct NvFlowVolumeShadowParams +01352 { +01353 NvFlowFloat4x4 projectionMatrix; +01354 NvFlowFloat4x4 viewMatrix; +01355 +01356 NvFlowRenderMaterialPool* materialPool; +01357 +01358 NvFlowVolumeRenderMode renderMode; +01359 NvFlowGridTextureChannel renderChannel; +01360 +01361 float intensityScale; +01362 float minIntensity; +01363 +01364 NvFlowFloat4 shadowBlendCompMask; +01365 float shadowBlendBias; +01366 }; +01367 +01369 struct NvFlowVolumeShadowDebugRenderParams +01370 { +01371 NvFlowRenderTargetView* renderTargetView; +01372 +01373 NvFlowFloat4x4 projectionMatrix; +01374 NvFlowFloat4x4 viewMatrix; +01375 }; +01376 +01378 struct NvFlowVolumeShadowStats +01379 { +01380 NvFlowUint shadowColumnsActive; +01381 NvFlowUint shadowBlocksActive; +01382 NvFlowUint shadowCellsActive; +01383 }; +01384 +01393 NV_FLOW_API NvFlowVolumeShadow* NvFlowCreateVolumeShadow(NvFlowContext* context, const NvFlowVolumeShadowDesc* desc); +01394 +01400 NV_FLOW_API void NvFlowReleaseVolumeShadow(NvFlowVolumeShadow* volumeShadow); +01401 +01410 NV_FLOW_API void NvFlowVolumeShadowUpdate(NvFlowVolumeShadow* volumeShadow, NvFlowContext* context, NvFlowGridExport* gridExport, const NvFlowVolumeShadowParams* params); +01411 +01420 NV_FLOW_API NvFlowGridExport* NvFlowVolumeShadowGetGridExport(NvFlowVolumeShadow* volumeShadow, NvFlowContext* context); +01421 +01429 NV_FLOW_API void NvFlowVolumeShadowDebugRender(NvFlowVolumeShadow* volumeShadow, NvFlowContext* context, const NvFlowVolumeShadowDebugRenderParams* params); +01430 +01437 NV_FLOW_API void NvFlowVolumeShadowGetStats(NvFlowVolumeShadow* volumeShadow, NvFlowVolumeShadowStats* stats); +01438 +01440 // -------------------------- NvFlowCrossSection ------------------------------- +01443 +01445 struct NvFlowCrossSection; +01446 +01448 struct NvFlowCrossSectionDesc +01449 { +01450 NvFlowGridExport* gridExport; +01451 }; +01452 +01454 struct NvFlowCrossSectionParams +01455 { +01456 NvFlowGridExport* gridExport; +01457 NvFlowGridExport* gridExportDebugVis; +01458 +01459 NvFlowFloat4x4 projectionMatrix; +01460 NvFlowFloat4x4 viewMatrix; +01461 +01462 NvFlowDepthStencilView* depthStencilView; +01463 NvFlowRenderTargetView* renderTargetView; +01464 +01465 NvFlowRenderMaterialPool* materialPool; +01466 +01467 NvFlowVolumeRenderMode renderMode; +01468 NvFlowGridTextureChannel renderChannel; +01469 +01470 NvFlowUint crossSectionAxis; +01471 NvFlowFloat3 crossSectionPosition; +01472 float crossSectionScale; +01473 +01474 float intensityScale; 01475 -01477 struct NvFlowDeviceDesc -01478 { -01479 NvFlowDeviceMode mode; -01480 bool autoSelectDevice; -01481 NvFlowUint adapterIdx; -01482 }; +01476 bool pointFilter; +01477 +01478 bool velocityVectors; +01479 float velocityScale; +01480 float vectorLengthScale; +01481 +01482 bool outlineCells; 01483 -01489 NV_FLOW_API void NvFlowDeviceDescDefaults(NvFlowDeviceDesc* desc); +01484 bool fullscreen; +01485 +01486 NvFlowFloat4 lineColor; +01487 NvFlowFloat4 backgroundColor; +01488 NvFlowFloat4 cellColor; +01489 }; 01490 -01498 NV_FLOW_API bool NvFlowDedicatedDeviceAvailable(NvFlowContext* renderContext); -01499 -01507 NV_FLOW_API bool NvFlowDedicatedDeviceQueueAvailable(NvFlowContext* renderContext); -01508 -01517 NV_FLOW_API NvFlowDevice* NvFlowCreateDevice(NvFlowContext* renderContext, const NvFlowDeviceDesc* desc); -01518 -01524 NV_FLOW_API void NvFlowReleaseDevice(NvFlowDevice* device); -01525 -01527 struct NvFlowDeviceQueue; -01528 -01530 enum NvFlowDeviceQueueType -01531 { -01532 eNvFlowDeviceQueueTypeGraphics = 0, -01533 eNvFlowDeviceQueueTypeCompute = 1, -01534 eNvFlowDeviceQueueTypeCopy = 2 -01535 }; -01536 -01538 struct NvFlowDeviceQueueDesc -01539 { -01540 NvFlowDeviceQueueType queueType; -01541 bool lowLatency; -01542 }; -01543 -01545 struct NvFlowDeviceQueueStatus -01546 { -01547 NvFlowUint framesInFlight; -01548 NvFlowUint64 lastFenceCompleted; -01549 NvFlowUint64 nextFenceValue; -01550 }; -01551 -01560 NV_FLOW_API NvFlowDeviceQueue* NvFlowCreateDeviceQueue(NvFlowDevice* device, const NvFlowDeviceQueueDesc* desc); -01561 -01567 NV_FLOW_API void NvFlowReleaseDeviceQueue(NvFlowDeviceQueue* deviceQueue); -01568 -01576 NV_FLOW_API NvFlowContext* NvFlowDeviceQueueCreateContext(NvFlowDeviceQueue* deviceQueue); -01577 -01585 NV_FLOW_API void NvFlowDeviceQueueUpdateContext(NvFlowDeviceQueue* deviceQueue, NvFlowContext* context, NvFlowDeviceQueueStatus* status); -01586 -01593 NV_FLOW_API void NvFlowDeviceQueueFlush(NvFlowDeviceQueue* deviceQueue, NvFlowContext* context); -01594 -01601 NV_FLOW_API void NvFlowDeviceQueueConditionalFlush(NvFlowDeviceQueue* deviceQueue, NvFlowContext* context); -01602 -01610 NV_FLOW_API void NvFlowDeviceQueueWaitOnFence(NvFlowDeviceQueue* deviceQueue, NvFlowContext* context, NvFlowUint64 fenceValue); +01496 NV_FLOW_API void NvFlowCrossSectionParamsDefaults(NvFlowCrossSectionParams* params); +01497 +01506 NV_FLOW_API NvFlowCrossSection* NvFlowCreateCrossSection(NvFlowContext* context, const NvFlowCrossSectionDesc* desc); +01507 +01513 NV_FLOW_API void NvFlowReleaseCrossSection(NvFlowCrossSection* crossSection); +01514 +01522 NV_FLOW_API void NvFlowCrossSectionRender(NvFlowCrossSection* crossSection, NvFlowContext* context, const NvFlowCrossSectionParams* params); +01523 +01525 // -------------------------- NvFlowGridProxy ------------------------------- +01528 +01530 struct NvFlowGridProxy; +01531 +01533 enum NvFlowGridProxyType +01534 { +01535 eNvFlowGridProxyTypePassThrough = 0, +01536 eNvFlowGridProxyTypeMultiGPU = 1, +01537 eNvFlowGridProxyTypeInterQueue = 2, +01538 }; +01539 +01541 struct NvFlowGridProxyDesc +01542 { +01543 NvFlowContext* gridContext; +01544 NvFlowContext* renderContext; +01545 NvFlowContext* gridCopyContext; +01546 NvFlowContext* renderCopyContext; +01547 +01548 NvFlowGridExport* gridExport; +01549 +01550 NvFlowGridProxyType proxyType; +01551 }; +01552 +01554 struct NvFlowGridProxyFlushParams +01555 { +01556 NvFlowContext* gridContext; +01557 NvFlowContext* gridCopyContext; +01558 NvFlowContext* renderCopyContext; +01559 }; +01560 +01568 NV_FLOW_API NvFlowGridProxy* NvFlowCreateGridProxy(const NvFlowGridProxyDesc* desc); +01569 +01575 NV_FLOW_API void NvFlowReleaseGridProxy(NvFlowGridProxy* proxy); +01576 +01584 NV_FLOW_API void NvFlowGridProxyPush(NvFlowGridProxy* proxy, NvFlowGridExport* gridExport, const NvFlowGridProxyFlushParams* params); +01585 +01592 NV_FLOW_API void NvFlowGridProxyFlush(NvFlowGridProxy* proxy, const NvFlowGridProxyFlushParams* params); +01593 +01602 NV_FLOW_API NvFlowGridExport* NvFlowGridProxyGetGridExport(NvFlowGridProxy* proxy, NvFlowContext* renderContext); +01603 +01605 // -------------------------- NvFlowDevice ------------------------------- +01608 +01610 struct NvFlowDevice; 01611 -01613 // -------------------------- NvFlowSDFGenerator ------------------------------- -01616 -01618 struct NvFlowSDFGen; -01619 -01621 struct NvFlowSDFGenDesc -01622 { -01623 NvFlowDim resolution; -01624 }; -01625 -01627 struct NvFlowSDFGenMeshParams -01628 { -01629 NvFlowUint numVertices; -01630 float* positions; -01631 NvFlowUint positionStride; -01632 float* normals; -01633 NvFlowUint normalStride; -01634 -01635 NvFlowUint numIndices; -01636 NvFlowUint* indices; -01637 -01638 NvFlowFloat4x4 modelMatrix; -01639 -01640 NvFlowDepthStencilView* depthStencilView; -01641 NvFlowRenderTargetView* renderTargetView; -01642 }; -01643 -01652 NV_FLOW_API NvFlowSDFGen* NvFlowCreateSDFGen(NvFlowContext* context, const NvFlowSDFGenDesc* desc); -01653 -01659 NV_FLOW_API void NvFlowReleaseSDFGen(NvFlowSDFGen* sdfGen); -01660 -01667 NV_FLOW_API void NvFlowSDFGenReset(NvFlowSDFGen* sdfGen, NvFlowContext* context); +01613 enum NvFlowDeviceMode +01614 { +01615 eNvFlowDeviceModeProxy = 0, +01616 eNvFlowDeviceModeUnique = 1, +01617 }; +01618 +01620 struct NvFlowDeviceDesc +01621 { +01622 NvFlowDeviceMode mode; +01623 bool autoSelectDevice; +01624 NvFlowUint adapterIdx; +01625 }; +01626 +01632 NV_FLOW_API void NvFlowDeviceDescDefaults(NvFlowDeviceDesc* desc); +01633 +01641 NV_FLOW_API bool NvFlowDedicatedDeviceAvailable(NvFlowContext* renderContext); +01642 +01650 NV_FLOW_API bool NvFlowDedicatedDeviceQueueAvailable(NvFlowContext* renderContext); +01651 +01660 NV_FLOW_API NvFlowDevice* NvFlowCreateDevice(NvFlowContext* renderContext, const NvFlowDeviceDesc* desc); +01661 +01667 NV_FLOW_API void NvFlowReleaseDevice(NvFlowDevice* device); 01668 -01676 NV_FLOW_API void NvFlowSDFGenVoxelize(NvFlowSDFGen* sdfGen, NvFlowContext* context, const NvFlowSDFGenMeshParams* params); -01677 -01684 NV_FLOW_API void NvFlowSDFGenUpdate(NvFlowSDFGen* sdfGen, NvFlowContext* context); -01685 -01694 NV_FLOW_API NvFlowTexture3D* NvFlowSDFGenShape(NvFlowSDFGen* sdfGen, NvFlowContext* context); -01695 -01697 // -------------------------- NvFlowParticleSurface ------------------------------- -01700 -01702 struct NvFlowParticleSurface; -01703 -01705 struct NvFlowParticleSurfaceDesc -01706 { -01707 NvFlowFloat3 initialLocation; -01708 NvFlowFloat3 halfSize; -01709 -01710 NvFlowDim virtualDim; -01711 float residentScale; -01712 -01713 NvFlowUint maxParticles; -01714 }; -01715 -01717 struct NvFlowParticleSurfaceData -01718 { -01719 const float* positions; -01720 NvFlowUint positionStride; -01721 NvFlowUint numParticles; -01722 }; -01723 -01725 struct NvFlowParticleSurfaceParams -01726 { -01727 float surfaceThreshold; -01728 float smoothRadius; -01729 bool separableSmoothing; -01730 }; -01731 -01733 struct NvFlowParticleSurfaceEmitParams -01734 { -01735 float deltaTime; -01736 -01737 NvFlowFloat3 velocityLinear; -01738 NvFlowFloat3 velocityCoupleRate; -01739 -01740 float smoke; -01741 float smokeCoupleRate; -01742 -01743 float temperature; -01744 float temperatureCoupleRate; +01670 struct NvFlowDeviceQueue; +01671 +01673 enum NvFlowDeviceQueueType +01674 { +01675 eNvFlowDeviceQueueTypeGraphics = 0, +01676 eNvFlowDeviceQueueTypeCompute = 1, +01677 eNvFlowDeviceQueueTypeCopy = 2 +01678 }; +01679 +01681 struct NvFlowDeviceQueueDesc +01682 { +01683 NvFlowDeviceQueueType queueType; +01684 bool lowLatency; +01685 }; +01686 +01688 struct NvFlowDeviceQueueStatus +01689 { +01690 NvFlowUint framesInFlight; +01691 NvFlowUint64 lastFenceCompleted; +01692 NvFlowUint64 nextFenceValue; +01693 }; +01694 +01703 NV_FLOW_API NvFlowDeviceQueue* NvFlowCreateDeviceQueue(NvFlowDevice* device, const NvFlowDeviceQueueDesc* desc); +01704 +01710 NV_FLOW_API void NvFlowReleaseDeviceQueue(NvFlowDeviceQueue* deviceQueue); +01711 +01719 NV_FLOW_API NvFlowContext* NvFlowDeviceQueueCreateContext(NvFlowDeviceQueue* deviceQueue); +01720 +01728 NV_FLOW_API void NvFlowDeviceQueueUpdateContext(NvFlowDeviceQueue* deviceQueue, NvFlowContext* context, NvFlowDeviceQueueStatus* status); +01729 +01736 NV_FLOW_API void NvFlowDeviceQueueFlush(NvFlowDeviceQueue* deviceQueue, NvFlowContext* context); +01737 +01744 NV_FLOW_API void NvFlowDeviceQueueConditionalFlush(NvFlowDeviceQueue* deviceQueue, NvFlowContext* context); 01745 -01746 float fuel; -01747 float fuelCoupleRate; -01748 }; -01749 -01758 NV_FLOW_API NvFlowParticleSurface* NvFlowCreateParticleSurface(NvFlowContext* context, const NvFlowParticleSurfaceDesc* desc); -01759 -01765 NV_FLOW_API void NvFlowReleaseParticleSurface(NvFlowParticleSurface* surface); -01766 -01774 NV_FLOW_API void NvFlowParticleSurfaceUpdateParticles(NvFlowParticleSurface* surface, NvFlowContext* context, const NvFlowParticleSurfaceData* data); -01775 -01783 NV_FLOW_API void NvFlowParticleSurfaceUpdateSurface(NvFlowParticleSurface* surface, NvFlowContext* context, const NvFlowParticleSurfaceParams* params); -01784 -01792 NV_FLOW_API void NvFlowParticleSurfaceAllocFunc(NvFlowParticleSurface* surface, NvFlowContext* context, const NvFlowGridEmitCustomAllocParams* params); -01793 -01803 NV_FLOW_API void NvFlowParticleSurfaceEmitVelocityFunc(NvFlowParticleSurface* surface, NvFlowContext* context, NvFlowUint* dataFrontIdx, const NvFlowGridEmitCustomEmitParams* params, const NvFlowParticleSurfaceEmitParams* emitParams); -01804 -01814 NV_FLOW_API void NvFlowParticleSurfaceEmitDensityFunc(NvFlowParticleSurface* surface, NvFlowContext* context, NvFlowUint* dataFrontIdx, const NvFlowGridEmitCustomEmitParams* params, const NvFlowParticleSurfaceEmitParams* emitParams); -01815 -01824 NV_FLOW_API NvFlowGridExport* NvFlowParticleSurfaceDebugGridExport(NvFlowParticleSurface* surface, NvFlowContext* context); -01825 +01753 NV_FLOW_API void NvFlowDeviceQueueWaitOnFence(NvFlowDeviceQueue* deviceQueue, NvFlowContext* context, NvFlowUint64 fenceValue); +01754 +01756 // -------------------------- NvFlowSDFGenerator ------------------------------- +01759 +01761 struct NvFlowSDFGen; +01762 +01764 struct NvFlowSDFGenDesc +01765 { +01766 NvFlowDim resolution; +01767 }; +01768 +01770 struct NvFlowSDFGenMeshParams +01771 { +01772 NvFlowUint numVertices; +01773 float* positions; +01774 NvFlowUint positionStride; +01775 float* normals; +01776 NvFlowUint normalStride; +01777 +01778 NvFlowUint numIndices; +01779 NvFlowUint* indices; +01780 +01781 NvFlowFloat4x4 modelMatrix; +01782 +01783 NvFlowDepthStencilView* depthStencilView; +01784 NvFlowRenderTargetView* renderTargetView; +01785 }; +01786 +01795 NV_FLOW_API NvFlowSDFGen* NvFlowCreateSDFGen(NvFlowContext* context, const NvFlowSDFGenDesc* desc); +01796 +01802 NV_FLOW_API void NvFlowReleaseSDFGen(NvFlowSDFGen* sdfGen); +01803 +01810 NV_FLOW_API void NvFlowSDFGenReset(NvFlowSDFGen* sdfGen, NvFlowContext* context); +01811 +01819 NV_FLOW_API void NvFlowSDFGenVoxelize(NvFlowSDFGen* sdfGen, NvFlowContext* context, const NvFlowSDFGenMeshParams* params); +01820 +01827 NV_FLOW_API void NvFlowSDFGenUpdate(NvFlowSDFGen* sdfGen, NvFlowContext* context); +01828 +01837 NV_FLOW_API NvFlowTexture3D* NvFlowSDFGenShape(NvFlowSDFGen* sdfGen, NvFlowContext* context); +01838 +01840 // -------------------------- NvFlowParticleSurface ------------------------------- +01843 +01845 struct NvFlowParticleSurface; +01846 +01848 struct NvFlowParticleSurfaceDesc +01849 { +01850 NvFlowFloat3 initialLocation; +01851 NvFlowFloat3 halfSize; +01852 +01853 NvFlowDim virtualDim; +01854 float residentScale; +01855 +01856 NvFlowUint maxParticles; +01857 }; +01858 +01860 struct NvFlowParticleSurfaceData +01861 { +01862 const float* positions; +01863 NvFlowUint positionStride; +01864 NvFlowUint numParticles; +01865 }; +01866 +01868 struct NvFlowParticleSurfaceParams +01869 { +01870 float surfaceThreshold; +01871 float smoothRadius; +01872 bool separableSmoothing; +01873 }; +01874 +01876 struct NvFlowParticleSurfaceEmitParams +01877 { +01878 float deltaTime; +01879 +01880 NvFlowFloat3 velocityLinear; +01881 NvFlowFloat3 velocityCoupleRate; +01882 +01883 float smoke; +01884 float smokeCoupleRate; +01885 +01886 float temperature; +01887 float temperatureCoupleRate; +01888 +01889 float fuel; +01890 float fuelCoupleRate; +01891 }; +01892 +01901 NV_FLOW_API NvFlowParticleSurface* NvFlowCreateParticleSurface(NvFlowContext* context, const NvFlowParticleSurfaceDesc* desc); +01902 +01908 NV_FLOW_API void NvFlowReleaseParticleSurface(NvFlowParticleSurface* surface); +01909 +01917 NV_FLOW_API void NvFlowParticleSurfaceUpdateParticles(NvFlowParticleSurface* surface, NvFlowContext* context, const NvFlowParticleSurfaceData* data); +01918 +01926 NV_FLOW_API void NvFlowParticleSurfaceUpdateSurface(NvFlowParticleSurface* surface, NvFlowContext* context, const NvFlowParticleSurfaceParams* params); +01927 +01935 NV_FLOW_API void NvFlowParticleSurfaceAllocFunc(NvFlowParticleSurface* surface, NvFlowContext* context, const NvFlowGridEmitCustomAllocParams* params); +01936 +01946 NV_FLOW_API void NvFlowParticleSurfaceEmitVelocityFunc(NvFlowParticleSurface* surface, NvFlowContext* context, NvFlowUint* dataFrontIdx, const NvFlowGridEmitCustomEmitParams* params, const NvFlowParticleSurfaceEmitParams* emitParams); +01947 +01957 NV_FLOW_API void NvFlowParticleSurfaceEmitDensityFunc(NvFlowParticleSurface* surface, NvFlowContext* context, NvFlowUint* dataFrontIdx, const NvFlowGridEmitCustomEmitParams* params, const NvFlowParticleSurfaceEmitParams* emitParams); +01958 +01967 NV_FLOW_API NvFlowGridExport* NvFlowParticleSurfaceDebugGridExport(NvFlowParticleSurface* surface, NvFlowContext* context); +01968 diff --git a/docs/api/files/functions_0x62.html b/docs/api/files/functions_0x62.html index 204e1d0..b90c033 100644 --- a/docs/api/files/functions_0x62.html +++ b/docs/api/files/functions_0x62.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -66,9 +66,15 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowGridParams
  • bigEffectPredictTime : NvFlowGridParams +
  • blendOpAlpha +: NvFlowBlendStateDesc +
  • blendOpColor +: NvFlowBlendStateDesc +
  • blendState +: NvFlowGraphicsShaderDesc
  • blockDim -: NvFlowShaderPointParams -, NvFlowShaderLinearParams +: NvFlowShaderLinearParams +, NvFlowShaderPointParams
  • blockDimBits : NvFlowShaderPointParams , NvFlowShaderLinearParams @@ -80,8 +86,8 @@ Here is a list of all struct and union fields with links to the structures/union
  • blockListRW : NvFlowGridImportLayerView
  • blockTable -: NvFlowGridEmitCustomEmitLayerParams -, NvFlowGridExportImportLayerMapping +: NvFlowGridExportImportLayerMapping +, NvFlowGridEmitCustomEmitLayerParams
  • blockTableRW : NvFlowGridImportLayerView
  • bounds diff --git a/docs/api/files/functions_0x63.html b/docs/api/files/functions_0x63.html index 9fe66a6..8c737a7 100644 --- a/docs/api/files/functions_0x63.html +++ b/docs/api/files/functions_0x63.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -103,16 +103,21 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowGridMaterialParams
  • cpuHandle : NvFlowDescriptorReserveHandleD3D12 +
  • crossAdapterShared +: NvFlowFenceDesc
  • crossSectionAxis : NvFlowCrossSectionParams
  • crossSectionPosition : NvFlowCrossSectionParams
  • crossSectionScale : NvFlowCrossSectionParams +
  • cs +: NvFlowComputeShaderDesc +
  • cs_length +: NvFlowComputeShaderDesc
  • currentState -: NvFlowDepthStencilViewDescD3D12 +: NvFlowRenderTargetViewDescD3D12 , NvFlowResourceViewDescD3D12 -, NvFlowRenderTargetViewDescD3D12 diff --git a/docs/api/files/functions_0x64.html b/docs/api/files/functions_0x64.html index 88e8287..9db25c7 100644 --- a/docs/api/files/functions_0x64.html +++ b/docs/api/files/functions_0x64.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -65,7 +65,10 @@ Here is a list of all struct and union fields with links to the structures/union
  • data : NvFlowShapeSDFData , NvFlowColorMapData +, NvFlowMappedData , NvFlowGridExportLayerView +, NvFlowVertexBufferDesc +, NvFlowIndexBufferDesc
  • dataRW : NvFlowGridEmitCustomEmitLayerParams , NvFlowGridImportLayerView @@ -85,14 +88,27 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowVolumeRenderMultiResParams
  • depthAlphaThreshold : NvFlowVolumeRenderParams +
  • depthClipEnable +: NvFlowGraphicsShaderDesc +
  • depthEnable +: NvFlowDepthStateDesc +
  • depthFunc +: NvFlowDepthStateDesc
  • depthIntensityThreshold : NvFlowVolumeRenderParams
  • depthPitch : NvFlowShapeSDFData +, NvFlowMappedData +
  • depthState +: NvFlowGraphicsShaderDesc +
  • depthStencilFormat +: NvFlowGraphicsShaderDesc
  • depthStencilView : NvFlowVolumeRenderParams , NvFlowCrossSectionParams , NvFlowSDFGenMeshParams +
  • depthWriteMask +: NvFlowDepthStateDesc
  • descriptorSize : NvFlowDescriptorReserveHandleD3D12
  • device @@ -101,22 +117,39 @@ Here is a list of all struct and union fields with links to the structures/union
  • deviceContext : NvFlowContextDescD3D11
  • dim -: NvFlowShapeSDFData +: NvFlowTexture3DDesc , NvFlowColorMapData +, NvFlowBufferDesc +, NvFlowTexture1DDesc +, NvFlowShapeSDFData +, NvFlowTexture3DSparseDesc
  • dimInv : NvFlowShaderLinearParams
  • distance : NvFlowShapeDescPlane
  • divergencePerBurn : NvFlowGridMaterialParams +
  • downloadAccess +: NvFlowBufferDesc +, NvFlowTexture3DDesc
  • downsampleFactor : NvFlowVolumeRenderParams +
  • ds_format +: NvFlowDepthStencilDesc +
  • dstBlendAlpha +: NvFlowBlendStateDesc +
  • dstBlendColor +: NvFlowBlendStateDesc
  • dsv : NvFlowDepthStencilViewDescD3D11 +
  • dsvCurrentState +: NvFlowDepthStencilViewDescD3D12
  • dsvDesc : NvFlowDepthStencilViewDescD3D12
  • dsvHandle : NvFlowDepthStencilViewDescD3D12 +
  • dsvResource +: NvFlowDepthStencilViewDescD3D12
  • dynamicHeapCbvSrvUav : NvFlowContextDescD3D12 diff --git a/docs/api/files/functions_0x65.html b/docs/api/files/functions_0x65.html index 5d09d98..dd1d6a5 100644 --- a/docs/api/files/functions_0x65.html +++ b/docs/api/files/functions_0x65.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -60,8 +60,12 @@ Here is a list of all struct and union fields with links to the structures/unions they belong to:

    - e -

    diff --git a/docs/api/files/functions_0x68.html b/docs/api/files/functions_0x68.html index 8b39b9c..12455ba 100644 --- a/docs/api/files/functions_0x68.html +++ b/docs/api/files/functions_0x68.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -68,7 +68,12 @@ Here is a list of all struct and union fields with links to the structures/union
  • heap : NvFlowDescriptorReserveHandleD3D12
  • height -: NvFlowVolumeRenderViewport +: NvFlowViewport +, NvFlowVolumeRenderViewport +, NvFlowColorBufferDesc +, NvFlowDepthBufferDesc +, NvFlowTexture2DDesc +, NvFlowDepthStencilDesc diff --git a/docs/api/files/functions_0x69.html b/docs/api/files/functions_0x69.html index 15e7059..33408f6 100644 --- a/docs/api/files/functions_0x69.html +++ b/docs/api/files/functions_0x69.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -71,6 +71,8 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowGridDesc , NvFlowGridResetDesc , NvFlowParticleSurfaceDesc +
  • inputElementDescs +: NvFlowGraphicsShaderDesc
  • intensityBias : NvFlowRenderMaterialParams
  • intensityCompMask diff --git a/docs/api/files/functions_0x6c.html b/docs/api/files/functions_0x6c.html index 4ddc432..2e59d3a 100644 --- a/docs/api/files/functions_0x6c.html +++ b/docs/api/files/functions_0x6c.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -60,9 +60,12 @@ Here is a list of all struct and union fields with links to the structures/unions they belong to:

    - l -

    diff --git a/docs/api/files/functions_0x6f.html b/docs/api/files/functions_0x6f.html index ed65485..a22284f 100644 --- a/docs/api/files/functions_0x6f.html +++ b/docs/api/files/functions_0x6f.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields diff --git a/docs/api/files/functions_0x70.html b/docs/api/files/functions_0x70.html index e9cf601..6450387 100644 --- a/docs/api/files/functions_0x70.html +++ b/docs/api/files/functions_0x70.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -88,8 +88,17 @@ Here is a list of all struct and union fields with links to the structures/union , NvFlowVolumeShadowParams , NvFlowCrossSectionParams , NvFlowVolumeRenderParams +, NvFlowGridSummaryDebugRenderParams
  • proxyType : NvFlowGridProxyDesc +
  • ps +: NvFlowGraphicsShaderDesc +
  • ps_length +: NvFlowGraphicsShaderDesc +
  • ps_readOnly +: NvFlowDrawParams +
  • ps_readWrite +: NvFlowDrawParams diff --git a/docs/api/files/functions_0x71.html b/docs/api/files/functions_0x71.html index 77f82af..fea3191 100644 --- a/docs/api/files/functions_0x71.html +++ b/docs/api/files/functions_0x71.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields diff --git a/docs/api/files/functions_0x72.html b/docs/api/files/functions_0x72.html index f6f3be5..06b7ad4 100644 --- a/docs/api/files/functions_0x72.html +++ b/docs/api/files/functions_0x72.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -63,11 +63,15 @@ Here is a list of all struct and union fields with links to the structures/union
  • radius : NvFlowShapeDescSphere , NvFlowShapeDescCapsule +
  • readOnly +: NvFlowDispatchParams +
  • readWrite +: NvFlowDispatchParams
  • renderChannel -: NvFlowVolumeLightingParams -, NvFlowVolumeShadowParams +: NvFlowCrossSectionParams , NvFlowVolumeRenderParams -, NvFlowCrossSectionParams +, NvFlowVolumeLightingParams +, NvFlowVolumeShadowParams
  • renderContext : NvFlowGridProxyDesc
  • renderCopyContext @@ -78,11 +82,14 @@ Here is a list of all struct and union fields with links to the structures/union , NvFlowVolumeLightingParams , NvFlowVolumeShadowParams , NvFlowCrossSectionParams +
  • renderTargetFormat +: NvFlowGraphicsShaderDesc
  • renderTargetView -: NvFlowCrossSectionParams -, NvFlowSDFGenMeshParams +: NvFlowGridSummaryDebugRenderParams , NvFlowVolumeRenderParams , NvFlowVolumeShadowDebugRenderParams +, NvFlowCrossSectionParams +, NvFlowSDFGenMeshParams
  • reserveDescriptors : NvFlowDynamicDescriptorHeapD3D12
  • residentScale @@ -92,14 +99,19 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowShapeSDFDesc , NvFlowSDFGenDesc
  • resource -: NvFlowResourceViewDescD3D12 -, NvFlowDepthStencilViewDescD3D12 -, NvFlowRenderTargetViewDescD3D12 +: NvFlowRenderTargetViewDescD3D12 +, NvFlowResourceViewDescD3D12
  • resourceView : NvFlowResourceRWViewDescD3D11 , NvFlowResourceRWViewDescD3D12 +
  • rootConstantBuffer +: NvFlowDrawParams +, NvFlowDispatchParams
  • rowPitch -: NvFlowShapeSDFData +: NvFlowMappedData +, NvFlowShapeSDFData +
  • rt_format +: NvFlowRenderTargetDesc
  • rtv : NvFlowRenderTargetViewDescD3D11
  • rtvDesc diff --git a/docs/api/files/functions_0x73.html b/docs/api/files/functions_0x73.html index f892059..dd2bb34 100644 --- a/docs/api/files/functions_0x73.html +++ b/docs/api/files/functions_0x73.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -68,8 +68,15 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowShapeDesc
  • sdfOffset : NvFlowShapeDescSDF +
  • secondConstantBuffer +: NvFlowDispatchParams +
  • semanticName +: NvFlowInputElementDesc
  • separableSmoothing : NvFlowParticleSurfaceParams +
  • shader +: NvFlowDispatchParams +, NvFlowDrawParams
  • shaderParams : NvFlowGridEmitCustomEmitLayerParams , NvFlowGridExportImportLayeredMapping @@ -95,8 +102,15 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowGridEmitParams
  • simulation : NvFlowQueryTime +
  • singlePassAdvection +: NvFlowGridParams
  • sizeDown : NvFlowVolumeRenderLMSParams +
  • sizeInBytes +: NvFlowConstantBufferDesc +, NvFlowVertexBufferDesc +, NvFlowIndexBufferDesc +, NvFlowHeapSparseDesc
  • sizeLeft : NvFlowVolumeRenderLMSParams
  • sizeRight @@ -108,9 +122,9 @@ Here is a list of all struct and union fields with links to the structures/union
  • slipThickness : NvFlowGridEmitParams
  • smoke -: NvFlowParticleSurfaceEmitParams -, NvFlowGridMaterialParams +: NvFlowGridMaterialParams , NvFlowGridEmitParams +, NvFlowParticleSurfaceEmitParams
  • smokeCoupleRate : NvFlowGridEmitParams , NvFlowParticleSurfaceEmitParams @@ -124,17 +138,27 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowShapeDesc
  • spheres : NvFlowGridExportDebugVisView +
  • srcBlendAlpha +: NvFlowBlendStateDesc +
  • srcBlendColor +: NvFlowBlendStateDesc
  • srv : NvFlowResourceViewDescD3D11 , NvFlowDepthStencilViewDescD3D11 +
  • srvCurrentState +: NvFlowDepthStencilViewDescD3D12
  • srvDesc : NvFlowResourceViewDescD3D12 , NvFlowDepthStencilViewDescD3D12
  • srvHandle : NvFlowDepthStencilViewDescD3D12 , NvFlowResourceViewDescD3D12 +
  • srvResource +: NvFlowDepthStencilViewDescD3D12
  • stateCPU : NvFlowGridImportStateCPUParams +, NvFlowGridSummaryUpdateParams +, NvFlowGridSummaryDebugRenderParams
  • supportsVTR : NvFlowSupport
  • surfaceThreshold diff --git a/docs/api/files/functions_0x74.html b/docs/api/files/functions_0x74.html index 3d3025a..7f6ccac 100644 --- a/docs/api/files/functions_0x74.html +++ b/docs/api/files/functions_0x74.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -71,8 +71,10 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowGridMaterialParams
  • topLeftX : NvFlowVolumeRenderViewport +, NvFlowViewport
  • topLeftY : NvFlowVolumeRenderViewport +, NvFlowViewport diff --git a/docs/api/files/functions_0x75.html b/docs/api/files/functions_0x75.html index 8c0f28b..a3686a2 100644 --- a/docs/api/files/functions_0x75.html +++ b/docs/api/files/functions_0x75.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -66,9 +66,16 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowResourceRWViewDescD3D12
  • uavHandle : NvFlowResourceRWViewDescD3D12 +
  • uavTarget +: NvFlowGraphicsShaderDesc
  • uid : NvFlowGridMaterialHandle , NvFlowRenderMaterialHandle +
  • uploadAccess +: NvFlowTexture3DDesc +, NvFlowTexture1DDesc +, NvFlowBufferDesc +, NvFlowConstantBufferDesc
  • userdata : NvFlowDynamicDescriptorHeapD3D12 diff --git a/docs/api/files/functions_0x76.html b/docs/api/files/functions_0x76.html index e8986ee..8229736 100644 --- a/docs/api/files/functions_0x76.html +++ b/docs/api/files/functions_0x76.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -82,23 +82,40 @@ Here is a list of all struct and union fields with links to the structures/union : NvFlowCrossSectionParams
  • viewMatrix : NvFlowCrossSectionParams +, NvFlowGridSummaryDebugRenderParams , NvFlowVolumeRenderParams , NvFlowVolumeShadowParams , NvFlowVolumeShadowDebugRenderParams
  • viewport -: NvFlowRenderTargetViewDescD3D11 -, NvFlowDepthStencilViewDescD3D12 -, NvFlowVolumeRenderMultiResParams -, NvFlowDepthStencilViewDescD3D11 +: NvFlowVolumeRenderMultiResParams , NvFlowVolumeRenderLMSParams +, NvFlowRenderTargetDesc +, NvFlowDepthStencilDesc +, NvFlowDepthStencilViewDescD3D11 +, NvFlowRenderTargetViewDescD3D11 , NvFlowRenderTargetViewDescD3D12 +, NvFlowDepthStencilViewDescD3D12
  • virtualDim -: NvFlowParticleSurfaceDesc -, NvFlowGridDesc +: NvFlowGridDesc +, NvFlowParticleSurfaceDesc +
  • vorticityConstantMask +: NvFlowGridMaterialParams +
  • vorticityFuelMask +: NvFlowGridMaterialParams +
  • vorticitySmokeMask +: NvFlowGridMaterialParams
  • vorticityStrength : NvFlowGridMaterialParams +
  • vorticityTemperatureMask +: NvFlowGridMaterialParams
  • vorticityVelocityMask : NvFlowGridMaterialParams +
  • vs +: NvFlowGraphicsShaderDesc +
  • vs_length +: NvFlowGraphicsShaderDesc +
  • vs_readOnly +: NvFlowDrawParams diff --git a/docs/api/files/functions_0x77.html b/docs/api/files/functions_0x77.html index a85167e..a9a3ed5 100644 --- a/docs/api/files/functions_0x77.html +++ b/docs/api/files/functions_0x77.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -62,8 +62,9 @@ Here is a list of all struct and union fields with links to the structures/union

    - w -

    diff --git a/docs/api/files/functions_0x78.html b/docs/api/files/functions_0x78.html index 04d105a..a667f4c 100644 --- a/docs/api/files/functions_0x78.html +++ b/docs/api/files/functions_0x78.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -65,6 +65,10 @@ Here is a list of all struct and union fields with links to the structures/union , NvFlowFloat4x4 , NvFlowFloat4 , NvFlowFloat3 +, NvFlowFloat2 +, NvFlowInt4 +, NvFlowInt3 +, NvFlowInt2 , NvFlowUint4 , NvFlowUint3 , NvFlowUint2 diff --git a/docs/api/files/functions_0x79.html b/docs/api/files/functions_0x79.html index f9bb345..73baecb 100644 --- a/docs/api/files/functions_0x79.html +++ b/docs/api/files/functions_0x79.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -65,6 +65,10 @@ Here is a list of all struct and union fields with links to the structures/union , NvFlowFloat4x4 , NvFlowFloat4 , NvFlowFloat3 +, NvFlowFloat2 +, NvFlowInt4 +, NvFlowInt3 +, NvFlowInt2 , NvFlowUint4 , NvFlowUint3 , NvFlowUint2 diff --git a/docs/api/files/functions_0x7a.html b/docs/api/files/functions_0x7a.html index dd48daa..cbcb0c0 100644 --- a/docs/api/files/functions_0x7a.html +++ b/docs/api/files/functions_0x7a.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -65,6 +65,8 @@ Here is a list of all struct and union fields with links to the structures/union , NvFlowFloat4x4 , NvFlowFloat4 , NvFlowFloat3 +, NvFlowInt4 +, NvFlowInt3 , NvFlowUint4 , NvFlowUint3 diff --git a/docs/api/files/functions_vars.html b/docs/api/files/functions_vars.html index a1a16d0..bc984d2 100644 --- a/docs/api/files/functions_vars.html +++ b/docs/api/files/functions_vars.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -80,6 +80,18 @@ : NvFlowRenderMaterialParams
  • autoSelectDevice : NvFlowDeviceDesc +
  • averageBurn +: NvFlowGridSummaryResult +
  • averageFuel +: NvFlowGridSummaryResult +
  • averageSmoke +: NvFlowGridSummaryResult +
  • averageSpeed +: NvFlowGridSummaryResult +
  • averageTemperature +: NvFlowGridSummaryResult +
  • averageVelocity +: NvFlowGridSummaryResult diff --git a/docs/api/files/functions_vars_0x62.html b/docs/api/files/functions_vars_0x62.html index 5cceaac..0069a65 100644 --- a/docs/api/files/functions_vars_0x62.html +++ b/docs/api/files/functions_vars_0x62.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -66,9 +66,15 @@ : NvFlowGridParams
  • bigEffectPredictTime : NvFlowGridParams +
  • blendOpAlpha +: NvFlowBlendStateDesc +
  • blendOpColor +: NvFlowBlendStateDesc +
  • blendState +: NvFlowGraphicsShaderDesc
  • blockDim -: NvFlowShaderPointParams -, NvFlowShaderLinearParams +: NvFlowShaderLinearParams +, NvFlowShaderPointParams
  • blockDimBits : NvFlowShaderPointParams , NvFlowShaderLinearParams @@ -80,8 +86,8 @@
  • blockListRW : NvFlowGridImportLayerView
  • blockTable -: NvFlowGridEmitCustomEmitLayerParams -, NvFlowGridExportImportLayerMapping +: NvFlowGridExportImportLayerMapping +, NvFlowGridEmitCustomEmitLayerParams
  • blockTableRW : NvFlowGridImportLayerView
  • bounds diff --git a/docs/api/files/functions_vars_0x63.html b/docs/api/files/functions_vars_0x63.html index 0857af3..8aa2cce 100644 --- a/docs/api/files/functions_vars_0x63.html +++ b/docs/api/files/functions_vars_0x63.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -103,16 +103,21 @@ : NvFlowGridMaterialParams
  • cpuHandle : NvFlowDescriptorReserveHandleD3D12 +
  • crossAdapterShared +: NvFlowFenceDesc
  • crossSectionAxis : NvFlowCrossSectionParams
  • crossSectionPosition : NvFlowCrossSectionParams
  • crossSectionScale : NvFlowCrossSectionParams +
  • cs +: NvFlowComputeShaderDesc +
  • cs_length +: NvFlowComputeShaderDesc
  • currentState -: NvFlowDepthStencilViewDescD3D12 +: NvFlowRenderTargetViewDescD3D12 , NvFlowResourceViewDescD3D12 -, NvFlowRenderTargetViewDescD3D12 diff --git a/docs/api/files/functions_vars_0x64.html b/docs/api/files/functions_vars_0x64.html index 07bcf3d..26c909f 100644 --- a/docs/api/files/functions_vars_0x64.html +++ b/docs/api/files/functions_vars_0x64.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -65,7 +65,10 @@
  • data : NvFlowShapeSDFData , NvFlowColorMapData +, NvFlowMappedData , NvFlowGridExportLayerView +, NvFlowVertexBufferDesc +, NvFlowIndexBufferDesc
  • dataRW : NvFlowGridEmitCustomEmitLayerParams , NvFlowGridImportLayerView @@ -85,14 +88,27 @@ : NvFlowVolumeRenderMultiResParams
  • depthAlphaThreshold : NvFlowVolumeRenderParams +
  • depthClipEnable +: NvFlowGraphicsShaderDesc +
  • depthEnable +: NvFlowDepthStateDesc +
  • depthFunc +: NvFlowDepthStateDesc
  • depthIntensityThreshold : NvFlowVolumeRenderParams
  • depthPitch : NvFlowShapeSDFData +, NvFlowMappedData +
  • depthState +: NvFlowGraphicsShaderDesc +
  • depthStencilFormat +: NvFlowGraphicsShaderDesc
  • depthStencilView : NvFlowVolumeRenderParams , NvFlowCrossSectionParams , NvFlowSDFGenMeshParams +
  • depthWriteMask +: NvFlowDepthStateDesc
  • descriptorSize : NvFlowDescriptorReserveHandleD3D12
  • device @@ -101,22 +117,39 @@
  • deviceContext : NvFlowContextDescD3D11
  • dim -: NvFlowShapeSDFData +: NvFlowTexture3DDesc , NvFlowColorMapData +, NvFlowBufferDesc +, NvFlowTexture1DDesc +, NvFlowShapeSDFData +, NvFlowTexture3DSparseDesc
  • dimInv : NvFlowShaderLinearParams
  • distance : NvFlowShapeDescPlane
  • divergencePerBurn : NvFlowGridMaterialParams +
  • downloadAccess +: NvFlowBufferDesc +, NvFlowTexture3DDesc
  • downsampleFactor : NvFlowVolumeRenderParams +
  • ds_format +: NvFlowDepthStencilDesc +
  • dstBlendAlpha +: NvFlowBlendStateDesc +
  • dstBlendColor +: NvFlowBlendStateDesc
  • dsv : NvFlowDepthStencilViewDescD3D11 +
  • dsvCurrentState +: NvFlowDepthStencilViewDescD3D12
  • dsvDesc : NvFlowDepthStencilViewDescD3D12
  • dsvHandle : NvFlowDepthStencilViewDescD3D12 +
  • dsvResource +: NvFlowDepthStencilViewDescD3D12
  • dynamicHeapCbvSrvUav : NvFlowContextDescD3D12 diff --git a/docs/api/files/functions_vars_0x65.html b/docs/api/files/functions_vars_0x65.html index 6a9c243..1200129 100644 --- a/docs/api/files/functions_vars_0x65.html +++ b/docs/api/files/functions_vars_0x65.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -60,8 +60,12 @@  

    - e -

    diff --git a/docs/api/files/functions_vars_0x68.html b/docs/api/files/functions_vars_0x68.html index 0c1f63a..a8fc8cc 100644 --- a/docs/api/files/functions_vars_0x68.html +++ b/docs/api/files/functions_vars_0x68.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -68,7 +68,12 @@
  • heap : NvFlowDescriptorReserveHandleD3D12
  • height -: NvFlowVolumeRenderViewport +: NvFlowViewport +, NvFlowVolumeRenderViewport +, NvFlowColorBufferDesc +, NvFlowDepthBufferDesc +, NvFlowTexture2DDesc +, NvFlowDepthStencilDesc diff --git a/docs/api/files/functions_vars_0x69.html b/docs/api/files/functions_vars_0x69.html index 0dc673e..b592ec5 100644 --- a/docs/api/files/functions_vars_0x69.html +++ b/docs/api/files/functions_vars_0x69.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -71,6 +71,8 @@ : NvFlowGridDesc , NvFlowGridResetDesc , NvFlowParticleSurfaceDesc +
  • inputElementDescs +: NvFlowGraphicsShaderDesc
  • intensityBias : NvFlowRenderMaterialParams
  • intensityCompMask diff --git a/docs/api/files/functions_vars_0x6c.html b/docs/api/files/functions_vars_0x6c.html index ff89ced..615201b 100644 --- a/docs/api/files/functions_vars_0x6c.html +++ b/docs/api/files/functions_vars_0x6c.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -60,9 +60,12 @@  

    - l -

    diff --git a/docs/api/files/functions_vars_0x6f.html b/docs/api/files/functions_vars_0x6f.html index c9b722c..05c8428 100644 --- a/docs/api/files/functions_vars_0x6f.html +++ b/docs/api/files/functions_vars_0x6f.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables diff --git a/docs/api/files/functions_vars_0x70.html b/docs/api/files/functions_vars_0x70.html index 19eeded..472e92a 100644 --- a/docs/api/files/functions_vars_0x70.html +++ b/docs/api/files/functions_vars_0x70.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -88,8 +88,17 @@ , NvFlowVolumeShadowParams , NvFlowCrossSectionParams , NvFlowVolumeRenderParams +, NvFlowGridSummaryDebugRenderParams
  • proxyType : NvFlowGridProxyDesc +
  • ps +: NvFlowGraphicsShaderDesc +
  • ps_length +: NvFlowGraphicsShaderDesc +
  • ps_readOnly +: NvFlowDrawParams +
  • ps_readWrite +: NvFlowDrawParams diff --git a/docs/api/files/functions_vars_0x71.html b/docs/api/files/functions_vars_0x71.html index f149d60..9bc0504 100644 --- a/docs/api/files/functions_vars_0x71.html +++ b/docs/api/files/functions_vars_0x71.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables diff --git a/docs/api/files/functions_vars_0x72.html b/docs/api/files/functions_vars_0x72.html index 2f115bb..0a14335 100644 --- a/docs/api/files/functions_vars_0x72.html +++ b/docs/api/files/functions_vars_0x72.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -63,11 +63,15 @@
  • radius : NvFlowShapeDescSphere , NvFlowShapeDescCapsule +
  • readOnly +: NvFlowDispatchParams +
  • readWrite +: NvFlowDispatchParams
  • renderChannel -: NvFlowVolumeLightingParams -, NvFlowVolumeShadowParams +: NvFlowCrossSectionParams , NvFlowVolumeRenderParams -, NvFlowCrossSectionParams +, NvFlowVolumeLightingParams +, NvFlowVolumeShadowParams
  • renderContext : NvFlowGridProxyDesc
  • renderCopyContext @@ -78,11 +82,14 @@ , NvFlowVolumeLightingParams , NvFlowVolumeShadowParams , NvFlowCrossSectionParams +
  • renderTargetFormat +: NvFlowGraphicsShaderDesc
  • renderTargetView -: NvFlowCrossSectionParams -, NvFlowSDFGenMeshParams +: NvFlowGridSummaryDebugRenderParams , NvFlowVolumeRenderParams , NvFlowVolumeShadowDebugRenderParams +, NvFlowCrossSectionParams +, NvFlowSDFGenMeshParams
  • reserveDescriptors : NvFlowDynamicDescriptorHeapD3D12
  • residentScale @@ -92,14 +99,19 @@ : NvFlowShapeSDFDesc , NvFlowSDFGenDesc
  • resource -: NvFlowResourceViewDescD3D12 -, NvFlowDepthStencilViewDescD3D12 -, NvFlowRenderTargetViewDescD3D12 +: NvFlowRenderTargetViewDescD3D12 +, NvFlowResourceViewDescD3D12
  • resourceView : NvFlowResourceRWViewDescD3D11 , NvFlowResourceRWViewDescD3D12 +
  • rootConstantBuffer +: NvFlowDrawParams +, NvFlowDispatchParams
  • rowPitch -: NvFlowShapeSDFData +: NvFlowMappedData +, NvFlowShapeSDFData +
  • rt_format +: NvFlowRenderTargetDesc
  • rtv : NvFlowRenderTargetViewDescD3D11
  • rtvDesc diff --git a/docs/api/files/functions_vars_0x73.html b/docs/api/files/functions_vars_0x73.html index 7e2c52d..e091613 100644 --- a/docs/api/files/functions_vars_0x73.html +++ b/docs/api/files/functions_vars_0x73.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -68,8 +68,15 @@ : NvFlowShapeDesc
  • sdfOffset : NvFlowShapeDescSDF +
  • secondConstantBuffer +: NvFlowDispatchParams +
  • semanticName +: NvFlowInputElementDesc
  • separableSmoothing : NvFlowParticleSurfaceParams +
  • shader +: NvFlowDispatchParams +, NvFlowDrawParams
  • shaderParams : NvFlowGridEmitCustomEmitLayerParams , NvFlowGridExportImportLayeredMapping @@ -95,8 +102,15 @@ : NvFlowGridEmitParams
  • simulation : NvFlowQueryTime +
  • singlePassAdvection +: NvFlowGridParams
  • sizeDown : NvFlowVolumeRenderLMSParams +
  • sizeInBytes +: NvFlowConstantBufferDesc +, NvFlowVertexBufferDesc +, NvFlowIndexBufferDesc +, NvFlowHeapSparseDesc
  • sizeLeft : NvFlowVolumeRenderLMSParams
  • sizeRight @@ -108,9 +122,9 @@
  • slipThickness : NvFlowGridEmitParams
  • smoke -: NvFlowParticleSurfaceEmitParams -, NvFlowGridMaterialParams +: NvFlowGridMaterialParams , NvFlowGridEmitParams +, NvFlowParticleSurfaceEmitParams
  • smokeCoupleRate : NvFlowGridEmitParams , NvFlowParticleSurfaceEmitParams @@ -124,17 +138,27 @@ : NvFlowShapeDesc
  • spheres : NvFlowGridExportDebugVisView +
  • srcBlendAlpha +: NvFlowBlendStateDesc +
  • srcBlendColor +: NvFlowBlendStateDesc
  • srv : NvFlowResourceViewDescD3D11 , NvFlowDepthStencilViewDescD3D11 +
  • srvCurrentState +: NvFlowDepthStencilViewDescD3D12
  • srvDesc : NvFlowResourceViewDescD3D12 , NvFlowDepthStencilViewDescD3D12
  • srvHandle : NvFlowDepthStencilViewDescD3D12 , NvFlowResourceViewDescD3D12 +
  • srvResource +: NvFlowDepthStencilViewDescD3D12
  • stateCPU : NvFlowGridImportStateCPUParams +, NvFlowGridSummaryUpdateParams +, NvFlowGridSummaryDebugRenderParams
  • supportsVTR : NvFlowSupport
  • surfaceThreshold diff --git a/docs/api/files/functions_vars_0x74.html b/docs/api/files/functions_vars_0x74.html index 070f6d0..b932d74 100644 --- a/docs/api/files/functions_vars_0x74.html +++ b/docs/api/files/functions_vars_0x74.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -71,8 +71,10 @@ : NvFlowGridMaterialParams
  • topLeftX : NvFlowVolumeRenderViewport +, NvFlowViewport
  • topLeftY : NvFlowVolumeRenderViewport +, NvFlowViewport diff --git a/docs/api/files/functions_vars_0x75.html b/docs/api/files/functions_vars_0x75.html index c456d75..acd7ef6 100644 --- a/docs/api/files/functions_vars_0x75.html +++ b/docs/api/files/functions_vars_0x75.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -66,9 +66,16 @@ : NvFlowResourceRWViewDescD3D12
  • uavHandle : NvFlowResourceRWViewDescD3D12 +
  • uavTarget +: NvFlowGraphicsShaderDesc
  • uid : NvFlowGridMaterialHandle , NvFlowRenderMaterialHandle +
  • uploadAccess +: NvFlowTexture3DDesc +, NvFlowTexture1DDesc +, NvFlowBufferDesc +, NvFlowConstantBufferDesc
  • userdata : NvFlowDynamicDescriptorHeapD3D12 diff --git a/docs/api/files/functions_vars_0x76.html b/docs/api/files/functions_vars_0x76.html index d9b0c0a..0eb5f5b 100644 --- a/docs/api/files/functions_vars_0x76.html +++ b/docs/api/files/functions_vars_0x76.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -82,23 +82,40 @@ : NvFlowCrossSectionParams
  • viewMatrix : NvFlowCrossSectionParams +, NvFlowGridSummaryDebugRenderParams , NvFlowVolumeRenderParams , NvFlowVolumeShadowParams , NvFlowVolumeShadowDebugRenderParams
  • viewport -: NvFlowRenderTargetViewDescD3D11 -, NvFlowDepthStencilViewDescD3D12 -, NvFlowVolumeRenderMultiResParams -, NvFlowDepthStencilViewDescD3D11 +: NvFlowVolumeRenderMultiResParams , NvFlowVolumeRenderLMSParams +, NvFlowRenderTargetDesc +, NvFlowDepthStencilDesc +, NvFlowDepthStencilViewDescD3D11 +, NvFlowRenderTargetViewDescD3D11 , NvFlowRenderTargetViewDescD3D12 +, NvFlowDepthStencilViewDescD3D12
  • virtualDim -: NvFlowParticleSurfaceDesc -, NvFlowGridDesc +: NvFlowGridDesc +, NvFlowParticleSurfaceDesc +
  • vorticityConstantMask +: NvFlowGridMaterialParams +
  • vorticityFuelMask +: NvFlowGridMaterialParams +
  • vorticitySmokeMask +: NvFlowGridMaterialParams
  • vorticityStrength : NvFlowGridMaterialParams +
  • vorticityTemperatureMask +: NvFlowGridMaterialParams
  • vorticityVelocityMask : NvFlowGridMaterialParams +
  • vs +: NvFlowGraphicsShaderDesc +
  • vs_length +: NvFlowGraphicsShaderDesc +
  • vs_readOnly +: NvFlowDrawParams diff --git a/docs/api/files/functions_vars_0x77.html b/docs/api/files/functions_vars_0x77.html index 1367d50..e4f8208 100644 --- a/docs/api/files/functions_vars_0x77.html +++ b/docs/api/files/functions_vars_0x77.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -62,8 +62,9 @@

    - w -

    diff --git a/docs/api/files/functions_vars_0x78.html b/docs/api/files/functions_vars_0x78.html index 6cb14cb..33c584c 100644 --- a/docs/api/files/functions_vars_0x78.html +++ b/docs/api/files/functions_vars_0x78.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -65,6 +65,10 @@ , NvFlowFloat4x4 , NvFlowFloat4 , NvFlowFloat3 +, NvFlowFloat2 +, NvFlowInt4 +, NvFlowInt3 +, NvFlowInt2 , NvFlowUint4 , NvFlowUint3 , NvFlowUint2 diff --git a/docs/api/files/functions_vars_0x79.html b/docs/api/files/functions_vars_0x79.html index df62968..f9d3bf4 100644 --- a/docs/api/files/functions_vars_0x79.html +++ b/docs/api/files/functions_vars_0x79.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -65,6 +65,10 @@ , NvFlowFloat4x4 , NvFlowFloat4 , NvFlowFloat3 +, NvFlowFloat2 +, NvFlowInt4 +, NvFlowInt3 +, NvFlowInt2 , NvFlowUint4 , NvFlowUint3 , NvFlowUint2 diff --git a/docs/api/files/functions_vars_0x7a.html b/docs/api/files/functions_vars_0x7a.html index c9023ee..a56938d 100644 --- a/docs/api/files/functions_vars_0x7a.html +++ b/docs/api/files/functions_vars_0x7a.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields - Variables + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields - Variables @@ -65,6 +65,8 @@ , NvFlowFloat4x4 , NvFlowFloat4 , NvFlowFloat3 +, NvFlowInt4 +, NvFlowInt3 , NvFlowUint4 , NvFlowUint3 diff --git a/docs/api/files/globals.html b/docs/api/files/globals.html index 05fa982..77bc499 100644 --- a/docs/api/files/globals.html +++ b/docs/api/files/globals.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -48,10 +48,58 @@ Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

    - e -

      +
    • eNvFlowBlend_DstAlpha +: NvFlowContextExt.h +
    • eNvFlowBlend_EnumCount +: NvFlowContextExt.h +
    • eNvFlowBlend_InvDstAlpha +: NvFlowContextExt.h +
    • eNvFlowBlend_InvSrcAlpha +: NvFlowContextExt.h +
    • eNvFlowBlend_One +: NvFlowContextExt.h +
    • eNvFlowBlend_SrcAlpha +: NvFlowContextExt.h +
    • eNvFlowBlend_Zero +: NvFlowContextExt.h +
    • eNvFlowBlendOp_Add +: NvFlowContextExt.h +
    • eNvFlowBlendOp_EnumCount +: NvFlowContextExt.h +
    • eNvFlowBlendOp_Max +: NvFlowContextExt.h +
    • eNvFlowBlendOp_Min +: NvFlowContextExt.h +
    • eNvFlowBlendOp_RevSubtract +: NvFlowContextExt.h +
    • eNvFlowBlendOp_Subtract +: NvFlowContextExt.h +
    • eNvFlowComparison_Always +: NvFlowContextExt.h +
    • eNvFlowComparison_EnumCount +: NvFlowContextExt.h +
    • eNvFlowComparison_Equal +: NvFlowContextExt.h +
    • eNvFlowComparison_Greater +: NvFlowContextExt.h +
    • eNvFlowComparison_GreaterEqual +: NvFlowContextExt.h +
    • eNvFlowComparison_Less +: NvFlowContextExt.h +
    • eNvFlowComparison_LessEqual +: NvFlowContextExt.h +
    • eNvFlowComparison_Never +: NvFlowContextExt.h +
    • eNvFlowComparison_NotEqual +: NvFlowContextExt.h
    • eNvFlowContextD3D11 : NvFlowContext.h
    • eNvFlowContextD3D12 : NvFlowContext.h +
    • eNvFlowDepthWriteMask_All +: NvFlowContextExt.h +
    • eNvFlowDepthWriteMask_Zero +: NvFlowContextExt.h
    • eNvFlowDeviceModeProxy : NvFlow.h
    • eNvFlowDeviceModeUnique diff --git a/docs/api/files/globals_0x6e.html b/docs/api/files/globals_0x6e.html index 9c0d75b..8ecaa67 100644 --- a/docs/api/files/globals_0x6e.html +++ b/docs/api/files/globals_0x6e.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -50,30 +50,166 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li

      - n -

      • NV_FLOW_API : NvFlowTypes.h +
      • NV_FLOW_DISPATCH_MAX_READ_TEXTURES +: NvFlowContextExt.h +
      • NV_FLOW_DISPATCH_MAX_WRITE_TEXTURES +: NvFlowContextExt.h +
      • NV_FLOW_DRAW_MAX_READ_TEXTURES +: NvFlowContextExt.h +
      • NV_FLOW_DRAW_MAX_WRITE_TEXTURES +: NvFlowContextExt.h +
      • NV_FLOW_MAX_RENDER_TARGETS +: NvFlowContextExt.h
      • NV_FLOW_VERSION : NvFlowContext.h +
      • NvFlowBlendEnum +: NvFlowContextExt.h +
      • NvFlowBlendOpEnum +: NvFlowContextExt.h +
      • NvFlowBufferDownload() +: NvFlowContextExt.h +
      • NvFlowBufferDownloadRange() +: NvFlowContextExt.h +
      • NvFlowBufferGetContextObject() +: NvFlowContextExt.h +
      • NvFlowBufferGetDesc() +: NvFlowContextExt.h +
      • NvFlowBufferGetResource() +: NvFlowContextExt.h +
      • NvFlowBufferGetResourceRW() +: NvFlowContextExt.h +
      • NvFlowBufferMap() +: NvFlowContextExt.h +
      • NvFlowBufferMapDownload() +: NvFlowContextExt.h +
      • NvFlowBufferUnmap() +: NvFlowContextExt.h +
      • NvFlowBufferUnmapDownload() +: NvFlowContextExt.h +
      • NvFlowBufferUnmapRange() +: NvFlowContextExt.h +
      • NvFlowColorBufferGetContextObject() +: NvFlowContextExt.h +
      • NvFlowColorBufferGetDesc() +: NvFlowContextExt.h +
      • NvFlowColorBufferGetRenderTarget() +: NvFlowContextExt.h +
      • NvFlowColorBufferGetResource() +: NvFlowContextExt.h +
      • NvFlowColorBufferGetResourceRW() +: NvFlowContextExt.h +
      • NvFlowComparisonEnum +: NvFlowContextExt.h +
      • NvFlowConstantBufferGetContextObject() +: NvFlowContextExt.h +
      • NvFlowConstantBufferGetDesc() +: NvFlowContextExt.h +
      • NvFlowConstantBufferMap() +: NvFlowContextExt.h +
      • NvFlowConstantBufferUnmap() +: NvFlowContextExt.h
      • NvFlowContextAPI : NvFlowContext.h +
      • NvFlowContextClearDepthStencil() +: NvFlowContextExt.h +
      • NvFlowContextClearRenderTarget() +: NvFlowContextExt.h +
      • NvFlowContextCopyBuffer() +: NvFlowContextExt.h +
      • NvFlowContextCopyConstantBuffer() +: NvFlowContextExt.h +
      • NvFlowContextCopyFromTexture2DCrossAdapter() +: NvFlowContextExt.h +
      • NvFlowContextCopyResource() +: NvFlowContextExt.h +
      • NvFlowContextCopyTexture3D() +: NvFlowContextExt.h +
      • NvFlowContextCopyToTexture2DCrossAdapter() +: NvFlowContextExt.h +
      • NvFlowContextDispatch() +: NvFlowContextExt.h +
      • NvFlowContextDrawIndexedInstanced() +: NvFlowContextExt.h +
      • NvFlowContextEventQueuePop() +: NvFlowContextExt.h +
      • NvFlowContextEventQueuePush() +: NvFlowContextExt.h
      • NvFlowContextFlushRequestPop() : NvFlowContext.h
      • NvFlowContextFlushRequestPush() : NvFlowContext.h
      • NvFlowContextGetContextType() : NvFlowContext.h +
      • NvFlowContextIsSparseTextureSupported() +: NvFlowContextExt.h +
      • NvFlowContextObjectAddRef() +: NvFlowContextExt.h +
      • NvFlowContextObjectGetGPUBytesUsed() +: NvFlowContextExt.h +
      • NvFlowContextObjectRelease() +: NvFlowContextExt.h
      • NvFlowContextPop() : NvFlowContext.h
      • NvFlowContextProcessFenceSignal() : NvFlowContext.h
      • NvFlowContextProcessFenceWait() : NvFlowContext.h +
      • NvFlowContextProfileGroupBegin() +: NvFlowContextExt.h +
      • NvFlowContextProfileGroupEnd() +: NvFlowContextExt.h +
      • NvFlowContextProfileItemBegin() +: NvFlowContextExt.h +
      • NvFlowContextProfileItemEnd() +: NvFlowContextExt.h
      • NvFlowContextPush() : NvFlowContext.h +
      • NvFlowContextRestoreResourceState() +: NvFlowContextExt.h +
      • NvFlowContextSetIndexBuffer() +: NvFlowContextExt.h +
      • NvFlowContextSetRenderTarget() +: NvFlowContextExt.h +
      • NvFlowContextSetVertexBuffer() +: NvFlowContextExt.h +
      • NvFlowContextSetViewport() +: NvFlowContextExt.h +
      • NvFlowContextSignalFence() +: NvFlowContextExt.h +
      • NvFlowContextTimerBegin() +: NvFlowContextExt.h +
      • NvFlowContextTimerEnd() +: NvFlowContextExt.h +
      • NvFlowContextTimerGetResult() +: NvFlowContextExt.h +
      • NvFlowContextTransitionToCommonState() +: NvFlowContextExt.h +
      • NvFlowContextUpdateSparseMapping() +: NvFlowContextExt.h +
      • NvFlowContextWaitOnFence() +: NvFlowContextExt.h +
      • NvFlowCreateBuffer() +: NvFlowContextExt.h +
      • NvFlowCreateBufferView() +: NvFlowContextExt.h +
      • NvFlowCreateColorBuffer() +: NvFlowContextExt.h +
      • NvFlowCreateComputeShader() +: NvFlowContextExt.h +
      • NvFlowCreateConstantBuffer() +: NvFlowContextExt.h
      • NvFlowCreateContextD3D11() : NvFlowContextD3D11.h
      • NvFlowCreateContextD3D12() : NvFlowContextD3D12.h +
      • NvFlowCreateContextEventQueue() +: NvFlowContextExt.h +
      • NvFlowCreateContextTimer() +: NvFlowContextExt.h
      • NvFlowCreateCrossSection() : NvFlow.h +
      • NvFlowCreateDepthBuffer() +: NvFlowContextExt.h
      • NvFlowCreateDepthStencilViewD3D11() : NvFlowContextD3D11.h
      • NvFlowCreateDepthStencilViewD3D12() @@ -82,6 +218,10 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowCreateDeviceQueue() : NvFlow.h +
      • NvFlowCreateFence() +: NvFlowContextExt.h +
      • NvFlowCreateGraphicsShader() +: NvFlowContextExt.h
      • NvFlowCreateGrid() : NvFlow.h
      • NvFlowCreateGridImport() @@ -90,6 +230,14 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowCreateGridProxy() : NvFlow.h +
      • NvFlowCreateGridSummary() +: NvFlow.h +
      • NvFlowCreateGridSummaryStateCPU() +: NvFlow.h +
      • NvFlowCreateHeapSparse() +: NvFlowContextExt.h +
      • NvFlowCreateIndexBuffer() +: NvFlowContextExt.h
      • NvFlowCreateParticleSurface() : NvFlow.h
      • NvFlowCreateRenderMaterial() @@ -106,6 +254,20 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowCreateShapeSDFFromTexture3D() : NvFlow.h +
      • NvFlowCreateTexture1D() +: NvFlowContextExt.h +
      • NvFlowCreateTexture2D() +: NvFlowContextExt.h +
      • NvFlowCreateTexture2DCrossAdapter() +: NvFlowContextExt.h +
      • NvFlowCreateTexture2DCrossAPI() +: NvFlowContextExt.h +
      • NvFlowCreateTexture3D() +: NvFlowContextExt.h +
      • NvFlowCreateTexture3DSparse() +: NvFlowContextExt.h +
      • NvFlowCreateVertexBuffer() +: NvFlowContextExt.h
      • NvFlowCreateVolumeRender() : NvFlow.h
      • NvFlowCreateVolumeShadow() @@ -120,6 +282,26 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowDeferredRelease() : NvFlowContext.h +
      • NvFlowDepthBufferGetContextObject() +: NvFlowContextExt.h +
      • NvFlowDepthBufferGetDepthStencil() +: NvFlowContextExt.h +
      • NvFlowDepthBufferGetDesc() +: NvFlowContextExt.h +
      • NvFlowDepthBufferGetResource() +: NvFlowContextExt.h +
      • NvFlowDepthStencilGetDesc() +: NvFlowContextExt.h +
      • NvFlowDepthStencilSetViewport() +: NvFlowContextExt.h +
      • NvFlowDepthStencilViewGetDepthBufferDesc() +: NvFlowContextExt.h +
      • NvFlowDepthStencilViewGetDepthStencil() +: NvFlowContextExt.h +
      • NvFlowDepthStencilViewGetResource() +: NvFlowContextExt.h +
      • NvFlowDepthWriteMask +: NvFlowContextExt.h
      • NvFlowDeviceDescDefaults() : NvFlow.h
      • NvFlowDeviceMode @@ -136,10 +318,16 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowDeviceQueueWaitOnFence() : NvFlow.h +
      • NvFlowFenceGetDesc() +: NvFlowContextExt.h
      • NvFlowFormat : NvFlowTypes.h
      • NvFlowGetDefaultRenderMaterial() : NvFlow.h +
      • NvFlowGraphicsShaderGetDesc() +: NvFlowContextExt.h +
      • NvFlowGraphicsShaderSetFormats() +: NvFlowContextExt.h
      • NvFlowGridComponent : NvFlow.h
      • NvFlowGridCreateMaterial() @@ -222,12 +410,36 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowGridSetTargetLocation() : NvFlow.h +
      • NvFlowGridSummaryDebugRender() +: NvFlow.h +
      • NvFlowGridSummaryGetLayerMaterial() +: NvFlow.h +
      • NvFlowGridSummaryGetNumLayers() +: NvFlow.h +
      • NvFlowGridSummaryGetSummaries() +: NvFlow.h +
      • NvFlowGridSummaryUpdate() +: NvFlow.h
      • NvFlowGridTextureChannel : NvFlow.h
      • NvFlowGridUpdate() : NvFlow.h +
      • NvFlowGridUpdateEmitMaterials() +: NvFlow.h
      • NvFlowGridUpdateEmitSDFs() : NvFlow.h +
      • NvFlowHeapSparseGetContextObject() +: NvFlowContextExt.h +
      • NvFlowHeapSparseGetDesc() +: NvFlowContextExt.h +
      • NvFlowIndexBufferGetContextObject() +: NvFlowContextExt.h +
      • NvFlowIndexBufferGetDesc() +: NvFlowContextExt.h +
      • NvFlowIndexBufferMap() +: NvFlowContextExt.h +
      • NvFlowIndexBufferUnmap() +: NvFlowContextExt.h
      • NvFlowInt : NvFlowTypes.h
      • NvFlowMultiRes @@ -246,16 +458,34 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowParticleSurfaceUpdateSurface() : NvFlow.h +
      • NvFlowReleaseBuffer() +: NvFlowContextExt.h +
      • NvFlowReleaseColorBuffer() +: NvFlowContextExt.h +
      • NvFlowReleaseComputeShader() +: NvFlowContextExt.h +
      • NvFlowReleaseConstantBuffer() +: NvFlowContextExt.h
      • NvFlowReleaseContext() : NvFlowContext.h +
      • NvFlowReleaseContextEventQueue() +: NvFlowContextExt.h +
      • NvFlowReleaseContextTimer() +: NvFlowContextExt.h
      • NvFlowReleaseCrossSection() : NvFlow.h +
      • NvFlowReleaseDepthBuffer() +: NvFlowContextExt.h
      • NvFlowReleaseDepthStencilView() : NvFlowContext.h
      • NvFlowReleaseDevice() : NvFlow.h
      • NvFlowReleaseDeviceQueue() : NvFlow.h +
      • NvFlowReleaseFence() +: NvFlowContextExt.h +
      • NvFlowReleaseGraphicsShader() +: NvFlowContextExt.h
      • NvFlowReleaseGrid() : NvFlow.h
      • NvFlowReleaseGridImport() @@ -264,6 +494,14 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowReleaseGridProxy() : NvFlow.h +
      • NvFlowReleaseGridSummary() +: NvFlow.h +
      • NvFlowReleaseGridSummaryStateCPU() +: NvFlow.h +
      • NvFlowReleaseHeapSparse() +: NvFlowContextExt.h +
      • NvFlowReleaseIndexBuffer() +: NvFlowContextExt.h
      • NvFlowReleaseParticleSurface() : NvFlow.h
      • NvFlowReleaseRenderMaterial() @@ -272,10 +510,24 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowReleaseRenderTargetView() : NvFlowContext.h +
      • NvFlowReleaseResourceReference() +: NvFlowContextExt.h
      • NvFlowReleaseSDFGen() : NvFlow.h
      • NvFlowReleaseShapeSDF() : NvFlow.h +
      • NvFlowReleaseTexture1D() +: NvFlowContextExt.h +
      • NvFlowReleaseTexture2D() +: NvFlowContextExt.h +
      • NvFlowReleaseTexture2DCrossAdapter() +: NvFlowContextExt.h +
      • NvFlowReleaseTexture3D() +: NvFlowContextExt.h +
      • NvFlowReleaseTexture3DSparse() +: NvFlowContextExt.h +
      • NvFlowReleaseVertexBuffer() +: NvFlowContextExt.h
      • NvFlowReleaseVolumeRender() : NvFlow.h
      • NvFlowReleaseVolumeShadow() @@ -288,6 +540,18 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowRenderMaterialUpdate() : NvFlow.h +
      • NvFlowRenderTargetGetDesc() +: NvFlowContextExt.h +
      • NvFlowRenderTargetSetViewport() +: NvFlowContextExt.h +
      • NvFlowRenderTargetViewGetRenderTarget() +: NvFlowContextExt.h +
      • NvFlowResourceGetContextObject() +: NvFlowContextExt.h +
      • NvFlowResourceRWGetContextObject() +: NvFlowContextExt.h +
      • NvFlowResourceRWGetResource() +: NvFlowContextExt.h
      • NvFlowResult : NvFlowTypes.h
      • NvFlowSDFGenReset() @@ -310,6 +574,62 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlow.h
      • NvFlowShapeType : NvFlow.h +
      • NvFlowShareFence() +: NvFlowContextExt.h +
      • NvFlowShareResourceReference() +: NvFlowContextExt.h +
      • NvFlowShareTexture2D() +: NvFlowContextExt.h +
      • NvFlowShareTexture2DCrossAdapter() +: NvFlowContextExt.h +
      • NvFlowShareTexture2DCrossAPI() +: NvFlowContextExt.h +
      • NvFlowTexture1DGetContextObject() +: NvFlowContextExt.h +
      • NvFlowTexture1DGetDesc() +: NvFlowContextExt.h +
      • NvFlowTexture1DGetResource() +: NvFlowContextExt.h +
      • NvFlowTexture1DGetResourceRW() +: NvFlowContextExt.h +
      • NvFlowTexture1DMap() +: NvFlowContextExt.h +
      • NvFlowTexture1DUnmap() +: NvFlowContextExt.h +
      • NvFlowTexture2DGetContextObject() +: NvFlowContextExt.h +
      • NvFlowTexture2DGetDesc() +: NvFlowContextExt.h +
      • NvFlowTexture2DGetResource() +: NvFlowContextExt.h +
      • NvFlowTexture2DGetResourceRW() +: NvFlowContextExt.h +
      • NvFlowTexture3DDownload() +: NvFlowContextExt.h +
      • NvFlowTexture3DGetContextObject() +: NvFlowContextExt.h +
      • NvFlowTexture3DGetDesc() +: NvFlowContextExt.h +
      • NvFlowTexture3DGetResource() +: NvFlowContextExt.h +
      • NvFlowTexture3DGetResourceRW() +: NvFlowContextExt.h +
      • NvFlowTexture3DMap() +: NvFlowContextExt.h +
      • NvFlowTexture3DMapDownload() +: NvFlowContextExt.h +
      • NvFlowTexture3DSparseGetContextObject() +: NvFlowContextExt.h +
      • NvFlowTexture3DSparseGetDesc() +: NvFlowContextExt.h +
      • NvFlowTexture3DSparseGetResource() +: NvFlowContextExt.h +
      • NvFlowTexture3DSparseGetResourceRW() +: NvFlowContextExt.h +
      • NvFlowTexture3DUnmap() +: NvFlowContextExt.h +
      • NvFlowTexture3DUnmapDownload() +: NvFlowContextExt.h
      • NvFlowUint : NvFlowTypes.h
      • NvFlowUint64 @@ -338,6 +658,14 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : NvFlowContextD3D11.h
      • NvFlowUpdateResourceViewDescD3D12() : NvFlowContextD3D12.h +
      • NvFlowVertexBufferGetContextObject() +: NvFlowContextExt.h +
      • NvFlowVertexBufferGetDesc() +: NvFlowContextExt.h +
      • NvFlowVertexBufferMap() +: NvFlowContextExt.h +
      • NvFlowVertexBufferUnmap() +: NvFlowContextExt.h
      • NvFlowVolumeRenderDownsample : NvFlow.h
      • NvFlowVolumeRenderGridExport() diff --git a/docs/api/files/globals_defs.html b/docs/api/files/globals_defs.html index d6f75c0..96f9600 100644 --- a/docs/api/files/globals_defs.html +++ b/docs/api/files/globals_defs.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -44,6 +44,16 @@ diff --git a/docs/api/files/globals_enum.html b/docs/api/files/globals_enum.html index 8273c6f..a6baf0e 100644 --- a/docs/api/files/globals_enum.html +++ b/docs/api/files/globals_enum.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -42,8 +42,16 @@  

          +
        • NvFlowBlendEnum +: NvFlowContextExt.h +
        • NvFlowBlendOpEnum +: NvFlowContextExt.h +
        • NvFlowComparisonEnum +: NvFlowContextExt.h
        • NvFlowContextAPI : NvFlowContext.h +
        • NvFlowDepthWriteMask +: NvFlowContextExt.h
        • NvFlowDeviceMode : NvFlow.h
        • NvFlowDeviceQueueType diff --git a/docs/api/files/globals_eval.html b/docs/api/files/globals_eval.html index b730e43..4d79015 100644 --- a/docs/api/files/globals_eval.html +++ b/docs/api/files/globals_eval.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -47,10 +47,58 @@  

          - e -

            +
          • eNvFlowBlend_DstAlpha +: NvFlowContextExt.h +
          • eNvFlowBlend_EnumCount +: NvFlowContextExt.h +
          • eNvFlowBlend_InvDstAlpha +: NvFlowContextExt.h +
          • eNvFlowBlend_InvSrcAlpha +: NvFlowContextExt.h +
          • eNvFlowBlend_One +: NvFlowContextExt.h +
          • eNvFlowBlend_SrcAlpha +: NvFlowContextExt.h +
          • eNvFlowBlend_Zero +: NvFlowContextExt.h +
          • eNvFlowBlendOp_Add +: NvFlowContextExt.h +
          • eNvFlowBlendOp_EnumCount +: NvFlowContextExt.h +
          • eNvFlowBlendOp_Max +: NvFlowContextExt.h +
          • eNvFlowBlendOp_Min +: NvFlowContextExt.h +
          • eNvFlowBlendOp_RevSubtract +: NvFlowContextExt.h +
          • eNvFlowBlendOp_Subtract +: NvFlowContextExt.h +
          • eNvFlowComparison_Always +: NvFlowContextExt.h +
          • eNvFlowComparison_EnumCount +: NvFlowContextExt.h +
          • eNvFlowComparison_Equal +: NvFlowContextExt.h +
          • eNvFlowComparison_Greater +: NvFlowContextExt.h +
          • eNvFlowComparison_GreaterEqual +: NvFlowContextExt.h +
          • eNvFlowComparison_Less +: NvFlowContextExt.h +
          • eNvFlowComparison_LessEqual +: NvFlowContextExt.h +
          • eNvFlowComparison_Never +: NvFlowContextExt.h +
          • eNvFlowComparison_NotEqual +: NvFlowContextExt.h
          • eNvFlowContextD3D11 : NvFlowContext.h
          • eNvFlowContextD3D12 : NvFlowContext.h +
          • eNvFlowDepthWriteMask_All +: NvFlowContextExt.h +
          • eNvFlowDepthWriteMask_Zero +: NvFlowContextExt.h
          • eNvFlowDeviceModeProxy : NvFlow.h
          • eNvFlowDeviceModeUnique diff --git a/docs/api/files/globals_func.html b/docs/api/files/globals_func.html index 1812441..aa862a2 100644 --- a/docs/api/files/globals_func.html +++ b/docs/api/files/globals_func.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields @@ -39,7 +39,7 @@
            @@ -47,26 +47,146 @@  

            - n -

              +
            • NvFlowBufferDownload() +: NvFlowContextExt.h +
            • NvFlowBufferDownloadRange() +: NvFlowContextExt.h +
            • NvFlowBufferGetContextObject() +: NvFlowContextExt.h +
            • NvFlowBufferGetDesc() +: NvFlowContextExt.h +
            • NvFlowBufferGetResource() +: NvFlowContextExt.h +
            • NvFlowBufferGetResourceRW() +: NvFlowContextExt.h +
            • NvFlowBufferMap() +: NvFlowContextExt.h +
            • NvFlowBufferMapDownload() +: NvFlowContextExt.h +
            • NvFlowBufferUnmap() +: NvFlowContextExt.h +
            • NvFlowBufferUnmapDownload() +: NvFlowContextExt.h +
            • NvFlowBufferUnmapRange() +: NvFlowContextExt.h +
            • NvFlowColorBufferGetContextObject() +: NvFlowContextExt.h +
            • NvFlowColorBufferGetDesc() +: NvFlowContextExt.h +
            • NvFlowColorBufferGetRenderTarget() +: NvFlowContextExt.h +
            • NvFlowColorBufferGetResource() +: NvFlowContextExt.h +
            • NvFlowColorBufferGetResourceRW() +: NvFlowContextExt.h +
            • NvFlowConstantBufferGetContextObject() +: NvFlowContextExt.h +
            • NvFlowConstantBufferGetDesc() +: NvFlowContextExt.h +
            • NvFlowConstantBufferMap() +: NvFlowContextExt.h +
            • NvFlowConstantBufferUnmap() +: NvFlowContextExt.h +
            • NvFlowContextClearDepthStencil() +: NvFlowContextExt.h +
            • NvFlowContextClearRenderTarget() +: NvFlowContextExt.h +
            • NvFlowContextCopyBuffer() +: NvFlowContextExt.h +
            • NvFlowContextCopyConstantBuffer() +: NvFlowContextExt.h +
            • NvFlowContextCopyFromTexture2DCrossAdapter() +: NvFlowContextExt.h +
            • NvFlowContextCopyResource() +: NvFlowContextExt.h +
            • NvFlowContextCopyTexture3D() +: NvFlowContextExt.h +
            • NvFlowContextCopyToTexture2DCrossAdapter() +: NvFlowContextExt.h +
            • NvFlowContextDispatch() +: NvFlowContextExt.h +
            • NvFlowContextDrawIndexedInstanced() +: NvFlowContextExt.h +
            • NvFlowContextEventQueuePop() +: NvFlowContextExt.h +
            • NvFlowContextEventQueuePush() +: NvFlowContextExt.h
            • NvFlowContextFlushRequestPop() : NvFlowContext.h
            • NvFlowContextFlushRequestPush() : NvFlowContext.h
            • NvFlowContextGetContextType() : NvFlowContext.h +
            • NvFlowContextIsSparseTextureSupported() +: NvFlowContextExt.h +
            • NvFlowContextObjectAddRef() +: NvFlowContextExt.h +
            • NvFlowContextObjectGetGPUBytesUsed() +: NvFlowContextExt.h +
            • NvFlowContextObjectRelease() +: NvFlowContextExt.h
            • NvFlowContextPop() : NvFlowContext.h
            • NvFlowContextProcessFenceSignal() : NvFlowContext.h
            • NvFlowContextProcessFenceWait() : NvFlowContext.h +
            • NvFlowContextProfileGroupBegin() +: NvFlowContextExt.h +
            • NvFlowContextProfileGroupEnd() +: NvFlowContextExt.h +
            • NvFlowContextProfileItemBegin() +: NvFlowContextExt.h +
            • NvFlowContextProfileItemEnd() +: NvFlowContextExt.h
            • NvFlowContextPush() : NvFlowContext.h +
            • NvFlowContextRestoreResourceState() +: NvFlowContextExt.h +
            • NvFlowContextSetIndexBuffer() +: NvFlowContextExt.h +
            • NvFlowContextSetRenderTarget() +: NvFlowContextExt.h +
            • NvFlowContextSetVertexBuffer() +: NvFlowContextExt.h +
            • NvFlowContextSetViewport() +: NvFlowContextExt.h +
            • NvFlowContextSignalFence() +: NvFlowContextExt.h +
            • NvFlowContextTimerBegin() +: NvFlowContextExt.h +
            • NvFlowContextTimerEnd() +: NvFlowContextExt.h +
            • NvFlowContextTimerGetResult() +: NvFlowContextExt.h +
            • NvFlowContextTransitionToCommonState() +: NvFlowContextExt.h +
            • NvFlowContextUpdateSparseMapping() +: NvFlowContextExt.h +
            • NvFlowContextWaitOnFence() +: NvFlowContextExt.h +
            • NvFlowCreateBuffer() +: NvFlowContextExt.h +
            • NvFlowCreateBufferView() +: NvFlowContextExt.h +
            • NvFlowCreateColorBuffer() +: NvFlowContextExt.h +
            • NvFlowCreateComputeShader() +: NvFlowContextExt.h +
            • NvFlowCreateConstantBuffer() +: NvFlowContextExt.h
            • NvFlowCreateContextD3D11() : NvFlowContextD3D11.h
            • NvFlowCreateContextD3D12() : NvFlowContextD3D12.h +
            • NvFlowCreateContextEventQueue() +: NvFlowContextExt.h +
            • NvFlowCreateContextTimer() +: NvFlowContextExt.h
            • NvFlowCreateCrossSection() : NvFlow.h +
            • NvFlowCreateDepthBuffer() +: NvFlowContextExt.h
            • NvFlowCreateDepthStencilViewD3D11() : NvFlowContextD3D11.h
            • NvFlowCreateDepthStencilViewD3D12() @@ -75,6 +195,10 @@ : NvFlow.h
            • NvFlowCreateDeviceQueue() : NvFlow.h +
            • NvFlowCreateFence() +: NvFlowContextExt.h +
            • NvFlowCreateGraphicsShader() +: NvFlowContextExt.h
            • NvFlowCreateGrid() : NvFlow.h
            • NvFlowCreateGridImport() @@ -83,6 +207,14 @@ : NvFlow.h
            • NvFlowCreateGridProxy() : NvFlow.h +
            • NvFlowCreateGridSummary() +: NvFlow.h +
            • NvFlowCreateGridSummaryStateCPU() +: NvFlow.h +
            • NvFlowCreateHeapSparse() +: NvFlowContextExt.h +
            • NvFlowCreateIndexBuffer() +: NvFlowContextExt.h
            • NvFlowCreateParticleSurface() : NvFlow.h
            • NvFlowCreateRenderMaterial() @@ -99,6 +231,20 @@ : NvFlow.h
            • NvFlowCreateShapeSDFFromTexture3D() : NvFlow.h +
            • NvFlowCreateTexture1D() +: NvFlowContextExt.h +
            • NvFlowCreateTexture2D() +: NvFlowContextExt.h +
            • NvFlowCreateTexture2DCrossAdapter() +: NvFlowContextExt.h +
            • NvFlowCreateTexture2DCrossAPI() +: NvFlowContextExt.h +
            • NvFlowCreateTexture3D() +: NvFlowContextExt.h +
            • NvFlowCreateTexture3DSparse() +: NvFlowContextExt.h +
            • NvFlowCreateVertexBuffer() +: NvFlowContextExt.h
            • NvFlowCreateVolumeRender() : NvFlow.h
            • NvFlowCreateVolumeShadow() @@ -113,6 +259,24 @@ : NvFlow.h
            • NvFlowDeferredRelease() : NvFlowContext.h +
            • NvFlowDepthBufferGetContextObject() +: NvFlowContextExt.h +
            • NvFlowDepthBufferGetDepthStencil() +: NvFlowContextExt.h +
            • NvFlowDepthBufferGetDesc() +: NvFlowContextExt.h +
            • NvFlowDepthBufferGetResource() +: NvFlowContextExt.h +
            • NvFlowDepthStencilGetDesc() +: NvFlowContextExt.h +
            • NvFlowDepthStencilSetViewport() +: NvFlowContextExt.h +
            • NvFlowDepthStencilViewGetDepthBufferDesc() +: NvFlowContextExt.h +
            • NvFlowDepthStencilViewGetDepthStencil() +: NvFlowContextExt.h +
            • NvFlowDepthStencilViewGetResource() +: NvFlowContextExt.h
            • NvFlowDeviceDescDefaults() : NvFlow.h
            • NvFlowDeviceQueueConditionalFlush() @@ -125,8 +289,14 @@ : NvFlow.h
            • NvFlowDeviceQueueWaitOnFence() : NvFlow.h +
            • NvFlowFenceGetDesc() +: NvFlowContextExt.h
            • NvFlowGetDefaultRenderMaterial() : NvFlow.h +
            • NvFlowGraphicsShaderGetDesc() +: NvFlowContextExt.h +
            • NvFlowGraphicsShaderSetFormats() +: NvFlowContextExt.h
            • NvFlowGridCreateMaterial() : NvFlow.h
            • NvFlowGridDescDefaults() @@ -195,10 +365,34 @@ : NvFlow.h
            • NvFlowGridSetTargetLocation() : NvFlow.h +
            • NvFlowGridSummaryDebugRender() +: NvFlow.h +
            • NvFlowGridSummaryGetLayerMaterial() +: NvFlow.h +
            • NvFlowGridSummaryGetNumLayers() +: NvFlow.h +
            • NvFlowGridSummaryGetSummaries() +: NvFlow.h +
            • NvFlowGridSummaryUpdate() +: NvFlow.h
            • NvFlowGridUpdate() : NvFlow.h +
            • NvFlowGridUpdateEmitMaterials() +: NvFlow.h
            • NvFlowGridUpdateEmitSDFs() : NvFlow.h +
            • NvFlowHeapSparseGetContextObject() +: NvFlowContextExt.h +
            • NvFlowHeapSparseGetDesc() +: NvFlowContextExt.h +
            • NvFlowIndexBufferGetContextObject() +: NvFlowContextExt.h +
            • NvFlowIndexBufferGetDesc() +: NvFlowContextExt.h +
            • NvFlowIndexBufferMap() +: NvFlowContextExt.h +
            • NvFlowIndexBufferUnmap() +: NvFlowContextExt.h
            • NvFlowParticleSurfaceAllocFunc() : NvFlow.h
            • NvFlowParticleSurfaceDebugGridExport() @@ -211,16 +405,34 @@ : NvFlow.h
            • NvFlowParticleSurfaceUpdateSurface() : NvFlow.h +
            • NvFlowReleaseBuffer() +: NvFlowContextExt.h +
            • NvFlowReleaseColorBuffer() +: NvFlowContextExt.h +
            • NvFlowReleaseComputeShader() +: NvFlowContextExt.h +
            • NvFlowReleaseConstantBuffer() +: NvFlowContextExt.h
            • NvFlowReleaseContext() : NvFlowContext.h +
            • NvFlowReleaseContextEventQueue() +: NvFlowContextExt.h +
            • NvFlowReleaseContextTimer() +: NvFlowContextExt.h
            • NvFlowReleaseCrossSection() : NvFlow.h +
            • NvFlowReleaseDepthBuffer() +: NvFlowContextExt.h
            • NvFlowReleaseDepthStencilView() : NvFlowContext.h
            • NvFlowReleaseDevice() : NvFlow.h
            • NvFlowReleaseDeviceQueue() : NvFlow.h +
            • NvFlowReleaseFence() +: NvFlowContextExt.h +
            • NvFlowReleaseGraphicsShader() +: NvFlowContextExt.h
            • NvFlowReleaseGrid() : NvFlow.h
            • NvFlowReleaseGridImport() @@ -229,6 +441,14 @@ : NvFlow.h
            • NvFlowReleaseGridProxy() : NvFlow.h +
            • NvFlowReleaseGridSummary() +: NvFlow.h +
            • NvFlowReleaseGridSummaryStateCPU() +: NvFlow.h +
            • NvFlowReleaseHeapSparse() +: NvFlowContextExt.h +
            • NvFlowReleaseIndexBuffer() +: NvFlowContextExt.h
            • NvFlowReleaseParticleSurface() : NvFlow.h
            • NvFlowReleaseRenderMaterial() @@ -237,10 +457,24 @@ : NvFlow.h
            • NvFlowReleaseRenderTargetView() : NvFlowContext.h +
            • NvFlowReleaseResourceReference() +: NvFlowContextExt.h
            • NvFlowReleaseSDFGen() : NvFlow.h
            • NvFlowReleaseShapeSDF() : NvFlow.h +
            • NvFlowReleaseTexture1D() +: NvFlowContextExt.h +
            • NvFlowReleaseTexture2D() +: NvFlowContextExt.h +
            • NvFlowReleaseTexture2DCrossAdapter() +: NvFlowContextExt.h +
            • NvFlowReleaseTexture3D() +: NvFlowContextExt.h +
            • NvFlowReleaseTexture3DSparse() +: NvFlowContextExt.h +
            • NvFlowReleaseVertexBuffer() +: NvFlowContextExt.h
            • NvFlowReleaseVolumeRender() : NvFlow.h
            • NvFlowReleaseVolumeShadow() @@ -253,6 +487,18 @@ : NvFlow.h
            • NvFlowRenderMaterialUpdate() : NvFlow.h +
            • NvFlowRenderTargetGetDesc() +: NvFlowContextExt.h +
            • NvFlowRenderTargetSetViewport() +: NvFlowContextExt.h +
            • NvFlowRenderTargetViewGetRenderTarget() +: NvFlowContextExt.h +
            • NvFlowResourceGetContextObject() +: NvFlowContextExt.h +
            • NvFlowResourceRWGetContextObject() +: NvFlowContextExt.h +
            • NvFlowResourceRWGetResource() +: NvFlowContextExt.h
            • NvFlowSDFGenReset() : NvFlow.h
            • NvFlowSDFGenShape() @@ -271,6 +517,62 @@ : NvFlow.h
            • NvFlowShapeSDFUnmap() : NvFlow.h +
            • NvFlowShareFence() +: NvFlowContextExt.h +
            • NvFlowShareResourceReference() +: NvFlowContextExt.h +
            • NvFlowShareTexture2D() +: NvFlowContextExt.h +
            • NvFlowShareTexture2DCrossAdapter() +: NvFlowContextExt.h +
            • NvFlowShareTexture2DCrossAPI() +: NvFlowContextExt.h +
            • NvFlowTexture1DGetContextObject() +: NvFlowContextExt.h +
            • NvFlowTexture1DGetDesc() +: NvFlowContextExt.h +
            • NvFlowTexture1DGetResource() +: NvFlowContextExt.h +
            • NvFlowTexture1DGetResourceRW() +: NvFlowContextExt.h +
            • NvFlowTexture1DMap() +: NvFlowContextExt.h +
            • NvFlowTexture1DUnmap() +: NvFlowContextExt.h +
            • NvFlowTexture2DGetContextObject() +: NvFlowContextExt.h +
            • NvFlowTexture2DGetDesc() +: NvFlowContextExt.h +
            • NvFlowTexture2DGetResource() +: NvFlowContextExt.h +
            • NvFlowTexture2DGetResourceRW() +: NvFlowContextExt.h +
            • NvFlowTexture3DDownload() +: NvFlowContextExt.h +
            • NvFlowTexture3DGetContextObject() +: NvFlowContextExt.h +
            • NvFlowTexture3DGetDesc() +: NvFlowContextExt.h +
            • NvFlowTexture3DGetResource() +: NvFlowContextExt.h +
            • NvFlowTexture3DGetResourceRW() +: NvFlowContextExt.h +
            • NvFlowTexture3DMap() +: NvFlowContextExt.h +
            • NvFlowTexture3DMapDownload() +: NvFlowContextExt.h +
            • NvFlowTexture3DSparseGetContextObject() +: NvFlowContextExt.h +
            • NvFlowTexture3DSparseGetDesc() +: NvFlowContextExt.h +
            • NvFlowTexture3DSparseGetResource() +: NvFlowContextExt.h +
            • NvFlowTexture3DSparseGetResourceRW() +: NvFlowContextExt.h +
            • NvFlowTexture3DUnmap() +: NvFlowContextExt.h +
            • NvFlowTexture3DUnmapDownload() +: NvFlowContextExt.h
            • NvFlowUpdateContextD3D11() : NvFlowContextD3D11.h
            • NvFlowUpdateContextD3D12() @@ -295,6 +597,14 @@ : NvFlowContextD3D11.h
            • NvFlowUpdateResourceViewDescD3D12() : NvFlowContextD3D12.h +
            • NvFlowVertexBufferGetContextObject() +: NvFlowContextExt.h +
            • NvFlowVertexBufferGetDesc() +: NvFlowContextExt.h +
            • NvFlowVertexBufferMap() +: NvFlowContextExt.h +
            • NvFlowVertexBufferUnmap() +: NvFlowContextExt.h
            • NvFlowVolumeRenderGridExport() : NvFlow.h
            • NvFlowVolumeRenderLightGridExport() diff --git a/docs/api/files/globals_type.html b/docs/api/files/globals_type.html index 1b50d2c..0fb0917 100644 --- a/docs/api/files/globals_type.html +++ b/docs/api/files/globals_type.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Data Fields + NVIDIA(R) Flow(R) 1.0.1 API Reference: Data Fields diff --git a/docs/api/files/group___nv_flow_context.html b/docs/api/files/group___nv_flow_context.html index 23daddd..d774b52 100644 --- a/docs/api/files/group___nv_flow_context.html +++ b/docs/api/files/group___nv_flow_context.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowContext + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowContext diff --git a/docs/api/files/group___nv_flow_context_d3_d11.html b/docs/api/files/group___nv_flow_context_d3_d11.html index 340e57d..98ea0e6 100644 --- a/docs/api/files/group___nv_flow_context_d3_d11.html +++ b/docs/api/files/group___nv_flow_context_d3_d11.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowContextD3D11 + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowContextD3D11 diff --git a/docs/api/files/group___nv_flow_context_d3_d12.html b/docs/api/files/group___nv_flow_context_d3_d12.html index 4bdc042..1985d55 100644 --- a/docs/api/files/group___nv_flow_context_d3_d12.html +++ b/docs/api/files/group___nv_flow_context_d3_d12.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowContextD3D12 + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowContextD3D12 diff --git a/docs/api/files/group___nv_flow_cross_section.html b/docs/api/files/group___nv_flow_cross_section.html index 4d72ae5..fb0f5be 100644 --- a/docs/api/files/group___nv_flow_cross_section.html +++ b/docs/api/files/group___nv_flow_cross_section.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowCrossSection + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowCrossSection diff --git a/docs/api/files/group___nv_flow_device.html b/docs/api/files/group___nv_flow_device.html index abc0eef..1a82126 100644 --- a/docs/api/files/group___nv_flow_device.html +++ b/docs/api/files/group___nv_flow_device.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDevice + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDevice diff --git a/docs/api/files/group___nv_flow_grid.html b/docs/api/files/group___nv_flow_grid.html index 04a6599..98e9b93 100644 --- a/docs/api/files/group___nv_flow_grid.html +++ b/docs/api/files/group___nv_flow_grid.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGrid + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGrid diff --git a/docs/api/files/group___nv_flow_grid_emit.html b/docs/api/files/group___nv_flow_grid_emit.html index 04190c5..060166d 100644 --- a/docs/api/files/group___nv_flow_grid_emit.html +++ b/docs/api/files/group___nv_flow_grid_emit.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridEmit + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridEmit @@ -47,6 +47,8 @@ void NvFlowGridEmitParamsDefaults (NvFlowGridEmitParams *params) +void NvFlowGridUpdateEmitMaterials (NvFlowGrid *grid, NvFlowGridMaterialHandle *materials, NvFlowUint numMaterials) + void NvFlowGridUpdateEmitSDFs (NvFlowGrid *grid, NvFlowShapeSDF **sdfs, NvFlowUint numSdfs) @@ -166,6 +168,49 @@ Allows the application to request default emit parameters from Flow.

              + +

              + +

              +
              + + + + + + + + + + + + + + + + + + + + + + + + +
              void NvFlowGridUpdateEmitMaterials (NvFlowGrid *  grid,
              NvFlowGridMaterialHandle materials,
              NvFlowUint  numMaterials 
              )
              +
              +
              + +

              +Update internal array of grid materials reference by emitMaterialIndex

              +

              Parameters:
              + + + + +
              [in] grid The Flow grid to apply the emit events.
              [in] materials Array of grid materials.
              [in] numMaterials Number of grid materials in the array.
              +
              +

              diff --git a/docs/api/files/group___nv_flow_grid_emit_custom.html b/docs/api/files/group___nv_flow_grid_emit_custom.html index c6bb500..ebf9358 100644 --- a/docs/api/files/group___nv_flow_grid_emit_custom.html +++ b/docs/api/files/group___nv_flow_grid_emit_custom.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridEmitCustom + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridEmitCustom diff --git a/docs/api/files/group___nv_flow_grid_export.html b/docs/api/files/group___nv_flow_grid_export.html index 996508c..5a8d122 100644 --- a/docs/api/files/group___nv_flow_grid_export.html +++ b/docs/api/files/group___nv_flow_grid_export.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridExport + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridExport diff --git a/docs/api/files/group___nv_flow_grid_import.html b/docs/api/files/group___nv_flow_grid_import.html index eed7738..9c215d2 100644 --- a/docs/api/files/group___nv_flow_grid_import.html +++ b/docs/api/files/group___nv_flow_grid_import.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridImport + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridImport diff --git a/docs/api/files/group___nv_flow_grid_material.html b/docs/api/files/group___nv_flow_grid_material.html index c3ef9eb..4ad7d41 100644 --- a/docs/api/files/group___nv_flow_grid_material.html +++ b/docs/api/files/group___nv_flow_grid_material.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridMaterial + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridMaterial diff --git a/docs/api/files/group___nv_flow_grid_proxy.html b/docs/api/files/group___nv_flow_grid_proxy.html index cdba262..9e3c55a 100644 --- a/docs/api/files/group___nv_flow_grid_proxy.html +++ b/docs/api/files/group___nv_flow_grid_proxy.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridProxy + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridProxy diff --git a/docs/api/files/group___nv_flow_grid_summary.html b/docs/api/files/group___nv_flow_grid_summary.html new file mode 100644 index 0000000..84ac616 --- /dev/null +++ b/docs/api/files/group___nv_flow_grid_summary.html @@ -0,0 +1,384 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridSummary + + + + + +

              + + +
              +

              NvFlowGridSummary

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

              Data Structures

              struct  NvFlowGridSummaryDebugRenderParams
               Parameters to debug render the grid summary data. More...
              struct  NvFlowGridSummaryDesc
               Description necessary to create grid summary. More...
              struct  NvFlowGridSummaryResult
               Summary results. More...
              struct  NvFlowGridSummaryUpdateParams
               Parameters required to update summary CPU state. More...

              Functions

              NvFlowGridSummary * NvFlowCreateGridSummary (NvFlowContext *context, const NvFlowGridSummaryDesc *desc)
              NvFlowGridSummaryStateCPU * NvFlowCreateGridSummaryStateCPU (NvFlowGridSummary *gridSummary)
              void NvFlowGridSummaryDebugRender (NvFlowGridSummary *gridSummary, NvFlowContext *context, const NvFlowGridSummaryDebugRenderParams *params)
              NvFlowGridMaterialHandle NvFlowGridSummaryGetLayerMaterial (NvFlowGridSummaryStateCPU *stateCPU, NvFlowUint layerIdx)
              NvFlowUint NvFlowGridSummaryGetNumLayers (NvFlowGridSummaryStateCPU *stateCPU)
              void NvFlowGridSummaryGetSummaries (NvFlowGridSummaryStateCPU *stateCPU, NvFlowGridSummaryResult **results, NvFlowUint *numResults, NvFlowUint layerIdx)
              void NvFlowGridSummaryUpdate (NvFlowGridSummary *gridSummary, NvFlowContext *context, const NvFlowGridSummaryUpdateParams *params)
              void NvFlowReleaseGridSummary (NvFlowGridSummary *gridSummary)
              void NvFlowReleaseGridSummaryStateCPU (NvFlowGridSummaryStateCPU *stateCPU)
              +

              Function Documentation

              + +
              +
              + + + + + + + + + + + + + + + + + + +
              NvFlowGridSummary* NvFlowCreateGridSummary (NvFlowContext *  context,
              const NvFlowGridSummaryDesc desc 
              )
              +
              +
              + +

              +Creates a grid summary object.

              +

              Parameters:
              + + + +
              [in] context The context for GPU resource allocation.
              [in] desc Description for memory allocation.
              +
              +
              Returns:
              The created grid summary object.
              + +
              +

              + +

              +
              + + + + + + + + + +
              NvFlowGridSummaryStateCPU* NvFlowCreateGridSummaryStateCPU (NvFlowGridSummary *  gridSummary  ) 
              +
              +
              + +

              +Creates a grid summary CPU state object.

              +

              Parameters:
              + + +
              [in] gridSummary The grid summary this CPU state will hold data from.
              +
              +
              Returns:
              The created grid summary CPU state object.
              + +
              +

              + +

              +
              + + + + + + + + + + + + + + + + + + + + + + + + +
              void NvFlowGridSummaryDebugRender (NvFlowGridSummary *  gridSummary,
              NvFlowContext *  context,
              const NvFlowGridSummaryDebugRenderParams params 
              )
              +
              +
              + +

              +Renders a visualization of the specified stateCPU.

              +

              Parameters:
              + + + + +
              [in] gridSummary The grid summary operator to perform the debug render.
              [in] context The render context.
              [in] params Parameters required to render the CPU state.
              +
              + +
              +

              + +

              +
              + + + + + + + + + + + + + + + + + + +
              NvFlowGridMaterialHandle NvFlowGridSummaryGetLayerMaterial (NvFlowGridSummaryStateCPU *  stateCPU,
              NvFlowUint  layerIdx 
              )
              +
              +
              + +

              +Returns grid material mapped to specied layerIdx.

              +

              Parameters:
              + + + +
              [in] stateCPU The grid summary cpu state.
              [in] layerIdx The layer index to get the material mapping of.
              +
              +
              Returns:
              Returns grid material.
              + +
              +

              + +

              +
              + + + + + + + + + +
              NvFlowUint NvFlowGridSummaryGetNumLayers (NvFlowGridSummaryStateCPU *  stateCPU  ) 
              +
              +
              + +

              +Returns the number of layers for the grid summary. This establishes the maximum number of results for a given world location.

              +

              Parameters:
              + + +
              [in] stateCPU The grid summary cpu state.
              +
              +
              Returns:
              Returns the number of layers.
              + +
              +

              + +

              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              void NvFlowGridSummaryGetSummaries (NvFlowGridSummaryStateCPU *  stateCPU,
              NvFlowGridSummaryResult **  results,
              NvFlowUint numResults,
              NvFlowUint  layerIdx 
              )
              +
              +
              + +

              +Returns pointer to array of summary results for the specified layer.

              +

              Parameters:
              + + + + + +
              [in] stateCPU The grid summary state to sample.
              [out] results Pointer to array pointer.
              [out] numResults Pointer to array size.
              [in] layerIdx Layer index to return summary results array from.
              +
              + +
              +

              + +

              +
              + + + + + + + + + + + + + + + + + + + + + + + + +
              void NvFlowGridSummaryUpdate (NvFlowGridSummary *  gridSummary,
              NvFlowContext *  context,
              const NvFlowGridSummaryUpdateParams params 
              )
              +
              +
              + +

              +Updates the specified stateCPU with the latest available summary data.

              +

              Parameters:
              + + + + +
              [in] gridSummary The grid summary operator to perform the update.
              [in] context The context the gridExport is valid on.
              [in] params Parameters required to update CPU state.
              +
              + +
              +

              + +

              +
              + + + + + + + + + +
              void NvFlowReleaseGridSummary (NvFlowGridSummary *  gridSummary  ) 
              +
              +
              + +

              +Releases a grid summary object.

              +

              Parameters:
              + + +
              [in] gridSummary The grid summary object to be released.
              +
              + +
              +

              + +

              +
              + + + + + + + + + +
              void NvFlowReleaseGridSummaryStateCPU (NvFlowGridSummaryStateCPU *  stateCPU  ) 
              +
              +
              + +

              +Releases a grid summary CPU state object.

              +

              Parameters:
              + + +
              [in] stateCPU The grid summary CPU state object to be released.
              +
              + +
              +

              +

              + + + + diff --git a/docs/api/files/group___nv_flow_particle_surface.html b/docs/api/files/group___nv_flow_particle_surface.html index a295df9..91fa9f2 100644 --- a/docs/api/files/group___nv_flow_particle_surface.html +++ b/docs/api/files/group___nv_flow_particle_surface.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowParticleSurface + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowParticleSurface diff --git a/docs/api/files/group___nv_flow_render_material.html b/docs/api/files/group___nv_flow_render_material.html index f0890f6..c64e98c 100644 --- a/docs/api/files/group___nv_flow_render_material.html +++ b/docs/api/files/group___nv_flow_render_material.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowRenderMaterial + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowRenderMaterial diff --git a/docs/api/files/group___nv_flow_s_d_f_generator.html b/docs/api/files/group___nv_flow_s_d_f_generator.html index 77d3ecd..ea6976b 100644 --- a/docs/api/files/group___nv_flow_s_d_f_generator.html +++ b/docs/api/files/group___nv_flow_s_d_f_generator.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowSDFGenerator + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowSDFGenerator diff --git a/docs/api/files/group___nv_flow_shape.html b/docs/api/files/group___nv_flow_shape.html index 7d38520..83a65e7 100644 --- a/docs/api/files/group___nv_flow_shape.html +++ b/docs/api/files/group___nv_flow_shape.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowShape + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowShape diff --git a/docs/api/files/group___nv_flow_volume_render.html b/docs/api/files/group___nv_flow_volume_render.html index 5a0c5a6..c3e06c2 100644 --- a/docs/api/files/group___nv_flow_volume_render.html +++ b/docs/api/files/group___nv_flow_volume_render.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowVolumeRender + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowVolumeRender diff --git a/docs/api/files/group___nv_flow_volume_shadow.html b/docs/api/files/group___nv_flow_volume_shadow.html index be68e2f..3a679e2 100644 --- a/docs/api/files/group___nv_flow_volume_shadow.html +++ b/docs/api/files/group___nv_flow_volume_shadow.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowVolumeShadow + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowVolumeShadow diff --git a/docs/api/files/index.html b/docs/api/files/index.html index dbc41d3..1246d3d 100644 --- a/docs/api/files/index.html +++ b/docs/api/files/index.html @@ -1,6 +1,6 @@ -NVIDIA(R) Flow(R) 1.0.0 API Reference +NVIDIA(R) Flow(R) 1.0.1 API Reference diff --git a/docs/api/files/main.html b/docs/api/files/main.html index 7aca3ab..7b7cdb2 100644 --- a/docs/api/files/main.html +++ b/docs/api/files/main.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Main Page + NVIDIA(R) Flow(R) 1.0.1 API Reference: Main Page @@ -23,7 +23,7 @@
              -

              NVIDIA(R) Flow(R) 1.0.0 API Reference Documentation

              +

              NVIDIA(R) Flow(R) 1.0.1 API Reference Documentation

              diff --git a/docs/api/files/modules.html b/docs/api/files/modules.html index 48553cb..38b9434 100644 --- a/docs/api/files/modules.html +++ b/docs/api/files/modules.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: Module Index + NVIDIA(R) Flow(R) 1.0.1 API Reference: Module Index @@ -31,6 +31,7 @@
            • NvFlowGridEmitCustom
            • NvFlowGridExport
            • NvFlowGridImport +
            • NvFlowGridSummary
            • NvFlowRenderMaterial
            • NvFlowVolumeRender
            • NvFlowVolumeShadow diff --git a/docs/api/files/struct_nv_flow_blend_state_desc.html b/docs/api/files/struct_nv_flow_blend_state_desc.html new file mode 100644 index 0000000..c507529 --- /dev/null +++ b/docs/api/files/struct_nv_flow_blend_state_desc.html @@ -0,0 +1,160 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowBlendStateDesc Struct Reference + + + + + + + + +
              +

              NvFlowBlendStateDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + + + + + + + + + +

              Data Fields

              NvFlowBlendOpEnum blendOpAlpha
              NvFlowBlendOpEnum blendOpColor
              NvFlowBlendEnum dstBlendAlpha
              NvFlowBlendEnum dstBlendColor
              bool enable
              NvFlowBlendEnum srcBlendAlpha
              NvFlowBlendEnum srcBlendColor
              +


              Field Documentation

              + +

              + +

              + +

              + +

              + +

              + +
              + +

              + +

              +

              + +

              + +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_buffer_desc.html b/docs/api/files/struct_nv_flow_buffer_desc.html new file mode 100644 index 0000000..32e4334 --- /dev/null +++ b/docs/api/files/struct_nv_flow_buffer_desc.html @@ -0,0 +1,109 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowBufferDesc Struct Reference + + + + + + + + +
              +

              NvFlowBufferDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + + + +

              Data Fields

              NvFlowUint dim
              bool downloadAccess
              NvFlowFormat format
              bool uploadAccess
              +


              Field Documentation

              + +
              + +
              + +

              + +

              +

              + +

              + +
              + +

              + +

              +

              + +

              + +
              + +

              + +

              +

              + +

              + +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_buffer_view_desc.html b/docs/api/files/struct_nv_flow_buffer_view_desc.html new file mode 100644 index 0000000..8fd019b --- /dev/null +++ b/docs/api/files/struct_nv_flow_buffer_view_desc.html @@ -0,0 +1,58 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowBufferViewDesc Struct Reference + + + + + + + + +
              +

              NvFlowBufferViewDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + +

              Data Fields

              NvFlowFormat format
              +


              Field Documentation

              + +
              + +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_color_buffer_desc.html b/docs/api/files/struct_nv_flow_color_buffer_desc.html new file mode 100644 index 0000000..ed2d9bd --- /dev/null +++ b/docs/api/files/struct_nv_flow_color_buffer_desc.html @@ -0,0 +1,92 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowColorBufferDesc Struct Reference + + + + + + + + +
              +

              NvFlowColorBufferDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + +

              Data Fields

              NvFlowFormat format
              NvFlowUint height
              NvFlowUint width
              +


              Field Documentation

              + +
              + +
              + +

              + +

              +

              + +

              + +
              + +

              + +

              +

              + +

              + +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_color_map_data.html b/docs/api/files/struct_nv_flow_color_map_data.html index 0ad242c..0ea7954 100644 --- a/docs/api/files/struct_nv_flow_color_map_data.html +++ b/docs/api/files/struct_nv_flow_color_map_data.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowColorMapData Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowColorMapData Struct Reference diff --git a/docs/api/files/struct_nv_flow_compute_shader_desc.html b/docs/api/files/struct_nv_flow_compute_shader_desc.html new file mode 100644 index 0000000..921d1fc --- /dev/null +++ b/docs/api/files/struct_nv_flow_compute_shader_desc.html @@ -0,0 +1,92 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowComputeShaderDesc Struct Reference + + + + + + + + +
              +

              NvFlowComputeShaderDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + +

              Data Fields

              const void * cs
              NvFlowUint64 cs_length
              const wchar_t * label
              +


              Field Documentation

              + +
              +
              + + + + +
              const void* NvFlowComputeShaderDesc::cs
              +
              +
              + +

              + +

              +

              + +

              + +

              +
              + + + + +
              const wchar_t* NvFlowComputeShaderDesc::label
              +
              +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_constant_buffer_desc.html b/docs/api/files/struct_nv_flow_constant_buffer_desc.html new file mode 100644 index 0000000..f5c90bb --- /dev/null +++ b/docs/api/files/struct_nv_flow_constant_buffer_desc.html @@ -0,0 +1,75 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowConstantBufferDesc Struct Reference + + + + + + + + +
              +

              NvFlowConstantBufferDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + +

              Data Fields

              NvFlowUint sizeInBytes
              bool uploadAccess
              +


              Field Documentation

              + +

              + +

              + +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_context_desc_d3_d11.html b/docs/api/files/struct_nv_flow_context_desc_d3_d11.html index b7f667b..624edf5 100644 --- a/docs/api/files/struct_nv_flow_context_desc_d3_d11.html +++ b/docs/api/files/struct_nv_flow_context_desc_d3_d11.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowContextDescD3D11 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowContextDescD3D11 Struct Reference diff --git a/docs/api/files/struct_nv_flow_context_desc_d3_d12.html b/docs/api/files/struct_nv_flow_context_desc_d3_d12.html index 059c3cf..ee21372 100644 --- a/docs/api/files/struct_nv_flow_context_desc_d3_d12.html +++ b/docs/api/files/struct_nv_flow_context_desc_d3_d12.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowContextDescD3D12 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowContextDescD3D12 Struct Reference diff --git a/docs/api/files/struct_nv_flow_cross_section_desc.html b/docs/api/files/struct_nv_flow_cross_section_desc.html index 88b30cb..0d6a1c3 100644 --- a/docs/api/files/struct_nv_flow_cross_section_desc.html +++ b/docs/api/files/struct_nv_flow_cross_section_desc.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowCrossSectionDesc Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowCrossSectionDesc Struct Reference diff --git a/docs/api/files/struct_nv_flow_cross_section_params.html b/docs/api/files/struct_nv_flow_cross_section_params.html index 619a350..0877c90 100644 --- a/docs/api/files/struct_nv_flow_cross_section_params.html +++ b/docs/api/files/struct_nv_flow_cross_section_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowCrossSectionParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowCrossSectionParams Struct Reference diff --git a/docs/api/files/struct_nv_flow_depth_buffer_desc.html b/docs/api/files/struct_nv_flow_depth_buffer_desc.html new file mode 100644 index 0000000..bcfd5a3 --- /dev/null +++ b/docs/api/files/struct_nv_flow_depth_buffer_desc.html @@ -0,0 +1,126 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDepthBufferDesc Struct Reference + + + + + + + + +
              +

              NvFlowDepthBufferDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + + + + + +

              Data Fields

              NvFlowFormat format_dsv
              NvFlowFormat format_resource
              NvFlowFormat format_srv
              NvFlowUint height
              NvFlowUint width
              +


              Field Documentation

              + +

              + +

              + +

              + +

              + +
              + +

              + +

              +

              + +

              + +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_depth_state_desc.html b/docs/api/files/struct_nv_flow_depth_state_desc.html new file mode 100644 index 0000000..e9c4159 --- /dev/null +++ b/docs/api/files/struct_nv_flow_depth_state_desc.html @@ -0,0 +1,92 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDepthStateDesc Struct Reference + + + + + + + + +
              +

              NvFlowDepthStateDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + +

              Data Fields

              bool depthEnable
              NvFlowComparisonEnum depthFunc
              NvFlowDepthWriteMask depthWriteMask
              +


              Field Documentation

              + +
              + +
              + +

              + +

              +

              + +

              + +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_depth_stencil_desc.html b/docs/api/files/struct_nv_flow_depth_stencil_desc.html new file mode 100644 index 0000000..08fe78e --- /dev/null +++ b/docs/api/files/struct_nv_flow_depth_stencil_desc.html @@ -0,0 +1,109 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDepthStencilDesc Struct Reference + + + + + + + + +
              +

              NvFlowDepthStencilDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + + + +

              Data Fields

              NvFlowFormat ds_format
              NvFlowUint height
              NvFlowViewport viewport
              NvFlowUint width
              +


              Field Documentation

              + +

              + +

              + +
              + +

              + +

              +

              + +

              + +

              + +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_depth_stencil_view_desc_d3_d11.html b/docs/api/files/struct_nv_flow_depth_stencil_view_desc_d3_d11.html index 0c6a164..98f05da 100644 --- a/docs/api/files/struct_nv_flow_depth_stencil_view_desc_d3_d11.html +++ b/docs/api/files/struct_nv_flow_depth_stencil_view_desc_d3_d11.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDepthStencilViewDescD3D11 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDepthStencilViewDescD3D11 Struct Reference diff --git a/docs/api/files/struct_nv_flow_depth_stencil_view_desc_d3_d12.html b/docs/api/files/struct_nv_flow_depth_stencil_view_desc_d3_d12.html index 3c33d2e..0f59a61 100644 --- a/docs/api/files/struct_nv_flow_depth_stencil_view_desc_d3_d12.html +++ b/docs/api/files/struct_nv_flow_depth_stencil_view_desc_d3_d12.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDepthStencilViewDescD3D12 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDepthStencilViewDescD3D12 Struct Reference @@ -31,28 +31,32 @@ - + - + + + + +

              Data Fields

              D3D12_RESOURCE_STATES currentState
              D3D12_RESOURCE_STATES dsvCurrentState
              D3D12_DEPTH_STENCIL_VIEW_DESC dsvDesc
              D3D12_CPU_DESCRIPTOR_HANDLE dsvHandle
              ID3D12Resource * resource
              ID3D12Resource * dsvResource
              D3D12_RESOURCE_STATES srvCurrentState
              D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc
              D3D12_CPU_DESCRIPTOR_HANDLE srvHandle
              ID3D12Resource * srvResource
              D3D12_VIEWPORT viewport

              Field Documentation

              - +
              @@ -92,12 +96,27 @@

              - + +

              + +
              + +

              + +

              +

              +

              @@ -135,6 +154,21 @@

              +

              +

              + +

              + +
              + +

              +

              diff --git a/docs/api/files/struct_nv_flow_descriptor_reserve_handle_d3_d12.html b/docs/api/files/struct_nv_flow_descriptor_reserve_handle_d3_d12.html index 5381243..4e84f42 100644 --- a/docs/api/files/struct_nv_flow_descriptor_reserve_handle_d3_d12.html +++ b/docs/api/files/struct_nv_flow_descriptor_reserve_handle_d3_d12.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDescriptorReserveHandleD3D12 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDescriptorReserveHandleD3D12 Struct Reference diff --git a/docs/api/files/struct_nv_flow_device_desc.html b/docs/api/files/struct_nv_flow_device_desc.html index cb832ce..7f36d80 100644 --- a/docs/api/files/struct_nv_flow_device_desc.html +++ b/docs/api/files/struct_nv_flow_device_desc.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDeviceDesc Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDeviceDesc Struct Reference diff --git a/docs/api/files/struct_nv_flow_device_queue_desc.html b/docs/api/files/struct_nv_flow_device_queue_desc.html index 013cb5a..ce3a180 100644 --- a/docs/api/files/struct_nv_flow_device_queue_desc.html +++ b/docs/api/files/struct_nv_flow_device_queue_desc.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDeviceQueueDesc Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDeviceQueueDesc Struct Reference diff --git a/docs/api/files/struct_nv_flow_device_queue_status.html b/docs/api/files/struct_nv_flow_device_queue_status.html index ff52edd..24c38e5 100644 --- a/docs/api/files/struct_nv_flow_device_queue_status.html +++ b/docs/api/files/struct_nv_flow_device_queue_status.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDeviceQueueStatus Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDeviceQueueStatus Struct Reference diff --git a/docs/api/files/struct_nv_flow_dim.html b/docs/api/files/struct_nv_flow_dim.html index 6963c03..ea3c750 100644 --- a/docs/api/files/struct_nv_flow_dim.html +++ b/docs/api/files/struct_nv_flow_dim.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDim Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDim Struct Reference diff --git a/docs/api/files/struct_nv_flow_dispatch_params.html b/docs/api/files/struct_nv_flow_dispatch_params.html new file mode 100644 index 0000000..451ec77 --- /dev/null +++ b/docs/api/files/struct_nv_flow_dispatch_params.html @@ -0,0 +1,143 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDispatchParams Struct Reference + + + + + +

              + + +
              +

              NvFlowDispatchParams Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + + + + + + + +

              Data Fields

              NvFlowDim gridDim
              NvFlowResource * readOnly [(16u)]
              NvFlowResourceRW * readWrite [(8u)]
              NvFlowConstantBuffer * rootConstantBuffer
              NvFlowConstantBuffer * secondConstantBuffer
              NvFlowComputeShader * shader
              +


              Field Documentation

              + +
              + +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowResource* NvFlowDispatchParams::readOnly[(16u)]
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowResourceRW* NvFlowDispatchParams::readWrite[(8u)]
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowConstantBuffer* NvFlowDispatchParams::rootConstantBuffer
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowConstantBuffer* NvFlowDispatchParams::secondConstantBuffer
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowComputeShader* NvFlowDispatchParams::shader
              +
              +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_draw_params.html b/docs/api/files/struct_nv_flow_draw_params.html new file mode 100644 index 0000000..520c044 --- /dev/null +++ b/docs/api/files/struct_nv_flow_draw_params.html @@ -0,0 +1,143 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDrawParams Struct Reference + + + + + + + + +
              +

              NvFlowDrawParams Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + + + + + + + +

              Data Fields

              bool frontCounterClockwise
              NvFlowResource * ps_readOnly [(16u)]
              NvFlowResourceRW * ps_readWrite [(1u)]
              NvFlowConstantBuffer * rootConstantBuffer
              NvFlowGraphicsShader * shader
              NvFlowResource * vs_readOnly [(16u)]
              +


              Field Documentation

              + +
              + +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowResource* NvFlowDrawParams::ps_readOnly[(16u)]
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowResourceRW* NvFlowDrawParams::ps_readWrite[(1u)]
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowConstantBuffer* NvFlowDrawParams::rootConstantBuffer
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowGraphicsShader* NvFlowDrawParams::shader
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              NvFlowResource* NvFlowDrawParams::vs_readOnly[(16u)]
              +
              +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_dynamic_descriptor_heap_d3_d12.html b/docs/api/files/struct_nv_flow_dynamic_descriptor_heap_d3_d12.html index a4d1914..b777d4a 100644 --- a/docs/api/files/struct_nv_flow_dynamic_descriptor_heap_d3_d12.html +++ b/docs/api/files/struct_nv_flow_dynamic_descriptor_heap_d3_d12.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowDynamicDescriptorHeapD3D12 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowDynamicDescriptorHeapD3D12 Struct Reference diff --git a/docs/api/files/struct_nv_flow_fence_desc.html b/docs/api/files/struct_nv_flow_fence_desc.html new file mode 100644 index 0000000..45a5a32 --- /dev/null +++ b/docs/api/files/struct_nv_flow_fence_desc.html @@ -0,0 +1,58 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowFenceDesc Struct Reference + + + + + + + + +
              +

              NvFlowFenceDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + +

              Data Fields

              bool crossAdapterShared
              +


              Field Documentation

              + +
              + +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_float2.html b/docs/api/files/struct_nv_flow_float2.html new file mode 100644 index 0000000..834b487 --- /dev/null +++ b/docs/api/files/struct_nv_flow_float2.html @@ -0,0 +1,75 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowFloat2 Struct Reference + + + + + + + + +
              +

              NvFlowFloat2 Struct Reference

              #include <NvFlowTypes.h> +

              + + + + + + + +

              Data Fields

              float x
              float y
              +


              Field Documentation

              + +
              +
              + + + + +
              float NvFlowFloat2::x
              +
              +
              + +

              + +

              +

              + +

              +
              + + + + +
              float NvFlowFloat2::y
              +
              +
              + +

              + +

              +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_float3.html b/docs/api/files/struct_nv_flow_float3.html index d7222eb..0c09adb 100644 --- a/docs/api/files/struct_nv_flow_float3.html +++ b/docs/api/files/struct_nv_flow_float3.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowFloat3 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowFloat3 Struct Reference diff --git a/docs/api/files/struct_nv_flow_float4.html b/docs/api/files/struct_nv_flow_float4.html index 8c118e1..28c74c2 100644 --- a/docs/api/files/struct_nv_flow_float4.html +++ b/docs/api/files/struct_nv_flow_float4.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowFloat4 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowFloat4 Struct Reference diff --git a/docs/api/files/struct_nv_flow_float4x4.html b/docs/api/files/struct_nv_flow_float4x4.html index 80e1492..4671f97 100644 --- a/docs/api/files/struct_nv_flow_float4x4.html +++ b/docs/api/files/struct_nv_flow_float4x4.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowFloat4x4 Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowFloat4x4 Struct Reference diff --git a/docs/api/files/struct_nv_flow_graphics_shader_desc.html b/docs/api/files/struct_nv_flow_graphics_shader_desc.html new file mode 100644 index 0000000..cd68108 --- /dev/null +++ b/docs/api/files/struct_nv_flow_graphics_shader_desc.html @@ -0,0 +1,296 @@ + + + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGraphicsShaderDesc Struct Reference + + + + + + + + +
              +

              NvFlowGraphicsShaderDesc Struct Reference

              #include <NvFlowContextExt.h> +

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

              Data Fields

              NvFlowBlendStateDesc blendState
              bool depthClipEnable
              NvFlowDepthStateDesc depthState
              NvFlowFormat depthStencilFormat
              NvFlowInputElementDescinputElementDescs
              const wchar_t * label
              bool lineList
              NvFlowUint numInputElements
              NvFlowUint numRenderTargets
              const void * ps
              NvFlowUint64 ps_length
              NvFlowFormat renderTargetFormat [(8u)]
              bool uavTarget
              const void * vs
              NvFlowUint64 vs_length
              +


              Field Documentation

              + +

              + +

              + +
              + +

              + +

              +

              + +

              + +

              + +

              + +

              +
              + + + + +
              const wchar_t* NvFlowGraphicsShaderDesc::label
              +
              +
              + +

              + +

              +

              + +

              + +
              + +

              + +

              +

              + +

              + +

              + +

              +
              + + + + +
              const void* NvFlowGraphicsShaderDesc::ps
              +
              +
              + +

              + +

              +

              + +

              + +

              + +

              + +
              + +

              + +

              +

              + +

              +
              + + + + +
              const void* NvFlowGraphicsShaderDesc::vs
              +
              +
              + +

              + +

              +

              + +

              +


              The documentation for this struct was generated from the following file: +
              + + + + diff --git a/docs/api/files/struct_nv_flow_grid_desc.html b/docs/api/files/struct_nv_flow_grid_desc.html index fa021b6..1d50bdd 100644 --- a/docs/api/files/struct_nv_flow_grid_desc.html +++ b/docs/api/files/struct_nv_flow_grid_desc.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridDesc Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridDesc Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_emit_custom_alloc_params.html b/docs/api/files/struct_nv_flow_grid_emit_custom_alloc_params.html index 45eef00..d64ac06 100644 --- a/docs/api/files/struct_nv_flow_grid_emit_custom_alloc_params.html +++ b/docs/api/files/struct_nv_flow_grid_emit_custom_alloc_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridEmitCustomAllocParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridEmitCustomAllocParams Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_emit_custom_emit_layer_params.html b/docs/api/files/struct_nv_flow_grid_emit_custom_emit_layer_params.html index 0864f12..4a8bc8e 100644 --- a/docs/api/files/struct_nv_flow_grid_emit_custom_emit_layer_params.html +++ b/docs/api/files/struct_nv_flow_grid_emit_custom_emit_layer_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridEmitCustomEmitLayerParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridEmitCustomEmitLayerParams Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_emit_custom_emit_params.html b/docs/api/files/struct_nv_flow_grid_emit_custom_emit_params.html index 2f88900..d080550 100644 --- a/docs/api/files/struct_nv_flow_grid_emit_custom_emit_params.html +++ b/docs/api/files/struct_nv_flow_grid_emit_custom_emit_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridEmitCustomEmitParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridEmitCustomEmitParams Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_emit_params.html b/docs/api/files/struct_nv_flow_grid_emit_params.html index dd9e477..d9c2952 100644 --- a/docs/api/files/struct_nv_flow_grid_emit_params.html +++ b/docs/api/files/struct_nv_flow_grid_emit_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridEmitParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridEmitParams Struct Reference @@ -49,6 +49,9 @@ float deltaTime  DeltaTime used to compute impulse.
              +NvFlowUint emitMaterialIndex + + Index into material lookup defined by NvFlowGridUpdateEmitMaterials().
              NvFlowUint emitMode  Emitter behavior, based on NvFlowGridEmitMode, 0u is default.
              @@ -67,9 +70,6 @@ NvFlowFloat4x4 localToWorld  Transform from shape local space to world space.
              -NvFlowGridMaterialHandle material - - Material for this emitter.
              float maxActiveDist  Maximum distance value for active emission.
              @@ -82,9 +82,6 @@ float minEdgeDist  Distance from minActiveDist to 1.0 emitter opacity.
              -NvFlowUint numSubSteps - - Numbers of interations to perform on cell value.
              NvFlowFloat3 predictVelocity  Velocity used only for predict.
              @@ -216,6 +213,23 @@ Center of mass in emitter local coordinate space. DeltaTime used to compute impulse.

              + +

              + +

              + +
              + +

              +Index into material lookup defined by NvFlowGridUpdateEmitMaterials(). +

              +

              @@ -318,23 +332,6 @@ Minimum temperature to release fuelRelease additional fuel. Transform from shape local space to world space.

              - -

              - -

              - -
              - -

              -Material for this emitter. -

              -

              @@ -403,23 +400,6 @@ Minimum distance value for active emission. Distance from minActiveDist to 1.0 emitter opacity.

              - -

              - -

              - -
              - -

              -Numbers of interations to perform on cell value. -

              -

              diff --git a/docs/api/files/struct_nv_flow_grid_export_debug_vis_view.html b/docs/api/files/struct_nv_flow_grid_export_debug_vis_view.html index 5c6339d..b87efce 100644 --- a/docs/api/files/struct_nv_flow_grid_export_debug_vis_view.html +++ b/docs/api/files/struct_nv_flow_grid_export_debug_vis_view.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridExportDebugVisView Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridExportDebugVisView Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_export_handle.html b/docs/api/files/struct_nv_flow_grid_export_handle.html index 23bbbfa..9f3ca16 100644 --- a/docs/api/files/struct_nv_flow_grid_export_handle.html +++ b/docs/api/files/struct_nv_flow_grid_export_handle.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridExportHandle Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridExportHandle Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_export_import_layer_mapping.html b/docs/api/files/struct_nv_flow_grid_export_import_layer_mapping.html index 3e4e9c3..852e48a 100644 --- a/docs/api/files/struct_nv_flow_grid_export_import_layer_mapping.html +++ b/docs/api/files/struct_nv_flow_grid_export_import_layer_mapping.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridExportImportLayerMapping Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridExportImportLayerMapping Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_export_import_layered_mapping.html b/docs/api/files/struct_nv_flow_grid_export_import_layered_mapping.html index c4632bb..7448823 100644 --- a/docs/api/files/struct_nv_flow_grid_export_import_layered_mapping.html +++ b/docs/api/files/struct_nv_flow_grid_export_import_layered_mapping.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridExportImportLayeredMapping Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridExportImportLayeredMapping Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_export_layer_view.html b/docs/api/files/struct_nv_flow_grid_export_layer_view.html index 2f22186..f5f3343 100644 --- a/docs/api/files/struct_nv_flow_grid_export_layer_view.html +++ b/docs/api/files/struct_nv_flow_grid_export_layer_view.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridExportLayerView Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridExportLayerView Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_export_layered_view.html b/docs/api/files/struct_nv_flow_grid_export_layered_view.html index 79afac4..d0cc56c 100644 --- a/docs/api/files/struct_nv_flow_grid_export_layered_view.html +++ b/docs/api/files/struct_nv_flow_grid_export_layered_view.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridExportLayeredView Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridExportLayeredView Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_export_simple_shape.html b/docs/api/files/struct_nv_flow_grid_export_simple_shape.html index 4477a3b..6fe78fb 100644 --- a/docs/api/files/struct_nv_flow_grid_export_simple_shape.html +++ b/docs/api/files/struct_nv_flow_grid_export_simple_shape.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridExportSimpleShape Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridExportSimpleShape Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_import_desc.html b/docs/api/files/struct_nv_flow_grid_import_desc.html index af7a362..f8067f1 100644 --- a/docs/api/files/struct_nv_flow_grid_import_desc.html +++ b/docs/api/files/struct_nv_flow_grid_import_desc.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridImportDesc Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridImportDesc Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_import_handle.html b/docs/api/files/struct_nv_flow_grid_import_handle.html index 20072de..0dc22d4 100644 --- a/docs/api/files/struct_nv_flow_grid_import_handle.html +++ b/docs/api/files/struct_nv_flow_grid_import_handle.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridImportHandle Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridImportHandle Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_import_layer_view.html b/docs/api/files/struct_nv_flow_grid_import_layer_view.html index 5967f7d..eb54235 100644 --- a/docs/api/files/struct_nv_flow_grid_import_layer_view.html +++ b/docs/api/files/struct_nv_flow_grid_import_layer_view.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridImportLayerView Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridImportLayerView Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_import_layered_view.html b/docs/api/files/struct_nv_flow_grid_import_layered_view.html index d859631..8c1da8e 100644 --- a/docs/api/files/struct_nv_flow_grid_import_layered_view.html +++ b/docs/api/files/struct_nv_flow_grid_import_layered_view.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridImportLayeredView Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridImportLayeredView Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_import_params.html b/docs/api/files/struct_nv_flow_grid_import_params.html index 50f1fef..4d4d81b 100644 --- a/docs/api/files/struct_nv_flow_grid_import_params.html +++ b/docs/api/files/struct_nv_flow_grid_import_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridImportParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridImportParams Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_import_state_c_p_u_params.html b/docs/api/files/struct_nv_flow_grid_import_state_c_p_u_params.html index 66eacab..803a2db 100644 --- a/docs/api/files/struct_nv_flow_grid_import_state_c_p_u_params.html +++ b/docs/api/files/struct_nv_flow_grid_import_state_c_p_u_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridImportStateCPUParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridImportStateCPUParams Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_material_handle.html b/docs/api/files/struct_nv_flow_grid_material_handle.html index 15f84f0..8d2be70 100644 --- a/docs/api/files/struct_nv_flow_grid_material_handle.html +++ b/docs/api/files/struct_nv_flow_grid_material_handle.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridMaterialHandle Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridMaterialHandle Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_material_params.html b/docs/api/files/struct_nv_flow_grid_material_params.html index 2d5de32..ba4f20f 100644 --- a/docs/api/files/struct_nv_flow_grid_material_params.html +++ b/docs/api/files/struct_nv_flow_grid_material_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridMaterialParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridMaterialParams Struct Reference @@ -70,12 +70,24 @@ NvFlowGridMaterialPerComponent velocity  Velocity component parameters.
              +float vorticityConstantMask + + Works as other masks, provides fixed offset.
              +float vorticityFuelMask + + 0.f disabled; 1.0f higher fuel, higher strength; -1.0f for inverse
              +float vorticitySmokeMask + + 0.f disabled; 1.0f higher smoke, higher strength; -1.0f for inverse
              float vorticityStrength  Higher values increase rotation, reduce laminar flow.
              +float vorticityTemperatureMask + + 0.f disabled; 1.0f higher temperatures, higher strength; -1.0f for inverse
              float vorticityVelocityMask - 0.f means zero velocity magnitude influence on vorticity
              + 0.f disabled; 1.0f higher velocities, higher strength; -1.0f for inverse


              Detailed Description

              Grid material parameters.

              Field Documentation

              @@ -281,6 +293,57 @@ Temperature increase per unit burn. Velocity component parameters.

              + +

              + +

              + +
              + +

              +Works as other masks, provides fixed offset. +

              + +

              +

              + +

              + +
              + +

              +0.f disabled; 1.0f higher fuel, higher strength; -1.0f for inverse +

              + +

              +

              + +

              + +
              + +

              +0.f disabled; 1.0f higher smoke, higher strength; -1.0f for inverse +

              +

              @@ -298,6 +361,23 @@ Velocity component parameters. Higher values increase rotation, reduce laminar flow.

              + +

              + +

              + +
              + +

              +0.f disabled; 1.0f higher temperatures, higher strength; -1.0f for inverse +

              +

              @@ -312,7 +392,7 @@ Higher values increase rotation, reduce laminar flow.

              -0.f means zero velocity magnitude influence on vorticity +0.f disabled; 1.0f higher velocities, higher strength; -1.0f for inverse

              diff --git a/docs/api/files/struct_nv_flow_grid_material_per_component.html b/docs/api/files/struct_nv_flow_grid_material_per_component.html index 04ecc22..e224a2a 100644 --- a/docs/api/files/struct_nv_flow_grid_material_per_component.html +++ b/docs/api/files/struct_nv_flow_grid_material_per_component.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridMaterialPerComponent Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridMaterialPerComponent Struct Reference diff --git a/docs/api/files/struct_nv_flow_grid_params.html b/docs/api/files/struct_nv_flow_grid_params.html index e1c7c37..dd2c538 100644 --- a/docs/api/files/struct_nv_flow_grid_params.html +++ b/docs/api/files/struct_nv_flow_grid_params.html @@ -1,6 +1,6 @@ - NVIDIA(R) Flow(R) 1.0.0 API Reference: NvFlowGridParams Struct Reference + NVIDIA(R) Flow(R) 1.0.1 API Reference: NvFlowGridParams Struct Reference @@ -49,6 +49,9 @@ bool pressureLegacyMode  If true, run older less accurate pressure solver.
              +bool singlePassAdvection + + If true, enables single pass advection.

              Detailed Description

              Parameters controlling grid behavior.

              Field Documentation

              @@ -135,6 +138,23 @@ Gravity vector for use by buoyancy. If true, run older less accurate pressure solver.

              + +

              + +

              + +
              + +

              +If true, enables single pass advection. +

              +


              The documentation for this struct was generated from the following file:
            • Release Notes
            @@ -137,7 +138,7 @@ @@ -152,6 +153,30 @@ + + + + + + + - + @@ -56,7 +56,7 @@ @@ -91,8 +91,9 @@
        • Release Notes
        @@ -153,7 +154,7 @@ Flexible simulation and rendering also supports a range of magical effects.

        @@ -168,6 +169,30 @@ Flexible simulation and rendering also supports a range of magical effects.

        + + + + + + + - + @@ -57,7 +57,7 @@ @@ -92,8 +92,9 @@
    • Release Notes
    @@ -271,7 +272,7 @@ since the emitter location and orientation will be advanced a shorter distance p @@ -286,6 +287,30 @@ since the emitter location and orientation will be advanced a shorter distance p + + + + + + + - + @@ -56,7 +56,7 @@ @@ -91,8 +91,9 @@
  • Release Notes
  • @@ -124,7 +125,15 @@

    Release Notes

    -

    1.0.0

    +

    1.0.1

    +
      +
    • Moving grid support.
    • +
    • Single pass advection.
    • +
    • Vorticity confinement masks.
    • +
    +
    +
    +

    1.0.0

    • D3D12 support.
    • MultiGPU, allowing DX12 Flow simulation and inter-GPU tranfer, in both DX11 and DX12 applications.
    • @@ -134,8 +143,8 @@
    • Grid data access APIs.
    -
    -

    0.1.1

    +
    +

    0.1.1

    • Initial Release
    @@ -151,7 +160,7 @@ @@ -166,6 +175,30 @@
    + + + + + + + - + @@ -52,7 +52,7 @@ @@ -87,8 +87,9 @@
  • Release Notes
  • @@ -131,7 +132,7 @@ @@ -146,6 +147,30 @@
    + + + + + + +