aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Hayes <jeremy@lunarg.com>2024-03-06 15:10:12 -0700
committerarcady-lunarg <122813703+arcady-lunarg@users.noreply.github.com>2024-03-07 12:27:21 -0500
commite7d4ad91a9e80c043c12dc05cd4bb55ec1933882 (patch)
tree47c350ec74d8fa4cc3e803dc96d4bae1074e034a
parentbada5c87ec6db4441db129d8506742c4a72bd610 (diff)
downloadglslang-e7d4ad91a9e80c043c12dc05cd4bb55ec1933882.tar.gz
Increase TStorageQualifier bitfield width
Fix #3538. Visual Studio 2022 added a new warning to detect when enumerators can not be represented within the given bit field width. This warning is disabled by default but can be enabled using the flag /w15249. This PR increases the width by one to accommodate the signed maximum value of EvqLast, which is currently 32. Perhaps a future improvement would be to use scoped enums; however, that is more work as the typing is more strict and would require more changes.
-rw-r--r--glslang/Include/Types.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h
index f938f118..939acbfd 100644
--- a/glslang/Include/Types.h
+++ b/glslang/Include/Types.h
@@ -573,7 +573,8 @@ public:
}
const char* semanticName;
- TStorageQualifier storage : 6;
+ TStorageQualifier storage : 7;
+ static_assert(EvqLast < 64, "need to increase size of TStorageQualifier bitfields!");
TBuiltInVariable builtIn : 9;
TBuiltInVariable declaredBuiltIn : 9;
static_assert(EbvLast < 256, "need to increase size of TBuiltInVariable bitfields!");