From 97631e9a8aae44315a96d57fa8bca75b3799f9cb Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Wed, 24 Apr 2024 07:18:21 -0700 Subject: Avoid DXC warnings for missing bitwise op parantheses (#4004) Resolves #3980 Based on the operator precedence, Slang may omits the parentheses if they are not needed. DXC prints warnings for such cases and some applications may treat the warnings as errors. This commit emits parentheses to avoid the DXC warning even when they are not needed. --- prelude/slang-hlsl-prelude.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'prelude') diff --git a/prelude/slang-hlsl-prelude.h b/prelude/slang-hlsl-prelude.h index 4774217f4..d892f228c 100644 --- a/prelude/slang-hlsl-prelude.h +++ b/prelude/slang-hlsl-prelude.h @@ -1,4 +1,8 @@ #ifdef SLANG_HLSL_ENABLE_NVAPI #include "nvHLSLExtns.h" #endif -#pragma warning(disable: 3557) + +#ifndef __DXC_VERSION_MAJOR + // warning X3557: loop doesn't seem to do anything, forcing loop to unroll + #pragma warning(disable: 3557) +#endif -- cgit v1.2.3