Skip to content

Commit 9c97d33

Browse files
Merge branch 'REMIX-4761-rtxOptionLayerPriority' into 'main'
[REMIX-4761] Refactor layer priorities to be more user friendly. Closes REMIX-4761 See merge request lightspeedrtx/dxvk-remix-nv!1815
2 parents 52da085 + ad7e03c commit 9c97d33

23 files changed

+301
-214
lines changed

documentation/components/ConstFloat.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Constant Float
1+
# Constant Number
22

33
Provides a constant decimal number that you can set\.<br/><br/>Use this to provide fixed values like 0\.5, 3\.14, or 100\.0 to other components\.
44

55
## Component Information
66

77
- **Name:** `ConstFloat`
8-
- **UI Name:** Constant Float
8+
- **UI Name:** Constant Number
99
- **Version:** 1
1010
- **Categories:** Constants
1111

documentation/components/CountToggles.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ The value of the boolean from the previous frame\.
4141

4242
| Property | Display Name | Type | IO Type | Default Value | Optional |
4343
|----------|--------------|------|---------|---------------|----------|
44-
| count | Count as Float | Float | Output | 0\.0 | No |
44+
| count | Count | Float | Output | 0\.0 | No |
4545

46-
### Count as Float
46+
### Count
4747

48-
The current count value as a float\.
48+
The current count value\.
4949

5050

5151
## Usage Notes

documentation/components/MeshProximity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ The world space position to test against the mesh bounding box\.
3131

3232
### Inactive Distance
3333

34-
The distance inside the bounding box that corresponds to a normalized value of 0\.0\. Negative numbers represent values outside the AABB\.
34+
The distance inside the bounding box that corresponds to a normalized value of 0\.0\. Positive numbers represent values outside the AABB\.
3535

3636

3737
### Full Activation Distance
3838

39-
The distance inside the bounding box that corresponds to a normalized value of 1\.0\. Negative numbers represent values outside the AABB\.
39+
The distance inside the bounding box that corresponds to a normalized value of 1\.0\. Positive numbers represent values outside the AABB\.
4040

4141

4242
### Easing Type

documentation/components/RtxOptionLayerAction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rtx Option Layer Action
22

3-
Activates and controls configuration layers at runtime based on game conditions\.<br/><br/>Controls an RtxOptionLayer by name, allowing dynamic enable/disable, strength adjustment, and threshold control\. This can be used to activate configuration layers at runtime based on game state or other conditions\.<br/><br/>The layer is created if it doesn't exist, and managed with reference counting\. Each layer requires a unique priority value \- if multiple components specify the same priority, an error will occur\.
3+
Activates and controls configuration layers at runtime based on game conditions\.<br/><br/>Controls an RtxOptionLayer by name, allowing dynamic enable/disable, strength adjustment, and threshold control\. This can be used to activate configuration layers at runtime based on game state or other conditions\.<br/><br/>The layer is created if it doesn't exist, and managed with reference counting\.<br/>If two components specify the same priority and config path, they will both control the same layer \(for enabled components, uses the MAX of the blend strengths and the MIN of the blend thresholds\)\.<br/>If two components specify the same priority but different config paths, the layers will be prioritized alphabetically \(a\.conf will override values from z\.conf\)\.
44

55
## Component Information
66

@@ -51,7 +51,7 @@ The blend threshold for non\-float options \(0\.0 to 1\.0\)\. Non\-float options
5151

5252
### Priority
5353

54-
The priority for the option layer\. Numbers are rounded to the nearest positive integer\. Higher values are blended on top of lower values\. Must be unique across all layers\.
54+
The priority for the option layer\. Numbers are rounded to the nearest positive integer\. Higher values are blended on top of lower values\. If two components specify the same priority but different config paths, the layers will be prioritized alphabetically \(a\.conf will override values from z\.conf\)\.
5555

5656

5757
**Value Constraints:**

documentation/components/RtxOptionLayerSensor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The config file for the RtxOptionLayer to read\.
2323

2424
### Priority
2525

26-
The priority for the option layer\. Numbers are rounded to the nearest positive integer\. Higher values are blended on top of lower values\. Must be unique across all layers\.
26+
The priority for the option layer\. Numbers are rounded to the nearest positive integer\. Higher values are blended on top of lower values\. If multiple layers share the same priority, they are ordered alphabetically by config path\.
2727

2828

