diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-05-31 17:20:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-31 17:20:37 -0400 |
| commit | 6cbc3929a54d37bd23cb5efa8e3320ba02f78b2f (patch) | |
| tree | 5a23cb47782e9e2a77762c90dd35da1005eba8d0 /source/slang/type-system-shared.h | |
| parent | b81ff3ef968d1cc4e954b31a1812b3c391d17b02 (diff) | |
Use slang- prefix on slang compiler and core source (#973)
* Prefixing source files in source/slang with slang-
* Prefix source in source/slang with slang- prefix.
* Rename core source files with slang- prefix.
* Update project files.
* Fix problems from automatic merge.
Diffstat (limited to 'source/slang/type-system-shared.h')
| -rw-r--r-- | source/slang/type-system-shared.h | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/source/slang/type-system-shared.h b/source/slang/type-system-shared.h deleted file mode 100644 index 95840e701..000000000 --- a/source/slang/type-system-shared.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef SLANG_TYPE_SYSTEM_SHARED_H -#define SLANG_TYPE_SYSTEM_SHARED_H - -#include "../../slang.h" - -namespace Slang -{ -#define FOREACH_BASE_TYPE(X) \ - X(Void) \ - X(Bool) \ - X(Int8) \ - X(Int16) \ - X(Int) \ - X(Int64) \ - X(UInt8) \ - X(UInt16) \ - X(UInt) \ - X(UInt64) \ - X(Half) \ - X(Float) \ - X(Double) \ -/* end */ - - enum class BaseType - { -#define DEFINE_BASE_TYPE(NAME) NAME, -FOREACH_BASE_TYPE(DEFINE_BASE_TYPE) -#undef DEFINE_BASE_TYPE - - CountOf, - }; - - struct TextureFlavor - { - typedef TextureFlavor ThisType; - enum - { - // Mask for the overall "shape" of the texture - BaseShapeMask = SLANG_RESOURCE_BASE_SHAPE_MASK, - - // Flag for whether the shape has "array-ness" - ArrayFlag = SLANG_TEXTURE_ARRAY_FLAG, - - // Whether or not the texture stores multiple samples per pixel - MultisampleFlag = SLANG_TEXTURE_MULTISAMPLE_FLAG, - - // Whether or not this is a shadow texture - // - // TODO(tfoley): is this even meaningful/used? - // ShadowFlag = 0x80, - }; - - enum Shape : uint8_t - { - Shape1D = SLANG_TEXTURE_1D, - Shape2D = SLANG_TEXTURE_2D, - Shape3D = SLANG_TEXTURE_3D, - ShapeCube = SLANG_TEXTURE_CUBE, - ShapeBuffer = SLANG_TEXTURE_BUFFER, - - Shape1DArray = Shape1D | ArrayFlag, - Shape2DArray = Shape2D | ArrayFlag, - // No Shape3DArray - ShapeCubeArray = ShapeCube | ArrayFlag, - }; - - enum - { - // This the total number of expressible flavors, - // which is *not* to say that every expressible - // flavor is actual valid. - Count = 0x10000, - }; - - uint16_t flavor; - - Shape GetBaseShape() const { return Shape(flavor & BaseShapeMask); } - bool isArray() const { return (flavor & ArrayFlag) != 0; } - 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; } - - TextureFlavor() = default; - TextureFlavor(uint32_t tag) { flavor = (uint16_t)tag; } - - static TextureFlavor create(SlangResourceShape shape, SlangResourceAccess access); - }; - - enum class SamplerStateFlavor : uint8_t - { - SamplerState, - SamplerComparisonState, - }; - -} - -#endif |
