-
Notifications
You must be signed in to change notification settings - Fork 92
RemixApi: add AddTextureHash and RemoveTextureHash methods #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
RemixApi: add AddTextureHash and RemoveTextureHash methods #90
Conversation
also fixes #727 (NVIDIAGameWorks/rtx-remix#727) - increased REMIXAPI_VERSION_MINOR from 5 to 6
|
REMIX-4052 |
| REMIXAPI_INSTANCE_CATEGORY_BIT_THIRD_PERSON_PLAYER_BODY = 1 << 19, | ||
| REMIXAPI_INSTANCE_CATEGORY_BIT_IGNORE_BAKED_LIGHTING = 1 << 20, | ||
| REMIXAPI_INSTANCE_CATEGORY_BIT_IGNORE_ALPHA_CHANNEL = 1 << 21, | ||
| REMIXAPI_INSTANCE_CATEGORY_BIT_IGNORE_ALPHA_CHANNEL = 1 << 8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the order like this will break any existing uses. I know it's just making it match the order of InstanceCategories in the runtime, but making the code slightly nicer isn't a good reason to introduce a breaking change to the API.
| PFN_remixapi_DrawLightInstance DrawLightInstance; | ||
| PFN_remixapi_SetConfigVariable SetConfigVariable; | ||
| PFN_remixapi_AddTextureHash AddTextureHash; | ||
| PFN_remixapi_RemoveTextureHash RemoveTextureHash; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New functions need to be declared at the end of the struct to preserve backwards compatibility
| #define REMIXAPI_VERSION_MAJOR 0 | ||
| #define REMIXAPI_VERSION_MINOR 5 | ||
| #define REMIXAPI_VERSION_MINOR 6 | ||
| #define REMIXAPI_VERSION_PATCH 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patch version should be reset, since you bumped the minor version. (0.5.1 becomes 0.6.0, not 0.6.1)
| return m_CInterface.SetConfigVariable(key, value); | ||
| } | ||
|
|
||
| inline Result< void > Interface::AddTextureHash(const char* textureCategory, const char* textureHash) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arguments we used for SetConfigVariable are actually something we regret, and we'd like to avoid repeating the same mistake. Primarily, in that it would be a breaking change to add any more arguments.
Instead of AddTextureHash and RemoveTextureHash, we'd prefer to see a ModifyRtxOption function that takes in a struct. That struct can be extended without breaking backwards compatibility, and could have fields for adding & removing values from a HashSet.
typedef struct remixapi_ModifyRtxOptionArgs {
remixapi_StructType sType;
void* pNext;
const char* rtxOptionName;
const char* newValue;
// Hash value to add or remove. Only used if `rtxOptionName` is a HashSet and `newValue` is a nullptr.
// Value of 0 is a no-op.
uint64_t hashToAdd;
uint64_t hashToRemove;
} remixapi_ModifyRtxOptionArgs;
May also be a good idea to define a REMIXAPI_EMPTY_HASH that's set to 0 somewhere in the API, instead of just having 0 as a magic value in that comment.
There may be a better way to encode newValue that would support actual int/float/etc values, but
This is one part of the PR that covers both the bridge and the runtime. The bridge PR can be found here:
NVIDIAGameWorks/bridge-remix#17
This PR implements two new API methods:
AddTextureHashandRemoveTextureHash.These can be used to add or remove individual texture hashes from texture category options (hash sets).
The
SetConfigVariableis not practical in that regard as it only allows to set the entire option to the specified value and would require the user to craft the entire hash set string.Example use cases:
XYis causing issues on a certain map and has to be hidden. But textureXYis also used in other parts of the game where it does not cause issues.Notheworthy changes:
Included fixes:
ext/remix/.2025-03-18.21-25-29.mp4