2929
**Value Constraints:**

documentation/components/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ This documentation provides detailed information about all available components
8686
| [Constant Bool](ConstBool.md) | Provides a constant true or false value that you can set\.<br/><br/>Use this to provide fixed on/off, yes/no,\.\.\. | 1 |
8787
| [Constant Color3](ConstColor3.md) | Provides a constant RGB color \(Red, Green, Blue\) that you can set\.<br/><br/>Use this to provide fixed colors\.\.\. | 1 |
8888
| [Constant Color4](ConstColor4.md) | Provides a constant RGBA color \(Red, Green, Blue, Alpha\) that you can set\.<br/><br/>Use this for fixed color\.\.\. | 1 |
89-
| [Constant Float](ConstFloat.md) | Provides a constant decimal number that you can set\.<br/><br/>Use this to provide fixed values like 0\.5, 3\.1\.\.\. | 1 |
9089
| [Constant Float2](ConstFloat2.md) | Provides a constant 2D vector \(two numbers: X and Y\) that you can set\.<br/><br/>Use this for fixed 2D coordi\.\.\. | 1 |
9190
| [Constant Float3](ConstFloat3.md) | Provides a constant 3D vector \(three numbers: X, Y, Z\) that you can set\.<br/><br/>Use this for fixed 3D posi\.\.\. | 1 |
9291
| [Constant Float4](ConstFloat4.md) | Provides a constant 4D vector \(four numbers: X, Y, Z, W\) that you can set\. | 1 |
9392
| [Constant Hash](ConstHash.md) | Provides a constant hash value that you can set\.<br/><br/>Use this to provide fixed hash identifiers for mes\.\.\. | 1 |
93+
| [Constant Number](ConstFloat.md) | Provides a constant decimal number that you can set\.<br/><br/>Use this to provide fixed values like 0\.5, 3\.1\.\.\. | 1 |
9494
| [Constant Prim](ConstPrim.md) | Provides a constant reference to a scene object \(prim\) that you can set\.<br/><br/>Use this to provide fixed \.\.\. | 1 |
9595
| [Constant String](ConstString.md) | Provides a constant text string that you can set\.<br/><br/>Use this to provide fixed text values, labels, or\.\.\. | 1 |
9696

