Skip to content

Commit c2bb4f5

Browse files
committed
Merge branch 'pkristof/evMinValueFix' into 'main'
Fixed clamping of ev min max values See merge request lightspeedrtx/dxvk-remix-nv!1774
2 parents 920843e + 8a2d47c commit c2bb4f5

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

RtxOptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ Tables below enumerate all the options and their defaults set by RTX Remix. Note
139139
|rtx.debugView.displayType|int|0|||The display type to use for visualizing debug view input values\.<br>Supported display types are: 0 = Standard, 1 = BGR Exclusive Color, 2 = EV100, 3 = HDR Waveform<br>Each mode may be useful for a different kind of visualization, though Standard is typically the most common mode to use\.<br>Standard mode works for a simple direct, scaled or color mapped visualization, BGR exclusive for another type of color mapped visualization, and EV100 or the HDR Waveform for understanding HDR value magnitudes in the input on a log scale\.|
140140
|rtx.debugView.enableGammaCorrection|bool|False|||Enables gamma correction of a debug view value\.|
141141
|rtx.debugView.enableInputQuantization|bool|False|||Enables uniform\-step input quantization on debug view input buffers\.<br>This is mostly useful for when debugging artifacts relating to quantization that may not be visible in a buffer due to higher precision formats in use\.<br>For example, the final output from tonemapping is a floating point texture in the debug view but will be quantized to 8 bit on some monitors\. Using this option the quantization which will be applied to the output can be visualized in advance\.|
142-
|rtx.debugView.evMaxValue|int|4|||The maximum EV100 debug view input value to map to the top of the visualization range when EV100 debug display is in use\. Values above this value in the input will be clamped to the top of the range\.|
143-
|rtx.debugView.evMinValue|int|-4|||The minimum EV100 debug view input value to map to the bottom of the visualization range when EV100 debug display is in use\. Values below this value in the input will be clamped to the bottom of the range\.|
142+
|rtx.debugView.evMaxValue|int|4|||The maximum EV100 debug view input value to map to the top of the visualization range when EV100 debug display is in use\.<br>Values above this value in the input will be clamped to the top of the range\.|
143+
|rtx.debugView.evMinValue|int|-4|||The minimum EV100 debug view input value to map to the bottom of the visualization range when EV100 debug display is in use\.<br>Values below this value in the input will be clamped to the bottom of the range\.|
144144
|rtx.debugView.gpuPrint.enable|bool|False|||Enables writing into a GPU buffer that's read by CPU when CTRL is pressed\. The value is printed to console\.|
145145
|rtx.debugView.gpuPrint.pixelIndex|int2|2147483647, 2147483647|||Pixel position to GPU print for\. Requires useMousePosition to be turned off\.|
146146
|rtx.debugView.gpuPrint.useMousePosition|bool|True|||Uses mouse position to select a pixel to GPU print for\.|

src/dxvk/rtx_render/rtx_debug_view.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,6 @@ namespace dxvk {
918918
ImGui::InputInt("Min Value (EV100)", &evMinValueObject());
919919
ImGui::InputInt("Max Value (EV100)", &evMaxValueObject());
920920

921-
evMaxValue.setDeferred(std::max(evMaxValue(), evMinValue()));
922-
923921
// Color legend
924922
{
925923
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4 { 0.25f, 0.25f, 0.25f, 1.0f });
@@ -1675,14 +1673,22 @@ namespace dxvk {
16751673
}
16761674

16771675
void DebugView::maxValueOnChange(DxvkDevice* device) {
1678-
// If the max value is negative, we want the min value to be further away from 0.
1676+
// If the max value is negative, we want the min value to be further away from 0 than the max value
16791677
const float factor = maxValue() > 0 ? 0.99999f : 1.00001f;
16801678
minValueObject().setMaxValue(maxValue() * factor);
16811679
}
16821680

16831681
void DebugView::minValueOnChange(DxvkDevice* device) {
1684-
// If the min value is negative, we want the max value to be closer to 0.
1682+
// If the min value is negative, we want the max value to be closer to 0 than the min value
16851683
const float factor = minValue() > 0 ? 1.00001f : 0.99999f;
16861684
maxValueObject().setMinValue(minValue() * factor);
16871685
}
1686+
1687+
void DebugView::evMinValueOnChange(DxvkDevice* device) {
1688+
evMaxValueObject().setMinValue(evMaxValue());
1689+
}
1690+
1691+
void DebugView::evMaxValueOnChange(DxvkDevice* device) {
1692+
evMinValueObject().setMaxValue(evMinValue());
1693+
}
16881694
} // namespace dxvk

