Skip to content

Commit 8e12877

Browse files
committed
fix: 修复最后一个通道结果不在 0~1 之间会影响光标绘制的问题
1 parent ebf6312 commit 8e12877

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎Runtime/EffectCompiler.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,7 @@ UINT GeneratePassSource(
12131213
if (isLastEffect) {
12141214
// 255.001953 的由来见 https://stackoverflow.com/questions/52103720/why-does-d3dcolortoubyte4-multiplies-components-by-255-001953f
12151215
result.append(R"(void WriteToOutput(uint2 pos, float3 color) {
1216+
color = saturate(color);
12161217
pos += __offset.zw;
12171218
if ((int)pos.x >= __cursorRect.x && (int)pos.y >= __cursorRect.y && (int)pos.x < __cursorRect.z && (int)pos.y < __cursorRect.w) {
12181219
float4 mask = __CURSOR.SampleLevel(__CURSOR_SAMPLER, (pos - __cursorRect.xy + 0.5f) * __cursorPt, 0);

0 commit comments

Comments
 (0)