From c2b4c5838431e12abb6f233c459d3d6a717aad18 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 21 May 2019 14:44:09 -0400 Subject: Hotfix/improve glsl semantic conversion (#965) * Specify glsl semantic format - such that conversions are possible from hlsl sematics. * Comment improvements. Give appropriate type in glsl for sv_tessfactor. Note that sv_tessfactor is not functional though. * Work in progress for comparison of types. * * Fix type comparison issues around the hash. * Fix tests whos output changed with use of isTypeEqual --- source/slang/type-system-shared.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/type-system-shared.h') diff --git a/source/slang/type-system-shared.h b/source/slang/type-system-shared.h index 183cacb4b..95840e701 100644 --- a/source/slang/type-system-shared.h +++ b/source/slang/type-system-shared.h @@ -32,6 +32,7 @@ FOREACH_BASE_TYPE(DEFINE_BASE_TYPE) struct TextureFlavor { + typedef TextureFlavor ThisType; enum { // Mask for the overall "shape" of the texture @@ -78,6 +79,9 @@ FOREACH_BASE_TYPE(DEFINE_BASE_TYPE) bool isMultisample() const { return (flavor & MultisampleFlag) != 0; } // bool isShadow() const { return (flavor & ShadowFlag) != 0; } + SLANG_FORCE_INLINE bool operator==(const ThisType& rhs) const { return flavor == rhs.flavor; } + SLANG_FORCE_INLINE bool operator!=(const ThisType& rhs) const { return !(*this == rhs); } + SlangResourceShape getShape() const { return flavor & 0xFF; } SlangResourceAccess getAccess() const { return (flavor >> 8) & 0xFF; } -- cgit v1.2.3