src/dxvk/rtx_render/rtx_debug_view.h

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,33 @@ namespace dxvk {
164164
bool m_enableAlphaChannel = false;
165165
float m_scale = 1.f;
166166

167-
public: static void maxValueOnChange(DxvkDevice* device);
167+
public: static void minValueOnChange(DxvkDevice* device);
168168
RTX_OPTION_ARGS("rtx.debugView", float, minValue, 0.f,
169169
"The minimum debug view input value to map to 0 in the output when the standard debug display is in use. Values below this value in the input will be clamped to 0 in the output.",
170170
args.environment = "DXVK_RTX_DEBUG_VIEW_MIN_VALUE",
171-
args.onChangeCallback = &maxValueOnChange);
171+
args.onChangeCallback = &minValueOnChange);
172172

173-
public: static void minValueOnChange(DxvkDevice* device);
173+
public: static void maxValueOnChange(DxvkDevice* device);
174174
RTX_OPTION_ARGS("rtx.debugView", float, maxValue, 1.f,
175175
"The maximum debug view input value to map to 1 in the output when the standard debug display is in use. Values above this value in the input will be clamped to 1 in the output.",
176176
args.environment = "DXVK_RTX_DEBUG_VIEW_MAX_VALUE",
177-
args.onChangeCallback = &minValueOnChange);
177+
args.onChangeCallback = &maxValueOnChange);
178178

179179

180180
// EV100 Display
181-
RTX_OPTION_ENV("rtx.debugView", int32_t, evMinValue, -4, "DXVK_RTX_DEBUG_VIEW_EV_MIN_VALUE", "The minimum EV100 debug view input value to map to the bottom of the visualization range when EV100 debug display is in use. Values below this value in the input will be clamped to the bottom of the range.");
182-
RTX_OPTION_ENV("rtx.debugView", int32_t, evMaxValue, 4, "DXVK_RTX_DEBUG_VIEW_EV_MAX_VALUE", "The maximum EV100 debug view input value to map to the top of the visualization range when EV100 debug display is in use. Values above this value in the input will be clamped to the top of the range.")
181+
public: static void evMinValueOnChange(DxvkDevice* device);
182+
RTX_OPTION_ARGS("rtx.debugView", int32_t, evMinValue, -4,
183+
"The minimum EV100 debug view input value to map to the bottom of the visualization range when EV100 debug display is in use.\n"
184+
"Values below this value in the input will be clamped to the bottom of the range.",
185+
args.environment = "DXVK_RTX_DEBUG_VIEW_EV_MIN_VALUE",
186+
args.onChangeCallback = &evMinValueOnChange);
187+
188+
public: static void evMaxValueOnChange(DxvkDevice* device);
189+
RTX_OPTION_ARGS("rtx.debugView", int32_t, evMaxValue, 4,
190+
"The maximum EV100 debug view input value to map to the top of the visualization range when EV100 debug display is in use.\n"
191+
"Values above this value in the input will be clamped to the top of the range.",
192+
args.environment = "DXVK_RTX_DEBUG_VIEW_EV_MAX_VALUE",
193+
args.onChangeCallback = &evMaxValueOnChange);
183194

184195
struct Accumulation {
185196
RTX_OPTION_ENV("rtx.debugView.accumulation", bool, enable, false, "RTX_DEBUG_VIEW_ACCUMULATION_ENABLE",

0 commit comments

Comments
 (0)