src/dxvk/dxvk_instance.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,15 +641,15 @@ namespace dxvk {
641641
initConfig<Config::Type_RtxUser>();
642642
initConfig<Config::Type_RtxMod>();
643643

644-
RtxOptionImpl::addRtxOptionLayer("quality.conf", (uint32_t) RtxOptionLayer::SystemLayerPriority::Quality, true, 1.0f, 1.0f);
644+
RtxOptionImpl::addRtxOptionLayer("quality.conf", (uint32_t) RtxOptionLayer::SystemLayerPriority::Quality, true, 1.0f, 0.1f);
645645
Logger::info("Set quality configs.");
646646

647-
RtxOptionImpl::addRtxOptionLayer("user.conf", (uint32_t) RtxOptionLayer::SystemLayerPriority::USER, true, 1.0f, 1.0f);
647+
RtxOptionImpl::addRtxOptionLayer("user.conf", (uint32_t) RtxOptionLayer::SystemLayerPriority::USER, true, 1.0f, 0.1f);
648648
Logger::info("Set user realtime configs.");
649649

650650
RtxOptionManager::initializeRtxOptions();
651-
for (const auto& [priority, optionLayer] : RtxOptionImpl::getRtxOptionLayerMap()) {
652-
RtxOptionManager::addRtxOptionLayer(optionLayer);
651+
for (const auto& [unusedLayerKey, optionLayerPtr] : RtxOptionImpl::getRtxOptionLayerMap()) {
652+
RtxOptionManager::addRtxOptionLayer(*optionLayerPtr);
653653
}
654654

655655
m_config.logOptions("Effective (combined)");
@@ -714,13 +714,13 @@ namespace dxvk {
714714
// Set config so that any rtx option initialized later will use the value in that config object
715715
// The start-up config contains the values from the code and dxvk.conf, only.
716716
RtxOptionManager::setStartupConfig(m_config);
717-
RtxOptionImpl::addRtxOptionLayer("dxvk.conf", (uint32_t)RtxOptionLayer::SystemLayerPriority::DxvkConf, true, 1.0f, 1.0f, &m_config);
717+
RtxOptionImpl::addRtxOptionLayer("dxvk.conf", (uint32_t)RtxOptionLayer::SystemLayerPriority::DxvkConf, true, 1.0f, 0.1f, &m_config);
718718
Logger::info("Set startup config.");
719719
} else if constexpr ((type == Config::Type_RtxUser) || (type == Config::Type_RtxMod)) {
720720
// Set custom config after the RTX user config has been merged into the config and
721721
// update the RTX options. Contains values from rtx.conf
722722
RtxOptionManager::setCustomConfig(m_config);
723-
RtxOptionImpl::addRtxOptionLayer("rtx.conf", (uint32_t)RtxOptionLayer::SystemLayerPriority::RtxConf, true, 1.0f, 1.0f, nullptr);
723+
RtxOptionImpl::addRtxOptionLayer("rtx.conf", (uint32_t)RtxOptionLayer::SystemLayerPriority::RtxConf, true, 1.0f, 0.1f, nullptr);
724724
Logger::info("Set custom config.");
725725
}
726726
}

src/dxvk/imgui/dxvk_imgui.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,25 +2095,26 @@ namespace dxvk {
20952095
ImGui::Indent();
20962096

20972097
if (IMGUI_ADD_TOOLTIP(ImGui::Button("Disable Layers"), "Reset all settings to Default.")) {
2098-
for (auto& [priority, optionLayer] : RtxOptionImpl::getRtxOptionLayerMap()) {
2099-
optionLayer.requestEnabled(false);
2098+
for (auto& [unusedLayerKey, optionLayerPtr] : RtxOptionImpl::getRtxOptionLayerMap()) {
2099+
optionLayerPtr->requestEnabled(false);
21002100
}
21012101
}
21022102

21032103
ImGui::SameLine();
21042104
if (IMGUI_ADD_TOOLTIP(ImGui::Button("Enable Layers"), "Enable all option layers.")) {
2105-
for (auto& [priority, optionLayer] : RtxOptionImpl::getRtxOptionLayerMap()) {
2106-
optionLayer.requestEnabled(true);
2105+
for (auto& [unusedLayerKey, optionLayerPtr] : RtxOptionImpl::getRtxOptionLayerMap()) {
2106+
optionLayerPtr->requestEnabled(true);
21072107
}
21082108
}
21092109

21102110
ImGui::Checkbox("Override configs", &RtxOptions::Option::overwriteConfigObject());
21112111

21122112
uint32_t optionLayerCounter = 1;
2113-
for (auto& [priority, optionLayer] : RtxOptionImpl::getRtxOptionLayerMap()) {
2113+
for (auto& [layerKey, optionLayerPtr] : RtxOptionImpl::getRtxOptionLayerMap()) {
21142114
// Runtime option layer priority is reserved for real-time user changes.
21152115
// These layers should not be modified through the GUI.
2116-
if (priority != RtxOptionLayer::s_runtimeOptionLayerPriority) {
2116+
if (layerKey.priority != RtxOptionLayer::s_runtimeOptionLayerPriority) {
2117+
RtxOptionLayer& optionLayer = *optionLayerPtr;
21172118
ImGui::Dummy(ImVec2(0.0f, 5.0f));
21182119
ImGui::Separator();
21192120
ImGui::Dummy(ImVec2(0.0f, 5.0f));

src/dxvk/rtx_render/graph/components/const_float.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace components {
3737

3838
REMIX_COMPONENT( \
3939
/* the Component name */ ConstFloat, \
40-
/* the UI name */ "Constant Float", \
40+
/* the UI name */ "Constant Number", \
4141
/* the UI categories */ "Constants", \
4242
/* the doc string */ "Provides a constant decimal number that you can set.\n\n" \
4343
"Use this to provide fixed values like 0.5, 3.14, or 100.0 to other components.", \

src/dxvk/rtx_render/graph/components/count_toggles.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace components {
3636
X(RtComponentPropertyType::Bool, true, prevFrameValue, "", "The value of the boolean from the previous frame.")
3737

3838
#define LIST_OUTPUTS(X) \
39-
X(RtComponentPropertyType::Float, 0.0f, count, "Count as Float", "The current count value as a float.")
39+
X(RtComponentPropertyType::Float, 0.0f, count, "Count", "The current count value.")
4040

4141

4242
REMIX_COMPONENT( \

0 commit comments

Comments
 (0)