Compare commits

..

174 Commits

Author SHA1 Message Date
icex2
18f84e4751 merge commit for archive created by Sapling 2025-02-20 14:42:23 +01:00
icex2
19f0776627 doc: Dev journal entry about IIDX engine and syncbook
Due to recent development of tools and discussions, this
is something that came up and has probably been overdue
for ages.

Document key concepts of how the iidx engine works regaring
rendering, game loop and (song) sync.

Add a “syncbook” that provides context and guidelines how
to configure any (modern) system to work properly with iidx.
2025-02-20 14:42:15 +01:00
icex2
aad38449e3 merge commit for archive created by Sapling 2025-02-20 12:31:48 +01:00
icex2
1c0092c9be doc: Dev journal entry about IIDX engine and syncbook
Due to recent development of tools and discussions, this
is something that came up and has probably been overdue
for ages.

Document key concepts of how the iidx engine works regaring
rendering, game loop and (song) sync.

Add a “syncbook” that provides context and guidelines how
to configure any (modern) system to work properly with iidx.
2025-02-20 12:31:36 +01:00
icex2
1db5260a59 Merge c337bdb7c0 into sapling-pr-archive-icex2 2025-02-20 12:21:56 +01:00
icex2
c337bdb7c0 doc: Dev journal entry about IIDX engine and syncbook
Due to recent development of tools and discussions, this
is something that came up and has probably been overdue
for ages.

Document key concepts of how the iidx engine works regaring
rendering, game loop and (song) sync.

Add a “syncbook” that provides context and guidelines how
to configure any (modern) system to work properly with iidx.
2025-02-20 12:20:55 +01:00
icex2
9cb37ccc11 merge commit for archive created by Sapling 2025-02-19 19:48:42 +01:00
icex2
549e50dfa7 fix: Missing closing bracket
Fix mistake that happened during conflict resolution
before the merge.
2025-02-19 19:48:30 +01:00
icex2
d5e4cc3447 Merge ae02d6556b into sapling-pr-archive-icex2 2025-02-19 19:42:55 +01:00
icex2
ae02d6556b feat(nvgpu): Add —overwrite-exists flag for profile creation
When running this in a script on startup to ensure
whatever configuration is required to be created is
created, this avoids several commands to first
check if the profile exists, delete it, then re-create it.
2025-02-19 19:42:48 +01:00
icex2
071a3994ed Merge 5bee76e553 into sapling-pr-archive-icex2 2025-02-19 19:41:41 +01:00
icex2
5bee76e553 feat(nvgpu): Add —overwrite-exists flag for profile creation
When running this in a script on startup to ensure
whatever configuration is required to be created is
created, this avoids several commands to first
check if the profile exists, delete it, then re-create it.
2025-02-19 19:41:33 +01:00
icex2
3c2dda505e fix(nvgpu): Initialize value of parameter to fix INVALID_ARGUMENT
As stated by the documentation in nvapi.h, path_info_count
must be set to the value 0 in this case.
2025-02-19 19:41:33 +01:00
icex2
d840f7bb8f Merge df4f646b70 into sapling-pr-archive-icex2 2025-02-19 19:40:27 +01:00
icex2
df4f646b70 feat(nvgpu): Add —overwrite-exists flag for profile creation
When running this in a script on startup to ensure
whatever configuration is required to be created is
created, this avoids several commands to first
check if the profile exists, delete it, then re-create it.
2025-02-19 19:40:21 +01:00
icex2
ca9cac9c19 fix(nvgpu): Initialize value of parameter to fix INVALID_ARGUMENT
As stated by the documentation in nvapi.h, path_info_count
must be set to the value 0 in this case.
2025-02-19 19:40:21 +01:00
icex2
7943ecffcd fix(nvgpu): Missing error handling not returning
If fetching the configuration fails, don’t continue with
processing any non-existing data.
2025-02-19 19:40:21 +01:00
icex2
51ce7c739a Merge c6180bdf47 into sapling-pr-archive-icex2 2025-02-19 19:39:17 +01:00
icex2
c6180bdf47 feat(nvgpu): Add —overwrite-exists flag for profile creation
When running this in a script on startup to ensure
whatever configuration is required to be created is
created, this avoids several commands to first
check if the profile exists, delete it, then re-create it.
2025-02-19 19:39:10 +01:00
icex2
c3a337ceb4 fix(nvgpu): Initialize value of parameter to fix INVALID_ARGUMENT
As stated by the documentation in nvapi.h, path_info_count
must be set to the value 0 in this case.
2025-02-19 19:39:10 +01:00
icex2
a3d890dcd7 fix(nvgpu): Missing error handling not returning
If fetching the configuration fails, don’t continue with
processing any non-existing data.
2025-02-19 19:39:10 +01:00
icex2
ee3d1d2592 chore: Remove TODO
Forgot to remove that after adressing the issue of needing
three calls in nvgpu to get the config data correctly.
2025-02-19 19:39:10 +01:00
icex2
4159813873 merge commit for archive created by Sapling 2025-02-19 19:36:53 +01:00
icex2
c5083a6d4a feat(nvgpu): Add —overwrite-exists flag for profile creation
When running this in a script on startup to ensure
whatever configuration is required to be created is
created, this avoids several commands to first
check if the profile exists, delete it, then re-create it.
2025-02-19 19:36:36 +01:00
icex2
8752c7dcc5 fix(nvgpu): Initialize value of parameter to fix INVALID_ARGUMENT
As stated by the documentation in nvapi.h, path_info_count
must be set to the value 0 in this case.
2025-02-19 19:36:36 +01:00
icex2
6276cb4e97 fix(nvgpu): Missing error handling not returning
If fetching the configuration fails, don’t continue with
processing any non-existing data.
2025-02-19 19:36:36 +01:00
icex2
fcbb4160ee chore: Remove TODO
Forgot to remove that after adressing the issue of needing
three calls in nvgpu to get the config data correctly.
2025-02-19 19:36:36 +01:00
icex2
9bcbe9170f feat: Extend monitor check tool, vsync and response time tests
Adding two more tests that have been proven very useful
for debugging monitor issues that caused problems with IIDX.

The vsync test flickers a text snippet between red and cyan on
every even and uneven frame. If vsync works correctly, the text
appears grey to the human eye. If there are issues like re-displaying
a previous frame or a dropped frame, this appears as the text
rendering red or cyan.

The response time test scrolls two simple blocks/lines vertically
to check if they creating ghosting/smearing on the display.

The tool now supports an interactive and command line mode.

Interactive mode is useful for running different tests on the setup
while the command line mode can be used to ran these tests
with fixed parameters and for a fixed amount of time, e.g. in a shell
script, for automation purpose.

The tool still has a few obvious imperfections like scaling issues on
different resolutions. Considering the basic functionality is given,
further improvements can follow in future iterations.
2025-02-19 19:36:27 +01:00
icex2
e74e3f1472 Merge 2062b803ff into sapling-pr-archive-icex2 2025-02-13 15:05:48 +01:00
icex2
2062b803ff feat: d3d9-frame-graph-hook, add frame rate graph view
Have a checkbox to switch to a frame graph focused view
which saves a bunch of math when it’s more useful to
focus on the frame/refresh rate than the frame time values.
2025-02-13 15:05:32 +01:00
icex2
7391cfa555 merge commit for archive created by Sapling 2025-02-13 14:53:12 +01:00
icex2
06d4467d5a feat: nvgpu, add option to enable gpu scaling
GPU scaling allows high quality upscaling of older games
to the native resolution of the screen. The output frame
quality is significantly sharper than the fairly simple
frame buffer upscaling of bemanitools.
2025-02-13 14:52:49 +01:00
icex2
b0b380e70c Merge f0b3556ac5 into sapling-pr-archive-icex2 2025-02-13 14:47:37 +01:00
icex2
f0b3556ac5 feat: nvgpu, make test timeout parameter optional
10 seconds is what the nvidia control panel also
has for the test timeout. Can still be changed if
shorter or longer timeouts are desired, but 10
seconds should be a general fine timeout value
to have this optional.
2025-02-13 14:47:22 +01:00
icex2
54284adf5f merge commit for archive created by Sapling 2025-02-13 14:42:06 +01:00
icex2
451f9d4021 feat: d3d9-monitor-check add result-timeout-secs parameter
Allow changing the time in seconds how long the results
are being displayed before exiting
2025-02-13 14:38:07 +01:00
icex2
1b0426941d merge commit for archive created by Sapling 2025-02-13 14:34:30 +01:00
icex2
f5a82fe049 feat: d3d9-monitor-check allow skip results
Allow pressing ESC to skip results and not having
to wait for 5 secs
2025-02-13 14:34:13 +01:00
icex2
2a5ddacb36 Merge 9246f72b80 into sapling-pr-archive-icex2 2025-02-13 14:30:12 +01:00
icex2
9246f72b80 feat: Improve d3d9-monitor-check command line args
Use more user-friendly seconds for total and warm-up time
instead of frames. Use the refresh rate to calculcate the
total frame count internally for the test.
2025-02-13 14:30:05 +01:00
icex2
f6d8e30671 Merge 8afab5c232 into sapling-pr-archive-icex2 2025-02-13 14:29:28 +01:00
icex2
8afab5c232 feat: Improve d3d9-monitor-check command line args
Use more user-friendly seconds for total and warm-up time
instead of frames. Use the refresh rate to calculcate the
total frame count internally for the test.
2025-02-13 14:29:21 +01:00
icex2
c0be02a24f feat: d3d9-monitor-check tool (#322)
A separate application to run the infamous IIDX “monitor check”.

The on-screen output has been enhanced to provide more
detailed information about the on-going process. The tool
furthermore allows basic querying of adapter and adapter
modes information from the command line. These additional
options can be useful to gather more debug information
or select correct parameters for the monitor test from actually
supported mode parameters by the adapter.

The tool has been tested on an actual cabinet with nvgpu
setting different custom timings. The accuracy seems to be
even higher than what IIDX’s monitor check is actually showing.
For example, with a custom timing of 59.900, the tool yields 59.902.
Meanwhile, the monitor check of iidx 29 59.8981 hz to 59.8997 hz
on screen.

This doesn’t mean the game’s getting inaccurate values. The game
actually syncs and plays just fine. However, the game’s monitor check
cannot be used as a reference for “getting the avg. refresh rate”
value as an input parameter for other tools, e.g. chart patching with
btools.

Co-authored-by: icex2 <djh.icex2@gmail.com>
2025-02-13 14:28:34 +01:00
icex2
e7459659dd merge commit for archive created by Sapling 2025-02-13 14:27:16 +01:00
icex2
3aa128e525 feat: Improve d3d9-monitor-check command line args
Use more user-friendly seconds for total and warm-up time
instead of frames. Use the refresh rate to calculcate the
total frame count internally for the test.
2025-02-13 14:26:33 +01:00
icex2
74bdd65098 Merge a66aba45b9 into sapling-pr-archive-icex2 2025-02-11 15:52:28 +01:00
icex2
a66aba45b9 feat: d3d9-monitor-check tool
A separate application to run the infamous IIDX “monitor check”.

The on-screen output has been enhanced to provide more
detailed information about the on-going process. The tool
furthermore allows basic querying of adapter and adapter
modes information from the command line. These additional
options can be useful to gather more debug information
or select correct parameters for the monitor test from actually
supported mode parameters by the adapter.

The tool has been tested on an actual cabinet with nvgpu
setting different custom timings. The accuracy seems to be
even higher than what IIDX’s monitor check is actually showing.
For example, with a custom timing of 59.900, the tool yields 59.902.
Meanwhile, the monitor check of iidx 29 59.8981 hz to 59.8997 hz
on screen.

This doesn’t mean the game’s getting inaccurate values. The game
actually syncs and plays just fine. However, the game’s monitor check
cannot be used as a reference for “getting the avg. refresh rate”
value as an input parameter for other tools, e.g. chart patching with
btools.
2025-02-11 15:52:15 +01:00
icex2
1373e9f1f4 Merge 9e2319bd13 into sapling-pr-archive-icex2 2025-02-11 15:34:43 +01:00
icex2
9e2319bd13 feat: Bump iidxhook9 supported versions, EPOLIS “support"
No changes required, just make support visible by reflecting
it in distribution package naming, documentation and
filenaming
2025-02-11 15:34:38 +01:00
icex2
5687392a92 merge commit for archive created by Sapling 2025-02-09 16:16:20 +01:00
icex2
addcdf8d16 doc: Dev journal entry about IIDX engine
Due to recent development of tools and discussions, this
is something that came up and has probably been overdue
for ages.
2025-02-09 16:16:13 +01:00
icex2
1fbb5ac39f merge commit for archive created by Sapling 2025-02-09 15:55:07 +01:00
icex2
191e1e74f0 doc: Dev journal entry about IIDX engine
Due to recent development of tools and discussions, this
is something that came up and has probably been overdue
for ages.
2025-02-09 15:54:58 +01:00
icex2
34807f0b9d Merge d442177f21 into sapling-pr-archive-icex2 2025-02-09 15:21:46 +01:00
icex2
d442177f21 doc: Dev journal entry about IIDX engine
Due to recent development of tools and discussions, this
is something that came up and has probably been overdue
for ages.
2025-02-09 15:21:40 +01:00
icex2
af372df06b Merge 4ed3c97c2a into sapling-pr-archive-icex2 2025-02-08 23:22:01 +01:00
icex2
4ed3c97c2a feat: Add separate d3d9-frame-graph-hook
Allow this to be hooked by any application with a d3d9
render backend. This is not compatible with d3d9ex.
2025-02-08 23:21:49 +01:00
icex2
0d876fc806 merge commit for archive created by Sapling 2025-02-08 23:20:46 +01:00
icex2
2b08a0cc1a feat: Add frame time performance graph imgui overlay
A overlay window showing the a frame time graph with
the current frame time, ~10 seconds of history as well
as reference lines for the current avg. and a configurable
target frame time.

This is considered a debug tool to support in any efforts
that are related to understanding current frame times
of the games. More specifically this can be used to asses
impact of any bemanitools hooking to the game’s main
(render) loop.
2025-02-08 23:20:31 +01:00
icex2
d8e604cdd9 Merge 95f792f655 into sapling-pr-archive-icex2 2025-02-08 23:18:31 +01:00
icex2
95f792f655 feat: Add bt d3d9 hook specific imgui overlay
For now, we focus on internal overlays for bemanitools
that hook into an existing d3d9 context. The current
abstraction is fairly thin and should be fine as a start.

Implementations are called “components” and hook
up with a single frame_update function to execute
and logic and drawing updates with imgui
2025-02-08 23:18:16 +01:00
icex2
7b8eec72d3 merge commit for archive created by Sapling 2025-02-08 23:16:47 +01:00
icex2
83621fa5d5 fix: Add missing hook_table_revert function
The function signature was already defined in the header
but the implementation in the module missing
2025-02-08 23:16:40 +01:00
icex2
563d6dd793 Merge e69c75bf7f into sapling-pr-archive-icex2 2025-02-08 23:14:58 +01:00
icex2
e69c75bf7f fix: Add missing hook_table_revert function
The function signature was already defined in the header
but the implementation in the module missing
2025-02-08 23:14:25 +01:00
icex2
847cc3322e Merge 48cd2bc687 into sapling-pr-archive-icex2 2025-02-08 23:12:42 +01:00
icex2
48cd2bc687 feat: Integrate imgui library
Version 1.91.7 of the imgui library with the cimgui wrapper.

imgui allows us to easily create minimal and powerful UI for
use-cases like in-game overlays or separate tooling.

The additional wrappers cimgui_impl_dx9 and cimgui_impl_win32
were added to provide a full C linkage integration for the rest
of the code base.

Tweaks to the makefile were kept to a minimum but enable
compilation of C++ since imgui is C++ based.

Remark: At this point bemanitools itself is still to be kept a pure
C codebase. Due to the lack of proper module/library management
with the current build system in bemanitools 5, proper separation
of concerns and clean integration with external libraries isn’t
possible with reasonable effort.
2025-02-08 23:11:59 +01:00
icex2
3db8bc4898 Merge 9b5f627dd1 into sapling-pr-archive-icex2 2025-02-08 23:02:32 +01:00
icex2
9b5f627dd1 feat: nvgpu tool for tweaking nvidia gpu driver settings
An open source re-implementation of the “NvDisplayConfigLDJ"
tool with additional enhancements.

This can be used to tweak your nvidia GPU driver settings to
create custom display timings to address IIDX’s requirement
if expecting proper display timings. This can also be used for
any legacy IIDX versions that even expect very specific display
timings, e.g. 59.95 or 60.05 hz.

Furthermore, creating application profiles allows further tweaks
to important GPU settings such as the current performance mode
setting. This is crucial to ensure the GPU is not going into any
kind of power saving states which results in non-smooth
scrolling during gameplay and micro stuttering that cannot
be measured on application level.
2025-02-08 23:02:27 +01:00
icex2
29f57065fe merge commit for archive created by Sapling 2025-02-08 23:01:49 +01:00
icex2
05889947fe feat: nvgpu tool for tweaking nvidia gpu driver settings
An open source re-implementation of the “NvDisplayConfigLDJ"
tool with additional enhancements.

This can be used to tweak your nvidia GPU driver settings to
create custom display timings to address IIDX’s requirement
if expecting proper display timings. This can also be used for
any legacy IIDX versions that even expect very specific display
timings, e.g. 59.95 or 60.05 hz.

Furthermore, creating application profiles allows further tweaks
to important GPU settings such as the current performance mode
setting. This is crucial to ensure the GPU is not going into any
kind of power saving states which results in non-smooth
scrolling during gameplay and micro stuttering that cannot
be measured on application level.
Summary:

Test Plan:
2025-02-08 23:00:58 +01:00
icex2
2a34bb19da Merge 8b22ef1e8c into sapling-pr-archive-icex2 2025-02-08 22:44:01 +01:00
icex2
8b22ef1e8c feat: Add iidxio-async implementation
A shim library implementing the same concept as the already
existing ddrio-async library. The iidxio implementation takes
another iidxio library and runs it asynchronously which may
improve performance for certain iidxio implementations,
e.g. if the send and receive functions are driving actual IO
calls synchrously and are expensive.

This is not a replacement for a well engineered and proper
implementation of a iidxio library for any specific use-case.
It does not fix bad performance of existing implementations,
i.e. if the poll rate is too low because actual IO is too slow.

Use with caution and know why and when you need to use
it.
2025-02-08 22:42:52 +01:00
icex2
b2006ec9be merge commit for archive created by Sapling 2025-02-08 22:39:49 +01:00
icex2
db6e7a6ad9 feat: d3d9-monitor-check tool
A separate application to run the infamous IIDX “monitor check”.

The on-screen output has been enhanced to provide more
detailed information about the on-going process. The tool
furthermore allows basic querying of adapter and adapter
modes information from the command line. These additional
options can be useful to gather more debug information
or select correct parameters for the monitor test from actually
supported mode parameters by the adapter.

The tool has been tested on an actual cabinet with nvgpu
setting different custom timings. The accuracy seems to be
even higher than what IIDX’s monitor check is actually showing.
For example, with a custom timing of 59.900, the tool yields 59.902.
Meanwhile, the monitor check of iidx 29 59.8981 hz to 59.8997 hz
on screen.

This doesn’t mean the game’s getting inaccurate values. The game
actually syncs and plays just fine. However, the game’s monitor check
cannot be used as a reference for “getting the avg. refresh rate”
value as an input parameter for other tools, e.g. chart patching with
btools.
2025-02-08 22:39:41 +01:00
icex2
f15eec50fe Merge 27bb8a0e2d into sapling-pr-archive-icex2 2025-02-08 22:17:30 +01:00
icex2
27bb8a0e2d feat: d3d9-monitor-check tool
A separate application to run the infamous IIDX “monitor check”.

The on-screen output has been enhanced to provide more
detailed information about the on-going process. The tool
furthermore allows basic querying of adapter and adapter
modes information from the command line. These additional
options can be useful to gather more debug information
or select correct parameters for the monitor test from actually
supported mode parameters by the adapter.

The tool has been tested on an actual cabinet with nvgpu
setting different custom timings. The accuracy seems to be
even higher than what IIDX’s monitor check is actually showing.
For example, with a custom timing of 59.900, the tool yields 59.902.
Meanwhile, the monitor check of iidx 30 yields ~XXX TODO.
2025-02-08 22:17:27 +01:00
icex2
e0c7141896 Merge 5f5824f9f8 into sapling-pr-archive-icex2 2025-02-08 22:17:05 +01:00
icex2
5f5824f9f8 feat: d3d9-monitor-check tool
Summary:

Test Plan:
A separate application to run the infamous IIDX “monitor check”.

The on-screen output has been enhanced to provide more
detailed information about the on-going process. The tool
furthermore allows basic querying of adapter and adapter
modes information from the command line. These additional
options can be useful to gather more debug information
or select correct parameters for the monitor test from actually
supported mode parameters by the adapter.

The tool has been tested on an actual cabinet with nvgpu
setting different custom timings. The accuracy seems to be
even higher than what IIDX’s monitor check is actually showing.
For example, with a custom timing of 59.900, the tool yields 59.902.
Meanwhile, the monitor check of iidx 30 yields ~XXX TODO.
2025-02-08 22:16:55 +01:00
icex2
9cf9cac4e3 merge commit for archive created by Sapling 2025-02-07 22:41:56 +01:00
icex2
a11c7a0704 feat: Add separate d3d9-frame-graph-hook
Allow this to be hooked by any application with a d3d9
render backend. This is not compatible with d3d9ex.
2025-02-07 22:41:44 +01:00
icex2
83473a83be feat: nvgpu tool for tweaking nvidia gpu driver settings
An open source re-implementation of the “NvDisplayConfigLDJ"
tool with additional enhancements.

This can be used to tweak your nvidia GPU driver settings to
create custom display timings to address IIDX’s requirement
if expecting proper display timings. This can also be used for
any legacy IIDX versions that even expect very specific display
timings, e.g. 59.95 or 60.05 hz.

Furthermore, creating application profiles allows further tweaks
to important GPU settings such as the current performance mode
setting. This is crucial to ensure the GPU is not going into any
kind of power saving states which results in non-smooth
scrolling during gameplay and micro stuttering that cannot
be measured on application level.
Summary:

Test Plan:
2025-02-07 22:41:44 +01:00
icex2
aa3e7d307d feat: Add frame time performance graph imgui overlay
A overlay window showing the a frame time graph with
the current frame time, ~10 seconds of history as well
as reference lines for the current avg. and a configurable
target frame time.

This is considered a debug tool to support in any efforts
that are related to understanding current frame times
of the games. More specifically this can be used to asses
impact of any bemanitools hooking to the game’s main
(render) loop.
2025-02-07 22:41:44 +01:00
icex2
1800f75f3d feat: Add bt d3d9 hook specific imgui overlay
For now, we focus on internal overlays for bemanitools
that hook into an existing d3d9 context. The current
abstraction is fairly thin and should be fine as a start.

Implementations are called “components” and hook
up with a single frame_update function to execute
and logic and drawing updates with imgui
2025-02-07 22:41:44 +01:00
icex2
c0289b14d3 fix: Add missing hook_table_revert function
The function signature was already defined in the header
but the implementation in the module missing
2025-02-07 22:41:44 +01:00
icex2
d17dcea594 feat: Integrate imgui library, squash to initial integration
Version 1.91.7 of the imgui library with the cimgui wrapper.

imgui allows us to easily create minimal and powerful UI for
use-cases like in-game overlays or separate tooling.

The additional wrappers cimgui_impl_dx9 and cimgui_impl_win32
were added to provide a full C linkage integration for the rest
of the code base.

Tweaks to the makefile were kept to a minimum but enable
compilation of C++ since imgui is C++ based.

Remark: At this point bemanitools itself is still to be kept a pure
C codebase. Due to the lack of proper module/library management
with the current build system in bemanitools 5, proper separation
of concerns and clean integration with external libraries isn’t
possible with reasonable effort.


Summary:

Test Plan:
2025-02-07 22:41:44 +01:00
icex2
002a5727ef Merge 1e4fffb5f9 into sapling-pr-archive-icex2 2025-02-07 16:17:23 +01:00
icex2
1e4fffb5f9 feat: Add separate d3d9-frame-graph-hook
Allow this to be hooked by any application with a d3d9
render backend. This is not compatible with d3d9ex.
2025-02-07 16:17:13 +01:00
icex2
93fe44b46e Merge e12eb2b969 into sapling-pr-archive-icex2 2025-02-07 16:15:55 +01:00
icex2
e12eb2b969 feat: Add separate d3d9-frame-graph-hook
Allow this to be hooked by any application with a d3d9
render backend. This is not compatible with d3d9ex.
2025-02-07 16:15:44 +01:00
icex2
0afadc6576 Merge 8b82b32894 into sapling-pr-archive-icex2 2025-02-07 15:19:17 +01:00
icex2
8b82b32894 feat: Integrate frame time performance graph into iidxhook 1-8
Integrate the previously created frame time graph component
into iidxhook 1 to 8. iidxhook9 uses d3d9ex which still requires
a separate hook implementation for imgui.

Guard the feature with a switch as it might have some performance
impact and it’s something that is only required to be turned on
when needed.
2025-02-07 15:19:02 +01:00
icex2
8efeb68c75 feat: Add frame time performance graph imgui overlay
A overlay window showing the a frame time graph with
the current frame time, ~10 seconds of history as well
as reference lines for the current avg. and a configurable
target frame time.

This is considered a debug tool to support in any efforts
that are related to understanding current frame times
of the games. More specifically this can be used to asses
impact of any bemanitools hooking to the game’s main
(render) loop.
2025-02-07 15:14:25 +01:00
icex2
d482acd533 feat: Add bt d3d9 hook specific imgui overlay
For now, we focus on internal overlays for bemanitools
that hook into an existing d3d9 context. The current
abstraction is fairly thin and should be fine as a start.

Implementations are called “components” and hook
up with a single frame_update function to execute
and logic and drawing updates with imgui
2025-02-07 15:12:21 +01:00
icex2
8d49bd8f40 fix: Add missing hook_table_revert function
The function signature was already defined in the header
but the implementation in the module missing
2025-02-07 15:10:31 +01:00
icex2
d977a0bf35 feat: Integrate imgui library, squash to initial integration
Version 1.91.7 of the imgui library with the cimgui wrapper.

imgui allows us to easily create minimal and powerful UI for
use-cases like in-game overlays or separate tooling.

The additional wrappers cimgui_impl_dx9 and cimgui_impl_win32
were added to provide a full C linkage integration for the rest
of the code base.

Tweaks to the makefile were kept to a minimum but enable
compilation of C++ since imgui is C++ based.

Remark: At this point bemanitools itself is still to be kept a pure
C codebase. Due to the lack of proper module/library management
with the current build system in bemanitools 5, proper separation
of concerns and clean integration with external libraries isn’t
possible with reasonable effort.


Summary:

Test Plan:
2025-02-07 15:10:31 +01:00
icex2
dab2230a1c merge commit for archive created by Sapling 2025-02-07 15:04:02 +01:00
icex2
d25d49b668 fix: Add missing hook_table_revert function
The function signature was already defined in the header
but the implementation in the module missing
2025-02-07 15:03:46 +01:00
icex2
cf8df078f5 Merge 4d8c9359a1 into sapling-pr-archive-icex2 2025-02-07 13:22:26 +01:00
icex2
4d8c9359a1 feat: Add warning if vsync is not enabled
Something I ran into by accident during testing and
development that I had vsync turned off by accident.
Increase visibility in the logs.
2025-02-07 13:22:11 +01:00
icex2
c33e9bb06a Merge 77ff211c68 into sapling-pr-archive-icex2 2025-02-07 13:11:56 +01:00
icex2
77ff211c68 feat: Integrate imgui library
Version 1.91.7 of the imgui library with the cimgui wrapper.

imgui allows us to easily create minimal and powerful UI for
use-cases like in-game overlays or separate tooling.

The additional wrappers cimgui_impl_dx9 and cimgui_impl_win32
were added to provide a full C linkage integration for the rest
of the code base.

Tweaks to the makefile were kept to a minimum but enable
compilation of C++ since imgui is C++ based.

Remark: At this point bemanitools itself is still to be kept a pure
C codebase. Due to the lack of proper module/library management
with the current build system in bemanitools 5, proper separation
of concerns and clean integration with external libraries isn’t
possible with reasonable effort.
2025-02-07 13:11:48 +01:00
icex2
0257ad6b42 Merge 15a1762837 into sapling-pr-archive-icex2 2025-02-07 13:00:37 +01:00
icex2
d92987b229 Merge 5f9aaeddf9 into sapling-pr-archive-icex2 2025-02-07 12:59:34 +01:00
icex2
5f9aaeddf9 feat: nvgpu tool for tweaking nvidia gpu driver settings
An open source re-implementation of the “NvDisplayConfigLDJ"
tool with additional enhancements.

This can be used to tweak your nvidia GPU driver settings to
create custom display timings to address IIDX’s requirement
if expecting proper display timings. This can also be used for
any legacy IIDX versions that even expect very specific display
timings, e.g. 59.95 or 60.05 hz.

Furthermore, creating application profiles allows further tweaks
to important GPU settings such as the current performance mode
setting. This is crucial to ensure the GPU is not going into any
kind of power saving states which results in non-smooth
scrolling during gameplay and micro stuttering that cannot
be measured on application level.
Summary:

Test Plan:
2025-02-07 12:59:28 +01:00
icex2
4cbef617a8 Merge 218ffe72c1 into sapling-pr-archive-icex2 2025-02-07 12:38:42 +01:00
icex2
2ca95ab6d8 Merge 61691f06a7 into sapling-pr-archive-icex2 2025-02-07 12:38:30 +01:00
icex2
61691f06a7 feat: nvgpu tool for tweaking nvidia gpu driver settings
An open source re-implementation of the “NvDisplayConfigLDJ"
tool with additional enhancements.

This can be used to tweak your nvidia GPU driver settings to
create custom display timings to address IIDX’s requirement
if expecting proper display timings. This can also be used for
any legacy IIDX versions that even expect very specific display
timings, e.g. 59.95 or 60.05 hz.

Furthermore, creating application profiles allows further tweaks
to important GPU settings such as the current performance mode
setting. This is crucial to ensure the GPU is not going into any
kind of power saving states which results in non-smooth
scrolling during gameplay and micro stuttering that cannot
be measured on application level.
2025-02-07 12:33:16 +01:00
icex2
218ffe72c1 feat: Add iidxio-async implementation
A shim library implementing the same concept as the already
existing ddrio-async library. The iidxio implementation takes
another iidxio library and runs it asynchronously which may
improve performance for certain iidxio implementations,
e.g. if the send and receive functions are driving actual IO
calls synchrously and are expensive.

This is not a replacement for a well engineered and proper
implementation of a iidxio library for any specific use-case.
It does not fix bad performance of existing implementations,
i.e. if the poll rate is too low because actual IO is too slow.

Use with caution and know why and when you need to use
it.
2025-02-07 12:18:55 +01:00
icex2
8c5cf383b6 Merge 94aa0bdda3 into sapling-pr-archive-icex2 2024-02-25 09:36:13 +01:00
icex2
075381481d merge commit for archive created by Sapling 2024-02-25 09:35:20 +01:00
icex2
94aa0bdda3 feat(avs-util): Add helper to translate property errors 2024-02-25 09:34:37 +01:00
icex2
70e8e2a965 fix(avs): Incorrect function signature
After getting doubts, I looked this one up again on the
assembly. The decompiled output confused me
and no actual value is being returned there.
2024-02-25 09:34:37 +01:00
icex2
d1db1d816f Merge d3273bf1d8 into sapling-pr-archive-icex2 2024-02-25 09:33:50 +01:00
icex2
d3273bf1d8 fix(avs): Incorrect function signature
After getting doubts, I looked this one up again on the
assembly. The decompiled output confused me
and no actual value is being returned there.
2024-02-25 09:33:42 +01:00
icex2
f4f8e7d8e2 Merge c369412f70 into sapling-pr-archive-icex2 2024-02-25 09:32:24 +01:00
icex2
84ff799024 Merge e12cd63ba2 into sapling-pr-archive-icex2 2024-02-25 09:31:08 +01:00
icex2
c369412f70 fix(mingw): Version upgrade caused this to error
HRESULT not defined fixed by including windows header
2024-02-25 09:30:53 +01:00
icex2
26d1da8660 refactor(dist): Config and .bat files
Move everything to new launcher.xml configuration
files. Adjust the bootstrapping of launcher in the
.bat files. Features such as copying the default
props/ files to nvram are now handled by launcher.

Using the PATH variable, bemanitools binaries can
live in their own dedicated bemanitools/ subfolder
next to props/ and modules/ now. All original
binaries are expected to be kept in a modules/
folder like on stock data.
2024-02-25 09:30:53 +01:00
icex2
04310f49fd refactor(launcher): Major re-work of launcher
Kudos to Shiz for providing the groundwork for this.

Fundamentally re-think how launcher operates and
bootstrapping the games is managed and configured.

This brings it significantly closer to how the original
bootstrap is doing the job: launcher now utilizes the
data (structures) provided by the bootstrap.xml configuration
file. This creates compatibility with vanilla data dumps
and original stock images. Note that bemanitools does not
include any code or means to run DRM'd data, only decrypted.

But, this allows users to keep decrypted dumps as stock as
possible which means:

* No copying around of property files anymore
* Keep the modules/ folder with the binaries
* Have bemanitools binaries separate in the data
* No need to edit/customize the original configuration files

A list of key features of the "new" launcher:

* Boostrap games by following the configuration provided by
  stock game's bootstrap.xml files
* Custom launcher.xml configuration file that adds further
  launcher configurable features, composability of
  bootstrap.xml configuration(s) as well as configuration
  overriding/stacking of selected types of configurations,
  e.g. eamuse config, avs-config. The latter eliminates
  the need for modifying stock config files in the prop/
  folder
* Unified logging system: launcher and AVS logging uses
  the same logger, all output can now be in a single file
* Original features such as various hook types still
  available

Due to the significant architectural changes, this also
breaks with any backwards compatibility to existing
launcher setups. Thus, users need to migrate by re-applying
the new configuration format and migrating their config
parameters accordingly.

Further migration instructions and updated documentation
will be provided upon release.

Co-authored-by: Shiz <hi@shiz.me>
2024-02-25 09:30:53 +01:00
icex2
d72996c5d9 refactor(inject): Use new core thread and log modules
Keep this a separate commit because this also removes
inject's own logging engine and replaces it with the
streamlined core API. The core API provides all the
features of inject's own logging engine which also
performed horribly. The entire logging operation
was locked which included expensive operations
that formatted the log messages and required
memory allocations and copying around data.

The core API's implementation at least only
synchronizes the actual IO operations
(though this can be improved further with an
actual async logging sink, TBD)
2024-02-25 09:30:53 +01:00
icex2
5ac858e15d chore: Delete old log and thread modules in util
The log API stopped scaling already a while ago and needs
considerable refactoring to consider the various use-cases
that emerged since it was first created on alpha versions
of bemanitools.
2024-02-25 09:30:53 +01:00
icex2
e4a221e15b refactor: Entire code base, thread and log usage
Boils down to:
- Include headers
- Reduce boiler plate with helpers
- Swap out explicit usages with core API layer
  and ensure the right API is configured beforehand
2024-02-25 09:30:53 +01:00
icex2
ea835b32ee refactor(api): Thread and log API
Split files and add name spacing.
2024-02-25 09:30:53 +01:00
icex2
fb1442b734 feat: Add helper to set avs implementations
Doesn't really reduce boiler plate but adds
clarity with a more meaningful function name
what the operation does.
2024-02-25 09:30:53 +01:00
icex2
87b7e53973 feat: Add core module
This module contains the "core" (API) of
bemanitools which includes an abstraction
layer for threads and logging at this time.

The threads API is very close to what
util/thread already was with some structural
enhancements which make it easier to understand
and work with the API, I hope. Some additional
helpers (*-ext module) support in doing common
tasks, e.g. setting up the thread API with other
modules.

The log(ging) part receives a major overhaul to
address known limitations and issues with the
util/log module:
- Cleaner API layer
- Separate sinks from actual logging engine
- Sinks are composable
- Improved and cleaner compatibility layer
  with AVS logging API

Additional "extensions" (*-ext modules) add
various helper functions for common tasks like
setting up the logging engine with a file and stdout
sink.

The sinks also improved significantly with the file
sink now supporting proper appending and log rotation.
Logging to stdout/stderr supports coloring of log
messages which works across logging engines.

Overall, this refactored foundation is expected to
support future developments and removes known
limitations at the current scale of bemanitools such as:
- Reducing boiler plate code across hooks
- Interop of bemanitools and AVS (and setting the foundation
  for addressing currently missing interop, e.g. for
  dealing with property structures without AVS)
- Addressing performance issues in the logging engine
  due to incorrect interop with AVS
2024-02-25 09:30:53 +01:00
icex2
2e45f095ba feat(avs-util): Add helper to translate property errors 2024-02-25 09:30:53 +01:00
icex2
e12cd63ba2 Fix(avs): Incorrect function signature
After getting doubts, I looked this one up again on the
assembly. The decompiled output confused me
and no actual value is being returned there.
2024-02-25 09:30:47 +01:00
icex2
a4b3f92935 feat(avs): Add property get and clear error functions
Use these to improve error handling by allowing
one to provide additional error information on
property related operations.
2024-02-25 09:23:02 +01:00
icex2
1126011d99 Merge 8804e667b3 into sapling-pr-archive-icex2 2024-02-25 09:22:54 +01:00
icex2
6a98ce1f59 feat(dev): Add a separate docker dev container
Improve the development experience by providing
an additional docker container that can be started
and used as an interactive development environment.
It provides all the tools and a stable environment
for building (identical to the build container).
2024-02-25 09:14:59 +01:00
icex2
dc6e745533 Merge f5b8af3f2a into sapling-pr-archive-icex2 2024-02-25 09:14:52 +01:00
icex2
8804e667b3 feat(avs): Add property get and clear error functions
Use these to improve error handling by allowing
one to provide additional error information on
property related operations.
2024-02-25 09:14:42 +01:00
icex2
f5b8af3f2a feat(dev): Add a separate docker dev container
Improve the development experience by providing
an additional docker container that can be started
and used as an interactive development environment.
It provides all the tools and a stable environment
for building (identical to the build container).
2024-02-25 09:14:42 +01:00
icex2
5833197b03 fix(hook): Add missing hook_table_revert impl
Allow hooks to cleanup when they are shut down.
2024-02-25 09:09:12 +01:00
icex2
339bf0dfed merge commit for archive created by Sapling 2024-02-25 09:08:50 +01:00
icex2
6a320a38c0 fix(mingw): Version upgrade caused this to error
HRESULT not defined fixed by including windows header
2024-02-25 09:08:26 +01:00
icex2
d8a5619a51 refactor(dist): Config and .bat files
Move everything to new launcher.xml configuration
files. Adjust the bootstrapping of launcher in the
.bat files. Features such as copying the default
props/ files to nvram are now handled by launcher.

Using the PATH variable, bemanitools binaries can
live in their own dedicated bemanitools/ subfolder
next to props/ and modules/ now. All original
binaries are expected to be kept in a modules/
folder like on stock data.
2024-02-25 09:08:26 +01:00
icex2
ab6c3fc8bc fix(hook): Add missing hook_table_revert impl
Allow hooks to cleanup when they are shut down.
2024-02-25 09:07:54 +01:00
icex2
215a4bdb15 refactor(launcher): Major re-work of launcher
Kudos to Shiz for providing the groundwork for this.

Fundamentally re-think how launcher operates and
bootstrapping the games is managed and configured.

This brings it significantly closer to how the original
bootstrap is doing the job: launcher now utilizes the
data (structures) provided by the bootstrap.xml configuration
file. This creates compatibility with vanilla data dumps
and original stock images. Note that bemanitools does not
include any code or means to run DRM'd data, only decrypted.

But, this allows users to keep decrypted dumps as stock as
possible which means:

* No copying around of property files anymore
* Keep the modules/ folder with the binaries
* Have bemanitools binaries separate in the data
* No need to edit/customize the original configuration files

A list of key features of the "new" launcher:

* Boostrap games by following the configuration provided by
  stock game's bootstrap.xml files
* Custom launcher.xml configuration file that adds further
  launcher configurable features, composability of
  bootstrap.xml configuration(s) as well as configuration
  overriding/stacking of selected types of configurations,
  e.g. eamuse config, avs-config. The latter eliminates
  the need for modifying stock config files in the prop/
  folder
* Unified logging system: launcher and AVS logging uses
  the same logger, all output can now be in a single file
* Original features such as various hook types still
  available

Due to the significant architectural changes, this also
breaks with any backwards compatibility to existing
launcher setups. Thus, users need to migrate by re-applying
the new configuration format and migrating their config
parameters accordingly.

Further migration instructions and updated documentation
will be provided upon release.

Co-authored-by: Shiz <hi@shiz.me>
2024-02-25 09:07:54 +01:00
icex2
4ac1399923 refactor(inject): Use new core thread and log modules
Keep this a separate commit because this also removes
inject's own logging engine and replaces it with the
streamlined core API. The core API provides all the
features of inject's own logging engine which also
performed horribly. The entire logging operation
was locked which included expensive operations
that formatted the log messages and required
memory allocations and copying around data.

The core API's implementation at least only
synchronizes the actual IO operations
(though this can be improved further with an
actual async logging sink, TBD)
2024-02-25 09:07:54 +01:00
icex2
f688eead44 chore: Delete old log and thread modules in util
The log API stopped scaling already a while ago and needs
considerable refactoring to consider the various use-cases
that emerged since it was first created on alpha versions
of bemanitools.
2024-02-25 09:07:54 +01:00
icex2
e8221631f9 refactor: Entire code base, thread and log usage
Boils down to:
- Include headers
- Reduce boiler plate with helpers
- Swap out explicit usages with core API layer
  and ensure the right API is configured beforehand
2024-02-25 09:07:54 +01:00
icex2
0afca1da49 refactor(api): Thread and log API
Split files and add name spacing.
2024-02-25 09:07:54 +01:00
icex2
734c17a0a2 feat: Add helper to set avs implementations
Doesn't really reduce boiler plate but adds
clarity with a more meaningful function name
what the operation does.
2024-02-25 09:07:54 +01:00
icex2
6940a9de4b feat: Add core module
This module contains the "core" (API) of
bemanitools which includes an abstraction
layer for threads and logging at this time.

The threads API is very close to what
util/thread already was with some structural
enhancements which make it easier to understand
and work with the API, I hope. Some additional
helpers (*-ext module) support in doing common
tasks, e.g. setting up the thread API with other
modules.

The log(ging) part receives a major overhaul to
address known limitations and issues with the
util/log module:
- Cleaner API layer
- Separate sinks from actual logging engine
- Sinks are composable
- Improved and cleaner compatibility layer
  with AVS logging API

Additional "extensions" (*-ext modules) add
various helper functions for common tasks like
setting up the logging engine with a file and stdout
sink.

The sinks also improved significantly with the file
sink now supporting proper appending and log rotation.
Logging to stdout/stderr supports coloring of log
messages which works across logging engines.

Overall, this refactored foundation is expected to
support future developments and removes known
limitations at the current scale of bemanitools such as:
- Reducing boiler plate code across hooks
- Interop of bemanitools and AVS (and setting the foundation
  for addressing currently missing interop, e.g. for
  dealing with property structures without AVS)
- Addressing performance issues in the logging engine
  due to incorrect interop with AVS
2024-02-25 09:07:54 +01:00
icex2
1d489643d1 feat(avs-util): Add helper to translate property errors 2024-02-25 09:07:54 +01:00
icex2
33fee83aff feat(avs): Add property get and clear error functions
Use these to improve error handling by allowing
one to provide additional error information on
property related operations.
2024-02-25 09:07:54 +01:00
icex2
8b377f256a feat(dev): Add a separate docker dev cotainer
Improve the development experience by providing
an additional docker container that can be started
and used as an interactive development environment.
It provides all the tools and a stable environment
for building (identical to the build container).
2024-02-25 09:07:54 +01:00
icex2
64cc7084dc merge commit for archive created by Sapling 2024-02-25 09:02:50 +01:00
icex2
7a086ea60b fix(hook): Add missing hook_table_revert impl
Allow hooks to cleanup when they are shut down.
2024-02-25 09:02:35 +01:00
icex2
7ee9a2e219 fix(dist): Incorrect versioning for ddr distribution packages
Apparently forgotten to get updated to reflect the
currently supported versions correctly.
2024-02-25 08:52:00 +01:00
icex2
fa5a50167f Merge 7a56fab96e into sapling-pr-archive-icex2 2024-02-25 08:51:32 +01:00
icex2
7a56fab96e fix(dist): Incorrect versioning for ddr distribution packages
Apparently forgotten to get updated to reflect the
currently supported versions correctly.
2024-02-25 08:51:25 +01:00
icex2
0c08d19276 merge commit for archive created by Sapling 2024-02-23 18:56:01 +01:00
icex2
c78639f094 fix(mingw): Version upgrade caused this to error
HRESULT not defined fixed by including windows header
2024-02-23 18:53:59 +01:00
icex2
2ebfd39bea refactor(dist): Config and .bat files
Move everything to new launcher.xml configuration
files. Adjust the bootstrapping of launcher in the
.bat files. Features such as copying the default
props/ files to nvram are now handled by launcher.

Using the PATH variable, bemanitools binaries can
live in their own dedicated bemanitools/ subfolder
next to props/ and modules/ now. All original
binaries are expected to be kept in a modules/
folder like on stock data.
2024-02-23 18:53:59 +01:00
icex2
2fe21ae6b7 refactor(launcher): Major re-work of launcher
Kudos to Shiz for providing the groundwork for this.

Fundamentally re-think how launcher operates and
bootstrapping the games is managed and configured.

This brings it significantly closer to how the original
bootstrap is doing the job: launcher now utilizes the
data (structures) provided by the bootstrap.xml configuration
file. This creates compatibility with vanilla data dumps
and original stock images. Note that bemanitools does not
include any code or means to run DRM'd data, only decrypted.

But, this allows users to keep decrypted dumps as stock as
possible which means:

* No copying around of property files anymore
* Keep the modules/ folder with the binaries
* Have bemanitools binaries separate in the data
* No need to edit/customize the original configuration files

A list of key features of the "new" launcher:

* Boostrap games by following the configuration provided by
  stock game's bootstrap.xml files
* Custom launcher.xml configuration file that adds further
  launcher configurable features, composability of
  bootstrap.xml configuration(s) as well as configuration
  overriding/stacking of selected types of configurations,
  e.g. eamuse config, avs-config. The latter eliminates
  the need for modifying stock config files in the prop/
  folder
* Unified logging system: launcher and AVS logging uses
  the same logger, all output can now be in a single file
* Original features such as various hook types still
  available

Due to the significant architectural changes, this also
breaks with any backwards compatibility to existing
launcher setups. Thus, users need to migrate by re-applying
the new configuration format and migrating their config
parameters accordingly.

Further migration instructions and updated documentation
will be provided upon release.

Co-authored-by: Shiz <hi@shiz.me>
2024-02-23 18:53:58 +01:00
icex2
daba638bb0 Merge 359ab5a541 into sapling-pr-archive-icex2 2024-02-23 18:48:44 +01:00
icex2
359ab5a541 refactor(inject): Use new core thread and log modules
Keep this a separate commit because this also removes
inject's own logging engine and replaces it with the
streamlined core API. The core API provides all the
features of inject's own logging engine which also
performed horribly. The entire logging operation
was locked which included expensive operations
that formatted the log messages and required
memory allocations and copying around data.

The core API's implementation at least only
synchronizes the actual IO operations
(though this can be improved further with an
actual async logging sink, TBD)
2024-02-23 18:48:21 +01:00
icex2
6dd3669559 Merge fbadcc9b41 into sapling-pr-archive-icex2 2024-02-23 17:43:06 +01:00
icex2
fbadcc9b41 refactor(dist): Config and .bat files
Move everything to new launcher.xml configuration
files. Adjust the bootstrapping of launcher in the
.bat files. Features such as copying the default
props/ files to nvram are now handled by launcher.

Using the PATH variable, bemanitools binaries can
live in their own dedicated bemanitools/ subfolder
next to props/ and modules/ now. All original
binaries are expected to be kept in a modules/
folder like on stock data.
2024-02-23 17:17:18 +01:00
icex2
ca91e4c4ae refactor(launcher): Major re-work of launcher
Kudos to Shiz for providing the groundwork for this.

Fundamentally re-think how launcher operates and
bootstrapping the games is managed and configured.

This brings it significantly closer to how the original
bootstrap is doing the job: launcher now utilizes the
data (structures) provided by the bootstrap.xml configuration
file. This creates compatibility with vanilla data dumps
and original stock images. Note that bemanitools does not
include any code or means to run DRM'd data, only decrypted.

But, this allows users to keep decrypted dumps as stock as
possible which means:

* No copying around of property files anymore
* Keep the modules/ folder with the binaries
* Have bemanitools binaries separate in the data
* No need to edit/customize the original configuration files

A list of key features of the "new" launcher:

* Boostrap games by following the configuration provided by
  stock game's bootstrap.xml files
* Custom launcher.xml configuration file that adds further
  launcher configurable features, composability of
  bootstrap.xml configuration(s) as well as configuration
  overriding/stacking of selected types of configurations,
  e.g. eamuse config, avs-config. The latter eliminates
  the need for modifying stock config files in the prop/
  folder
* Unified logging system: launcher and AVS logging uses
  the same logger, all output can now be in a single file
* Original features such as various hook types still
  available

Due to the significant architectural changes, this also
breaks with any backwards compatibility to existing
launcher setups. Thus, users need to migrate by re-applying
the new configuration format and migrating their config
parameters accordingly.

Further migration instructions and updated documentation
will be provided upon release.

Co-authored-by: Shiz <hi@shiz.me>
2024-02-23 17:17:17 +01:00
icex2
08a72abb58 refactor(inject): Use new core thread and log modules
Keep this a separate commit because this also removes
inject's own logging engine and replaces it with the
streamlined core API. The core API provides all the
features of inject's own logging engine which also
performed horribly. The entire logging operation
was locked which included expensive operations
that formatted the log messages and required
memory allocations and copying around data.

The core API's implementation at least only
synchronizes the actual IO operations
(though this can be improved further with an
actual async logging sink, TBD)
2024-02-23 17:17:17 +01:00
icex2
7e49fad175 chore: Delete old log and thread modules in util
The log API stopped scaling already a while ago and needs
considerable refactoring to consider the various use-cases
that emerged since it was first created on alpha versions
of bemanitools.
2024-02-23 17:09:15 +01:00
icex2
0adec478cc refactor: Entire code base, thread and log usage
Boils down to:
- Include headers
- Reduce boiler plate with helpers
- Swap out explicit usages with core API layer
  and ensure the right API is configured beforehand
2024-02-23 13:29:53 +01:00
icex2
bc9b8b508e refactor(api): Thread and log API
Split files and add name spacing.
2024-02-23 13:29:53 +01:00
icex2
33372f3ef2 feat(avs-util): Add helper to translate property errors 2024-02-23 12:42:29 +01:00
icex2
dedbdaf729 feat: Add helper to set avs implementations
Doesn't really reduce boiler plate but adds
clarity with a more meaningful function name
what the operation does.
2024-02-23 12:42:29 +01:00
icex2
3865e09f06 feat: Add core module
This module contains the "core" (API) of
bemanitools which includes an abstraction
layer for threads and logging at this time.

The threads API is very close to what
util/thread already was with some structural
enhancements which make it easier to understand
and work with the API, I hope. Some additional
helpers (*-ext module) support in doing common
tasks, e.g. setting up the thread API with other
modules.

The log(ging) part receives a major overhaul to
address known limitations and issues with the
util/log module:
- Cleaner API layer
- Separate sinks from actual logging engine
- Sinks are composable
- Improved and cleaner compatibility layer
  with AVS logging API

Additional "extensions" (*-ext modules) add
various helper functions for common tasks like
setting up the logging engine with a file and stdout
sink.

The sinks also improved significantly with the file
sink now supporting proper appending and log rotation.
Logging to stdout/stderr supports coloring of log
messages which works across logging engines.

Overall, this refactored foundation is expected to
support future developments and removes known
limitations at the current scale of bemanitools such as:
- Reducing boiler plate code across hooks
- Interop of bemanitools and AVS (and setting the foundation
  for addressing currently missing interop, e.g. for
  dealing with property structures without AVS)
- Addressing performance issues in the logging engine
  due to incorrect interop with AVS
2024-02-23 12:42:29 +01:00
icex2
517f8e885f feat(avs): Add property get and clear error functions
Use these to improve error handling by allowing
one to provide additional error information on
property related operations.
2024-02-23 11:15:17 +01:00
icex2
560aba3133 feat(dev): Add a separate docker dev cotainer
Improve the development experience by providing
an additional docker container that can be started
and used as an interactive development environment.
It provides all the tools and a stable environment
for building (identical to the build container).
2024-02-22 23:18:26 +01:00
icex2
6b75b33253 fix(hook): Add missing hook_table_revert impl 2024-02-22 23:17:17 +01:00
icex2
312aa619c6 fix(dist): Incorrect versioning for ddr distribution packages
Apparently forgotten to get updated to reflect the
currently supported versions correctly.
2024-02-22 23:16:28 +01:00
96 changed files with 626 additions and 117988 deletions

View File

@@ -28,7 +28,7 @@ cppflags := -I src -I src/main -I src/test -DGITREV=$(gitrev)
cflags := -O2 -pipe -ffunction-sections -fdata-sections \
-Wall -std=c99 -DPSAPI_VERSION=1
cflags_release := -Werror
ldflags := -Wl,--gc-sections -static -static-libgcc -static-libstdc++
ldflags := -Wl,--gc-sections -static-libgcc
#
# The first target that GNU Make encounters becomes the default target.
@@ -136,10 +136,8 @@ modules := $(dlls) $(exes) $(libs) $(avsdlls) $(avsexes) $(testdlls) $(testexes
define t_moddefs
cppflags_$3 += $(cppflags) -DBUILD_MODULE=$3
cxxflags_$3 += $(cxxflags) # Add C++-specific flags
cflags_$3 += $(cflags)
release: cflags_$3 += $(cflags_release)
release: cxxflags_$3 += $(cxxflags_release) # Add C++-specific release flags
ldflags_$3 += $(ldflags)
srcdir_$3 ?= src/main/$3
@@ -194,11 +192,9 @@ abslib_$1_$2_$3 := $$(libs_$3:%=$$(bindir_$1_indep)/lib%.a)
absdpl_$1_$2_$3 := $$(deplibs_$3:%=$$(bindir_$1_$2)/lib%.a)
objdir_$1_$2_$3 := $(objdir)/$$(subdir_$1_$2)/$3
obj_$1_$2_$3 := $$(src_$3:%.c=$$(objdir_$1_$2_$3)/%.o) \
$$(cppsrc_$3:%.cpp=$$(objdir_$1_$2_$3)/%.o) \
$$(rc_$3:%.rc=$$(objdir_$1_$2_$3)/%_rc.o)
deps += $$(src_$3:%.c=$$(depdir_$1_$2_$3)/%.d) \
$$(cppsrc_$3:%.cpp=$$(depdir_$1_$2_$3)/%.d)
deps += $$(src_$3:%.c=$$(depdir_$1_$2_$3)/%.d)
$$(depdir_$1_$2_$3):
$(V)mkdir -p $$@
@@ -207,24 +203,16 @@ $$(objdir_$1_$2_$3):
$(V)mkdir -p $$@
$$(volatile_$3:%.c=$$(objdir_$1_$2_$3)/%.o): FORCE
$$(volatile_cpp_$3:%.cpp=$$(objdir_$1_$2_$3)/%.o): FORCE
$$(objdir_$1_$2_$3)/%.o: $$(srcdir_$3)/%.c \
| $$(depdir_$1_$2_$3) $$(objdir_$1_$2_$3)
$(V)echo \(.c\) ... $$@
$(V)echo ... $$@
$(V)$$(toolchain_$1)gcc $$(cflags_$3) $$(cppflags_$3) \
-MMD -MF $$(depdir_$1_$2_$3)/$$*.d -MT $$@ -MP \
-DAVS_VERSION=$2 -c -o $$@ $$<
$$(objdir_$1_$2_$3)/%.o: $$(srcdir_$3)/%.cpp \
| $$(depdir_$1_$2_$3) $$(objdir_$1_$2_$3)
$(V)echo \(.cpp\) ... $$@
$(V)$$(toolchain_$1)g++ $$(cxxflags_$3) $$(cppflags_$3) \
-MMD -MF $$(depdir_$1_$2_$3)/$$*.d -MT $$@ -MP \
-DAVS_VERSION=$2 -c -o $$@ $$<
$$(objdir_$1_$2_$3)/%_rc.o: $$(srcdir_$3)/%.rc
$(V)echo \(.rc\) ... $$@ [windres]
$(V)echo ... $$@ [windres]
$(V)$$(toolchain_$1)windres $$(cppflags_$3) $$< $$@
endef
@@ -236,7 +224,7 @@ define t_archive
$(t_compile)
$$(bindir_$1_$2)/lib$3.a: $$(obj_$1_$2_$3) | $$(bindir_$1_$2)
$(V)echo \(.a\) ... $$@
$(V)echo ... $$@
$(V)$$(toolchain_$1)ar r $$@ $$^ 2> /dev/null
$(V)$$(toolchain_$1)ranlib $$@
@@ -254,8 +242,8 @@ implib_$1_$2_$3 := $$(bindir_$1_$2)/lib$3.a
$$(dll_$1_$2_$3) $$(implib_$1_$2_$3): $$(obj_$1_$2_$3) $$(abslib_$1_$2_$3) \
$$(absdpl_$1_$2_$3) \
$$(srcdir_$3)/$3.def | $$(bindir_$1_$2)
$(V)echo \(.dll\) ... $$(dll_$1_$2_$3)
$(V)$$(toolchain_$1)g++ -shared \
$(V)echo ... $$(dll_$1_$2_$3)
$(V)$$(toolchain_$1)gcc -shared \
-o $$(dll_$1_$2_$3) -Wl,--out-implib,$$(implib_$1_$2_$3) \
-Wl,--start-group $$^ -Wl,--end-group $$(ldflags_$3)
$(V)$$(toolchain_$1)strip $$(dll_$1_$2_$3)
@@ -273,8 +261,8 @@ exe_$1_$2_$3 := $$(bindir_$1_$2)/$3.exe
$$(exe_$1_$2_$3): $$(obj_$1_$2_$3) $$(abslib_$1_$2_$3) $$(absdpl_$1_$2_$3) \
| $$(bindir_$1_$2)
$(V)echo \(.exe\) ... $$@
$(V)$$(toolchain_$1)g++ -o $$@ $$^ $$(ldflags_$3)
$(V)echo ... $$@
$(V)$$(toolchain_$1)gcc -o $$@ $$^ $$(ldflags_$3)
$(V)$$(toolchain_$1)strip $$@
endef
@@ -286,7 +274,7 @@ define t_import
impdef_$1_$2_$3 ?= src/imports/import_$1_$2_$3.def
$$(bindir_$1_$2)/lib$3.a: $$(impdef_$1_$2_$3) | $$(bindir_$1_$2)
$(V)echo \(.a\) ... $$@ [dlltool]
$(V)echo ... $$@ [dlltool]
$(V)$$(toolchain_$1)dlltool --kill-at -l $$@ -d $$<
endef

View File

@@ -159,9 +159,6 @@ include src/main/iidxio-ezusb/Module.mk
include src/main/iidxio-ezusb2/Module.mk
include src/main/iidxio/Module.mk
include src/main/iidxiotest/Module.mk
include src/main/imgui/Module.mk
include src/main/imgui-bt/Module.mk
include src/main/imgui-debug/Module.mk
include src/main/inject/Module.mk
include src/main/jbio-magicbox/Module.mk
include src/main/jbio-p4io/Module.mk
@@ -175,8 +172,6 @@ include src/main/jbhook3/Module.mk
include src/main/launcher/Module.mk
include src/main/mempatch-hook/Module.mk
include src/main/mm/Module.mk
include src/main/nv/Module.mk
include src/main/nvgpu/Module.mk
include src/main/p3io/Module.mk
include src/main/p3iodrv/Module.mk
include src/main/p3ioemu/Module.mk
@@ -237,7 +232,6 @@ $(zipdir)/tools.zip: \
build/bin/indep-32/ezusb2-dbg-hook.dll \
build/bin/indep-32/ezusb2-tool.exe \
build/bin/indep-32/ezusb-tool.exe \
build/bin/indep-32/nvgpu.exe \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^
@@ -252,7 +246,6 @@ $(zipdir)/tools-x64.zip: \
build/bin/indep-64/iidx-ezusb2-exit-hook.dll \
build/bin/indep-64/jbiotest.exe \
build/bin/indep-64/mempatch-hook.dll \
build/bin/indep-64/nvgpu.exe \
| $(zipdir)/
$(V)echo ... $@
$(V)zip -j $@ $^

View File

@@ -122,7 +122,6 @@ The following games are supported with their corresponding hook-libraries.
- ir-beat-patch-9/10: Patch the IR beat phase on IIDX 9 and 10
- [mempatch-hook](doc/tools/mempatch-hook.md): Patch raw memory locations in the target process
based on the provided configuration
- [nvgpu](doc/tools/nvgpu.md): Command line tool to configure and tweak the NVIDIA GPU driver
- [pcbidgen](doc/tools/pcbidgen.md): Konami PCBID generator tool
- [ViGEm clients](doc/vigem/README.md): Expose BT5 APIs as XBOX game controllers to play any games
with real cabinet hardware.

View File

@@ -0,0 +1,319 @@
# IIDX engine overview and how game-play is impacted by hardware and software
Date: 2025-02-09 Author: icex2
This document provides information and explains the following:
* A sort-of taxonomy of the different major IIDX game engine versions
* How the core game-play part of the engine works regarding
* Threading model
* Main render loop
* Timing and synchronization
The goal is to capture key knowledge about how the game's engine works to enable a better
understanding for developing bemanitools and how certain features can impact performance and
synchronization during game-play.
This document is not claiming to be complete or 100% accurate. It is based on my own personal
research and understanding of the IIDX game engine. It is very likely that some of the information
is wrong or misunderstood. Feel free to raise any questions or concerns in an issue as I want
this document to be as accurate as possible.
## Taxonomy of IIDX game engine versions
With every version, there have been numerous changes and improvements to the game engine. The
following is a rough taxonomy that is focused on cabinet and hardware changes. As these are likely
the main driver for key changes to the software and game engine, they create fairly distinct
stages throughout the different versions of the game. The key attributes to be considered here are:
* Main PCB
* IO board
* Monitor
All of these had significant impact on key software features appearing or changing.
### Twinkle hardware era: 1st Style to 8th Style
* [Twinkle PCB](https://github.com/shizmob/arcade-docs/blob/main/konami/boards.md#twinkle)
* [Original rear projection monitor](https://github.com/shizmob/arcade-docs/blob/main/konami/products.md#iidx-rear-projection-monitor)
* Homogenous hardware and software
### 1st gen PC-based upgrade only: 9th Style
* 9th Style came as an upgrade kit only to existing twinkle-based cabinet hardware
* [KNM-845G3-A02 PCB](https://github.com/shizmob/arcade-docs/blob/main/konami/boards.md#knm-845g3-a02)
* [C02 EZUSB FX USB IO board](https://github.com/shizmob/arcade-docs/blob/main/konami/io.md#gec02-pwbaa)
* Magnetic card readers connected to ezusb IO board
### 1st gen PC-based with dedicated cabinet: 10th Style to DistorteD (13)
* From here on, old cabinets that received the "Twinkle hardware" upgrade kit could always receive software only
upgrades
* [CRT monitor](https://github.com/shizmob/arcade-docs/blob/main/konami/products.md#iidx-crt-monitor) with new dedicated
cabinets
* [D01 EZUSB FX USB IO board](https://github.com/shizmob/arcade-docs/blob/main/konami/io.md#d01-io)
* Slotted card readers starting version 13
### 2nd gen PC: GOLD (14) to Lincle (19)
* [FAB-e945-KN205](https://github.com/shizmob/arcade-docs/blob/main/konami/boards.md#fab-e945-kn205)
* All prior cabinet configurations can be upgraded with a PCB and software upgrade
* New LCD monitor starting version 15
* Further variants of the LCD monitor appear starting version 18
* [IO2 EZUSB FX2 USB IO board](https://github.com/shizmob/arcade-docs/blob/main/konami/io.md#usbio2) introduced with
version 14
* Switch to wave pass readers on version 19
### 3rd gen PC: Tricoro (20) to Sinobuz (24)
* All prior cabinet configurations can be upgraded with a PCB and software upgrade
* [ADE-HM65](https://github.com/shizmob/arcade-docs/blob/main/konami/boards.md#hm65)
* Game engine supports HD mode (720p)
* Many new LCD monitor variants appear with every new version
### 4th gen PC: CANNON BALLERS (25) to RESIDENT (30)
* All prior cabinet configurations can be upgraded with a PCB and software upgrade
* [ADE-6291](https://github.com/shizmob/arcade-docs/blob/main/konami/boards.md#ade-6291)
* [BIO2 IO board](https://github.com/shizmob/arcade-docs/blob/main/konami/boards.md#hm65)
* Upgrade cabinets required the [BIO2 sub-IO board](https://github.com/shizmob/arcade-docs/blob/main/konami/io.md#bio2-ldj-sub-io)
* Drop of SD mode support starting version 27
* Supporting 120 hz monitors starting version 27
* Many new LCD monitor variants appear with every new version
* 42" 120 hz for lightning cabinets starting version 27
* 42" 60 hz for non-lightning cabinets starting version 25
### 5th gen PC: RESIDENT (30) to EPOLIS (31)
* All prior cabinet configurations can be upgraded with a PCB and software upgrade
* [C300-xonarae](https://github.com/shizmob/arcade-docs/blob/main/konami/boards.md#c300-xonarae)
* Game engine supports FHD mode (1080p)
## Threading model and core responsibilities in PC-based games
Since the early days of 9th Style to today (as of time of writing this: EPOLIS), the threading model
hasn't changed significantly:
* Main and rendering thread
* Runs your typical D3D9 render loop
* Using D3D9ex starting version 27
* Starting and managing other threads
* Any file and game asset loading
* Handles all the core game logic of the different screens starting from the initial boot screen
to the core game-play screen
* IO thread
* Polls the main IO hardware and synchronizes the in-memory input and output state with the
hardware
* Executes commands issued by the main thread to the IO board such as dongle or card reader
commands (ezusb generation of IO only)
* Card reader thread (not applicable to versions 9 to 12)
* Runs the protocol to read/write the hardware of the readers
* Async execution of higher level commands issued by the main thread to the card reader hardware,
e.g. card read, card eject etc.
* Audio thread
* Streaming of audio data to the sound API
* DirectSound for versions 9 to 26
* WASAPI for versions 27 to 30 for non-lighting cabinets with ADE-6291 hardware
* ASIO for versions 27 and newer for lighting cabinets
* ASIO for version 30/31 and newer for non-lighting cabinets with C300-xonarae hardware
* Async execution of higher level commands issued by the main thread to the audio backend, e.g.
play audio, stop audio, etc.
* Network thread
* Network plumbing with the xrpc protocol
* Async execution of request-response commands issued by the main thread
## Main and rendering thread
With the game having transitioning to different screens throughout it's lifecycle, the main render
loop might contain different logic such as asset loading. The following focuses on the main
game-play screen, only. Common rendering logic still applies to other screens.
This follows your typical D3D9 single threaded rendering loop which boils down to the following:
* Begin the scene (`BeginScene`)
* Set the render target (`SetRenderTarget`)
* Clear the back buffer (`Clear`)
* Run engine step. This includes and is mixed with
* IO input evaluation
* Game engine state and (re-) drawing the scene
* Commands to the audio playback, e.g. play key sounds
* Setting IO outputs
* End the scene (`EndScene`)
* Target a minimum frame time
* Introduced with version 11
* Sleep (`Sleep` or `SleepEx`) to fill up the frame up to either 13 ms or 14 ms (depending on the
version)
* This was likely introduced to not have the game run at hundreds of FPS if v-sync was disabled
(probably when running in window mode for development/testing purposes)
* Swapping the back buffers (`Present`)
* D3D9 is configured with v-sync enabled by default and targets 60 hz
* With this configuration, the call to `Present` fills up the remaining frame time to target the
configured 60 hz refresh rate
### Rendering resolutions
The game engine went through a couple of different rendering resolutions:
* 640x240: version 1 to 8 (all twinkle hardware)
* 640x480: version 9 to 19 (1st and 2nd gen PC-based)
* 1280x720 (HD mode) and 640x480 (SD mode): version 20 to 27 (3rd and 4th gen PC-based)
* 1280x720 (HD mode) only for version 28 to 29 (4th gen PC-based)
* 1280x720 (HD mode) and 1920x1080 (FHD mode) for version 30 (4th gen PC-based)
* 1920x1080 (FHD mode) only for version 30+ (5th gen PC-based)
## Core engine timing and synchronization
The following outlines and explains the core engine concepts related to timing and synchronization.
### The origins, twinkle hardware
* It appears that the game has been on the same codebase since it's inception.
* This can be reasoned by the following observations
* 9th style as the first PC-based game very buggy on initial release
* 9th style threading model very clunky with various thread settings showing they tried to
prioritize different processing on a single core CPU
* Coming from twinkle hardware that is a realtime system vs. a Windows XP system
* Fixed playstation 1 based hardware with a refresh rate of
[59.8260978565 hz](https://github.com/mamedev/mame/blob/bf9df04e005697788ae988ef5aea91a1878fd631/src/devices/video/psx.cpp#L435)
* No need to assume getting anything else if the resource budget per frame is not exceeded
* All sub-systems were driven synchronously to that fixed time step
* No need for the engine to synchronize audio during the song. When the song is started
correctly, it stayed sync throughout the song
* Observations and assumptions
* It appears the developers struggled a lot with the significant platform shift to PC as indicated
by various core engine improvements throughout the years still
* Switches of hardware generations further complicated the situation as these forced them to further
drift away from how the game engine was initially designed on the twinkle system
### Frame time/timing and engine step
* The game's engine step and timing is frame based
* The main render loop defines the minimum valid timing window for the game engine to be able to
evaluate
* 60 hz/fps = 16.667 ms (rounded to three decimal places)
* 120 hz/fps = 8.333 ms (rounded to three decimal places), only relevant for lightning cabinets with their 120 hz
screen/mode
* Depending on the GPU hardware and configuration, the GPU might drive the screen not exactly at
perfectly 60 hz/fps = 16.667 ms
* As outlined in the [main render loop](#main-and-rendering-thread), the `Present` call is the
key function call to determine the frame time for the game engine
* Just having v-sync enabled and telling D3D9 to **target** 60 hz, it still depends on how the GPU
driver is implemented and how the GPU driver's implementation of D3D9 executes on the `Present`
call
* This is primarily determined by how the GPU driver is operating and driving connected display
hardware
* The following factors can contribute to that either directly or indirectly
* Different monitor types analog vs. digital (CRT vs. LCD)
* Different monitor connections VGA vs. DVI/HDMI/DP
* Different GPU drivers
* Different GPU hardware and vendors
* Different GPU settings
### Monitor check screen
The monitor check screen was introduced with version 14. This was a solution to the problem of not
guaranteeing a single fixed refresh rate throughout different GPU and monitor combinations. See
a detailed explanation in the previous sub-subsection about
[what influences the frame time](#frame-timetiming-and-engine-step) of the game.
The goal of the monitor check is to measure the frame time of the main render loop and use the
results for [driving the core engine step](#engine-step-and-synchronization).
The monitor check evolved slightly as different GPU and monitor hardware, and GPU drivers yielded
varying refresh rates that determined the frame times of the main game loop.
Actual values are outlined further down in the [engine step time](#engine-step-time) section.
There are two main versions of the monitor check, all of them have always been part of the boot
process:
* 14
* Measures a total of 3000 frames
* If total time this took < 50004 ms -> so average of 16.668 ms per frame = 59.9952 hz
* S-Video mode -> 59.95 hz (also shows S-VIDEO when the monitor check completes)
* Otherwise VGA mode -> 60.05 hz
* If VGA is determined, the game patches the chart event data when loading
* `event_timestamp * 0.99817199 + 0.40000001`
* When S-Video no charts are patched and the timing data in the chart is used as is
* 15 to 18
* Identical to 14 except that chart patching now happens in milliseconds instead of frames
* VGA mode: `16.65279`
* S-Video mode: `16.680567`
* `event_timestamp * (1.0 / frame_time) + 0.40000001)`
* 19
* Identical to previous version
* Monitor check screen shows current FPS on the last revision of that version. However, it doesn't
use the value shown there by any means. Assuming this was added before the introduction of the
new monitor check on 20.
* 20 to 26
* Runs on boot or when switching monitor modes SD vs. HD
* Measures only 1200 frames
* Takes the average refresh rate of 1200 frames
* Applies the measured avg. frame time directly to the charts before song
* 27 to 30
* Frame rate measuring identical to prior versions
* Added additional logic after the frame time measurements for handling of 120 hz displays
* Includes checking the monitor and if the framerate matches as expected
* 30/31 LDJ-010 upgrade
* Added NvDisplayConfigLDJ tool which runs on system start and configures a custom timing in the
NVIDIA GPU driver to ensure a fixed monitor refresh rate
* 31
* Same code as before
* Consider the first 460 frames of the measurement as warm-up frames
* Discard these for the actual measurement to get more stable frame times
* Use a base avg. value of 119.982 for the 120 hz monitors and 59.9 for 60 hz monitors. Further
frames measured are counted towards the average with the given base value
### Engine core game-play with visual and audio synchronization
#### Chart data
* Chart data encodes note timing and timing window information
* Chart data consists of *note events* encoding a timestamp and note information such as type
and key-sound information
* Timing windows are defined per chart
* Most infamous example: GAMBOL (7Key/Another)
* Game engine timestamp evaluation and note event timestamp encoding
* 9 to 14: Refresh rate in hz
* 15 to 31: Milliseconds (equivalent to assuming 1000 fps)
* Fundamentally, that doesn't change game play experience as it's just a different way of
evaluating the timestamps since refresh rate in hz/frame rate in fps can be converted lossless to
frame time in ms
#### Engine step time
The engine uses the following source for frame rate/time to drive internal logic on the following
versions
* 9 to 13: Hardcoded 59.95 hz
* 14: Either 59.95 hz or 60.05 hz determined by which value is determined to be closer to the
measured one during the monitor check screen on startup
* 15 to 19: 59.95 hz or 60.05 hz
* Monitor check on startup measures the frame time and picks the value closest to what's been
measured
* Monitor check result can be overridden with the *Output Type* setting in the operator menu
* *S-Video* to force to 59.95 hz
* *VGA* to force to 60.05 hz
* 20 to 31: Monitor check on boot determines the frame time and uses the result throughout the
entire game session
#### Engine step and synchronization
Per frame engine step advancing and synchronization during game-play
* Game-play needs synchronization of the following aspects
* Drawn content on the screen
* Background audio playback track
* Key sound effects
* The game engine synchronizes these only at the start of a song
* It takes known/determined refresh rate/frame time as the fixed time for every frame cycle
throughout the entire song
* It starts playback of the background audio track together with playback of the chart data
* With every engine step/frame it advances internal calculations by that fixed amount of time.
Thus, the game engine expects this to be constant/stable throughout an entire song
* The chart data is advanced every frame by the engine
* Key sound events are turned into audio playback on command as the chart advances
* No re-synchronization or check-pointing between main rendering thread and audio is happening
throughout the song
* Remark: The above does not consider any kind of offsetting and timing adjustments for the sake
of keeping this simple and focus on the absolute core concepts

View File

@@ -0,0 +1,224 @@
# IIDX "Syncbook": A guide to ensuring sync and performant gameplay
This is a guide applicable to all IIDX versions that are native Windows PC-based. The goal is to
enable proper configuration of those games to ensure the game engine "runs in-sync" with any of its
IO (visual GPU/display output, audio output, user input) resulting in high and stable performance
for smooth game-play.
This document won't go into the implementation details of the game engine. Please refer to the
[IIDX engine details journal](../dev/journal/2025-02-09-iidx-engine.md) for a more in-depth
information.
## Understanding the problems and options to address them
First, let's understand what the key problems are and how they contribute to different issues
that impact game-play.
### Song de-syncing
Symptom: Throughout playing a song, the audio is de-syncing even it was fine when the song started.
Cause: The game engine is fundamentally designed to run on a fixed and consistent frame
rate/time per engine step. A mismatch of expected frame time by the game engine and actually delivered
frame time by the GPU driver. This can come either as a stable frame time that just mismatches in
general or (highly) fluctuating frame times.
* G-sync on modern displays causes known fluctuations because it adjusts dynamically the monitor
refresh rate
* V-sync not correctly configured/enforced or even vsync-off override in driver is causing
inconsistent frame times
* Incorrect display timings causing refresh rate fluctuations resulting in inconsistent frame times
Stable frame times but not having the correct ones that the game engine expects is a different
problem that can be addressed by:
* Knowing the refresh rates expected by the game engine of the different game versions
* Configuring your GPU driver's display timings to match the expected frame times
* Or, patch the game's chart data with your custom display timings so the game engine gets uses
*your* "correct" frame times
* Note: Offline patching the chart data doesn't work for several game versions as the monitor
check does override this data, but not as flexible as required
* Use the chart patch feature of bemanitools instead
### Micro-stuttering and non-smooth note scrolling
This is a trickier problem as it can be caused by a few different things.
* GPU related
* Fluctuating refresh rates result in fluctuating frame times in the main game loop
* GPU power configuration in non-performance mode (e.g. "power saving") causes processing latency
due to sleep states
* Display related
* Display firmware buggy and/or internal scalers that expect to run at very specific refresh rates
and cannot adapt to any custom display timings enforced by the GPU
* A known example is the official
[PENDUAL LCD monitor](https://github.com/shizmob/arcade-docs/blob/6ac99975cdb2bf668362f65fa9fa3ffb2127308b/konami/product/GULDJ-JI.md#notes-and-known-issues) that does not v-sync correctly to any other refresh-rate than 60.000 hz
* CPU related
* CPU power configuration on Windows in non-performance mode (e.g. "power saving") causes
processing latency due to sleep states
* Correct CPU C-states configuration in BIOS/UEFI
* These cannot be configured in Windows and are separate from Windows's power configuration
* Other stuff running in the background of the system causing fluctuations
* (Synchronous) Disk I/O heavy applications stealing CPU time
* Or any other process creating a considerable amount of CPU or GPU load
## Configuration guide for different game versions
### Measuring monitor refresh rate
Let's start with configuring the system to meet the game engine's expectation regarding the
target monitor refresh rate and requiring vsync.
First, use the [d3d9-monitor-check tool](../tools/d3d9-monitor-check.md) to measure the currently
configured refresh rate of your monitor. Note that your monitor might yield different timings on
different resolutions and different game versions run on
[different rendering resolutions](../dev/journal/2025-02-09-iidx-engine.md#rendering-resolutions).
For example, the game version is 31 with the rendering resolution of 1920x1080 in FHD mode that you
want to target:
```bat
d3d9-monitor-check.exe cmdline refresh-rate-test 1920 1080 60
```
The test shows the current monitor refresh rate and the average refresh rate over the course of
the test. Check that the avg. refresh rate is stable during the measuring phase (during warm-up,
it's ok if it fluctuates).
This test allows you to determine/check:
* Refresh rate/frame time fluctuations: if you see (high) fluctuations on the first or second
decimal place
* What's your current target refresh rate the GPU is driving your monitor at
* If vsync isn't overridden by some other driver setting as you want to see a refresh rate around
the 60 hz mark
### Measuring vsync issues
Some displays or the GPU configuration might lead to vsync issues which can be detected with the
`d3d9-monitor-check.exe` tool as well.
```bat
d3d9-monitor-check.exe cmdline vsync-test 1920 1080 60
```
This runs a test with a VSYNC text that alternates red and cyan colors. If the text appears grey
all the time, everything's fine. If you spot brief red or cyan text either occasionally or
periodically, your current configuration has vsync issues resulting in skipped frames or old
frames displaying longer.
### Configuration
The following are recommended configurations for the different game versions. If any of these
don't work as expected, you have to troubleshoot and tweak these potentially. Please refer to the
[guidelines above](#configuration-guide-for-different-game-versions) to understand how to use
the tooling and test your changes.
#### Recommended configuration with NVIDIA GPU and driver
We want to achieve the following configuration on the GPU driver:
* Turn-off g-sync if you have a monitor that supports it
* Disable power saving mode on GPU driver
* V-sync is not forced off
* Run the display on a target refresh rate of `59.950 hz` which has been determined to be
[the most compatible across all PC-based versions](../dev/journal/2025-02-09-iidx-engine.md#engine-step-time).
##### Turn-off g-sync
Create a new GPU profile for IIDX, if it doesn't exist yet:
```bat
nvgpu.exe profile create iidx
```
Add the application names when the profile needs to be applied:
```bat
:: For iidx versions 9 to 17
nvgpu.exe profile application-add iidx bm2dx.exe
:: For iidx versions 18+
nvgpu.exe profile application-add iidx launcher.exe
```
Disable G-SYNC for the profile:
```bat
nvgpu.exe profile gsync-disable iidx
```
##### Disable power saving mode
Set GPU power state to maximum for the profile (assumes you have a
[GPU profile called `iidx` already created](#turn-off-g-sync)):
```bat
nvgpu.exe profile gpu-power-state-max iidx
```
##### Configure and verify target refresh rate of 59.950 hz and vsync
Get display ID of your primary display:
```bat
nvgpu.exe display primary-display-id
```
Copy the hex-value of the display ID and use it in the following commands.
Test the custom display timing first, e.g. for versions that run in 1920x1080
(Replace `<DISPLAY_ID> ` with the primary display ID you got):
```bat
nvgpu.exe display custom-resolution-test <DISPLAY_ID> 1920 1080 59.95 10
```
This will test it for 10 seconds and then revert. If the result looked good, i.e. the screen didn't
go blank or the display output was garbage, apply it:
```bat
nvgpu.exe display custom-resolution-set <DISPLAY_ID> 1920 1080 59.95
```
Test and verify the configuration is applied and works correctly:
```bat
d3d9-monitor-check.exe cmdline refresh-rate-test 1920 1080 60
```
Test if the enforced refresh rate is compatible with your display and vsync is working correctly:
```bat
d3d9-monitor-check.exe cmdline vsync-test 1920 1080 60
```
##### Alternative refresh rate configuration
If for some reason your display doesn't support 59.950 hz properly, i.e. display artifacts or vsync
issues, you can use any other 60 hz compatible refresh rate, e.g. anything between 59.900 hz and
60.100 hz that your display supports properly.
Follow the same steps [as above](#configure-and-verify-target-refresh-rate-of-59950-hz-and-vsync)
but use a different refresh rate, e.g. 60.000 hz.
Verify using the `d3d9-monitor-check.exe` with the outlined steps if you need to play around to find
a refresh rate that works for your setup.
For the game versions 9 to 19, you have to use the chart patch feature of bemanitools to patch
the charts to your custom refresh rate. Otherwise, the game engine will run on your configured
refresh rate, but it will take the non-matching refresh rate from the chart data which causes
song de-syncing.
For example, to configure a refresh rate of 60.000 hz in the iidxhook config file:
```text
gfx.monitor_check=60.000
```
##### ATI/AMD
Currently, there is no tooling provided by bemanitools to configure the AMD GPU driver. The basic
concepts of what needs to be configured still applies as outlined in the NVIDIA sections above
though, e.g. through AMD's GPU control panel.
Further steps and instructions TBD

View File

@@ -146,16 +146,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
- Use iidxhook's frame rate limiter feature (see further below) to software lock the refresh rate.
This might be necessary on Windows 7 and newer for D3D8 games, e.g. iidx 9 to 12, which seem to
ignore GPU side v-sync.
- Use iidxhook's auto timebase feature (see further below) or set a pre-determined value to cut down
start-up times.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
### The game still stutters (randomly) and drifts off-sync
@@ -173,9 +164,7 @@ This can be caused by:
## My songs are offsync
- Make sure your machine's refresh rate is stable
- If you don't get a close to 59.94hz refresh rate, use the software monitor check/auto timebase
that's built into iidxhook (refer to help/config file)
Refer to the [iidx-syncbook](iidx-syncbook.md).
## The game crashes instantly (10th, RED, HAPPY SKY)
@@ -233,6 +222,8 @@ file) or use a CLVSD.ax codec which has the debugger checks removed.
## I used the auto timebase option and/or limited my refresh rate but the songs are still going offsync
Refer to the [iidx-syncbook](iidx-syncbook.md) if you haven't already.
There aren't many options left. The old games were developed for specific hardware and are not
guaranteed to work well on (especially) newer hardware. Multiple monitor setups can also have a bad
impact on a stable refresh rate. Try a setup with just a single monitor you want to use for gameplay

View File

@@ -115,16 +115,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
- Use iidxhook's frame rate limiter feature (see further below) to software lock the refresh rate.
This might be necessary on Windows 7 and newer for D3D8 games, e.g. iidx 9 to 12, which seem to
ignore GPU side v-sync.
- Use iidxhook's auto timebase feature (see further below) or set a pre-determined value to cut down
start-up times.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
### The game still stutters (randomly) and drifts off-sync
@@ -142,9 +133,7 @@ This can be caused by:
## My songs are offsync
- Make sure your machine's refresh rate is stable
- If you don't get a close to 59.94hz refresh rate, use the software monitor check/auto timebase
that's built into iidxhook (refer to help/config file)
Refer to the [iidx-syncbook](iidx-syncbook.md).
## The game crashes instantly
@@ -192,6 +181,8 @@ CLVSD.ax codec which has the debugger checks removed.
## I used the auto timebase option and/or limited my refresh rate but the songs are still going offsync
Refer to the [iidx-syncbook](iidx-syncbook.md) if you haven't already.
There aren't many options left. The old games were developed for specific hardware and are not
guaranteed to work well on (especially) newer hardware. Multiple monitor setups can also have a bad
impact on a stable refresh rate. Try a setup with just a single monitor you want to use for gameplay

View File

@@ -132,16 +132,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
- Use iidxhook's frame rate limiter feature (see further below) to software lock the refresh rate.
This might be necessary on Windows 7 and newer for D3D8 games, e.g. iidx 9 to 12, which seem to
ignore GPU side v-sync.
- Use iidxhook's auto timebase feature (see further below) or set a pre-determined value to cut down
start-up times.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
## "NETWORK WARNING" instead of "NETWORK OK"
@@ -154,15 +145,7 @@ This can be caused by:
## My songs are offsync
The built-in monitor check just determines if the game should sync to either 59.94 hz (S-Video
setting) or 60.04 hz (VGA setting). If you don't have a setup that runs on (as close as possible)
these values:
- Make sure your machine's refresh rate is stable, e.g. 60.00x hz.
- If you don't get a close to 59.94hz (S-Video setting) or 60.04 hz (VGA setting) refresh rate, go
an set the output mode in the operator menu to "VGA" to enforce the game to run chart syncing on
60.04 hz refresh rate (even if your setup does not have that value). Next, use the software
monitor check/auto timebase that's built into iidxhook (refer to cmd help/configfile).
Refer to the [iidx-syncbook](iidx-syncbook.md).
## My game runs too fast
@@ -205,6 +188,8 @@ CLVSD.ax codec which has the debugger checks removed.
## I used the auto timebase option and/or limited my refresh rate but the songs are still going offsync
Refer to the [iidx-syncbook](iidx-syncbook.md) if you haven't already.
There aren't many options left. The old games were developed for specific hardware and are not
guaranteed to work well on (especially) newer hardware. Multiple monitor setups can also have a bad
impact on a stable refresh rate. Try a setup with just a single monitor you want to use for gameplay

View File

@@ -143,16 +143,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
- Use iidxhook's frame rate limiter feature (see further below) to software lock the refresh rate.
This might be necessary on Windows 7 and newer for D3D8 games, e.g. iidx 9 to 12, which seem to
ignore GPU side v-sync.
- Use iidxhook's auto timebase feature (see further below) or set a pre-determined value to cut down
start-up times.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
## "NETWORK WARNING" instead of "NETWORK OK"
@@ -165,15 +156,7 @@ This can be caused by:
## My songs are offsync
The built-in monitor check just determines if the game should sync to either 59.94 hz (S-Video
setting) or 60.04 hz (VGA setting). If you don't have a setup that runs on (as close as possible)
these values:
- Make sure your machine's refresh rate is stable, e.g. 60.00x hz.
- If you don't get a close to 59.94hz (S-Video setting) or 60.04 hz (VGA setting) refresh rate, go
an set the output mode in the operator menu to "VGA" to enforce the game to run chart syncing on
60.04 hz refresh rate (even if your setup does not have that value). Next, use the software
monitor check/auto timebase that's built into iidxhook (refer to cmd help/configfile).
Refer to the [iidx-syncbook](iidx-syncbook.md).
## My game runs too fast
@@ -211,6 +194,8 @@ CLVSD.ax codec which has the debugger checks removed.
## I used the auto timebase option and/or limited my refresh rate but the songs are still going offsync
Refer to the [iidx-syncbook](iidx-syncbook.md) if you haven't already.
There aren't many options left. The old games were developed for specific hardware and are not
guaranteed to work well on (especially) newer hardware. Multiple monitor setups can also have a bad
impact on a stable refresh rate. Try a setup with just a single monitor you want to use for gameplay

View File

@@ -143,16 +143,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
- Use iidxhook's frame rate limiter feature (see further below) to software lock the refresh rate.
This might be necessary on Windows 7 and newer for D3D8 games, e.g. iidx 9 to 12, which seem to
ignore GPU side v-sync.
- Use iidxhook's auto timebase feature (see further below) or set a pre-determined value to cut down
start-up times.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
## "NETWORK WARNING" instead of "NETWORK OK"
@@ -165,11 +156,7 @@ This can be caused by:
## My songs are offsync
From this version onwards (if you use the very final data of Lincle), the game comes with a built-in
auto timebase option ("monitor check" on startup) which dynamically, detects the refresh rate of
your current setup. Thus, BT5's timebase option is not included from this hook version onwards,
anymore. Ensure that refresh rate displayed is very stable, e.g. 60.00x hz, and the game should be
able to provide you with a smooth and sync game experience.
Refer to the [iidx-syncbook](iidx-syncbook.md).
## My game runs too fast

View File

@@ -155,11 +155,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
## "NETWORK WARNING" instead of "NETWORK OK"
@@ -172,11 +168,7 @@ This can be caused by:
## My songs are offsync
From this version onwards (or Lincle very final revision), the game comes with a built-in auto
timebase option ("monitor check" on startup) which dynamically, detects the refresh rate of your
current setup. Thus, BT5's timebase option is not included from this hook version onwards, anymore.
Ensure that refresh rate displayed is very stable, e.g. 60.00x hz, and the game should be able to
provide you with a smooth and sync game experience.
Refer to the [iidx-syncbook](iidx-syncbook.md).
## My game runs too fast

View File

@@ -159,11 +159,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
## "NETWORK WARNING" instead of "NETWORK OK"
@@ -176,11 +172,7 @@ This can be caused by:
## My songs are offsync
From IIDX 20 (or Lincle very final revision) onwards, the game comes with a built-in auto timebase
option ("monitor check" on startup) which dynamically, detects the refresh rate of your current
setup. Thus, BT5's timebase option is not included from this hook version onwards, anymore. Ensure
that refresh rate displayed is very stable, e.g. 60.00x hz, and the game should be able to provide
you with a smooth and sync game experience.
Refer to the [iidx-syncbook](iidx-syncbook.md).
## My game runs too fast

View File

@@ -158,11 +158,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
## "NETWORK WARNING" instead of "NETWORK OK"
@@ -175,11 +171,7 @@ This can be caused by:
## My songs are offsync
From IIDX 20 (or Lincle very final revision) onwards, the game comes with a built-in auto timebase
option ("monitor check" on startup) which dynamically, detects the refresh rate of your current
setup. Thus, BT5's timebase option is not included from this hook version onwards, anymore. Ensure
that refresh rate displayed is very stable, e.g. 60.00x hz, and the game should be able to provide
you with a smooth and sync game experience.
Refer to the [iidx-syncbook](iidx-syncbook.md).
## My game runs too fast

View File

@@ -205,11 +205,7 @@ This can be related to various issues:
start "" /relatime "gamestart.bat"
```
- Enforce v-sync enabled in your GPU settings.
- Ensure that you have a constant refresh rate around the 60 hz (59.9xx or 60.0xx) that is not
jumping around. Use the timebase feature of one of the newer games to check that or enable
iidxhook's timebase and check the log output for the determined value. Run this a few times and
check if the results differ.
Also refer to the [iidx-syncbook](iidx-syncbook.md).
## "NETWORK WARNING" instead of "NETWORK OK"
@@ -222,11 +218,7 @@ This can be caused by:
## My songs are offsync
From IIDX 20 (or Lincle very final revision) onwards, the game comes with a built-in auto timebase
option ("monitor check" on startup) which dynamically, detects the refresh rate of your current
setup. Thus, BT5's timebase option is not included from this hook version onwards, anymore. Ensure
that refresh rate displayed is very stable, e.g. 60.00x hz, and the game should be able to provide
you with a smooth and sync game experience.
Refer to the [iidx-syncbook](iidx-syncbook.md).
## My game runs too fast

View File

@@ -1,80 +0,0 @@
# nvgpu - Command line tool to configure and tweak the NVIDIA GPU driver
An open source re-implementation of the “NvDisplayConfigLDJ" tool with additional enhancements.
The tool is based on NVIDIA's [nvapi](https://github.com/NVIDIA/nvapi) which is an interface to
various driver settings that can also be tweaked from the NVIDIA Control Panel. The goal of this
tool is to provide a streamlined command line interface to configure various settings that can
improve gameplay experience significantly.
This can be used to tweak your nvidia GPU driver settings to create custom display timings to address
IIDXs requirement if expecting proper display timings. This can also be used for any legacy IIDX
versions that even expect very specific display timings, e.g. 59.95 or 60.05 hz.
Furthermore, creating application profiles allows further tweaks to important GPU settings such as
the current performance mode setting. This is crucial to ensure the GPU is not going into any kind of
power saving states which results in non-smooth scrolling during gameplay and micro stuttering that
cannot be measured on application level.
Simply run the tool without any arguments to get a full synopsis of available commands.
## Example usage for modern IIDX
### Custom GPU profile
The following creates a custom profile to address potential performance concerns such as not 100% smooth scrolling and
micro stuttering.
* Create a custom profile: `nvgpu profile create launcher`
* Add the launcher application to the profile: `nvgpu profile application-add launcher launcher.exe`
* This will apply to any (IIDX) game running with `launcher.exe`
* Disable G-SYNC for the profile: `nvgpu profile gsync-disable launcher`
* Set GPU power state to maximum for the profile: `nvgpu profile gpu-power-state-max launcher`
### Custom timing
* Run the game and observe the monitor check screen (requires IIDX 20+)
* Take note of the refresh rate of the monitor that is determined by the game
* Exit the game
* Run `nvgpu display list` to get the display ID of the monitor you want to change use that ID in the following commands
* Run `nvgpu display custom-resolution-test` with your display ID and monitor settings to test the custom configuration
first
* For example, for IIDX 31 which runs in native 1920x1080 with a monitor also having that as its native resolution,
having the monitor id `0x12345678` and the monitor check yielding a value of ~`59.9345`, run
`nvgpu display custom-resolution-test 1920 1080 59.9345 10`
* Observe if the test is successful and the display doesn't turn blank or displays a glitched image for ~10 seconds
* Run `nvgpu display custom-resolution-set` with the previously tested settings to apply the custom display mode
* For example, `nvgpu display custom-resolution-set 0x12345678 1920 1080 59.9345`
## Example usage for legacy IIDX
Legacy IIDX concerns any game prior to IIDX 20 that introduced the monitor check screen. The game engine was expecting
a the display/GPU/driver to perform at specific refresh rate timings in order to provide correct timing and audio
playback for the game. To this date (i.e. IIDX 31), the game engine never re-syncs audio playback during gameplay.
Therefore any flaky and incorrect timing will result in audio desynchronization either early on or throughout a song.
### Custom GPU profile
The following creates a custom profile to address potential performance concerns such as not 100% smooth scrolling and
micro stuttering.
* Create a custom profile: `nvgpu profile create bm2dx`
* Add the launcher application to the profile: `nvgpu profile application-add bm2dx bm2dx.exe`
* This will apply to any (IIDX) game running with an executable named `bm2fx.exe`
* Disable G-SYNC for the profile: `nvgpu profile gsync-disable bm2dx`
* Set GPU power state to maximum for the profile: `nvgpu profile gpu-power-state-max bm2dx`
### Custom timing
* Use a modern game and it to observe the monitor check screen (requires IIDX 20+)
* Take note of the refresh rate of the monitor that is determined by the game
* Exit the game
* Run `nvgpu display list` to get the display ID of the monitor you want to change use that ID in the following commands
* Run `nvgpu display custom-resolution-test` with your display ID and monitor settings to test the custom configuration
first
* For example, for IIDX 31 which runs in native 1920x1080 with a monitor also having that as its native resolution,
having the monitor id `0x12345678` and the monitor check yielding a value of ~`59.9345`, run
`nvgpu display custom-resolution-test 1920 1080 59.9345 10`
* Observe if the test is successful and the display doesn't turn blank or displays a glitched image for ~10 seconds
* Run `nvgpu display custom-resolution-set` with the previously tested settings to apply the custom display mode
* For example, `nvgpu display custom-resolution-set 0x12345678 1920 1080 59.9345`

View File

@@ -1,947 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
#include "NvApiDriverSettings.h"
EValues_OGL_AA_LINE_GAMMA g_valuesOGL_AA_LINE_GAMMA[OGL_AA_LINE_GAMMA_NUM_VALUES] =
{
OGL_AA_LINE_GAMMA_DISABLED,
OGL_AA_LINE_GAMMA_ENABLED,
OGL_AA_LINE_GAMMA_MIN,
OGL_AA_LINE_GAMMA_MAX,
};
EValues_OGL_CPL_GDI_COMPATIBILITY g_valuesOGL_CPL_GDI_COMPATIBILITY[OGL_CPL_GDI_COMPATIBILITY_NUM_VALUES] =
{
OGL_CPL_GDI_COMPATIBILITY_PREFER_DISABLED,
OGL_CPL_GDI_COMPATIBILITY_PREFER_ENABLED,
OGL_CPL_GDI_COMPATIBILITY_AUTO,
};
EValues_OGL_CPL_PREFER_DXPRESENT g_valuesOGL_CPL_PREFER_DXPRESENT[OGL_CPL_PREFER_DXPRESENT_NUM_VALUES] =
{
OGL_CPL_PREFER_DXPRESENT_PREFER_DISABLED,
OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED,
OGL_CPL_PREFER_DXPRESENT_AUTO,
};
EValues_OGL_DEEP_COLOR_SCANOUT g_valuesOGL_DEEP_COLOR_SCANOUT[OGL_DEEP_COLOR_SCANOUT_NUM_VALUES] =
{
OGL_DEEP_COLOR_SCANOUT_DISABLE,
OGL_DEEP_COLOR_SCANOUT_ENABLE,
};
EValues_OGL_DEFAULT_SWAP_INTERVAL g_valuesOGL_DEFAULT_SWAP_INTERVAL[OGL_DEFAULT_SWAP_INTERVAL_NUM_VALUES] =
{
OGL_DEFAULT_SWAP_INTERVAL_TEAR,
OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE,
OGL_DEFAULT_SWAP_INTERVAL_VSYNC,
OGL_DEFAULT_SWAP_INTERVAL_VALUE_MASK,
OGL_DEFAULT_SWAP_INTERVAL_FORCE_MASK,
OGL_DEFAULT_SWAP_INTERVAL_FORCE_OFF,
OGL_DEFAULT_SWAP_INTERVAL_FORCE_ON,
OGL_DEFAULT_SWAP_INTERVAL_APP_CONTROLLED,
OGL_DEFAULT_SWAP_INTERVAL_DISABLE,
};
EValues_OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL g_valuesOGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL[OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_NUM_VALUES] =
{
OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ZERO_SCANLINES,
OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ONE_FULL_FRAME_OF_SCANLINES,
};
EValues_OGL_DEFAULT_SWAP_INTERVAL_SIGN g_valuesOGL_DEFAULT_SWAP_INTERVAL_SIGN[OGL_DEFAULT_SWAP_INTERVAL_SIGN_NUM_VALUES] =
{
OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE,
OGL_DEFAULT_SWAP_INTERVAL_SIGN_NEGATIVE,
};
EValues_OGL_EVENT_LOG_SEVERITY_THRESHOLD g_valuesOGL_EVENT_LOG_SEVERITY_THRESHOLD[OGL_EVENT_LOG_SEVERITY_THRESHOLD_NUM_VALUES] =
{
OGL_EVENT_LOG_SEVERITY_THRESHOLD_DISABLE,
OGL_EVENT_LOG_SEVERITY_THRESHOLD_CRITICAL,
OGL_EVENT_LOG_SEVERITY_THRESHOLD_WARNING,
OGL_EVENT_LOG_SEVERITY_THRESHOLD_INFORMATION,
OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL,
};
EValues_OGL_FORCE_BLIT g_valuesOGL_FORCE_BLIT[OGL_FORCE_BLIT_NUM_VALUES] =
{
OGL_FORCE_BLIT_ON,
OGL_FORCE_BLIT_OFF,
};
EValues_OGL_FORCE_STEREO g_valuesOGL_FORCE_STEREO[OGL_FORCE_STEREO_NUM_VALUES] =
{
OGL_FORCE_STEREO_OFF,
OGL_FORCE_STEREO_ON,
};
const wchar_t * g_valuesOGL_IMPLICIT_GPU_AFFINITY[OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES] =
{
OGL_IMPLICIT_GPU_AFFINITY_AUTOSELECT
};
EValues_OGL_OVERLAY_PIXEL_TYPE g_valuesOGL_OVERLAY_PIXEL_TYPE[OGL_OVERLAY_PIXEL_TYPE_NUM_VALUES] =
{
OGL_OVERLAY_PIXEL_TYPE_NONE,
OGL_OVERLAY_PIXEL_TYPE_CI,
OGL_OVERLAY_PIXEL_TYPE_RGBA,
OGL_OVERLAY_PIXEL_TYPE_CI_AND_RGBA,
};
EValues_OGL_OVERLAY_SUPPORT g_valuesOGL_OVERLAY_SUPPORT[OGL_OVERLAY_SUPPORT_NUM_VALUES] =
{
OGL_OVERLAY_SUPPORT_OFF,
OGL_OVERLAY_SUPPORT_ON,
OGL_OVERLAY_SUPPORT_FORCE_SW,
};
EValues_OGL_QUALITY_ENHANCEMENTS g_valuesOGL_QUALITY_ENHANCEMENTS[OGL_QUALITY_ENHANCEMENTS_NUM_VALUES] =
{
OGL_QUALITY_ENHANCEMENTS_HQUAL,
OGL_QUALITY_ENHANCEMENTS_QUAL,
OGL_QUALITY_ENHANCEMENTS_PERF,
OGL_QUALITY_ENHANCEMENTS_HPERF,
};
EValues_OGL_SINGLE_BACKDEPTH_BUFFER g_valuesOGL_SINGLE_BACKDEPTH_BUFFER[OGL_SINGLE_BACKDEPTH_BUFFER_NUM_VALUES] =
{
OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE,
OGL_SINGLE_BACKDEPTH_BUFFER_ENABLE,
OGL_SINGLE_BACKDEPTH_BUFFER_USE_HW_DEFAULT,
};
EValues_OGL_SLI_MULTICAST g_valuesOGL_SLI_MULTICAST[OGL_SLI_MULTICAST_NUM_VALUES] =
{
OGL_SLI_MULTICAST_DISABLE,
OGL_SLI_MULTICAST_ENABLE,
OGL_SLI_MULTICAST_FORCE_DISABLE,
OGL_SLI_MULTICAST_ALLOW_MOSAIC,
};
EValues_OGL_THREAD_CONTROL g_valuesOGL_THREAD_CONTROL[OGL_THREAD_CONTROL_NUM_VALUES] =
{
OGL_THREAD_CONTROL_ENABLE,
OGL_THREAD_CONTROL_DISABLE,
};
EValues_OGL_TMON_LEVEL g_valuesOGL_TMON_LEVEL[OGL_TMON_LEVEL_NUM_VALUES] =
{
OGL_TMON_LEVEL_DISABLE,
OGL_TMON_LEVEL_CRITICAL,
OGL_TMON_LEVEL_WARNING,
OGL_TMON_LEVEL_INFORMATION,
OGL_TMON_LEVEL_MOST,
OGL_TMON_LEVEL_VERBOSE,
};
EValues_OGL_TRIPLE_BUFFER g_valuesOGL_TRIPLE_BUFFER[OGL_TRIPLE_BUFFER_NUM_VALUES] =
{
OGL_TRIPLE_BUFFER_DISABLED,
OGL_TRIPLE_BUFFER_ENABLED,
};
EValues_AA_BEHAVIOR_FLAGS g_valuesAA_BEHAVIOR_FLAGS[AA_BEHAVIOR_FLAGS_NUM_VALUES] =
{
AA_BEHAVIOR_FLAGS_NONE,
AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_APP_CONTROLLED,
AA_BEHAVIOR_FLAGS_TREAT_OVERRIDE_AS_ENHANCE,
AA_BEHAVIOR_FLAGS_DISABLE_OVERRIDE,
AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_APP_CONTROLLED,
AA_BEHAVIOR_FLAGS_TREAT_ENHANCE_AS_OVERRIDE,
AA_BEHAVIOR_FLAGS_DISABLE_ENHANCE,
AA_BEHAVIOR_FLAGS_MAP_VCAA_TO_MULTISAMPLING,
AA_BEHAVIOR_FLAGS_SLI_DISABLE_TRANSPARENCY_SUPERSAMPLING,
AA_BEHAVIOR_FLAGS_DISABLE_CPLAA,
AA_BEHAVIOR_FLAGS_SKIP_RT_DIM_CHECK_FOR_ENHANCE,
AA_BEHAVIOR_FLAGS_DISABLE_SLIAA,
AA_BEHAVIOR_FLAGS_DEFAULT,
AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4,
AA_BEHAVIOR_FLAGS_AA_RT_BPP_DIV_4_SHIFT,
AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4,
AA_BEHAVIOR_FLAGS_NON_AA_RT_BPP_DIV_4_SHIFT,
AA_BEHAVIOR_FLAGS_MASK,
};
EValues_AA_MODE_ALPHATOCOVERAGE g_valuesAA_MODE_ALPHATOCOVERAGE[AA_MODE_ALPHATOCOVERAGE_NUM_VALUES] =
{
AA_MODE_ALPHATOCOVERAGE_MODE_MASK,
AA_MODE_ALPHATOCOVERAGE_MODE_OFF,
AA_MODE_ALPHATOCOVERAGE_MODE_ON,
AA_MODE_ALPHATOCOVERAGE_MODE_MAX,
};
EValues_AA_MODE_GAMMACORRECTION g_valuesAA_MODE_GAMMACORRECTION[AA_MODE_GAMMACORRECTION_NUM_VALUES] =
{
AA_MODE_GAMMACORRECTION_MASK,
AA_MODE_GAMMACORRECTION_OFF,
AA_MODE_GAMMACORRECTION_ON_IF_FOS,
AA_MODE_GAMMACORRECTION_ON_ALWAYS,
AA_MODE_GAMMACORRECTION_MAX,
AA_MODE_GAMMACORRECTION_DEFAULT,
AA_MODE_GAMMACORRECTION_DEFAULT_TESLA,
AA_MODE_GAMMACORRECTION_DEFAULT_FERMI,
};
EValues_AA_MODE_METHOD g_valuesAA_MODE_METHOD[AA_MODE_METHOD_NUM_VALUES] =
{
AA_MODE_METHOD_NONE,
AA_MODE_METHOD_SUPERSAMPLE_2X_H,
AA_MODE_METHOD_SUPERSAMPLE_2X_V,
AA_MODE_METHOD_SUPERSAMPLE_1_5X1_5,
AA_MODE_METHOD_FREE_0x03,
AA_MODE_METHOD_FREE_0x04,
AA_MODE_METHOD_SUPERSAMPLE_4X,
AA_MODE_METHOD_SUPERSAMPLE_4X_BIAS,
AA_MODE_METHOD_SUPERSAMPLE_4X_GAUSSIAN,
AA_MODE_METHOD_FREE_0x08,
AA_MODE_METHOD_FREE_0x09,
AA_MODE_METHOD_SUPERSAMPLE_9X,
AA_MODE_METHOD_SUPERSAMPLE_9X_BIAS,
AA_MODE_METHOD_SUPERSAMPLE_16X,
AA_MODE_METHOD_SUPERSAMPLE_16X_BIAS,
AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL,
AA_MODE_METHOD_MULTISAMPLE_2X_QUINCUNX,
AA_MODE_METHOD_MULTISAMPLE_4X,
AA_MODE_METHOD_FREE_0x11,
AA_MODE_METHOD_MULTISAMPLE_4X_GAUSSIAN,
AA_MODE_METHOD_MIXEDSAMPLE_4X_SKEWED_4TAP,
AA_MODE_METHOD_FREE_0x14,
AA_MODE_METHOD_FREE_0x15,
AA_MODE_METHOD_MIXEDSAMPLE_6X,
AA_MODE_METHOD_MIXEDSAMPLE_6X_SKEWED_6TAP,
AA_MODE_METHOD_MIXEDSAMPLE_8X,
AA_MODE_METHOD_MIXEDSAMPLE_8X_SKEWED_8TAP,
AA_MODE_METHOD_MIXEDSAMPLE_16X,
AA_MODE_METHOD_MULTISAMPLE_4X_GAMMA,
AA_MODE_METHOD_MULTISAMPLE_16X,
AA_MODE_METHOD_VCAA_32X_8v24,
AA_MODE_METHOD_CORRUPTION_CHECK,
AA_MODE_METHOD_6X_CT,
AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_GAMMA,
AA_MODE_METHOD_SUPERSAMPLE_4X_GAMMA,
AA_MODE_METHOD_MULTISAMPLE_4X_FOSGAMMA,
AA_MODE_METHOD_MULTISAMPLE_2X_DIAGONAL_FOSGAMMA,
AA_MODE_METHOD_SUPERSAMPLE_4X_FOSGAMMA,
AA_MODE_METHOD_MULTISAMPLE_8X,
AA_MODE_METHOD_VCAA_8X_4v4,
AA_MODE_METHOD_VCAA_16X_4v12,
AA_MODE_METHOD_VCAA_16X_8v8,
AA_MODE_METHOD_MIXEDSAMPLE_32X,
AA_MODE_METHOD_SUPERVCAA_64X_4v12,
AA_MODE_METHOD_SUPERVCAA_64X_8v8,
AA_MODE_METHOD_MIXEDSAMPLE_64X,
AA_MODE_METHOD_MIXEDSAMPLE_128X,
AA_MODE_METHOD_COUNT,
AA_MODE_METHOD_METHOD_MASK,
AA_MODE_METHOD_METHOD_MAX,
};
EValues_AA_MODE_REPLAY g_valuesAA_MODE_REPLAY[AA_MODE_REPLAY_NUM_VALUES] =
{
AA_MODE_REPLAY_SAMPLES_MASK,
AA_MODE_REPLAY_SAMPLES_ONE,
AA_MODE_REPLAY_SAMPLES_TWO,
AA_MODE_REPLAY_SAMPLES_FOUR,
AA_MODE_REPLAY_SAMPLES_EIGHT,
AA_MODE_REPLAY_SAMPLES_MAX,
AA_MODE_REPLAY_MODE_MASK,
AA_MODE_REPLAY_MODE_OFF,
AA_MODE_REPLAY_MODE_ALPHA_TEST,
AA_MODE_REPLAY_MODE_PIXEL_KILL,
AA_MODE_REPLAY_MODE_DYN_BRANCH,
AA_MODE_REPLAY_MODE_OPTIMAL,
AA_MODE_REPLAY_MODE_ALL,
AA_MODE_REPLAY_MODE_MAX,
AA_MODE_REPLAY_TRANSPARENCY,
AA_MODE_REPLAY_DISALLOW_TRAA,
AA_MODE_REPLAY_TRANSPARENCY_DEFAULT,
AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_TESLA,
AA_MODE_REPLAY_TRANSPARENCY_DEFAULT_FERMI,
AA_MODE_REPLAY_MASK,
};
EValues_AA_MODE_SELECTOR g_valuesAA_MODE_SELECTOR[AA_MODE_SELECTOR_NUM_VALUES] =
{
AA_MODE_SELECTOR_MASK,
AA_MODE_SELECTOR_APP_CONTROL,
AA_MODE_SELECTOR_OVERRIDE,
AA_MODE_SELECTOR_ENHANCE,
AA_MODE_SELECTOR_MAX,
};
EValues_AA_MODE_SELECTOR_SLIAA g_valuesAA_MODE_SELECTOR_SLIAA[AA_MODE_SELECTOR_SLIAA_NUM_VALUES] =
{
AA_MODE_SELECTOR_SLIAA_DISABLED,
AA_MODE_SELECTOR_SLIAA_ENABLED,
};
EValues_ANISO_MODE_LEVEL g_valuesANISO_MODE_LEVEL[ANISO_MODE_LEVEL_NUM_VALUES] =
{
ANISO_MODE_LEVEL_MASK,
ANISO_MODE_LEVEL_NONE_POINT,
ANISO_MODE_LEVEL_NONE_LINEAR,
ANISO_MODE_LEVEL_MAX,
ANISO_MODE_LEVEL_DEFAULT,
};
EValues_ANISO_MODE_SELECTOR g_valuesANISO_MODE_SELECTOR[ANISO_MODE_SELECTOR_NUM_VALUES] =
{
ANISO_MODE_SELECTOR_MASK,
ANISO_MODE_SELECTOR_APP,
ANISO_MODE_SELECTOR_USER,
ANISO_MODE_SELECTOR_COND,
ANISO_MODE_SELECTOR_MAX,
ANISO_MODE_SELECTOR_DEFAULT,
};
EValues_ANSEL_ALLOW g_valuesANSEL_ALLOW[ANSEL_ALLOW_NUM_VALUES] =
{
ANSEL_ALLOW_DISALLOWED,
ANSEL_ALLOW_ALLOWED,
};
EValues_ANSEL_ALLOWLISTED g_valuesANSEL_ALLOWLISTED[ANSEL_ALLOWLISTED_NUM_VALUES] =
{
ANSEL_ALLOWLISTED_DISALLOWED,
ANSEL_ALLOWLISTED_ALLOWED,
};
EValues_ANSEL_ENABLE g_valuesANSEL_ENABLE[ANSEL_ENABLE_NUM_VALUES] =
{
ANSEL_ENABLE_OFF,
ANSEL_ENABLE_ON,
};
EValues_APPLICATION_PROFILE_NOTIFICATION_TIMEOUT g_valuesAPPLICATION_PROFILE_NOTIFICATION_TIMEOUT[APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NUM_VALUES] =
{
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED,
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_NINE_SECONDS,
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_FIFTEEN_SECONDS,
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_THIRTY_SECONDS,
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ONE_MINUTE,
APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_TWO_MINUTES,
};
EValues_BATTERY_BOOST_APP_FPS g_valuesBATTERY_BOOST_APP_FPS[BATTERY_BOOST_APP_FPS_NUM_VALUES] =
{
BATTERY_BOOST_APP_FPS_MIN,
BATTERY_BOOST_APP_FPS_MAX,
BATTERY_BOOST_APP_FPS_NO_OVERRIDE,
};
EValues_CPL_HIDDEN_PROFILE g_valuesCPL_HIDDEN_PROFILE[CPL_HIDDEN_PROFILE_NUM_VALUES] =
{
CPL_HIDDEN_PROFILE_DISABLED,
CPL_HIDDEN_PROFILE_ENABLED,
};
const wchar_t * g_valuesCUDA_EXCLUDED_GPUS[CUDA_EXCLUDED_GPUS_NUM_VALUES] =
{
CUDA_EXCLUDED_GPUS_NONE
};
const wchar_t * g_valuesD3DOGL_GPU_MAX_POWER[D3DOGL_GPU_MAX_POWER_NUM_VALUES] =
{
D3DOGL_GPU_MAX_POWER_DEFAULTPOWER
};
EValues_EXPORT_PERF_COUNTERS g_valuesEXPORT_PERF_COUNTERS[EXPORT_PERF_COUNTERS_NUM_VALUES] =
{
EXPORT_PERF_COUNTERS_OFF,
EXPORT_PERF_COUNTERS_ON,
};
EValues_EXTERNAL_QUIET_MODE g_valuesEXTERNAL_QUIET_MODE[EXTERNAL_QUIET_MODE_NUM_VALUES] =
{
EXTERNAL_QUIET_MODE_ON,
EXTERNAL_QUIET_MODE_OFF,
};
EValues_FRL_FPS g_valuesFRL_FPS[FRL_FPS_NUM_VALUES] =
{
FRL_FPS_DISABLED,
FRL_FPS_MIN,
FRL_FPS_MAX,
};
EValues_FXAA_ALLOW g_valuesFXAA_ALLOW[FXAA_ALLOW_NUM_VALUES] =
{
FXAA_ALLOW_DISALLOWED,
FXAA_ALLOW_ALLOWED,
};
EValues_FXAA_ENABLE g_valuesFXAA_ENABLE[FXAA_ENABLE_NUM_VALUES] =
{
FXAA_ENABLE_OFF,
FXAA_ENABLE_ON,
};
EValues_FXAA_INDICATOR_ENABLE g_valuesFXAA_INDICATOR_ENABLE[FXAA_INDICATOR_ENABLE_NUM_VALUES] =
{
FXAA_INDICATOR_ENABLE_OFF,
FXAA_INDICATOR_ENABLE_ON,
};
EValues_LATENCY_INDICATOR_AUTOALIGN g_valuesLATENCY_INDICATOR_AUTOALIGN[LATENCY_INDICATOR_AUTOALIGN_NUM_VALUES] =
{
LATENCY_INDICATOR_AUTOALIGN_DISABLED,
LATENCY_INDICATOR_AUTOALIGN_ENABLED,
};
EValues_MCSFRSHOWSPLIT g_valuesMCSFRSHOWSPLIT[MCSFRSHOWSPLIT_NUM_VALUES] =
{
MCSFRSHOWSPLIT_DISABLED,
MCSFRSHOWSPLIT_ENABLED,
};
EValues_NV_QUALITY_UPSCALING g_valuesNV_QUALITY_UPSCALING[NV_QUALITY_UPSCALING_NUM_VALUES] =
{
NV_QUALITY_UPSCALING_OFF,
NV_QUALITY_UPSCALING_ON,
};
EValues_OPTIMUS_MAXAA g_valuesOPTIMUS_MAXAA[OPTIMUS_MAXAA_NUM_VALUES] =
{
OPTIMUS_MAXAA_MIN,
OPTIMUS_MAXAA_MAX,
};
EValues_PHYSXINDICATOR g_valuesPHYSXINDICATOR[PHYSXINDICATOR_NUM_VALUES] =
{
PHYSXINDICATOR_DISABLED,
PHYSXINDICATOR_ENABLED,
};
EValues_PREFERRED_PSTATE g_valuesPREFERRED_PSTATE[PREFERRED_PSTATE_NUM_VALUES] =
{
PREFERRED_PSTATE_ADAPTIVE,
PREFERRED_PSTATE_PREFER_MAX,
PREFERRED_PSTATE_DRIVER_CONTROLLED,
PREFERRED_PSTATE_PREFER_CONSISTENT_PERFORMANCE,
PREFERRED_PSTATE_PREFER_MIN,
PREFERRED_PSTATE_OPTIMAL_POWER,
PREFERRED_PSTATE_MIN,
PREFERRED_PSTATE_MAX,
};
EValues_PREVENT_UI_AF_OVERRIDE g_valuesPREVENT_UI_AF_OVERRIDE[PREVENT_UI_AF_OVERRIDE_NUM_VALUES] =
{
PREVENT_UI_AF_OVERRIDE_OFF,
PREVENT_UI_AF_OVERRIDE_ON,
};
EValues_SHIM_MCCOMPAT g_valuesSHIM_MCCOMPAT[SHIM_MCCOMPAT_NUM_VALUES] =
{
SHIM_MCCOMPAT_INTEGRATED,
SHIM_MCCOMPAT_ENABLE,
SHIM_MCCOMPAT_USER_EDITABLE,
SHIM_MCCOMPAT_MASK,
SHIM_MCCOMPAT_VIDEO_MASK,
SHIM_MCCOMPAT_VARYING_BIT,
SHIM_MCCOMPAT_AUTO_SELECT,
SHIM_MCCOMPAT_OVERRIDE_BIT,
};
EValues_SHIM_RENDERING_MODE g_valuesSHIM_RENDERING_MODE[SHIM_RENDERING_MODE_NUM_VALUES] =
{
SHIM_RENDERING_MODE_INTEGRATED,
SHIM_RENDERING_MODE_ENABLE,
SHIM_RENDERING_MODE_USER_EDITABLE,
SHIM_RENDERING_MODE_MASK,
SHIM_RENDERING_MODE_VIDEO_MASK,
SHIM_RENDERING_MODE_VARYING_BIT,
SHIM_RENDERING_MODE_AUTO_SELECT,
SHIM_RENDERING_MODE_OVERRIDE_BIT,
};
EValues_SHIM_RENDERING_OPTIONS g_valuesSHIM_RENDERING_OPTIONS[SHIM_RENDERING_OPTIONS_NUM_VALUES] =
{
SHIM_RENDERING_OPTIONS_DEFAULT_RENDERING_MODE,
SHIM_RENDERING_OPTIONS_DISABLE_ASYNC_PRESENT,
SHIM_RENDERING_OPTIONS_EHSHELL_DETECT,
SHIM_RENDERING_OPTIONS_FLASHPLAYER_HOST_DETECT,
SHIM_RENDERING_OPTIONS_VIDEO_DRM_APP_DETECT,
SHIM_RENDERING_OPTIONS_IGNORE_OVERRIDES,
SHIM_RENDERING_OPTIONS_RESERVED1,
SHIM_RENDERING_OPTIONS_ENABLE_DWM_ASYNC_PRESENT,
SHIM_RENDERING_OPTIONS_RESERVED2,
SHIM_RENDERING_OPTIONS_ALLOW_INHERITANCE,
SHIM_RENDERING_OPTIONS_DISABLE_WRAPPERS,
SHIM_RENDERING_OPTIONS_DISABLE_DXGI_WRAPPERS,
SHIM_RENDERING_OPTIONS_PRUNE_UNSUPPORTED_FORMATS,
SHIM_RENDERING_OPTIONS_ENABLE_ALPHA_FORMAT,
SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING,
SHIM_RENDERING_OPTIONS_DISABLE_CUDA,
SHIM_RENDERING_OPTIONS_ALLOW_CP_CAPS_FOR_VIDEO,
SHIM_RENDERING_OPTIONS_IGPU_TRANSCODING_FWD_OPTIMUS,
SHIM_RENDERING_OPTIONS_DISABLE_DURING_SECURE_BOOT,
SHIM_RENDERING_OPTIONS_INVERT_FOR_QUADRO,
SHIM_RENDERING_OPTIONS_INVERT_FOR_MSHYBRID,
SHIM_RENDERING_OPTIONS_REGISTER_PROCESS_ENABLE_GOLD,
SHIM_RENDERING_OPTIONS_HANDLE_WINDOWED_MODE_PERF_OPT,
SHIM_RENDERING_OPTIONS_HANDLE_WIN7_ASYNC_RUNTIME_BUG,
SHIM_RENDERING_OPTIONS_EXPLICIT_ADAPTER_OPTED_BY_APP,
SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH,
SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH,
SHIM_RENDERING_OPTIONS_DISABLE_TURING_POWER_POLICY,
SHIM_RENDERING_OPTIONS_ALLOW_DYNAMIC_DISPLAY_MUX_SWITCH_MDM,
SHIM_RENDERING_OPTIONS_DISALLOW_DYNAMIC_DISPLAY_MUX_SWITCH_MDM,
};
EValues_SLI_GPU_COUNT g_valuesSLI_GPU_COUNT[SLI_GPU_COUNT_NUM_VALUES] =
{
SLI_GPU_COUNT_AUTOSELECT,
SLI_GPU_COUNT_ONE,
SLI_GPU_COUNT_TWO,
SLI_GPU_COUNT_THREE,
SLI_GPU_COUNT_FOUR,
};
EValues_SLI_PREDEFINED_GPU_COUNT g_valuesSLI_PREDEFINED_GPU_COUNT[SLI_PREDEFINED_GPU_COUNT_NUM_VALUES] =
{
SLI_PREDEFINED_GPU_COUNT_AUTOSELECT,
SLI_PREDEFINED_GPU_COUNT_ONE,
SLI_PREDEFINED_GPU_COUNT_TWO,
SLI_PREDEFINED_GPU_COUNT_THREE,
SLI_PREDEFINED_GPU_COUNT_FOUR,
};
EValues_SLI_PREDEFINED_GPU_COUNT_DX10 g_valuesSLI_PREDEFINED_GPU_COUNT_DX10[SLI_PREDEFINED_GPU_COUNT_DX10_NUM_VALUES] =
{
SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT,
SLI_PREDEFINED_GPU_COUNT_DX10_ONE,
SLI_PREDEFINED_GPU_COUNT_DX10_TWO,
SLI_PREDEFINED_GPU_COUNT_DX10_THREE,
SLI_PREDEFINED_GPU_COUNT_DX10_FOUR,
};
EValues_SLI_PREDEFINED_MODE g_valuesSLI_PREDEFINED_MODE[SLI_PREDEFINED_MODE_NUM_VALUES] =
{
SLI_PREDEFINED_MODE_AUTOSELECT,
SLI_PREDEFINED_MODE_FORCE_SINGLE,
SLI_PREDEFINED_MODE_FORCE_AFR,
SLI_PREDEFINED_MODE_FORCE_AFR2,
SLI_PREDEFINED_MODE_FORCE_SFR,
SLI_PREDEFINED_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR,
};
EValues_SLI_PREDEFINED_MODE_DX10 g_valuesSLI_PREDEFINED_MODE_DX10[SLI_PREDEFINED_MODE_DX10_NUM_VALUES] =
{
SLI_PREDEFINED_MODE_DX10_AUTOSELECT,
SLI_PREDEFINED_MODE_DX10_FORCE_SINGLE,
SLI_PREDEFINED_MODE_DX10_FORCE_AFR,
SLI_PREDEFINED_MODE_DX10_FORCE_AFR2,
SLI_PREDEFINED_MODE_DX10_FORCE_SFR,
SLI_PREDEFINED_MODE_DX10_FORCE_AFR_OF_SFR__FALLBACK_3AFR,
};
EValues_SLI_RENDERING_MODE g_valuesSLI_RENDERING_MODE[SLI_RENDERING_MODE_NUM_VALUES] =
{
SLI_RENDERING_MODE_AUTOSELECT,
SLI_RENDERING_MODE_FORCE_SINGLE,
SLI_RENDERING_MODE_FORCE_AFR,
SLI_RENDERING_MODE_FORCE_AFR2,
SLI_RENDERING_MODE_FORCE_SFR,
SLI_RENDERING_MODE_FORCE_AFR_OF_SFR__FALLBACK_3AFR,
};
EValues_VRPRERENDERLIMIT g_valuesVRPRERENDERLIMIT[VRPRERENDERLIMIT_NUM_VALUES] =
{
VRPRERENDERLIMIT_MIN,
VRPRERENDERLIMIT_MAX,
VRPRERENDERLIMIT_APP_CONTROLLED,
VRPRERENDERLIMIT_DEFAULT,
};
EValues_VRRFEATUREINDICATOR g_valuesVRRFEATUREINDICATOR[VRRFEATUREINDICATOR_NUM_VALUES] =
{
VRRFEATUREINDICATOR_DISABLED,
VRRFEATUREINDICATOR_ENABLED,
};
EValues_VRROVERLAYINDICATOR g_valuesVRROVERLAYINDICATOR[VRROVERLAYINDICATOR_NUM_VALUES] =
{
VRROVERLAYINDICATOR_DISABLED,
VRROVERLAYINDICATOR_ENABLED,
};
EValues_VRRREQUESTSTATE g_valuesVRRREQUESTSTATE[VRRREQUESTSTATE_NUM_VALUES] =
{
VRRREQUESTSTATE_DISABLED,
VRRREQUESTSTATE_FULLSCREEN_ONLY,
VRRREQUESTSTATE_FULLSCREEN_AND_WINDOWED,
};
EValues_VRR_APP_OVERRIDE g_valuesVRR_APP_OVERRIDE[VRR_APP_OVERRIDE_NUM_VALUES] =
{
VRR_APP_OVERRIDE_ALLOW,
VRR_APP_OVERRIDE_FORCE_OFF,
VRR_APP_OVERRIDE_DISALLOW,
VRR_APP_OVERRIDE_ULMB,
VRR_APP_OVERRIDE_FIXED_REFRESH,
};
EValues_VRR_APP_OVERRIDE_REQUEST_STATE g_valuesVRR_APP_OVERRIDE_REQUEST_STATE[VRR_APP_OVERRIDE_REQUEST_STATE_NUM_VALUES] =
{
VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW,
VRR_APP_OVERRIDE_REQUEST_STATE_FORCE_OFF,
VRR_APP_OVERRIDE_REQUEST_STATE_DISALLOW,
VRR_APP_OVERRIDE_REQUEST_STATE_ULMB,
VRR_APP_OVERRIDE_REQUEST_STATE_FIXED_REFRESH,
};
EValues_VRR_MODE g_valuesVRR_MODE[VRR_MODE_NUM_VALUES] =
{
VRR_MODE_DISABLED,
VRR_MODE_FULLSCREEN_ONLY,
VRR_MODE_FULLSCREEN_AND_WINDOWED,
};
EValues_VSYNCSMOOTHAFR g_valuesVSYNCSMOOTHAFR[VSYNCSMOOTHAFR_NUM_VALUES] =
{
VSYNCSMOOTHAFR_OFF,
VSYNCSMOOTHAFR_ON,
};
EValues_VSYNCVRRCONTROL g_valuesVSYNCVRRCONTROL[VSYNCVRRCONTROL_NUM_VALUES] =
{
VSYNCVRRCONTROL_DISABLE,
VSYNCVRRCONTROL_ENABLE,
VSYNCVRRCONTROL_NOTSUPPORTED,
};
EValues_VSYNC_BEHAVIOR_FLAGS g_valuesVSYNC_BEHAVIOR_FLAGS[VSYNC_BEHAVIOR_FLAGS_NUM_VALUES] =
{
VSYNC_BEHAVIOR_FLAGS_NONE,
VSYNC_BEHAVIOR_FLAGS_DEFAULT,
VSYNC_BEHAVIOR_FLAGS_IGNORE_FLIPINTERVAL_MULTIPLE,
};
EValues_WKS_API_STEREO_EYES_EXCHANGE g_valuesWKS_API_STEREO_EYES_EXCHANGE[WKS_API_STEREO_EYES_EXCHANGE_NUM_VALUES] =
{
WKS_API_STEREO_EYES_EXCHANGE_OFF,
WKS_API_STEREO_EYES_EXCHANGE_ON,
};
EValues_WKS_API_STEREO_MODE g_valuesWKS_API_STEREO_MODE[WKS_API_STEREO_MODE_NUM_VALUES] =
{
WKS_API_STEREO_MODE_SHUTTER_GLASSES,
WKS_API_STEREO_MODE_VERTICAL_INTERLACED,
WKS_API_STEREO_MODE_TWINVIEW,
WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_AUTO,
WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC0,
WKS_API_STEREO_MODE_NV17_SHUTTER_GLASSES_DAC1,
WKS_API_STEREO_MODE_COLOR_LINE,
WKS_API_STEREO_MODE_COLOR_INTERLEAVED,
WKS_API_STEREO_MODE_ANAGLYPH,
WKS_API_STEREO_MODE_HORIZONTAL_INTERLACED,
WKS_API_STEREO_MODE_SIDE_FIELD,
WKS_API_STEREO_MODE_SUB_FIELD,
WKS_API_STEREO_MODE_CHECKERBOARD,
WKS_API_STEREO_MODE_INVERSE_CHECKERBOARD,
WKS_API_STEREO_MODE_TRIDELITY_SL,
WKS_API_STEREO_MODE_TRIDELITY_MV,
WKS_API_STEREO_MODE_SEEFRONT,
WKS_API_STEREO_MODE_STEREO_MIRROR,
WKS_API_STEREO_MODE_FRAME_SEQUENTIAL,
WKS_API_STEREO_MODE_AUTODETECT_PASSIVE_MODE,
WKS_API_STEREO_MODE_AEGIS_DT_FRAME_SEQUENTIAL,
WKS_API_STEREO_MODE_OEM_EMITTER_FRAME_SEQUENTIAL,
WKS_API_STEREO_MODE_DP_INBAND,
WKS_API_STEREO_MODE_USE_HW_DEFAULT,
WKS_API_STEREO_MODE_DEFAULT_GL,
};
EValues_WKS_STEREO_DONGLE_SUPPORT g_valuesWKS_STEREO_DONGLE_SUPPORT[WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES] =
{
WKS_STEREO_DONGLE_SUPPORT_OFF,
WKS_STEREO_DONGLE_SUPPORT_DAC,
WKS_STEREO_DONGLE_SUPPORT_DLP,
};
EValues_WKS_STEREO_SUPPORT g_valuesWKS_STEREO_SUPPORT[WKS_STEREO_SUPPORT_NUM_VALUES] =
{
WKS_STEREO_SUPPORT_OFF,
WKS_STEREO_SUPPORT_ON,
};
EValues_WKS_STEREO_SWAP_MODE g_valuesWKS_STEREO_SWAP_MODE[WKS_STEREO_SWAP_MODE_NUM_VALUES] =
{
WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL,
WKS_STEREO_SWAP_MODE_PER_EYE,
WKS_STEREO_SWAP_MODE_PER_EYE_PAIR,
WKS_STEREO_SWAP_MODE_LEGACY_BEHAVIOR,
WKS_STEREO_SWAP_MODE_PER_EYE_FOR_SWAP_GROUP,
};
EValues_AO_MODE g_valuesAO_MODE[AO_MODE_NUM_VALUES] =
{
AO_MODE_OFF,
AO_MODE_LOW,
AO_MODE_MEDIUM,
AO_MODE_HIGH,
};
EValues_AO_MODE_ACTIVE g_valuesAO_MODE_ACTIVE[AO_MODE_ACTIVE_NUM_VALUES] =
{
AO_MODE_ACTIVE_DISABLED,
AO_MODE_ACTIVE_ENABLED,
};
EValues_AUTO_LODBIASADJUST g_valuesAUTO_LODBIASADJUST[AUTO_LODBIASADJUST_NUM_VALUES] =
{
AUTO_LODBIASADJUST_OFF,
AUTO_LODBIASADJUST_ON,
};
EValues_EXPORT_PERF_COUNTERS_DX9_ONLY g_valuesEXPORT_PERF_COUNTERS_DX9_ONLY[EXPORT_PERF_COUNTERS_DX9_ONLY_NUM_VALUES] =
{
EXPORT_PERF_COUNTERS_DX9_ONLY_OFF,
EXPORT_PERF_COUNTERS_DX9_ONLY_ON,
};
EValues_LODBIASADJUST g_valuesLODBIASADJUST[LODBIASADJUST_NUM_VALUES] =
{
LODBIASADJUST_MIN,
LODBIASADJUST_MAX,
};
EValues_MAXWELL_B_SAMPLE_INTERLEAVE g_valuesMAXWELL_B_SAMPLE_INTERLEAVE[MAXWELL_B_SAMPLE_INTERLEAVE_NUM_VALUES] =
{
MAXWELL_B_SAMPLE_INTERLEAVE_OFF,
MAXWELL_B_SAMPLE_INTERLEAVE_ON,
};
EValues_PRERENDERLIMIT g_valuesPRERENDERLIMIT[PRERENDERLIMIT_NUM_VALUES] =
{
PRERENDERLIMIT_MIN,
PRERENDERLIMIT_MAX,
PRERENDERLIMIT_APP_CONTROLLED,
};
EValues_PS_SHADERDISKCACHE g_valuesPS_SHADERDISKCACHE[PS_SHADERDISKCACHE_NUM_VALUES] =
{
PS_SHADERDISKCACHE_OFF,
PS_SHADERDISKCACHE_ON,
};
EValues_PS_SHADERDISKCACHE_MAX_SIZE g_valuesPS_SHADERDISKCACHE_MAX_SIZE[PS_SHADERDISKCACHE_MAX_SIZE_NUM_VALUES] =
{
PS_SHADERDISKCACHE_MAX_SIZE_MIN,
PS_SHADERDISKCACHE_MAX_SIZE_MAX,
};
EValues_PS_TEXFILTER_ANISO_OPTS2 g_valuesPS_TEXFILTER_ANISO_OPTS2[PS_TEXFILTER_ANISO_OPTS2_NUM_VALUES] =
{
PS_TEXFILTER_ANISO_OPTS2_OFF,
PS_TEXFILTER_ANISO_OPTS2_ON,
};
EValues_PS_TEXFILTER_BILINEAR_IN_ANISO g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO[PS_TEXFILTER_BILINEAR_IN_ANISO_NUM_VALUES] =
{
PS_TEXFILTER_BILINEAR_IN_ANISO_OFF,
PS_TEXFILTER_BILINEAR_IN_ANISO_ON,
};
EValues_PS_TEXFILTER_DISABLE_TRILIN_SLOPE g_valuesPS_TEXFILTER_DISABLE_TRILIN_SLOPE[PS_TEXFILTER_DISABLE_TRILIN_SLOPE_NUM_VALUES] =
{
PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF,
PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ON,
};
EValues_PS_TEXFILTER_NO_NEG_LODBIAS g_valuesPS_TEXFILTER_NO_NEG_LODBIAS[PS_TEXFILTER_NO_NEG_LODBIAS_NUM_VALUES] =
{
PS_TEXFILTER_NO_NEG_LODBIAS_OFF,
PS_TEXFILTER_NO_NEG_LODBIAS_ON,
};
EValues_QUALITY_ENHANCEMENTS g_valuesQUALITY_ENHANCEMENTS[QUALITY_ENHANCEMENTS_NUM_VALUES] =
{
QUALITY_ENHANCEMENTS_HIGHQUALITY,
QUALITY_ENHANCEMENTS_QUALITY,
QUALITY_ENHANCEMENTS_PERFORMANCE,
QUALITY_ENHANCEMENTS_HIGHPERFORMANCE,
};
EValues_QUALITY_ENHANCEMENT_SUBSTITUTION g_valuesQUALITY_ENHANCEMENT_SUBSTITUTION[QUALITY_ENHANCEMENT_SUBSTITUTION_NUM_VALUES] =
{
QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION,
QUALITY_ENHANCEMENT_SUBSTITUTION_HIGHQUALITY_BECOMES_QUALITY,
};
EValues_REFRESH_RATE_OVERRIDE g_valuesREFRESH_RATE_OVERRIDE[REFRESH_RATE_OVERRIDE_NUM_VALUES] =
{
REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED,
REFRESH_RATE_OVERRIDE_HIGHEST_AVAILABLE,
REFRESH_RATE_OVERRIDE_LOW_LATENCY_RR_MASK,
};
EValues_SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE g_valuesSET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE[SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_NUM_VALUES] =
{
SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF,
SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ON,
};
EValues_SET_VAB_DATA g_valuesSET_VAB_DATA[SET_VAB_DATA_NUM_VALUES] =
{
SET_VAB_DATA_ZERO,
SET_VAB_DATA_UINT_ONE,
SET_VAB_DATA_FLOAT_ONE,
SET_VAB_DATA_FLOAT_POS_INF,
SET_VAB_DATA_FLOAT_NAN,
SET_VAB_DATA_USE_API_DEFAULTS,
};
EValues_VSYNCMODE g_valuesVSYNCMODE[VSYNCMODE_NUM_VALUES] =
{
VSYNCMODE_PASSIVE,
VSYNCMODE_FORCEOFF,
VSYNCMODE_FORCEON,
VSYNCMODE_FLIPINTERVAL2,
VSYNCMODE_FLIPINTERVAL3,
VSYNCMODE_FLIPINTERVAL4,
VSYNCMODE_VIRTUAL,
};
EValues_VSYNCTEARCONTROL g_valuesVSYNCTEARCONTROL[VSYNCTEARCONTROL_NUM_VALUES] =
{
VSYNCTEARCONTROL_DISABLE,
VSYNCTEARCONTROL_ENABLE,
};
SettingDWORDNameString mapSettingDWORD[TOTAL_DWORD_SETTING_NUM] =
{
{OGL_AA_LINE_GAMMA_ID, OGL_AA_LINE_GAMMA_STRING, 4, (NvU32 *)g_valuesOGL_AA_LINE_GAMMA, OGL_AA_LINE_GAMMA_DISABLED},
{OGL_CPL_GDI_COMPATIBILITY_ID, OGL_CPL_GDI_COMPATIBILITY_STRING, 3, (NvU32 *)g_valuesOGL_CPL_GDI_COMPATIBILITY, OGL_CPL_GDI_COMPATIBILITY_AUTO},
{OGL_CPL_PREFER_DXPRESENT_ID, OGL_CPL_PREFER_DXPRESENT_STRING, 3, (NvU32 *)g_valuesOGL_CPL_PREFER_DXPRESENT, OGL_CPL_PREFER_DXPRESENT_AUTO},
{OGL_DEEP_COLOR_SCANOUT_ID, OGL_DEEP_COLOR_SCANOUT_STRING, 2, (NvU32 *)g_valuesOGL_DEEP_COLOR_SCANOUT, OGL_DEEP_COLOR_SCANOUT_ENABLE},
{OGL_DEFAULT_SWAP_INTERVAL_ID, OGL_DEFAULT_SWAP_INTERVAL_STRING, 9, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL, OGL_DEFAULT_SWAP_INTERVAL_VSYNC_ONE},
{OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID, OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_STRING, 2, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL, 0x00000000},
{OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID, OGL_DEFAULT_SWAP_INTERVAL_SIGN_STRING, 2, (NvU32 *)g_valuesOGL_DEFAULT_SWAP_INTERVAL_SIGN, OGL_DEFAULT_SWAP_INTERVAL_SIGN_POSITIVE},
{OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID, OGL_EVENT_LOG_SEVERITY_THRESHOLD_STRING, 5, (NvU32 *)g_valuesOGL_EVENT_LOG_SEVERITY_THRESHOLD, OGL_EVENT_LOG_SEVERITY_THRESHOLD_ALL},
{OGL_EXTENSION_STRING_VERSION_ID, OGL_EXTENSION_STRING_VERSION_STRING, 0, NULL, 0x00000000},
{OGL_FORCE_BLIT_ID, OGL_FORCE_BLIT_STRING, 2, (NvU32 *)g_valuesOGL_FORCE_BLIT, OGL_FORCE_BLIT_OFF},
{OGL_FORCE_STEREO_ID, OGL_FORCE_STEREO_STRING, 2, (NvU32 *)g_valuesOGL_FORCE_STEREO, OGL_FORCE_STEREO_OFF},
{OGL_MAX_FRAMES_ALLOWED_ID, OGL_MAX_FRAMES_ALLOWED_STRING, 0, NULL, 0x00000002},
{OGL_OVERLAY_PIXEL_TYPE_ID, OGL_OVERLAY_PIXEL_TYPE_STRING, 4, (NvU32 *)g_valuesOGL_OVERLAY_PIXEL_TYPE, OGL_OVERLAY_PIXEL_TYPE_CI},
{OGL_OVERLAY_SUPPORT_ID, OGL_OVERLAY_SUPPORT_STRING, 3, (NvU32 *)g_valuesOGL_OVERLAY_SUPPORT, OGL_OVERLAY_SUPPORT_OFF},
{OGL_QUALITY_ENHANCEMENTS_ID, OGL_QUALITY_ENHANCEMENTS_STRING, 4, (NvU32 *)g_valuesOGL_QUALITY_ENHANCEMENTS, OGL_QUALITY_ENHANCEMENTS_QUAL},
{OGL_SINGLE_BACKDEPTH_BUFFER_ID, OGL_SINGLE_BACKDEPTH_BUFFER_STRING, 3, (NvU32 *)g_valuesOGL_SINGLE_BACKDEPTH_BUFFER, OGL_SINGLE_BACKDEPTH_BUFFER_DISABLE},
{OGL_SLI_MULTICAST_ID, OGL_SLI_MULTICAST_STRING, 4, (NvU32 *)g_valuesOGL_SLI_MULTICAST, OGL_SLI_MULTICAST_DISABLE},
{OGL_THREAD_CONTROL_ID, OGL_THREAD_CONTROL_STRING, 2, (NvU32 *)g_valuesOGL_THREAD_CONTROL, 0x00000000},
{OGL_TMON_LEVEL_ID, OGL_TMON_LEVEL_STRING, 6, (NvU32 *)g_valuesOGL_TMON_LEVEL, OGL_TMON_LEVEL_MOST},
{OGL_TRIPLE_BUFFER_ID, OGL_TRIPLE_BUFFER_STRING, 2, (NvU32 *)g_valuesOGL_TRIPLE_BUFFER, OGL_TRIPLE_BUFFER_DISABLED},
{AA_BEHAVIOR_FLAGS_ID, AA_BEHAVIOR_FLAGS_STRING, 18, (NvU32 *)g_valuesAA_BEHAVIOR_FLAGS, AA_BEHAVIOR_FLAGS_DEFAULT},
{AA_MODE_ALPHATOCOVERAGE_ID, AA_MODE_ALPHATOCOVERAGE_STRING, 4, (NvU32 *)g_valuesAA_MODE_ALPHATOCOVERAGE, 0x00000000},
{AA_MODE_GAMMACORRECTION_ID, AA_MODE_GAMMACORRECTION_STRING, 8, (NvU32 *)g_valuesAA_MODE_GAMMACORRECTION, 0x00000000},
{AA_MODE_METHOD_ID, AA_MODE_METHOD_STRING, 50, (NvU32 *)g_valuesAA_MODE_METHOD, AA_MODE_METHOD_NONE},
{AA_MODE_REPLAY_ID, AA_MODE_REPLAY_STRING, 20, (NvU32 *)g_valuesAA_MODE_REPLAY, 0x00000000},
{AA_MODE_SELECTOR_ID, AA_MODE_SELECTOR_STRING, 5, (NvU32 *)g_valuesAA_MODE_SELECTOR, AA_MODE_SELECTOR_APP_CONTROL},
{AA_MODE_SELECTOR_SLIAA_ID, AA_MODE_SELECTOR_SLIAA_STRING, 2, (NvU32 *)g_valuesAA_MODE_SELECTOR_SLIAA, AA_MODE_SELECTOR_SLIAA_DISABLED},
{ANISO_MODE_LEVEL_ID, ANISO_MODE_LEVEL_STRING, 5, (NvU32 *)g_valuesANISO_MODE_LEVEL, ANISO_MODE_LEVEL_DEFAULT},
{ANISO_MODE_SELECTOR_ID, ANISO_MODE_SELECTOR_STRING, 6, (NvU32 *)g_valuesANISO_MODE_SELECTOR, ANISO_MODE_SELECTOR_DEFAULT},
{ANSEL_ALLOW_ID, ANSEL_ALLOW_STRING, 2, (NvU32 *)g_valuesANSEL_ALLOW, ANSEL_ALLOW_ALLOWED},
{ANSEL_ALLOWLISTED_ID, ANSEL_ALLOWLISTED_STRING, 2, (NvU32 *)g_valuesANSEL_ALLOWLISTED, ANSEL_ALLOWLISTED_DISALLOWED},
{ANSEL_ENABLE_ID, ANSEL_ENABLE_STRING, 2, (NvU32 *)g_valuesANSEL_ENABLE, ANSEL_ENABLE_ON},
{APPIDLE_DYNAMIC_FRL_FPS_ID, APPIDLE_DYNAMIC_FRL_FPS_STRING, 0, NULL, 0x00000000},
{APPIDLE_DYNAMIC_FRL_THRESHOLD_TIME_ID, APPIDLE_DYNAMIC_FRL_THRESHOLD_TIME_STRING, 0, NULL, 0x00000000},
{APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID, APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_STRING, 6, (NvU32 *)g_valuesAPPLICATION_PROFILE_NOTIFICATION_TIMEOUT, APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_DISABLED},
{APPLICATION_STEAM_ID_ID, APPLICATION_STEAM_ID_STRING, 0, NULL, 0x00000000},
{BATTERY_BOOST_APP_FPS_ID, BATTERY_BOOST_APP_FPS_STRING, 3, (NvU32 *)g_valuesBATTERY_BOOST_APP_FPS, BATTERY_BOOST_APP_FPS_NO_OVERRIDE},
{CPL_HIDDEN_PROFILE_ID, CPL_HIDDEN_PROFILE_STRING, 2, (NvU32 *)g_valuesCPL_HIDDEN_PROFILE, CPL_HIDDEN_PROFILE_DISABLED},
{EXPORT_PERF_COUNTERS_ID, EXPORT_PERF_COUNTERS_STRING, 2, (NvU32 *)g_valuesEXPORT_PERF_COUNTERS, EXPORT_PERF_COUNTERS_OFF},
{EXTERNAL_QUIET_MODE_ID, EXTERNAL_QUIET_MODE_STRING, 2, (NvU32 *)g_valuesEXTERNAL_QUIET_MODE, EXTERNAL_QUIET_MODE_OFF},
{FRL_FPS_ID, FRL_FPS_STRING, 3, (NvU32 *)g_valuesFRL_FPS, FRL_FPS_DISABLED},
{FXAA_ALLOW_ID, FXAA_ALLOW_STRING, 2, (NvU32 *)g_valuesFXAA_ALLOW, FXAA_ALLOW_ALLOWED},
{FXAA_ENABLE_ID, FXAA_ENABLE_STRING, 2, (NvU32 *)g_valuesFXAA_ENABLE, FXAA_ENABLE_OFF},
{FXAA_INDICATOR_ENABLE_ID, FXAA_INDICATOR_ENABLE_STRING, 2, (NvU32 *)g_valuesFXAA_INDICATOR_ENABLE, FXAA_INDICATOR_ENABLE_OFF},
{LATENCY_INDICATOR_AUTOALIGN_ID, LATENCY_INDICATOR_AUTOALIGN_STRING, 2, (NvU32 *)g_valuesLATENCY_INDICATOR_AUTOALIGN, LATENCY_INDICATOR_AUTOALIGN_ENABLED},
{MCSFRSHOWSPLIT_ID, MCSFRSHOWSPLIT_STRING, 2, (NvU32 *)g_valuesMCSFRSHOWSPLIT, MCSFRSHOWSPLIT_DISABLED},
{NV_QUALITY_UPSCALING_ID, NV_QUALITY_UPSCALING_STRING, 2, (NvU32 *)g_valuesNV_QUALITY_UPSCALING, NV_QUALITY_UPSCALING_OFF},
{OPTIMUS_MAXAA_ID, OPTIMUS_MAXAA_STRING, 2, (NvU32 *)g_valuesOPTIMUS_MAXAA, 0x00000000},
{PHYSXINDICATOR_ID, PHYSXINDICATOR_STRING, 2, (NvU32 *)g_valuesPHYSXINDICATOR, PHYSXINDICATOR_DISABLED},
{PREFERRED_PSTATE_ID, PREFERRED_PSTATE_STRING, 8, (NvU32 *)g_valuesPREFERRED_PSTATE, PREFERRED_PSTATE_OPTIMAL_POWER},
{PREVENT_UI_AF_OVERRIDE_ID, PREVENT_UI_AF_OVERRIDE_STRING, 2, (NvU32 *)g_valuesPREVENT_UI_AF_OVERRIDE, PREVENT_UI_AF_OVERRIDE_OFF},
{SHIM_MAXRES_ID, SHIM_MAXRES_STRING, 0, NULL, 0x00000000},
{SHIM_MCCOMPAT_ID, SHIM_MCCOMPAT_STRING, 8, (NvU32 *)g_valuesSHIM_MCCOMPAT, SHIM_MCCOMPAT_AUTO_SELECT},
{SHIM_RENDERING_MODE_ID, SHIM_RENDERING_MODE_STRING, 8, (NvU32 *)g_valuesSHIM_RENDERING_MODE, SHIM_RENDERING_MODE_AUTO_SELECT},
{SHIM_RENDERING_OPTIONS_ID, SHIM_RENDERING_OPTIONS_STRING, 30, (NvU32 *)g_valuesSHIM_RENDERING_OPTIONS, 0x00000000},
{SLI_GPU_COUNT_ID, SLI_GPU_COUNT_STRING, 5, (NvU32 *)g_valuesSLI_GPU_COUNT, SLI_GPU_COUNT_AUTOSELECT},
{SLI_PREDEFINED_GPU_COUNT_ID, SLI_PREDEFINED_GPU_COUNT_STRING, 5, (NvU32 *)g_valuesSLI_PREDEFINED_GPU_COUNT, SLI_PREDEFINED_GPU_COUNT_AUTOSELECT},
{SLI_PREDEFINED_GPU_COUNT_DX10_ID, SLI_PREDEFINED_GPU_COUNT_DX10_STRING, 5, (NvU32 *)g_valuesSLI_PREDEFINED_GPU_COUNT_DX10, SLI_PREDEFINED_GPU_COUNT_DX10_AUTOSELECT},
{SLI_PREDEFINED_MODE_ID, SLI_PREDEFINED_MODE_STRING, 6, (NvU32 *)g_valuesSLI_PREDEFINED_MODE, SLI_PREDEFINED_MODE_AUTOSELECT},
{SLI_PREDEFINED_MODE_DX10_ID, SLI_PREDEFINED_MODE_DX10_STRING, 6, (NvU32 *)g_valuesSLI_PREDEFINED_MODE_DX10, SLI_PREDEFINED_MODE_DX10_AUTOSELECT},
{SLI_RENDERING_MODE_ID, SLI_RENDERING_MODE_STRING, 6, (NvU32 *)g_valuesSLI_RENDERING_MODE, SLI_RENDERING_MODE_AUTOSELECT},
{VRPRERENDERLIMIT_ID, VRPRERENDERLIMIT_STRING, 4, (NvU32 *)g_valuesVRPRERENDERLIMIT, VRPRERENDERLIMIT_DEFAULT},
{VRRFEATUREINDICATOR_ID, VRRFEATUREINDICATOR_STRING, 2, (NvU32 *)g_valuesVRRFEATUREINDICATOR, VRRFEATUREINDICATOR_ENABLED},
{VRROVERLAYINDICATOR_ID, VRROVERLAYINDICATOR_STRING, 2, (NvU32 *)g_valuesVRROVERLAYINDICATOR, VRROVERLAYINDICATOR_ENABLED},
{VRRREQUESTSTATE_ID, VRRREQUESTSTATE_STRING, 3, (NvU32 *)g_valuesVRRREQUESTSTATE, VRRREQUESTSTATE_FULLSCREEN_ONLY},
{VRR_APP_OVERRIDE_ID, VRR_APP_OVERRIDE_STRING, 5, (NvU32 *)g_valuesVRR_APP_OVERRIDE, VRR_APP_OVERRIDE_ALLOW},
{VRR_APP_OVERRIDE_REQUEST_STATE_ID, VRR_APP_OVERRIDE_REQUEST_STATE_STRING, 5, (NvU32 *)g_valuesVRR_APP_OVERRIDE_REQUEST_STATE, VRR_APP_OVERRIDE_REQUEST_STATE_ALLOW},
{VRR_MODE_ID, VRR_MODE_STRING, 3, (NvU32 *)g_valuesVRR_MODE, VRR_MODE_FULLSCREEN_ONLY},
{VSYNCSMOOTHAFR_ID, VSYNCSMOOTHAFR_STRING, 2, (NvU32 *)g_valuesVSYNCSMOOTHAFR, VSYNCSMOOTHAFR_OFF},
{VSYNCVRRCONTROL_ID, VSYNCVRRCONTROL_STRING, 3, (NvU32 *)g_valuesVSYNCVRRCONTROL, VSYNCVRRCONTROL_ENABLE},
{VSYNC_BEHAVIOR_FLAGS_ID, VSYNC_BEHAVIOR_FLAGS_STRING, 3, (NvU32 *)g_valuesVSYNC_BEHAVIOR_FLAGS, VSYNC_BEHAVIOR_FLAGS_DEFAULT},
{WKS_API_STEREO_EYES_EXCHANGE_ID, WKS_API_STEREO_EYES_EXCHANGE_STRING, 2, (NvU32 *)g_valuesWKS_API_STEREO_EYES_EXCHANGE, WKS_API_STEREO_EYES_EXCHANGE_OFF},
{WKS_API_STEREO_MODE_ID, WKS_API_STEREO_MODE_STRING, 25, (NvU32 *)g_valuesWKS_API_STEREO_MODE, WKS_API_STEREO_MODE_SHUTTER_GLASSES},
{WKS_STEREO_DONGLE_SUPPORT_ID, WKS_STEREO_DONGLE_SUPPORT_STRING, 3, (NvU32 *)g_valuesWKS_STEREO_DONGLE_SUPPORT, WKS_STEREO_DONGLE_SUPPORT_DAC},
{WKS_STEREO_SUPPORT_ID, WKS_STEREO_SUPPORT_STRING, 2, (NvU32 *)g_valuesWKS_STEREO_SUPPORT, WKS_STEREO_SUPPORT_OFF},
{WKS_STEREO_SWAP_MODE_ID, WKS_STEREO_SWAP_MODE_STRING, 5, (NvU32 *)g_valuesWKS_STEREO_SWAP_MODE, WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL},
{AO_MODE_ID, AO_MODE_STRING, 4, (NvU32 *)g_valuesAO_MODE, AO_MODE_OFF},
{AO_MODE_ACTIVE_ID, AO_MODE_ACTIVE_STRING, 2, (NvU32 *)g_valuesAO_MODE_ACTIVE, AO_MODE_ACTIVE_DISABLED},
{AUTO_LODBIASADJUST_ID, AUTO_LODBIASADJUST_STRING, 2, (NvU32 *)g_valuesAUTO_LODBIASADJUST, AUTO_LODBIASADJUST_ON},
{EXPORT_PERF_COUNTERS_DX9_ONLY_ID, EXPORT_PERF_COUNTERS_DX9_ONLY_STRING, 2, (NvU32 *)g_valuesEXPORT_PERF_COUNTERS_DX9_ONLY, EXPORT_PERF_COUNTERS_DX9_ONLY_OFF},
{LODBIASADJUST_ID, LODBIASADJUST_STRING, 2, (NvU32 *)g_valuesLODBIASADJUST, 0x00000000},
{MAXWELL_B_SAMPLE_INTERLEAVE_ID, MAXWELL_B_SAMPLE_INTERLEAVE_STRING, 2, (NvU32 *)g_valuesMAXWELL_B_SAMPLE_INTERLEAVE, MAXWELL_B_SAMPLE_INTERLEAVE_OFF},
{PRERENDERLIMIT_ID, PRERENDERLIMIT_STRING, 3, (NvU32 *)g_valuesPRERENDERLIMIT, PRERENDERLIMIT_APP_CONTROLLED},
{PS_SHADERDISKCACHE_ID, PS_SHADERDISKCACHE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE, PS_SHADERDISKCACHE_ON},
{PS_SHADERDISKCACHE_MAX_SIZE_ID, PS_SHADERDISKCACHE_MAX_SIZE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE_MAX_SIZE, 0x00000000},
{PS_TEXFILTER_ANISO_OPTS2_ID, PS_TEXFILTER_ANISO_OPTS2_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_ANISO_OPTS2, PS_TEXFILTER_ANISO_OPTS2_OFF},
{PS_TEXFILTER_BILINEAR_IN_ANISO_ID, PS_TEXFILTER_BILINEAR_IN_ANISO_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO, PS_TEXFILTER_BILINEAR_IN_ANISO_OFF},
{PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID, PS_TEXFILTER_DISABLE_TRILIN_SLOPE_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_DISABLE_TRILIN_SLOPE, PS_TEXFILTER_DISABLE_TRILIN_SLOPE_OFF},
{PS_TEXFILTER_NO_NEG_LODBIAS_ID, PS_TEXFILTER_NO_NEG_LODBIAS_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_NO_NEG_LODBIAS, PS_TEXFILTER_NO_NEG_LODBIAS_OFF},
{QUALITY_ENHANCEMENTS_ID, QUALITY_ENHANCEMENTS_STRING, 4, (NvU32 *)g_valuesQUALITY_ENHANCEMENTS, QUALITY_ENHANCEMENTS_QUALITY},
{QUALITY_ENHANCEMENT_SUBSTITUTION_ID, QUALITY_ENHANCEMENT_SUBSTITUTION_STRING, 2, (NvU32 *)g_valuesQUALITY_ENHANCEMENT_SUBSTITUTION, QUALITY_ENHANCEMENT_SUBSTITUTION_NO_SUBSTITUTION},
{REFRESH_RATE_OVERRIDE_ID, REFRESH_RATE_OVERRIDE_STRING, 3, (NvU32 *)g_valuesREFRESH_RATE_OVERRIDE, REFRESH_RATE_OVERRIDE_APPLICATION_CONTROLLED},
{SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID, SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_STRING, 2, (NvU32 *)g_valuesSET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE, SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_OFF},
{SET_VAB_DATA_ID, SET_VAB_DATA_STRING, 6, (NvU32 *)g_valuesSET_VAB_DATA, SET_VAB_DATA_USE_API_DEFAULTS},
{VSYNCMODE_ID, VSYNCMODE_STRING, 7, (NvU32 *)g_valuesVSYNCMODE, VSYNCMODE_PASSIVE},
{VSYNCTEARCONTROL_ID, VSYNCTEARCONTROL_STRING, 2, (NvU32 *)g_valuesVSYNCTEARCONTROL, VSYNCTEARCONTROL_DISABLE},
};
SettingWSTRINGNameString mapSettingWSTRING[TOTAL_WSTRING_SETTING_NUM] =
{
{OGL_IMPLICIT_GPU_AFFINITY_ID, OGL_IMPLICIT_GPU_AFFINITY_STRING, 1, (const wchar_t **)g_valuesOGL_IMPLICIT_GPU_AFFINITY, L"autoselect"},
{CUDA_EXCLUDED_GPUS_ID, CUDA_EXCLUDED_GPUS_STRING, 1, (const wchar_t **)g_valuesCUDA_EXCLUDED_GPUS, L"none"},
{D3DOGL_GPU_MAX_POWER_ID, D3DOGL_GPU_MAX_POWER_STRING, 1, (const wchar_t **)g_valuesD3DOGL_GPU_MAX_POWER, L"0"},
{ICAFE_LOGO_CONFIG_ID, ICAFE_LOGO_CONFIG_STRING, 0, NULL, L""},
{PS_SHADERDISKCACHE_DLL_PATH_WCHAR_ID, PS_SHADERDISKCACHE_DLL_PATH_WCHAR_STRING, 0, NULL, L""},
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,758 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
////////////////////////// NVIDIA SHADER EXTENSIONS /////////////////
// internal functions
// Functions in this file are not expected to be called by apps directly
#include "imports/nvapi/nvShaderExtnEnums.h"
struct NvShaderExtnStruct
{
uint opcode; // opcode
uint rid; // resource ID
uint sid; // sampler ID
uint4 dst1u; // destination operand 1 (for instructions that need extra destination operands)
uint4 src3u; // source operand 3
uint4 src4u; // source operand 4
uint4 src5u; // source operand 5
uint4 src0u; // uint source operand 0
uint4 src1u; // uint source operand 0
uint4 src2u; // uint source operand 0
uint4 dst0u; // uint destination operand
uint markUavRef; // the next store to UAV is fake and is used only to identify the uav slot
uint numOutputsForIncCounter; // Used for output to IncrementCounter
float padding1[27]; // struct size: 256 bytes
};
// RW structured buffer for Nvidia shader extensions
// Application needs to define NV_SHADER_EXTN_SLOT as a unused slot, which should be
// set using NvAPI_D3D11_SetNvShaderExtnSlot() call before creating the first shader that
// uses nvidia shader extensions. E.g before including this file in shader define it as:
// #define NV_SHADER_EXTN_SLOT u7
// For SM5.1, application needs to define NV_SHADER_EXTN_REGISTER_SPACE as register space
// E.g. before including this file in shader define it as:
// #define NV_SHADER_EXTN_REGISTER_SPACE space2
// Note that other operations to this UAV will be ignored so application
// should bind a null resource
#ifdef NV_SHADER_EXTN_REGISTER_SPACE
RWStructuredBuffer<NvShaderExtnStruct> g_NvidiaExt : register( NV_SHADER_EXTN_SLOT, NV_SHADER_EXTN_REGISTER_SPACE );
#else
RWStructuredBuffer<NvShaderExtnStruct> g_NvidiaExt : register( NV_SHADER_EXTN_SLOT );
#endif
//----------------------------------------------------------------------------//
// the exposed SHFL instructions accept a mask parameter in src2
// To compute lane mask from width of segment:
// minLaneID : currentLaneId & src2[12:8]
// maxLaneID : minLaneId | (src2[4:0] & ~src2[12:8])
// where [minLaneId, maxLaneId] defines the segment where currentLaneId belongs
// we always set src2[4:0] to 11111 (0x1F), and set src2[12:8] as (32 - width)
int __NvGetShflMaskFromWidth(uint width)
{
return ((NV_WARP_SIZE - width) << 8) | 0x1F;
}
//----------------------------------------------------------------------------//
void __NvReferenceUAVForOp(RWByteAddressBuffer uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav.Store(index, 0);
}
void __NvReferenceUAVForOp(RWTexture1D<float2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = float2(0,0);
}
void __NvReferenceUAVForOp(RWTexture2D<float2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = float2(0,0);
}
void __NvReferenceUAVForOp(RWTexture3D<float2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = float2(0,0);
}
void __NvReferenceUAVForOp(RWTexture1D<float4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = float4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture2D<float4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = float4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture3D<float4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = float4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture1D<float> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = 0.0f;
}
void __NvReferenceUAVForOp(RWTexture2D<float> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = 0.0f;
}
void __NvReferenceUAVForOp(RWTexture3D<float> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = 0.0f;
}
void __NvReferenceUAVForOp(RWTexture1D<uint2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = uint2(0,0);
}
void __NvReferenceUAVForOp(RWTexture2D<uint2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = uint2(0,0);
}
void __NvReferenceUAVForOp(RWTexture3D<uint2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = uint2(0,0);
}
void __NvReferenceUAVForOp(RWTexture1D<uint4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = uint4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture2D<uint4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = uint4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture3D<uint4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = uint4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture1D<uint> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = 0;
}
void __NvReferenceUAVForOp(RWTexture2D<uint> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = 0;
}
void __NvReferenceUAVForOp(RWTexture3D<uint> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = 0;
}
void __NvReferenceUAVForOp(RWTexture1D<int2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = int2(0,0);
}
void __NvReferenceUAVForOp(RWTexture2D<int2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = int2(0,0);
}
void __NvReferenceUAVForOp(RWTexture3D<int2> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = int2(0,0);
}
void __NvReferenceUAVForOp(RWTexture1D<int4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = int4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture2D<int4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = int4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture3D<int4> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = int4(0,0,0,0);
}
void __NvReferenceUAVForOp(RWTexture1D<int> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[index] = 0;
}
void __NvReferenceUAVForOp(RWTexture2D<int> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint2(index,index)] = 0;
}
void __NvReferenceUAVForOp(RWTexture3D<int> uav)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].markUavRef = 1;
uav[uint3(index,index,index)] = 0;
}
//----------------------------------------------------------------------------//
// ATOMIC op sub-opcodes
#define NV_EXTN_ATOM_AND 0
#define NV_EXTN_ATOM_OR 1
#define NV_EXTN_ATOM_XOR 2
#define NV_EXTN_ATOM_ADD 3
#define NV_EXTN_ATOM_MAX 6
#define NV_EXTN_ATOM_MIN 7
#define NV_EXTN_ATOM_SWAP 8
#define NV_EXTN_ATOM_CAS 9
//----------------------------------------------------------------------------//
// performs Atomic operation on two consecutive fp16 values in the given UAV
// the uint paramater 'fp16x2Val' is treated as two fp16 values
// the passed sub-opcode 'op' should be an immediate constant
// byteAddress must be multiple of 4
// the returned value are the two fp16 values packed into a single uint
uint __NvAtomicOpFP16x2(RWByteAddressBuffer uav, uint byteAddress, uint fp16x2Val, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = byteAddress;
g_NvidiaExt[index].src1u.x = fp16x2Val;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
return g_NvidiaExt[index].dst0u.x;
}
//----------------------------------------------------------------------------//
// performs Atomic operation on a R16G16_FLOAT UAV at the given address
// the uint paramater 'fp16x2Val' is treated as two fp16 values
// the passed sub-opcode 'op' should be an immediate constant
// the returned value are the two fp16 values (.x and .y components) packed into a single uint
// Warning: Behaviour of these set of functions is undefined if the UAV is not
// of R16G16_FLOAT format (might result in app crash or TDR)
uint __NvAtomicOpFP16x2(RWTexture1D<float2> uav, uint address, uint fp16x2Val, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = address;
g_NvidiaExt[index].src1u.x = fp16x2Val;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
return g_NvidiaExt[index].dst0u.x;
}
uint __NvAtomicOpFP16x2(RWTexture2D<float2> uav, uint2 address, uint fp16x2Val, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xy = address;
g_NvidiaExt[index].src1u.x = fp16x2Val;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
return g_NvidiaExt[index].dst0u.x;
}
uint __NvAtomicOpFP16x2(RWTexture3D<float2> uav, uint3 address, uint fp16x2Val, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xyz = address;
g_NvidiaExt[index].src1u.x = fp16x2Val;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
return g_NvidiaExt[index].dst0u.x;
}
//----------------------------------------------------------------------------//
// performs Atomic operation on a R16G16B16A16_FLOAT UAV at the given address
// the uint2 paramater 'fp16x2Val' is treated as four fp16 values
// i.e, fp16x2Val.x = uav.xy and fp16x2Val.y = uav.yz
// the passed sub-opcode 'op' should be an immediate constant
// the returned value are the four fp16 values (.xyzw components) packed into uint2
// Warning: Behaviour of these set of functions is undefined if the UAV is not
// of R16G16B16A16_FLOAT format (might result in app crash or TDR)
uint2 __NvAtomicOpFP16x2(RWTexture1D<float4> uav, uint address, uint2 fp16x2Val, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
// break it down into two fp16x2 atomic ops
uint2 retVal;
// first op has x-coordinate = x * 2
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = address * 2;
g_NvidiaExt[index].src1u.x = fp16x2Val.x;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
retVal.x = g_NvidiaExt[index].dst0u.x;
// second op has x-coordinate = x * 2 + 1
index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = address * 2 + 1;
g_NvidiaExt[index].src1u.x = fp16x2Val.y;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
retVal.y = g_NvidiaExt[index].dst0u.x;
return retVal;
}
uint2 __NvAtomicOpFP16x2(RWTexture2D<float4> uav, uint2 address, uint2 fp16x2Val, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
// break it down into two fp16x2 atomic ops
uint2 retVal;
// first op has x-coordinate = x * 2
uint2 addressTemp = uint2(address.x * 2, address.y);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xy = addressTemp;
g_NvidiaExt[index].src1u.x = fp16x2Val.x;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
retVal.x = g_NvidiaExt[index].dst0u.x;
// second op has x-coordinate = x * 2 + 1
addressTemp.x++;
index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xy = addressTemp;
g_NvidiaExt[index].src1u.x = fp16x2Val.y;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
retVal.y = g_NvidiaExt[index].dst0u.x;
return retVal;
}
uint2 __NvAtomicOpFP16x2(RWTexture3D<float4> uav, uint3 address, uint2 fp16x2Val, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
// break it down into two fp16x2 atomic ops
uint2 retVal;
// first op has x-coordinate = x * 2
uint3 addressTemp = uint3(address.x * 2, address.y, address.z);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xyz = addressTemp;
g_NvidiaExt[index].src1u.x = fp16x2Val.x;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
retVal.x = g_NvidiaExt[index].dst0u.x;
// second op has x-coordinate = x * 2 + 1
addressTemp.x++;
index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xyz = addressTemp;
g_NvidiaExt[index].src1u.x = fp16x2Val.y;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP16_ATOMIC;
retVal.y = g_NvidiaExt[index].dst0u.x;
return retVal;
}
uint __fp32x2Tofp16x2(float2 val)
{
return (f32tof16(val.y)<<16) | f32tof16(val.x) ;
}
uint2 __fp32x4Tofp16x4(float4 val)
{
return uint2( (f32tof16(val.y)<<16) | f32tof16(val.x), (f32tof16(val.w)<<16) | f32tof16(val.z) ) ;
}
//----------------------------------------------------------------------------//
// FP32 Atomic functions
// performs Atomic operation treating the uav as float (fp32) values
// the passed sub-opcode 'op' should be an immediate constant
// byteAddress must be multiple of 4
float __NvAtomicAddFP32(RWByteAddressBuffer uav, uint byteAddress, float val)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = byteAddress;
g_NvidiaExt[index].src1u.x = asuint(val); // passing as uint to make it more convinient for the driver to translate
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC;
return asfloat(g_NvidiaExt[index].dst0u.x);
}
float __NvAtomicAddFP32(RWTexture1D<float> uav, uint address, float val)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = address;
g_NvidiaExt[index].src1u.x = asuint(val);
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC;
return asfloat(g_NvidiaExt[index].dst0u.x);
}
float __NvAtomicAddFP32(RWTexture2D<float> uav, uint2 address, float val)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xy = address;
g_NvidiaExt[index].src1u.x = asuint(val);
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC;
return asfloat(g_NvidiaExt[index].dst0u.x);
}
float __NvAtomicAddFP32(RWTexture3D<float> uav, uint3 address, float val)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xyz = address;
g_NvidiaExt[index].src1u.x = asuint(val);
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_ADD;
g_NvidiaExt[index].opcode = NV_EXTN_OP_FP32_ATOMIC;
return asfloat(g_NvidiaExt[index].dst0u.x);
}
//----------------------------------------------------------------------------//
// UINT64 Atmoic Functions
// The functions below performs atomic operation on the given UAV treating the value as uint64
// byteAddress must be multiple of 8
// The returned value is the value present in memory location before the atomic operation
// uint2 vector type is used to represent a single uint64 value with the x component containing the low 32 bits and y component the high 32 bits.
uint2 __NvAtomicCompareExchangeUINT64(RWByteAddressBuffer uav, uint byteAddress, uint2 compareValue, uint2 value)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = byteAddress;
g_NvidiaExt[index].src1u.xy = compareValue;
g_NvidiaExt[index].src1u.zw = value;
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS;
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
return g_NvidiaExt[index].dst0u.xy;
}
uint2 __NvAtomicOpUINT64(RWByteAddressBuffer uav, uint byteAddress, uint2 value, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = byteAddress;
g_NvidiaExt[index].src1u.xy = value;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
return g_NvidiaExt[index].dst0u.xy;
}
uint2 __NvAtomicCompareExchangeUINT64(RWTexture1D<uint2> uav, uint address, uint2 compareValue, uint2 value)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = address;
g_NvidiaExt[index].src1u.xy = compareValue;
g_NvidiaExt[index].src1u.zw = value;
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS;
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
return g_NvidiaExt[index].dst0u.xy;
}
uint2 __NvAtomicOpUINT64(RWTexture1D<uint2> uav, uint address, uint2 value, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = address;
g_NvidiaExt[index].src1u.xy = value;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
return g_NvidiaExt[index].dst0u.xy;
}
uint2 __NvAtomicCompareExchangeUINT64(RWTexture2D<uint2> uav, uint2 address, uint2 compareValue, uint2 value)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xy = address;
g_NvidiaExt[index].src1u.xy = compareValue;
g_NvidiaExt[index].src1u.zw = value;
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS;
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
return g_NvidiaExt[index].dst0u.xy;
}
uint2 __NvAtomicOpUINT64(RWTexture2D<uint2> uav, uint2 address, uint2 value, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xy = address;
g_NvidiaExt[index].src1u.xy = value;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
return g_NvidiaExt[index].dst0u.xy;
}
uint2 __NvAtomicCompareExchangeUINT64(RWTexture3D<uint2> uav, uint3 address, uint2 compareValue, uint2 value)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xyz = address;
g_NvidiaExt[index].src1u.xy = compareValue;
g_NvidiaExt[index].src1u.zw = value;
g_NvidiaExt[index].src2u.x = NV_EXTN_ATOM_CAS;
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
return g_NvidiaExt[index].dst0u.xy;
}
uint2 __NvAtomicOpUINT64(RWTexture3D<uint2> uav, uint3 address, uint2 value, uint atomicOpType)
{
__NvReferenceUAVForOp(uav);
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.xyz = address;
g_NvidiaExt[index].src1u.xy = value;
g_NvidiaExt[index].src2u.x = atomicOpType;
g_NvidiaExt[index].opcode = NV_EXTN_OP_UINT64_ATOMIC;
return g_NvidiaExt[index].dst0u.xy;
}
uint4 __NvFootprint(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, int3 offset = int3(0, 0, 0))
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = texIndex;
g_NvidiaExt[index].src0u.y = smpIndex;
g_NvidiaExt[index].src1u.xyz = asuint(location);
g_NvidiaExt[index].src1u.w = gran;
g_NvidiaExt[index].src3u.x = texSpace;
g_NvidiaExt[index].src3u.y = smpSpace;
g_NvidiaExt[index].src3u.z = texType;
g_NvidiaExt[index].src3u.w = footprintmode;
g_NvidiaExt[index].src4u.xyz = asuint(offset);
g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT;
g_NvidiaExt[index].numOutputsForIncCounter = 4;
// result is returned as the return value of IncrementCounter on fake UAV slot
uint4 op;
op.x = g_NvidiaExt.IncrementCounter();
op.y = g_NvidiaExt.IncrementCounter();
op.z = g_NvidiaExt.IncrementCounter();
op.w = g_NvidiaExt.IncrementCounter();
return op;
}
uint4 __NvFootprintBias(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float bias, int3 offset = int3(0, 0, 0))
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = texIndex;
g_NvidiaExt[index].src0u.y = smpIndex;
g_NvidiaExt[index].src1u.xyz = asuint(location);
g_NvidiaExt[index].src1u.w = gran;
g_NvidiaExt[index].src2u.x = asuint(bias);
g_NvidiaExt[index].src3u.x = texSpace;
g_NvidiaExt[index].src3u.y = smpSpace;
g_NvidiaExt[index].src3u.z = texType;
g_NvidiaExt[index].src3u.w = footprintmode;
g_NvidiaExt[index].src4u.xyz = asuint(offset);
g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_BIAS;
g_NvidiaExt[index].numOutputsForIncCounter = 4;
// result is returned as the return value of IncrementCounter on fake UAV slot
uint4 op;
op.x = g_NvidiaExt.IncrementCounter();
op.y = g_NvidiaExt.IncrementCounter();
op.z = g_NvidiaExt.IncrementCounter();
op.w = g_NvidiaExt.IncrementCounter();
return op;
}
uint4 __NvFootprintLevel(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float lodLevel, int3 offset = int3(0, 0, 0))
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = texIndex;
g_NvidiaExt[index].src0u.y = smpIndex;
g_NvidiaExt[index].src1u.xyz = asuint(location);
g_NvidiaExt[index].src1u.w = gran;
g_NvidiaExt[index].src2u.x = asuint(lodLevel);
g_NvidiaExt[index].src3u.x = texSpace;
g_NvidiaExt[index].src3u.y = smpSpace;
g_NvidiaExt[index].src3u.z = texType;
g_NvidiaExt[index].src3u.w = footprintmode;
g_NvidiaExt[index].src4u.xyz = asuint(offset);
g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_LEVEL;
g_NvidiaExt[index].numOutputsForIncCounter = 4;
// result is returned as the return value of IncrementCounter on fake UAV slot
uint4 op;
op.x = g_NvidiaExt.IncrementCounter();
op.y = g_NvidiaExt.IncrementCounter();
op.z = g_NvidiaExt.IncrementCounter();
op.w = g_NvidiaExt.IncrementCounter();
return op;
}
uint4 __NvFootprintGrad(uint texSpace, uint texIndex, uint smpSpace, uint smpIndex, uint texType, float3 location, uint footprintmode, uint gran, float3 ddx, float3 ddy, int3 offset = int3(0, 0, 0))
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = texIndex;
g_NvidiaExt[index].src0u.y = smpIndex;
g_NvidiaExt[index].src1u.xyz = asuint(location);
g_NvidiaExt[index].src1u.w = gran;
g_NvidiaExt[index].src2u.xyz = asuint(ddx);
g_NvidiaExt[index].src5u.xyz = asuint(ddy);
g_NvidiaExt[index].src3u.x = texSpace;
g_NvidiaExt[index].src3u.y = smpSpace;
g_NvidiaExt[index].src3u.z = texType;
g_NvidiaExt[index].src3u.w = footprintmode;
g_NvidiaExt[index].src4u.xyz = asuint(offset);
g_NvidiaExt[index].opcode = NV_EXTN_OP_FOOTPRINT_GRAD;
g_NvidiaExt[index].numOutputsForIncCounter = 4;
// result is returned as the return value of IncrementCounter on fake UAV slot
uint4 op;
op.x = g_NvidiaExt.IncrementCounter();
op.y = g_NvidiaExt.IncrementCounter();
op.z = g_NvidiaExt.IncrementCounter();
op.w = g_NvidiaExt.IncrementCounter();
return op;
}
// returns value of special register - specify subopcode from any of NV_SPECIALOP_* specified in nvShaderExtnEnums.h - other opcodes undefined behavior
uint __NvGetSpecial(uint subOpCode)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].opcode = NV_EXTN_OP_GET_SPECIAL;
g_NvidiaExt[index].src0u.x = subOpCode;
return g_NvidiaExt.IncrementCounter();
}
// predicate is returned in laneValid indicating if srcLane is in range and val from specified lane is returned.
int __NvShflGeneric(int val, uint srcLane, uint maskClampVal, out uint laneValid)
{
uint index = g_NvidiaExt.IncrementCounter();
g_NvidiaExt[index].src0u.x = val; // variable to be shuffled
g_NvidiaExt[index].src0u.y = srcLane; // source lane
g_NvidiaExt[index].src0u.z = maskClampVal;
g_NvidiaExt[index].opcode = NV_EXTN_OP_SHFL_GENERIC;
g_NvidiaExt[index].numOutputsForIncCounter = 2;
laneValid = asuint(g_NvidiaExt.IncrementCounter());
return g_NvidiaExt.IncrementCounter();
}

View File

@@ -1,142 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
////////////////////////////////////////////////////////////////////////////////
////////////////////////// NVIDIA SHADER EXTENSIONS ////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// This file can be included both from HLSL shader code as well as C++ code.
// The app should call NvAPI_D3D11_IsNvShaderExtnOpCodeSupported() / NvAPI_D3D12_IsNvShaderExtnOpCodeSupported()
// to check for support for every nv shader extension opcode it plans to use
//----------------------------------------------------------------------------//
//---------------------------- NV Shader Extn Version -----------------------//
//----------------------------------------------------------------------------//
#define NV_SHADER_EXTN_VERSION 1
//----------------------------------------------------------------------------//
//---------------------------- Misc constants --------------------------------//
//----------------------------------------------------------------------------//
#define NV_WARP_SIZE 32
#define NV_WARP_SIZE_LOG2 5
//----------------------------------------------------------------------------//
//---------------------------- opCode constants ------------------------------//
//----------------------------------------------------------------------------//
#define NV_EXTN_OP_SHFL 1
#define NV_EXTN_OP_SHFL_UP 2
#define NV_EXTN_OP_SHFL_DOWN 3
#define NV_EXTN_OP_SHFL_XOR 4
#define NV_EXTN_OP_VOTE_ALL 5
#define NV_EXTN_OP_VOTE_ANY 6
#define NV_EXTN_OP_VOTE_BALLOT 7
#define NV_EXTN_OP_GET_LANE_ID 8
#define NV_EXTN_OP_FP16_ATOMIC 12
#define NV_EXTN_OP_FP32_ATOMIC 13
#define NV_EXTN_OP_GET_SPECIAL 19
#define NV_EXTN_OP_UINT64_ATOMIC 20
#define NV_EXTN_OP_MATCH_ANY 21
// FOOTPRINT - For Sample and SampleBias
#define NV_EXTN_OP_FOOTPRINT 28
#define NV_EXTN_OP_FOOTPRINT_BIAS 29
#define NV_EXTN_OP_GET_SHADING_RATE 30
// FOOTPRINT - For SampleLevel and SampleGrad
#define NV_EXTN_OP_FOOTPRINT_LEVEL 31
#define NV_EXTN_OP_FOOTPRINT_GRAD 32
// SHFL Generic
#define NV_EXTN_OP_SHFL_GENERIC 33
#define NV_EXTN_OP_VPRS_EVAL_ATTRIB_AT_SAMPLE 51
#define NV_EXTN_OP_VPRS_EVAL_ATTRIB_SNAPPED 52
// HitObject API
#define NV_EXTN_OP_HIT_OBJECT_TRACE_RAY 67
#define NV_EXTN_OP_HIT_OBJECT_MAKE_HIT 68
#define NV_EXTN_OP_HIT_OBJECT_MAKE_HIT_WITH_RECORD_INDEX 69
#define NV_EXTN_OP_HIT_OBJECT_MAKE_MISS 70
#define NV_EXTN_OP_HIT_OBJECT_REORDER_THREAD 71
#define NV_EXTN_OP_HIT_OBJECT_INVOKE 72
#define NV_EXTN_OP_HIT_OBJECT_IS_MISS 73
#define NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_ID 74
#define NV_EXTN_OP_HIT_OBJECT_GET_INSTANCE_INDEX 75
#define NV_EXTN_OP_HIT_OBJECT_GET_PRIMITIVE_INDEX 76
#define NV_EXTN_OP_HIT_OBJECT_GET_GEOMETRY_INDEX 77
#define NV_EXTN_OP_HIT_OBJECT_GET_HIT_KIND 78
#define NV_EXTN_OP_HIT_OBJECT_GET_RAY_DESC 79
#define NV_EXTN_OP_HIT_OBJECT_GET_ATTRIBUTES 80
#define NV_EXTN_OP_HIT_OBJECT_GET_SHADER_TABLE_INDEX 81
#define NV_EXTN_OP_HIT_OBJECT_LOAD_LOCAL_ROOT_TABLE_CONSTANT 82
#define NV_EXTN_OP_HIT_OBJECT_IS_HIT 83
#define NV_EXTN_OP_HIT_OBJECT_IS_NOP 84
#define NV_EXTN_OP_HIT_OBJECT_MAKE_NOP 85
// Micro-map API
#define NV_EXTN_OP_RT_TRIANGLE_OBJECT_POSITIONS 86
#define NV_EXTN_OP_RT_MICRO_TRIANGLE_OBJECT_POSITIONS 87
#define NV_EXTN_OP_RT_MICRO_TRIANGLE_BARYCENTRICS 88
#define NV_EXTN_OP_RT_IS_MICRO_TRIANGLE_HIT 89
#define NV_EXTN_OP_RT_IS_BACK_FACING 90
#define NV_EXTN_OP_RT_MICRO_VERTEX_OBJECT_POSITION 91
#define NV_EXTN_OP_RT_MICRO_VERTEX_BARYCENTRICS 92
//----------------------------------------------------------------------------//
//-------------------- GET_SPECIAL subOpCode constants -----------------------//
//----------------------------------------------------------------------------//
#define NV_SPECIALOP_THREADLTMASK 4
#define NV_SPECIALOP_FOOTPRINT_SINGLELOD_PRED 5
#define NV_SPECIALOP_GLOBAL_TIMER_LO 9
#define NV_SPECIALOP_GLOBAL_TIMER_HI 10
//----------------------------------------------------------------------------//
//----------------------------- Texture Types -------------------------------//
//----------------------------------------------------------------------------//
#define NV_EXTN_TEXTURE_1D 2
#define NV_EXTN_TEXTURE_1D_ARRAY 3
#define NV_EXTN_TEXTURE_2D 4
#define NV_EXTN_TEXTURE_2D_ARRAY 5
#define NV_EXTN_TEXTURE_3D 6
#define NV_EXTN_TEXTURE_CUBE 7
#define NV_EXTN_TEXTURE_CUBE_ARRAY 8
//---------------------------------------------------------------------------//
//----------------FOOTPRINT Enums for NvFootprint* extns---------------------//
//---------------------------------------------------------------------------//
#define NV_EXTN_FOOTPRINT_MODE_FINE 0
#define NV_EXTN_FOOTPRINT_MODE_COARSE 1

File diff suppressed because it is too large Load Diff

View File

@@ -1,529 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
#ifndef _NVAPI_INTERFACE_H
#define _NVAPI_INTERFACE_H
struct NVAPI_INTERFACE_TABLE { const char * func; unsigned int id; };
struct NVAPI_INTERFACE_TABLE nvapi_interface_table[] =
{
{ "NvAPI_Initialize", 0x0150e828 },
{ "NvAPI_Unload", 0xd22bdd7e },
{ "NvAPI_GetErrorMessage", 0x6c2d048c },
{ "NvAPI_GetInterfaceVersionString", 0x01053fa5 },
{ "NvAPI_GPU_GetEDID", 0x37d32e69 },
{ "NvAPI_SetView", 0x0957d7b6 },
{ "NvAPI_SetViewEx", 0x06b89e68 },
{ "NvAPI_GetDisplayDriverVersion", 0xf951a4d1 },
{ "NvAPI_SYS_GetDriverAndBranchVersion", 0x2926aaad },
{ "NvAPI_GPU_GetMemoryInfo", 0x07f9b368 },
{ "NvAPI_GPU_GetMemoryInfoEx", 0xc0599498 },
{ "NvAPI_OGL_ExpertModeSet", 0x3805ef7a },
{ "NvAPI_OGL_ExpertModeGet", 0x22ed9516 },
{ "NvAPI_OGL_ExpertModeDefaultsSet", 0xb47a657e },
{ "NvAPI_OGL_ExpertModeDefaultsGet", 0xae921f12 },
{ "NvAPI_EnumPhysicalGPUs", 0xe5ac921f },
{ "NvAPI_EnumTCCPhysicalGPUs", 0xd9930b07 },
{ "NvAPI_EnumLogicalGPUs", 0x48b3ea59 },
{ "NvAPI_GetPhysicalGPUsFromDisplay", 0x34ef9506 },
{ "NvAPI_GetPhysicalGPUFromUnAttachedDisplay", 0x5018ed61 },
{ "NvAPI_GetLogicalGPUFromDisplay", 0xee1370cf },
{ "NvAPI_GetLogicalGPUFromPhysicalGPU", 0xadd604d1 },
{ "NvAPI_GetPhysicalGPUsFromLogicalGPU", 0xaea3fa32 },
{ "NvAPI_GetPhysicalGPUFromGPUID", 0x5380ad1a },
{ "NvAPI_GetGPUIDfromPhysicalGPU", 0x6533ea3e },
{ "NvAPI_GPU_GetShaderSubPipeCount", 0x0be17923 },
{ "NvAPI_GPU_GetGpuCoreCount", 0xc7026a87 },
{ "NvAPI_GPU_GetAllOutputs", 0x7d554f8e },
{ "NvAPI_GPU_GetConnectedOutputs", 0x1730bfc9 },
{ "NvAPI_GPU_GetConnectedSLIOutputs", 0x0680de09 },
{ "NvAPI_GPU_GetConnectedDisplayIds", 0x0078dba2 },
{ "NvAPI_GPU_GetAllDisplayIds", 0x785210a2 },
{ "NvAPI_GPU_GetConnectedOutputsWithLidState", 0xcf8caf39 },
{ "NvAPI_GPU_GetConnectedSLIOutputsWithLidState", 0x96043cc7 },
{ "NvAPI_GPU_GetSystemType", 0xbaaabfcc },
{ "NvAPI_GPU_GetActiveOutputs", 0xe3e89b6f },
{ "NvAPI_GPU_SetEDID", 0xe83d6456 },
{ "NvAPI_GPU_GetOutputType", 0x40a505e4 },
{ "NvAPI_GPU_ValidateOutputCombination", 0x34c9c2d4 },
{ "NvAPI_GPU_GetFullName", 0xceee8e9f },
{ "NvAPI_GPU_GetPCIIdentifiers", 0x2ddfb66e },
{ "NvAPI_GPU_GetGPUType", 0xc33baeb1 },
{ "NvAPI_GPU_GetBusType", 0x1bb18724 },
{ "NvAPI_GPU_GetBusId", 0x1be0b8e5 },
{ "NvAPI_GPU_GetBusSlotId", 0x2a0a350f },
{ "NvAPI_GPU_GetIRQ", 0xe4715417 },
{ "NvAPI_GPU_GetVbiosRevision", 0xacc3da0a },
{ "NvAPI_GPU_GetVbiosOEMRevision", 0x2d43fb31 },
{ "NvAPI_GPU_GetVbiosVersionString", 0xa561fd7d },
{ "NvAPI_GPU_GetAGPAperture", 0x6e042794 },
{ "NvAPI_GPU_GetCurrentAGPRate", 0xc74925a0 },
{ "NvAPI_GPU_GetCurrentPCIEDownstreamWidth", 0xd048c3b1 },
{ "NvAPI_GPU_GetPhysicalFrameBufferSize", 0x46fbeb03 },
{ "NvAPI_GPU_GetVirtualFrameBufferSize", 0x5a04b644 },
{ "NvAPI_GPU_GetQuadroStatus", 0xe332fa47 },
{ "NvAPI_GPU_GetBoardInfo", 0x22d54523 },
{ "NvAPI_GPU_GetRamBusWidth", 0x7975c581 },
{ "NvAPI_GPU_GetArchInfo", 0xd8265d24 },
{ "NvAPI_I2CRead", 0x2fde12c5 },
{ "NvAPI_I2CWrite", 0xe812eb07 },
{ "NvAPI_GPU_WorkstationFeatureSetup", 0x6c1f3fe4 },
{ "NvAPI_GPU_WorkstationFeatureQuery", 0x004537df },
{ "NvAPI_GPU_GetHDCPSupportStatus", 0xf089eef5 },
{ "NvAPI_GPU_CudaEnumComputeCapableGpus", 0x5786cc6e },
{ "NvAPI_GPU_GetTachReading", 0x5f608315 },
{ "NvAPI_GPU_GetECCStatusInfo", 0xca1ddaf3 },
{ "NvAPI_GPU_GetECCErrorInfo", 0xc71f85a6 },
{ "NvAPI_GPU_ResetECCErrorInfo", 0xc02eec20 },
{ "NvAPI_GPU_GetECCConfigurationInfo", 0x77a796f3 },
{ "NvAPI_GPU_SetECCConfiguration", 0x1cf639d9 },
{ "NvAPI_GPU_QueryWorkstationFeatureSupport", 0x80b1abb9 },
{ "NvAPI_GPU_SetScanoutIntensity", 0xa57457a4 },
{ "NvAPI_GPU_GetScanoutIntensityState", 0xe81ce836 },
{ "NvAPI_GPU_SetScanoutWarping", 0xb34bab4f },
{ "NvAPI_GPU_GetScanoutWarpingState", 0x6f5435af },
{ "NvAPI_GPU_SetScanoutCompositionParameter", 0xf898247d },
{ "NvAPI_GPU_GetScanoutCompositionParameter", 0x58fe51e6 },
{ "NvAPI_GPU_GetScanoutConfiguration", 0x6a9f5b63 },
{ "NvAPI_GPU_GetScanoutConfigurationEx", 0xe2e1e6f0 },
{ "NvAPI_GPU_GetAdapterIdFromPhysicalGpu", 0x0ff07fde },
{ "NvAPI_GPU_GetVirtualizationInfo", 0x44e022a9 },
{ "NvAPI_GPU_GetLogicalGpuInfo", 0x842b066e },
{ "NvAPI_GPU_GetLicensableFeatures", 0x3fc596aa },
{ "NvAPI_GPU_NVLINK_GetCaps", 0xbef1119d },
{ "NvAPI_GPU_NVLINK_GetStatus", 0xc72a38e3 },
{ "NvAPI_GPU_GetGPUInfo", 0xafd1b02c },
{ "NvAPI_GPU_GetVRReadyData", 0x81d629c5 },
{ "NvAPI_GPU_GetGspFeatures", 0x581c4391 },
{ "NvAPI_GPU_GetPerfDecreaseInfo", 0x7f7f4600 },
{ "NvAPI_GPU_GetPstatesInfoEx", 0x843c0256 },
{ "NvAPI_GPU_GetPstates20", 0x6ff81213 },
{ "NvAPI_GPU_GetCurrentPstate", 0x927da4f6 },
{ "NvAPI_GPU_GetDynamicPstatesInfoEx", 0x60ded2ed },
{ "NvAPI_GPU_GetThermalSettings", 0xe3640a56 },
{ "NvAPI_GPU_GetAllClockFrequencies", 0xdcb616c3 },
{ "NvAPI_GPU_QueryIlluminationSupport", 0xa629da31 },
{ "NvAPI_GPU_GetIllumination", 0x9a1b9365 },
{ "NvAPI_GPU_SetIllumination", 0x0254a187 },
{ "NvAPI_GPU_ClientIllumDevicesGetInfo", 0xd4100e58 },
{ "NvAPI_GPU_ClientIllumDevicesGetControl", 0x73c01d58 },
{ "NvAPI_GPU_ClientIllumDevicesSetControl", 0x57024c62 },
{ "NvAPI_GPU_ClientIllumZonesGetInfo", 0x4b81241b },
{ "NvAPI_GPU_ClientIllumZonesGetControl", 0x3dbf5764 },
{ "NvAPI_GPU_ClientIllumZonesSetControl", 0x197d065e },
{ "NvAPI_Event_RegisterCallback", 0xe6dbea69 },
{ "NvAPI_Event_UnregisterCallback", 0xde1f9b45 },
{ "NvAPI_EnumNvidiaDisplayHandle", 0x9abdd40d },
{ "NvAPI_EnumNvidiaUnAttachedDisplayHandle", 0x20de9260 },
{ "NvAPI_CreateDisplayFromUnAttachedDisplay", 0x63f9799e },
{ "NvAPI_GetAssociatedNvidiaDisplayHandle", 0x35c29134 },
{ "NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle", 0xa70503b2 },
{ "NvAPI_GetAssociatedNvidiaDisplayName", 0x22a78b05 },
{ "NvAPI_GetUnAttachedAssociatedDisplayName", 0x4888d790 },
{ "NvAPI_EnableHWCursor", 0x2863148d },
{ "NvAPI_DisableHWCursor", 0xab163097 },
{ "NvAPI_GetVBlankCounter", 0x67b5db55 },
{ "NvAPI_SetRefreshRateOverride", 0x3092ac32 },
{ "NvAPI_GetAssociatedDisplayOutputId", 0xd995937e },
{ "NvAPI_GetDisplayPortInfo", 0xc64ff367 },
{ "NvAPI_SetDisplayPort", 0xfa13e65a },
{ "NvAPI_GetHDMISupportInfo", 0x6ae16ec3 },
{ "NvAPI_Disp_InfoFrameControl", 0x6067af3f },
{ "NvAPI_Disp_ColorControl", 0x92f9d80d },
{ "NvAPI_Disp_GetHdrCapabilities", 0x84f2a8df },
{ "NvAPI_Disp_HdrColorControl", 0x351da224 },
{ "NvAPI_Disp_SetSourceColorSpace", 0x473b6caf },
{ "NvAPI_Disp_GetSourceColorSpace", 0xceedc85b },
{ "NvAPI_Disp_SetSourceHdrMetadata", 0x905eb63b },
{ "NvAPI_Disp_GetSourceHdrMetadata", 0x0d3f52da },
{ "NvAPI_Disp_SetOutputMode", 0x98e7661a },
{ "NvAPI_Disp_GetOutputMode", 0x81fed88d },
{ "NvAPI_Disp_SetHdrToneMapping", 0xdd6da362 },
{ "NvAPI_Disp_GetHdrToneMapping", 0xfbd36e71 },
{ "NvAPI_DISP_GetTiming", 0x175167e9 },
{ "NvAPI_DISP_GetMonitorCapabilities", 0x3b05c7e1 },
{ "NvAPI_DISP_GetMonitorColorCapabilities", 0x6ae4cfb5 },
{ "NvAPI_DISP_EnumCustomDisplay", 0xa2072d59 },
{ "NvAPI_DISP_TryCustomDisplay", 0x1f7db630 },
{ "NvAPI_DISP_DeleteCustomDisplay", 0x552e5b9b },
{ "NvAPI_DISP_SaveCustomDisplay", 0x49882876 },
{ "NvAPI_DISP_RevertCustomDisplayTrial", 0xcbbd40f0 },
{ "NvAPI_GetView", 0xd6b99d89 },
{ "NvAPI_GetViewEx", 0xdbbc0af4 },
{ "NvAPI_GetSupportedViews", 0x66fb7fc0 },
{ "NvAPI_DISP_GetDisplayIdByDisplayName", 0xae457190 },
{ "NvAPI_DISP_GetGDIPrimaryDisplayId", 0x1e9d8a31 },
{ "NvAPI_DISP_GetDisplayConfig", 0x11abccf8 },
{ "NvAPI_DISP_SetDisplayConfig", 0x5d8cf8de },
{ "NvAPI_DISP_GetEdidData", 0x436ced76 },
{ "NvAPI_DISP_GetAdaptiveSyncData", 0xb73d1ee9 },
{ "NvAPI_DISP_SetAdaptiveSyncData", 0x3eebba1d },
{ "NvAPI_DISP_GetVirtualRefreshRateData", 0x8c00429a },
{ "NvAPI_DISP_SetVirtualRefreshRateData", 0x5abbe6a3 },
{ "NvAPI_DISP_SetPreferredStereoDisplay", 0xc9d0e25f },
{ "NvAPI_DISP_GetPreferredStereoDisplay", 0x1f6b4666 },
{ "NvAPI_DISP_GetNvManagedDedicatedDisplays", 0xdbdf0cb2 },
{ "NvAPI_DISP_AcquireDedicatedDisplay", 0x47c917ba },
{ "NvAPI_DISP_ReleaseDedicatedDisplay", 0x1247825f },
{ "NvAPI_DISP_GetNvManagedDedicatedDisplayMetadata", 0xd645d80c },
{ "NvAPI_DISP_SetNvManagedDedicatedDisplayMetadata", 0x3d8b129a },
{ "NvAPI_Disp_GetDisplayIdInfo", 0xbae8aa5e },
{ "NvAPI_Disp_GetDisplayIdsFromTarget", 0xe7e5f89e },
{ "NvAPI_Disp_GetVRRInfo", 0xdf8fda57 },
{ "NvAPI_Mosaic_GetSupportedTopoInfo", 0xfdb63c81 },
{ "NvAPI_Mosaic_GetTopoGroup", 0xcb89381d },
{ "NvAPI_Mosaic_GetOverlapLimits", 0x989685f0 },
{ "NvAPI_Mosaic_SetCurrentTopo", 0x9b542831 },
{ "NvAPI_Mosaic_GetCurrentTopo", 0xec32944e },
{ "NvAPI_Mosaic_EnableCurrentTopo", 0x5f1aa66c },
{ "NvAPI_Mosaic_GetDisplayViewportsByResolution", 0xdc6dc8d3 },
{ "NvAPI_Mosaic_SetDisplayGrids", 0x4d959a89 },
{ "NvAPI_Mosaic_ValidateDisplayGrids", 0xcf43903d },
{ "NvAPI_Mosaic_EnumDisplayModes", 0x78db97d7 },
{ "NvAPI_Mosaic_EnumDisplayGrids", 0xdf2887af },
{ "NvAPI_GetSupportedMosaicTopologies", 0x410b5c25 },
{ "NvAPI_GetCurrentMosaicTopology", 0xf60852bd },
{ "NvAPI_SetCurrentMosaicTopology", 0xd54b8989 },
{ "NvAPI_EnableCurrentMosaicTopology", 0x74073cc9 },
{ "NvAPI_GSync_EnumSyncDevices", 0xd9639601 },
{ "NvAPI_GSync_QueryCapabilities", 0x44a3f1d1 },
{ "NvAPI_GSync_GetTopology", 0x4562bc38 },
{ "NvAPI_GSync_SetSyncStateSettings", 0x60acdfdd },
{ "NvAPI_GSync_GetControlParameters", 0x16de1c6a },
{ "NvAPI_GSync_SetControlParameters", 0x8bbff88b },
{ "NvAPI_GSync_AdjustSyncDelay", 0x2d11ff51 },
{ "NvAPI_GSync_GetSyncStatus", 0xf1f5b434 },
{ "NvAPI_GSync_GetStatusParameters", 0x70d404ec },
{ "NvAPI_D3D_GetCurrentSLIState", 0x4b708b54 },
{ "NvAPI_D3D9_RegisterResource", 0xa064bdfc },
{ "NvAPI_D3D9_UnregisterResource", 0xbb2b17aa },
{ "NvAPI_D3D9_AliasSurfaceAsTexture", 0xe5ceae41 },
{ "NvAPI_D3D9_StretchRectEx", 0x22de03aa },
{ "NvAPI_D3D9_ClearRT", 0x332d3942 },
{ "NvAPI_D3D_GetObjectHandleForResource", 0xfceac864 },
{ "NvAPI_D3D_SetResourceHint", 0x6c0ed98c },
{ "NvAPI_D3D_BeginResourceRendering", 0x91123d6a },
{ "NvAPI_D3D_EndResourceRendering", 0x37e7191c },
{ "NvAPI_D3D9_GetSurfaceHandle", 0x0f2dd3f2 },
{ "NvAPI_D3D9_VideoSetStereoInfo", 0xb852f4db },
{ "NvAPI_D3D10_SetDepthBoundsTest", 0x4eadf5d2 },
{ "NvAPI_D3D11_CreateDevice", 0x6a16d3a0 },
{ "NvAPI_D3D11_CreateDeviceAndSwapChain", 0xbb939ee5 },
{ "NvAPI_D3D11_SetDepthBoundsTest", 0x7aaf7a04 },
{ "NvAPI_D3D11_IsNvShaderExtnOpCodeSupported", 0x5f68da40 },
{ "NvAPI_D3D11_SetNvShaderExtnSlot", 0x8e90bb9f },
{ "NvAPI_D3D12_SetNvShaderExtnSlotSpace", 0xac2dfeb5 },
{ "NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread", 0x43d867c0 },
{ "NvAPI_D3D11_SetNvShaderExtnSlotLocalThread", 0x0e6482a0 },
{ "NvAPI_D3D11_BeginUAVOverlapEx", 0xba08208a },
{ "NvAPI_D3D11_BeginUAVOverlap", 0x65b93ca8 },
{ "NvAPI_D3D11_EndUAVOverlap", 0x2216a357 },
{ "NvAPI_D3D11_GetResourceHandle", 0x09d52986 },
{ "NvAPI_D3D_SetFPSIndicatorState", 0xa776e8db },
{ "NvAPI_D3D9_Present", 0x05650beb },
{ "NvAPI_D3D9_QueryFrameCount", 0x9083e53a },
{ "NvAPI_D3D9_ResetFrameCount", 0xfa6a0675 },
{ "NvAPI_D3D9_QueryMaxSwapGroup", 0x5995410d },
{ "NvAPI_D3D9_QuerySwapGroup", 0xeba4d232 },
{ "NvAPI_D3D9_JoinSwapGroup", 0x7d44bb54 },
{ "NvAPI_D3D9_BindSwapBarrier", 0x9c39c246 },
{ "NvAPI_D3D_SetVerticalSyncMode", 0x5526cfd1 },
{ "NvAPI_D3D1x_Present", 0x03b845a1 },
{ "NvAPI_D3D1x_QueryFrameCount", 0x9152e055 },
{ "NvAPI_D3D1x_ResetFrameCount", 0xfbbb031a },
{ "NvAPI_D3D1x_QueryMaxSwapGroup", 0x9bb9d68f },
{ "NvAPI_D3D1x_QuerySwapGroup", 0x407f67aa },
{ "NvAPI_D3D1x_JoinSwapGroup", 0x14610cd7 },
{ "NvAPI_D3D1x_BindSwapBarrier", 0x9de8c729 },
{ "NvAPI_D3D12_QueryPresentBarrierSupport", 0xa15faef7 },
{ "NvAPI_D3D12_CreatePresentBarrierClient", 0x4d815de9 },
{ "NvAPI_D3D12_RegisterPresentBarrierResources", 0xd53c9ef0 },
{ "NvAPI_DestroyPresentBarrierClient", 0x3c5c351b },
{ "NvAPI_JoinPresentBarrier", 0x17f6bf82 },
{ "NvAPI_LeavePresentBarrier", 0xc3ec5a7f },
{ "NvAPI_QueryPresentBarrierFrameStatistics", 0x61b844a1 },
{ "NvAPI_D3D12_CreateDDisplayPresentBarrierClient", 0xb5a21987 },
{ "NvAPI_D3D11_CreateRasterizerState", 0xdb8d28af },
{ "NvAPI_D3D_ConfigureAnsel", 0x341c6c7f },
{ "NvAPI_D3D11_CreateTiledTexture2DArray", 0x7886981a },
{ "NvAPI_D3D11_CheckFeatureSupport", 0x106a487e },
{ "NvAPI_D3D11_CreateImplicitMSAATexture2D", 0xb8f79632 },
{ "NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D", 0x24c6a07b },
{ "NvAPI_D3D11_ResolveSubresourceRegion", 0xe6bfedd6 },
{ "NvAPI_D3D12_ResolveSubresourceRegion", 0xc24a15bf },
{ "NvAPI_D3D11_TiledTexture2DArrayGetDesc", 0xf1a2b9d5 },
{ "NvAPI_D3D11_UpdateTileMappings", 0x9a06ea07 },
{ "NvAPI_D3D11_CopyTileMappings", 0xc09ee6bc },
{ "NvAPI_D3D11_TiledResourceBarrier", 0xd6839099 },
{ "NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA", 0xf1c54fc9 },
{ "NvAPI_D3D11_CreateGeometryShaderEx_2", 0x99ed5c1c },
{ "NvAPI_D3D11_CreateVertexShaderEx", 0x0beaa0b2 },
{ "NvAPI_D3D11_CreateHullShaderEx", 0xb53cab00 },
{ "NvAPI_D3D11_CreateDomainShaderEx", 0xa0d7180d },
{ "NvAPI_D3D11_CreatePixelShaderEx_2", 0x4162822b },
{ "NvAPI_D3D11_CreateFastGeometryShaderExplicit", 0x71ab7c9c },
{ "NvAPI_D3D11_CreateFastGeometryShader", 0x525d43be },
{ "NvAPI_D3D11_DecompressView", 0x3a94e822 },
{ "NvAPI_D3D12_CreateGraphicsPipelineState", 0x2fc28856 },
{ "NvAPI_D3D12_CreateComputePipelineState", 0x2762deac },
{ "NvAPI_D3D12_SetDepthBoundsTestValues", 0xb9333fe9 },
{ "NvAPI_D3D12_CreateReservedResource", 0x2c85f101 },
{ "NvAPI_D3D12_CreateHeap", 0x5cb397cf },
{ "NvAPI_D3D12_CreateHeap2", 0x924be9d6 },
{ "NvAPI_D3D12_QueryCpuVisibleVidmem", 0x26322bc3 },
{ "NvAPI_D3D12_ReservedResourceGetDesc", 0x9aa2aabb },
{ "NvAPI_D3D12_UpdateTileMappings", 0xc6017a7d },
{ "NvAPI_D3D12_CopyTileMappings", 0x47f78194 },
{ "NvAPI_D3D12_ResourceAliasingBarrier", 0xb942bab7 },
{ "NvAPI_D3D12_CaptureUAVInfo", 0x6e5ea9db },
{ "NvAPI_D3D11_GetResourceGPUVirtualAddressEx", 0xaf6d14da },
{ "NvAPI_D3D11_EnumerateMetaCommands", 0xc7453ba8 },
{ "NvAPI_D3D11_CreateMetaCommand", 0xf505fba0 },
{ "NvAPI_D3D11_InitializeMetaCommand", 0xaec629e9 },
{ "NvAPI_D3D11_ExecuteMetaCommand", 0x82236c47 },
{ "NvAPI_D3D12_EnumerateMetaCommands", 0xcd9141d8 },
{ "NvAPI_D3D12_CreateMetaCommand", 0xeb29634b },
{ "NvAPI_D3D12_InitializeMetaCommand", 0xa4125399 },
{ "NvAPI_D3D12_ExecuteMetaCommand", 0xde24fc3d },
{ "NvAPI_D3D12_CreateCommittedResource", 0x027e98ae },
{ "NvAPI_D3D12_GetCopyableFootprints", 0xf6305eb5 },
{ "NvAPI_D3D12_CopyTextureRegion", 0x82b91b25 },
{ "NvAPI_D3D12_IsNvShaderExtnOpCodeSupported", 0x3dfacec8 },
{ "NvAPI_D3D12_GetOptimalThreadCountForMesh", 0xb43995cb },
{ "NvAPI_D3D_IsGSyncCapable", 0x9c1eed78 },
{ "NvAPI_D3D_IsGSyncActive", 0xe942b0ff },
{ "NvAPI_D3D1x_DisableShaderDiskCache", 0xd0cbca7d },
{ "NvAPI_D3D11_MultiGPU_GetCaps", 0xd2d25687 },
{ "NvAPI_D3D11_MultiGPU_Init", 0x017be49e },
{ "NvAPI_D3D11_CreateMultiGPUDevice", 0xbdb20007 },
{ "NvAPI_D3D_QuerySinglePassStereoSupport", 0x6f5f0a6d },
{ "NvAPI_D3D_SetSinglePassStereoMode", 0xa39e6e6e },
{ "NvAPI_D3D12_QuerySinglePassStereoSupport", 0x3b03791b },
{ "NvAPI_D3D12_SetSinglePassStereoMode", 0x83556d87 },
{ "NvAPI_D3D_QueryMultiViewSupport", 0xb6e0a41c },
{ "NvAPI_D3D_SetMultiViewMode", 0x8285c8da },
{ "NvAPI_D3D_QueryModifiedWSupport", 0xcbf9f4f5 },
{ "NvAPI_D3D_SetModifiedWMode", 0x06ea4bf4 },
{ "NvAPI_D3D12_QueryModifiedWSupport", 0x51235248 },
{ "NvAPI_D3D12_SetModifiedWMode", 0xe1fdaba7 },
{ "NvAPI_D3D_CreateLateLatchObject", 0x2db27d09 },
{ "NvAPI_D3D_QueryLateLatchSupport", 0x8ceca0ec },
{ "NvAPI_D3D_RegisterDevice", 0x8c02c4d0 },
{ "NvAPI_D3D11_MultiDrawInstancedIndirect", 0xd4e26bbf },
{ "NvAPI_D3D11_MultiDrawIndexedInstancedIndirect", 0x59e890f9 },
{ "NvAPI_D3D_ImplicitSLIControl", 0x2aede111 },
{ "NvAPI_D3D12_GetNeedsAppFPBlendClamping", 0x6ef4d2d1 },
{ "NvAPI_D3D12_UseDriverHeapPriorities", 0xf0d978a8 },
{ "NvAPI_D3D12_Mosaic_GetCompanionAllocations", 0xa46022c7 },
{ "NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions", 0xb092b818 },
{ "NvAPI_D3D1x_GetGraphicsCapabilities", 0x52b1499a },
{ "NvAPI_D3D12_GetGraphicsCapabilities", 0x01e87354 },
{ "NvAPI_D3D11_RSSetExclusiveScissorRects", 0xae4d73ef },
{ "NvAPI_D3D11_RSSetViewportsPixelShadingRates", 0x34f7938f },
{ "NvAPI_D3D11_CreateShadingRateResourceView", 0x99ca2dff },
{ "NvAPI_D3D11_RSSetShadingRateResourceView", 0x1b0c2f83 },
{ "NvAPI_D3D11_RSGetPixelShadingRateSampleOrder", 0x092442a1 },
{ "NvAPI_D3D11_RSSetPixelShadingRateSampleOrder", 0xa942373a },
{ "NvAPI_D3D_InitializeVRSHelper", 0x4780d70b },
{ "NvAPI_D3D_InitializeNvGazeHandler", 0x5b3b7479 },
{ "NvAPI_D3D_InitializeSMPAssist", 0x42763d0c },
{ "NvAPI_D3D_QuerySMPAssistSupport", 0xc57921de },
{ "NvAPI_D3D_GetSleepStatus", 0xaef96ca1 },
{ "NvAPI_D3D_SetSleepMode", 0xac1ca9e0 },
{ "NvAPI_D3D_Sleep", 0x852cd1d2 },
{ "NvAPI_D3D_SetReflexSync", 0xb9f6faff },
{ "NvAPI_D3D_GetLatency", 0x1a587f9c },
{ "NvAPI_D3D_SetLatencyMarker", 0xd9984c05 },
{ "NvAPI_D3D12_SetAsyncFrameMarker", 0x13c98f73 },
{ "NvAPI_D3D11_SetAsyncFrameMarker", 0x59c2c510 },
{ "NvAPI_D3D12_NotifyOutOfBandCommandQueue", 0x03d6e8cb },
{ "NvAPI_D3D12_SetCreateCommandQueueLowLatencyHint", 0x548c224f },
{ "NvAPI_D3D12_CreateCubinComputeShaderExV2", 0x299f5fdc },
{ "NvAPI_D3D12_CreateCubinComputeShader", 0x2a2c79e8 },
{ "NvAPI_D3D12_CreateCubinComputeShaderEx", 0x3151211b },
{ "NvAPI_D3D12_CreateCubinComputeShaderWithName", 0x1dc7261f },
{ "NvAPI_D3D12_LaunchCubinShader", 0x5c52bb86 },
{ "NvAPI_D3D12_DestroyCubinComputeShader", 0x7fb785ba },
{ "NvAPI_D3D12_GetCudaMergedTextureSamplerObject", 0x329fe6e0 },
{ "NvAPI_D3D12_GetCudaIndependentDescriptorObject", 0x0ddac234 },
{ "NvAPI_D3D12_GetCudaTextureObject", 0x80403fc9 },
{ "NvAPI_D3D12_GetCudaSurfaceObject", 0x48f5b2ee },
{ "NvAPI_D3D12_IsFatbinPTXSupported", 0x70c07832 },
{ "NvAPI_D3D12_CreateCuModule", 0xad1a677d },
{ "NvAPI_D3D12_EnumFunctionsInModule", 0x7ab88d88 },
{ "NvAPI_D3D12_CreateCuFunction", 0xe2436e22 },
{ "NvAPI_D3D12_LaunchCuKernelChain", 0x24973538 },
{ "NvAPI_D3D12_LaunchCuKernelChainEx", 0x846a9bf0 },
{ "NvAPI_D3D12_DestroyCuModule", 0x41c65285 },
{ "NvAPI_D3D12_DestroyCuFunction", 0xdf295ea6 },
{ "NvAPI_D3D11_CreateCubinComputeShader", 0x0ed98181 },
{ "NvAPI_D3D11_CreateCubinComputeShaderEx", 0x32c2a0f6 },
{ "NvAPI_D3D11_CreateCubinComputeShaderWithName", 0xb672be19 },
{ "NvAPI_D3D11_LaunchCubinShader", 0x427e236d },
{ "NvAPI_D3D11_DestroyCubinComputeShader", 0x01682c86 },
{ "NvAPI_D3D11_IsFatbinPTXSupported", 0x6086bd93 },
{ "NvAPI_D3D11_CreateUnorderedAccessView", 0x74a497a1 },
{ "NvAPI_D3D11_CreateShaderResourceView", 0x65cb431e },
{ "NvAPI_D3D11_CreateSamplerState", 0x89eca416 },
{ "NvAPI_D3D11_GetCudaTextureObject", 0x9006fa68 },
{ "NvAPI_D3D11_GetResourceGPUVirtualAddress", 0x1819b423 },
{ "NvAPI_D3D12_GetRaytracingCaps", 0x85a6c2a0 },
{ "NvAPI_D3D12_EnableRaytracingValidation", 0x1de5991b },
{ "NvAPI_D3D12_RegisterRaytracingValidationMessageCallback", 0x8554eb38 },
{ "NvAPI_D3D12_UnregisterRaytracingValidationMessageCallback", 0x26975da6 },
{ "NvAPI_D3D12_FlushRaytracingValidationMessages", 0xb8fb1fcb },
{ "NvAPI_D3D12_GetRaytracingDisplacementMicromapArrayPrebuildInfo", 0xfa99b6de },
{ "NvAPI_D3D12_GetRaytracingOpacityMicromapArrayPrebuildInfo", 0x4726d180 },
{ "NvAPI_D3D12_SetCreatePipelineStateOptions", 0x5c607a27 },
{ "NvAPI_D3D12_CheckDriverMatchingIdentifierEx", 0xafb237d4 },
{ "NvAPI_D3D12_GetRaytracingAccelerationStructurePrebuildInfoEx", 0x8d025b77 },
{ "NvAPI_D3D12_BuildRaytracingOpacityMicromapArray", 0x814f8d11 },
{ "NvAPI_D3D12_RelocateRaytracingOpacityMicromapArray", 0x0425c538 },
{ "NvAPI_D3D12_BuildRaytracingDisplacementMicromapArray", 0x066f569d },
{ "NvAPI_D3D12_RelocateRaytracingDisplacementMicromapArray", 0x1c142308 },
{ "NvAPI_D3D12_EmitRaytracingDisplacementMicromapArrayPostbuildInfo", 0x68b9a790 },
{ "NvAPI_D3D12_EmitRaytracingOpacityMicromapArrayPostbuildInfo", 0x1d9a39b6 },
{ "NvAPI_D3D12_BuildRaytracingAccelerationStructureEx", 0xe24ead45 },
{ "NvAPI_D3D12_QueryWorkstationFeatureProperties", 0xa92ea23a },
{ "NvAPI_D3D12_CreateCommittedRDMABuffer", 0xe78dcb44 },
{ "NvAPI_DirectD3D12GraphicsCommandList_Create", 0x74a4e712 },
{ "NvAPI_DirectD3D12GraphicsCommandList_Release", 0x99da3dde },
{ "NvAPI_DirectD3D12GraphicsCommandList_Reset", 0x999c26d8 },
{ "NvAPI_VIO_GetCapabilities", 0x1dc91303 },
{ "NvAPI_VIO_Open", 0x44ee4841 },
{ "NvAPI_VIO_Close", 0xd01bd237 },
{ "NvAPI_VIO_Status", 0x0e6ce4f1 },
{ "NvAPI_VIO_SyncFormatDetect", 0x118d48a3 },
{ "NvAPI_VIO_GetConfig", 0xd34a789b },
{ "NvAPI_VIO_SetConfig", 0x0e4eec07 },
{ "NvAPI_VIO_SetCSC", 0xa1ec8d74 },
{ "NvAPI_VIO_GetCSC", 0x7b0d72a3 },
{ "NvAPI_VIO_SetGamma", 0x964bf452 },
{ "NvAPI_VIO_GetGamma", 0x51d53d06 },
{ "NvAPI_VIO_SetSyncDelay", 0x2697a8d1 },
{ "NvAPI_VIO_GetSyncDelay", 0x462214a9 },
{ "NvAPI_VIO_GetPCIInfo", 0xb981d935 },
{ "NvAPI_VIO_IsRunning", 0x96bd040e },
{ "NvAPI_VIO_Start", 0xcde8e1a3 },
{ "NvAPI_VIO_Stop", 0x6ba2a5d6 },
{ "NvAPI_VIO_IsFrameLockModeCompatible", 0x7bf0a94d },
{ "NvAPI_VIO_EnumDevices", 0xfd7c5557 },
{ "NvAPI_VIO_QueryTopology", 0x869534e2 },
{ "NvAPI_VIO_EnumSignalFormats", 0xead72fe4 },
{ "NvAPI_VIO_EnumDataFormats", 0x221fa8e8 },
{ "NvAPI_Stereo_CreateConfigurationProfileRegistryKey", 0xbe7692ec },
{ "NvAPI_Stereo_DeleteConfigurationProfileRegistryKey", 0xf117b834 },
{ "NvAPI_Stereo_SetConfigurationProfileValue", 0x24409f48 },
{ "NvAPI_Stereo_DeleteConfigurationProfileValue", 0x49bceecf },
{ "NvAPI_Stereo_Enable", 0x239c4545 },
{ "NvAPI_Stereo_Disable", 0x2ec50c2b },
{ "NvAPI_Stereo_IsEnabled", 0x348ff8e1 },
{ "NvAPI_Stereo_GetStereoSupport", 0x296c434d },
{ "NvAPI_Stereo_CreateHandleFromIUnknown", 0xac7e37f4 },
{ "NvAPI_Stereo_DestroyHandle", 0x3a153134 },
{ "NvAPI_Stereo_Activate", 0xf6a1ad68 },
{ "NvAPI_Stereo_Deactivate", 0x2d68de96 },
{ "NvAPI_Stereo_IsActivated", 0x1fb0bc30 },
{ "NvAPI_Stereo_GetSeparation", 0x451f2134 },
{ "NvAPI_Stereo_SetSeparation", 0x5c069fa3 },
{ "NvAPI_Stereo_DecreaseSeparation", 0xda044458 },
{ "NvAPI_Stereo_IncreaseSeparation", 0xc9a8ecec },
{ "NvAPI_Stereo_GetConvergence", 0x4ab00934 },
{ "NvAPI_Stereo_SetConvergence", 0x3dd6b54b },
{ "NvAPI_Stereo_DecreaseConvergence", 0x4c87e317 },
{ "NvAPI_Stereo_IncreaseConvergence", 0xa17daabe },
{ "NvAPI_Stereo_GetFrustumAdjustMode", 0xe6839b43 },
{ "NvAPI_Stereo_SetFrustumAdjustMode", 0x7be27fa2 },
{ "NvAPI_Stereo_CaptureJpegImage", 0x932cb140 },
{ "NvAPI_Stereo_InitActivation", 0xc7177702 },
{ "NvAPI_Stereo_Trigger_Activation", 0x0d6c6cd2 },
{ "NvAPI_Stereo_CapturePngImage", 0x8b7e99b5 },
{ "NvAPI_Stereo_ReverseStereoBlitControl", 0x3cd58f89 },
{ "NvAPI_Stereo_SetNotificationMessage", 0x6b9b409e },
{ "NvAPI_Stereo_SetActiveEye", 0x96eea9f8 },
{ "NvAPI_Stereo_SetDriverMode", 0x5e8f0bec },
{ "NvAPI_Stereo_GetEyeSeparation", 0xce653127 },
{ "NvAPI_Stereo_IsWindowedModeSupported", 0x40c8ed5e },
{ "NvAPI_Stereo_SetSurfaceCreationMode", 0xf5dcfcba },
{ "NvAPI_Stereo_GetSurfaceCreationMode", 0x36f1c736 },
{ "NvAPI_Stereo_Debug_WasLastDrawStereoized", 0xed4416c5 },
{ "NvAPI_Stereo_SetDefaultProfile", 0x44f0ecd1 },
{ "NvAPI_Stereo_GetDefaultProfile", 0x624e21c2 },
{ "NvAPI_D3D1x_CreateSwapChain", 0x1bc21b66 },
{ "NvAPI_D3D9_CreateSwapChain", 0x1a131e09 },
{ "NvAPI_Vulkan_InitLowLatencyDevice", 0x5c1696b6 },
{ "NvAPI_Vulkan_DestroyLowLatencyDevice", 0x11a5932b },
{ "NvAPI_Vulkan_GetSleepStatus", 0xadf966af },
{ "NvAPI_Vulkan_SetSleepMode", 0x2acfd162 },
{ "NvAPI_Vulkan_Sleep", 0x36732b1e },
{ "NvAPI_Vulkan_GetLatency", 0x3233d44a },
{ "NvAPI_Vulkan_SetLatencyMarker", 0xa17d13d6 },
{ "NvAPI_Vulkan_NotifyOutOfBandVkQueue", 0x5d6d3840 },
{ "NvAPI_DRS_CreateSession", 0x0694d52e },
{ "NvAPI_DRS_DestroySession", 0xdad9cff8 },
{ "NvAPI_DRS_LoadSettings", 0x375dbd6b },
{ "NvAPI_DRS_SaveSettings", 0xfcbc7e14 },
{ "NvAPI_DRS_LoadSettingsFromFile", 0xd3ede889 },
{ "NvAPI_DRS_SaveSettingsToFile", 0x2be25df8 },
{ "NvAPI_DRS_CreateProfile", 0xcc176068 },
{ "NvAPI_DRS_DeleteProfile", 0x17093206 },
{ "NvAPI_DRS_SetCurrentGlobalProfile", 0x1c89c5df },
{ "NvAPI_DRS_GetCurrentGlobalProfile", 0x617bff9f },
{ "NvAPI_DRS_GetProfileInfo", 0x61cd6fd6 },
{ "NvAPI_DRS_SetProfileInfo", 0x16abd3a9 },
{ "NvAPI_DRS_FindProfileByName", 0x7e4a9a0b },
{ "NvAPI_DRS_EnumProfiles", 0xbc371ee0 },
{ "NvAPI_DRS_GetNumProfiles", 0x1dae4fbc },
{ "NvAPI_DRS_CreateApplication", 0x4347a9de },
{ "NvAPI_DRS_DeleteApplicationEx", 0xc5ea85a1 },
{ "NvAPI_DRS_DeleteApplication", 0x2c694bc6 },
{ "NvAPI_DRS_GetApplicationInfo", 0xed1f8c69 },
{ "NvAPI_DRS_EnumApplications", 0x7fa2173a },
{ "NvAPI_DRS_FindApplicationByName", 0xeee566b2 },
{ "NvAPI_DRS_SetSetting", 0x577dd202 },
{ "NvAPI_DRS_GetSetting", 0x73bf8338 },
{ "NvAPI_DRS_EnumSettings", 0xae3039da },
{ "NvAPI_DRS_EnumAvailableSettingIds", 0xf020614a },
{ "NvAPI_DRS_EnumAvailableSettingValues", 0x2ec39f90 },
{ "NvAPI_DRS_GetSettingIdFromName", 0xcb7309cd },
{ "NvAPI_DRS_GetSettingNameFromId", 0xd61cbe6e },
{ "NvAPI_DRS_DeleteProfileSetting", 0xe4a26362 },
{ "NvAPI_DRS_RestoreAllDefaults", 0x5927b094 },
{ "NvAPI_DRS_RestoreProfileDefault", 0xfa5f6134 },
{ "NvAPI_DRS_RestoreProfileDefaultSetting", 0x53f0381e },
{ "NvAPI_DRS_GetBaseProfile", 0xda8466a0 },
{ "NvAPI_SYS_GetChipSetInfo", 0x53dabbca },
{ "NvAPI_SYS_GetLidAndDockInfo", 0xcda14d8a },
{ "NvAPI_SYS_GetDisplayIdFromGpuAndOutputId", 0x08f2bab4 },
{ "NvAPI_SYS_GetGpuAndOutputIdFromDisplayId", 0x112ba1a5 },
{ "NvAPI_SYS_GetPhysicalGpuFromDisplayId", 0x9ea74659 },
{ "NvAPI_SYS_GetDisplayDriverInfo", 0x721faceb },
{ "NvAPI_SYS_GetPhysicalGPUs", 0xd3b24d2d },
{ "NvAPI_SYS_GetLogicalGPUs", 0xccfffc10 },
{ "NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates", 0xadeeaf67 },
};
#endif // _NVAPI_INTERFACE_H

View File

@@ -1,659 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
#pragma once
#include"imports/nvapi/nvapi_lite_salstart.h"
#pragma pack(push,8)
#ifdef __cplusplus
extern "C" {
#endif
#if (defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER) && (_MSC_VER > 1399) && !defined(NVAPI_INTERNAL) && !defined(NVAPI_DEPRECATED_OLD)
#ifndef __nvapi_deprecated_function
#define __nvapi_deprecated_function(message) __declspec(deprecated(message))
#endif
#ifndef __nvapi_deprecated_datatype
#define __nvapi_deprecated_datatype(FirstRelease) __declspec(deprecated("Do not use this data type - it is deprecated in release " #FirstRelease "."))
#endif
#else
#ifndef __nvapi_deprecated_function
#define __nvapi_deprecated_function(message)
#endif
#ifndef __nvapi_deprecated_datatype
#define __nvapi_deprecated_datatype(FirstRelease)
#endif
#endif
/* 64-bit types for compilers that support them, plus some obsolete variants */
#if defined(__GNUC__) || defined(__arm) || defined(__IAR_SYSTEMS_ICC__) || defined(__ghs__) || defined(_WIN64)
typedef unsigned long long NvU64; /* 0 to 18446744073709551615 */
typedef long long NvS64; /* -9223372036854775808 to 9223372036854775807 */
#else
typedef unsigned __int64 NvU64; /* 0 to 18446744073709551615 */
typedef __int64 NvS64; /* -9223372036854775808 to 9223372036854775807 */
#endif
#if NVAPI_USE_STDINT
typedef uint32_t NvV32; /* "void": enumerated or multiple fields */
typedef uint32_t NvU32; /* 0 to 4294967295 */
typedef int32_t NvS32; /* -2147483648 to 2147483647 */
#else
// mac os 32-bit still needs this
#if (defined(macintosh) || defined(__APPLE__)) && !defined(__LP64__)
typedef signed long NvS32; /* -2147483648 to 2147483647 */
#else
typedef signed int NvS32; /* -2147483648 to 2147483647 */
#endif
#if !(NVOS_IS_UNIX || (defined(__unix)))
// mac os 32-bit still needs this
#if ( (defined(macintosh) && defined(__LP64__) && (__NVAPI_RESERVED0__)) || \
(!defined(macintosh) && defined(__NVAPI_RESERVED0__)) )
typedef unsigned int NvU32; /* 0 to 4294967295 */
#else
typedef unsigned long NvU32; /* 0 to 4294967295 */
#endif
#else
typedef unsigned int NvU32; /* 0 to 4294967295 */
#endif
#endif
typedef unsigned long temp_NvU32; /* 0 to 4294967295 */
typedef signed short NvS16;
typedef unsigned short NvU16;
typedef unsigned char NvU8;
typedef signed char NvS8;
typedef float NvF32;
typedef double NvF64;
/*!
* Macro to convert NvU32 to NvF32.
*/
#define NvU32TONvF32(_pData) *(NvF32 *)(_pData)
/*!
* Macro to convert NvF32 to NvU32.
*/
#define NvF32TONvU32(_pData) *(NvU32 *)(_pData)
/* Boolean type */
typedef NvU8 NvBool;
#define NV_TRUE ((NvBool)(0 == 0))
#define NV_FALSE ((NvBool)(0 != 0))
typedef struct _NV_RECT
{
NvU32 left;
NvU32 top;
NvU32 right;
NvU32 bottom;
} NV_RECT;
#define NV_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
//! \addtogroup nvapihandles
//! NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI
//! These are meant to be opaque types. Do not assume they correspond to indices, HDCs,
//! display indexes or anything else.
//!
//! Most handles remain valid until a display re-configuration (display mode set) or GPU
//! reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED
//! is received by an app, it should discard all handles, and re-enumerate them.
//! @{
NV_DECLARE_HANDLE(NvLogicalGpuHandle); //!< One or more physical GPUs acting in concert (SLI)
NV_DECLARE_HANDLE(NvPhysicalGpuHandle); //!< A single physical GPU
NV_DECLARE_HANDLE(NvDisplayHandle); //!< Display Device driven by NVIDIA GPU(s) (an attached display)
NV_DECLARE_HANDLE(NvMonitorHandle); //!< Monitor handle
NV_DECLARE_HANDLE(NvUnAttachedDisplayHandle); //!< Unattached Display Device driven by NVIDIA GPU(s)
NV_DECLARE_HANDLE(NvVisualComputingDeviceHandle); //!< A handle to a Visual Computing Device
NV_DECLARE_HANDLE(NvEventHandle); //!< A handle to an event registration instance
NV_DECLARE_HANDLE(NvHICHandle); //!< A handle to a Host Interface Card
NV_DECLARE_HANDLE(NvGSyncDeviceHandle); //!< A handle to a Sync device
NV_DECLARE_HANDLE(NvVioHandle); //!< A handle to an SDI device
NV_DECLARE_HANDLE(NvTransitionHandle); //!< A handle to address a single transition request
NV_DECLARE_HANDLE(NvAudioHandle); //!< NVIDIA HD Audio Device
NV_DECLARE_HANDLE(Nv3DVPContextHandle); //!< A handle for a 3D Vision Pro (3DVP) context
NV_DECLARE_HANDLE(Nv3DVPTransceiverHandle); //!< A handle for a 3DVP RF transceiver
NV_DECLARE_HANDLE(Nv3DVPGlassesHandle); //!< A handle for a pair of 3DVP RF shutter glasses
NV_DECLARE_HANDLE(NvPcfClientHandle); //!< A handle for NVPCF clients
typedef void* StereoHandle; //!< A stereo handle, that corresponds to the device interface
NV_DECLARE_HANDLE(NvSourceHandle); //!< Unique source handle on the system
NV_DECLARE_HANDLE(NvTargetHandle); //!< Unique target handle on the system
NV_DECLARE_HANDLE(NVDX_SwapChainHandle); //!< DirectX SwapChain objects
static const NVDX_SwapChainHandle NVDX_SWAPCHAIN_NONE = 0;
NV_DECLARE_HANDLE(NvPresentBarrierClientHandle); //!< PresentBarrier client object
//! @}
//! \ingroup nvapihandles
//! @{
#define NVAPI_DEFAULT_HANDLE 0
#define NV_BIT(x) (1 << (x))
//! @}
//! \addtogroup nvapitypes
//! @{
#define NVAPI_GENERIC_STRING_MAX 4096
#define NVAPI_LONG_STRING_MAX 256
#define NVAPI_SHORT_STRING_MAX 64
typedef struct
{
NvS32 sX;
NvS32 sY;
NvS32 sWidth;
NvS32 sHeight;
} NvSBox;
#ifndef NvGUID_Defined
#define NvGUID_Defined
typedef struct
{
NvU32 data1;
NvU16 data2;
NvU16 data3;
NvU8 data4[8];
} NvGUID, NvLUID;
#endif //#ifndef NvGUID_Defined
#define NVAPI_MAX_PHYSICAL_GPUS 64
#define NVAPI_MAX_PHYSICAL_BRIDGES 100
#define NVAPI_PHYSICAL_GPUS 32
#define NVAPI_MAX_LOGICAL_GPUS 64
#define NVAPI_MAX_AVAILABLE_GPU_TOPOLOGIES 256
#define NVAPI_MAX_AVAILABLE_SLI_GROUPS 256
#define NVAPI_MAX_GPU_TOPOLOGIES NVAPI_MAX_PHYSICAL_GPUS
#define NVAPI_MAX_GPU_PER_TOPOLOGY 8
#define NVAPI_MAX_DISPLAY_HEADS 2
#define NVAPI_ADVANCED_DISPLAY_HEADS 4
#define NVAPI_MAX_DISPLAYS NVAPI_PHYSICAL_GPUS * NVAPI_ADVANCED_DISPLAY_HEADS
#define NVAPI_MAX_ACPI_IDS 16
#define NVAPI_MAX_VIEW_MODES 8
#define NVAPI_SYSTEM_MAX_HWBCS 128
#define NVAPI_SYSTEM_HWBC_INVALID_ID 0xffffffff
#define NVAPI_SYSTEM_MAX_DISPLAYS NVAPI_MAX_PHYSICAL_GPUS * NV_MAX_HEADS
#define NV_MAX_HEADS 4 //!< Maximum heads, each with NVAPI_DESKTOP_RES resolution
#define NVAPI_MAX_HEADS_PER_GPU 32
#define NV_MAX_VID_STREAMS 4 //!< Maximum number of input video streams, each with a #NVAPI_VIDEO_SRC_INFO
#define NV_MAX_VID_STREAMS_EX 20 //!< Increasing MAX no. of input video streams, each with a #NVAPI_VIDEO_SRC_INFO
#define NV_MAX_VID_PROFILES 4 //!< Maximum number of output video profiles supported
#define NVAPI_MAX_AUDIO_DEVICES 16
typedef char NvAPI_String[NVAPI_GENERIC_STRING_MAX];
typedef char NvAPI_LongString[NVAPI_LONG_STRING_MAX];
typedef char NvAPI_ShortString[NVAPI_SHORT_STRING_MAX];
typedef NvU16 NvAPI_UnicodeShortString[NVAPI_SHORT_STRING_MAX];
//! @}
// =========================================================================================
//! NvAPI Version Definition \n
//! Maintain per structure specific version define using the MAKE_NVAPI_VERSION macro. \n
//! Usage: #define NV_GENLOCK_STATUS_VER MAKE_NVAPI_VERSION(NV_GENLOCK_STATUS, 1)
//! \ingroup nvapitypes
// =========================================================================================
#define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16))
//! \ingroup nvapitypes
#define GET_NVAPI_VERSION(ver) (NvU32)((ver)>>16)
//! \ingroup nvapitypes
#define GET_NVAPI_SIZE(ver) (NvU32)((ver) & 0xffff)
// ====================================================
//! NvAPI Status Values
//! All NvAPI functions return one of these codes.
//! \ingroup nvapistatus
// ====================================================
typedef enum _NvAPI_Status
{
NVAPI_OK = 0, //!< Success. Request is completed.
NVAPI_ERROR = -1, //!< Generic error
NVAPI_LIBRARY_NOT_FOUND = -2, //!< NVAPI support library cannot be loaded.
NVAPI_NO_IMPLEMENTATION = -3, //!< not implemented in current driver installation
NVAPI_API_NOT_INITIALIZED = -4, //!< NvAPI_Initialize has not been called (successfully)
NVAPI_INVALID_ARGUMENT = -5, //!< The argument/parameter value is not valid or NULL.
NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, //!< No NVIDIA display driver, or NVIDIA GPU driving a display, was found.
NVAPI_END_ENUMERATION = -7, //!< No more items to enumerate
NVAPI_INVALID_HANDLE = -8, //!< Invalid handle
NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, //!< An argument's structure version is not supported
NVAPI_HANDLE_INVALIDATED = -10, //!< The handle is no longer valid (likely due to GPU or display re-configuration)
NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, //!< No NVIDIA OpenGL context is current (but needs to be)
NVAPI_INVALID_POINTER = -14, //!< An invalid pointer, usually NULL, was passed as a parameter
NVAPI_NO_GL_EXPERT = -12, //!< OpenGL Expert is not supported by the current drivers
NVAPI_INSTRUMENTATION_DISABLED = -13, //!< OpenGL Expert is supported, but driver instrumentation is currently disabled
NVAPI_NO_GL_NSIGHT = -15, //!< OpenGL does not support Nsight
NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, //!< Expected a logical GPU handle for one or more parameters
NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, //!< Expected a physical GPU handle for one or more parameters
NVAPI_EXPECTED_DISPLAY_HANDLE = -102, //!< Expected an NV display handle for one or more parameters
NVAPI_INVALID_COMBINATION = -103, //!< The combination of parameters is not valid.
NVAPI_NOT_SUPPORTED = -104, //!< Requested feature is not supported in the selected GPU
NVAPI_PORTID_NOT_FOUND = -105, //!< No port ID was found for the I2C transaction
NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, //!< Expected an unattached display handle as one of the input parameters.
NVAPI_INVALID_PERF_LEVEL = -107, //!< Invalid perf level
NVAPI_DEVICE_BUSY = -108, //!< Device is busy; request not fulfilled
NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, //!< NV persist file is not found
NVAPI_PERSIST_DATA_NOT_FOUND = -110, //!< NV persist data is not found
NVAPI_EXPECTED_TV_DISPLAY = -111, //!< Expected a TV output display
NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, //!< Expected a TV output on the D Connector - HDTV_EIAJ4120.
NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, //!< SLI is not active on this device.
NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, //!< Setup of SLI rendering mode is not possible right now.
NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, //!< Expected a digital flat panel.
NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, //!< Argument exceeds the expected size.
NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, //!< Inhibit is ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI active.
NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, //!< Testing of clocks is not supported.
NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, //!< The specified underscan config is from an unknown source (e.g. INF)
NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, //!< Timeout while reconfiguring GPUs
NVAPI_DATA_NOT_FOUND = -121, //!< Requested data was not found
NVAPI_EXPECTED_ANALOG_DISPLAY = -122, //!< Expected an analog display
NVAPI_NO_VIDLINK = -123, //!< No SLI video bridge is present
NVAPI_REQUIRES_REBOOT = -124, //!< NVAPI requires a reboot for the settings to take effect
NVAPI_INVALID_HYBRID_MODE = -125, //!< The function is not supported with the current Hybrid mode.
NVAPI_MIXED_TARGET_TYPES = -126, //!< The target types are not all the same
NVAPI_SYSWOW64_NOT_SUPPORTED = -127, //!< The function is not supported from 32-bit on a 64-bit system.
NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, //!< There is no implicit GPU topology active. Use NVAPI_SetHybridMode to change topology.
NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, //!< Prompt the user to close all non-migratable applications.
NVAPI_OUT_OF_MEMORY = -130, //!< Could not allocate sufficient memory to complete the call.
NVAPI_WAS_STILL_DRAWING = -131, //!< The previous operation that is transferring information to or from this surface is incomplete.
NVAPI_FILE_NOT_FOUND = -132, //!< The file was not found.
NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, //!< There are too many unique instances of a particular type of state object.
NVAPI_INVALID_CALL = -134, //!< The method call is invalid. For example, a method's parameter may not be a valid pointer.
NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, //!< d3d10_1.dll cannot be loaded.
NVAPI_FUNCTION_NOT_FOUND = -136, //!< Couldn't find the function in the loaded DLL.
NVAPI_INVALID_USER_PRIVILEGE = -137, //!< The application will require Administrator privileges to access this API.
//!< The application can be elevated to a higher permission level by selecting "Run as Administrator".
NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE = -138, //!< The handle corresponds to GDIPrimary.
NVAPI_EXPECTED_COMPUTE_GPU_HANDLE = -139, //!< Setting Physx GPU requires that the GPU is compute-capable.
NVAPI_STEREO_NOT_INITIALIZED = -140, //!< The Stereo part of NVAPI failed to initialize completely. Check if the stereo driver is installed.
NVAPI_STEREO_REGISTRY_ACCESS_FAILED = -141, //!< Access to stereo-related registry keys or values has failed.
NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED = -142, //!< The given registry profile type is not supported.
NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED = -143, //!< The given registry value is not supported.
NVAPI_STEREO_NOT_ENABLED = -144, //!< Stereo is not enabled and the function needed it to execute completely.
NVAPI_STEREO_NOT_TURNED_ON = -145, //!< Stereo is not turned on and the function needed it to execute completely.
NVAPI_STEREO_INVALID_DEVICE_INTERFACE = -146, //!< Invalid device interface.
NVAPI_STEREO_PARAMETER_OUT_OF_RANGE = -147, //!< Separation percentage or JPEG image capture quality is out of [0-100] range.
NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED = -148, //!< The given frustum adjust mode is not supported.
NVAPI_TOPO_NOT_POSSIBLE = -149, //!< The mosaic topology is not possible given the current state of the hardware.
NVAPI_MODE_CHANGE_FAILED = -150, //!< An attempt to do a display resolution mode change has failed.
NVAPI_D3D11_LIBRARY_NOT_FOUND = -151, //!< d3d11.dll/d3d11_beta.dll cannot be loaded.
NVAPI_INVALID_ADDRESS = -152, //!< Address is outside of valid range.
NVAPI_STRING_TOO_SMALL = -153, //!< The pre-allocated string is too small to hold the result.
NVAPI_MATCHING_DEVICE_NOT_FOUND = -154, //!< The input does not match any of the available devices.
NVAPI_DRIVER_RUNNING = -155, //!< Driver is running.
NVAPI_DRIVER_NOTRUNNING = -156, //!< Driver is not running.
NVAPI_ERROR_DRIVER_RELOAD_REQUIRED = -157, //!< A driver reload is required to apply these settings.
NVAPI_SET_NOT_ALLOWED = -158, //!< Intended setting is not allowed.
NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED = -159, //!< Information can't be returned due to "advanced display topology".
NVAPI_SETTING_NOT_FOUND = -160, //!< Setting is not found.
NVAPI_SETTING_SIZE_TOO_LARGE = -161, //!< Setting size is too large.
NVAPI_TOO_MANY_SETTINGS_IN_PROFILE = -162, //!< There are too many settings for a profile.
NVAPI_PROFILE_NOT_FOUND = -163, //!< Profile is not found.
NVAPI_PROFILE_NAME_IN_USE = -164, //!< Profile name is duplicated.
NVAPI_PROFILE_NAME_EMPTY = -165, //!< Profile name is empty.
NVAPI_EXECUTABLE_NOT_FOUND = -166, //!< Application not found in the Profile.
NVAPI_EXECUTABLE_ALREADY_IN_USE = -167, //!< Application already exists in the other profile.
NVAPI_DATATYPE_MISMATCH = -168, //!< Data Type mismatch
NVAPI_PROFILE_REMOVED = -169, //!< The profile passed as parameter has been removed and is no longer valid.
NVAPI_UNREGISTERED_RESOURCE = -170, //!< An unregistered resource was passed as a parameter.
NVAPI_ID_OUT_OF_RANGE = -171, //!< The DisplayId corresponds to a display which is not within the normal outputId range.
NVAPI_DISPLAYCONFIG_VALIDATION_FAILED = -172, //!< Display topology is not valid so the driver cannot do a mode set on this configuration.
NVAPI_DPMST_CHANGED = -173, //!< Display Port Multi-Stream topology has been changed.
NVAPI_INSUFFICIENT_BUFFER = -174, //!< Input buffer is insufficient to hold the contents.
NVAPI_ACCESS_DENIED = -175, //!< No access to the caller.
NVAPI_MOSAIC_NOT_ACTIVE = -176, //!< The requested action cannot be performed without Mosaic being enabled.
NVAPI_SHARE_RESOURCE_RELOCATED = -177, //!< The surface is relocated away from video memory.
NVAPI_REQUEST_USER_TO_DISABLE_DWM = -178, //!< The user should disable DWM before calling NvAPI.
NVAPI_D3D_DEVICE_LOST = -179, //!< D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET - the user has to reset the device.
NVAPI_INVALID_CONFIGURATION = -180, //!< The requested action cannot be performed in the current state.
NVAPI_STEREO_HANDSHAKE_NOT_DONE = -181, //!< Call failed as stereo handshake not completed.
NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS = -182, //!< The path provided was too short to determine the correct NVDRS_APPLICATION
NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED = -183, //!< Default stereo profile is not currently defined
NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST = -184, //!< Default stereo profile does not exist
NVAPI_CLUSTER_ALREADY_EXISTS = -185, //!< A cluster is already defined with the given configuration.
NVAPI_DPMST_DISPLAY_ID_EXPECTED = -186, //!< The input display id is not that of a multi stream enabled connector or a display device in a multi stream topology
NVAPI_INVALID_DISPLAY_ID = -187, //!< The input display id is not valid or the monitor associated to it does not support the current operation
NVAPI_STREAM_IS_OUT_OF_SYNC = -188, //!< While playing secure audio stream, stream goes out of sync
NVAPI_INCOMPATIBLE_AUDIO_DRIVER = -189, //!< Older audio driver version than required
NVAPI_VALUE_ALREADY_SET = -190, //!< Value already set, setting again not allowed.
NVAPI_TIMEOUT = -191, //!< Requested operation timed out
NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE = -192, //!< The requested workstation feature set has incomplete driver internal allocation resources
NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE = -193, //!< Call failed because InitActivation was not called.
NVAPI_SYNC_NOT_ACTIVE = -194, //!< The requested action cannot be performed without Sync being enabled.
NVAPI_SYNC_MASTER_NOT_FOUND = -195, //!< The requested action cannot be performed without Sync Master being enabled.
NVAPI_INVALID_SYNC_TOPOLOGY = -196, //!< Invalid displays passed in the NV_GSYNC_DISPLAY pointer.
NVAPI_ECID_SIGN_ALGO_UNSUPPORTED = -197, //!< The specified signing algorithm is not supported. Either an incorrect value was entered or the current installed driver/hardware does not support the input value.
NVAPI_ECID_KEY_VERIFICATION_FAILED = -198, //!< The encrypted public key verification has failed.
NVAPI_FIRMWARE_OUT_OF_DATE = -199, //!< The device's firmware is out of date.
NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED = -200, //!< The device's firmware is not supported.
NVAPI_LICENSE_CALLER_AUTHENTICATION_FAILED = -201, //!< The caller is not authorized to modify the License.
NVAPI_D3D_DEVICE_NOT_REGISTERED = -202, //!< The user tried to use a deferred context without registering the device first
NVAPI_RESOURCE_NOT_ACQUIRED = -203, //!< Head or SourceId was not reserved for the VR Display before doing the Modeset or the dedicated display.
NVAPI_TIMING_NOT_SUPPORTED = -204, //!< Provided timing is not supported.
NVAPI_HDCP_ENCRYPTION_FAILED = -205, //!< HDCP Encryption Failed for the device. Would be applicable when the device is HDCP Capable.
NVAPI_PCLK_LIMITATION_FAILED = -206, //!< Provided mode is over sink device pclk limitation.
NVAPI_NO_CONNECTOR_FOUND = -207, //!< No connector on GPU found.
NVAPI_HDCP_DISABLED = -208, //!< When a non-HDCP capable HMD is connected, we would inform user by this code.
NVAPI_API_IN_USE = -209, //!< Atleast an API is still being called
NVAPI_NVIDIA_DISPLAY_NOT_FOUND = -210, //!< No display found on Nvidia GPU(s).
NVAPI_PRIV_SEC_VIOLATION = -211, //!< Priv security violation, improper access to a secured register.
NVAPI_INCORRECT_VENDOR = -212, //!< NVAPI cannot be called by this vendor
NVAPI_DISPLAY_IN_USE = -213, //!< DirectMode Display is already in use
NVAPI_UNSUPPORTED_CONFIG_NON_HDCP_HMD = -214, //!< The Config is having Non-NVidia GPU with Non-HDCP HMD connected
NVAPI_MAX_DISPLAY_LIMIT_REACHED = -215, //!< GPU's Max Display Limit has Reached
NVAPI_INVALID_DIRECT_MODE_DISPLAY = -216, //!< DirectMode not Enabled on the Display
NVAPI_GPU_IN_DEBUG_MODE = -217, //!< GPU is in debug mode, OC is NOT allowed.
NVAPI_D3D_CONTEXT_NOT_FOUND = -218, //!< No NvAPI context was found for this D3D object
NVAPI_STEREO_VERSION_MISMATCH = -219, //!< there is version mismatch between stereo driver and dx driver
NVAPI_GPU_NOT_POWERED = -220, //!< GPU is not powered and so the request cannot be completed.
NVAPI_ERROR_DRIVER_RELOAD_IN_PROGRESS = -221, //!< The display driver update in progress.
NVAPI_WAIT_FOR_HW_RESOURCE = -222, //!< Wait for HW resources allocation
NVAPI_REQUIRE_FURTHER_HDCP_ACTION = -223, //!< operation requires further HDCP action
NVAPI_DISPLAY_MUX_TRANSITION_FAILED = -224, //!< Dynamic Mux transition failure
NVAPI_INVALID_DSC_VERSION = -225, //!< Invalid DSC version
NVAPI_INVALID_DSC_SLICECOUNT = -226, //!< Invalid DSC slice count
NVAPI_INVALID_DSC_OUTPUT_BPP = -227, //!< Invalid DSC output BPP
NVAPI_FAILED_TO_LOAD_FROM_DRIVER_STORE = -228, //!< There was an error while loading nvapi.dll from the driver store.
NVAPI_NO_VULKAN = -229, //!< OpenGL does not export Vulkan fake extensions
NVAPI_REQUEST_PENDING = -230, //!< A request for NvTOPPs telemetry CData has already been made and is pending a response.
NVAPI_RESOURCE_IN_USE = -231, //!< Operation cannot be performed because the resource is in use.
NVAPI_INVALID_IMAGE = -232, //!< Device kernel image is invalid
NVAPI_INVALID_PTX = -233, //!< PTX JIT compilation failed
NVAPI_NVLINK_UNCORRECTABLE = -234, //!< Uncorrectable NVLink error was detected during the execution
NVAPI_JIT_COMPILER_NOT_FOUND = -235, //!< PTX JIT compiler library was not found.
NVAPI_INVALID_SOURCE = -236, //!< Device kernel source is invalid.
NVAPI_ILLEGAL_INSTRUCTION = -237, //!< While executing a kernel, the device encountered an illegal instruction.
NVAPI_INVALID_PC = -238, //!< While executing a kernel, the device program counter wrapped its address space
NVAPI_LAUNCH_FAILED = -239, //!< An exception occurred on the device while executing a kernel
NVAPI_NOT_PERMITTED = -240, //!< Attempted operation is not permitted.
NVAPI_CALLBACK_ALREADY_REGISTERED = -241, //!< The callback function has already been registered.
NVAPI_CALLBACK_NOT_FOUND = -242, //!< The callback function is not found or not registered.
NVAPI_INVALID_OUTPUT_WIRE_FORMAT = -243, //!< Invalid Wire Format for the VR HMD
} NvAPI_Status;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_SYS_GetDriverAndBranchVersion
//
//! DESCRIPTION: This API returns display driver version and driver-branch string.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \param [out] pDriverVersion Contains the driver version after successful return.
//! \param [out] szBuildBranchString Contains the driver-branch string after successful return.
//!
//! \retval ::NVAPI_INVALID_ARGUMENT: either pDriverVersion is NULL or enum index too big
//! \retval ::NVAPI_OK - completed request
//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
//! \retval ::NVAPI_ERROR - miscellaneous error occurred
//!
//! \ingroup driverapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_SYS_GetDriverAndBranchVersion(NvU32* pDriverVersion, NvAPI_ShortString szBuildBranchString);
//! \ingroup driverapi
//! Used in NvAPI_GPU_GetMemoryInfo().
typedef struct
{
NvU32 version; //!< Version info
NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
} NV_DISPLAY_DRIVER_MEMORY_INFO_V1;
//! \ingroup driverapi
//! Used in NvAPI_GPU_GetMemoryInfo().
typedef struct
{
NvU32 version; //!< Version info
NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces.
} NV_DISPLAY_DRIVER_MEMORY_INFO_V2;
//! \ingroup driverapi
//! Used in NvAPI_GPU_GetMemoryInfo().
typedef struct
{
NvU32 version; //!< Version info
NvU32 dedicatedVideoMemory; //!< Size(in kb) of the physical framebuffer.
NvU32 availableDedicatedVideoMemory; //!< Size(in kb) of the available physical framebuffer for allocating video memory surfaces.
NvU32 systemVideoMemory; //!< Size(in kb) of system memory the driver allocates at load time.
NvU32 sharedSystemMemory; //!< Size(in kb) of shared system memory that driver is allowed to commit for surfaces across all allocations.
NvU32 curAvailableDedicatedVideoMemory; //!< Size(in kb) of the current available physical framebuffer for allocating video memory surfaces.
NvU32 dedicatedVideoMemoryEvictionsSize; //!< Size(in kb) of the total size of memory released as a result of the evictions.
NvU32 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU
//!< video memory to make room for other allocations.
} NV_DISPLAY_DRIVER_MEMORY_INFO_V3;
//! \ingroup driverapi
typedef NV_DISPLAY_DRIVER_MEMORY_INFO_V3 NV_DISPLAY_DRIVER_MEMORY_INFO;
//! \ingroup driverapi
//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V1
#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V1,1)
//! \ingroup driverapi
//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V2
#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V2,2)
//! \ingroup driverapi
//! Macro for constructing the version field of NV_DISPLAY_DRIVER_MEMORY_INFO_V3
#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V3,3)
//! \ingroup driverapi
#define NV_DISPLAY_DRIVER_MEMORY_INFO_VER NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetMemoryInfo
//
//! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU.
//! If the GPU is in TCC Mode, only dedicatedVideoMemory will be returned in pMemoryInfo (NV_DISPLAY_DRIVER_MEMORY_INFO).
//!
//! \deprecated Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetMemoryInfoEx.
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! TCC_SUPPORTED
//!
//! \since Release: 177
//!
//! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted.
//! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_DISPLAY_DRIVER_MEMORY_INFO.
//!
//! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL.
//! \retval NVAPI_OK Call successful.
//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_DISPLAY_DRIVER_MEMORY_INFO structure version mismatch.
//!
//! \ingroup driverapi
///////////////////////////////////////////////////////////////////////////////
__nvapi_deprecated_function("Do not use this function - it is deprecated in release 520. Instead, use NvAPI_GPU_GetMemoryInfoEx.")
NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_DISPLAY_DRIVER_MEMORY_INFO *pMemoryInfo);
//! \ingroup driverapi
//! Used in NvAPI_GPU_GetMemoryInfoEx().
typedef struct
{
NvU32 version; //!< Structure version
NvU64 dedicatedVideoMemory; //!< Size(in bytes) of the physical framebuffer. Refers to the dedicated video memory on discrete GPUs.
//! It is more performant for GPU operations than the reserved systemVideoMemory.
NvU64 availableDedicatedVideoMemory; //!< Size(in bytes) of the available physical framebuffer for allocating video memory surfaces.
NvU64 systemVideoMemory; //!< Size(in bytes) of system memory the driver allocates at load time. It is a substitute for dedicated video memory.
//!< Typically used with integrated GPUs that do not have dedicated video memory.
NvU64 sharedSystemMemory; //!< Size(in bytes) of shared system memory that driver is allowed to commit for surfaces across all allocations.
//!< On discrete GPUs, it is used to utilize system memory for various operations. It does not need to be reserved during boot.
//!< It may be used by both GPU and CPU, and has an "on-demand" type of usage.
NvU64 curAvailableDedicatedVideoMemory; //!< Size(in bytes) of the current available physical framebuffer for allocating video memory surfaces.
NvU64 dedicatedVideoMemoryEvictionsSize; //!< Size(in bytes) of the total size of memory released as a result of the evictions.
NvU64 dedicatedVideoMemoryEvictionCount; //!< Indicates the number of eviction events that caused an allocation to be removed from dedicated video memory to free GPU
//!< video memory to make room for other allocations.
NvU64 dedicatedVideoMemoryPromotionsSize; //!< Size(in bytes) of the total size of memory allocated as a result of the promotions.
NvU64 dedicatedVideoMemoryPromotionCount; //!< Indicates the number of promotion events that caused an allocation to be promoted to dedicated video memory
} NV_GPU_MEMORY_INFO_EX_V1;
//! \ingroup driverapi
typedef NV_GPU_MEMORY_INFO_EX_V1 NV_GPU_MEMORY_INFO_EX;
//! \ingroup driverapi
//! Macro for constructing the version field of NV_GPU_MEMORY_INFO_EX_V1
#define NV_GPU_MEMORY_INFO_EX_VER_1 MAKE_NVAPI_VERSION(NV_GPU_MEMORY_INFO_EX_V1,1)
//! \ingroup driverapi
#define NV_GPU_MEMORY_INFO_EX_VER NV_GPU_MEMORY_INFO_EX_VER_1
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetMemoryInfoEx
//
//! DESCRIPTION: This function retrieves the available driver memory footprint for the specified GPU.
//! If the GPU is in TCC Mode, only dedicatedVideoMemory will be returned in pMemoryInfo (NV_GPU_MEMORY_INFO_EX).
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! TCC_SUPPORTED
//!
//! MCDM_SUPPORTED
//!
//! \since Release: 520
//!
//! \param [in] hPhysicalGpu Handle of the physical GPU for which the memory information is to be extracted.
//! \param [out] pMemoryInfo The memory footprint available in the driver. See NV_GPU_MEMORY_INFO_EX.
//!
//! \retval NVAPI_INVALID_ARGUMENT pMemoryInfo is NULL.
//! \retval NVAPI_OK Call successful.
//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
//! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_GPU_MEMORY_INFO_EX structure version mismatch.
//!
//! \ingroup driverapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_GPU_GetMemoryInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_MEMORY_INFO_EX *pMemoryInfo);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_EnumPhysicalGPUs
//
//! This function returns an array of physical GPU handles.
//! Each handle represents a physical GPU present in the system.
//! That GPU may be part of an SLI configuration, or may not be visible to the OS directly.
//!
//! At least one GPU must be present in the system and running an NVIDIA display driver.
//!
//! The array nvGPUHandle will be filled with physical GPU handle values. The returned
//! gpuCount determines how many entries in the array are valid.
//!
//! \note In drivers older than 105.00, all physical GPU handles get invalidated on a
//! modeset. So the calling applications need to renum the handles after every modeset.\n
//! With drivers 105.00 and up, all physical GPU handles are constant.
//! Physical GPU handles are constant as long as the GPUs are not physically moved and
//! the SBIOS VGA order is unchanged.
//!
//! For GPU handles in TCC MODE please use NvAPI_EnumTCCPhysicalGPUs()
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \par Introduced in
//! \since Release: 80
//!
//! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL
//! \retval NVAPI_OK One or more handles were returned
//! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
//! \ingroup gpu
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_EnumPhysicalGPUs(NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
NV_DECLARE_HANDLE(NVDX_ObjectHandle); // DX Objects
static const NVDX_ObjectHandle NVDX_OBJECT_NONE = 0;
#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_D3D_GetObjectHandleForResource
//
//! DESCRIPTION: This API gets a handle to a resource.
//!
//! \param [in] pDev The ID3D11Device, ID3D10Device or IDirect3DDevice9 or ID3D11DeviceContext to use
//! \param [in] pResource The ID3D11Resource, ID3D10Resource or IDirect3DResource9 from which
//! we want the NvAPI handle
//! \param [out] pHandle A handle to the resource
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 185
//!
//! \return ::NVAPI_OK if the handle was populated.
//!
//! \ingroup dx
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_D3D_GetObjectHandleForResource(
IUnknown *pDevice,
IUnknown *pResource,
NVDX_ObjectHandle *pHandle);
#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
#include"imports/nvapi/nvapi_lite_salend.h"
#ifdef __cplusplus
}
#endif
#pragma pack(pop)

View File

@@ -1,184 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
#pragma once
#include"imports/nvapi/nvapi_lite_salstart.h"
#include"imports/nvapi/nvapi_lite_common.h"
#pragma pack(push,8)
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
//! \ingroup dx
//! D3D_FEATURE_LEVEL supported - used in NvAPI_D3D11_CreateDevice() and NvAPI_D3D11_CreateDeviceAndSwapChain()
typedef enum
{
NVAPI_DEVICE_FEATURE_LEVEL_NULL = -1,
NVAPI_DEVICE_FEATURE_LEVEL_10_0 = 0,
NVAPI_DEVICE_FEATURE_LEVEL_10_0_PLUS = 1,
NVAPI_DEVICE_FEATURE_LEVEL_10_1 = 2,
NVAPI_DEVICE_FEATURE_LEVEL_11_0 = 3,
} NVAPI_DEVICE_FEATURE_LEVEL;
#endif //defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
#if defined(__cplusplus) && defined(__d3d11_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_D3D11_CreateDevice
//
//! DESCRIPTION: This function tries to create a DirectX 11 device. If the call fails (if we are running
//! on pre-DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR DirectX 10.0+
//! OR DirectX 10.0 device. The function call is the same as D3D11CreateDevice(), but with an extra
//! argument (D3D_FEATURE_LEVEL supported by the device) that the function fills in. This argument
//! can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel is less than DirecX 10.0.
//!
//! NOTE: When NvAPI_D3D11_CreateDevice is called with 10+ feature level we have an issue on few set of
//! tesla hardware (G80/G84/G86/G92/G94/G96) which does not support all feature level 10+ functionality
//! e.g. calling driver with mismatch between RenderTarget and Depth Buffer. App developers should
//! take into consideration such limitation when using NVAPI on such tesla hardwares.
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 185
//!
//! \param [in] pAdapter
//! \param [in] DriverType
//! \param [in] Software
//! \param [in] Flags
//! \param [in] *pFeatureLevels
//! \param [in] FeatureLevels
//! \param [in] SDKVersion
//! \param [in] **ppDevice
//! \param [in] *pFeatureLevel
//! \param [in] **ppImmediateContext
//! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported
//!
//! \return NVAPI_OK if the createDevice call succeeded.
//!
//! \ingroup dx
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_D3D11_CreateDevice(IDXGIAdapter* pAdapter,
D3D_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
CONST D3D_FEATURE_LEVEL *pFeatureLevels,
UINT FeatureLevels,
UINT SDKVersion,
ID3D11Device **ppDevice,
D3D_FEATURE_LEVEL *pFeatureLevel,
ID3D11DeviceContext **ppImmediateContext,
NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel);
#endif //defined(__cplusplus) && defined(__d3d11_h__)
#if defined(__cplusplus) && defined(__d3d11_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_D3D11_CreateDeviceAndSwapChain
//
//! DESCRIPTION: This function tries to create a DirectX 11 device and swap chain. If the call fails (if we are
//! running on pre=DirectX 11 hardware), depending on the type of hardware it will try to create a DirectX 10.1 OR
//! DirectX 10.0+ OR DirectX 10.0 device. The function call is the same as D3D11CreateDeviceAndSwapChain,
//! but with an extra argument (D3D_FEATURE_LEVEL supported by the device) that the function fills
//! in. This argument can contain -1 (NVAPI_DEVICE_FEATURE_LEVEL_NULL), if the requested featureLevel
//! is less than DirectX 10.0.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 185
//!
//! \param [in] pAdapter
//! \param [in] DriverType
//! \param [in] Software
//! \param [in] Flags
//! \param [in] *pFeatureLevels
//! \param [in] FeatureLevels
//! \param [in] SDKVersion
//! \param [in] *pSwapChainDesc
//! \param [in] **ppSwapChain
//! \param [in] **ppDevice
//! \param [in] *pFeatureLevel
//! \param [in] **ppImmediateContext
//! \param [in] *pSupportedLevel D3D_FEATURE_LEVEL supported
//!
//!return NVAPI_OK if the createDevice with swap chain call succeeded.
//!
//! \ingroup dx
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_D3D11_CreateDeviceAndSwapChain(IDXGIAdapter* pAdapter,
D3D_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
CONST D3D_FEATURE_LEVEL *pFeatureLevels,
UINT FeatureLevels,
UINT SDKVersion,
CONST DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
IDXGISwapChain **ppSwapChain,
ID3D11Device **ppDevice,
D3D_FEATURE_LEVEL *pFeatureLevel,
ID3D11DeviceContext **ppImmediateContext,
NVAPI_DEVICE_FEATURE_LEVEL *pSupportedLevel);
#endif //defined(__cplusplus) && defined(__d3d11_h__)
#if defined(__cplusplus) && defined(__d3d11_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_D3D11_SetDepthBoundsTest
//
//! DESCRIPTION: This function enables/disables the depth bounds test
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \param [in] pDeviceOrContext The device or device context to set depth bounds test
//! \param [in] bEnable Enable(non-zero)/disable(zero) the depth bounds test
//! \param [in] fMinDepth The minimum depth for depth bounds test
//! \param [in] fMaxDepth The maximum depth for depth bounds test
//! The valid values for fMinDepth and fMaxDepth
//! are such that 0 <= fMinDepth <= fMaxDepth <= 1
//!
//! \return ::NVAPI_OK if the depth bounds test was correcly enabled or disabled
//!
//! \ingroup dx
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_D3D11_SetDepthBoundsTest(IUnknown* pDeviceOrContext,
NvU32 bEnable,
float fMinDepth,
float fMaxDepth);
#endif //defined(__cplusplus) && defined(__d3d11_h__)
#include"imports/nvapi/nvapi_lite_salend.h"
#ifdef __cplusplus
}
#endif
#pragma pack(pop)

View File

@@ -1,809 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
#ifndef __NVAPI_EMPTY_SAL
#ifdef __nvapi_undef__ecount
#undef __ecount
#undef __nvapi_undef__ecount
#endif
#ifdef __nvapi_undef__bcount
#undef __bcount
#undef __nvapi_undef__bcount
#endif
#ifdef __nvapi_undef__in
#undef __in
#undef __nvapi_undef__in
#endif
#ifdef __nvapi_undef__in_ecount
#undef __in_ecount
#undef __nvapi_undef__in_ecount
#endif
#ifdef __nvapi_undef__in_bcount
#undef __in_bcount
#undef __nvapi_undef__in_bcount
#endif
#ifdef __nvapi_undef__in_z
#undef __in_z
#undef __nvapi_undef__in_z
#endif
#ifdef __nvapi_undef__in_ecount_z
#undef __in_ecount_z
#undef __nvapi_undef__in_ecount_z
#endif
#ifdef __nvapi_undef__in_bcount_z
#undef __in_bcount_z
#undef __nvapi_undef__in_bcount_z
#endif
#ifdef __nvapi_undef__in_nz
#undef __in_nz
#undef __nvapi_undef__in_nz
#endif
#ifdef __nvapi_undef__in_ecount_nz
#undef __in_ecount_nz
#undef __nvapi_undef__in_ecount_nz
#endif
#ifdef __nvapi_undef__in_bcount_nz
#undef __in_bcount_nz
#undef __nvapi_undef__in_bcount_nz
#endif
#ifdef __nvapi_undef__out
#undef __out
#undef __nvapi_undef__out
#endif
#ifdef __nvapi_undef__out_ecount
#undef __out_ecount
#undef __nvapi_undef__out_ecount
#endif
#ifdef __nvapi_undef__out_bcount
#undef __out_bcount
#undef __nvapi_undef__out_bcount
#endif
#ifdef __nvapi_undef__out_ecount_part
#undef __out_ecount_part
#undef __nvapi_undef__out_ecount_part
#endif
#ifdef __nvapi_undef__out_bcount_part
#undef __out_bcount_part
#undef __nvapi_undef__out_bcount_part
#endif
#ifdef __nvapi_undef__out_ecount_full
#undef __out_ecount_full
#undef __nvapi_undef__out_ecount_full
#endif
#ifdef __nvapi_undef__out_bcount_full
#undef __out_bcount_full
#undef __nvapi_undef__out_bcount_full
#endif
#ifdef __nvapi_undef__out_z
#undef __out_z
#undef __nvapi_undef__out_z
#endif
#ifdef __nvapi_undef__out_z_opt
#undef __out_z_opt
#undef __nvapi_undef__out_z_opt
#endif
#ifdef __nvapi_undef__out_ecount_z
#undef __out_ecount_z
#undef __nvapi_undef__out_ecount_z
#endif
#ifdef __nvapi_undef__out_bcount_z
#undef __out_bcount_z
#undef __nvapi_undef__out_bcount_z
#endif
#ifdef __nvapi_undef__out_ecount_part_z
#undef __out_ecount_part_z
#undef __nvapi_undef__out_ecount_part_z
#endif
#ifdef __nvapi_undef__out_bcount_part_z
#undef __out_bcount_part_z
#undef __nvapi_undef__out_bcount_part_z
#endif
#ifdef __nvapi_undef__out_ecount_full_z
#undef __out_ecount_full_z
#undef __nvapi_undef__out_ecount_full_z
#endif
#ifdef __nvapi_undef__out_bcount_full_z
#undef __out_bcount_full_z
#undef __nvapi_undef__out_bcount_full_z
#endif
#ifdef __nvapi_undef__out_nz
#undef __out_nz
#undef __nvapi_undef__out_nz
#endif
#ifdef __nvapi_undef__out_nz_opt
#undef __out_nz_opt
#undef __nvapi_undef__out_nz_opt
#endif
#ifdef __nvapi_undef__out_ecount_nz
#undef __out_ecount_nz
#undef __nvapi_undef__out_ecount_nz
#endif
#ifdef __nvapi_undef__out_bcount_nz
#undef __out_bcount_nz
#undef __nvapi_undef__out_bcount_nz
#endif
#ifdef __nvapi_undef__inout
#undef __inout
#undef __nvapi_undef__inout
#endif
#ifdef __nvapi_undef__inout_ecount
#undef __inout_ecount
#undef __nvapi_undef__inout_ecount
#endif
#ifdef __nvapi_undef__inout_bcount
#undef __inout_bcount
#undef __nvapi_undef__inout_bcount
#endif
#ifdef __nvapi_undef__inout_ecount_part
#undef __inout_ecount_part
#undef __nvapi_undef__inout_ecount_part
#endif
#ifdef __nvapi_undef__inout_bcount_part
#undef __inout_bcount_part
#undef __nvapi_undef__inout_bcount_part
#endif
#ifdef __nvapi_undef__inout_ecount_full
#undef __inout_ecount_full
#undef __nvapi_undef__inout_ecount_full
#endif
#ifdef __nvapi_undef__inout_bcount_full
#undef __inout_bcount_full
#undef __nvapi_undef__inout_bcount_full
#endif
#ifdef __nvapi_undef__inout_z
#undef __inout_z
#undef __nvapi_undef__inout_z
#endif
#ifdef __nvapi_undef__inout_ecount_z
#undef __inout_ecount_z
#undef __nvapi_undef__inout_ecount_z
#endif
#ifdef __nvapi_undef__inout_bcount_z
#undef __inout_bcount_z
#undef __nvapi_undef__inout_bcount_z
#endif
#ifdef __nvapi_undef__inout_nz
#undef __inout_nz
#undef __nvapi_undef__inout_nz
#endif
#ifdef __nvapi_undef__inout_ecount_nz
#undef __inout_ecount_nz
#undef __nvapi_undef__inout_ecount_nz
#endif
#ifdef __nvapi_undef__inout_bcount_nz
#undef __inout_bcount_nz
#undef __nvapi_undef__inout_bcount_nz
#endif
#ifdef __nvapi_undef__ecount_opt
#undef __ecount_opt
#undef __nvapi_undef__ecount_opt
#endif
#ifdef __nvapi_undef__bcount_opt
#undef __bcount_opt
#undef __nvapi_undef__bcount_opt
#endif
#ifdef __nvapi_undef__in_opt
#undef __in_opt
#undef __nvapi_undef__in_opt
#endif
#ifdef __nvapi_undef__in_ecount_opt
#undef __in_ecount_opt
#undef __nvapi_undef__in_ecount_opt
#endif
#ifdef __nvapi_undef__in_bcount_opt
#undef __in_bcount_opt
#undef __nvapi_undef__in_bcount_opt
#endif
#ifdef __nvapi_undef__in_z_opt
#undef __in_z_opt
#undef __nvapi_undef__in_z_opt
#endif
#ifdef __nvapi_undef__in_ecount_z_opt
#undef __in_ecount_z_opt
#undef __nvapi_undef__in_ecount_z_opt
#endif
#ifdef __nvapi_undef__in_bcount_z_opt
#undef __in_bcount_z_opt
#undef __nvapi_undef__in_bcount_z_opt
#endif
#ifdef __nvapi_undef__in_nz_opt
#undef __in_nz_opt
#undef __nvapi_undef__in_nz_opt
#endif
#ifdef __nvapi_undef__in_ecount_nz_opt
#undef __in_ecount_nz_opt
#undef __nvapi_undef__in_ecount_nz_opt
#endif
#ifdef __nvapi_undef__in_bcount_nz_opt
#undef __in_bcount_nz_opt
#undef __nvapi_undef__in_bcount_nz_opt
#endif
#ifdef __nvapi_undef__out_opt
#undef __out_opt
#undef __nvapi_undef__out_opt
#endif
#ifdef __nvapi_undef__out_ecount_opt
#undef __out_ecount_opt
#undef __nvapi_undef__out_ecount_opt
#endif
#ifdef __nvapi_undef__out_bcount_opt
#undef __out_bcount_opt
#undef __nvapi_undef__out_bcount_opt
#endif
#ifdef __nvapi_undef__out_ecount_part_opt
#undef __out_ecount_part_opt
#undef __nvapi_undef__out_ecount_part_opt
#endif
#ifdef __nvapi_undef__out_bcount_part_opt
#undef __out_bcount_part_opt
#undef __nvapi_undef__out_bcount_part_opt
#endif
#ifdef __nvapi_undef__out_ecount_full_opt
#undef __out_ecount_full_opt
#undef __nvapi_undef__out_ecount_full_opt
#endif
#ifdef __nvapi_undef__out_bcount_full_opt
#undef __out_bcount_full_opt
#undef __nvapi_undef__out_bcount_full_opt
#endif
#ifdef __nvapi_undef__out_ecount_z_opt
#undef __out_ecount_z_opt
#undef __nvapi_undef__out_ecount_z_opt
#endif
#ifdef __nvapi_undef__out_bcount_z_opt
#undef __out_bcount_z_opt
#undef __nvapi_undef__out_bcount_z_opt
#endif
#ifdef __nvapi_undef__out_ecount_part_z_opt
#undef __out_ecount_part_z_opt
#undef __nvapi_undef__out_ecount_part_z_opt
#endif
#ifdef __nvapi_undef__out_bcount_part_z_opt
#undef __out_bcount_part_z_opt
#undef __nvapi_undef__out_bcount_part_z_opt
#endif
#ifdef __nvapi_undef__out_ecount_full_z_opt
#undef __out_ecount_full_z_opt
#undef __nvapi_undef__out_ecount_full_z_opt
#endif
#ifdef __nvapi_undef__out_bcount_full_z_opt
#undef __out_bcount_full_z_opt
#undef __nvapi_undef__out_bcount_full_z_opt
#endif
#ifdef __nvapi_undef__out_ecount_nz_opt
#undef __out_ecount_nz_opt
#undef __nvapi_undef__out_ecount_nz_opt
#endif
#ifdef __nvapi_undef__out_bcount_nz_opt
#undef __out_bcount_nz_opt
#undef __nvapi_undef__out_bcount_nz_opt
#endif
#ifdef __nvapi_undef__inout_opt
#undef __inout_opt
#undef __nvapi_undef__inout_opt
#endif
#ifdef __nvapi_undef__inout_ecount_opt
#undef __inout_ecount_opt
#undef __nvapi_undef__inout_ecount_opt
#endif
#ifdef __nvapi_undef__inout_bcount_opt
#undef __inout_bcount_opt
#undef __nvapi_undef__inout_bcount_opt
#endif
#ifdef __nvapi_undef__inout_ecount_part_opt
#undef __inout_ecount_part_opt
#undef __nvapi_undef__inout_ecount_part_opt
#endif
#ifdef __nvapi_undef__inout_bcount_part_opt
#undef __inout_bcount_part_opt
#undef __nvapi_undef__inout_bcount_part_opt
#endif
#ifdef __nvapi_undef__inout_ecount_full_opt
#undef __inout_ecount_full_opt
#undef __nvapi_undef__inout_ecount_full_opt
#endif
#ifdef __nvapi_undef__inout_bcount_full_opt
#undef __inout_bcount_full_opt
#undef __nvapi_undef__inout_bcount_full_opt
#endif
#ifdef __nvapi_undef__inout_z_opt
#undef __inout_z_opt
#undef __nvapi_undef__inout_z_opt
#endif
#ifdef __nvapi_undef__inout_ecount_z_opt
#undef __inout_ecount_z_opt
#undef __nvapi_undef__inout_ecount_z_opt
#endif
#ifdef __nvapi_undef__inout_ecount_z_opt
#undef __inout_ecount_z_opt
#undef __nvapi_undef__inout_ecount_z_opt
#endif
#ifdef __nvapi_undef__inout_bcount_z_opt
#undef __inout_bcount_z_opt
#undef __nvapi_undef__inout_bcount_z_opt
#endif
#ifdef __nvapi_undef__inout_nz_opt
#undef __inout_nz_opt
#undef __nvapi_undef__inout_nz_opt
#endif
#ifdef __nvapi_undef__inout_ecount_nz_opt
#undef __inout_ecount_nz_opt
#undef __nvapi_undef__inout_ecount_nz_opt
#endif
#ifdef __nvapi_undef__inout_bcount_nz_opt
#undef __inout_bcount_nz_opt
#undef __nvapi_undef__inout_bcount_nz_opt
#endif
#ifdef __nvapi_undef__deref_ecount
#undef __deref_ecount
#undef __nvapi_undef__deref_ecount
#endif
#ifdef __nvapi_undef__deref_bcount
#undef __deref_bcount
#undef __nvapi_undef__deref_bcount
#endif
#ifdef __nvapi_undef__deref_out
#undef __deref_out
#undef __nvapi_undef__deref_out
#endif
#ifdef __nvapi_undef__deref_out_ecount
#undef __deref_out_ecount
#undef __nvapi_undef__deref_out_ecount
#endif
#ifdef __nvapi_undef__deref_out_bcount
#undef __deref_out_bcount
#undef __nvapi_undef__deref_out_bcount
#endif
#ifdef __nvapi_undef__deref_out_ecount_part
#undef __deref_out_ecount_part
#undef __nvapi_undef__deref_out_ecount_part
#endif
#ifdef __nvapi_undef__deref_out_bcount_part
#undef __deref_out_bcount_part
#undef __nvapi_undef__deref_out_bcount_part
#endif
#ifdef __nvapi_undef__deref_out_ecount_full
#undef __deref_out_ecount_full
#undef __nvapi_undef__deref_out_ecount_full
#endif
#ifdef __nvapi_undef__deref_out_bcount_full
#undef __deref_out_bcount_full
#undef __nvapi_undef__deref_out_bcount_full
#endif
#ifdef __nvapi_undef__deref_out_z
#undef __deref_out_z
#undef __nvapi_undef__deref_out_z
#endif
#ifdef __nvapi_undef__deref_out_ecount_z
#undef __deref_out_ecount_z
#undef __nvapi_undef__deref_out_ecount_z
#endif
#ifdef __nvapi_undef__deref_out_bcount_z
#undef __deref_out_bcount_z
#undef __nvapi_undef__deref_out_bcount_z
#endif
#ifdef __nvapi_undef__deref_out_nz
#undef __deref_out_nz
#undef __nvapi_undef__deref_out_nz
#endif
#ifdef __nvapi_undef__deref_out_ecount_nz
#undef __deref_out_ecount_nz
#undef __nvapi_undef__deref_out_ecount_nz
#endif
#ifdef __nvapi_undef__deref_out_bcount_nz
#undef __deref_out_bcount_nz
#undef __nvapi_undef__deref_out_bcount_nz
#endif
#ifdef __nvapi_undef__deref_inout
#undef __deref_inout
#undef __nvapi_undef__deref_inout
#endif
#ifdef __nvapi_undef__deref_inout_z
#undef __deref_inout_z
#undef __nvapi_undef__deref_inout_z
#endif
#ifdef __nvapi_undef__deref_inout_ecount
#undef __deref_inout_ecount
#undef __nvapi_undef__deref_inout_ecount
#endif
#ifdef __nvapi_undef__deref_inout_bcount
#undef __deref_inout_bcount
#undef __nvapi_undef__deref_inout_bcount
#endif
#ifdef __nvapi_undef__deref_inout_ecount_part
#undef __deref_inout_ecount_part
#undef __nvapi_undef__deref_inout_ecount_part
#endif
#ifdef __nvapi_undef__deref_inout_bcount_part
#undef __deref_inout_bcount_part
#undef __nvapi_undef__deref_inout_bcount_part
#endif
#ifdef __nvapi_undef__deref_inout_ecount_full
#undef __deref_inout_ecount_full
#undef __nvapi_undef__deref_inout_ecount_full
#endif
#ifdef __nvapi_undef__deref_inout_bcount_full
#undef __deref_inout_bcount_full
#undef __nvapi_undef__deref_inout_bcount_full
#endif
#ifdef __nvapi_undef__deref_inout_z
#undef __deref_inout_z
#undef __nvapi_undef__deref_inout_z
#endif
#ifdef __nvapi_undef__deref_inout_ecount_z
#undef __deref_inout_ecount_z
#undef __nvapi_undef__deref_inout_ecount_z
#endif
#ifdef __nvapi_undef__deref_inout_bcount_z
#undef __deref_inout_bcount_z
#undef __nvapi_undef__deref_inout_bcount_z
#endif
#ifdef __nvapi_undef__deref_inout_nz
#undef __deref_inout_nz
#undef __nvapi_undef__deref_inout_nz
#endif
#ifdef __nvapi_undef__deref_inout_ecount_nz
#undef __deref_inout_ecount_nz
#undef __nvapi_undef__deref_inout_ecount_nz
#endif
#ifdef __nvapi_undef__deref_inout_bcount_nz
#undef __deref_inout_bcount_nz
#undef __nvapi_undef__deref_inout_bcount_nz
#endif
#ifdef __nvapi_undef__deref_ecount_opt
#undef __deref_ecount_opt
#undef __nvapi_undef__deref_ecount_opt
#endif
#ifdef __nvapi_undef__deref_bcount_opt
#undef __deref_bcount_opt
#undef __nvapi_undef__deref_bcount_opt
#endif
#ifdef __nvapi_undef__deref_out_opt
#undef __deref_out_opt
#undef __nvapi_undef__deref_out_opt
#endif
#ifdef __nvapi_undef__deref_out_ecount_opt
#undef __deref_out_ecount_opt
#undef __nvapi_undef__deref_out_ecount_opt
#endif
#ifdef __nvapi_undef__deref_out_bcount_opt
#undef __deref_out_bcount_opt
#undef __nvapi_undef__deref_out_bcount_opt
#endif
#ifdef __nvapi_undef__deref_out_ecount_part_opt
#undef __deref_out_ecount_part_opt
#undef __nvapi_undef__deref_out_ecount_part_opt
#endif
#ifdef __nvapi_undef__deref_out_bcount_part_opt
#undef __deref_out_bcount_part_opt
#undef __nvapi_undef__deref_out_bcount_part_opt
#endif
#ifdef __nvapi_undef__deref_out_ecount_full_opt
#undef __deref_out_ecount_full_opt
#undef __nvapi_undef__deref_out_ecount_full_opt
#endif
#ifdef __nvapi_undef__deref_out_bcount_full_opt
#undef __deref_out_bcount_full_opt
#undef __nvapi_undef__deref_out_bcount_full_opt
#endif
#ifdef __nvapi_undef__deref_out_z_opt
#undef __deref_out_z_opt
#undef __nvapi_undef__deref_out_z_opt
#endif
#ifdef __nvapi_undef__deref_out_ecount_z_opt
#undef __deref_out_ecount_z_opt
#undef __nvapi_undef__deref_out_ecount_z_opt
#endif
#ifdef __nvapi_undef__deref_out_bcount_z_opt
#undef __deref_out_bcount_z_opt
#undef __nvapi_undef__deref_out_bcount_z_opt
#endif
#ifdef __nvapi_undef__deref_out_nz_opt
#undef __deref_out_nz_opt
#undef __nvapi_undef__deref_out_nz_opt
#endif
#ifdef __nvapi_undef__deref_out_ecount_nz_opt
#undef __deref_out_ecount_nz_opt
#undef __nvapi_undef__deref_out_ecount_nz_opt
#endif
#ifdef __nvapi_undef__deref_out_bcount_nz_opt
#undef __deref_out_bcount_nz_opt
#undef __nvapi_undef__deref_out_bcount_nz_opt
#endif
#ifdef __nvapi_undef__deref_inout_opt
#undef __deref_inout_opt
#undef __nvapi_undef__deref_inout_opt
#endif
#ifdef __nvapi_undef__deref_inout_ecount_opt
#undef __deref_inout_ecount_opt
#undef __nvapi_undef__deref_inout_ecount_opt
#endif
#ifdef __nvapi_undef__deref_inout_bcount_opt
#undef __deref_inout_bcount_opt
#undef __nvapi_undef__deref_inout_bcount_opt
#endif
#ifdef __nvapi_undef__deref_inout_ecount_part_opt
#undef __deref_inout_ecount_part_opt
#undef __nvapi_undef__deref_inout_ecount_part_opt
#endif
#ifdef __nvapi_undef__deref_inout_bcount_part_opt
#undef __deref_inout_bcount_part_opt
#undef __nvapi_undef__deref_inout_bcount_part_opt
#endif
#ifdef __nvapi_undef__deref_inout_ecount_full_opt
#undef __deref_inout_ecount_full_opt
#undef __nvapi_undef__deref_inout_ecount_full_opt
#endif
#ifdef __nvapi_undef__deref_inout_bcount_full_opt
#undef __deref_inout_bcount_full_opt
#undef __nvapi_undef__deref_inout_bcount_full_opt
#endif
#ifdef __nvapi_undef__deref_inout_z_opt
#undef __deref_inout_z_opt
#undef __nvapi_undef__deref_inout_z_opt
#endif
#ifdef __nvapi_undef__deref_inout_ecount_z_opt
#undef __deref_inout_ecount_z_opt
#undef __nvapi_undef__deref_inout_ecount_z_opt
#endif
#ifdef __nvapi_undef__deref_inout_bcount_z_opt
#undef __deref_inout_bcount_z_opt
#undef __nvapi_undef__deref_inout_bcount_z_opt
#endif
#ifdef __nvapi_undef__deref_inout_nz_opt
#undef __deref_inout_nz_opt
#undef __nvapi_undef__deref_inout_nz_opt
#endif
#ifdef __nvapi_undef__deref_inout_ecount_nz_opt
#undef __deref_inout_ecount_nz_opt
#undef __nvapi_undef__deref_inout_ecount_nz_opt
#endif
#ifdef __nvapi_undef__deref_inout_bcount_nz_opt
#undef __deref_inout_bcount_nz_opt
#undef __nvapi_undef__deref_inout_bcount_nz_opt
#endif
#ifdef __nvapi_undef__deref_opt_ecount
#undef __deref_opt_ecount
#undef __nvapi_undef__deref_opt_ecount
#endif
#ifdef __nvapi_undef__deref_opt_bcount
#undef __deref_opt_bcount
#undef __nvapi_undef__deref_opt_bcount
#endif
#ifdef __nvapi_undef__deref_opt_out
#undef __deref_opt_out
#undef __nvapi_undef__deref_opt_out
#endif
#ifdef __nvapi_undef__deref_opt_out_z
#undef __deref_opt_out_z
#undef __nvapi_undef__deref_opt_out_z
#endif
#ifdef __nvapi_undef__deref_opt_out_ecount
#undef __deref_opt_out_ecount
#undef __nvapi_undef__deref_opt_out_ecount
#endif
#ifdef __nvapi_undef__deref_opt_out_bcount
#undef __deref_opt_out_bcount
#undef __nvapi_undef__deref_opt_out_bcount
#endif
#ifdef __nvapi_undef__deref_opt_out_ecount_part
#undef __deref_opt_out_ecount_part
#undef __nvapi_undef__deref_opt_out_ecount_part
#endif
#ifdef __nvapi_undef__deref_opt_out_bcount_part
#undef __deref_opt_out_bcount_part
#undef __nvapi_undef__deref_opt_out_bcount_part
#endif
#ifdef __nvapi_undef__deref_opt_out_ecount_full
#undef __deref_opt_out_ecount_full
#undef __nvapi_undef__deref_opt_out_ecount_full
#endif
#ifdef __nvapi_undef__deref_opt_out_bcount_full
#undef __deref_opt_out_bcount_full
#undef __nvapi_undef__deref_opt_out_bcount_full
#endif
#ifdef __nvapi_undef__deref_opt_inout
#undef __deref_opt_inout
#undef __nvapi_undef__deref_opt_inout
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount
#undef __deref_opt_inout_ecount
#undef __nvapi_undef__deref_opt_inout_ecount
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount
#undef __deref_opt_inout_bcount
#undef __nvapi_undef__deref_opt_inout_bcount
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_part
#undef __deref_opt_inout_ecount_part
#undef __nvapi_undef__deref_opt_inout_ecount_part
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_part
#undef __deref_opt_inout_bcount_part
#undef __nvapi_undef__deref_opt_inout_bcount_part
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_full
#undef __deref_opt_inout_ecount_full
#undef __nvapi_undef__deref_opt_inout_ecount_full
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_full
#undef __deref_opt_inout_bcount_full
#undef __nvapi_undef__deref_opt_inout_bcount_full
#endif
#ifdef __nvapi_undef__deref_opt_inout_z
#undef __deref_opt_inout_z
#undef __nvapi_undef__deref_opt_inout_z
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_z
#undef __deref_opt_inout_ecount_z
#undef __nvapi_undef__deref_opt_inout_ecount_z
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_z
#undef __deref_opt_inout_bcount_z
#undef __nvapi_undef__deref_opt_inout_bcount_z
#endif
#ifdef __nvapi_undef__deref_opt_inout_nz
#undef __deref_opt_inout_nz
#undef __nvapi_undef__deref_opt_inout_nz
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_nz
#undef __deref_opt_inout_ecount_nz
#undef __nvapi_undef__deref_opt_inout_ecount_nz
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_nz
#undef __deref_opt_inout_bcount_nz
#undef __nvapi_undef__deref_opt_inout_bcount_nz
#endif
#ifdef __nvapi_undef__deref_opt_ecount_opt
#undef __deref_opt_ecount_opt
#undef __nvapi_undef__deref_opt_ecount_opt
#endif
#ifdef __nvapi_undef__deref_opt_bcount_opt
#undef __deref_opt_bcount_opt
#undef __nvapi_undef__deref_opt_bcount_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_opt
#undef __deref_opt_out_opt
#undef __nvapi_undef__deref_opt_out_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_ecount_opt
#undef __deref_opt_out_ecount_opt
#undef __nvapi_undef__deref_opt_out_ecount_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_bcount_opt
#undef __deref_opt_out_bcount_opt
#undef __nvapi_undef__deref_opt_out_bcount_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_ecount_part_opt
#undef __deref_opt_out_ecount_part_opt
#undef __nvapi_undef__deref_opt_out_ecount_part_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_bcount_part_opt
#undef __deref_opt_out_bcount_part_opt
#undef __nvapi_undef__deref_opt_out_bcount_part_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_ecount_full_opt
#undef __deref_opt_out_ecount_full_opt
#undef __nvapi_undef__deref_opt_out_ecount_full_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_bcount_full_opt
#undef __deref_opt_out_bcount_full_opt
#undef __nvapi_undef__deref_opt_out_bcount_full_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_z_opt
#undef __deref_opt_out_z_opt
#undef __nvapi_undef__deref_opt_out_z_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_ecount_z_opt
#undef __deref_opt_out_ecount_z_opt
#undef __nvapi_undef__deref_opt_out_ecount_z_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_bcount_z_opt
#undef __deref_opt_out_bcount_z_opt
#undef __nvapi_undef__deref_opt_out_bcount_z_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_nz_opt
#undef __deref_opt_out_nz_opt
#undef __nvapi_undef__deref_opt_out_nz_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_ecount_nz_opt
#undef __deref_opt_out_ecount_nz_opt
#undef __nvapi_undef__deref_opt_out_ecount_nz_opt
#endif
#ifdef __nvapi_undef__deref_opt_out_bcount_nz_opt
#undef __deref_opt_out_bcount_nz_opt
#undef __nvapi_undef__deref_opt_out_bcount_nz_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_opt
#undef __deref_opt_inout_opt
#undef __nvapi_undef__deref_opt_inout_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_opt
#undef __deref_opt_inout_ecount_opt
#undef __nvapi_undef__deref_opt_inout_ecount_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_opt
#undef __deref_opt_inout_bcount_opt
#undef __nvapi_undef__deref_opt_inout_bcount_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_part_opt
#undef __deref_opt_inout_ecount_part_opt
#undef __nvapi_undef__deref_opt_inout_ecount_part_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_part_opt
#undef __deref_opt_inout_bcount_part_opt
#undef __nvapi_undef__deref_opt_inout_bcount_part_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_full_opt
#undef __deref_opt_inout_ecount_full_opt
#undef __nvapi_undef__deref_opt_inout_ecount_full_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_full_opt
#undef __deref_opt_inout_bcount_full_opt
#undef __nvapi_undef__deref_opt_inout_bcount_full_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_z_opt
#undef __deref_opt_inout_z_opt
#undef __nvapi_undef__deref_opt_inout_z_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_z_opt
#undef __deref_opt_inout_ecount_z_opt
#undef __nvapi_undef__deref_opt_inout_ecount_z_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_z_opt
#undef __deref_opt_inout_bcount_z_opt
#undef __nvapi_undef__deref_opt_inout_bcount_z_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_nz_opt
#undef __deref_opt_inout_nz_opt
#undef __nvapi_undef__deref_opt_inout_nz_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_ecount_nz_opt
#undef __deref_opt_inout_ecount_nz_opt
#undef __nvapi_undef__deref_opt_inout_ecount_nz_opt
#endif
#ifdef __nvapi_undef__deref_opt_inout_bcount_nz_opt
#undef __deref_opt_inout_bcount_nz_opt
#undef __nvapi_undef__deref_opt_inout_bcount_nz_opt
#endif
#ifdef __nvapi_success
#undef __success
#undef __nvapi_success
#endif
#ifdef __nvapi__Ret_notnull_
#undef __nvapi__Ret_notnull_
#undef _Ret_notnull_
#endif
#ifdef __nvapi__Post_writable_byte_size_
#undef __nvapi__Post_writable_byte_size_
#undef _Post_writable_byte_size_
#endif
#ifdef __nvapi_Outptr_
#undef __nvapi_Outptr_
#undef _Outptr_
#endif
#endif // __NVAPI_EMPTY_SAL

View File

@@ -1,812 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
// ====================================================
// SAL related support
// ====================================================
#ifndef __ecount
#define __nvapi_undef__ecount
#define __ecount(size)
#endif
#ifndef __bcount
#define __nvapi_undef__bcount
#define __bcount(size)
#endif
#ifndef __in
#define __nvapi_undef__in
#define __in
#endif
#ifndef __in_ecount
#define __nvapi_undef__in_ecount
#define __in_ecount(size)
#endif
#ifndef __in_bcount
#define __nvapi_undef__in_bcount
#define __in_bcount(size)
#endif
#ifndef __in_z
#define __nvapi_undef__in_z
#define __in_z
#endif
#ifndef __in_ecount_z
#define __nvapi_undef__in_ecount_z
#define __in_ecount_z(size)
#endif
#ifndef __in_bcount_z
#define __nvapi_undef__in_bcount_z
#define __in_bcount_z(size)
#endif
#ifndef __in_nz
#define __nvapi_undef__in_nz
#define __in_nz
#endif
#ifndef __in_ecount_nz
#define __nvapi_undef__in_ecount_nz
#define __in_ecount_nz(size)
#endif
#ifndef __in_bcount_nz
#define __nvapi_undef__in_bcount_nz
#define __in_bcount_nz(size)
#endif
#ifndef __out
#define __nvapi_undef__out
#define __out
#endif
#ifndef __out_ecount
#define __nvapi_undef__out_ecount
#define __out_ecount(size)
#endif
#ifndef __out_bcount
#define __nvapi_undef__out_bcount
#define __out_bcount(size)
#endif
#ifndef __out_ecount_part
#define __nvapi_undef__out_ecount_part
#define __out_ecount_part(size,length)
#endif
#ifndef __out_bcount_part
#define __nvapi_undef__out_bcount_part
#define __out_bcount_part(size,length)
#endif
#ifndef __out_ecount_full
#define __nvapi_undef__out_ecount_full
#define __out_ecount_full(size)
#endif
#ifndef __out_bcount_full
#define __nvapi_undef__out_bcount_full
#define __out_bcount_full(size)
#endif
#ifndef __out_z
#define __nvapi_undef__out_z
#define __out_z
#endif
#ifndef __out_z_opt
#define __nvapi_undef__out_z_opt
#define __out_z_opt
#endif
#ifndef __out_ecount_z
#define __nvapi_undef__out_ecount_z
#define __out_ecount_z(size)
#endif
#ifndef __out_bcount_z
#define __nvapi_undef__out_bcount_z
#define __out_bcount_z(size)
#endif
#ifndef __out_ecount_part_z
#define __nvapi_undef__out_ecount_part_z
#define __out_ecount_part_z(size,length)
#endif
#ifndef __out_bcount_part_z
#define __nvapi_undef__out_bcount_part_z
#define __out_bcount_part_z(size,length)
#endif
#ifndef __out_ecount_full_z
#define __nvapi_undef__out_ecount_full_z
#define __out_ecount_full_z(size)
#endif
#ifndef __out_bcount_full_z
#define __nvapi_undef__out_bcount_full_z
#define __out_bcount_full_z(size)
#endif
#ifndef __out_nz
#define __nvapi_undef__out_nz
#define __out_nz
#endif
#ifndef __out_nz_opt
#define __nvapi_undef__out_nz_opt
#define __out_nz_opt
#endif
#ifndef __out_ecount_nz
#define __nvapi_undef__out_ecount_nz
#define __out_ecount_nz(size)
#endif
#ifndef __out_bcount_nz
#define __nvapi_undef__out_bcount_nz
#define __out_bcount_nz(size)
#endif
#ifndef __inout
#define __nvapi_undef__inout
#define __inout
#endif
#ifndef __inout_ecount
#define __nvapi_undef__inout_ecount
#define __inout_ecount(size)
#endif
#ifndef __inout_bcount
#define __nvapi_undef__inout_bcount
#define __inout_bcount(size)
#endif
#ifndef __inout_ecount_part
#define __nvapi_undef__inout_ecount_part
#define __inout_ecount_part(size,length)
#endif
#ifndef __inout_bcount_part
#define __nvapi_undef__inout_bcount_part
#define __inout_bcount_part(size,length)
#endif
#ifndef __inout_ecount_full
#define __nvapi_undef__inout_ecount_full
#define __inout_ecount_full(size)
#endif
#ifndef __inout_bcount_full
#define __nvapi_undef__inout_bcount_full
#define __inout_bcount_full(size)
#endif
#ifndef __inout_z
#define __nvapi_undef__inout_z
#define __inout_z
#endif
#ifndef __inout_ecount_z
#define __nvapi_undef__inout_ecount_z
#define __inout_ecount_z(size)
#endif
#ifndef __inout_bcount_z
#define __nvapi_undef__inout_bcount_z
#define __inout_bcount_z(size)
#endif
#ifndef __inout_nz
#define __nvapi_undef__inout_nz
#define __inout_nz
#endif
#ifndef __inout_ecount_nz
#define __nvapi_undef__inout_ecount_nz
#define __inout_ecount_nz(size)
#endif
#ifndef __inout_bcount_nz
#define __nvapi_undef__inout_bcount_nz
#define __inout_bcount_nz(size)
#endif
#ifndef __ecount_opt
#define __nvapi_undef__ecount_opt
#define __ecount_opt(size)
#endif
#ifndef __bcount_opt
#define __nvapi_undef__bcount_opt
#define __bcount_opt(size)
#endif
#ifndef __in_opt
#define __nvapi_undef__in_opt
#define __in_opt
#endif
#ifndef __in_ecount_opt
#define __nvapi_undef__in_ecount_opt
#define __in_ecount_opt(size)
#endif
#ifndef __in_bcount_opt
#define __nvapi_undef__in_bcount_opt
#define __in_bcount_opt(size)
#endif
#ifndef __in_z_opt
#define __nvapi_undef__in_z_opt
#define __in_z_opt
#endif
#ifndef __in_ecount_z_opt
#define __nvapi_undef__in_ecount_z_opt
#define __in_ecount_z_opt(size)
#endif
#ifndef __in_bcount_z_opt
#define __nvapi_undef__in_bcount_z_opt
#define __in_bcount_z_opt(size)
#endif
#ifndef __in_nz_opt
#define __nvapi_undef__in_nz_opt
#define __in_nz_opt
#endif
#ifndef __in_ecount_nz_opt
#define __nvapi_undef__in_ecount_nz_opt
#define __in_ecount_nz_opt(size)
#endif
#ifndef __in_bcount_nz_opt
#define __nvapi_undef__in_bcount_nz_opt
#define __in_bcount_nz_opt(size)
#endif
#ifndef __out_opt
#define __nvapi_undef__out_opt
#define __out_opt
#endif
#ifndef __out_ecount_opt
#define __nvapi_undef__out_ecount_opt
#define __out_ecount_opt(size)
#endif
#ifndef __out_bcount_opt
#define __nvapi_undef__out_bcount_opt
#define __out_bcount_opt(size)
#endif
#ifndef __out_ecount_part_opt
#define __nvapi_undef__out_ecount_part_opt
#define __out_ecount_part_opt(size,length)
#endif
#ifndef __out_bcount_part_opt
#define __nvapi_undef__out_bcount_part_opt
#define __out_bcount_part_opt(size,length)
#endif
#ifndef __out_ecount_full_opt
#define __nvapi_undef__out_ecount_full_opt
#define __out_ecount_full_opt(size)
#endif
#ifndef __out_bcount_full_opt
#define __nvapi_undef__out_bcount_full_opt
#define __out_bcount_full_opt(size)
#endif
#ifndef __out_ecount_z_opt
#define __nvapi_undef__out_ecount_z_opt
#define __out_ecount_z_opt(size)
#endif
#ifndef __out_bcount_z_opt
#define __nvapi_undef__out_bcount_z_opt
#define __out_bcount_z_opt(size)
#endif
#ifndef __out_ecount_part_z_opt
#define __nvapi_undef__out_ecount_part_z_opt
#define __out_ecount_part_z_opt(size,length)
#endif
#ifndef __out_bcount_part_z_opt
#define __nvapi_undef__out_bcount_part_z_opt
#define __out_bcount_part_z_opt(size,length)
#endif
#ifndef __out_ecount_full_z_opt
#define __nvapi_undef__out_ecount_full_z_opt
#define __out_ecount_full_z_opt(size)
#endif
#ifndef __out_bcount_full_z_opt
#define __nvapi_undef__out_bcount_full_z_opt
#define __out_bcount_full_z_opt(size)
#endif
#ifndef __out_ecount_nz_opt
#define __nvapi_undef__out_ecount_nz_opt
#define __out_ecount_nz_opt(size)
#endif
#ifndef __out_bcount_nz_opt
#define __nvapi_undef__out_bcount_nz_opt
#define __out_bcount_nz_opt(size)
#endif
#ifndef __inout_opt
#define __nvapi_undef__inout_opt
#define __inout_opt
#endif
#ifndef __inout_ecount_opt
#define __nvapi_undef__inout_ecount_opt
#define __inout_ecount_opt(size)
#endif
#ifndef __inout_bcount_opt
#define __nvapi_undef__inout_bcount_opt
#define __inout_bcount_opt(size)
#endif
#ifndef __inout_ecount_part_opt
#define __nvapi_undef__inout_ecount_part_opt
#define __inout_ecount_part_opt(size,length)
#endif
#ifndef __inout_bcount_part_opt
#define __nvapi_undef__inout_bcount_part_opt
#define __inout_bcount_part_opt(size,length)
#endif
#ifndef __inout_ecount_full_opt
#define __nvapi_undef__inout_ecount_full_opt
#define __inout_ecount_full_opt(size)
#endif
#ifndef __inout_bcount_full_opt
#define __nvapi_undef__inout_bcount_full_opt
#define __inout_bcount_full_opt(size)
#endif
#ifndef __inout_z_opt
#define __nvapi_undef__inout_z_opt
#define __inout_z_opt
#endif
#ifndef __inout_ecount_z_opt
#define __nvapi_undef__inout_ecount_z_opt
#define __inout_ecount_z_opt(size)
#endif
#ifndef __inout_ecount_z_opt
#define __nvapi_undef__inout_ecount_z_opt
#define __inout_ecount_z_opt(size)
#endif
#ifndef __inout_bcount_z_opt
#define __nvapi_undef__inout_bcount_z_opt
#define __inout_bcount_z_opt(size)
#endif
#ifndef __inout_nz_opt
#define __nvapi_undef__inout_nz_opt
#define __inout_nz_opt
#endif
#ifndef __inout_ecount_nz_opt
#define __nvapi_undef__inout_ecount_nz_opt
#define __inout_ecount_nz_opt(size)
#endif
#ifndef __inout_bcount_nz_opt
#define __nvapi_undef__inout_bcount_nz_opt
#define __inout_bcount_nz_opt(size)
#endif
#ifndef __deref_ecount
#define __nvapi_undef__deref_ecount
#define __deref_ecount(size)
#endif
#ifndef __deref_bcount
#define __nvapi_undef__deref_bcount
#define __deref_bcount(size)
#endif
#ifndef __deref_out
#define __nvapi_undef__deref_out
#define __deref_out
#endif
#ifndef __deref_out_ecount
#define __nvapi_undef__deref_out_ecount
#define __deref_out_ecount(size)
#endif
#ifndef __deref_out_bcount
#define __nvapi_undef__deref_out_bcount
#define __deref_out_bcount(size)
#endif
#ifndef __deref_out_ecount_part
#define __nvapi_undef__deref_out_ecount_part
#define __deref_out_ecount_part(size,length)
#endif
#ifndef __deref_out_bcount_part
#define __nvapi_undef__deref_out_bcount_part
#define __deref_out_bcount_part(size,length)
#endif
#ifndef __deref_out_ecount_full
#define __nvapi_undef__deref_out_ecount_full
#define __deref_out_ecount_full(size)
#endif
#ifndef __deref_out_bcount_full
#define __nvapi_undef__deref_out_bcount_full
#define __deref_out_bcount_full(size)
#endif
#ifndef __deref_out_z
#define __nvapi_undef__deref_out_z
#define __deref_out_z
#endif
#ifndef __deref_out_ecount_z
#define __nvapi_undef__deref_out_ecount_z
#define __deref_out_ecount_z(size)
#endif
#ifndef __deref_out_bcount_z
#define __nvapi_undef__deref_out_bcount_z
#define __deref_out_bcount_z(size)
#endif
#ifndef __deref_out_nz
#define __nvapi_undef__deref_out_nz
#define __deref_out_nz
#endif
#ifndef __deref_out_ecount_nz
#define __nvapi_undef__deref_out_ecount_nz
#define __deref_out_ecount_nz(size)
#endif
#ifndef __deref_out_bcount_nz
#define __nvapi_undef__deref_out_bcount_nz
#define __deref_out_bcount_nz(size)
#endif
#ifndef __deref_inout
#define __nvapi_undef__deref_inout
#define __deref_inout
#endif
#ifndef __deref_inout_z
#define __nvapi_undef__deref_inout_z
#define __deref_inout_z
#endif
#ifndef __deref_inout_ecount
#define __nvapi_undef__deref_inout_ecount
#define __deref_inout_ecount(size)
#endif
#ifndef __deref_inout_bcount
#define __nvapi_undef__deref_inout_bcount
#define __deref_inout_bcount(size)
#endif
#ifndef __deref_inout_ecount_part
#define __nvapi_undef__deref_inout_ecount_part
#define __deref_inout_ecount_part(size,length)
#endif
#ifndef __deref_inout_bcount_part
#define __nvapi_undef__deref_inout_bcount_part
#define __deref_inout_bcount_part(size,length)
#endif
#ifndef __deref_inout_ecount_full
#define __nvapi_undef__deref_inout_ecount_full
#define __deref_inout_ecount_full(size)
#endif
#ifndef __deref_inout_bcount_full
#define __nvapi_undef__deref_inout_bcount_full
#define __deref_inout_bcount_full(size)
#endif
#ifndef __deref_inout_z
#define __nvapi_undef__deref_inout_z
#define __deref_inout_z
#endif
#ifndef __deref_inout_ecount_z
#define __nvapi_undef__deref_inout_ecount_z
#define __deref_inout_ecount_z(size)
#endif
#ifndef __deref_inout_bcount_z
#define __nvapi_undef__deref_inout_bcount_z
#define __deref_inout_bcount_z(size)
#endif
#ifndef __deref_inout_nz
#define __nvapi_undef__deref_inout_nz
#define __deref_inout_nz
#endif
#ifndef __deref_inout_ecount_nz
#define __nvapi_undef__deref_inout_ecount_nz
#define __deref_inout_ecount_nz(size)
#endif
#ifndef __deref_inout_bcount_nz
#define __nvapi_undef__deref_inout_bcount_nz
#define __deref_inout_bcount_nz(size)
#endif
#ifndef __deref_ecount_opt
#define __nvapi_undef__deref_ecount_opt
#define __deref_ecount_opt(size)
#endif
#ifndef __deref_bcount_opt
#define __nvapi_undef__deref_bcount_opt
#define __deref_bcount_opt(size)
#endif
#ifndef __deref_out_opt
#define __nvapi_undef__deref_out_opt
#define __deref_out_opt
#endif
#ifndef __deref_out_ecount_opt
#define __nvapi_undef__deref_out_ecount_opt
#define __deref_out_ecount_opt(size)
#endif
#ifndef __deref_out_bcount_opt
#define __nvapi_undef__deref_out_bcount_opt
#define __deref_out_bcount_opt(size)
#endif
#ifndef __deref_out_ecount_part_opt
#define __nvapi_undef__deref_out_ecount_part_opt
#define __deref_out_ecount_part_opt(size,length)
#endif
#ifndef __deref_out_bcount_part_opt
#define __nvapi_undef__deref_out_bcount_part_opt
#define __deref_out_bcount_part_opt(size,length)
#endif
#ifndef __deref_out_ecount_full_opt
#define __nvapi_undef__deref_out_ecount_full_opt
#define __deref_out_ecount_full_opt(size)
#endif
#ifndef __deref_out_bcount_full_opt
#define __nvapi_undef__deref_out_bcount_full_opt
#define __deref_out_bcount_full_opt(size)
#endif
#ifndef __deref_out_z_opt
#define __nvapi_undef__deref_out_z_opt
#define __deref_out_z_opt
#endif
#ifndef __deref_out_ecount_z_opt
#define __nvapi_undef__deref_out_ecount_z_opt
#define __deref_out_ecount_z_opt(size)
#endif
#ifndef __deref_out_bcount_z_opt
#define __nvapi_undef__deref_out_bcount_z_opt
#define __deref_out_bcount_z_opt(size)
#endif
#ifndef __deref_out_nz_opt
#define __nvapi_undef__deref_out_nz_opt
#define __deref_out_nz_opt
#endif
#ifndef __deref_out_ecount_nz_opt
#define __nvapi_undef__deref_out_ecount_nz_opt
#define __deref_out_ecount_nz_opt(size)
#endif
#ifndef __deref_out_bcount_nz_opt
#define __nvapi_undef__deref_out_bcount_nz_opt
#define __deref_out_bcount_nz_opt(size)
#endif
#ifndef __deref_inout_opt
#define __nvapi_undef__deref_inout_opt
#define __deref_inout_opt
#endif
#ifndef __deref_inout_ecount_opt
#define __nvapi_undef__deref_inout_ecount_opt
#define __deref_inout_ecount_opt(size)
#endif
#ifndef __deref_inout_bcount_opt
#define __nvapi_undef__deref_inout_bcount_opt
#define __deref_inout_bcount_opt(size)
#endif
#ifndef __deref_inout_ecount_part_opt
#define __nvapi_undef__deref_inout_ecount_part_opt
#define __deref_inout_ecount_part_opt(size,length)
#endif
#ifndef __deref_inout_bcount_part_opt
#define __nvapi_undef__deref_inout_bcount_part_opt
#define __deref_inout_bcount_part_opt(size,length)
#endif
#ifndef __deref_inout_ecount_full_opt
#define __nvapi_undef__deref_inout_ecount_full_opt
#define __deref_inout_ecount_full_opt(size)
#endif
#ifndef __deref_inout_bcount_full_opt
#define __nvapi_undef__deref_inout_bcount_full_opt
#define __deref_inout_bcount_full_opt(size)
#endif
#ifndef __deref_inout_z_opt
#define __nvapi_undef__deref_inout_z_opt
#define __deref_inout_z_opt
#endif
#ifndef __deref_inout_ecount_z_opt
#define __nvapi_undef__deref_inout_ecount_z_opt
#define __deref_inout_ecount_z_opt(size)
#endif
#ifndef __deref_inout_bcount_z_opt
#define __nvapi_undef__deref_inout_bcount_z_opt
#define __deref_inout_bcount_z_opt(size)
#endif
#ifndef __deref_inout_nz_opt
#define __nvapi_undef__deref_inout_nz_opt
#define __deref_inout_nz_opt
#endif
#ifndef __deref_inout_ecount_nz_opt
#define __nvapi_undef__deref_inout_ecount_nz_opt
#define __deref_inout_ecount_nz_opt(size)
#endif
#ifndef __deref_inout_bcount_nz_opt
#define __nvapi_undef__deref_inout_bcount_nz_opt
#define __deref_inout_bcount_nz_opt(size)
#endif
#ifndef __deref_opt_ecount
#define __nvapi_undef__deref_opt_ecount
#define __deref_opt_ecount(size)
#endif
#ifndef __deref_opt_bcount
#define __nvapi_undef__deref_opt_bcount
#define __deref_opt_bcount(size)
#endif
#ifndef __deref_opt_out
#define __nvapi_undef__deref_opt_out
#define __deref_opt_out
#endif
#ifndef __deref_opt_out_z
#define __nvapi_undef__deref_opt_out_z
#define __deref_opt_out_z
#endif
#ifndef __deref_opt_out_ecount
#define __nvapi_undef__deref_opt_out_ecount
#define __deref_opt_out_ecount(size)
#endif
#ifndef __deref_opt_out_bcount
#define __nvapi_undef__deref_opt_out_bcount
#define __deref_opt_out_bcount(size)
#endif
#ifndef __deref_opt_out_ecount_part
#define __nvapi_undef__deref_opt_out_ecount_part
#define __deref_opt_out_ecount_part(size,length)
#endif
#ifndef __deref_opt_out_bcount_part
#define __nvapi_undef__deref_opt_out_bcount_part
#define __deref_opt_out_bcount_part(size,length)
#endif
#ifndef __deref_opt_out_ecount_full
#define __nvapi_undef__deref_opt_out_ecount_full
#define __deref_opt_out_ecount_full(size)
#endif
#ifndef __deref_opt_out_bcount_full
#define __nvapi_undef__deref_opt_out_bcount_full
#define __deref_opt_out_bcount_full(size)
#endif
#ifndef __deref_opt_inout
#define __nvapi_undef__deref_opt_inout
#define __deref_opt_inout
#endif
#ifndef __deref_opt_inout_ecount
#define __nvapi_undef__deref_opt_inout_ecount
#define __deref_opt_inout_ecount(size)
#endif
#ifndef __deref_opt_inout_bcount
#define __nvapi_undef__deref_opt_inout_bcount
#define __deref_opt_inout_bcount(size)
#endif
#ifndef __deref_opt_inout_ecount_part
#define __nvapi_undef__deref_opt_inout_ecount_part
#define __deref_opt_inout_ecount_part(size,length)
#endif
#ifndef __deref_opt_inout_bcount_part
#define __nvapi_undef__deref_opt_inout_bcount_part
#define __deref_opt_inout_bcount_part(size,length)
#endif
#ifndef __deref_opt_inout_ecount_full
#define __nvapi_undef__deref_opt_inout_ecount_full
#define __deref_opt_inout_ecount_full(size)
#endif
#ifndef __deref_opt_inout_bcount_full
#define __nvapi_undef__deref_opt_inout_bcount_full
#define __deref_opt_inout_bcount_full(size)
#endif
#ifndef __deref_opt_inout_z
#define __nvapi_undef__deref_opt_inout_z
#define __deref_opt_inout_z
#endif
#ifndef __deref_opt_inout_ecount_z
#define __nvapi_undef__deref_opt_inout_ecount_z
#define __deref_opt_inout_ecount_z(size)
#endif
#ifndef __deref_opt_inout_bcount_z
#define __nvapi_undef__deref_opt_inout_bcount_z
#define __deref_opt_inout_bcount_z(size)
#endif
#ifndef __deref_opt_inout_nz
#define __nvapi_undef__deref_opt_inout_nz
#define __deref_opt_inout_nz
#endif
#ifndef __deref_opt_inout_ecount_nz
#define __nvapi_undef__deref_opt_inout_ecount_nz
#define __deref_opt_inout_ecount_nz(size)
#endif
#ifndef __deref_opt_inout_bcount_nz
#define __nvapi_undef__deref_opt_inout_bcount_nz
#define __deref_opt_inout_bcount_nz(size)
#endif
#ifndef __deref_opt_ecount_opt
#define __nvapi_undef__deref_opt_ecount_opt
#define __deref_opt_ecount_opt(size)
#endif
#ifndef __deref_opt_bcount_opt
#define __nvapi_undef__deref_opt_bcount_opt
#define __deref_opt_bcount_opt(size)
#endif
#ifndef __deref_opt_out_opt
#define __nvapi_undef__deref_opt_out_opt
#define __deref_opt_out_opt
#endif
#ifndef __deref_opt_out_ecount_opt
#define __nvapi_undef__deref_opt_out_ecount_opt
#define __deref_opt_out_ecount_opt(size)
#endif
#ifndef __deref_opt_out_bcount_opt
#define __nvapi_undef__deref_opt_out_bcount_opt
#define __deref_opt_out_bcount_opt(size)
#endif
#ifndef __deref_opt_out_ecount_part_opt
#define __nvapi_undef__deref_opt_out_ecount_part_opt
#define __deref_opt_out_ecount_part_opt(size,length)
#endif
#ifndef __deref_opt_out_bcount_part_opt
#define __nvapi_undef__deref_opt_out_bcount_part_opt
#define __deref_opt_out_bcount_part_opt(size,length)
#endif
#ifndef __deref_opt_out_ecount_full_opt
#define __nvapi_undef__deref_opt_out_ecount_full_opt
#define __deref_opt_out_ecount_full_opt(size)
#endif
#ifndef __deref_opt_out_bcount_full_opt
#define __nvapi_undef__deref_opt_out_bcount_full_opt
#define __deref_opt_out_bcount_full_opt(size)
#endif
#ifndef __deref_opt_out_z_opt
#define __nvapi_undef__deref_opt_out_z_opt
#define __deref_opt_out_z_opt
#endif
#ifndef __deref_opt_out_ecount_z_opt
#define __nvapi_undef__deref_opt_out_ecount_z_opt
#define __deref_opt_out_ecount_z_opt(size)
#endif
#ifndef __deref_opt_out_bcount_z_opt
#define __nvapi_undef__deref_opt_out_bcount_z_opt
#define __deref_opt_out_bcount_z_opt(size)
#endif
#ifndef __deref_opt_out_nz_opt
#define __nvapi_undef__deref_opt_out_nz_opt
#define __deref_opt_out_nz_opt
#endif
#ifndef __deref_opt_out_ecount_nz_opt
#define __nvapi_undef__deref_opt_out_ecount_nz_opt
#define __deref_opt_out_ecount_nz_opt(size)
#endif
#ifndef __deref_opt_out_bcount_nz_opt
#define __nvapi_undef__deref_opt_out_bcount_nz_opt
#define __deref_opt_out_bcount_nz_opt(size)
#endif
#ifndef __deref_opt_inout_opt
#define __nvapi_undef__deref_opt_inout_opt
#define __deref_opt_inout_opt
#endif
#ifndef __deref_opt_inout_ecount_opt
#define __nvapi_undef__deref_opt_inout_ecount_opt
#define __deref_opt_inout_ecount_opt(size)
#endif
#ifndef __deref_opt_inout_bcount_opt
#define __nvapi_undef__deref_opt_inout_bcount_opt
#define __deref_opt_inout_bcount_opt(size)
#endif
#ifndef __deref_opt_inout_ecount_part_opt
#define __nvapi_undef__deref_opt_inout_ecount_part_opt
#define __deref_opt_inout_ecount_part_opt(size,length)
#endif
#ifndef __deref_opt_inout_bcount_part_opt
#define __nvapi_undef__deref_opt_inout_bcount_part_opt
#define __deref_opt_inout_bcount_part_opt(size,length)
#endif
#ifndef __deref_opt_inout_ecount_full_opt
#define __nvapi_undef__deref_opt_inout_ecount_full_opt
#define __deref_opt_inout_ecount_full_opt(size)
#endif
#ifndef __deref_opt_inout_bcount_full_opt
#define __nvapi_undef__deref_opt_inout_bcount_full_opt
#define __deref_opt_inout_bcount_full_opt(size)
#endif
#ifndef __deref_opt_inout_z_opt
#define __nvapi_undef__deref_opt_inout_z_opt
#define __deref_opt_inout_z_opt
#endif
#ifndef __deref_opt_inout_ecount_z_opt
#define __nvapi_undef__deref_opt_inout_ecount_z_opt
#define __deref_opt_inout_ecount_z_opt(size)
#endif
#ifndef __deref_opt_inout_bcount_z_opt
#define __nvapi_undef__deref_opt_inout_bcount_z_opt
#define __deref_opt_inout_bcount_z_opt(size)
#endif
#ifndef __deref_opt_inout_nz_opt
#define __nvapi_undef__deref_opt_inout_nz_opt
#define __deref_opt_inout_nz_opt
#endif
#ifndef __deref_opt_inout_ecount_nz_opt
#define __nvapi_undef__deref_opt_inout_ecount_nz_opt
#define __deref_opt_inout_ecount_nz_opt(size)
#endif
#ifndef __deref_opt_inout_bcount_nz_opt
#define __nvapi_undef__deref_opt_inout_bcount_nz_opt
#define __deref_opt_inout_bcount_nz_opt(size)
#endif
#ifndef __success
#define __nvapi_success
#define __success(epxr)
#endif
#ifndef _Ret_notnull_
#define __nvapi__Ret_notnull_
#define _Ret_notnull_
#endif
#ifndef _Post_writable_byte_size_
#define __nvapi__Post_writable_byte_size_
#define _Post_writable_byte_size_(n)
#endif
#ifndef _Outptr_
#define __nvapi_Outptr_
#define _Outptr_
#endif
#define NVAPI_INTERFACE extern __success(return == NVAPI_OK) NvAPI_Status __cdecl

View File

@@ -1,247 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
#pragma once
#include"imports/nvapi/nvapi_lite_salstart.h"
#include"imports/nvapi/nvapi_lite_common.h"
#pragma pack(push,8)
#ifdef __cplusplus
extern "C" {
#endif
//-----------------------------------------------------------------------------
// DirectX APIs
//-----------------------------------------------------------------------------
//! \ingroup dx
//! Used in NvAPI_D3D10_GetCurrentSLIState(), and NvAPI_D3D_GetCurrentSLIState().
typedef struct
{
NvU32 version; //!< Structure version
NvU32 maxNumAFRGroups; //!< [OUT] The maximum possible value of numAFRGroups
NvU32 numAFRGroups; //!< [OUT] The number of AFR groups enabled in the system
NvU32 currentAFRIndex; //!< [OUT] The AFR group index for the frame currently being rendered
NvU32 nextFrameAFRIndex; //!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present)
NvU32 previousFrameAFRIndex; //!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet)
NvU32 bIsCurAFRGroupNew; //!< [OUT] Boolean: Is this frame the first time running on the current AFR group
} NV_GET_CURRENT_SLI_STATE_V1;
typedef struct
{
NvU32 version; //!< Structure version
NvU32 maxNumAFRGroups; //!< [OUT] The maximum possible value of numAFRGroups
NvU32 numAFRGroups; //!< [OUT] The number of AFR groups enabled in the system
NvU32 currentAFRIndex; //!< [OUT] The AFR group index for the frame currently being rendered
NvU32 nextFrameAFRIndex; //!< [OUT] What the AFR group index will be for the next frame (i.e. after calling Present)
NvU32 previousFrameAFRIndex; //!< [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet)
NvU32 bIsCurAFRGroupNew; //!< [OUT] Boolean: Is this frame the first time running on the current AFR group
NvU32 numVRSLIGpus; //!< [OUT] The number of GPUs used in VR-SLI. If it is 0 VR-SLI is not active
} NV_GET_CURRENT_SLI_STATE_V2;
//! \ingroup dx
#define NV_GET_CURRENT_SLI_STATE_VER1 MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE_V1,1)
#define NV_GET_CURRENT_SLI_STATE_VER2 MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE_V2,1)
#define NV_GET_CURRENT_SLI_STATE_VER NV_GET_CURRENT_SLI_STATE_VER2
#define NV_GET_CURRENT_SLI_STATE NV_GET_CURRENT_SLI_STATE_V2
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_D3D_GetCurrentSLIState
//
//! DESCRIPTION: This function returns the current SLI state for the specified device. The structure
//! contains the number of AFR groups, the current AFR group index,
//! and what the AFR group index will be for the next frame. \p
//! pDevice can be either a IDirect3DDevice9 or ID3D10Device pointer.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 173
//!
//! \retval NVAPI_OK Completed request
//! \retval NVAPI_ERROR Error occurred
//!
//! \ingroup dx
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_D3D_GetCurrentSLIState(IUnknown *pDevice, NV_GET_CURRENT_SLI_STATE *pSliState);
#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_D3D_SetResourceHint
//
//! \fn NvAPI_D3D_SetResourceHint(IUnknown *pDev, NVDX_ObjectHandle obj,
//! NVAPI_D3D_SETRESOURCEHINT_CATEGORY dwHintCategory,
//! NvU32 dwHintName,
//! NvU32 *pdwHintValue)
//!
//! DESCRIPTION: This is a general purpose function for passing down various resource
//! related hints to the driver. Hints are divided into categories
//! and types within each category. For DX11 devices this function is free-threaded.
//! An application is responsible to complete this call before making use of the resource
//! in a rendering context (therefore applying inter-thread synchronization as appropriate).
//! As a debug help to an application the driver enforces that a resource in this call was never bound.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 185
//!
//! \param [in] pDev The ID3D10Device or IDirect3DDevice9 that is a using the resource
//! \param [in] obj Previously obtained HV resource handle
//! \param [in] dwHintCategory Category of the hints
//! \param [in] dwHintName A hint within this category
//! \param [in/out] *pdwHintValue Pointer to location containing hint value, function returns previous hint value in this slot
//!
//! \return an int which could be an NvAPI status or DX HRESULT code
//!
//! \retval ::NVAPI_OK
//! \retval ::NVAPI_INVALID_ARGUMENT
//! \retval ::NVAPI_INVALID_CALL It is illegal to change a hint dynamically when the resource is already bound.
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//! \ingroup dx
//! Valid categories for NvAPI_D3D_SetResourceHint()
typedef enum _NVAPI_D3D_SETRESOURCEHINT_CATEGORY
{
NVAPI_D3D_SRH_CATEGORY_SLI = 1
} NVAPI_D3D_SETRESOURCEHINT_CATEGORY;
//
// NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC:
// NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USING:
// NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC:
//! \ingroup dx
//! Types of SLI hints; \n
//! NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC: Valid values : 0 or 1 \n
//! Default value: 0 \n
//! Explanation: If the value is 1, the driver will not track any rendering operations that would mark this resource as dirty,
//! avoiding any form of synchronization across frames rendered in parallel in multiple GPUs in AFR mode.
//!
//! NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USAGE: Valid values : 0 or 1 \n
//! Default value: 0 \n
//! Explanation: If the value is 1, the driver will try to perform operations which involved target resource in broadcast,
//! where it's possible. Hint is static and must be set before resource starts using.
//!
//! NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC: Valid values : 0 or 1 \n
//! Default value: 0 \n
//! Explanation: If the value is 1, the driver will do dirty resource resolve regardless of discard flags in the application profile or
//! AFR-FriendlyD3DHints.exe name using.
//!
typedef enum _NVAPI_D3D_SETRESOURCEHINT_SLI
{
NVAPI_D3D_SRH_SLI_APP_CONTROLLED_INTERFRAME_CONTENT_SYNC = 1,
NVAPI_D3D_SRH_SLI_ASK_FOR_BROADCAST_USAGE = 2,
NVAPI_D3D_SRH_SLI_RESPECT_DRIVER_INTERFRAME_CONTENT_SYNC = 3
} NVAPI_D3D_SETRESOURCEHINT_SLI;
//! \ingroup dx
NVAPI_INTERFACE NvAPI_D3D_SetResourceHint(IUnknown *pDev, NVDX_ObjectHandle obj,
NVAPI_D3D_SETRESOURCEHINT_CATEGORY dwHintCategory,
NvU32 dwHintName,
NvU32 *pdwHintValue);
#endif //defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_D3D_BeginResourceRendering
//
//! \fn NvAPI_D3D_BeginResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags)
//! DESCRIPTION: This function tells the driver that the resource will begin to receive updates. It must be used in combination with NvAPI_D3D_EndResourceRendering().
//! The primary use of this function is allow the driver to initiate early inter-frame synchronization of resources while running in AFR SLI mode.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 185
//!
//! \param [in] pDev IDirect3DDevice9, ID3D10Device, ID3D11Device or ID3D11DeviceContext that is using the resource
//! \param [in] obj Previously obtained HV resource handle
//! \param [in] Flags The flags for functionality applied to resource while being used.
//!
//! \retval ::NVAPI_OK Function succeeded, if used properly and driver can initiate proper sync'ing of the resources.
//! \retval ::NVAPI_INVALID_ARGUMENT Bad argument(s) or invalid flag values
//! \retval ::NVAPI_INVALID_CALL Mismatched begin/end calls
//
///////////////////////////////////////////////////////////////////////////////
//! \ingroup dx
//! Used in NvAPI_D3D_BeginResourceRendering().
typedef enum _NVAPI_D3D_RESOURCERENDERING_FLAG
{
NVAPI_D3D_RR_FLAG_DEFAULTS = 0x00000000, //!< All bits set to 0 are defaults.
NVAPI_D3D_RR_FLAG_FORCE_DISCARD_CONTENT = 0x00000001, //!< (bit 0) The flag forces to discard previous content of the resource regardless of the NvApiHints_Sli_Disable_InterframeSync hint
NVAPI_D3D_RR_FLAG_FORCE_KEEP_CONTENT = 0x00000002, //!< (bit 1) The flag forces to respect previous content of the resource regardless of the NvApiHints_Sli_Disable_InterframeSync hint
NVAPI_D3D_RR_FLAG_MULTI_FRAME = 0x00000004 //!< (bit 2) The flag hints the driver that content will be used for many frames. If not specified then the driver assumes that content is used only on the next frame
} NVAPI_D3D_RESOURCERENDERING_FLAG;
//! \ingroup dx
NVAPI_INTERFACE NvAPI_D3D_BeginResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags);
#endif //defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_D3D_EndResourceRendering
//
//! DESCRIPTION: This function tells the driver that the resource is done receiving updates. It must be used in combination with
//! NvAPI_D3D_BeginResourceRendering().
//! The primary use of this function is allow the driver to initiate early inter-frame syncs of resources while running in AFR SLI mode.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 185
//!
//! \param [in] pDev IDirect3DDevice9, ID3D10Device, ID3D11Device or ID3D11DeviceContext that is using the resource
//! \param [in] obj Previously obtained HV resource handle
//! \param [in] Flags Reserved, must be zero
//
//! \retval ::NVAPI_OK Function succeeded, if used properly and driver can initiate proper sync'ing of the resources.
//! \retval ::NVAPI_INVALID_ARGUMENT Bad argument(s) or invalid flag values
//! \retval ::NVAPI_INVALID_CALL Mismatched begin/end calls
//!
//! \ingroup dx
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_D3D_EndResourceRendering(IUnknown *pDeviceOrContext, NVDX_ObjectHandle obj, NvU32 Flags);
#endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
#include"imports/nvapi/nvapi_lite_salend.h"
#ifdef __cplusplus
}
#endif
#pragma pack(pop)

View File

@@ -1,592 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
#pragma once
#include"imports/nvapi/nvapi_lite_salstart.h"
#include"imports/nvapi/nvapi_lite_common.h"
#pragma pack(push,8)
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_Enable
//
//! DESCRIPTION: This APU enables stereo mode in the registry.
//! Calls to this function affect the entire system.
//! If stereo is not enabled, then calls to functions that require that stereo is enabled have no effect,
//! and will return the appropriate error code.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \retval ::NVAPI_OK Stereo is now enabled.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_Enable(void);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_Disable
//
//! DESCRIPTION: This API disables stereo mode in the registry.
//! Calls to this function affect the entire system.
//! If stereo is not enabled, then calls to functions that require that stereo is enabled have no effect,
//! and will return the appropriate error code.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \retval ::NVAPI_OK Stereo is now disabled.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_Disable(void);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_IsEnabled
//
//! DESCRIPTION: This API checks if stereo mode is enabled in the registry.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [out] pIsStereoEnabled Address where the result of the inquiry will be placed.
//!
//! \retval ::NVAPI_OK Check was sucessfully completed and result reflects current state of stereo availability.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_IsEnabled(NvU8 *pIsStereoEnabled);
#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)|| defined(__d3d12_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_CreateHandleFromIUnknown
//
//! DESCRIPTION: This API creates a stereo handle that is used in subsequent calls related to a given device interface.
//! This must be called before any other NvAPI_Stereo_ function for that handle.
//! Multiple devices can be used at one time using multiple calls to this function (one per each device).
//!
//! HOW TO USE: After the Direct3D device is created, create the stereo handle.
//! On call success:
//! -# Use all other NvAPI_Stereo_ functions that have stereo handle as first parameter.
//! -# After the device interface that corresponds to the the stereo handle is destroyed,
//! the application should call NvAPI_DestroyStereoHandle() for that stereo handle.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] pDevice Pointer to IUnknown interface that is IDirect3DDevice9* in DX9, ID3D10Device*.
//! \param [out] pStereoHandle Pointer to the newly created stereo handle.
//!
//! \retval ::NVAPI_OK Stereo handle is created for given device interface.
//! \retval ::NVAPI_INVALID_ARGUMENT Provided device interface is invalid.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_CreateHandleFromIUnknown(IUnknown *pDevice, StereoHandle *pStereoHandle);
#endif // defined(_D3D9_H_) || defined(__d3d10_h__)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_DestroyHandle
//
//! DESCRIPTION: This API destroys the stereo handle created with one of the NvAPI_Stereo_CreateHandleFrom() functions.
//! This should be called after the device corresponding to the handle has been destroyed.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that is to be destroyed.
//!
//! \retval ::NVAPI_OK Stereo handle is destroyed.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_DestroyHandle(StereoHandle stereoHandle);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_Activate
//
//! DESCRIPTION: This API activates stereo for the device interface corresponding to the given stereo handle.
//! Activating stereo is possible only if stereo was enabled previously in the registry.
//! If stereo is not activated, then calls to functions that require that stereo is activated have no effect,
//! and will return the appropriate error code.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle corresponding to the device interface.
//!
//! \retval ::NVAPI_OK Stereo is turned on.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_Activate(StereoHandle stereoHandle);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_Deactivate
//
//! DESCRIPTION: This API deactivates stereo for the given device interface.
//! If stereo is not activated, then calls to functions that require that stereo is activated have no effect,
//! and will return the appropriate error code.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//!
//! \retval ::NVAPI_OK Stereo is turned off.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_Deactivate(StereoHandle stereoHandle);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_IsActivated
//
//! DESCRIPTION: This API checks if stereo is activated for the given device interface.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [in] pIsStereoOn Address where result of the inquiry will be placed.
//!
//! \retval ::NVAPI_OK - Check was sucessfully completed and result reflects current state of stereo (on/off).
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR - Something is wrong (generic error).
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_IsActivated(StereoHandle stereoHandle, NvU8 *pIsStereoOn);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_GetSeparation
//
//! DESCRIPTION: This API gets current separation value (in percents).
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [out] pSeparationPercentage Address of @c float type variable to store current separation percentage in.
//!
//! \retval ::NVAPI_OK Retrieval of separation percentage was successfull.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_GetSeparation(StereoHandle stereoHandle, float *pSeparationPercentage);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_SetSeparation
//
//! DESCRIPTION: This API sets separation to given percentage.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [in] newSeparationPercentage New value for separation percentage.
//!
//! \retval ::NVAPI_OK Setting of separation percentage was successfull.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_STEREO_PARAMETER_OUT_OF_RANGE Given separation percentage is out of [0..100] range.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_SetSeparation(StereoHandle stereoHandle, float newSeparationPercentage);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_GetConvergence
//
//! DESCRIPTION: This API gets the current convergence value.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [out] pConvergence Address of @c float type variable to store current convergence value in.
//!
//! \retval ::NVAPI_OK Retrieval of convergence value was successfull.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_GetConvergence(StereoHandle stereoHandle, float *pConvergence);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_SetConvergence
//
//! DESCRIPTION: This API sets convergence to the given value.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [in] newConvergence New value for convergence.
//!
//! \retval ::NVAPI_OK Setting of convergence value was successfull.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_SetConvergence(StereoHandle stereoHandle, float newConvergence);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_SetActiveEye
//
//! \fn NvAPI_Stereo_SetActiveEye(StereoHandle hStereoHandle, NV_STEREO_ACTIVE_EYE StereoEye);
//! DESCRIPTION: This API sets the back buffer to left or right in Direct stereo mode.
//!
//! HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate
//! NvAPI_Stereo_CreateHandleFrom function.
//!
//! \since Release: 285
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [in] StereoEye Defines active eye in Direct stereo mode
//!
//! \retval ::NVAPI_OK - Active eye is set.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_INVALID_ARGUMENT - StereoEye parameter has not allowed value.
//! \retval ::NVAPI_SET_NOT_ALLOWED - Current stereo mode is not Direct
//! \retval ::NVAPI_ERROR - Something is wrong (generic error).
//
///////////////////////////////////////////////////////////////////////////////
//! \ingroup stereoapi
typedef enum _NV_StereoActiveEye
{
NVAPI_STEREO_EYE_RIGHT = 1,
NVAPI_STEREO_EYE_LEFT = 2,
NVAPI_STEREO_EYE_MONO = 3,
} NV_STEREO_ACTIVE_EYE;
//! \ingroup stereoapi
NVAPI_INTERFACE NvAPI_Stereo_SetActiveEye(StereoHandle hStereoHandle, NV_STEREO_ACTIVE_EYE StereoEye);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_SetDriverMode
//
//! \fn NvAPI_Stereo_SetDriverMode( NV_STEREO_DRIVER_MODE mode );
//! DESCRIPTION: This API sets the 3D stereo driver mode: Direct or Automatic
//!
//! HOW TO USE: This API must be called before the device is created.
//! Applies to DirectX 9 and higher.
//!
//! \since Release: 285
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \param [in] mode Defines the 3D stereo driver mode: Direct or Automatic
//!
//! \retval ::NVAPI_OK Active eye is set.
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_INVALID_ARGUMENT mode parameter has not allowed value.
//! \retval ::NVAPI_ERROR Something is wrong (generic error).
//
///////////////////////////////////////////////////////////////////////////////
//! \ingroup stereoapi
typedef enum _NV_StereoDriverMode
{
NVAPI_STEREO_DRIVER_MODE_AUTOMATIC = 0,
NVAPI_STEREO_DRIVER_MODE_DIRECT = 2,
} NV_STEREO_DRIVER_MODE;
//! \ingroup stereoapi
NVAPI_INTERFACE NvAPI_Stereo_SetDriverMode( NV_STEREO_DRIVER_MODE mode );
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_GetEyeSeparation
//
//! DESCRIPTION: This API returns eye separation as a ratio of <between eye distance>/<physical screen width>.
//!
//! HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate API. Applies only to DirectX 9 and up.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [out] pSeparation Eye separation.
//!
//! \retval ::NVAPI_OK Active eye is set.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR (generic error).
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_GetEyeSeparation(StereoHandle hStereoHandle, float *pSeparation );
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_IsWindowedModeSupported
//
//! DESCRIPTION: This API returns availability of windowed mode stereo
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! \param [out] bSupported(OUT) != 0 - supported, \n
//! == 0 - is not supported
//!
//!
//! \retval ::NVAPI_OK Retrieval of frustum adjust mode was successfull.
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR Something is wrong (generic error).
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_IsWindowedModeSupported(NvU8* bSupported);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_SetSurfaceCreationMode
//
//! \function NvAPI_Stereo_SetSurfaceCreationMode(StereoHandle hStereoHandle, NVAPI_STEREO_SURFACECREATEMODE creationMode)
//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface.
//! \param [in] creationMode New surface creation mode for this device interface.
//!
//! \since Release: 285
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! DESCRIPTION: This API sets surface creation mode for this device interface.
//!
//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function.
//!
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
//! There are no return error codes with specific meaning for this API.
//!
///////////////////////////////////////////////////////////////////////////////
//! \ingroup stereoapi
typedef enum _NVAPI_STEREO_SURFACECREATEMODE
{
NVAPI_STEREO_SURFACECREATEMODE_AUTO, //!< Use driver registry profile settings for surface creation mode.
NVAPI_STEREO_SURFACECREATEMODE_FORCESTEREO, //!< Always create stereo surfaces.
NVAPI_STEREO_SURFACECREATEMODE_FORCEMONO //!< Always create mono surfaces.
} NVAPI_STEREO_SURFACECREATEMODE;
//! \ingroup stereoapi
NVAPI_INTERFACE NvAPI_Stereo_SetSurfaceCreationMode(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_SURFACECREATEMODE creationMode);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_GetSurfaceCreationMode
//
//! \function NvAPI_Stereo_GetSurfaceCreationMode(StereoHandle hStereoHandle, NVAPI_STEREO_SURFACECREATEMODE* pCreationMode)
//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface.
//! \param [out] pCreationMode The current creation mode for this device interface.
//!
//! \since Release: 295
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! DESCRIPTION: This API gets surface creation mode for this device interface.
//!
//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function.
//!
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
//! There are no return error codes with specific meaning for this API.
//!
///////////////////////////////////////////////////////////////////////////////
//! \ingroup stereoapi
NVAPI_INTERFACE NvAPI_Stereo_GetSurfaceCreationMode(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_SURFACECREATEMODE* pCreationMode);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_Debug_WasLastDrawStereoized
//
//! \param [in] hStereoHandle Stereo handle that corresponds to the device interface.
//! \param [out] pWasStereoized Address where result of the inquiry will be placed.
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! DESCRIPTION: This API checks if the last draw call was stereoized. It is a very expensive to call and should be used for debugging purpose *only*.
//!
//! WHEN TO USE: After the stereo handle for device interface is created via successful call to appropriate NvAPI_Stereo_CreateHandleFrom function.
//!
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
//! There are no return error codes with specific meaning for this API.
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_Debug_WasLastDrawStereoized(__in StereoHandle hStereoHandle, __out NvU8 *pWasStereoized);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_SetDefaultProfile
//
//!
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! DESCRIPTION: This API defines the stereo profile used by the driver in case the application has no associated profile.
//!
//! WHEN TO USE: To take effect, this API must be called before D3D device is created. Calling once a device has been created will not affect the current device.
//!
//! \param [in] szProfileName Default profile name.
//!
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
//! Error codes specific to this API are described below.
//!
//! \retval NVAPI_SUCCESS - Default stereo profile name has been copied into szProfileName.
//! \retval NVAPI_INVALID_ARGUMENT - szProfileName == NULL.
//! \retval NVAPI_DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST - Default stereo profile does not exist
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_SetDefaultProfile(__in const char* szProfileName);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Stereo_GetDefaultProfile
//
//! SUPPORTED OS: Windows 10 and higher
//!
//!
//! DESCRIPTION: This API retrieves the current default stereo profile.
//!
//! After call cbSizeOut contain 0 if default profile is not set required buffer size cbSizeOut.
//! To get needed buffer size this function can be called with szProfileName==0 and cbSizeIn == 0.
//!
//! WHEN TO USE: This API can be called at any time.
//!
//!
//! \param [in] cbSizeIn Size of buffer allocated for default stereo profile name.
//! \param [out] szProfileName Default stereo profile name.
//! \param [out] pcbSizeOut Required buffer size.
//! # ==0 - there is no default stereo profile name currently set
//! # !=0 - size of buffer required for currently set default stereo profile name including trailing '0'.
//!
//!
//! \return This API can return any of the error codes enumerated in #NvAPI_Status.
//! Error codes specific to this API are described below.
//!
//! \retval NVAPI_SUCCESS - Default stereo profile name has been copied into szProfileName.
//! \retval NVAPI_DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED - There is no default stereo profile set at this time.
//! \retval NVAPI_INVALID_ARGUMENT - pcbSizeOut == 0 or cbSizeIn >= *pcbSizeOut && szProfileName == 0
//! \retval NVAPI_INSUFFICIENT_BUFFER - cbSizeIn < *pcbSizeOut
//!
//! \ingroup stereoapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Stereo_GetDefaultProfile( __in NvU32 cbSizeIn, __out_bcount_part_opt(cbSizeIn, *pcbSizeOut) char* szProfileName, __out NvU32 *pcbSizeOut);
#include"imports/nvapi/nvapi_lite_salend.h"
#ifdef __cplusplus
}
#endif
#pragma pack(pop)

View File

@@ -1,95 +0,0 @@
/*********************************************************************************************************\
|* *|
|* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. *|
|* SPDX-License-Identifier: MIT *|
|* *|
|* Permission is hereby granted, free of charge, to any person obtaining a *|
|* copy of this software and associated documentation files (the "Software"), *|
|* to deal in the Software without restriction, including without limitation *|
|* the rights to use, copy, modify, merge, publish, distribute, sublicense, *|
|* and/or sell copies of the Software, and to permit persons to whom the *|
|* Software is furnished to do so, subject to the following conditions: *|
|* *|
|* The above copyright notice and this permission notice shall be included in *|
|* all copies or substantial portions of the Software. *|
|* *|
|* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *|
|* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *|
|* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *|
|* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *|
|* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *|
|* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *|
|* DEALINGS IN THE SOFTWARE. *|
|* *|
|* *|
\*********************************************************************************************************/
#pragma once
#include"imports/nvapi/nvapi_lite_salstart.h"
#include"imports/nvapi/nvapi_lite_common.h"
#pragma pack(push,8)
#ifdef __cplusplus
extern "C" {
#endif
//! SUPPORTED OS: Windows 10 and higher
//!
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_DISP_GetGDIPrimaryDisplayId
//
//! DESCRIPTION: This API returns the Display ID of the GDI Primary.
//!
//! \param [out] displayId Display ID of the GDI Primary display.
//!
//! \retval ::NVAPI_OK: Capabilties have been returned.
//! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND: GDI Primary not on an NVIDIA GPU.
//! \retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid.
//! \retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
//! \retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available
//! \retval ::NVAPI_ERROR: Miscellaneous error occurred
//!
//! \ingroup dispcontrol
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_DISP_GetGDIPrimaryDisplayId(NvU32* displayId);
#define NV_MOSAIC_MAX_DISPLAYS (64)
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Mosaic_GetDisplayViewportsByResolution
//
//! DESCRIPTION: This API returns the viewports that would be applied on
//! the requested display.
//!
//! \param [in] displayId Display ID of a single display in the active
//! mosaic topology to query.
//! \param [in] srcWidth Width of full display topology. If both
//! width and height are 0, the current
//! resolution is used.
//! \param [in] srcHeight Height of full display topology. If both
//! width and height are 0, the current
//! resolution is used.
//! \param [out] viewports Array of NV_RECT viewports.
//! SUPPORTED OS: Windows 10 and higher
//!
//! If the requested resolution is a single-wide
//! resolution, only viewports[0] will
//! contain the viewport details, regardless
//! of which display is driving the display.
//! \param [out] bezelCorrected Returns 1 if the requested resolution is
//! bezel corrected. May be NULL.
//!
//! \retval ::NVAPI_OK Capabilties have been returned.
//! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
//! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first
//! \retval ::NVAPI_MOSAIC_NOT_ACTIVE The display does not belong to an active Mosaic Topology
//! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available
//! \retval ::NVAPI_ERROR Miscellaneous error occurred
//!
//! \ingroup mosaicapi
///////////////////////////////////////////////////////////////////////////////
NVAPI_INTERFACE NvAPI_Mosaic_GetDisplayViewportsByResolution(NvU32 displayId, NvU32 srcWidth, NvU32 srcHeight, NV_RECT viewports[NV_MOSAIC_MAX_DISPLAYS], NvU8* bezelCorrected);
#include"imports/nvapi/nvapi_lite_salend.h"
#ifdef __cplusplus
}
#endif
#pragma pack(pop)

View File

@@ -7,7 +7,6 @@ src_iidxhook-util := \
acio.c \
chart-patch.c \
clock.c \
config-debug.c \
config-eamuse.c \
config-ezusb.c \
config-gfx.c \

View File

@@ -1,34 +0,0 @@
#include "cconfig/cconfig-util.h"
#include "iidxhook-util/config-debug.h"
#include "util/log.h"
#define IIDXHOOK_CONFIG_DEBUG_ENABLE_FRAME_PERF_GRAPH_KEY "debug.enable_frame_perf_graph"
#define IIDXHOOK_CONFIG_DEBUG_DEFAULT_ENABLE_FRAME_PERF_GRAPH_VALUE false
void iidxhook_config_debug_init(struct cconfig *config)
{
cconfig_util_set_bool(
config,
IIDXHOOK_CONFIG_DEBUG_ENABLE_FRAME_PERF_GRAPH_KEY,
IIDXHOOK_CONFIG_DEBUG_DEFAULT_ENABLE_FRAME_PERF_GRAPH_VALUE,
"Enable frame performance graph overlay");
}
void iidxhook_config_debug_get(
struct iidxhook_config_debug *config_debug, struct cconfig *config)
{
if (!cconfig_util_get_bool(
config,
IIDXHOOK_CONFIG_DEBUG_ENABLE_FRAME_PERF_GRAPH_KEY,
&config_debug->enable_frame_perf_graph,
IIDXHOOK_CONFIG_DEBUG_DEFAULT_ENABLE_FRAME_PERF_GRAPH_VALUE)) {
log_warning(
"Invalid value for key '%s' specified, fallback "
"to default '%d'",
IIDXHOOK_CONFIG_DEBUG_ENABLE_FRAME_PERF_GRAPH_KEY,
IIDXHOOK_CONFIG_DEBUG_DEFAULT_ENABLE_FRAME_PERF_GRAPH_VALUE);
}
}

View File

@@ -1,17 +0,0 @@
#ifndef IIDXHOOK_CONFIG_DEBUG_H
#define IIDXHOOK_CONFIG_DEBUG_H
#include <windows.h>
#include "cconfig/cconfig.h"
struct iidxhook_config_debug {
bool enable_frame_perf_graph;
};
void iidxhook_config_debug_init(struct cconfig *config);
void iidxhook_config_debug_get(
struct iidxhook_config_debug *config_debug, struct cconfig *config);
#endif

View File

@@ -3,9 +3,6 @@ dlls += iidxhook1
ldflags_iidxhook1 := \
-lws2_32 \
-liphlpapi \
-ld3d9 \
-ldwmapi\
-lgdi32 \
libs_iidxhook1 := \
iidxhook-util \
@@ -21,9 +18,6 @@ libs_iidxhook1 := \
cconfig \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook1 := \
config-iidxhook1.c \

View File

@@ -27,7 +27,6 @@
#include "iidxhook-util/chart-patch.h"
#include "iidxhook-util/clock.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-eamuse.h"
#include "iidxhook-util/config-ezusb.h"
#include "iidxhook-util/config-gfx.h"
@@ -42,10 +41,6 @@
#include "iidxhook1/ezusb-mon.h"
#include "iidxhook1/log-ezusb.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "util/defs.h"
#include "util/log.h"
#include "util/thread.h"
@@ -58,7 +53,6 @@
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler
};
static HANDLE STDCALL my_OpenProcess(DWORD, BOOL, DWORD);
@@ -74,17 +68,6 @@ static const struct hook_symbol init_hook_syms[] = {
},
};
static void iidxhook1_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void iidxhook1_setup_d3d9_hooks(
const struct iidxhook_config_gfx *config_gfx,
const struct iidxhook_config_iidxhook1 *config_iidxhook1)
@@ -142,7 +125,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_util_config_ezusb config_ezusb;
struct iidxhook_util_config_eamuse config_eamuse;
struct iidxhook_config_gfx config_gfx;
@@ -162,7 +144,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_util_config_ezusb_init(config);
iidxhook_util_config_eamuse_init(config);
iidxhook_config_gfx_init(config);
@@ -178,7 +159,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_util_config_ezusb_get(&config_ezusb, config);
iidxhook_util_config_eamuse_get(&config_eamuse, config);
iidxhook_config_gfx_get(&config_gfx, config);
@@ -222,8 +202,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
settings_hook_set_path(config_misc.settings_path);
}
iidxhook1_setup_imgui_debug_components(&config_debug);
/* Direct3D and USER32 hooks */
iidxhook1_setup_d3d9_hooks(&config_gfx, &config_iidxhook1);

View File

@@ -3,9 +3,6 @@ avsdlls += iidxhook2
ldflags_iidxhook2 := \
-lws2_32 \
-liphlpapi \
-ld3d9 \
-ldwmapi\
-lgdi32 \
libs_iidxhook2 := \
iidxhook-util \
@@ -21,9 +18,6 @@ libs_iidxhook2 := \
cconfig \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook2 := \
config-iidxhook2.c \

View File

@@ -29,7 +29,6 @@
#include "iidxhook-util/acio.h"
#include "iidxhook-util/chart-patch.h"
#include "iidxhook-util/clock.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-eamuse.h"
#include "iidxhook-util/config-ezusb.h"
#include "iidxhook-util/config-gfx.h"
@@ -42,10 +41,6 @@
#include "iidxhook2/config-iidxhook2.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "util/log.h"
#include "util/thread.h"
@@ -57,7 +52,6 @@
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static HANDLE STDCALL my_OpenProcess(DWORD, BOOL, DWORD);
@@ -71,17 +65,6 @@ static const struct hook_symbol init_hook_syms[] = {
.link = (void **) &real_OpenProcess},
};
static void iidxhook2_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void iidxhook2_setup_d3d9_hooks(
const struct iidxhook_config_gfx *config_gfx,
const struct iidxhook_config_iidxhook2 *config_iidxhook2)
@@ -139,7 +122,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_util_config_ezusb config_ezusb;
struct iidxhook_util_config_eamuse config_eamuse;
struct iidxhook_config_gfx config_gfx;
@@ -159,7 +141,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_util_config_ezusb_init(config);
iidxhook_util_config_eamuse_init(config);
iidxhook_config_gfx_init(config);
@@ -175,7 +156,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_util_config_ezusb_get(&config_ezusb, config);
iidxhook_util_config_eamuse_get(&config_eamuse, config);
iidxhook_config_gfx_get(&config_gfx, config);
@@ -214,8 +194,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
settings_hook_set_path(config_misc.settings_path);
}
iidxhook2_setup_imgui_debug_components(&config_debug);
/* Direct3D and USER32 hooks */
iidxhook2_setup_d3d9_hooks(&config_gfx, &config_iidxhook2);

View File

@@ -3,13 +3,9 @@ avsdlls += iidxhook3
ldflags_iidxhook3 := \
-lws2_32 \
-liphlpapi \
-ld3d9 \
-ldwmapi\
-lgdi32 \
libs_iidxhook3 := \
iidxhook-util \
iidxhook-d3d9 \
ezusb-emu \
ezusb-iidx-16seg-emu \
ezusb2-emu \
@@ -24,9 +20,6 @@ libs_iidxhook3 := \
cconfig \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook3 := \
dllmain.c \

View File

@@ -30,7 +30,6 @@
#include "iidxhook-util/acio.h"
#include "iidxhook-util/chart-patch.h"
#include "iidxhook-util/clock.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-eamuse.h"
#include "iidxhook-util/config-gfx.h"
#include "iidxhook-util/config-misc.h"
@@ -39,10 +38,6 @@
#include "iidxhook-util/eamuse.h"
#include "iidxhook-util/settings.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "security/rp-sign-key.h"
#include "util/log.h"
@@ -57,7 +52,6 @@
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static HANDLE STDCALL my_OpenProcess(DWORD, BOOL, DWORD);
@@ -70,17 +64,6 @@ static const struct hook_symbol init_hook_syms[] = {
.link = (void **) &real_OpenProcess},
};
static void iidxhook3_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void
iidxhook3_setup_d3d9_hooks(const struct iidxhook_config_gfx *config_gfx)
{
@@ -137,7 +120,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_util_config_eamuse config_eamuse;
struct iidxhook_config_gfx config_gfx;
struct iidxhook_config_misc config_misc;
@@ -155,7 +137,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_util_config_eamuse_init(config);
iidxhook_config_gfx_init(config);
iidxhook_config_misc_init(config);
@@ -169,7 +150,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_util_config_eamuse_get(&config_eamuse, config);
iidxhook_config_gfx_get(&config_gfx, config);
iidxhook_config_misc_get(&config_misc, config);
@@ -207,8 +187,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
settings_hook_set_path(config_misc.settings_path);
}
iidxhook3_setup_imgui_debug_components(&config_debug);
/* Direct3D and USER32 hooks */
iidxhook3_setup_d3d9_hooks(&config_gfx);

View File

@@ -3,9 +3,6 @@ avsdlls += iidxhook4-cn
ldflags_iidxhook4-cn := \
-liphlpapi \
-lws2_32 \
-ld3d9 \
-ldwmapi\
-lgdi32 \
deplibs_iidxhook4-cn := \
avs \
@@ -23,9 +20,6 @@ libs_iidxhook4-cn := \
cconfig \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook4-cn := \
avs-boot.c \

View File

@@ -25,7 +25,6 @@
#include "iidxhook4-cn/path.h"
#include "iidxhook-util/chart-patch.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-eamuse.h"
#include "iidxhook-util/config-gfx.h"
#include "iidxhook-util/config-io.h"
@@ -34,10 +33,6 @@
#include "iidxhook-util/d3d9.h"
#include "iidxhook-util/settings.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "security/rp-sign-key.h"
#include "imports/avs.h"
@@ -56,7 +51,6 @@ static bool iidxhook_init_check;
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static const struct hook_symbol init_hook_syms[] = {
@@ -67,17 +61,6 @@ static const struct hook_symbol init_hook_syms[] = {
static struct iidxhook_config_io config_io;
static void iidxhook4_cn_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void
iidxhook4_cn_setup_d3d9_hooks(const struct iidxhook_config_gfx *config_gfx)
{
@@ -134,7 +117,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_util_config_eamuse config_eamuse;
struct iidxhook_config_gfx config_gfx;
struct iidxhook_config_sec config_sec;
@@ -152,7 +134,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_util_config_eamuse_init(config);
iidxhook_config_gfx_init(config);
iidxhook_config_io_init(config);
@@ -167,7 +148,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_util_config_eamuse_get(&config_eamuse, config);
iidxhook_config_gfx_get(&config_gfx, config);
iidxhook_config_io_get(&config_io, config);
@@ -194,8 +174,6 @@ my_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
&config_sec.black_plug_mcode);
ezusb_iidx_emu_node_security_plug_set_pcbid(&config_eamuse.pcbid);
iidxhook4_cn_setup_imgui_debug_components(&config_debug);
iidxhook4_cn_setup_d3d9_hooks(&config_gfx);
if (strlen(config_misc.settings_path) > 0) {

View File

@@ -2,9 +2,6 @@ avsdlls += iidxhook4
ldflags_iidxhook4 := \
-liphlpapi \
-ld3d9 \
-ldwmapi\
-lgdi32 \
deplibs_iidxhook4 := \
avs \
@@ -25,9 +22,6 @@ libs_iidxhook4 := \
cconfig \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook4 := \
dllmain.c \

View File

@@ -27,7 +27,6 @@
#include "iidxhook-util/acio.h"
#include "iidxhook-util/chart-patch.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-gfx.h"
#include "iidxhook-util/config-io.h"
#include "iidxhook-util/config-misc.h"
@@ -35,10 +34,6 @@
#include "iidxhook-util/log-server.h"
#include "iidxhook-util/settings.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "imports/avs.h"
#include "util/log.h"
@@ -53,22 +48,10 @@
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static struct iidxhook_config_io config_io;
static void iidxhook4_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void
iidxhook4_setup_d3d9_hooks(const struct iidxhook_config_gfx *config_gfx)
{
@@ -118,7 +101,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_config_gfx config_gfx;
struct iidxhook_config_misc config_misc;
@@ -129,7 +111,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_config_gfx_init(config);
iidxhook_config_io_init(config);
iidxhook_config_misc_init(config);
@@ -143,7 +124,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_config_gfx_get(&config_gfx, config);
iidxhook_config_io_get(&config_io, config);
iidxhook_config_misc_get(&config_misc, config);
@@ -153,8 +133,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
log_info(IIDXHOOK4_INFO_HEADER);
log_info("Initializing iidxhook...");
iidxhook4_setup_imgui_debug_components(&config_debug);
iidxhook4_setup_d3d9_hooks(&config_gfx);
if (strlen(config_misc.settings_path) > 0) {

View File

@@ -3,9 +3,6 @@ avsdlls += iidxhook5-cn
ldflags_iidxhook5-cn := \
-liphlpapi \
-lws2_32 \
-ld3d9 \
-ldwmapi\
-lgdi32 \
deplibs_iidxhook5-cn := \
avs \
@@ -23,9 +20,6 @@ libs_iidxhook5-cn := \
cconfig \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook5-cn := \
avs-boot.c \

View File

@@ -25,7 +25,6 @@
#include "iidxhook5-cn/avs-boot.h"
#include "iidxhook5-cn/path.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-eamuse.h"
#include "iidxhook-util/config-gfx.h"
#include "iidxhook-util/config-io.h"
@@ -34,10 +33,6 @@
#include "iidxhook-util/d3d9.h"
#include "iidxhook-util/settings.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "security/rp-sign-key.h"
#include "imports/avs.h"
@@ -56,7 +51,6 @@ static bool iidxhook_init_check;
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static const struct hook_symbol init_hook_user32_syms[] = {
@@ -67,17 +61,6 @@ static const struct hook_symbol init_hook_user32_syms[] = {
static struct iidxhook_config_io config_io;
static void iidxhook5_cn_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void
iidxhook5_cn_setup_d3d9_hooks(const struct iidxhook_config_gfx *config_gfx)
{
@@ -114,7 +97,6 @@ static ATOM WINAPI my_RegisterClassA(const WNDCLASSA *lpWndClass)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_util_config_eamuse config_eamuse;
struct iidxhook_config_gfx config_gfx;
struct iidxhook_config_sec config_sec;
@@ -132,7 +114,6 @@ static ATOM WINAPI my_RegisterClassA(const WNDCLASSA *lpWndClass)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_util_config_eamuse_init(config);
iidxhook_config_gfx_init(config);
iidxhook_config_io_init(config);
@@ -147,7 +128,6 @@ static ATOM WINAPI my_RegisterClassA(const WNDCLASSA *lpWndClass)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_util_config_eamuse_get(&config_eamuse, config);
iidxhook_config_gfx_get(&config_gfx, config);
iidxhook_config_io_get(&config_io, config);
@@ -174,8 +154,6 @@ static ATOM WINAPI my_RegisterClassA(const WNDCLASSA *lpWndClass)
&config_sec.black_plug_mcode);
ezusb_iidx_emu_node_security_plug_set_pcbid(&config_eamuse.pcbid);
iidxhook5_cn_setup_imgui_debug_components(&config_debug);
iidxhook5_cn_setup_d3d9_hooks(&config_gfx);
if (strlen(config_misc.settings_path) > 0) {

View File

@@ -2,9 +2,6 @@ avsdlls += iidxhook5
ldflags_iidxhook5 := \
-liphlpapi \
-ld3d9 \
-ldwmapi\
-lgdi32 \
deplibs_iidxhook5 := \
avs \
@@ -25,9 +22,6 @@ libs_iidxhook5 := \
cconfig \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook5 := \
dllmain.c \

View File

@@ -27,7 +27,6 @@
#include "iidxhook-util/acio.h"
#include "iidxhook-util/chart-patch.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-gfx.h"
#include "iidxhook-util/config-io.h"
#include "iidxhook-util/config-misc.h"
@@ -35,10 +34,6 @@
#include "iidxhook-util/log-server.h"
#include "iidxhook-util/settings.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "imports/avs.h"
#include "util/log.h"
@@ -55,22 +50,10 @@
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static struct iidxhook_config_io config_io;
static void iidxhook5_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void
iidxhook5_setup_d3d9_hooks(const struct iidxhook_config_gfx *config_gfx)
{
@@ -120,7 +103,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_config_gfx config_gfx;
struct iidxhook_config_misc config_misc;
@@ -131,7 +113,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_config_gfx_init(config);
iidxhook_config_io_init(config);
iidxhook_config_misc_init(config);
@@ -145,7 +126,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_config_gfx_get(&config_gfx, config);
iidxhook_config_io_get(&config_io, config);
iidxhook_config_misc_get(&config_misc, config);
@@ -155,8 +135,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
log_info(IIDXHOOK5_INFO_HEADER);
log_info("Initializing iidxhook...");
iidxhook5_setup_imgui_debug_components(&config_debug);
iidxhook5_setup_d3d9_hooks(&config_gfx);
if (strlen(config_misc.settings_path) > 0) {

View File

@@ -2,9 +2,6 @@ avsdlls += iidxhook6
ldflags_iidxhook6 := \
-liphlpapi \
-ld3d9 \
-ldwmapi\
-lgdi32 \
deplibs_iidxhook6 := \
avs \
@@ -26,9 +23,6 @@ libs_iidxhook6 := \
cconfig \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook6 := \
dllmain.c \

View File

@@ -28,16 +28,11 @@
#include "iidxhook-d3d9/bb-scale-hd.h"
#include "iidxhook-util/acio.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-gfx.h"
#include "iidxhook-util/config-io.h"
#include "iidxhook-util/d3d9.h"
#include "iidxhook-util/log-server.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "imports/avs.h"
#include "util/log.h"
@@ -53,22 +48,10 @@
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_d3d9_bb_scale_hd_d3d9_irp_handler,
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static struct iidxhook_config_io config_io;
static void iidxhook6_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void
iidxhook6_setup_d3d9_hooks(const struct iidxhook_config_gfx *config_gfx)
{
@@ -104,7 +87,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_config_gfx config_gfx;
log_server_init();
@@ -114,7 +96,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_config_gfx_init(config);
iidxhook_config_io_init(config);
@@ -127,7 +108,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_config_gfx_get(&config_gfx, config);
iidxhook_config_io_get(&config_io, config);
@@ -136,8 +116,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
log_info(IIDXHOOK6_INFO_HEADER);
log_info("Initializing iidxhook...");
iidxhook6_setup_imgui_debug_components(&config_debug);
iidxhook6_setup_d3d9_hooks(&config_gfx);
if (!config_io.disable_io_emu) {

View File

@@ -3,8 +3,6 @@ avsdlls += iidxhook7
ldflags_iidxhook7 := \
-liphlpapi \
-ld3d9 \
-ldwmapi\
-lgdi32 \
deplibs_iidxhook7 := \
avs \
@@ -26,9 +24,6 @@ libs_iidxhook7 := \
iidxio \
util \
ezusb \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook7 := \
dllmain.c \

View File

@@ -28,16 +28,11 @@
#include "iidxhook-d3d9/bb-scale-hd.h"
#include "iidxhook-util/acio.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-gfx.h"
#include "iidxhook-util/config-io.h"
#include "iidxhook-util/d3d9.h"
#include "iidxhook-util/log-server.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "imports/avs.h"
#include "util/log.h"
@@ -53,22 +48,10 @@
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_d3d9_bb_scale_hd_d3d9_irp_handler,
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static struct iidxhook_config_io config_io;
static void iidxhook7_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void
iidxhook7_setup_d3d9_hooks(const struct iidxhook_config_gfx *config_gfx)
{
@@ -104,7 +87,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_config_gfx config_gfx;
log_server_init();
@@ -114,7 +96,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_config_gfx_init(config);
iidxhook_config_io_init(config);
@@ -127,11 +108,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_init(config);
iidxhook_config_gfx_init(config);
iidxhook_config_io_init(config);
iidxhook_config_debug_get(&config_debug, config);
iidxhook_config_gfx_get(&config_gfx, config);
iidxhook_config_io_get(&config_io, config);
@@ -140,8 +116,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
log_info(IIDXHOOK7_INFO_HEADER);
log_info("Initializing iidxhook...");
iidxhook7_setup_imgui_debug_components(&config_debug);
iidxhook7_setup_d3d9_hooks(&config_gfx);
if (!config_io.disable_io_emu) {

View File

@@ -7,9 +7,6 @@ ldflags_iidxhook8 := \
-lmf \
-lmfplat \
-lole32 \
-ld3d9 \
-ldwmapi\
-lgdi32 \
deplibs_iidxhook8 := \
avs \
@@ -27,10 +24,7 @@ libs_iidxhook8 := \
cconfig \
util \
eamio \
imgui-bt \
imgui-debug \
imgui \
src_iidxhook8 := \
config-io.c \
dllmain.c \

View File

@@ -21,15 +21,10 @@
#include "iidxhook-d3d9/bb-scale-hd.h"
#include "iidxhook-util/acio.h"
#include "iidxhook-util/config-debug.h"
#include "iidxhook-util/config-gfx.h"
#include "iidxhook-util/d3d9.h"
#include "iidxhook-util/log-server.h"
#include "imgui-bt/imgui-d3d9-hook.h"
#include "imgui-debug/frame-perf-graph.h"
#include "bio2emu-iidx/bi2a.h"
#include "bio2emu/emu.h"
@@ -52,19 +47,8 @@
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
iidxhook_d3d9_bb_scale_hd_d3d9_irp_handler,
iidxhook_util_d3d9_irp_handler,
imgui_hook_d3d9_irp_handler,
};
static void iidxhook8_setup_imgui_debug_components(const struct iidxhook_config_debug *config_debug)
{
imgui_bt_component_t debug_frame_graph_component;
if (config_debug->enable_frame_perf_graph) {
imgui_debug_frame_perf_graph_init(60.0f, &debug_frame_graph_component);
imgui_d3d9_hook_init(&debug_frame_graph_component, 1);
}
}
static void
iidxhook8_setup_d3d9_hooks(const struct iidxhook_config_gfx *config_gfx)
{
@@ -109,7 +93,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
{
struct cconfig *config;
struct iidxhook_config_debug config_debug;
struct iidxhook_config_gfx config_gfx;
// log_server_init is required due to IO occuring in a non avs_thread
@@ -121,7 +104,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
config = cconfig_init();
iidxhook_config_debug_init(config);
iidxhook_config_gfx_init(config);
iidxhook8_config_io_init(config);
camhook_config_cam_init(config, 2);
@@ -135,7 +117,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
exit(EXIT_FAILURE);
}
iidxhook_config_debug_get(&config_debug, config);
iidxhook_config_gfx_get(&config_gfx, config);
iidxhook8_config_io_get(&iidxhook8_config_io, config);
camhook_config_cam_get(&config_cam, config, 2);
@@ -145,8 +126,6 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
log_info(IIDXHOOK8_INFO_HEADER);
log_info("Initializing iidxhook...");
iidxhook8_setup_imgui_debug_components(&config_debug);
iidxhook8_setup_d3d9_hooks(&config_gfx);
/* Start up IIDXIO.DLL */

View File

@@ -1,10 +0,0 @@
libs += imgui-bt
libs_imgui-bt := \
hook \
hooklib \
util \
imgui \
src_imgui-bt := \
imgui-d3d9-hook.c \

View File

@@ -1,10 +0,0 @@
#ifndef IMGUI_BT_CIMGUI_H
#define IMGUI_BT_CIMGUI_H
// Comprehensive header file for including cimgui correctly for integration in this project
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#include "imgui/cimgui.h"
#include "imgui/cimgui_impl_dx9.h"
#include "imgui/cimgui_impl_win32.h"
#endif

View File

@@ -1,12 +0,0 @@
#ifndef IMGUI_BT_COMPONENT_H
#define IMGUI_BT_COMPONENT_H
#include "imgui-bt/cimgui.h"
typedef void (*imgui_bt_component_frame_update_t)(ImGuiContext *ctx);
typedef struct imgui_bt_component {
imgui_bt_component_frame_update_t frame_update;
} imgui_bt_component_t;
#endif

View File

@@ -1,143 +0,0 @@
#define LOG_MODULE "imgui-d3d9-hook"
#include "hook/d3d9.h"
#include "hook/table.h"
#include "imgui-bt/cimgui.h"
#include "imgui-bt/component.h"
#include "util/defs.h"
#include "util/log.h"
#include "util/mem.h"
typedef LRESULT WINAPI (*RegisterClassA_t)(WNDCLASSA *lpwcx);
typedef LRESULT WINAPI (*WndProc_t)(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
static LRESULT WINAPI _imgui_d3d9_hook_RegisterClassA(WNDCLASSA *lpwcx);
static bool _imgui_d3d9_hook_initialized;
static ImGuiContext *_imgui_d3d9_hook_imgui_ctx;
static RegisterClassA_t _imgui_d3d9_hook_original_RegisterClassA;
static WndProc_t _imgui_d3d9_hook_original_wndproc;
static imgui_bt_component_t *_imgui_d3d9_hook_components;
static size_t _imgui_d3d9_hook_component_count;
static const struct hook_symbol _imgui_d3d9_hook_syms[] = {
{.name = "RegisterClassA",
.patch = _imgui_d3d9_hook_RegisterClassA,
.link = (void **) &_imgui_d3d9_hook_original_RegisterClassA},
};
CIMGUI_API LRESULT igImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
static LRESULT WINAPI _imgui_d3d9_hook_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LRESULT result;
result = igImplWin32_WndProcHandler(hWnd, msg, wParam, lParam);
if (result) {
return result;
}
return _imgui_d3d9_hook_original_wndproc(hWnd, msg, wParam, lParam);
}
static LRESULT WINAPI _imgui_d3d9_hook_RegisterClassA(WNDCLASSA *lpwcx)
{
log_info("Swapping out WndProc handler for wrapper handler in RegisterClassA %s", lpwcx->lpszClassName);
_imgui_d3d9_hook_original_wndproc = lpwcx->lpfnWndProc;
lpwcx->lpfnWndProc = _imgui_d3d9_hook_WndProc;
return _imgui_d3d9_hook_original_RegisterClassA(lpwcx);
}
void imgui_d3d9_hook_init(const imgui_bt_component_t *components, size_t component_count)
{
ImGuiIO *io;
ImGuiStyle* style;
log_assert(components);
log_assert(component_count > 0);
_imgui_d3d9_hook_components = (imgui_bt_component_t *) xmalloc(component_count * sizeof(imgui_bt_component_t));
memcpy(_imgui_d3d9_hook_components, components, component_count * sizeof(imgui_bt_component_t));
_imgui_d3d9_hook_component_count = component_count;
_imgui_d3d9_hook_imgui_ctx = igCreateContext(NULL);
io = igGetIO();
io->ConfigFlags = ImGuiConfigFlags_NavEnableKeyboard
| ImGuiConfigFlags_DockingEnable
| ImGuiConfigFlags_ViewportsEnable;
io->MouseDrawCursor = true;
io->IniFilename = NULL;
io->FontAllowUserScaling = true;
hook_table_apply(NULL, "user32.dll", _imgui_d3d9_hook_syms, lengthof(_imgui_d3d9_hook_syms));
// Setup style
style = igGetStyle();
style->Colors[ImGuiCol_WindowBg] = (ImVec4){0.0f, 0.0f, 0.0f, 1.0f};
style->Colors[ImGuiCol_PlotLines] = (ImVec4){1.0f, 1.0f, 0.0f, 1.0f};
_imgui_d3d9_hook_initialized = true;
}
void imgui_d3d9_hook_fini()
{
hook_table_revert(NULL, "user32.dll", _imgui_d3d9_hook_syms, lengthof(_imgui_d3d9_hook_syms));
igImplDX9_Shutdown();
igImplWin32_Shutdown();
igDestroyContext(NULL);
_imgui_d3d9_hook_initialized = false;
}
HRESULT imgui_hook_d3d9_irp_handler(struct hook_d3d9_irp *irp)
{
HRESULT hr;
log_assert(irp);
if (!_imgui_d3d9_hook_initialized) {
return hook_d3d9_irp_invoke_next(irp);
}
switch (irp->op) {
case HOOK_D3D9_IRP_OP_CTX_CREATE_DEVICE:
hr = hook_d3d9_irp_invoke_next(irp);
if (hr == S_OK) {
igImplWin32_Init(irp->args.ctx_create_device.hwnd);
igImplDX9_Init(*irp->args.ctx_create_device.pdev);
}
return hr;
case HOOK_D3D9_IRP_OP_DEV_BEGIN_SCENE:
igImplDX9_NewFrame();
igImplWin32_NewFrame();
igNewFrame();
for (size_t i = 0; i < _imgui_d3d9_hook_component_count; i++) {
_imgui_d3d9_hook_components[i].frame_update(_imgui_d3d9_hook_imgui_ctx);
}
return hook_d3d9_irp_invoke_next(irp);
case HOOK_D3D9_IRP_OP_DEV_END_SCENE:
igRender();
igImplDX9_RenderDrawData(igGetDrawData());
return hook_d3d9_irp_invoke_next(irp);
default:
return hook_d3d9_irp_invoke_next(irp);
}
log_fatal("Illegal state");
}

View File

@@ -1,13 +0,0 @@
#ifndef IMGUI_D3D9_HOOK_H
#define IMGUI_D3D9_HOOK_H
#include "hook/d3d9.h"
#include "imgui-bt/component.h"
void imgui_d3d9_hook_init(const imgui_bt_component_t *components, size_t component_count);
void imgui_d3d9_hook_fini();
HRESULT imgui_hook_d3d9_irp_handler(struct hook_d3d9_irp *irp);
#endif

View File

@@ -1,10 +0,0 @@
libs += imgui-debug
libs_imgui-debug := \
imgui-bt \
imgui \
util \
src_imgui-debug := \
frame-perf-graph.c \
time-history.c \

View File

@@ -1,258 +0,0 @@
#include <math.h>
#include "imgui-bt/cimgui.h"
#include "imgui-debug/frame-perf-graph.h"
#include "imgui-debug/time-history.h"
#include "util/log.h"
typedef struct imgui_debug_frame_perf_graph {
float target_time_ms;
float y_axis_min_time_ms;
float y_axis_max_time_ms;
} imgui_debug_frame_perf_graph_t;
static const ImVec2 WINDOW_MIN_SIZE = {320, 240};
static imgui_debug_time_history_t _imgui_debug_frame_perf_graph_history;
static imgui_debug_frame_perf_graph_t _imgui_debug_frame_perf_graph;
static void _imgui_debug_frame_perf_graph_draw(
imgui_debug_frame_perf_graph_t *graph,
const imgui_debug_time_history_t *history)
{
float current_value;
ImVec2 window_size;
static bool show_labels = true;
static bool show_target_line = true;
static bool show_avg_line = true;
log_assert(history);
current_value = imgui_debug_time_history_recent_value_get(history);
igSetNextWindowSize(WINDOW_MIN_SIZE, ImGuiCond_FirstUseEver);
igSetNextWindowSizeConstraints(WINDOW_MIN_SIZE, igGetIO()->DisplaySize, NULL, NULL);
igBegin("Frame Time Graph", NULL, ImGuiWindowFlags_MenuBar);
// Add menu bar
if (igBeginMenuBar()) {
if (igBeginMenu("Settings", true)) {
igPushItemWidth(110);
float min_time_slider = graph->y_axis_min_time_ms;
float max_time_slider = graph->y_axis_max_time_ms;
float target_time_input = graph->target_time_ms;
if (igDragFloat("y-axis min time (ms)", &min_time_slider, 0.1f, 0.1f, max_time_slider - 0.1f, "%.1f", ImGuiSliderFlags_None)) {
graph->y_axis_min_time_ms = min_time_slider;
}
if (igDragFloat("y-axis max time (ms)", &max_time_slider, 0.1f, min_time_slider + 0.1f, 100.0f, "%.1f", ImGuiSliderFlags_None)) {
graph->y_axis_max_time_ms = max_time_slider;
}
if (igInputFloat("Target time reference (ms)", &target_time_input, 0.0f, 0.0f, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue)) {
if (target_time_input >= 0.1f && target_time_input <= 100.0f) {
graph->target_time_ms = target_time_input;
} else {
target_time_input = graph->target_time_ms;
}
}
igCheckbox("Show reference line labels", &show_labels);
igCheckbox("Show target reference line", &show_target_line);
igCheckbox("Show average reference line", &show_avg_line);
if (igButton("Focus on average", (ImVec2){0, 0})) {
// Convert +/- 10 fps around average to milliseconds
float avg_fps = 1000.0f / history->avg_time_ms;
graph->y_axis_min_time_ms = 1000.0f / (avg_fps + 10.0f);
graph->y_axis_max_time_ms = 1000.0f / fmaxf(avg_fps - 10.0f, 1.0f);
}
igSameLine(0, -1);
if (igButton("Focus on target", (ImVec2){0, 0})) {
// Convert +/- 10 fps around target to milliseconds
float target_fps = 1000.0f / graph->target_time_ms;
graph->y_axis_min_time_ms = 1000.0f / (target_fps + 10.0f);
graph->y_axis_max_time_ms = 1000.0f / fmaxf(target_fps - 10.0f, 1.0f);
}
igPopItemWidth();
igEndMenu();
}
igEndMenuBar();
}
igGetContentRegionAvail(&window_size);
igPushStyleColor_Vec4(ImGuiCol_Text, (ImVec4){1, 1, 0, 1});
igText("Now %.3f ms", current_value);
igPopStyleColor(1);
igSameLine(0, -1);
igPushStyleColor_Vec4(ImGuiCol_Text, (ImVec4){1, 0, 0, 1});
igText("Target %.3f ms", graph->target_time_ms);
igPopStyleColor(1);
igPushStyleColor_Vec4(ImGuiCol_Text, (ImVec4){0, 1, 0, 1});
igText("Avg %.3f ms", history->avg_time_ms);
igPopStyleColor(1);
igSameLine(0, -1);
igText(" Min %.3f ms Max %.3f ms", history->min_time_ms, history->max_time_ms);
// Setup plot area using actual window size, with extra space at top for "ms" label
ImVec2 plot_pos;
igGetCursorScreenPos(&plot_pos);
plot_pos.y += 15; // Add space at top for "ms" label
ImVec2 plot_size = {window_size.x - 50, window_size.y - 65}; // Adjusted for extra top space
// Plot frame times in ms
ImVec2 plot_pos_offset = {plot_pos.x + 50, plot_pos.y};
igSetCursorScreenPos(plot_pos_offset);
igPlotLines_FloatPtr("##framegraph",
history->time_values_ms,
history->size,
history->current_index,
"",
graph->y_axis_min_time_ms,
graph->y_axis_max_time_ms,
plot_size,
sizeof(float));
// Draw Y axis (ms)
ImDrawList* draw_list = igGetWindowDrawList();
char y_label[32];
ImDrawList_AddLine(draw_list,
(ImVec2){plot_pos.x + 50, plot_pos.y},
(ImVec2){plot_pos.x + 50, plot_pos.y + plot_size.y},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), 1.0f);
// Draw "ms" label at top of y-axis
ImDrawList_AddText_Vec2(draw_list, (ImVec2){plot_pos.x + 5, plot_pos.y - 15},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), "ms", NULL);
// Scale number of reference points based on plot height
int num_reference_points = (int)(plot_size.y / 25); // One point per ~40 pixels
if (num_reference_points < 4) num_reference_points = 4;
float time_min = graph->y_axis_min_time_ms;
float time_max = graph->y_axis_max_time_ms;
float time_step = (time_max - time_min) / (num_reference_points + 1);
// Draw min time value at top of y-axis and reference line
snprintf(y_label, sizeof(y_label), "%.2f", time_min);
ImDrawList_AddText_Vec2(draw_list, (ImVec2){plot_pos.x + 5, plot_pos.y + plot_size.y - 10},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), y_label, NULL);
ImDrawList_AddLine(draw_list,
(ImVec2){plot_pos.x + 50, plot_pos.y + plot_size.y},
(ImVec2){plot_pos.x + plot_size.x + 50, plot_pos.y + plot_size.y},
igColorConvertFloat4ToU32((ImVec4){1,1,1,0.3f}), 1.0f);
// Draw reference points and lines on side of y-axis
for (int i = 1; i <= num_reference_points; i++) {
float value = time_max - (time_step * i);
float normalized_pos = (time_max - value) / (time_max - time_min);
float y_pos = plot_pos.y + (plot_size.y * normalized_pos);
snprintf(y_label, sizeof(y_label), "%.2f", value);
ImDrawList_AddText_Vec2(draw_list, (ImVec2){plot_pos.x + 5, y_pos - 5},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), y_label, NULL);
ImDrawList_AddLine(draw_list,
(ImVec2){plot_pos.x + 50, y_pos},
(ImVec2){plot_pos.x + plot_size.x + 50, y_pos},
igColorConvertFloat4ToU32((ImVec4){1,1,1,0.2f}), 1.0f);
}
// Draw max time value at bottom of y-axis and reference line
snprintf(y_label, sizeof(y_label), "%.2f", time_max);
ImDrawList_AddText_Vec2(draw_list, (ImVec2){plot_pos.x + 5, plot_pos.y},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), y_label, NULL);
ImDrawList_AddLine(draw_list,
(ImVec2){plot_pos.x + 50, plot_pos.y},
(ImVec2){plot_pos.x + plot_size.x + 50, plot_pos.y},
igColorConvertFloat4ToU32((ImVec4){1,1,1,0.3f}), 1.0f);
// Draw target frame time reference line if within plot area
if (show_target_line && graph->target_time_ms >= time_min && graph->target_time_ms <= time_max) {
float normalized_target = (time_max - graph->target_time_ms) / (time_max - time_min);
float y_pos_target = plot_pos.y + (plot_size.y * normalized_target);
ImDrawList_AddLine(draw_list,
(ImVec2){plot_pos.x + 50, y_pos_target},
(ImVec2){plot_pos.x + plot_size.x + 50, y_pos_target},
igColorConvertFloat4ToU32((ImVec4){1,0,0,1.0f}), 1.0f);
if (show_labels) {
snprintf(y_label, sizeof(y_label), "%.3f", graph->target_time_ms);
ImDrawList_AddText_Vec2(draw_list,
(ImVec2){plot_pos.x + 50 + plot_size.x/2 - 10, y_pos_target + 5},
igColorConvertFloat4ToU32((ImVec4){1,0,0,1}), y_label, NULL);
}
}
// Draw reference line for current average if within plot area
if (show_avg_line && history->avg_time_ms >= time_min && history->avg_time_ms <= time_max) {
float normalized_avg = (time_max - history->avg_time_ms) / (time_max - time_min);
float y_pos_avg = plot_pos.y + (plot_size.y * normalized_avg);
ImDrawList_AddLine(draw_list,
(ImVec2){plot_pos.x + 50, y_pos_avg},
(ImVec2){plot_pos.x + plot_size.x + 50, y_pos_avg},
igColorConvertFloat4ToU32((ImVec4){0,1,0,1.0f}), 1.0f);
if (show_labels) {
snprintf(y_label, sizeof(y_label), "%.3f", history->avg_time_ms);
ImDrawList_AddText_Vec2(draw_list,
(ImVec2){plot_pos.x + 50 + plot_size.x/2 - 10, y_pos_avg + 5},
igColorConvertFloat4ToU32((ImVec4){0,1,0,1}), y_label, NULL);
}
}
// Draw X axis (time in frames)
ImDrawList_AddLine(draw_list,
(ImVec2){plot_pos.x + 50, plot_pos.y + plot_size.y},
(ImVec2){plot_pos.x + plot_size.x + 50, plot_pos.y + plot_size.y},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), 1.0f);
// Draw "frames" label centered on x-axis
ImDrawList_AddText_Vec2(draw_list, (ImVec2){plot_pos.x + 50 + (plot_size.x / 2) - 20, plot_pos.y + plot_size.y + 5},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), "frames ago", NULL);
char x_label[32];
snprintf(x_label, sizeof(x_label), "%d", history->size);
ImDrawList_AddText_Vec2(draw_list, (ImVec2){plot_pos.x + 50, plot_pos.y + plot_size.y + 5},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), x_label, NULL);
ImDrawList_AddText_Vec2(draw_list, (ImVec2){plot_pos.x + plot_size.x + 50, plot_pos.y + plot_size.y + 5},
igColorConvertFloat4ToU32((ImVec4){1,1,1,1}), "0", NULL);
igEnd();
}
static void _imgui_debug_frame_perf_graph_component_frame_update(ImGuiContext *ctx)
{
ImGuiIO *io;
log_assert(ctx);
igSetCurrentContext(ctx);
io = igGetIO();
imgui_debug_time_history_update(&_imgui_debug_frame_perf_graph_history, 1000.0f / io->Framerate);
_imgui_debug_frame_perf_graph_draw(&_imgui_debug_frame_perf_graph, &_imgui_debug_frame_perf_graph_history);
}
void imgui_debug_frame_perf_graph_init(
float target_fps,
imgui_bt_component_t *component)
{
log_assert(target_fps > 0.0f);
log_assert(component);
imgui_debug_time_history_init(ceilf(10 * target_fps), &_imgui_debug_frame_perf_graph_history);
_imgui_debug_frame_perf_graph.target_time_ms = 1000.0f / target_fps;
_imgui_debug_frame_perf_graph.y_axis_min_time_ms = 1000.0f / fmaxf(0.0f, target_fps - 20.0f);
_imgui_debug_frame_perf_graph.y_axis_max_time_ms = 1000.0f / fminf(target_fps + 20.0f, 1000.0f);
component->frame_update = _imgui_debug_frame_perf_graph_component_frame_update;
}

View File

@@ -1,10 +0,0 @@
#ifndef IMGUI_DEBUG_FRAME_PERF_GRAPH_H
#define IMGUI_DEBUG_FRAME_PERF_GRAPH_H
#include "imgui-bt/component.h"
void imgui_debug_frame_perf_graph_init(
float target_fps,
imgui_bt_component_t *component);
#endif

View File

@@ -1,63 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include "time-history.h"
#include "util/log.h"
#include "util/mem.h"
void imgui_debug_time_history_init(uint32_t size, imgui_debug_time_history_t *history)
{
log_assert(size > 0);
log_assert(history);
memset(history, 0, sizeof(imgui_debug_time_history_t));
history->size = size;
history->time_values_ms = (float *) xmalloc(size * sizeof(float));
}
void imgui_debug_time_history_update(imgui_debug_time_history_t *history, float time_ms)
{
log_assert(history);
history->time_values_ms[history->current_index] = time_ms;
history->current_index = (history->current_index + 1) % history->size;
history->min_time_ms = history->time_values_ms[0];
history->max_time_ms = history->time_values_ms[0];
history->avg_time_ms = 0;
for (uint32_t i = 0; i < history->size; i++) {
if (history->time_values_ms[i] < history->min_time_ms) {
history->min_time_ms = history->time_values_ms[i];
}
if (history->time_values_ms[i] > history->max_time_ms) {
history->max_time_ms = history->time_values_ms[i];
}
history->avg_time_ms += history->time_values_ms[i];
}
history->avg_time_ms /= history->size;
}
float imgui_debug_time_history_recent_value_get(const imgui_debug_time_history_t *history)
{
log_assert(history);
if (history->current_index == 0) {
return history->time_values_ms[history->size - 1];
} else {
return history->time_values_ms[history->current_index - 1];
}
}
void imgui_debug_time_history_free(imgui_debug_time_history_t *history)
{
log_assert(history);
log_assert(history->time_values_ms);
free(history->time_values_ms);
}

View File

@@ -1,23 +0,0 @@
#ifndef IMGUI_DEBUG_TIME_HISTORY_H
#define IMGUI_DEBUG_TIME_HISTORY_H
#include <stdint.h>
typedef struct imgui_debug_time_history {
uint32_t size;
float *time_values_ms;
uint32_t current_index;
float min_time_ms;
float max_time_ms;
float avg_time_ms;
} imgui_debug_time_history_t;
void imgui_debug_time_history_init(uint32_t size, imgui_debug_time_history_t *history);
void imgui_debug_time_history_update(imgui_debug_time_history_t *history, float time_ms);
float imgui_debug_time_history_recent_value_get(const imgui_debug_time_history_t *history);
void imgui_debug_time_history_free(imgui_debug_time_history_t *history);
#endif

View File

@@ -1,15 +0,0 @@
libs += imgui
src_imgui := \
cppsrc_imgui := \
cimgui.cpp \
cimgui_impl_dx9.cpp \
cimgui_impl_win32.cpp \
imgui_demo.cpp \
imgui_draw.cpp \
imgui_impl_dx9.cpp \
imgui_impl_win32.cpp \
imgui_tables.cpp \
imgui_widgets.cpp \
imgui.cpp \

View File

@@ -1 +0,0 @@
#undef NDEBUG

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,33 +0,0 @@
#include "imgui_impl_dx9.h"
#include "imgui_internal.h"
#include "cimgui.h"
CIMGUI_API bool igImplDX9_Init(IDirect3DDevice9* device)
{
return ImGui_ImplDX9_Init(device);
}
CIMGUI_API void igImplDX9_Shutdown()
{
ImGui_ImplDX9_Shutdown();
}
CIMGUI_API void igImplDX9_NewFrame()
{
ImGui_ImplDX9_NewFrame();
}
CIMGUI_API void igImplDX9_RenderDrawData(ImDrawData* draw_data)
{
ImGui_ImplDX9_RenderDrawData(draw_data);
}
CIMGUI_API bool igImplDX9_CreateDeviceObjects()
{
return ImGui_ImplDX9_CreateDeviceObjects();
}
CIMGUI_API void igImplDX9_InvalidateDeviceObjects()
{
ImGui_ImplDX9_InvalidateDeviceObjects();
}

View File

@@ -1,16 +0,0 @@
#ifndef CIMGUI_IMPL_DX9_INCLUDED
#define CIMGUI_IMPL_DX9_INCLUDED
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#include "cimgui.h"
typedef struct IDirect3DDevice9 IDirect3DDevice9;
CIMGUI_API bool igImplDX9_Init(IDirect3DDevice9* device);
CIMGUI_API void igImplDX9_Shutdown();
CIMGUI_API void igImplDX9_NewFrame();
CIMGUI_API void igImplDX9_RenderDrawData(ImDrawData* draw_data);
CIMGUI_API bool igImplDX9_CreateDeviceObjects();
CIMGUI_API void igImplDX9_InvalidateDeviceObjects();
#endif // CIMGUI_IMPL_DX9_INCLUDED

View File

@@ -1,52 +0,0 @@
#include <windows.h>
#include "imgui_impl_win32.h"
#include "imgui_internal.h"
#include "cimgui.h"
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
CIMGUI_API bool igImplWin32_Init(void* hwnd)
{
return ImGui_ImplWin32_Init(hwnd);
}
CIMGUI_API bool igImplWin32_InitForOpenGL(void* hwnd)
{
return ImGui_ImplWin32_InitForOpenGL(hwnd);
}
CIMGUI_API void igImplWin32_Shutdown()
{
ImGui_ImplWin32_Shutdown();
}
CIMGUI_API void igImplWin32_NewFrame()
{
ImGui_ImplWin32_NewFrame();
}
CIMGUI_API LRESULT igImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam);
}
CIMGUI_API void igImplWin32_EnableDpiAwareness()
{
ImGui_ImplWin32_EnableDpiAwareness();
}
CIMGUI_API float igImplWin32_GetDpiScaleForHwnd(void* hwnd)
{
return ImGui_ImplWin32_GetDpiScaleForHwnd(hwnd);
}
CIMGUI_API float igImplWin32_GetDpiScaleForMonitor(void* monitor)
{
return ImGui_ImplWin32_GetDpiScaleForMonitor(monitor);
}
CIMGUI_API void igImplWin32_EnableAlphaCompositing(void* hwnd)
{
ImGui_ImplWin32_EnableAlphaCompositing(hwnd);
}

View File

@@ -1,21 +0,0 @@
#ifndef CIMGUI_IMPL_WIN32_INCLUDED
#define CIMGUI_IMPL_WIN32_INCLUDED
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#include "cimgui.h"
CIMGUI_API bool igImplWin32_Init(void* hwnd);
CIMGUI_API bool igImplWin32_InitForOpenGL(void* hwnd);
CIMGUI_API void igImplWin32_Shutdown();
CIMGUI_API void igImplWin32_NewFrame();
#if 0
CIMGUI_API LRESULT igImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
#endif
CIMGUI_API void igImplWin32_EnableDpiAwareness();
CIMGUI_API float igImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd
CIMGUI_API float igImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor
CIMGUI_API void igImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd
#endif // CIMGUI_IMPL_WIN32_INCLUDED

View File

@@ -1,142 +0,0 @@
//-----------------------------------------------------------------------------
// DEAR IMGUI COMPILE-TIME OPTIONS
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
//-----------------------------------------------------------------------------
// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it)
// B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template.
//-----------------------------------------------------------------------------
// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
// Call IMGUI_CHECKVERSION() from your .cpp file to verify that the data structures your files are using are matching the ones imgui.cpp is using.
//-----------------------------------------------------------------------------
#pragma once
//---- Define assertion handler. Defaults to calling assert().
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
// - Windows DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
//#define IMGUI_API __declspec(dllexport) // MSVC Windows: DLL export
//#define IMGUI_API __declspec(dllimport) // MSVC Windows: DLL import
//#define IMGUI_API __attribute__((visibility("default"))) // GCC/Clang: override visibility when set is hidden
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.
//---- Don't implement some functions to reduce linkage requirements.
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, IME).
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
//#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default platform_io.Platform_OpenInShellFn() handler (Win32: ShellExecute(), require shell32.lib/.a, Mac/Linux: use system("")).
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
//#define IMGUI_DISABLE_DEFAULT_FONT // Disable default embedded font (ProggyClean.ttf), remove ~9.5 KB from output binary. AddFontDefault() will assert.
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
//---- Enable Test Engine / Automation features.
//#define IMGUI_ENABLE_TEST_ENGINE // Enable imgui_test_engine hooks. Generally set automatically by include "imgui_te_config.h", see Test Engine for details.
//---- Include imgui_user.h at the end of imgui.h as a convenience
// May be convenient for some users to only explicitly include vanilla imgui.h and have extra stuff included.
//#define IMGUI_INCLUDE_IMGUI_USER_H
//#define IMGUI_USER_H_FILENAME "my_folder/my_imgui_user.h"
//---- Pack vertex colors as BGRA8 instead of RGBA8 (to avoid converting from one to another). Need dedicated backend support.
//#define IMGUI_USE_BGRA_PACKED_COLOR
//---- Use legacy CRC32-adler tables (used before 1.91.6), in order to preserve old .ini data that you cannot afford to invalidate.
//#define IMGUI_USE_LEGACY_CRC32_ADLER
//---- Use 32-bit for ImWchar (default is 16-bit) to support Unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
//#define IMGUI_USE_WCHAR32
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
// By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
//#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if IMGUI_USE_STB_SPRINTF is defined.
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
//#define IMGUI_DISABLE_STB_SPRINTF_IMPLEMENTATION // only disabled if IMGUI_USE_STB_SPRINTF is defined.
//---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
// Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h.
//#define IMGUI_USE_STB_SPRINTF
//---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui)
// Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided).
// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
//#define IMGUI_ENABLE_FREETYPE
//---- Use FreeType + plutosvg or lunasvg to render OpenType SVG fonts (SVGinOT)
// Only works in combination with IMGUI_ENABLE_FREETYPE.
// - lunasvg is currently easier to acquire/install, as e.g. it is part of vcpkg.
// - plutosvg will support more fonts and may load them faster. It currently requires to be built manually but it is fairly easy. See misc/freetype/README for instructions.
// - Both require headers to be available in the include path + program to be linked with the library code (not provided).
// - (note: lunasvg implementation is based on Freetype's rsvg-port.c which is licensed under CeCILL-C Free Software License Agreement)
//#define IMGUI_ENABLE_FREETYPE_PLUTOSVG
//#define IMGUI_ENABLE_FREETYPE_LUNASVG
//---- Use stb_truetype to build and rasterize the font atlas (default)
// The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend.
//#define IMGUI_ENABLE_STB_TRUETYPE
//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
/*
#define IM_VEC2_CLASS_EXTRA \
constexpr ImVec2(const MyVec2& f) : x(f.x), y(f.y) {} \
operator MyVec2() const { return MyVec2(x,y); }
#define IM_VEC4_CLASS_EXTRA \
constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \
operator MyVec4() const { return MyVec4(x,y,z,w); }
*/
//---- ...Or use Dear ImGui's own very basic math operators.
//#define IMGUI_DEFINE_MATH_OPERATORS
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
//#define ImDrawIdx unsigned int
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
//struct ImDrawList;
//struct ImDrawCmd;
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
//#define ImDrawCallback MyImDrawCallback
//---- Debug Tools: Macro to break in Debugger (we provide a default implementation of this in the codebase)
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
//#define IM_DEBUG_BREAK IM_ASSERT(0)
//#define IM_DEBUG_BREAK __debugbreak()
//---- Debug Tools: Enable slower asserts
//#define IMGUI_DEBUG_PARANOID
//---- Tip: You can add extra functions within the ImGui:: namespace from anywhere (e.g. your own sources/header files)
/*
namespace ImGui
{
void MyFunction(const char* name, MyMatrix44* mtx);
}
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,424 +0,0 @@
// dear imgui: Renderer Backend for DirectX9
// This needs to be used along with a Platform Backend (e.g. Win32)
// Implemented features:
// [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID!
// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
// [X] Renderer: IMGUI_USE_BGRA_PACKED_COLOR support, as this is the optimal color encoding for DirectX9.
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// Learn about Dear ImGui:
// - FAQ https://dearimgui.com/faq
// - Getting Started https://dearimgui.com/getting-started
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
// - Introduction, links and more at the top of imgui.cpp
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2024-10-07: DirectX9: Changed default texture sampler to Clamp instead of Repeat/Wrap.
// 2024-02-12: DirectX9: Using RGBA format when supported by the driver to avoid CPU side conversion. (#6575)
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
// 2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
// 2021-06-25: DirectX9: Explicitly disable texture state stages after >= 1.
// 2021-05-19: DirectX9: Replaced direct access to ImDrawCmd::TextureId with a call to ImDrawCmd::GetTexID(). (will become a requirement)
// 2021-04-23: DirectX9: Explicitly setting up more graphics states to increase compatibility with unusual non-default states.
// 2021-03-18: DirectX9: Calling IDirect3DStateBlock9::Capture() after CreateStateBlock() as a workaround for state restoring issues (see #3857).
// 2021-03-03: DirectX9: Added support for IMGUI_USE_BGRA_PACKED_COLOR in user's imconfig file.
// 2021-02-18: DirectX9: Change blending equation to preserve alpha in output buffer.
// 2019-05-29: DirectX9: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
// 2019-04-30: DirectX9: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
// 2019-03-29: Misc: Fixed erroneous assert in ImGui_ImplDX9_InvalidateDeviceObjects().
// 2019-01-16: Misc: Disabled fog before drawing UI's. Fixes issue #2288.
// 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window.
// 2018-06-08: Misc: Extracted imgui_impl_dx9.cpp/.h away from the old combined DX9+Win32 example.
// 2018-06-08: DirectX9: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle.
// 2018-05-07: Render: Saving/restoring Transform because they don't seem to be included in the StateBlock. Setting shading mode to Gouraud.
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplDX9_RenderDrawData() in the .h file so you can call it yourself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
#include "imgui.h"
#ifndef IMGUI_DISABLE
#include "imgui_impl_dx9.h"
// DirectX
#include <d3d9.h>
// DirectX data
struct ImGui_ImplDX9_Data
{
LPDIRECT3DDEVICE9 pd3dDevice;
LPDIRECT3DVERTEXBUFFER9 pVB;
LPDIRECT3DINDEXBUFFER9 pIB;
LPDIRECT3DTEXTURE9 FontTexture;
int VertexBufferSize;
int IndexBufferSize;
bool HasRgbaSupport;
ImGui_ImplDX9_Data() { memset((void*)this, 0, sizeof(*this)); VertexBufferSize = 5000; IndexBufferSize = 10000; }
};
struct CUSTOMVERTEX
{
float pos[3];
D3DCOLOR col;
float uv[2];
};
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
#ifdef IMGUI_USE_BGRA_PACKED_COLOR
#define IMGUI_COL_TO_DX9_ARGB(_COL) (_COL)
#else
#define IMGUI_COL_TO_DX9_ARGB(_COL) (((_COL) & 0xFF00FF00) | (((_COL) & 0xFF0000) >> 16) | (((_COL) & 0xFF) << 16))
#endif
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
static ImGui_ImplDX9_Data* ImGui_ImplDX9_GetBackendData()
{
return ImGui::GetCurrentContext() ? (ImGui_ImplDX9_Data*)ImGui::GetIO().BackendRendererUserData : nullptr;
}
// Functions
static void ImGui_ImplDX9_SetupRenderState(ImDrawData* draw_data)
{
ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
// Setup viewport
D3DVIEWPORT9 vp;
vp.X = vp.Y = 0;
vp.Width = (DWORD)draw_data->DisplaySize.x;
vp.Height = (DWORD)draw_data->DisplaySize.y;
vp.MinZ = 0.0f;
vp.MaxZ = 1.0f;
LPDIRECT3DDEVICE9 device = bd->pd3dDevice;
device->SetViewport(&vp);
// Setup render state: fixed-pipeline, alpha-blending, no face culling, no depth testing, shade mode (for gradient), bilinear sampling.
device->SetPixelShader(nullptr);
device->SetVertexShader(nullptr);
device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
device->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD);
device->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
device->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
device->SetRenderState(D3DRS_ZENABLE, FALSE);
device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
device->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);
device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
device->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
device->SetRenderState(D3DRS_SRCBLENDALPHA, D3DBLEND_ONE);
device->SetRenderState(D3DRS_DESTBLENDALPHA, D3DBLEND_INVSRCALPHA);
device->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
device->SetRenderState(D3DRS_FOGENABLE, FALSE);
device->SetRenderState(D3DRS_RANGEFOGENABLE, FALSE);
device->SetRenderState(D3DRS_SPECULARENABLE, FALSE);
device->SetRenderState(D3DRS_STENCILENABLE, FALSE);
device->SetRenderState(D3DRS_CLIPPING, TRUE);
device->SetRenderState(D3DRS_LIGHTING, FALSE);
device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
device->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
device->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
device->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
device->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
device->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
// Setup orthographic projection matrix
// Our visible imgui space lies from draw_data->DisplayPos (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps.
// Being agnostic of whether <d3dx9.h> or <DirectXMath.h> can be used, we aren't relying on D3DXMatrixIdentity()/D3DXMatrixOrthoOffCenterLH() or DirectX::XMMatrixIdentity()/DirectX::XMMatrixOrthographicOffCenterLH()
{
float L = draw_data->DisplayPos.x + 0.5f;
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x + 0.5f;
float T = draw_data->DisplayPos.y + 0.5f;
float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y + 0.5f;
D3DMATRIX mat_identity = { { { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f } } };
D3DMATRIX mat_projection =
{ { {
2.0f/(R-L), 0.0f, 0.0f, 0.0f,
0.0f, 2.0f/(T-B), 0.0f, 0.0f,
0.0f, 0.0f, 0.5f, 0.0f,
(L+R)/(L-R), (T+B)/(B-T), 0.5f, 1.0f
} } };
device->SetTransform(D3DTS_WORLD, &mat_identity);
device->SetTransform(D3DTS_VIEW, &mat_identity);
device->SetTransform(D3DTS_PROJECTION, &mat_projection);
}
}
// Render function.
void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data)
{
// Avoid rendering when minimized
if (draw_data->DisplaySize.x <= 0.0f || draw_data->DisplaySize.y <= 0.0f)
return;
ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
LPDIRECT3DDEVICE9 device = bd->pd3dDevice;
// Create and grow buffers if needed
if (!bd->pVB || bd->VertexBufferSize < draw_data->TotalVtxCount)
{
if (bd->pVB) { bd->pVB->Release(); bd->pVB = nullptr; }
bd->VertexBufferSize = draw_data->TotalVtxCount + 5000;
if (device->CreateVertexBuffer(bd->VertexBufferSize * sizeof(CUSTOMVERTEX), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT, &bd->pVB, nullptr) < 0)
return;
}
if (!bd->pIB || bd->IndexBufferSize < draw_data->TotalIdxCount)
{
if (bd->pIB) { bd->pIB->Release(); bd->pIB = nullptr; }
bd->IndexBufferSize = draw_data->TotalIdxCount + 10000;
if (device->CreateIndexBuffer(bd->IndexBufferSize * sizeof(ImDrawIdx), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, sizeof(ImDrawIdx) == 2 ? D3DFMT_INDEX16 : D3DFMT_INDEX32, D3DPOOL_DEFAULT, &bd->pIB, nullptr) < 0)
return;
}
// Backup the DX9 state
IDirect3DStateBlock9* state_block = nullptr;
if (device->CreateStateBlock(D3DSBT_ALL, &state_block) < 0)
return;
if (state_block->Capture() < 0)
{
state_block->Release();
return;
}
// Backup the DX9 transform (DX9 documentation suggests that it is included in the StateBlock but it doesn't appear to)
D3DMATRIX last_world, last_view, last_projection;
device->GetTransform(D3DTS_WORLD, &last_world);
device->GetTransform(D3DTS_VIEW, &last_view);
device->GetTransform(D3DTS_PROJECTION, &last_projection);
// Allocate buffers
CUSTOMVERTEX* vtx_dst;
ImDrawIdx* idx_dst;
if (bd->pVB->Lock(0, (UINT)(draw_data->TotalVtxCount * sizeof(CUSTOMVERTEX)), (void**)&vtx_dst, D3DLOCK_DISCARD) < 0)
{
state_block->Release();
return;
}
if (bd->pIB->Lock(0, (UINT)(draw_data->TotalIdxCount * sizeof(ImDrawIdx)), (void**)&idx_dst, D3DLOCK_DISCARD) < 0)
{
bd->pVB->Unlock();
state_block->Release();
return;
}
// Copy and convert all vertices into a single contiguous buffer, convert colors to DX9 default format.
// FIXME-OPT: This is a minor waste of resource, the ideal is to use imconfig.h and
// 1) to avoid repacking colors: #define IMGUI_USE_BGRA_PACKED_COLOR
// 2) to avoid repacking vertices: #define IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT struct ImDrawVert { ImVec2 pos; float z; ImU32 col; ImVec2 uv; }
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* draw_list = draw_data->CmdLists[n];
const ImDrawVert* vtx_src = draw_list->VtxBuffer.Data;
for (int i = 0; i < draw_list->VtxBuffer.Size; i++)
{
vtx_dst->pos[0] = vtx_src->pos.x;
vtx_dst->pos[1] = vtx_src->pos.y;
vtx_dst->pos[2] = 0.0f;
vtx_dst->col = IMGUI_COL_TO_DX9_ARGB(vtx_src->col);
vtx_dst->uv[0] = vtx_src->uv.x;
vtx_dst->uv[1] = vtx_src->uv.y;
vtx_dst++;
vtx_src++;
}
memcpy(idx_dst, draw_list->IdxBuffer.Data, draw_list->IdxBuffer.Size * sizeof(ImDrawIdx));
idx_dst += draw_list->IdxBuffer.Size;
}
bd->pVB->Unlock();
bd->pIB->Unlock();
device->SetStreamSource(0, bd->pVB, 0, sizeof(CUSTOMVERTEX));
device->SetIndices(bd->pIB);
device->SetFVF(D3DFVF_CUSTOMVERTEX);
// Setup desired DX state
ImGui_ImplDX9_SetupRenderState(draw_data);
// Render command lists
// (Because we merged all buffers into a single one, we maintain our own offset into them)
int global_vtx_offset = 0;
int global_idx_offset = 0;
ImVec2 clip_off = draw_data->DisplayPos;
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* draw_list = draw_data->CmdLists[n];
for (int cmd_i = 0; cmd_i < draw_list->CmdBuffer.Size; cmd_i++)
{
const ImDrawCmd* pcmd = &draw_list->CmdBuffer[cmd_i];
if (pcmd->UserCallback != nullptr)
{
// User callback, registered via ImDrawList::AddCallback()
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
ImGui_ImplDX9_SetupRenderState(draw_data);
else
pcmd->UserCallback(draw_list, pcmd);
}
else
{
// Project scissor/clipping rectangles into framebuffer space
ImVec2 clip_min(pcmd->ClipRect.x - clip_off.x, pcmd->ClipRect.y - clip_off.y);
ImVec2 clip_max(pcmd->ClipRect.z - clip_off.x, pcmd->ClipRect.w - clip_off.y);
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
continue;
// Apply scissor/clipping rectangle
const RECT r = { (LONG)clip_min.x, (LONG)clip_min.y, (LONG)clip_max.x, (LONG)clip_max.y };
device->SetScissorRect(&r);
// Bind texture, Draw
const LPDIRECT3DTEXTURE9 texture = (LPDIRECT3DTEXTURE9)pcmd->GetTexID();
device->SetTexture(0, texture);
device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, pcmd->VtxOffset + global_vtx_offset, 0, (UINT)draw_list->VtxBuffer.Size, pcmd->IdxOffset + global_idx_offset, pcmd->ElemCount / 3);
}
}
global_idx_offset += draw_list->IdxBuffer.Size;
global_vtx_offset += draw_list->VtxBuffer.Size;
}
// Restore the DX9 transform
device->SetTransform(D3DTS_WORLD, &last_world);
device->SetTransform(D3DTS_VIEW, &last_view);
device->SetTransform(D3DTS_PROJECTION, &last_projection);
// Restore the DX9 state
state_block->Apply();
state_block->Release();
}
static bool ImGui_ImplDX9_CheckFormatSupport(LPDIRECT3DDEVICE9 pDevice, D3DFORMAT format)
{
LPDIRECT3D9 pd3d = nullptr;
if (pDevice->GetDirect3D(&pd3d) != D3D_OK)
return false;
D3DDEVICE_CREATION_PARAMETERS param = {};
D3DDISPLAYMODE mode = {};
if (pDevice->GetCreationParameters(&param) != D3D_OK || pDevice->GetDisplayMode(0, &mode) != D3D_OK)
{
pd3d->Release();
return false;
}
// Font texture should support linear filter, color blend and write to render-target
bool support = (pd3d->CheckDeviceFormat(param.AdapterOrdinal, param.DeviceType, mode.Format, D3DUSAGE_DYNAMIC | D3DUSAGE_QUERY_FILTER | D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3DRTYPE_TEXTURE, format)) == D3D_OK;
pd3d->Release();
return support;
}
bool ImGui_ImplDX9_Init(IDirect3DDevice9* device)
{
ImGuiIO& io = ImGui::GetIO();
IMGUI_CHECKVERSION();
IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
// Setup backend capabilities flags
ImGui_ImplDX9_Data* bd = IM_NEW(ImGui_ImplDX9_Data)();
io.BackendRendererUserData = (void*)bd;
io.BackendRendererName = "imgui_impl_dx9";
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
bd->pd3dDevice = device;
bd->pd3dDevice->AddRef();
bd->HasRgbaSupport = ImGui_ImplDX9_CheckFormatSupport(bd->pd3dDevice, D3DFMT_A8B8G8R8);
return true;
}
void ImGui_ImplDX9_Shutdown()
{
ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
ImGuiIO& io = ImGui::GetIO();
ImGui_ImplDX9_InvalidateDeviceObjects();
if (bd->pd3dDevice) { bd->pd3dDevice->Release(); }
io.BackendRendererName = nullptr;
io.BackendRendererUserData = nullptr;
io.BackendFlags &= ~ImGuiBackendFlags_RendererHasVtxOffset;
IM_DELETE(bd);
}
// Convert RGBA32 to BGRA32 (because RGBA32 is not well supported by DX9 devices)
static void ImGui_ImplDX9_CopyTextureRegion(bool tex_use_colors, ImU32* src, int src_pitch, ImU32* dst, int dst_pitch, int w, int h)
{
#ifndef IMGUI_USE_BGRA_PACKED_COLOR
ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
const bool convert_rgba_to_bgra = (!bd->HasRgbaSupport && tex_use_colors);
#else
const bool convert_rgba_to_bgra = false;
IM_UNUSED(tex_use_colors);
#endif
for (int y = 0; y < h; y++)
{
ImU32* src_p = (ImU32*)((unsigned char*)src + src_pitch * y);
ImU32* dst_p = (ImU32*)((unsigned char*)dst + dst_pitch * y);
if (convert_rgba_to_bgra)
for (int x = w; x > 0; x--, src_p++, dst_p++) // Convert copy
*dst_p = IMGUI_COL_TO_DX9_ARGB(*src_p);
else
memcpy(dst_p, src_p, w * 4); // Raw copy
}
}
static bool ImGui_ImplDX9_CreateFontsTexture()
{
// Build texture atlas
ImGuiIO& io = ImGui::GetIO();
ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
unsigned char* pixels;
int width, height, bytes_per_pixel;
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height, &bytes_per_pixel);
// Upload texture to graphics system
bd->FontTexture = nullptr;
if (bd->pd3dDevice->CreateTexture(width, height, 1, D3DUSAGE_DYNAMIC, bd->HasRgbaSupport ? D3DFMT_A8B8G8R8 : D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bd->FontTexture, nullptr) < 0)
return false;
D3DLOCKED_RECT tex_locked_rect;
if (bd->FontTexture->LockRect(0, &tex_locked_rect, nullptr, 0) != D3D_OK)
return false;
ImGui_ImplDX9_CopyTextureRegion(io.Fonts->TexPixelsUseColors, (ImU32*)pixels, width * bytes_per_pixel, (ImU32*)tex_locked_rect.pBits, (int)tex_locked_rect.Pitch, width, height);
bd->FontTexture->UnlockRect(0);
// Store our identifier
io.Fonts->SetTexID((ImTextureID)bd->FontTexture);
return true;
}
bool ImGui_ImplDX9_CreateDeviceObjects()
{
ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
if (!bd || !bd->pd3dDevice)
return false;
if (!ImGui_ImplDX9_CreateFontsTexture())
return false;
return true;
}
void ImGui_ImplDX9_InvalidateDeviceObjects()
{
ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
if (!bd || !bd->pd3dDevice)
return;
if (bd->pVB) { bd->pVB->Release(); bd->pVB = nullptr; }
if (bd->pIB) { bd->pIB->Release(); bd->pIB = nullptr; }
if (bd->FontTexture) { bd->FontTexture->Release(); bd->FontTexture = nullptr; ImGui::GetIO().Fonts->SetTexID(0); } // We copied bd->pFontTextureView to io.Fonts->TexID so let's clear that as well.
}
void ImGui_ImplDX9_NewFrame()
{
ImGui_ImplDX9_Data* bd = ImGui_ImplDX9_GetBackendData();
IM_ASSERT(bd != nullptr && "Context or backend not initialized! Did you call ImGui_ImplDX9_Init()?");
if (!bd->FontTexture)
ImGui_ImplDX9_CreateDeviceObjects();
}
//-----------------------------------------------------------------------------
#endif // #ifndef IMGUI_DISABLE

View File

@@ -1,33 +0,0 @@
// dear imgui: Renderer Backend for DirectX9
// This needs to be used along with a Platform Backend (e.g. Win32)
// Implemented features:
// [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID!
// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
// [X] Renderer: IMGUI_USE_BGRA_PACKED_COLOR support, as this is the optimal color encoding for DirectX9.
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// Learn about Dear ImGui:
// - FAQ https://dearimgui.com/faq
// - Getting Started https://dearimgui.com/getting-started
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
// - Introduction, links and more at the top of imgui.cpp
#pragma once
#include "imgui.h" // IMGUI_IMPL_API
#ifndef IMGUI_DISABLE
struct IDirect3DDevice9;
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device);
IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data);
// Use if you want to reset your rendering device without losing Dear ImGui state.
IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects();
IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects();
#endif // #ifndef IMGUI_DISABLE

View File

@@ -1,940 +0,0 @@
// dear imgui: Platform Backend for Windows (standard windows API for 32-bits AND 64-bits applications)
// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..)
// Implemented features:
// [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui)
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen.
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy VK_* values are obsolete since 1.87 and not supported since 1.91.5]
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// Learn about Dear ImGui:
// - FAQ https://dearimgui.com/faq
// - Getting Started https://dearimgui.com/getting-started
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
// - Introduction, links and more at the top of imgui.cpp
// Configuration flags to add in your imconfig file:
//#define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD // Disable gamepad support. This was meaningful before <1.81 but we now load XInput dynamically so the option is now less relevant.
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2024-07-08: Inputs: Fixed ImGuiMod_Super being mapped to VK_APPS instead of VK_LWIN||VK_RWIN. (#7768)
// 2023-10-05: Inputs: Added support for extra ImGuiKey values: F13 to F24 function keys, app back/forward keys.
// 2023-09-25: Inputs: Synthesize key-down event on key-up for VK_SNAPSHOT / ImGuiKey_PrintScreen as Windows doesn't emit it (same behavior as GLFW/SDL).
// 2023-09-07: Inputs: Added support for keyboard codepage conversion for when application is compiled in MBCS mode and using a non-Unicode window.
// 2023-04-19: Added ImGui_ImplWin32_InitForOpenGL() to facilitate combining raw Win32/Winapi with OpenGL. (#3218)
// 2023-04-04: Inputs: Added support for io.AddMouseSourceEvent() to discriminate ImGuiMouseSource_Mouse/ImGuiMouseSource_TouchScreen/ImGuiMouseSource_Pen. (#2702)
// 2023-02-15: Inputs: Use WM_NCMOUSEMOVE / WM_NCMOUSELEAVE to track mouse position over non-client area (e.g. OS decorations) when app is not focused. (#6045, #6162)
// 2023-02-02: Inputs: Flipping WM_MOUSEHWHEEL (horizontal mouse-wheel) value to match other backends and offer consistent horizontal scrolling direction. (#4019, #6096, #1463)
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
// 2022-09-28: Inputs: Convert WM_CHAR values with MultiByteToWideChar() when window class was registered as MBCS (not Unicode).
// 2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).
// 2022-01-26: Inputs: replaced short-lived io.AddKeyModsEvent() (added two weeks ago) with io.AddKeyEvent() using ImGuiKey_ModXXX flags. Sorry for the confusion.
// 2021-01-20: Inputs: calling new io.AddKeyAnalogEvent() for gamepad support, instead of writing directly to io.NavInputs[].
// 2022-01-17: Inputs: calling new io.AddMousePosEvent(), io.AddMouseButtonEvent(), io.AddMouseWheelEvent() API (1.87+).
// 2022-01-17: Inputs: always update key mods next and before a key event (not in NewFrame) to fix input queue with very low framerates.
// 2022-01-12: Inputs: Update mouse inputs using WM_MOUSEMOVE/WM_MOUSELEAVE + fallback to provide it when focused but not hovered/captured. More standard and will allow us to pass it to future input queue API.
// 2022-01-12: Inputs: Maintain our own copy of MouseButtonsDown mask instead of using ImGui::IsAnyMouseDown() which will be obsoleted.
// 2022-01-10: Inputs: calling new io.AddKeyEvent(), io.AddKeyModsEvent() + io.SetKeyEventNativeData() API (1.87+). Support for full ImGuiKey range.
// 2021-12-16: Inputs: Fill VK_LCONTROL/VK_RCONTROL/VK_LSHIFT/VK_RSHIFT/VK_LMENU/VK_RMENU for completeness.
// 2021-08-17: Calling io.AddFocusEvent() on WM_SETFOCUS/WM_KILLFOCUS messages.
// 2021-08-02: Inputs: Fixed keyboard modifiers being reported when host window doesn't have focus.
// 2021-07-29: Inputs: MousePos is correctly reported when the host platform window is hovered but not focused (using TrackMouseEvent() to receive WM_MOUSELEAVE events).
// 2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
// 2021-06-08: Fixed ImGui_ImplWin32_EnableDpiAwareness() and ImGui_ImplWin32_GetDpiScaleForMonitor() to handle Windows 8.1/10 features without a manifest (per-monitor DPI, and properly calls SetProcessDpiAwareness() on 8.1).
// 2021-03-23: Inputs: Clearing keyboard down array when losing focus (WM_KILLFOCUS).
// 2021-02-18: Added ImGui_ImplWin32_EnableAlphaCompositing(). Non Visual Studio users will need to link with dwmapi.lib (MinGW/gcc: use -ldwmapi).
// 2021-02-17: Fixed ImGui_ImplWin32_EnableDpiAwareness() attempting to get SetProcessDpiAwareness from shcore.dll on Windows 8 whereas it is only supported on Windows 8.1.
// 2021-01-25: Inputs: Dynamically loading XInput DLL.
// 2020-12-04: Misc: Fixed setting of io.DisplaySize to invalid/uninitialized data when after hwnd has been closed.
// 2020-03-03: Inputs: Calling AddInputCharacterUTF16() to support surrogate pairs leading to codepoint >= 0x10000 (for more complete CJK inputs)
// 2020-02-17: Added ImGui_ImplWin32_EnableDpiAwareness(), ImGui_ImplWin32_GetDpiScaleForHwnd(), ImGui_ImplWin32_GetDpiScaleForMonitor() helper functions.
// 2020-01-14: Inputs: Added support for #define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD/IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT.
// 2019-12-05: Inputs: Added support for ImGuiMouseCursor_NotAllowed mouse cursor.
// 2019-05-11: Inputs: Don't filter value from WM_CHAR before calling AddInputCharacter().
// 2019-01-17: Misc: Using GetForegroundWindow()+IsChild() instead of GetActiveWindow() to be compatible with windows created in a different thread or parent.
// 2019-01-17: Inputs: Added support for mouse buttons 4 and 5 via WM_XBUTTON* messages.
// 2019-01-15: Inputs: Added support for XInput gamepads (if ImGuiConfigFlags_NavEnableGamepad is set by user application).
// 2018-11-30: Misc: Setting up io.BackendPlatformName so it can be displayed in the About Window.
// 2018-06-29: Inputs: Added support for the ImGuiMouseCursor_Hand cursor.
// 2018-06-10: Inputs: Fixed handling of mouse wheel messages to support fine position messages (typically sent by track-pads).
// 2018-06-08: Misc: Extracted imgui_impl_win32.cpp/.h away from the old combined DX9/DX10/DX11/DX12 examples.
// 2018-03-20: Misc: Setup io.BackendFlags ImGuiBackendFlags_HasMouseCursors and ImGuiBackendFlags_HasSetMousePos flags + honor ImGuiConfigFlags_NoMouseCursorChange flag.
// 2018-02-20: Inputs: Added support for mouse cursors (ImGui::GetMouseCursor() value and WM_SETCURSOR message handling).
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
// 2018-02-06: Inputs: Honoring the io.WantSetMousePos by repositioning the mouse (when using navigation and ImGuiConfigFlags_NavMoveMouse is set).
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-01-20: Inputs: Added Horizontal Mouse Wheel support.
// 2018-01-08: Inputs: Added mapping for ImGuiKey_Insert.
// 2018-01-05: Inputs: Added WM_LBUTTONDBLCLK double-click handlers for window classes with the CS_DBLCLKS flag.
// 2017-10-23: Inputs: Added WM_SYSKEYDOWN / WM_SYSKEYUP handlers so e.g. the VK_MENU key can be read.
// 2017-10-23: Inputs: Using Win32 ::SetCapture/::GetCapture() to retrieve mouse positions outside the client area when dragging.
// 2016-11-12: Inputs: Only call Win32 ::SetCursor(nullptr) when io.MouseDrawCursor is set.
#include "imgui.h"
#ifndef IMGUI_DISABLE
#include "imgui_impl_win32.h"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <windowsx.h> // GET_X_LPARAM(), GET_Y_LPARAM()
#include <tchar.h>
#include <dwmapi.h>
// Using XInput for gamepad (will load DLL dynamically)
#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
#include <xinput.h>
typedef DWORD(WINAPI* PFN_XInputGetCapabilities)(DWORD, DWORD, XINPUT_CAPABILITIES*);
typedef DWORD(WINAPI* PFN_XInputGetState)(DWORD, XINPUT_STATE*);
#endif
// Clang/GCC warnings with -Weverything
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-function-type" // warning: cast between incompatible function types (for loader)
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
#pragma GCC diagnostic ignored "-Wcast-function-type" // warning: cast between incompatible function types (for loader)
#endif
struct ImGui_ImplWin32_Data
{
HWND hWnd;
HWND MouseHwnd;
int MouseTrackedArea; // 0: not tracked, 1: client area, 2: non-client area
int MouseButtonsDown;
INT64 Time;
INT64 TicksPerSecond;
ImGuiMouseCursor LastMouseCursor;
UINT32 KeyboardCodePage;
#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
bool HasGamepad;
bool WantUpdateHasGamepad;
HMODULE XInputDLL;
PFN_XInputGetCapabilities XInputGetCapabilities;
PFN_XInputGetState XInputGetState;
#endif
ImGui_ImplWin32_Data() { memset((void*)this, 0, sizeof(*this)); }
};
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// FIXME: multi-context support is not well tested and probably dysfunctional in this backend.
// FIXME: some shared resources (mouse cursor shape, gamepad) are mishandled when using multi-context.
static ImGui_ImplWin32_Data* ImGui_ImplWin32_GetBackendData()
{
return ImGui::GetCurrentContext() ? (ImGui_ImplWin32_Data*)ImGui::GetIO().BackendPlatformUserData : nullptr;
}
static ImGui_ImplWin32_Data* ImGui_ImplWin32_GetBackendData(ImGuiIO& io)
{
return (ImGui_ImplWin32_Data*)io.BackendPlatformUserData;
}
// Functions
static void ImGui_ImplWin32_UpdateKeyboardCodePage(ImGuiIO& io)
{
// Retrieve keyboard code page, required for handling of non-Unicode Windows.
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData(io);
HKL keyboard_layout = ::GetKeyboardLayout(0);
LCID keyboard_lcid = MAKELCID(HIWORD(keyboard_layout), SORT_DEFAULT);
if (::GetLocaleInfoA(keyboard_lcid, (LOCALE_RETURN_NUMBER | LOCALE_IDEFAULTANSICODEPAGE), (LPSTR)&bd->KeyboardCodePage, sizeof(bd->KeyboardCodePage)) == 0)
bd->KeyboardCodePage = CP_ACP; // Fallback to default ANSI code page when fails.
}
static bool ImGui_ImplWin32_InitEx(void* hwnd, bool platform_has_own_dc)
{
ImGuiIO& io = ImGui::GetIO();
IMGUI_CHECKVERSION();
IM_ASSERT(io.BackendPlatformUserData == nullptr && "Already initialized a platform backend!");
INT64 perf_frequency, perf_counter;
if (!::QueryPerformanceFrequency((LARGE_INTEGER*)&perf_frequency))
return false;
if (!::QueryPerformanceCounter((LARGE_INTEGER*)&perf_counter))
return false;
// Setup backend capabilities flags
ImGui_ImplWin32_Data* bd = IM_NEW(ImGui_ImplWin32_Data)();
io.BackendPlatformUserData = (void*)bd;
io.BackendPlatformName = "imgui_impl_win32";
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
bd->hWnd = (HWND)hwnd;
bd->TicksPerSecond = perf_frequency;
bd->Time = perf_counter;
bd->LastMouseCursor = ImGuiMouseCursor_COUNT;
ImGui_ImplWin32_UpdateKeyboardCodePage(io);
// Set platform dependent data in viewport
ImGuiViewport* main_viewport = ImGui::GetMainViewport();
main_viewport->PlatformHandle = main_viewport->PlatformHandleRaw = (void*)bd->hWnd;
IM_UNUSED(platform_has_own_dc); // Used in 'docking' branch
// Dynamically load XInput library
#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
bd->WantUpdateHasGamepad = true;
const char* xinput_dll_names[] =
{
"xinput1_4.dll", // Windows 8+
"xinput1_3.dll", // DirectX SDK
"xinput9_1_0.dll", // Windows Vista, Windows 7
"xinput1_2.dll", // DirectX SDK
"xinput1_1.dll" // DirectX SDK
};
for (int n = 0; n < IM_ARRAYSIZE(xinput_dll_names); n++)
if (HMODULE dll = ::LoadLibraryA(xinput_dll_names[n]))
{
bd->XInputDLL = dll;
bd->XInputGetCapabilities = (PFN_XInputGetCapabilities)::GetProcAddress(dll, "XInputGetCapabilities");
bd->XInputGetState = (PFN_XInputGetState)::GetProcAddress(dll, "XInputGetState");
break;
}
#endif // IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
return true;
}
IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd)
{
return ImGui_ImplWin32_InitEx(hwnd, false);
}
IMGUI_IMPL_API bool ImGui_ImplWin32_InitForOpenGL(void* hwnd)
{
// OpenGL needs CS_OWNDC
return ImGui_ImplWin32_InitEx(hwnd, true);
}
void ImGui_ImplWin32_Shutdown()
{
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData();
IM_ASSERT(bd != nullptr && "No platform backend to shutdown, or already shutdown?");
ImGuiIO& io = ImGui::GetIO();
// Unload XInput library
#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
if (bd->XInputDLL)
::FreeLibrary(bd->XInputDLL);
#endif // IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
io.BackendPlatformName = nullptr;
io.BackendPlatformUserData = nullptr;
io.BackendFlags &= ~(ImGuiBackendFlags_HasMouseCursors | ImGuiBackendFlags_HasSetMousePos | ImGuiBackendFlags_HasGamepad);
IM_DELETE(bd);
}
static bool ImGui_ImplWin32_UpdateMouseCursor(ImGuiIO& io, ImGuiMouseCursor imgui_cursor)
{
if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange)
return false;
if (imgui_cursor == ImGuiMouseCursor_None || io.MouseDrawCursor)
{
// Hide OS mouse cursor if imgui is drawing it or if it wants no cursor
::SetCursor(nullptr);
}
else
{
// Show OS mouse cursor
LPTSTR win32_cursor = IDC_ARROW;
switch (imgui_cursor)
{
case ImGuiMouseCursor_Arrow: win32_cursor = IDC_ARROW; break;
case ImGuiMouseCursor_TextInput: win32_cursor = IDC_IBEAM; break;
case ImGuiMouseCursor_ResizeAll: win32_cursor = IDC_SIZEALL; break;
case ImGuiMouseCursor_ResizeEW: win32_cursor = IDC_SIZEWE; break;
case ImGuiMouseCursor_ResizeNS: win32_cursor = IDC_SIZENS; break;
case ImGuiMouseCursor_ResizeNESW: win32_cursor = IDC_SIZENESW; break;
case ImGuiMouseCursor_ResizeNWSE: win32_cursor = IDC_SIZENWSE; break;
case ImGuiMouseCursor_Hand: win32_cursor = IDC_HAND; break;
case ImGuiMouseCursor_NotAllowed: win32_cursor = IDC_NO; break;
}
::SetCursor(::LoadCursor(nullptr, win32_cursor));
}
return true;
}
static bool IsVkDown(int vk)
{
return (::GetKeyState(vk) & 0x8000) != 0;
}
static void ImGui_ImplWin32_AddKeyEvent(ImGuiIO& io, ImGuiKey key, bool down, int native_keycode, int native_scancode = -1)
{
io.AddKeyEvent(key, down);
io.SetKeyEventNativeData(key, native_keycode, native_scancode); // To support legacy indexing (<1.87 user code)
IM_UNUSED(native_scancode);
}
static void ImGui_ImplWin32_ProcessKeyEventsWorkarounds(ImGuiIO& io)
{
// Left & right Shift keys: when both are pressed together, Windows tend to not generate the WM_KEYUP event for the first released one.
if (ImGui::IsKeyDown(ImGuiKey_LeftShift) && !IsVkDown(VK_LSHIFT))
ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_LeftShift, false, VK_LSHIFT);
if (ImGui::IsKeyDown(ImGuiKey_RightShift) && !IsVkDown(VK_RSHIFT))
ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_RightShift, false, VK_RSHIFT);
// Sometimes WM_KEYUP for Win key is not passed down to the app (e.g. for Win+V on some setups, according to GLFW).
if (ImGui::IsKeyDown(ImGuiKey_LeftSuper) && !IsVkDown(VK_LWIN))
ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_LeftSuper, false, VK_LWIN);
if (ImGui::IsKeyDown(ImGuiKey_RightSuper) && !IsVkDown(VK_RWIN))
ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_RightSuper, false, VK_RWIN);
}
static void ImGui_ImplWin32_UpdateKeyModifiers(ImGuiIO& io)
{
io.AddKeyEvent(ImGuiMod_Ctrl, IsVkDown(VK_CONTROL));
io.AddKeyEvent(ImGuiMod_Shift, IsVkDown(VK_SHIFT));
io.AddKeyEvent(ImGuiMod_Alt, IsVkDown(VK_MENU));
io.AddKeyEvent(ImGuiMod_Super, IsVkDown(VK_LWIN) || IsVkDown(VK_RWIN));
}
static void ImGui_ImplWin32_UpdateMouseData(ImGuiIO& io)
{
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData(io);
IM_ASSERT(bd->hWnd != 0);
HWND focused_window = ::GetForegroundWindow();
const bool is_app_focused = (focused_window == bd->hWnd);
if (is_app_focused)
{
// (Optional) Set OS mouse position from Dear ImGui if requested (rarely used, only when io.ConfigNavMoveSetMousePos is enabled by user)
if (io.WantSetMousePos)
{
POINT pos = { (int)io.MousePos.x, (int)io.MousePos.y };
if (::ClientToScreen(bd->hWnd, &pos))
::SetCursorPos(pos.x, pos.y);
}
// (Optional) Fallback to provide mouse position when focused (WM_MOUSEMOVE already provides this when hovered or captured)
// This also fills a short gap when clicking non-client area: WM_NCMOUSELEAVE -> modal OS move -> gap -> WM_NCMOUSEMOVE
if (!io.WantSetMousePos && bd->MouseTrackedArea == 0)
{
POINT pos;
if (::GetCursorPos(&pos) && ::ScreenToClient(bd->hWnd, &pos))
io.AddMousePosEvent((float)pos.x, (float)pos.y);
}
}
}
// Gamepad navigation mapping
static void ImGui_ImplWin32_UpdateGamepads(ImGuiIO& io)
{
#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData(io);
//if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs.
// return;
// Calling XInputGetState() every frame on disconnected gamepads is unfortunately too slow.
// Instead we refresh gamepad availability by calling XInputGetCapabilities() _only_ after receiving WM_DEVICECHANGE.
if (bd->WantUpdateHasGamepad)
{
XINPUT_CAPABILITIES caps = {};
bd->HasGamepad = bd->XInputGetCapabilities ? (bd->XInputGetCapabilities(0, XINPUT_FLAG_GAMEPAD, &caps) == ERROR_SUCCESS) : false;
bd->WantUpdateHasGamepad = false;
}
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;
XINPUT_STATE xinput_state;
XINPUT_GAMEPAD& gamepad = xinput_state.Gamepad;
if (!bd->HasGamepad || bd->XInputGetState == nullptr || bd->XInputGetState(0, &xinput_state) != ERROR_SUCCESS)
return;
io.BackendFlags |= ImGuiBackendFlags_HasGamepad;
#define IM_SATURATE(V) (V < 0.0f ? 0.0f : V > 1.0f ? 1.0f : V)
#define MAP_BUTTON(KEY_NO, BUTTON_ENUM) { io.AddKeyEvent(KEY_NO, (gamepad.wButtons & BUTTON_ENUM) != 0); }
#define MAP_ANALOG(KEY_NO, VALUE, V0, V1) { float vn = (float)(VALUE - V0) / (float)(V1 - V0); io.AddKeyAnalogEvent(KEY_NO, vn > 0.10f, IM_SATURATE(vn)); }
MAP_BUTTON(ImGuiKey_GamepadStart, XINPUT_GAMEPAD_START);
MAP_BUTTON(ImGuiKey_GamepadBack, XINPUT_GAMEPAD_BACK);
MAP_BUTTON(ImGuiKey_GamepadFaceLeft, XINPUT_GAMEPAD_X);
MAP_BUTTON(ImGuiKey_GamepadFaceRight, XINPUT_GAMEPAD_B);
MAP_BUTTON(ImGuiKey_GamepadFaceUp, XINPUT_GAMEPAD_Y);
MAP_BUTTON(ImGuiKey_GamepadFaceDown, XINPUT_GAMEPAD_A);
MAP_BUTTON(ImGuiKey_GamepadDpadLeft, XINPUT_GAMEPAD_DPAD_LEFT);
MAP_BUTTON(ImGuiKey_GamepadDpadRight, XINPUT_GAMEPAD_DPAD_RIGHT);
MAP_BUTTON(ImGuiKey_GamepadDpadUp, XINPUT_GAMEPAD_DPAD_UP);
MAP_BUTTON(ImGuiKey_GamepadDpadDown, XINPUT_GAMEPAD_DPAD_DOWN);
MAP_BUTTON(ImGuiKey_GamepadL1, XINPUT_GAMEPAD_LEFT_SHOULDER);
MAP_BUTTON(ImGuiKey_GamepadR1, XINPUT_GAMEPAD_RIGHT_SHOULDER);
MAP_ANALOG(ImGuiKey_GamepadL2, gamepad.bLeftTrigger, XINPUT_GAMEPAD_TRIGGER_THRESHOLD, 255);
MAP_ANALOG(ImGuiKey_GamepadR2, gamepad.bRightTrigger, XINPUT_GAMEPAD_TRIGGER_THRESHOLD, 255);
MAP_BUTTON(ImGuiKey_GamepadL3, XINPUT_GAMEPAD_LEFT_THUMB);
MAP_BUTTON(ImGuiKey_GamepadR3, XINPUT_GAMEPAD_RIGHT_THUMB);
MAP_ANALOG(ImGuiKey_GamepadLStickLeft, gamepad.sThumbLX, -XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, -32768);
MAP_ANALOG(ImGuiKey_GamepadLStickRight, gamepad.sThumbLX, +XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, +32767);
MAP_ANALOG(ImGuiKey_GamepadLStickUp, gamepad.sThumbLY, +XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, +32767);
MAP_ANALOG(ImGuiKey_GamepadLStickDown, gamepad.sThumbLY, -XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, -32768);
MAP_ANALOG(ImGuiKey_GamepadRStickLeft, gamepad.sThumbRX, -XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, -32768);
MAP_ANALOG(ImGuiKey_GamepadRStickRight, gamepad.sThumbRX, +XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, +32767);
MAP_ANALOG(ImGuiKey_GamepadRStickUp, gamepad.sThumbRY, +XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, +32767);
MAP_ANALOG(ImGuiKey_GamepadRStickDown, gamepad.sThumbRY, -XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, -32768);
#undef MAP_BUTTON
#undef MAP_ANALOG
#else // #ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
IM_UNUSED(io);
#endif
}
void ImGui_ImplWin32_NewFrame()
{
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData();
IM_ASSERT(bd != nullptr && "Context or backend not initialized? Did you call ImGui_ImplWin32_Init()?");
ImGuiIO& io = ImGui::GetIO();
// Setup display size (every frame to accommodate for window resizing)
RECT rect = { 0, 0, 0, 0 };
::GetClientRect(bd->hWnd, &rect);
io.DisplaySize = ImVec2((float)(rect.right - rect.left), (float)(rect.bottom - rect.top));
// Setup time step
INT64 current_time = 0;
::QueryPerformanceCounter((LARGE_INTEGER*)&current_time);
io.DeltaTime = (float)(current_time - bd->Time) / bd->TicksPerSecond;
bd->Time = current_time;
// Update OS mouse position
ImGui_ImplWin32_UpdateMouseData(io);
// Process workarounds for known Windows key handling issues
ImGui_ImplWin32_ProcessKeyEventsWorkarounds(io);
// Update OS mouse cursor with the cursor requested by imgui
ImGuiMouseCursor mouse_cursor = io.MouseDrawCursor ? ImGuiMouseCursor_None : ImGui::GetMouseCursor();
if (bd->LastMouseCursor != mouse_cursor)
{
bd->LastMouseCursor = mouse_cursor;
ImGui_ImplWin32_UpdateMouseCursor(io, mouse_cursor);
}
// Update game controllers (if enabled and available)
ImGui_ImplWin32_UpdateGamepads(io);
}
// Map VK_xxx to ImGuiKey_xxx.
// Not static to allow third-party code to use that if they want to (but undocumented)
ImGuiKey ImGui_ImplWin32_KeyEventToImGuiKey(WPARAM wParam, LPARAM lParam);
ImGuiKey ImGui_ImplWin32_KeyEventToImGuiKey(WPARAM wParam, LPARAM lParam)
{
// There is no distinct VK_xxx for keypad enter, instead it is VK_RETURN + KF_EXTENDED.
if ((wParam == VK_RETURN) && (HIWORD(lParam) & KF_EXTENDED))
return ImGuiKey_KeypadEnter;
switch (wParam)
{
case VK_TAB: return ImGuiKey_Tab;
case VK_LEFT: return ImGuiKey_LeftArrow;
case VK_RIGHT: return ImGuiKey_RightArrow;
case VK_UP: return ImGuiKey_UpArrow;
case VK_DOWN: return ImGuiKey_DownArrow;
case VK_PRIOR: return ImGuiKey_PageUp;
case VK_NEXT: return ImGuiKey_PageDown;
case VK_HOME: return ImGuiKey_Home;
case VK_END: return ImGuiKey_End;
case VK_INSERT: return ImGuiKey_Insert;
case VK_DELETE: return ImGuiKey_Delete;
case VK_BACK: return ImGuiKey_Backspace;
case VK_SPACE: return ImGuiKey_Space;
case VK_RETURN: return ImGuiKey_Enter;
case VK_ESCAPE: return ImGuiKey_Escape;
case VK_OEM_7: return ImGuiKey_Apostrophe;
case VK_OEM_COMMA: return ImGuiKey_Comma;
case VK_OEM_MINUS: return ImGuiKey_Minus;
case VK_OEM_PERIOD: return ImGuiKey_Period;
case VK_OEM_2: return ImGuiKey_Slash;
case VK_OEM_1: return ImGuiKey_Semicolon;
case VK_OEM_PLUS: return ImGuiKey_Equal;
case VK_OEM_4: return ImGuiKey_LeftBracket;
case VK_OEM_5: return ImGuiKey_Backslash;
case VK_OEM_6: return ImGuiKey_RightBracket;
case VK_OEM_3: return ImGuiKey_GraveAccent;
case VK_CAPITAL: return ImGuiKey_CapsLock;
case VK_SCROLL: return ImGuiKey_ScrollLock;
case VK_NUMLOCK: return ImGuiKey_NumLock;
case VK_SNAPSHOT: return ImGuiKey_PrintScreen;
case VK_PAUSE: return ImGuiKey_Pause;
case VK_NUMPAD0: return ImGuiKey_Keypad0;
case VK_NUMPAD1: return ImGuiKey_Keypad1;
case VK_NUMPAD2: return ImGuiKey_Keypad2;
case VK_NUMPAD3: return ImGuiKey_Keypad3;
case VK_NUMPAD4: return ImGuiKey_Keypad4;
case VK_NUMPAD5: return ImGuiKey_Keypad5;
case VK_NUMPAD6: return ImGuiKey_Keypad6;
case VK_NUMPAD7: return ImGuiKey_Keypad7;
case VK_NUMPAD8: return ImGuiKey_Keypad8;
case VK_NUMPAD9: return ImGuiKey_Keypad9;
case VK_DECIMAL: return ImGuiKey_KeypadDecimal;
case VK_DIVIDE: return ImGuiKey_KeypadDivide;
case VK_MULTIPLY: return ImGuiKey_KeypadMultiply;
case VK_SUBTRACT: return ImGuiKey_KeypadSubtract;
case VK_ADD: return ImGuiKey_KeypadAdd;
case VK_LSHIFT: return ImGuiKey_LeftShift;
case VK_LCONTROL: return ImGuiKey_LeftCtrl;
case VK_LMENU: return ImGuiKey_LeftAlt;
case VK_LWIN: return ImGuiKey_LeftSuper;
case VK_RSHIFT: return ImGuiKey_RightShift;
case VK_RCONTROL: return ImGuiKey_RightCtrl;
case VK_RMENU: return ImGuiKey_RightAlt;
case VK_RWIN: return ImGuiKey_RightSuper;
case VK_APPS: return ImGuiKey_Menu;
case '0': return ImGuiKey_0;
case '1': return ImGuiKey_1;
case '2': return ImGuiKey_2;
case '3': return ImGuiKey_3;
case '4': return ImGuiKey_4;
case '5': return ImGuiKey_5;
case '6': return ImGuiKey_6;
case '7': return ImGuiKey_7;
case '8': return ImGuiKey_8;
case '9': return ImGuiKey_9;
case 'A': return ImGuiKey_A;
case 'B': return ImGuiKey_B;
case 'C': return ImGuiKey_C;
case 'D': return ImGuiKey_D;
case 'E': return ImGuiKey_E;
case 'F': return ImGuiKey_F;
case 'G': return ImGuiKey_G;
case 'H': return ImGuiKey_H;
case 'I': return ImGuiKey_I;
case 'J': return ImGuiKey_J;
case 'K': return ImGuiKey_K;
case 'L': return ImGuiKey_L;
case 'M': return ImGuiKey_M;
case 'N': return ImGuiKey_N;
case 'O': return ImGuiKey_O;
case 'P': return ImGuiKey_P;
case 'Q': return ImGuiKey_Q;
case 'R': return ImGuiKey_R;
case 'S': return ImGuiKey_S;
case 'T': return ImGuiKey_T;
case 'U': return ImGuiKey_U;
case 'V': return ImGuiKey_V;
case 'W': return ImGuiKey_W;
case 'X': return ImGuiKey_X;
case 'Y': return ImGuiKey_Y;
case 'Z': return ImGuiKey_Z;
case VK_F1: return ImGuiKey_F1;
case VK_F2: return ImGuiKey_F2;
case VK_F3: return ImGuiKey_F3;
case VK_F4: return ImGuiKey_F4;
case VK_F5: return ImGuiKey_F5;
case VK_F6: return ImGuiKey_F6;
case VK_F7: return ImGuiKey_F7;
case VK_F8: return ImGuiKey_F8;
case VK_F9: return ImGuiKey_F9;
case VK_F10: return ImGuiKey_F10;
case VK_F11: return ImGuiKey_F11;
case VK_F12: return ImGuiKey_F12;
case VK_F13: return ImGuiKey_F13;
case VK_F14: return ImGuiKey_F14;
case VK_F15: return ImGuiKey_F15;
case VK_F16: return ImGuiKey_F16;
case VK_F17: return ImGuiKey_F17;
case VK_F18: return ImGuiKey_F18;
case VK_F19: return ImGuiKey_F19;
case VK_F20: return ImGuiKey_F20;
case VK_F21: return ImGuiKey_F21;
case VK_F22: return ImGuiKey_F22;
case VK_F23: return ImGuiKey_F23;
case VK_F24: return ImGuiKey_F24;
case VK_BROWSER_BACK: return ImGuiKey_AppBack;
case VK_BROWSER_FORWARD: return ImGuiKey_AppForward;
default: return ImGuiKey_None;
}
}
// Allow compilation with old Windows SDK. MinGW doesn't have default _WIN32_WINNT/WINVER versions.
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
#ifndef DBT_DEVNODES_CHANGED
#define DBT_DEVNODES_CHANGED 0x0007
#endif
// Helper to obtain the source of mouse messages.
// See https://learn.microsoft.com/en-us/windows/win32/tablet/system-events-and-mouse-messages
// Prefer to call this at the top of the message handler to avoid the possibility of other Win32 calls interfering with this.
static ImGuiMouseSource ImGui_ImplWin32_GetMouseSourceFromMessageExtraInfo()
{
LPARAM extra_info = ::GetMessageExtraInfo();
if ((extra_info & 0xFFFFFF80) == 0xFF515700)
return ImGuiMouseSource_Pen;
if ((extra_info & 0xFFFFFF80) == 0xFF515780)
return ImGuiMouseSource_TouchScreen;
return ImGuiMouseSource_Mouse;
}
// Win32 message handler (process Win32 mouse/keyboard inputs, etc.)
// Call from your application's message handler. Keep calling your message handler unless this function returns TRUE.
// When implementing your own backend, you can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if Dear ImGui wants to use your inputs.
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application, or clear/overwrite your copy of the mouse data.
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or clear/overwrite your copy of the keyboard data.
// Generally you may always pass all inputs to Dear ImGui, and hide them from your application based on those two flags.
// PS: We treat DBLCLK messages as regular mouse down messages, so this code will work on windows classes that have the CS_DBLCLKS flag set. Our own example app code doesn't set this flag.
// Copy either line into your .cpp file to forward declare the function:
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); // Use ImGui::GetCurrentContext()
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandlerEx(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, ImGuiIO& io); // Doesn't use ImGui::GetCurrentContext()
IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Most backends don't have silent checks like this one, but we need it because WndProc are called early in CreateWindow().
// We silently allow both context or just only backend data to be nullptr.
if (ImGui::GetCurrentContext() == nullptr)
return 0;
return ImGui_ImplWin32_WndProcHandlerEx(hwnd, msg, wParam, lParam, ImGui::GetIO());
}
// This version is in theory thread-safe in the sense that no path should access ImGui::GetCurrentContext().
IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandlerEx(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, ImGuiIO& io)
{
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData(io);
if (bd == nullptr)
return 0;
switch (msg)
{
case WM_MOUSEMOVE:
case WM_NCMOUSEMOVE:
{
// We need to call TrackMouseEvent in order to receive WM_MOUSELEAVE events
ImGuiMouseSource mouse_source = ImGui_ImplWin32_GetMouseSourceFromMessageExtraInfo();
const int area = (msg == WM_MOUSEMOVE) ? 1 : 2;
bd->MouseHwnd = hwnd;
if (bd->MouseTrackedArea != area)
{
TRACKMOUSEEVENT tme_cancel = { sizeof(tme_cancel), TME_CANCEL, hwnd, 0 };
TRACKMOUSEEVENT tme_track = { sizeof(tme_track), (DWORD)((area == 2) ? (TME_LEAVE | TME_NONCLIENT) : TME_LEAVE), hwnd, 0 };
if (bd->MouseTrackedArea != 0)
::TrackMouseEvent(&tme_cancel);
::TrackMouseEvent(&tme_track);
bd->MouseTrackedArea = area;
}
POINT mouse_pos = { (LONG)GET_X_LPARAM(lParam), (LONG)GET_Y_LPARAM(lParam) };
if (msg == WM_NCMOUSEMOVE && ::ScreenToClient(hwnd, &mouse_pos) == FALSE) // WM_NCMOUSEMOVE are provided in absolute coordinates.
return 0;
io.AddMouseSourceEvent(mouse_source);
io.AddMousePosEvent((float)mouse_pos.x, (float)mouse_pos.y);
return 0;
}
case WM_MOUSELEAVE:
case WM_NCMOUSELEAVE:
{
const int area = (msg == WM_MOUSELEAVE) ? 1 : 2;
if (bd->MouseTrackedArea == area)
{
if (bd->MouseHwnd == hwnd)
bd->MouseHwnd = nullptr;
bd->MouseTrackedArea = 0;
io.AddMousePosEvent(-FLT_MAX, -FLT_MAX);
}
return 0;
}
case WM_DESTROY:
if (bd->MouseHwnd == hwnd && bd->MouseTrackedArea != 0)
{
TRACKMOUSEEVENT tme_cancel = { sizeof(tme_cancel), TME_CANCEL, hwnd, 0 };
::TrackMouseEvent(&tme_cancel);
bd->MouseHwnd = nullptr;
bd->MouseTrackedArea = 0;
io.AddMousePosEvent(-FLT_MAX, -FLT_MAX);
}
return 0;
case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK:
case WM_RBUTTONDOWN: case WM_RBUTTONDBLCLK:
case WM_MBUTTONDOWN: case WM_MBUTTONDBLCLK:
case WM_XBUTTONDOWN: case WM_XBUTTONDBLCLK:
{
ImGuiMouseSource mouse_source = ImGui_ImplWin32_GetMouseSourceFromMessageExtraInfo();
int button = 0;
if (msg == WM_LBUTTONDOWN || msg == WM_LBUTTONDBLCLK) { button = 0; }
if (msg == WM_RBUTTONDOWN || msg == WM_RBUTTONDBLCLK) { button = 1; }
if (msg == WM_MBUTTONDOWN || msg == WM_MBUTTONDBLCLK) { button = 2; }
if (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONDBLCLK) { button = (GET_XBUTTON_WPARAM(wParam) == XBUTTON1) ? 3 : 4; }
if (bd->MouseButtonsDown == 0 && ::GetCapture() == nullptr)
::SetCapture(hwnd); // Allow us to read mouse coordinates when dragging mouse outside of our window bounds.
bd->MouseButtonsDown |= 1 << button;
io.AddMouseSourceEvent(mouse_source);
io.AddMouseButtonEvent(button, true);
return 0;
}
case WM_LBUTTONUP:
case WM_RBUTTONUP:
case WM_MBUTTONUP:
case WM_XBUTTONUP:
{
ImGuiMouseSource mouse_source = ImGui_ImplWin32_GetMouseSourceFromMessageExtraInfo();
int button = 0;
if (msg == WM_LBUTTONUP) { button = 0; }
if (msg == WM_RBUTTONUP) { button = 1; }
if (msg == WM_MBUTTONUP) { button = 2; }
if (msg == WM_XBUTTONUP) { button = (GET_XBUTTON_WPARAM(wParam) == XBUTTON1) ? 3 : 4; }
bd->MouseButtonsDown &= ~(1 << button);
if (bd->MouseButtonsDown == 0 && ::GetCapture() == hwnd)
::ReleaseCapture();
io.AddMouseSourceEvent(mouse_source);
io.AddMouseButtonEvent(button, false);
return 0;
}
case WM_MOUSEWHEEL:
io.AddMouseWheelEvent(0.0f, (float)GET_WHEEL_DELTA_WPARAM(wParam) / (float)WHEEL_DELTA);
return 0;
case WM_MOUSEHWHEEL:
io.AddMouseWheelEvent(-(float)GET_WHEEL_DELTA_WPARAM(wParam) / (float)WHEEL_DELTA, 0.0f);
return 0;
case WM_KEYDOWN:
case WM_KEYUP:
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
{
const bool is_key_down = (msg == WM_KEYDOWN || msg == WM_SYSKEYDOWN);
if (wParam < 256)
{
// Submit modifiers
ImGui_ImplWin32_UpdateKeyModifiers(io);
// Obtain virtual key code and convert to ImGuiKey
const ImGuiKey key = ImGui_ImplWin32_KeyEventToImGuiKey(wParam, lParam);
const int vk = (int)wParam;
const int scancode = (int)LOBYTE(HIWORD(lParam));
// Special behavior for VK_SNAPSHOT / ImGuiKey_PrintScreen as Windows doesn't emit the key down event.
if (key == ImGuiKey_PrintScreen && !is_key_down)
ImGui_ImplWin32_AddKeyEvent(io, key, true, vk, scancode);
// Submit key event
if (key != ImGuiKey_None)
ImGui_ImplWin32_AddKeyEvent(io, key, is_key_down, vk, scancode);
// Submit individual left/right modifier events
if (vk == VK_SHIFT)
{
// Important: Shift keys tend to get stuck when pressed together, missing key-up events are corrected in ImGui_ImplWin32_ProcessKeyEventsWorkarounds()
if (IsVkDown(VK_LSHIFT) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_LeftShift, is_key_down, VK_LSHIFT, scancode); }
if (IsVkDown(VK_RSHIFT) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_RightShift, is_key_down, VK_RSHIFT, scancode); }
}
else if (vk == VK_CONTROL)
{
if (IsVkDown(VK_LCONTROL) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_LeftCtrl, is_key_down, VK_LCONTROL, scancode); }
if (IsVkDown(VK_RCONTROL) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_RightCtrl, is_key_down, VK_RCONTROL, scancode); }
}
else if (vk == VK_MENU)
{
if (IsVkDown(VK_LMENU) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_LeftAlt, is_key_down, VK_LMENU, scancode); }
if (IsVkDown(VK_RMENU) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(io, ImGuiKey_RightAlt, is_key_down, VK_RMENU, scancode); }
}
}
return 0;
}
case WM_SETFOCUS:
case WM_KILLFOCUS:
io.AddFocusEvent(msg == WM_SETFOCUS);
return 0;
case WM_INPUTLANGCHANGE:
ImGui_ImplWin32_UpdateKeyboardCodePage(io);
return 0;
case WM_CHAR:
if (::IsWindowUnicode(hwnd))
{
// You can also use ToAscii()+GetKeyboardState() to retrieve characters.
if (wParam > 0 && wParam < 0x10000)
io.AddInputCharacterUTF16((unsigned short)wParam);
}
else
{
wchar_t wch = 0;
::MultiByteToWideChar(bd->KeyboardCodePage, MB_PRECOMPOSED, (char*)&wParam, 1, &wch, 1);
io.AddInputCharacter(wch);
}
return 0;
case WM_SETCURSOR:
// This is required to restore cursor when transitioning from e.g resize borders to client area.
if (LOWORD(lParam) == HTCLIENT && ImGui_ImplWin32_UpdateMouseCursor(io, bd->LastMouseCursor))
return 1;
return 0;
case WM_DEVICECHANGE:
#ifndef IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
if ((UINT)wParam == DBT_DEVNODES_CHANGED)
bd->WantUpdateHasGamepad = true;
#endif
return 0;
}
return 0;
}
//--------------------------------------------------------------------------------------------------------
// DPI-related helpers (optional)
//--------------------------------------------------------------------------------------------------------
// - Use to enable DPI awareness without having to create an application manifest.
// - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps.
// - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc.
// but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime,
// neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies.
//---------------------------------------------------------------------------------------------------------
// This is the scheme successfully used by GLFW (from which we borrowed some of the code) and other apps aiming to be highly portable.
// ImGui_ImplWin32_EnableDpiAwareness() is just a helper called by main.cpp, we don't call it automatically.
// If you are trying to implement your own backend for your own engine, you may ignore that noise.
//---------------------------------------------------------------------------------------------------------
// Perform our own check with RtlVerifyVersionInfo() instead of using functions from <VersionHelpers.h> as they
// require a manifest to be functional for checks above 8.1. See https://github.com/ocornut/imgui/issues/4200
static BOOL _IsWindowsVersionOrGreater(WORD major, WORD minor, WORD)
{
typedef LONG(WINAPI* PFN_RtlVerifyVersionInfo)(OSVERSIONINFOEXW*, ULONG, ULONGLONG);
static PFN_RtlVerifyVersionInfo RtlVerifyVersionInfoFn = nullptr;
if (RtlVerifyVersionInfoFn == nullptr)
if (HMODULE ntdllModule = ::GetModuleHandleA("ntdll.dll"))
RtlVerifyVersionInfoFn = (PFN_RtlVerifyVersionInfo)GetProcAddress(ntdllModule, "RtlVerifyVersionInfo");
if (RtlVerifyVersionInfoFn == nullptr)
return FALSE;
RTL_OSVERSIONINFOEXW versionInfo = { };
ULONGLONG conditionMask = 0;
versionInfo.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOEXW);
versionInfo.dwMajorVersion = major;
versionInfo.dwMinorVersion = minor;
VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
return (RtlVerifyVersionInfoFn(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask) == 0) ? TRUE : FALSE;
}
#define _IsWindowsVistaOrGreater() _IsWindowsVersionOrGreater(HIBYTE(0x0600), LOBYTE(0x0600), 0) // _WIN32_WINNT_VISTA
#define _IsWindows8OrGreater() _IsWindowsVersionOrGreater(HIBYTE(0x0602), LOBYTE(0x0602), 0) // _WIN32_WINNT_WIN8
#define _IsWindows8Point1OrGreater() _IsWindowsVersionOrGreater(HIBYTE(0x0603), LOBYTE(0x0603), 0) // _WIN32_WINNT_WINBLUE
#define _IsWindows10OrGreater() _IsWindowsVersionOrGreater(HIBYTE(0x0A00), LOBYTE(0x0A00), 0) // _WIN32_WINNT_WINTHRESHOLD / _WIN32_WINNT_WIN10
#ifndef DPI_ENUMS_DECLARED
typedef enum { PROCESS_DPI_UNAWARE = 0, PROCESS_SYSTEM_DPI_AWARE = 1, PROCESS_PER_MONITOR_DPI_AWARE = 2 } PROCESS_DPI_AWARENESS;
typedef enum { MDT_EFFECTIVE_DPI = 0, MDT_ANGULAR_DPI = 1, MDT_RAW_DPI = 2, MDT_DEFAULT = MDT_EFFECTIVE_DPI } MONITOR_DPI_TYPE;
#endif
#ifndef _DPI_AWARENESS_CONTEXTS_
DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE (DPI_AWARENESS_CONTEXT)-3
#endif
#ifndef DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 (DPI_AWARENESS_CONTEXT)-4
#endif
typedef HRESULT(WINAPI* PFN_SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS); // Shcore.lib + dll, Windows 8.1+
typedef HRESULT(WINAPI* PFN_GetDpiForMonitor)(HMONITOR, MONITOR_DPI_TYPE, UINT*, UINT*); // Shcore.lib + dll, Windows 8.1+
typedef DPI_AWARENESS_CONTEXT(WINAPI* PFN_SetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); // User32.lib + dll, Windows 10 v1607+ (Creators Update)
// Helper function to enable DPI awareness without setting up a manifest
void ImGui_ImplWin32_EnableDpiAwareness()
{
if (_IsWindows10OrGreater())
{
static HINSTANCE user32_dll = ::LoadLibraryA("user32.dll"); // Reference counted per-process
if (PFN_SetThreadDpiAwarenessContext SetThreadDpiAwarenessContextFn = (PFN_SetThreadDpiAwarenessContext)::GetProcAddress(user32_dll, "SetThreadDpiAwarenessContext"))
{
SetThreadDpiAwarenessContextFn(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
return;
}
}
if (_IsWindows8Point1OrGreater())
{
static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll"); // Reference counted per-process
if (PFN_SetProcessDpiAwareness SetProcessDpiAwarenessFn = (PFN_SetProcessDpiAwareness)::GetProcAddress(shcore_dll, "SetProcessDpiAwareness"))
{
SetProcessDpiAwarenessFn(PROCESS_PER_MONITOR_DPI_AWARE);
return;
}
}
#if _WIN32_WINNT >= 0x0600
::SetProcessDPIAware();
#endif
}
#if defined(_MSC_VER) && !defined(NOGDI)
#pragma comment(lib, "gdi32") // Link with gdi32.lib for GetDeviceCaps(). MinGW will require linking with '-lgdi32'
#endif
float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
{
UINT xdpi = 96, ydpi = 96;
if (_IsWindows8Point1OrGreater())
{
static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll"); // Reference counted per-process
static PFN_GetDpiForMonitor GetDpiForMonitorFn = nullptr;
if (GetDpiForMonitorFn == nullptr && shcore_dll != nullptr)
GetDpiForMonitorFn = (PFN_GetDpiForMonitor)::GetProcAddress(shcore_dll, "GetDpiForMonitor");
if (GetDpiForMonitorFn != nullptr)
{
GetDpiForMonitorFn((HMONITOR)monitor, MDT_EFFECTIVE_DPI, &xdpi, &ydpi);
IM_ASSERT(xdpi == ydpi); // Please contact me if you hit this assert!
return xdpi / 96.0f;
}
}
#ifndef NOGDI
const HDC dc = ::GetDC(nullptr);
xdpi = ::GetDeviceCaps(dc, LOGPIXELSX);
ydpi = ::GetDeviceCaps(dc, LOGPIXELSY);
IM_ASSERT(xdpi == ydpi); // Please contact me if you hit this assert!
::ReleaseDC(nullptr, dc);
#endif
return xdpi / 96.0f;
}
float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd)
{
HMONITOR monitor = ::MonitorFromWindow((HWND)hwnd, MONITOR_DEFAULTTONEAREST);
return ImGui_ImplWin32_GetDpiScaleForMonitor(monitor);
}
//---------------------------------------------------------------------------------------------------------
// Transparency related helpers (optional)
//--------------------------------------------------------------------------------------------------------
#if defined(_MSC_VER)
#pragma comment(lib, "dwmapi") // Link with dwmapi.lib. MinGW will require linking with '-ldwmapi'
#endif
// [experimental]
// Borrowed from GLFW's function updateFramebufferTransparency() in src/win32_window.c
// (the Dwm* functions are Vista era functions but we are borrowing logic from GLFW)
void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd)
{
if (!_IsWindowsVistaOrGreater())
return;
BOOL composition;
if (FAILED(::DwmIsCompositionEnabled(&composition)) || !composition)
return;
BOOL opaque;
DWORD color;
if (_IsWindows8OrGreater() || (SUCCEEDED(::DwmGetColorizationColor(&color, &opaque)) && !opaque))
{
HRGN region = ::CreateRectRgn(0, 0, -1, -1);
DWM_BLURBEHIND bb = {};
bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION;
bb.hRgnBlur = region;
bb.fEnable = TRUE;
::DwmEnableBlurBehindWindow((HWND)hwnd, &bb);
::DeleteObject(region);
}
else
{
DWM_BLURBEHIND bb = {};
bb.dwFlags = DWM_BB_ENABLE;
::DwmEnableBlurBehindWindow((HWND)hwnd, &bb);
}
}
//---------------------------------------------------------------------------------------------------------
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif // #ifndef IMGUI_DISABLE

View File

@@ -1,53 +0,0 @@
// dear imgui: Platform Backend for Windows (standard windows API for 32-bits AND 64-bits applications)
// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..)
// Implemented features:
// [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui)
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen.
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy VK_* values are obsolete since 1.87 and not supported since 1.91.5]
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// Learn about Dear ImGui:
// - FAQ https://dearimgui.com/faq
// - Getting Started https://dearimgui.com/getting-started
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
// - Introduction, links and more at the top of imgui.cpp
#pragma once
#include "imgui.h" // IMGUI_IMPL_API
#ifndef IMGUI_DISABLE
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd);
IMGUI_IMPL_API bool ImGui_ImplWin32_InitForOpenGL(void* hwnd);
IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown();
IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame();
// Win32 message handler your application need to call.
// - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on <windows.h> from this helper.
// - You should COPY the line below into your .cpp code to forward declare the function and then you can call it.
// - Call from your application's message handler. Keep calling your message handler unless this function returns TRUE.
#if 0
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
#endif
// DPI-related helpers (optional)
// - Use to enable DPI awareness without having to create an application manifest.
// - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps.
// - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc.
// but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime,
// neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies.
IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness();
IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd
IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor
// Transparency related helpers (optional) [experimental]
// - Use to enable alpha compositing transparency with the desktop.
// - Use together with e.g. clearing your framebuffer with zero-alpha.
IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd
#endif // #ifndef IMGUI_DISABLE

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,627 +0,0 @@
// [DEAR IMGUI]
// This is a slightly modified version of stb_rect_pack.h 1.01.
// Grep for [DEAR IMGUI] to find the changes.
//
// stb_rect_pack.h - v1.01 - public domain - rectangle packing
// Sean Barrett 2014
//
// Useful for e.g. packing rectangular textures into an atlas.
// Does not do rotation.
//
// Before #including,
//
// #define STB_RECT_PACK_IMPLEMENTATION
//
// in the file that you want to have the implementation.
//
// Not necessarily the awesomest packing method, but better than
// the totally naive one in stb_truetype (which is primarily what
// this is meant to replace).
//
// Has only had a few tests run, may have issues.
//
// More docs to come.
//
// No memory allocations; uses qsort() and assert() from stdlib.
// Can override those by defining STBRP_SORT and STBRP_ASSERT.
//
// This library currently uses the Skyline Bottom-Left algorithm.
//
// Please note: better rectangle packers are welcome! Please
// implement them to the same API, but with a different init
// function.
//
// Credits
//
// Library
// Sean Barrett
// Minor features
// Martins Mozeiko
// github:IntellectualKitty
//
// Bugfixes / warning fixes
// Jeremy Jaussaud
// Fabian Giesen
//
// Version history:
//
// 1.01 (2021-07-11) always use large rect mode, expose STBRP__MAXVAL in public section
// 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles
// 0.99 (2019-02-07) warning fixes
// 0.11 (2017-03-03) return packing success/fail result
// 0.10 (2016-10-25) remove cast-away-const to avoid warnings
// 0.09 (2016-08-27) fix compiler warnings
// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0)
// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0)
// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort
// 0.05: added STBRP_ASSERT to allow replacing assert
// 0.04: fixed minor bug in STBRP_LARGE_RECTS support
// 0.01: initial release
//
// LICENSE
//
// See end of file for license information.
//////////////////////////////////////////////////////////////////////////////
//
// INCLUDE SECTION
//
#ifndef STB_INCLUDE_STB_RECT_PACK_H
#define STB_INCLUDE_STB_RECT_PACK_H
#define STB_RECT_PACK_VERSION 1
#ifdef STBRP_STATIC
#define STBRP_DEF static
#else
#define STBRP_DEF extern
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct stbrp_context stbrp_context;
typedef struct stbrp_node stbrp_node;
typedef struct stbrp_rect stbrp_rect;
typedef int stbrp_coord;
#define STBRP__MAXVAL 0x7fffffff
// Mostly for internal use, but this is the maximum supported coordinate value.
STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
// Assign packed locations to rectangles. The rectangles are of type
// 'stbrp_rect' defined below, stored in the array 'rects', and there
// are 'num_rects' many of them.
//
// Rectangles which are successfully packed have the 'was_packed' flag
// set to a non-zero value and 'x' and 'y' store the minimum location
// on each axis (i.e. bottom-left in cartesian coordinates, top-left
// if you imagine y increasing downwards). Rectangles which do not fit
// have the 'was_packed' flag set to 0.
//
// You should not try to access the 'rects' array from another thread
// while this function is running, as the function temporarily reorders
// the array while it executes.
//
// To pack into another rectangle, you need to call stbrp_init_target
// again. To continue packing into the same rectangle, you can call
// this function again. Calling this multiple times with multiple rect
// arrays will probably produce worse packing results than calling it
// a single time with the full rectangle array, but the option is
// available.
//
// The function returns 1 if all of the rectangles were successfully
// packed and 0 otherwise.
struct stbrp_rect
{
// reserved for your use:
int id;
// input:
stbrp_coord w, h;
// output:
stbrp_coord x, y;
int was_packed; // non-zero if valid packing
}; // 16 bytes, nominally
STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
// Initialize a rectangle packer to:
// pack a rectangle that is 'width' by 'height' in dimensions
// using temporary storage provided by the array 'nodes', which is 'num_nodes' long
//
// You must call this function every time you start packing into a new target.
//
// There is no "shutdown" function. The 'nodes' memory must stay valid for
// the following stbrp_pack_rects() call (or calls), but can be freed after
// the call (or calls) finish.
//
// Note: to guarantee best results, either:
// 1. make sure 'num_nodes' >= 'width'
// or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1'
//
// If you don't do either of the above things, widths will be quantized to multiples
// of small integers to guarantee the algorithm doesn't run out of temporary storage.
//
// If you do #2, then the non-quantized algorithm will be used, but the algorithm
// may run out of temporary storage and be unable to pack some rectangles.
STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
// Optionally call this function after init but before doing any packing to
// change the handling of the out-of-temp-memory scenario, described above.
// If you call init again, this will be reset to the default (false).
STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
// Optionally select which packing heuristic the library should use. Different
// heuristics will produce better/worse results for different data sets.
// If you call init again, this will be reset to the default.
enum
{
STBRP_HEURISTIC_Skyline_default=0,
STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
STBRP_HEURISTIC_Skyline_BF_sortHeight
};
//////////////////////////////////////////////////////////////////////////////
//
// the details of the following structures don't matter to you, but they must
// be visible so you can handle the memory allocations for them
struct stbrp_node
{
stbrp_coord x,y;
stbrp_node *next;
};
struct stbrp_context
{
int width;
int height;
int align;
int init_mode;
int heuristic;
int num_nodes;
stbrp_node *active_head;
stbrp_node *free_head;
stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2'
};
#ifdef __cplusplus
}
#endif
#endif
//////////////////////////////////////////////////////////////////////////////
//
// IMPLEMENTATION SECTION
//
#ifdef STB_RECT_PACK_IMPLEMENTATION
#ifndef STBRP_SORT
#include <stdlib.h>
#define STBRP_SORT qsort
#endif
#ifndef STBRP_ASSERT
#include <assert.h>
#define STBRP_ASSERT assert
#endif
#ifdef _MSC_VER
#define STBRP__NOTUSED(v) (void)(v)
#define STBRP__CDECL __cdecl
#else
#define STBRP__NOTUSED(v) (void)sizeof(v)
#define STBRP__CDECL
#endif
enum
{
STBRP__INIT_skyline = 1
};
STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
{
switch (context->init_mode) {
case STBRP__INIT_skyline:
STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight);
context->heuristic = heuristic;
break;
default:
STBRP_ASSERT(0);
}
}
STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
{
if (allow_out_of_mem)
// if it's ok to run out of memory, then don't bother aligning them;
// this gives better packing, but may fail due to OOM (even though
// the rectangles easily fit). @TODO a smarter approach would be to only
// quantize once we've hit OOM, then we could get rid of this parameter.
context->align = 1;
else {
// if it's not ok to run out of memory, then quantize the widths
// so that num_nodes is always enough nodes.
//
// I.e. num_nodes * align >= width
// align >= width / num_nodes
// align = ceil(width/num_nodes)
context->align = (context->width + context->num_nodes-1) / context->num_nodes;
}
}
STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
{
int i;
for (i=0; i < num_nodes-1; ++i)
nodes[i].next = &nodes[i+1];
nodes[i].next = NULL;
context->init_mode = STBRP__INIT_skyline;
context->heuristic = STBRP_HEURISTIC_Skyline_default;
context->free_head = &nodes[0];
context->active_head = &context->extra[0];
context->width = width;
context->height = height;
context->num_nodes = num_nodes;
stbrp_setup_allow_out_of_mem(context, 0);
// node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly)
context->extra[0].x = 0;
context->extra[0].y = 0;
context->extra[0].next = &context->extra[1];
context->extra[1].x = (stbrp_coord) width;
context->extra[1].y = (1<<30);
context->extra[1].next = NULL;
}
// find minimum y position if it starts at x1
static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
{
stbrp_node *node = first;
int x1 = x0 + width;
int min_y, visited_width, waste_area;
STBRP__NOTUSED(c);
STBRP_ASSERT(first->x <= x0);
#if 0
// skip in case we're past the node
while (node->next->x <= x0)
++node;
#else
STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency
#endif
STBRP_ASSERT(node->x <= x0);
min_y = 0;
waste_area = 0;
visited_width = 0;
while (node->x < x1) {
if (node->y > min_y) {
// raise min_y higher.
// we've accounted for all waste up to min_y,
// but we'll now add more waste for everything we've visted
waste_area += visited_width * (node->y - min_y);
min_y = node->y;
// the first time through, visited_width might be reduced
if (node->x < x0)
visited_width += node->next->x - x0;
else
visited_width += node->next->x - node->x;
} else {
// add waste area
int under_width = node->next->x - node->x;
if (under_width + visited_width > width)
under_width = width - visited_width;
waste_area += under_width * (min_y - node->y);
visited_width += under_width;
}
node = node->next;
}
*pwaste = waste_area;
return min_y;
}
typedef struct
{
int x,y;
stbrp_node **prev_link;
} stbrp__findresult;
static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
{
int best_waste = (1<<30), best_x, best_y = (1 << 30);
stbrp__findresult fr;
stbrp_node **prev, *node, *tail, **best = NULL;
// align to multiple of c->align
width = (width + c->align - 1);
width -= width % c->align;
STBRP_ASSERT(width % c->align == 0);
// if it can't possibly fit, bail immediately
if (width > c->width || height > c->height) {
fr.prev_link = NULL;
fr.x = fr.y = 0;
return fr;
}
node = c->active_head;
prev = &c->active_head;
while (node->x + width <= c->width) {
int y,waste;
y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL
// bottom left
if (y < best_y) {
best_y = y;
best = prev;
}
} else {
// best-fit
if (y + height <= c->height) {
// can only use it if it first vertically
if (y < best_y || (y == best_y && waste < best_waste)) {
best_y = y;
best_waste = waste;
best = prev;
}
}
}
prev = &node->next;
node = node->next;
}
best_x = (best == NULL) ? 0 : (*best)->x;
// if doing best-fit (BF), we also have to try aligning right edge to each node position
//
// e.g, if fitting
//
// ____________________
// |____________________|
//
// into
//
// | |
// | ____________|
// |____________|
//
// then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned
//
// This makes BF take about 2x the time
if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) {
tail = c->active_head;
node = c->active_head;
prev = &c->active_head;
// find first node that's admissible
while (tail->x < width)
tail = tail->next;
while (tail) {
int xpos = tail->x - width;
int y,waste;
STBRP_ASSERT(xpos >= 0);
// find the left position that matches this
while (node->next->x <= xpos) {
prev = &node->next;
node = node->next;
}
STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
if (y + height <= c->height) {
if (y <= best_y) {
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
best_x = xpos;
//STBRP_ASSERT(y <= best_y); [DEAR IMGUI]
best_y = y;
best_waste = waste;
best = prev;
}
}
}
tail = tail->next;
}
}
fr.prev_link = best;
fr.x = best_x;
fr.y = best_y;
return fr;
}
static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
{
// find best position according to heuristic
stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
stbrp_node *node, *cur;
// bail if:
// 1. it failed
// 2. the best node doesn't fit (we don't always check this)
// 3. we're out of memory
if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
res.prev_link = NULL;
return res;
}
// on success, create new node
node = context->free_head;
node->x = (stbrp_coord) res.x;
node->y = (stbrp_coord) (res.y + height);
context->free_head = node->next;
// insert the new node into the right starting point, and
// let 'cur' point to the remaining nodes needing to be
// stiched back in
cur = *res.prev_link;
if (cur->x < res.x) {
// preserve the existing one, so start testing with the next one
stbrp_node *next = cur->next;
cur->next = node;
cur = next;
} else {
*res.prev_link = node;
}
// from here, traverse cur and free the nodes, until we get to one
// that shouldn't be freed
while (cur->next && cur->next->x <= res.x + width) {
stbrp_node *next = cur->next;
// move the current node to the free list
cur->next = context->free_head;
context->free_head = cur;
cur = next;
}
// stitch the list back in
node->next = cur;
if (cur->x < res.x + width)
cur->x = (stbrp_coord) (res.x + width);
#ifdef _DEBUG
cur = context->active_head;
while (cur->x < context->width) {
STBRP_ASSERT(cur->x < cur->next->x);
cur = cur->next;
}
STBRP_ASSERT(cur->next == NULL);
{
int count=0;
cur = context->active_head;
while (cur) {
cur = cur->next;
++count;
}
cur = context->free_head;
while (cur) {
cur = cur->next;
++count;
}
STBRP_ASSERT(count == context->num_nodes+2);
}
#endif
return res;
}
static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
if (p->h > q->h)
return -1;
if (p->h < q->h)
return 1;
return (p->w > q->w) ? -1 : (p->w < q->w);
}
static int STBRP__CDECL rect_original_order(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
}
STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
{
int i, all_rects_packed = 1;
// we use the 'was_packed' field internally to allow sorting/unsorting
for (i=0; i < num_rects; ++i) {
rects[i].was_packed = i;
}
// sort according to heuristic
STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare);
for (i=0; i < num_rects; ++i) {
if (rects[i].w == 0 || rects[i].h == 0) {
rects[i].x = rects[i].y = 0; // empty rect needs no space
} else {
stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
if (fr.prev_link) {
rects[i].x = (stbrp_coord) fr.x;
rects[i].y = (stbrp_coord) fr.y;
} else {
rects[i].x = rects[i].y = STBRP__MAXVAL;
}
}
}
// unsort
STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order);
// set was_packed flags and all_rects_packed status
for (i=0; i < num_rects; ++i) {
rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
if (!rects[i].was_packed)
all_rects_packed = 0;
}
// return the all_rects_packed status
return all_rects_packed;
}
#endif
/*
------------------------------------------------------------------------------
This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Sean Barrett
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +0,0 @@
libs += nv
src_nv := \
module.c \

View File

@@ -1,63 +0,0 @@
#ifndef NVGPU_CONFIG_NVAPI_H
#define NVGPU_CONFIG_NVAPI_H
#include <stdint.h>
// Remark: nvapi is not compatible with mingw and requires some changes, see
// https://forums.developer.nvidia.com/t/how-can-you-compile-nvapi-h-with-mingw/33050/5
#include "imports/nvapi/nvapi.h"
#include "imports/nvapi/NvApiDriverSettings.h"
typedef NvAPI_Status (*NvAPI_Initialize_t)();
typedef NvAPI_Status (*NvAPI_Unload_t)();
typedef NvAPI_Status (*NvAPI_GetInterfaceVersionStringEx_t)(NvAPI_ShortString);
typedef NvAPI_Status (*NvAPI_SYS_GetDriverAndBranchVersion_t)(NvU32 *, NvAPI_ShortString);
typedef NvAPI_Status (*NvAPI_GetErrorMessage_t)(NvAPI_Status, NvAPI_ShortString);
typedef NvAPI_Status (*NvAPI_DRS_CreateSession_t)(NvDRSSessionHandle *);
typedef NvAPI_Status (*NvAPI_DRS_LoadSettings_t)(NvDRSSessionHandle);
typedef NvAPI_Status (*NvAPI_DRS_FindProfileByName_t)(NvDRSSessionHandle, NvAPI_UnicodeString, NvDRSProfileHandle *);
typedef NvAPI_Status (*NvAPI_DRS_FindApplicationByName_t)(NvDRSSessionHandle, NvAPI_UnicodeString, NvDRSProfileHandle *, NVDRS_APPLICATION *);
typedef NvAPI_Status (*NvAPI_DRS_CreateProfile_t)(NvDRSSessionHandle, NVDRS_PROFILE *, NvDRSProfileHandle *);
typedef NvAPI_Status (*NvAPI_DRS_CreateApplication_t)(NvDRSSessionHandle, NvDRSProfileHandle, NVDRS_APPLICATION *);
typedef NvAPI_Status (*NvAPI_DRS_GetSetting_t)(NvDRSSessionHandle, NvDRSProfileHandle, NvU32, NVDRS_SETTING *);
typedef NvAPI_Status (*NvAPI_DRS_SetSetting_t)(NvDRSSessionHandle, NvDRSProfileHandle, NVDRS_SETTING *);
typedef NvAPI_Status (*NvAPI_DRS_SaveSettings_t)(NvDRSSessionHandle);
typedef NvAPI_Status (*NvAPI_DRS_DestroySession_t)(NvDRSSessionHandle);
typedef NvAPI_Status (*NvAPI_EnumPhysicalGPUs_t)(NvPhysicalGpuHandle *, NvU32 *);
typedef NvAPI_Status (*NvAPI_GPU_GetConnectedDisplayIds_t)(NvPhysicalGpuHandle, NV_GPU_DISPLAYIDS*, NvU32 *, NvU32);
typedef NvAPI_Status (*NvAPI_DISP_GetTiming_t)(NvU32, NV_TIMING_INPUT*, NV_TIMING*);
typedef NvAPI_Status (*NvAPI_DISP_TryCustomDisplay_t)(NvU32 *, NvU32, NV_CUSTOM_DISPLAY *);
typedef NvAPI_Status (*NvAPI_DISP_SaveCustomDisplay_t)(NvU32*, NvU32, NvU32, NvU32);
typedef NvAPI_Status (*NvAPI_DISP_RevertCustomDisplayTrial_t)(NvU32*, NvU32);
typedef NvAPI_Status (*NvAPI_DRS_DeleteProfile_t)(NvDRSSessionHandle, NvDRSProfileHandle);
typedef NvAPI_Status (*NvAPI_DISP_GetDisplayConfig_t)(NvU32*, NV_DISPLAYCONFIG_PATH_INFO*);
typedef NvAPI_Status (*NvAPI_DISP_SetDisplayConfig_t)(NvU32, NV_DISPLAYCONFIG_PATH_INFO*, NvU32);
typedef struct nv_api {
NvAPI_Initialize_t NvAPI_Initialize;
NvAPI_Unload_t NvAPI_Unload;
NvAPI_GetInterfaceVersionStringEx_t NvAPI_GetInterfaceVersionStringEx;
NvAPI_SYS_GetDriverAndBranchVersion_t NvAPI_SYS_GetDriverAndBranchVersion;
NvAPI_GetErrorMessage_t NvAPI_GetErrorMessage;
NvAPI_DRS_CreateSession_t NvAPI_DRS_CreateSession;
NvAPI_DRS_LoadSettings_t NvAPI_DRS_LoadSettings;
NvAPI_DRS_FindProfileByName_t NvAPI_DRS_FindProfileByName;
NvAPI_DRS_FindApplicationByName_t NvAPI_DRS_FindApplicationByName;
NvAPI_DRS_CreateProfile_t NvAPI_DRS_CreateProfile;
NvAPI_DRS_CreateApplication_t NvAPI_DRS_CreateApplication;
NvAPI_DRS_GetSetting_t NvAPI_DRS_GetSetting;
NvAPI_DRS_SetSetting_t NvAPI_DRS_SetSetting;
NvAPI_DRS_SaveSettings_t NvAPI_DRS_SaveSettings;
NvAPI_DRS_DestroySession_t NvAPI_DRS_DestroySession;
NvAPI_EnumPhysicalGPUs_t NvAPI_EnumPhysicalGPUs;
NvAPI_GPU_GetConnectedDisplayIds_t NvAPI_GPU_GetConnectedDisplayIds;
NvAPI_DISP_GetTiming_t NvAPI_DISP_GetTiming;
NvAPI_DISP_TryCustomDisplay_t NvAPI_DISP_TryCustomDisplay;
NvAPI_DISP_SaveCustomDisplay_t NvAPI_DISP_SaveCustomDisplay;
NvAPI_DISP_RevertCustomDisplayTrial_t NvAPI_DISP_RevertCustomDisplayTrial;
NvAPI_DRS_DeleteProfile_t NvAPI_DRS_DeleteProfile;
NvAPI_DISP_GetDisplayConfig_t NvAPI_DISP_GetDisplayConfig;
NvAPI_DISP_SetDisplayConfig_t NvAPI_DISP_SetDisplayConfig;
} nv_api_t;
#endif

View File

@@ -1,790 +0,0 @@
#define LOG_MODULE "nv-module"
#include <windows.h>
#include "nv/module.h"
#include "util/log.h"
#include "util/mem.h"
#include "util/winerr.h"
#if defined(_WIN64)
#define NV_MODULE_PATH "nvapi64.dll"
#else
#define NV_MODULE_PATH "nvapi.dll"
#endif
// Source: https://github.com/falahati/NvAPIWrapper/blob/master/NvAPIWrapper/Native/Helpers/FunctionId.cs
// Last update on source: 2019-07-15
// // -------------------------------------------------
// // Public NvAPI Functions
// // -------------------------------------------------
// NvAPI_CreateDisplayFromUnAttachedDisplay = 0x63F9799E,
// NvAPI_D3D_BeginResourceRendering = 0x91123D6A,
// NvAPI_D3D_ConfigureAnsel = 0x341C6C7F,
// NvAPI_D3D_CreateLateLatchObject = 0x2DB27D09,
// NvAPI_D3D_EndResourceRendering = 0x37E7191C,
// NvAPI_D3D_GetCurrentSLIState = 0x4B708B54,
// NvAPI_D3D_GetObjectHandleForResource = 0xFCEAC864,
// NvAPI_D3D_ImplicitSLIControl = 0x2AEDE111,
// NvAPI_D3D_InitializeSMPAssist = 0x42763D0C,
// NvAPI_D3D_IsGSyncActive = 0xE942B0FF,
// NvAPI_D3D_IsGSyncCapable = 0x9C1EED78,
// NvAPI_D3D_QueryLateLatchSupport = 0x8CECA0EC,
// NvAPI_D3D_QueryModifiedWSupport = 0xCBF9F4F5,
// NvAPI_D3D_QueryMultiViewSupport = 0xB6E0A41C,
// NvAPI_D3D_QuerySinglePassStereoSupport = 0x6F5F0A6D,
// NvAPI_D3D_QuerySMPAssistSupport = 0xC57921DE,
// NvAPI_D3D_RegisterDevice = 0x8C02C4D0,
// NvAPI_D3D_SetFPSIndicatorState = 0xA776E8DB,
// NvAPI_D3D_SetModifiedWMode = 0x6EA4BF4,
// NvAPI_D3D_SetMultiViewMode = 0x8285C8DA,
// NvAPI_D3D_SetResourceHint = 0x6C0ED98C,
// NvAPI_D3D_SetSinglePassStereoMode = 0xA39E6E6E,
// NvAPI_D3D10_SetDepthBoundsTest = 0x4EADF5D2,
// NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA = 0xF1C54FC9,
// NvAPI_D3D11_BeginUAVOverlap = 0x65B93CA8,
// NvAPI_D3D11_BeginUAVOverlapEx = 0xBA08208A,
// NvAPI_D3D11_CopyTileMappings = 0xC09EE6BC,
// NvAPI_D3D11_CreateDevice = 0x6A16D3A0,
// NvAPI_D3D11_CreateDeviceAndSwapChain = 0xBB939EE5,
// NvAPI_D3D11_CreateDomainShaderEx = 0xA0D7180D,
// NvAPI_D3D11_CreateFastGeometryShader = 0x525D43BE,
// NvAPI_D3D11_CreateFastGeometryShaderExplicit = 0x71AB7C9C,
// NvAPI_D3D11_CreateGeometryShaderEx_2 = 0x99ED5C1C,
// NvAPI_D3D11_CreateHullShaderEx = 0xB53CAB00,
// NvAPI_D3D11_CreateMultiGPUDevice = 0xBDB20007,
// NvAPI_D3D11_CreatePixelShaderEx_2 = 0x4162822B,
// NvAPI_D3D11_CreateRasterizerState = 0xDB8D28AF,
// NvAPI_D3D11_CreateShadingRateResourceView = 0x99CA2DFF,
// NvAPI_D3D11_CreateTiledTexture2DArray = 0x7886981A,
// NvAPI_D3D11_CreateVertexShaderEx = 0xBEAA0B2,
// NvAPI_D3D11_EndUAVOverlap = 0x2216A357,
// NvAPI_D3D11_IsNvShaderExtnOpCodeSupported = 0x5F68DA40,
// NvAPI_D3D11_MultiDrawIndexedInstancedIndirect = 0x59E890F9,
// NvAPI_D3D11_MultiDrawInstancedIndirect = 0xD4E26BBF,
// NvAPI_D3D11_MultiGPU_GetCaps = 0xD2D25687,
// NvAPI_D3D11_MultiGPU_Init = 0x17BE49E,
// NvAPI_D3D11_RSGetPixelShadingRateSampleOrder = 0x92442A1,
// NvAPI_D3D11_RSSetExclusiveScissorRects = 0xAE4D73EF,
// NvAPI_D3D11_RSSetPixelShadingRateSampleOrder = 0xA942373A,
// NvAPI_D3D11_RSSetShadingRateResourceView = 0x1B0C2F83,
// NvAPI_D3D11_RSSetViewportsPixelShadingRates = 0x34F7938F,
// NvAPI_D3D11_SetDepthBoundsTest = 0x7AAF7A04,
// NvAPI_D3D11_SetNvShaderExtnSlot = 0x8E90BB9F,
// NvAPI_D3D11_SetNvShaderExtnSlotLocalThread = 0xE6482A0,
// NvAPI_D3D11_TiledResourceBarrier = 0xD6839099,
// NvAPI_D3D11_TiledTexture2DArrayGetDesc = 0xF1A2B9D5,
// NvAPI_D3D11_UpdateTileMappings = 0x9A06EA07,
// NvAPI_D3D12_CopyTileMappings = 0x47F78194,
// NvAPI_D3D12_CreateComputePipelineState = 0x2762DEAC,
// NvAPI_D3D12_CreateGraphicsPipelineState = 0x2FC28856,
// NvAPI_D3D12_CreateHeap = 0x5CB397CF,
// NvAPI_D3D12_CreateReservedResource = 0x2C85F101,
// NvAPI_D3D12_IsNvShaderExtnOpCodeSupported = 0x3DFACEC8,
// NvAPI_D3D12_Mosaic_GetCompanionAllocations = 0xA46022C7,
// NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions = 0xB092B818,
// NvAPI_D3D12_QueryModifiedWSupport = 0x51235248,
// NvAPI_D3D12_QuerySinglePassStereoSupport = 0x3B03791B,
// NvAPI_D3D12_ReservedResourceGetDesc = 0x9AA2AABB,
// NvAPI_D3D12_ResourceAliasingBarrier = 0xB942BAB7,
// NvAPI_D3D12_SetDepthBoundsTestValues = 0xB9333FE9,
// NvAPI_D3D12_SetModifiedWMode = 0xE1FDABA7,
// NvAPI_D3D12_SetSinglePassStereoMode = 0x83556D87,
// NvAPI_D3D12_UpdateTileMappings = 0xC6017A7D,
// NvAPI_D3D12_UseDriverHeapPriorities = 0xF0D978A8,
// NvAPI_D3D1x_CreateSwapChain = 0x1BC21B66,
// NvAPI_D3D1x_DisableShaderDiskCache = 0xD0CBCA7D,
// NvAPI_D3D1x_GetGraphicsCapabilities = 0x52B1499A,
// NvAPI_D3D9_AliasSurfaceAsTexture = 0xE5CEAE41,
// NvAPI_D3D9_ClearRT = 0x332D3942,
// NvAPI_D3D9_CreateSwapChain = 0x1A131E09,
// NvAPI_D3D9_GetSurfaceHandle = 0xF2DD3F2,
// NvAPI_D3D9_RegisterResource = 0xA064BDFC,
// NvAPI_D3D9_StretchRectEx = 0x22DE03AA,
// NvAPI_D3D9_UnregisterResource = 0xBB2B17AA,
// NvAPI_D3D9_VideoSetStereoInfo = 0xB852F4DB,
// NvAPI_DisableHWCursor = 0xAB163097,
// NvAPI_Disp_ColorControl = 0x92F9D80D,
// NvAPI_DISP_DeleteCustomDisplay = 0x552E5B9B,
// NvAPI_DISP_EnumCustomDisplay = 0xA2072D59,
// NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle = 0xA70503B2,
// NvAPI_DISP_GetDisplayConfig = 0x11ABCCF8,
// NvAPI_DISP_GetDisplayIdByDisplayName = 0xAE457190,
// NvAPI_DISP_GetGDIPrimaryDisplayId = 0x1E9D8A31,
// NvAPI_Disp_GetHdrCapabilities = 0x84F2A8DF,
// NvAPI_DISP_GetMonitorCapabilities = 0x3B05C7E1,
// NvAPI_DISP_GetMonitorColorCapabilities = 0x6AE4CFB5,
// NvAPI_DISP_GetTiming = 0x175167E9,
// NvAPI_Disp_HdrColorControl = 0x351DA224,
// NvAPI_Disp_InfoFrameControl = 0x6067AF3F,
// NvAPI_DISP_RevertCustomDisplayTrial = 0xCBBD40F0,
// NvAPI_DISP_SaveCustomDisplay = 0x49882876,
// NvAPI_DISP_SetDisplayConfig = 0x5D8CF8DE,
// NvAPI_DISP_TryCustomDisplay = 0x1F7DB630,
// NvAPI_DRS_CreateApplication = 0x4347A9DE,
// NvAPI_DRS_CreateProfile = 0xCC176068,
// NvAPI_DRS_CreateSession = 0x694D52E,
// NvAPI_DRS_DeleteApplication = 0x2C694BC6,
// NvAPI_DRS_DeleteApplicationEx = 0xC5EA85A1,
// NvAPI_DRS_DeleteProfile = 0x17093206,
// NvAPI_DRS_DeleteProfileSetting = 0xE4A26362,
// NvAPI_DRS_DestroySession = 0xDAD9CFF8,
// NvAPI_DRS_EnumApplications = 0x7FA2173A,
// NvAPI_DRS_EnumAvailableSettingIds = 0xF020614A,
// NvAPI_DRS_EnumAvailableSettingValues = 0x2EC39F90,
// NvAPI_DRS_EnumProfiles = 0xBC371EE0,
// NvAPI_DRS_EnumSettings = 0xAE3039DA,
// NvAPI_DRS_FindApplicationByName = 0xEEE566B2,
// NvAPI_DRS_FindProfileByName = 0x7E4A9A0B,
// NvAPI_DRS_GetApplicationInfo = 0xED1F8C69,
// NvAPI_DRS_GetBaseProfile = 0xDA8466A0,
// NvAPI_DRS_GetCurrentGlobalProfile = 0x617BFF9F,
// NvAPI_DRS_GetNumProfiles = 0x1DAE4FBC,
// NvAPI_DRS_GetProfileInfo = 0x61CD6FD6,
// NvAPI_DRS_GetSetting = 0x73BF8338,
// NvAPI_DRS_GetSettingIdFromName = 0xCB7309CD,
// NvAPI_DRS_GetSettingNameFromId = 0xD61CBE6E,
// NvAPI_DRS_LoadSettings = 0x375DBD6B,
// NvAPI_DRS_LoadSettingsFromFile = 0xD3EDE889,
// NvAPI_DRS_RestoreAllDefaults = 0x5927B094,
// NvAPI_DRS_RestoreProfileDefault = 0xFA5F6134,
// NvAPI_DRS_RestoreProfileDefaultSetting = 0x53F0381E,
// NvAPI_DRS_SaveSettings = 0xFCBC7E14,
// NvAPI_DRS_SaveSettingsToFile = 0x2BE25DF8,
// NvAPI_DRS_SetCurrentGlobalProfile = 0x1C89C5DF,
// NvAPI_DRS_SetProfileInfo = 0x16ABD3A9,
// NvAPI_DRS_SetSetting = 0x577DD202,
// NvAPI_EnableCurrentMosaicTopology = 0x74073CC9,
// NvAPI_EnableHWCursor = 0x2863148D,
// NvAPI_EnumLogicalGPUs = 0x48B3EA59,
// NvAPI_EnumNvidiaDisplayHandle = 0x9ABDD40D,
// NvAPI_EnumNvidiaUnAttachedDisplayHandle = 0x20DE9260,
// NvAPI_EnumPhysicalGPUs = 0xE5AC921F,
// NvAPI_EnumTCCPhysicalGPUs = 0xD9930B07,
// NvAPI_GetAssociatedDisplayOutputId = 0xD995937E,
// NvAPI_GetAssociatedNvidiaDisplayHandle = 0x35C29134,
// NvAPI_GetAssociatedNvidiaDisplayName = 0x22A78B05,
// NvAPI_GetCurrentMosaicTopology = 0xF60852BD,
// NvAPI_GetDisplayDriverVersion = 0xF951A4D1,
// NvAPI_GetDisplayPortInfo = 0xC64FF367,
// NvAPI_GetErrorMessage = 0x6C2D048C,
// NvAPI_GetHDMISupportInfo = 0x6AE16EC3,
// NvAPI_GetInterfaceVersionString = 0x1053FA5,
// NvAPI_GetLogicalGPUFromDisplay = 0xEE1370CF,
// NvAPI_GetLogicalGPUFromPhysicalGPU = 0xADD604D1,
// NvAPI_GetPhysicalGPUFromUnAttachedDisplay = 0x5018ED61,
// NvAPI_GetPhysicalGPUsFromDisplay = 0x34EF9506,
// NvAPI_GetPhysicalGPUsFromLogicalGPU = 0xAEA3FA32,
// NvAPI_GetSupportedMosaicTopologies = 0x410B5C25,
// NvAPI_GetSupportedViews = 0x66FB7FC0,
// NvAPI_GetUnAttachedAssociatedDisplayName = 0x4888D790,
// NvAPI_GetVBlankCounter = 0x67B5DB55,
// NvAPI_GetView = 0xD6B99D89,
// NvAPI_GetViewEx = 0xDBBC0AF4,
// NvAPI_GPU_ClientIllumDevicesGetControl = 0x73C01D58,
// NvAPI_GPU_ClientIllumDevicesGetInfo = 0xD4100E58,
// NvAPI_GPU_ClientIllumDevicesSetControl = 0x57024C62,
// NvAPI_GPU_ClientIllumZonesGetControl = 0x3DBF5764,
// NvAPI_GPU_ClientIllumZonesGetInfo = 0x4B81241B,
// NvAPI_GPU_ClientIllumZonesSetControl = 0x197D065E,
// NvAPI_GPU_GetActiveOutputs = 0xE3E89B6F,
// NvAPI_GPU_GetAGPAperture = 0x6E042794,
// NvAPI_GPU_GetAllClockFrequencies = 0xDCB616C3,
// NvAPI_GPU_GetAllDisplayIds = 0x785210A2,
// NvAPI_GPU_GetAllOutputs = 0x7D554F8E,
// NvAPI_GPU_GetBoardInfo = 0x22D54523,
// NvAPI_GPU_GetBusId = 0x1BE0B8E5,
// NvAPI_GPU_GetBusSlotId = 0x2A0A350F,
// NvAPI_GPU_GetBusType = 0x1BB18724,
// NvAPI_GPU_GetConnectedDisplayIds = 0x78DBA2,
// NvAPI_GPU_GetConnectedOutputs = 0x1730BFC9,
// NvAPI_GPU_GetConnectedOutputsWithLidState = 0xCF8CAF39,
// NvAPI_GPU_GetConnectedSLIOutputs = 0x680DE09,
// NvAPI_GPU_GetConnectedSLIOutputsWithLidState = 0x96043CC7,
// NvAPI_GPU_GetCurrentAGPRate = 0xC74925A0,
// NvAPI_GPU_GetCurrentPCIEDownstreamWidth = 0xD048C3B1,
// NvAPI_GPU_GetCurrentPstate = 0x927DA4F6,
// NvAPI_GPU_GetDynamicPstatesInfoEx = 0x60DED2ED,
// NvAPI_GPU_GetECCConfigurationInfo = 0x77A796F3,
// NvAPI_GPU_GetECCErrorInfo = 0xC71F85A6,
// NvAPI_GPU_GetECCStatusInfo = 0xCA1DDAF3,
// NvAPI_GPU_GetEDID = 0x37D32E69,
// NvAPI_GPU_GetFullName = 0xCEEE8E9F,
// NvAPI_GPU_GetGpuCoreCount = 0xC7026A87,
// NvAPI_GPU_GetGPUType = 0xC33BAEB1,
// NvAPI_GPU_GetHDCPSupportStatus = 0xF089EEF5,
// NvAPI_GPU_GetIllumination = 0x9A1B9365,
// NvAPI_GPU_GetIRQ = 0xE4715417,
// NvAPI_GPU_GetMemoryInfo = 0x7F9B368,
// NvAPI_GPU_GetOutputType = 0x40A505E4,
// NvAPI_GPU_GetPCIIdentifiers = 0x2DDFB66E,
// NvAPI_GPU_GetPerfDecreaseInfo = 0x7F7F4600,
// NvAPI_GPU_GetPhysicalFrameBufferSize = 0x46FBEB03,
// NvAPI_GPU_GetPstates20 = 0x6FF81213,
// NvAPI_GPU_GetPstatesInfoEx = 0x843C0256,
// NvAPI_GPU_GetQuadroStatus = 0xE332FA47,
// NvAPI_GPU_GetScanoutCompositionParameter = 0x58FE51E6,
// NvAPI_GPU_GetScanoutConfiguration = 0x6A9F5B63,
// NvAPI_GPU_GetScanoutConfigurationEx = 0xE2E1E6F0,
// NvAPI_GPU_GetScanoutIntensityState = 0xE81CE836,
// NvAPI_GPU_GetScanoutWarpingState = 0x6F5435AF,
// NvAPI_GPU_GetShaderSubPipeCount = 0xBE17923,
// NvAPI_GPU_GetSystemType = 0xBAAABFCC,
// NvAPI_GPU_GetTachReading = 0x5F608315,
// NvAPI_GPU_GetThermalSettings = 0xE3640A56,
// NvAPI_GPU_GetVbiosOEMRevision = 0x2D43FB31,
// NvAPI_GPU_GetVbiosRevision = 0xACC3DA0A,
// NvAPI_GPU_GetVbiosVersionString = 0xA561FD7D,
// NvAPI_GPU_GetVirtualFrameBufferSize = 0x5A04B644,
// NvAPI_GPU_QueryIlluminationSupport = 0xA629DA31,
// NvAPI_GPU_ResetECCErrorInfo = 0xC02EEC20,
// NvAPI_GPU_SetECCConfiguration = 0x1CF639D9,
// NvAPI_GPU_SetEDID = 0xE83D6456,
// NvAPI_GPU_SetIllumination = 0x254A187,
// NvAPI_GPU_SetScanoutCompositionParameter = 0xF898247D,
// NvAPI_GPU_SetScanoutIntensity = 0xA57457A4,
// NvAPI_GPU_SetScanoutWarping = 0xB34BAB4F,
// NvAPI_GPU_ValidateOutputCombination = 0x34C9C2D4,
// NvAPI_GPU_WorkstationFeatureQuery = 0x4537DF,
// NvAPI_GPU_WorkstationFeatureSetup = 0x6C1F3FE4,
// NvAPI_GSync_AdjustSyncDelay = 0x2D11FF51,
// NvAPI_GSync_EnumSyncDevices = 0xD9639601,
// NvAPI_GSync_GetControlParameters = 0x16DE1C6A,
// NvAPI_GSync_GetStatusParameters = 0x70D404EC,
// NvAPI_GSync_GetSyncStatus = 0xF1F5B434,
// NvAPI_GSync_GetTopology = 0x4562BC38,
// NvAPI_GSync_QueryCapabilities = 0x44A3F1D1,
// NvAPI_GSync_SetControlParameters = 0x8BBFF88B,
// NvAPI_GSync_SetSyncStateSettings = 0x60ACDFDD,
// NvAPI_I2CRead = 0x2FDE12C5,
// NvAPI_I2CWrite = 0xE812EB07,
// NvAPI_Mosaic_EnableCurrentTopo = 0x5F1AA66C,
// NvAPI_Mosaic_EnumDisplayGrids = 0xDF2887AF,
// NvAPI_Mosaic_EnumDisplayModes = 0x78DB97D7,
// NvAPI_Mosaic_GetCurrentTopo = 0xEC32944E,
// NvAPI_Mosaic_GetDisplayViewportsByResolution = 0xDC6DC8D3,
// NvAPI_Mosaic_GetOverlapLimits = 0x989685F0,
// NvAPI_Mosaic_GetSupportedTopoInfo = 0xFDB63C81,
// NvAPI_Mosaic_GetTopoGroup = 0xCB89381D,
// NvAPI_Mosaic_SetCurrentTopo = 0x9B542831,
// NvAPI_Mosaic_SetDisplayGrids = 0x4D959A89,
// NvAPI_Mosaic_ValidateDisplayGrids = 0xCF43903D,
// NvAPI_OGL_ExpertModeDefaultsGet = 0xAE921F12,
// NvAPI_OGL_ExpertModeDefaultsSet = 0xB47A657E,
// NvAPI_OGL_ExpertModeGet = 0x22ED9516,
// NvAPI_OGL_ExpertModeSet = 0x3805EF7A,
// NvAPI_SetCurrentMosaicTopology = 0xD54B8989,
// NvAPI_SetDisplayPort = 0xFA13E65A,
// NvAPI_SetRefreshRateOverride = 0x3092AC32,
// NvAPI_SetView = 0x957D7B6,
// NvAPI_SetViewEx = 0x6B89E68,
// NvAPI_Stereo_Activate = 0xF6A1AD68,
// NvAPI_Stereo_CaptureJpegImage = 0x932CB140,
// NvAPI_Stereo_CapturePngImage = 0x8B7E99B5,
// NvAPI_Stereo_CreateConfigurationProfileRegistryKey = 0xBE7692EC,
// NvAPI_Stereo_CreateHandleFromIUnknown = 0xAC7E37F4,
// NvAPI_Stereo_Deactivate = 0x2D68DE96,
// NvAPI_Stereo_Debug_WasLastDrawStereoized = 0xED4416C5,
// NvAPI_Stereo_DecreaseConvergence = 0x4C87E317,
// NvAPI_Stereo_DecreaseSeparation = 0xDA044458,
// NvAPI_Stereo_DeleteConfigurationProfileRegistryKey = 0xF117B834,
// NvAPI_Stereo_DeleteConfigurationProfileValue = 0x49BCEECF,
// NvAPI_Stereo_DestroyHandle = 0x3A153134,
// NvAPI_Stereo_Disable = 0x2EC50C2B,
// NvAPI_Stereo_Enable = 0x239C4545,
// NvAPI_Stereo_GetConvergence = 0x4AB00934,
// NvAPI_Stereo_GetDefaultProfile = 0x624E21C2,
// NvAPI_Stereo_GetEyeSeparation = 0xCE653127,
// NvAPI_Stereo_GetFrustumAdjustMode = 0xE6839B43,
// NvAPI_Stereo_GetSeparation = 0x451F2134,
// NvAPI_Stereo_GetStereoSupport = 0x296C434D,
// NvAPI_Stereo_GetSurfaceCreationMode = 0x36F1C736,
// NvAPI_Stereo_IncreaseConvergence = 0xA17DAABE,
// NvAPI_Stereo_IncreaseSeparation = 0xC9A8ECEC,
// NvAPI_Stereo_InitActivation = 0xC7177702,
// NvAPI_Stereo_IsActivated = 0x1FB0BC30,
// NvAPI_Stereo_IsEnabled = 0x348FF8E1,
// NvAPI_Stereo_IsWindowedModeSupported = 0x40C8ED5E,
// NvAPI_Stereo_ReverseStereoBlitControl = 0x3CD58F89,
// NvAPI_Stereo_SetActiveEye = 0x96EEA9F8,
// NvAPI_Stereo_SetConfigurationProfileValue = 0x24409F48,
// NvAPI_Stereo_SetConvergence = 0x3DD6B54B,
// NvAPI_Stereo_SetDefaultProfile = 0x44F0ECD1,
// NvAPI_Stereo_SetDriverMode = 0x5E8F0BEC,
// NvAPI_Stereo_SetFrustumAdjustMode = 0x7BE27FA2,
// NvAPI_Stereo_SetNotificationMessage = 0x6B9B409E,
// NvAPI_Stereo_SetSeparation = 0x5C069FA3,
// NvAPI_Stereo_SetSurfaceCreationMode = 0xF5DCFCBA,
// NvAPI_Stereo_Trigger_Activation = 0xD6C6CD2,
// NvAPI_SYS_GetChipSetInfo = 0x53DABBCA,
// NvAPI_SYS_GetDisplayIdFromGpuAndOutputId = 0x8F2BAB4,
// NvAPI_SYS_GetDriverAndBranchVersion = 0x2926AAAD,
// NvAPI_SYS_GetGpuAndOutputIdFromDisplayId = 0x112BA1A5,
// NvAPI_SYS_GetLidAndDockInfo = 0xCDA14D8A,
// NvAPI_SYS_GetPhysicalGpuFromDisplayId = 0x9EA74659,
// NvAPI_VIO_Close = 0xD01BD237,
// NvAPI_VIO_EnumDataFormats = 0x221FA8E8,
// NvAPI_VIO_EnumDevices = 0xFD7C5557,
// NvAPI_VIO_EnumSignalFormats = 0xEAD72FE4,
// NvAPI_VIO_GetCapabilities = 0x1DC91303,
// NvAPI_VIO_GetConfig = 0xD34A789B,
// NvAPI_VIO_GetCSC = 0x7B0D72A3,
// NvAPI_VIO_GetGamma = 0x51D53D06,
// NvAPI_VIO_GetPCIInfo = 0xB981D935,
// NvAPI_VIO_GetSyncDelay = 0x462214A9,
// NvAPI_VIO_IsFrameLockModeCompatible = 0x7BF0A94D,
// NvAPI_VIO_IsRunning = 0x96BD040E,
// NvAPI_VIO_Open = 0x44EE4841,
// NvAPI_VIO_QueryTopology = 0x869534E2,
// NvAPI_VIO_SetConfig = 0xE4EEC07,
// NvAPI_VIO_SetCSC = 0xA1EC8D74,
// NvAPI_VIO_SetGamma = 0x964BF452,
// NvAPI_VIO_SetSyncDelay = 0x2697A8D1,
// NvAPI_VIO_Start = 0xCDE8E1A3,
// NvAPI_VIO_Status = 0xE6CE4F1,
// NvAPI_VIO_Stop = 0x6BA2A5D6,
// NvAPI_VIO_SyncFormatDetect = 0x118D48A3,
// // -------------------------------------------------
// // Private Internal NvAPI Functions
// // -------------------------------------------------
// NvAPI_3D_GetProperty = 0x8061A4B1,
// NvAPI_3D_GetPropertyRange = 0x0B85DE27C,
// NvAPI_3D_SetProperty = 0x0C9175E8D,
// NvAPI_AccessDisplayDriverRegistry = 0xF5579360,
// NvAPI_Coproc_GetApplicationCoprocInfo = 0x79232685,
// NvAPI_Coproc_GetCoprocInfoFlagsEx = 0x69A9874D,
// NvAPI_Coproc_GetCoprocStatus = 0x1EFC3957,
// NvAPI_Coproc_NotifyCoprocPowerState = 0x0CADCB956,
// NvAPI_Coproc_SetCoprocInfoFlagsEx = 0x0F4C863AC,
// NvAPI_CreateUnAttachedDisplayFromDisplay = 0xA0C72EE4,
// NvAPI_D3D_CreateQuery = 0x5D19BCA4,
// NvAPI_D3D_DestroyQuery = 0x0C8FF7258,
// NvAPI_D3D_Query_Begin = 0x0E5A9AAE0,
// NvAPI_D3D_Query_End = 0x2AC084FA,
// NvAPI_D3D_Query_GetData = 0x0F8B53C69,
// NvAPI_D3D_Query_GetDataSize = 0x0F2A54796,
// NvAPI_D3D_Query_GetType = 0x4ACEEAF7,
// NvAPI_D3D_RegisterApp = 0x0D44D3C4E,
// NvAPI_D3D10_AliasPrimaryAsTexture = 0x8AAC133D,
// NvAPI_D3D10_BeginShareResource = 0x35233210,
// NvAPI_D3D10_BeginShareResourceEx = 0x0EF303A9D,
// NvAPI_D3D10_CreateDevice = 0x2DE11D61,
// NvAPI_D3D10_CreateDeviceAndSwapChain = 0x5B803DAF,
// NvAPI_D3D10_EndShareResource = 0x0E9C5853,
// NvAPI_D3D10_GetRenderedCursorAsBitmap = 0x0CAC3CE5D,
// NvAPI_D3D10_ProcessCallbacks = 0x0AE9C2019,
// NvAPI_D3D10_SetPrimaryFlipChainCallbacks = 0x73EB9329,
// NvAPI_D3D11_BeginShareResource = 0x121BDC6,
// NvAPI_D3D11_EndShareResource = 0x8FFB8E26,
// NvAPI_D3D1x_BindSwapBarrier = 0x9DE8C729,
// NvAPI_D3D1x_IFR_SetUpTargetBufferToSys = 0x473F7828,
// NvAPI_D3D1x_IFR_TransferRenderTarget = 0x9FBAE4EB,
// NvAPI_D3D1x_JoinSwapGroup = 0x14610CD7,
// NvAPI_D3D1x_Present = 0x3B845A1,
// NvAPI_D3D1x_QueryFrameCount = 0x9152E055,
// NvAPI_D3D1x_QueryMaxSwapGroup = 0x9BB9D68F,
// NvAPI_D3D1x_QuerySwapGroup = 0x407F67AA,
// NvAPI_D3D1x_ResetFrameCount = 0x0FBBB031A,
// NvAPI_D3D9_AliasPrimaryAsTexture = 0x13C7112E,
// NvAPI_D3D9_AliasPrimaryFromDevice = 0x7C20C5BE,
// NvAPI_D3D9_BindSwapBarrier = 0x9C39C246,
// NvAPI_D3D9_CreatePathContextNV = 0x0A342F682,
// NvAPI_D3D9_CreatePathNV = 0x71329DF3,
// NvAPI_D3D9_CreateRenderTarget = 0x0B3827C8,
// NvAPI_D3D9_CreateTexture = 0x0D5E13573,
// NvAPI_D3D9_CreateVideo = 0x89FFD9A3,
// NvAPI_D3D9_CreateVideoBegin = 0x84C9D553,
// NvAPI_D3D9_CreateVideoEnd = 0x0B476BF61,
// NvAPI_D3D9_DeletePathNV = 0x73E0019A,
// NvAPI_D3D9_DestroyPathContextNV = 0x667C2929,
// NvAPI_D3D9_DMA = 0x962B8AF6,
// NvAPI_D3D9_DrawPathNV = 0x13199B3D,
// NvAPI_D3D9_EnableStereo = 0x492A6954,
// NvAPI_D3D9_EnumVideoFeatures = 0x1DB7C52C,
// NvAPI_D3D9_FreeVideo = 0x3111BED1,
// NvAPI_D3D9_GetCurrentRenderTargetHandle = 0x22CAD61,
// NvAPI_D3D9_GetCurrentZBufferHandle = 0x0B380F218,
// NvAPI_D3D9_GetIndexBufferHandle = 0x0FC5A155B,
// NvAPI_D3D9_GetOverlaySurfaceHandles = 0x6800F5FC,
// NvAPI_D3D9_GetSLIInfo = 0x694BFF4D,
// NvAPI_D3D9_GetTextureHandle = 0x0C7985ED5,
// NvAPI_D3D9_GetVertexBufferHandle = 0x72B19155,
// NvAPI_D3D9_GetVideoCapabilities = 0x3D596B93,
// NvAPI_D3D9_GetVideoState = 0x0A4527BF8,
// NvAPI_D3D9_GPUBasedCPUSleep = 0x0D504DDA7,
// NvAPI_D3D9_GpuSyncAcquire = 0x0D00B8317,
// NvAPI_D3D9_GpuSyncEnd = 0x754033F0,
// NvAPI_D3D9_GpuSyncGetHandleSize = 0x80C9FD3B,
// NvAPI_D3D9_GpuSyncInit = 0x6D6FDAD4,
// NvAPI_D3D9_GpuSyncMapIndexBuffer = 0x12EE68F2,
// NvAPI_D3D9_GpuSyncMapSurfaceBuffer = 0x2AB714AB,
// NvAPI_D3D9_GpuSyncMapTexBuffer = 0x0CDE4A28A,
// NvAPI_D3D9_GpuSyncMapVertexBuffer = 0x0DBC803EC,
// NvAPI_D3D9_GpuSyncRelease = 0x3D7A86BB,
// NvAPI_D3D9_IFR_SetUpTargetBufferToNV12BLVideoSurface = 0x0CFC92C15,
// NvAPI_D3D9_IFR_SetUpTargetBufferToSys = 0x55255D05,
// NvAPI_D3D9_IFR_TransferRenderTarget = 0x0AB7C2DC,
// NvAPI_D3D9_IFR_TransferRenderTargetToNV12BLVideoSurface = 0x5FE72F64,
// NvAPI_D3D9_JoinSwapGroup = 0x7D44BB54,
// NvAPI_D3D9_Lock = 0x6317345C,
// NvAPI_D3D9_NVFBC_GetStatus = 0x0bd3eb475,
// NvAPI_D3D9_PathClearDepthNV = 0x157E45C4,
// NvAPI_D3D9_PathDepthNV = 0x0FCB16330,
// NvAPI_D3D9_PathEnableColorWriteNV = 0x3E2804A2,
// NvAPI_D3D9_PathEnableDepthTestNV = 0x0E99BA7F3,
// NvAPI_D3D9_PathMatrixNV = 0x0D2F6C499,
// NvAPI_D3D9_PathParameterfNV = 0x0F7FF00C1,
// NvAPI_D3D9_PathParameteriNV = 0x0FC31236C,
// NvAPI_D3D9_PathVerticesNV = 0x0C23DF926,
// NvAPI_D3D9_Present = 0x5650BEB,
// NvAPI_D3D9_PresentSurfaceToDesktop = 0x0F7029C5,
// NvAPI_D3D9_PresentVideo = 0x5CF7F862,
// NvAPI_D3D9_QueryAAOverrideMode = 0x0DDF5643C,
// NvAPI_D3D9_QueryFrameCount = 0x9083E53A,
// NvAPI_D3D9_QueryMaxSwapGroup = 0x5995410D,
// NvAPI_D3D9_QuerySwapGroup = 0x0EBA4D232,
// NvAPI_D3D9_QueryVideoInfo = 0x1E6634B3,
// NvAPI_D3D9_ResetFrameCount = 0x0FA6A0675,
// NvAPI_D3D9_SetGamutData = 0x2BBDA32E,
// NvAPI_D3D9_SetPitchSurfaceCreation = 0x18CDF365,
// NvAPI_D3D9_SetResourceHint = 0x905F5C27,
// NvAPI_D3D9_SetSLIMode = 0x0BFDC062C,
// NvAPI_D3D9_SetSurfaceCreationLayout = 0x5609B86A,
// NvAPI_D3D9_SetVideoState = 0x0BD4BC56F,
// NvAPI_D3D9_StretchRect = 0x0AEAECD41,
// NvAPI_D3D9_Unlock = 0x0C182027E,
// NvAPI_D3D9_VideoSurfaceEncryptionControl = 0x9D2509EF,
// NvAPI_DeleteCustomDisplay = 0x0E7CB998D,
// NvAPI_DeleteUnderscanConfig = 0x0F98854C8,
// NvAPI_Disp_DpAuxChannelControl = 0x8EB56969,
// NvAPI_DISP_EnumHDMIStereoModes = 0x0D2CCF5D6,
// NvAPI_DISP_GetDisplayBlankingState = 0x63E5D8DB,
// NvAPI_DISP_GetHCloneTopology = 0x47BAD137,
// NvAPI_DISP_GetVirtualModeData = 0x3230D69A,
// NvAPI_DISP_OverrideDisplayModeList = 0x291BFF2,
// NvAPI_DISP_SetDisplayBlankingState = 0x1E17E29B,
// NvAPI_DISP_SetHCloneTopology = 0x61041C24,
// NvAPI_DISP_ValidateHCloneTopology = 0x5F4C2664,
// NvAPI_EnumCustomDisplay = 0x42892957,
// NvAPI_EnumUnderscanConfig = 0x4144111A,
// NvAPI_Event_RegisterCallback = 0x0E6DBEA69,
// NvAPI_Event_UnregisterCallback = 0x0DE1F9B45,
// NvAPI_GetDisplayDriverBuildTitle = 0x7562E947,
// NvAPI_GetDisplayDriverCompileType = 0x988AEA78,
// NvAPI_GetDisplayDriverMemoryInfo = 0x774AA982,
// NvAPI_GetDisplayDriverRegistryPath = 0x0E24CEEE,
// NvAPI_GetDisplayDriverSecurityLevel = 0x9D772BBA,
// NvAPI_GetDisplayFeatureConfig = 0x8E985CCD,
// NvAPI_GetDisplayFeatureConfigDefaults = 0x0F5F4D01,
// NvAPI_GetDisplayPosition = 0x6BB1EE5D,
// NvAPI_GetDisplaySettings = 0x0DC27D5D4,
// NvAPI_GetDriverMemoryInfo = 0x2DC95125,
// NvAPI_GetDriverModel = 0x25EEB2C4,
// NvAPI_GetDVCInfo = 0x4085DE45,
// NvAPI_GetDVCInfoEx = 0x0E45002D,
// NvAPI_GetGPUIDfromPhysicalGPU = 0x6533EA3E,
// NvAPI_GetHDCPLinkParameters = 0x0B3BB0772,
// NvAPI_GetHUEInfo = 0x95B64341,
// NvAPI_GetHybridMode = 0x0E23B68C1,
// NvAPI_GetImageSharpeningInfo = 0x9FB063DF,
// NvAPI_GetInfoFrame = 0x9734F1D,
// NvAPI_GetInfoFrameState = 0x41511594,
// NvAPI_GetInfoFrameStatePvt = 0x7FC17574,
// NvAPI_GetInvalidGpuTopologies = 0x15658BE6,
// NvAPI_GetLoadedMicrocodePrograms = 0x919B3136,
// NvAPI_GetPhysicalGPUFromDisplay = 0x1890E8DA,
// NvAPI_GetPhysicalGPUFromGPUID = 0x5380AD1A,
// NvAPI_GetPVExtName = 0x2F5B08E0,
// NvAPI_GetPVExtProfile = 0x1B1B9A16,
// NvAPI_GetScalingCaps = 0x8E875CF9,
// NvAPI_GetTiming = 0x0AFC4833E,
// NvAPI_GetTopologyDisplayGPU = 0x813D89A8,
// NvAPI_GetTVEncoderControls = 0x5757474A,
// NvAPI_GetTVOutputBorderColor = 0x6DFD1C8C,
// NvAPI_GetTVOutputInfo = 0x30C805D5,
// NvAPI_GetUnAttachedDisplayDriverRegistryPath = 0x633252D8,
// NvAPI_GetValidGpuTopologies = 0x5DFAB48A,
// NvAPI_GetVideoState = 0x1C5659CD,
// NvAPI_GPS_GetPerfSensors = 0x271C1109,
// NvAPI_GPS_GetPowerSteeringStatus = 0x540EE82E,
// NvAPI_GPS_GetThermalLimit = 0x583113ED,
// NvAPI_GPS_GetVPStateCap = 0x71913023,
// NvAPI_GPS_SetPowerSteeringStatus = 0x9723D3A2,
// NvAPI_GPS_SetThermalLimit = 0x0C07E210F,
// NvAPI_GPS_SetVPStateCap = 0x68888EB4,
// NvAPI_GPU_ClearPCIELinkAERInfo = 0x521566BB,
// NvAPI_GPU_ClearPCIELinkErrorInfo = 0x8456FF3D,
// NvAPI_GPU_ClientPowerPoliciesGetInfo = 0x34206D86,
// NvAPI_GPU_ClientPowerPoliciesGetStatus = 0x70916171,
// NvAPI_GPU_ClientPowerPoliciesSetStatus = 0x0AD95F5ED,
// NvAPI_GPU_ClientPowerTopologyGetInfo = 0x0A4DFD3F2,
// NvAPI_GPU_ClientPowerTopologyGetStatus = 0x0EDCF624E,
// NvAPI_GPU_CudaEnumComputeCapableGpus = 0x5786CC6E,
// NvAPI_GPU_EnableDynamicPstates = 0x0FA579A0F,
// NvAPI_GPU_EnableOverclockedPstates = 0x0B23B70EE,
// NvAPI_GPU_Get_DisplayPort_DongleInfo = 0x76A70E8D,
// NvAPI_GPU_GetAllClocks = 0x1BD69F49,
// NvAPI_GPU_GetAllGpusOnSameBoard = 0x4DB019E6,
// NvAPI_GPU_GetArchInfo = 0xD8265D24,
// NvAPI_GPU_GetBarInfo = 0xE4B701E3,
// NvAPI_GPU_GetClockBoostLock = 0xe440b867, // unknown name, NVAPI_ID_CURVE_GET
// NvAPI_GPU_GetClockBoostMask = 0x507b4b59,
// NvAPI_GPU_GetClockBoostRanges = 0x64b43a6a,
// NvAPI_GPU_GetClockBoostTable = 0x23f1b133,
// NvAPI_GPU_GetColorSpaceConversion = 0x8159E87A,
// NvAPI_GPU_GetConnectorInfo = 0x4ECA2C10,
// NvAPI_GPU_GetCoolerPolicyTable = 0x518A32C,
// NvAPI_GPU_GetCoolerSettings = 0x0DA141340,
// NvAPI_GPU_GetCoreVoltageBoostPercent = 0x9df23ca1,
// NvAPI_GPU_GetCurrentFanSpeedLevel = 0x0BD71F0C9,
// NvAPI_GPU_GetCurrentThermalLevel = 0x0D2488B79,
// NvAPI_GPU_GetCurrentVoltage = 0x465f9bcf,
// NvAPI_GPU_GetDeepIdleState = 0x1AAD16B4,
// NvAPI_GPU_GetDeviceDisplayMode = 0x0D2277E3A,
// NvAPI_GPU_GetDisplayUnderflowStatus = 0xED9E8057,
// NvAPI_GPU_GetDitherControl = 0x932AC8FB,
// NvAPI_GPU_GetExtendedMinorRevision = 0x25F17421,
// NvAPI_GPU_GetFBWidthAndLocation = 0x11104158,
// NvAPI_GPU_GetFlatPanelInfo = 0x36CFF969,
// NvAPI_GPU_GetFoundry = 0x5D857A00,
// NvAPI_GPU_GetFrameBufferCalibrationLockFailures = 0x524B9773,
// NvAPI_GPU_GetHardwareQualType = 0xF91E777B,
// NvAPI_GPU_GetHybridControllerInfo = 0xD26B8A58,
// NvAPI_GPU_GetLogicalFBWidthAndLocation = 0x8efc0978,
// NvAPI_GPU_GetManufacturingInfo = 0xA4218928,
// NvAPI_GPU_GetMemPartitionMask = 0x329D77CD,
// NvAPI_GPU_GetMXMBlock = 0xB7AB19B9,
// NvAPI_GPU_GetPartitionCount = 0x86F05D7A,
// NvAPI_GPU_GetPCIEInfo = 0xE3795199,
// NvAPI_GPU_GetPerfClocks = 0x1EA54A3B,
// NvAPI_GPU_GetPerfHybridMode = 0x5D7CCAEB,
// NvAPI_GPU_GetPerGpuTopologyStatus = 0x0A81F8992,
// NvAPI_GPU_GetPixelClockRange = 0x66AF10B7,
// NvAPI_GPU_GetPowerMizerInfo = 0x76BFA16B,
// NvAPI_GPU_GetPSFloorSweepStatus = 0xDEE047AB,
// NvAPI_GPU_GetPstateClientLimits = 0x88C82104,
// NvAPI_GPU_GetPstatesInfo = 0x0BA94C56E,
// NvAPI_GPU_GetRamBankCount = 0x17073A3C,
// NvAPI_GPU_GetRamBusWidth = 0x7975C581,
// NvAPI_GPU_GetRamConfigStrap = 0x51CCDB2A,
// NvAPI_GPU_GetRamMaker = 0x42aea16a,
// NvAPI_GPU_GetRamType = 0x57F7CAAC,
// NvAPI_GPU_GetRawFuseData = 0xE0B1DCE9,
// NvAPI_GPU_GetROPCount = 0xfdc129fa,
// NvAPI_GPU_GetSampleType = 0x32E1D697,
// NvAPI_GPU_GetSerialNumber = 0x14B83A5F,
// NvAPI_GPU_GetShaderPipeCount = 0x63E2F56F,
// NvAPI_GPU_GetShortName = 0xD988F0F3,
// NvAPI_GPU_GetSMMask = 0x0EB7AF173,
// NvAPI_GPU_GetTargetID = 0x35B5FD2F,
// NvAPI_GPU_GetThermalPoliciesInfo = 0x00D258BB5, // NvAPI_GPU_ClientThermalPoliciesGetInfo
// NvAPI_GPU_GetThermalPoliciesStatus = 0x0E9C425A1,
// NvAPI_GPU_GetThermalTable = 0xC729203C,
// NvAPI_GPU_GetTotalSMCount = 0x0AE5FBCFE,
// NvAPI_GPU_GetTotalSPCount = 0x0B6D62591,
// NvAPI_GPU_GetTotalTPCCount = 0x4E2F76A8,
// NvAPI_GPU_GetTPCMask = 0x4A35DF54,
// NvAPI_GPU_GetUsages = 0x189a1fdf,
// NvAPI_GPU_GetVbiosImage = 0xFC13EE11,
// NvAPI_GPU_GetVbiosMxmVersion = 0xE1D5DABA,
// NvAPI_GPU_GetVFPCurve = 0x21537ad4,
// NvAPI_GPU_GetVoltageDomainsStatus = 0x0C16C7E2C,
// NvAPI_GPU_GetVoltages = 0x7D656244,
// NvAPI_GPU_GetVoltageStep = 0x28766157, // unsure of the name
// NvAPI_GPU_GetVPECount = 0xD8CBF37B,
// NvAPI_GPU_GetVSFloorSweepStatus = 0xD4F3944C,
// NvAPI_GPU_GPIOQueryLegalPins = 0x0FAB69565,
// NvAPI_GPU_GPIOReadFromPin = 0x0F5E10439,
// NvAPI_GPU_GPIOWriteToPin = 0x0F3B11E68,
// NvAPI_GPU_PerfPoliciesGetInfo = 0x409d9841,
// NvAPI_GPU_PerfPoliciesGetStatus = 0x3d358a0c,
// NvAPI_GPU_PhysxQueryRecommendedState = 0x7A4174F4,
// NvAPI_GPU_PhysxSetState = 0x4071B85E,
// NvAPI_GPU_QueryActiveApps = 0x65B1C5F5,
// NvAPI_GPU_RestoreCoolerPolicyTable = 0x0D8C4FE63,
// NvAPI_GPU_RestoreCoolerSettings = 0x8F6ED0FB,
// NvAPI_GPU_SetClockBoostLock = 0x39442cfb, // unknown name, NVAPI_ID_CURVE_SET
// NvAPI_GPU_SetClockBoostTable = 0x0733e009,
// NvAPI_GPU_SetClocks = 0x6F151055,
// NvAPI_GPU_SetColorSpaceConversion = 0x0FCABD23A,
// NvAPI_GPU_SetCoolerLevels = 0x891FA0AE,
// NvAPI_GPU_SetCoolerPolicyTable = 0x987947CD,
// NvAPI_GPU_SetCoreVoltageBoostPercent = 0xb9306d9b,
// NvAPI_GPU_SetCurrentPCIESpeed = 0x3BD32008,
// NvAPI_GPU_SetCurrentPCIEWidth = 0x3F28E1B9,
// NvAPI_GPU_SetDeepIdleState = 0x568A2292,
// NvAPI_GPU_SetDisplayUnderflowMode = 0x387B2E41,
// NvAPI_GPU_SetDitherControl = 0x0DF0DFCDD,
// NvAPI_GPU_SetPerfClocks = 0x7BCF4AC,
// NvAPI_GPU_SetPerfHybridMode = 0x7BC207F8,
// NvAPI_GPU_SetPixelClockRange = 0x5AC7F8E5,
// NvAPI_GPU_SetPowerMizerInfo = 0x50016C78,
// NvAPI_GPU_SetPstateClientLimits = 0x0FDFC7D49,
// NvAPI_GPU_SetPstates20 = 0x0F4DAE6B,
// NvAPI_GPU_SetPstatesInfo = 0x0CDF27911,
// NvAPI_GPU_SetThermalPoliciesStatus = 0x034C0B13D,
// NvAPI_Hybrid_IsAppMigrationStateChangeable = 0x584CB0B6,
// NvAPI_Hybrid_QueryBlockedMigratableApps = 0x0F4C2F8CC,
// NvAPI_Hybrid_QueryUnblockedNonMigratableApps = 0x5F35BCB5,
// NvAPI_Hybrid_SetAppMigrationState = 0x0FA0B9A59,
// NvAPI_I2CReadEx = 0x4D7B0709,
// NvAPI_I2CWriteEx = 0x283AC65A,
// NvAPI_LoadMicrocode = 0x3119F36E,
// NvAPI_Mosaic_ChooseGpuTopologies = 0x0B033B140,
// NvAPI_Mosaic_EnumGridTopologies = 0x0A3C55220,
// NvAPI_Mosaic_GetDisplayCapabilities = 0x0D58026B9,
// NvAPI_Mosaic_GetMosaicCapabilities = 0x0DA97071E,
// NvAPI_Mosaic_GetMosaicViewports = 0x7EBA036,
// NvAPI_Mosaic_SetGridTopology = 0x3F113C77,
// NvAPI_Mosaic_ValidateDisplayGridsWithSLI = 0x1ECFD263,
// NvAPI_QueryNonMigratableApps = 0x0BB9EF1C3,
// NvAPI_QueryUnderscanCap = 0x61D7B624,
// NvAPI_RestartDisplayDriver = 0xB4B26B65,
// NvAPI_RevertCustomDisplayTrial = 0x854BA405,
// NvAPI_SaveCustomDisplay = 0x0A9062C78,
// NvAPI_SetDisplayFeatureConfig = 0x0F36A668D,
// NvAPI_SetDisplayPosition = 0x57D9060F,
// NvAPI_SetDisplaySettings = 0x0E04F3D86,
// NvAPI_SetDVCLevel = 0x172409B4,
// NvAPI_SetDVCLevelEx = 0x4A82C2B1,
// NvAPI_SetFrameRateNotify = 0x18919887,
// NvAPI_SetGpuTopologies = 0x25201F3D,
// NvAPI_SetHUEAngle = 0x0F5A0F22C,
// NvAPI_SetHybridMode = 0x0FB22D656,
// NvAPI_SetImageSharpeningLevel = 0x3FC9A59C,
// NvAPI_SetInfoFrame = 0x69C6F365,
// NvAPI_SetInfoFrameState = 0x67EFD887,
// NvAPI_SetPVExtName = 0x4FEEB498,
// NvAPI_SetPVExtProfile = 0x8354A8F4,
// NvAPI_SetTopologyDisplayGPU = 0xF409D5E5,
// NvAPI_SetTopologyFocusDisplayAndView = 0x0A8064F9,
// NvAPI_SetTVEncoderControls = 0x0CA36A3AB,
// NvAPI_SetTVOutputBorderColor = 0x0AED02700,
// NvAPI_SetUnderscanConfig = 0x3EFADA1D,
// NvAPI_SetVideoState = 0x54FE75A,
// NvAPI_Stereo_AppHandShake = 0x8C610BDA,
// NvAPI_Stereo_ForceToScreenDepth = 0x2D495758,
// NvAPI_Stereo_GetCursorSeparation = 0x72162B35,
// NvAPI_Stereo_GetPixelShaderConstantB = 0x0C79333AE,
// NvAPI_Stereo_GetPixelShaderConstantF = 0x0D4974572,
// NvAPI_Stereo_GetPixelShaderConstantI = 0x0ECD8F8CF,
// NvAPI_Stereo_GetStereoCaps = 0x0DFC063B7,
// NvAPI_Stereo_GetVertexShaderConstantB = 0x712BAA5B,
// NvAPI_Stereo_GetVertexShaderConstantF = 0x622FDC87,
// NvAPI_Stereo_GetVertexShaderConstantI = 0x5A60613A,
// NvAPI_Stereo_HandShake_Message_Control = 0x315E0EF0,
// NvAPI_Stereo_HandShake_Trigger_Activation = 0x0B30CD1A7,
// NvAPI_Stereo_Is3DCursorSupported = 0x0D7C9EC09,
// NvAPI_Stereo_SetCursorSeparation = 0x0FBC08FC1,
// NvAPI_Stereo_SetPixelShaderConstantB = 0x0BA6109EE,
// NvAPI_Stereo_SetPixelShaderConstantF = 0x0A9657F32,
// NvAPI_Stereo_SetPixelShaderConstantI = 0x912AC28F,
// NvAPI_Stereo_SetVertexShaderConstantB = 0x5268716F,
// NvAPI_Stereo_SetVertexShaderConstantF = 0x416C07B3,
// NvAPI_Stereo_SetVertexShaderConstantI = 0x7923BA0E,
// NvAPI_SYS_GetChipSetTopologyStatus = 0x8A50F126,
// NvAPI_SYS_GetSliApprovalCookie = 0xB539A26E,
// NvAPI_SYS_SetPostOutput = 0xD3A092B1,
// NvAPI_SYS_VenturaGetCoolingBudget = 0x0C9D86E33,
// NvAPI_SYS_VenturaGetPowerReading = 0x63685979,
// NvAPI_SYS_VenturaGetState = 0x0CB7C208D,
// NvAPI_SYS_VenturaSetCoolingBudget = 0x85FF5A15,
// NvAPI_SYS_VenturaSetState = 0x0CE2E9D9,
// NvAPI_TryCustomDisplay = 0x0BF6C1762,
// NvAPI_VideoGetStereoInfo = 0x8E1F8CFE,
// NvAPI_VideoSetStereoInfo = 0x97063269,
// NvAPI_GPU_ClientFanCoolersGetInfo = 0xfb85b01e,
// NvAPI_GPU_ClientFanCoolersGetStatus = 0x35aed5e8,
// NvAPI_GPU_ClientFanCoolersGetControl = 0x814b209f,
// NvAPI_GPU_ClientFanCoolersSetControl = 0xa58971a5,
// Unknown_1629A173 = 0x1629a173, // `Unknown(*mut { version = 0x00030038, count, .. })`
// Unknown_36E39E6B = 0x36e39e6b, // `Unknown(*mut { version = 0x0002000c, count, ... })` might be handles?
// Unknown_B7BCF50D = 0xb7bcf50d, // `Unknown(hGpu, *mut { version = 0x00010008, value })` seen `value = 0x703`
// Unknown_F1D2777B = 0xf1d2777b, // `Unknown(hDisplayHandle, *mut hGpu)` maybe?
// NvAPI_Unload = 0xD22BDD7E,
// NvAPI_Initialize = 0x150E828
typedef uintptr_t *(*NvAPI_QueryInterface_t)(unsigned int);
typedef struct nv_module {
HMODULE handle;
nv_api_t api;
} nv_module_t;
static void* _nv_module_function_get(HMODULE handle, const char *name)
{
void *func = GetProcAddress(handle, name);
if (func == NULL) {
log_fatal("Failed to get function pointer for %s: %s", name, util_winerr_format_error_code(GetLastError()));
}
return func;
}
void nv_module_load(nv_module_t **module)
{
HMODULE handle;
NvAPI_QueryInterface_t nvapi_query_interface;
log_assert(module);
*module = (nv_module_t *) xmalloc(sizeof(nv_module_t));
handle = LoadLibraryA(NV_MODULE_PATH);
if (handle == NULL) {
log_fatal("Failed to load nvapi module: %s", util_winerr_format_error_code(GetLastError()));
}
(*module)->handle = handle;
nvapi_query_interface = _nv_module_function_get((*module)->handle, "nvapi_QueryInterface");
(*module)->api.NvAPI_Initialize = (NvAPI_Initialize_t) nvapi_query_interface(0x0150E828);
(*module)->api.NvAPI_Unload = (NvAPI_Unload_t) nvapi_query_interface(0xD22BDD7E);
(*module)->api.NvAPI_GetInterfaceVersionStringEx = (NvAPI_GetInterfaceVersionStringEx_t) nvapi_query_interface(0x1053FA5);
(*module)->api.NvAPI_SYS_GetDriverAndBranchVersion = (NvAPI_SYS_GetDriverAndBranchVersion_t) nvapi_query_interface(0x2926AAAD);
(*module)->api.NvAPI_GetErrorMessage = (NvAPI_GetErrorMessage_t) nvapi_query_interface(0x6C2D048C);
(*module)->api.NvAPI_DRS_CreateSession = (NvAPI_DRS_CreateSession_t) nvapi_query_interface(0x0694D52E);
(*module)->api.NvAPI_DRS_LoadSettings = (NvAPI_DRS_LoadSettings_t) nvapi_query_interface(0x375DBD6B);
(*module)->api.NvAPI_DRS_FindProfileByName = (NvAPI_DRS_FindProfileByName_t) nvapi_query_interface(0x7E4A9A0B);
(*module)->api.NvAPI_DRS_FindApplicationByName = (NvAPI_DRS_FindApplicationByName_t) nvapi_query_interface(0x0EEE566B2);
(*module)->api.NvAPI_DRS_CreateProfile = (NvAPI_DRS_CreateProfile_t) nvapi_query_interface(0x0CC176068);
(*module)->api.NvAPI_DRS_CreateApplication = (NvAPI_DRS_CreateApplication_t) nvapi_query_interface(0x4347A9DE);
(*module)->api.NvAPI_DRS_GetSetting = (NvAPI_DRS_GetSetting_t) nvapi_query_interface(0x73BF8338);
(*module)->api.NvAPI_DRS_SetSetting = (NvAPI_DRS_SetSetting_t) nvapi_query_interface(0x577DD202);
(*module)->api.NvAPI_DRS_SaveSettings = (NvAPI_DRS_SaveSettings_t) nvapi_query_interface(0x0FCBC7E14);
(*module)->api.NvAPI_DRS_DestroySession = (NvAPI_DRS_DestroySession_t) nvapi_query_interface(0x0DAD9CFF8);
(*module)->api.NvAPI_EnumPhysicalGPUs = (NvAPI_EnumPhysicalGPUs_t) nvapi_query_interface(0x0E5AC921F);
(*module)->api.NvAPI_GPU_GetConnectedDisplayIds = (NvAPI_GPU_GetConnectedDisplayIds_t) nvapi_query_interface(0x78DBA2);
(*module)->api.NvAPI_DISP_GetTiming = (NvAPI_DISP_GetTiming_t) nvapi_query_interface(0x175167E9);
(*module)->api.NvAPI_DISP_TryCustomDisplay = (NvAPI_DISP_TryCustomDisplay_t) nvapi_query_interface(0x1F7DB630);
(*module)->api.NvAPI_DISP_SaveCustomDisplay = (NvAPI_DISP_SaveCustomDisplay_t) nvapi_query_interface(0x49882876);
(*module)->api.NvAPI_DISP_RevertCustomDisplayTrial = (NvAPI_DISP_RevertCustomDisplayTrial_t) nvapi_query_interface(0xCBBD40F0);
(*module)->api.NvAPI_DRS_DeleteProfile = (NvAPI_DRS_DeleteProfile_t) nvapi_query_interface(0x17093206);
(*module)->api.NvAPI_DISP_GetDisplayConfig = (NvAPI_DISP_GetDisplayConfig_t) nvapi_query_interface(0x11ABCCF8);
(*module)->api.NvAPI_DISP_SetDisplayConfig = (NvAPI_DISP_SetDisplayConfig_t) nvapi_query_interface(0x5D8CF8DE);
}
void nv_module_free(nv_module_t **module)
{
log_assert(module);
FreeLibrary((*module)->handle);
free(*module);
}
void nv_module_api_get(const nv_module_t *module, nv_api_t *api)
{
log_assert(module);
log_assert(api);
*api = module->api;
}

View File

@@ -1,13 +0,0 @@
#ifndef NVGPU_CONFIG_NVAPI_MODULE_H
#define NVGPU_CONFIG_NVAPI_MODULE_H
#include "nv/api.h"
typedef struct nv_module nv_module_t;
void nv_module_load(nv_module_t **module);
void nv_module_free(nv_module_t **module);
void nv_module_api_get(const nv_module_t *module, nv_api_t *api);
#endif

View File

@@ -1,8 +0,0 @@
exes += nvgpu \
libs_nvgpu := \
nv \
util \
src_nvgpu := \
main.c \

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,5 @@ src_util := \
str.c \
thread.c \
time.c \
winerr.c \
winres.c \

View File

@@ -1,25 +1,54 @@
#define LOG_MODULE "util-proc"
#include <windows.h>
#include <winternl.h>
#include <tlhelp32.h>
#include <ntstatus.h>
#include <winnt.h>
#include <stdbool.h>
#include <stdint.h>
#include "util/defs.h"
#include "util/log.h"
#include "util/mem.h"
#include "util/str.h"
#include "util/winerr.h"
#include "proc.h"
bool proc_is_running_as_admin_user()
{
SID_IDENTIFIER_AUTHORITY authority = SECURITY_NT_AUTHORITY;
PSID sid;
BOOL res;
BOOL is_admin;
typedef NTSTATUS (NTAPI *PNtQueryInformationThread)(
HANDLE ThreadHandle,
THREADINFOCLASS ThreadInformationClass,
PVOID ThreadInformation,
ULONG ThreadInformationLength,
PULONG ReturnLength
);
res = AllocateAndInitializeSid(
&authority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0,
0,
0,
0,
0,
0,
&sid);
if (!res) {
log_warning(
"Failed to allocate memory for is admin check: %lX",
GetLastError());
return false;
}
is_admin = false;
res = CheckTokenMembership(NULL, sid, &is_admin);
if (!res) {
log_warning(
"Failed to check admin group membership: %lX", GetLastError());
return false;
}
FreeSid(sid);
return is_admin;
}
void proc_terminate_current_process(uint32_t exit_code)
{
@@ -29,196 +58,4 @@ void proc_terminate_current_process(uint32_t exit_code)
SYNCHRONIZE | PROCESS_TERMINATE, TRUE, GetCurrentProcessId());
TerminateProcess(hnd, exit_code);
}
void* proc_thread_get_proc_address(int thread_id)
{
HANDLE thread;
char* err_str;
HMODULE nt_dll;
PNtQueryInformationThread ntQueryInformationThread;
NTSTATUS status;
PVOID thread_start_address;
ULONG return_len;
thread = proc_thread_get_handle(thread_id);
if (thread == NULL) {
err_str = util_winerr_format_last_error_code();
log_fatal("Failed to open thread with id %d: %s", thread_id, err_str);
}
nt_dll = LoadLibrary("ntdll.dll");
ntQueryInformationThread = (PNtQueryInformationThread) GetProcAddress(nt_dll, "NtQueryInformationThread");
status = ntQueryInformationThread(thread, ThreadQuerySetWin32StartAddress, &thread_start_address, sizeof(thread_start_address), &return_len);
CloseHandle(thread);
FreeLibrary(nt_dll);
if (status != STATUS_SUCCESS) {
log_fatal("Failed to get start address for thread %d: 0x%lx\n", thread_id, status);
}
return thread_start_address;
}
HMODULE proc_thread_proc_get_origin_module(void* proc_addr)
{
HMODULE module;
log_assert(proc_addr);
if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(LPCTSTR) proc_addr, &module)) {
return NULL;
} else {
return module;
}
}
bool proc_thread_proc_get_origin_module_path(void* proc_addr, char* buffer, size_t len)
{
HMODULE module;
module = proc_thread_proc_get_origin_module(proc_addr);
if (module != NULL) {
if (GetModuleFileNameA(module, buffer, len) == 0) {
return false;
} else {
return true;
}
} else {
return false;
}
}
bool proc_thread_proc_get_origin_module_name(void* proc_addr, char* buffer, size_t len)
{
HMODULE module;
char path_buffer[MAX_PATH];
const char* filename;
module = proc_thread_proc_get_origin_module(proc_addr);
if (module != NULL) {
if (GetModuleFileNameA(module, path_buffer, sizeof(path_buffer)) == 0) {
return false;
} else {
filename = strrchr(path_buffer, '\\');
if (filename == NULL) {
// no backslashes found, use the entire path
filename = path_buffer;
} else {
// skip the backslash
filename++;
}
str_cpy(buffer, len, filename);
return true;
}
} else {
return false;
}
}
size_t proc_thread_scan_threads_current_process(struct proc_thread_info** info)
{
DWORD pid;
HANDLE snapshot;
char* err_str;
THREADENTRY32 thread_entry;
size_t idx;
HANDLE thread;
log_assert(info);
pid = GetCurrentProcessId();
// Create a snapshot of the running threads in the target process.
snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, pid);
if (snapshot == INVALID_HANDLE_VALUE) {
err_str = util_winerr_format_last_error_code();
log_fatal("Failed to create snapshot of threads: %s", err_str);
}
thread_entry.dwSize = sizeof(THREADENTRY32);
idx = 0;
*info = NULL;
// Count entries for allocation of return value
if (Thread32First(snapshot, &thread_entry)) {
do {
if (thread_entry.th32OwnerProcessID == pid) {
*info = xrealloc(*info, (idx + 1) * sizeof(struct proc_thread_info));
thread = proc_thread_get_handle(thread_entry.th32ThreadID);
(*info)[idx].id = thread_entry.th32ThreadID;
(*info)[idx].proc = proc_thread_get_proc_address(thread_entry.th32ThreadID);
(*info)[idx].priority = GetThreadPriority(thread);
(*info)[idx].origin_module = proc_thread_proc_get_origin_module((*info)[idx].proc);
CloseHandle(thread);
idx++;
}
} while (Thread32Next(snapshot, &thread_entry));
}
CloseHandle(snapshot);
return idx;
}
HANDLE proc_thread_get_handle(int thread_id)
{
HANDLE handle;
handle = OpenThread(THREAD_ALL_ACCESS, FALSE, thread_id);
return handle;
}
bool proc_thread_set_priority(int thread_id, int priority)
{
HANDLE thread;
BOOL res;
thread = proc_thread_get_handle(thread_id);
if (thread == NULL) {
return false;
}
res = SetThreadPriority(thread, priority);
CloseHandle(thread);
return res;
}
bool proc_thread_set_affinity(int thread_id, uint32_t cpu_mask)
{
HANDLE thread;
DWORD_PTR affinity_mask;
DWORD_PTR prev_affinity_mask;
thread = proc_thread_get_handle(thread_id);
if (thread == NULL) {
return false;
}
affinity_mask = cpu_mask;
prev_affinity_mask = SetThreadAffinityMask(thread, affinity_mask);
CloseHandle(thread);
return prev_affinity_mask != 0;
}

View File

@@ -1,37 +1,8 @@
#pragma once
#include <windows.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#define PROC_THREAD_CPU_AFFINITY_CORE(c) (1 << c)
bool proc_is_running_as_admin_user();
struct proc_thread_info {
int id;
void* proc;
// According to
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getthreadpriority#return-value
int priority;
HMODULE origin_module;
};
void proc_terminate_current_process(uint32_t exit_code);
void* proc_thread_get_proc_address(int thread_id);
HMODULE proc_thread_proc_get_origin_module(void* proc_addr);
bool proc_thread_proc_get_origin_module_path(void* proc_addr, char* buffer, size_t len);
bool proc_thread_proc_get_origin_module_name(void* proc_addr, char* buffer, size_t len);
size_t proc_thread_scan_threads_current_process(struct proc_thread_info** info);
HANDLE proc_thread_get_handle(int thread_id);
bool proc_thread_set_priority(int thread_id, int priority);
// cpu starts with 0, specify multiple to set affinity to these cores
bool proc_thread_set_affinity(int thread_id, uint32_t cpu_mask);
void proc_terminate_current_process(uint32_t exit_code);

View File

@@ -1,38 +0,0 @@
#include <windows.h>
#include "util/mem.h"
#include "util/str.h"
#include "util/winerr.h"
char* util_winerr_format_last_error_code()
{
return util_winerr_format_error_code(GetLastError());
}
char* util_winerr_format_error_code(int err_code)
{
// Max size according to docs
char buffer[64 * 1024];
char *buffer_dyn;
DWORD format_flags;
DWORD language_id;
size_t len;
format_flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
language_id = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
len = FormatMessageA(format_flags, NULL, err_code, language_id, buffer, sizeof(buffer), NULL);
if (len > 0) {
// Have this on the heap by don't use the dynamic allocation provided by
// the function because it's on a different heap and can't be free'd
// with free()
buffer_dyn = xmalloc(len);
str_cpy(buffer_dyn, len, buffer);
return buffer_dyn;
} else {
return NULL;
}
}

View File

@@ -1,8 +0,0 @@
#ifndef UTIL_WINERR_H
#define UTIL_WINERR_H
char* util_winerr_format_last_error_code();
char* util_winerr_format_error_code(int err_code);
#endif