diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-04-24 07:18:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-24 07:18:21 -0700 |
| commit | 97631e9a8aae44315a96d57fa8bca75b3799f9cb (patch) | |
| tree | d6796f4a3daad9af8b02645d4c7a50c1f1b01eac /prelude | |
| parent | c6b9a91253bce6d450efc281b3f86617b3eef633 (diff) | |
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.
Diffstat (limited to 'prelude')
| -rw-r--r-- | prelude/slang-hlsl-prelude.h | 6 |
1 files changed, 5 insertions, 1 deletions
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 |
