diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-11-13 22:22:50 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-11-13 22:22:50 +0000 |
| commit | d359125adafd13e80d79267e742a5f599f6fc390 (patch) | |
| tree | df44a7384b8cf921cf82225c879c1962c1fd5534 /Graphics/GraphicsEngine | |
| parent | Few updates to support Metal backend (diff) | |
| download | DiligentCore-d359125adafd13e80d79267e742a5f599f6fc390.tar.gz DiligentCore-d359125adafd13e80d79267e742a5f599f6fc390.zip | |
Added comparison operators for LayoutElement and InputLayoutDesc; updated texture test to support Metal.
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/interface/InputLayout.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngine/interface/InputLayout.h b/Graphics/GraphicsEngine/interface/InputLayout.h index c7b18965..308a6a8c 100644 --- a/Graphics/GraphicsEngine/interface/InputLayout.h +++ b/Graphics/GraphicsEngine/interface/InputLayout.h @@ -60,7 +60,6 @@ enum INPUT_ELEMENT_FREQUENCY /// Description of a single element of the input layout struct LayoutElement { - /// HLSL semantic. Default value ("ATTRIB") allows HLSL shaders to be converted /// to GLSL and used in OpenGL backend as well as compiled to SPIRV and used /// in Vulkan backend. @@ -172,6 +171,25 @@ struct LayoutElement Frequency {_Frequency }, InstanceDataStepRate{_InstanceDataStepRate } {} + + bool operator == (const LayoutElement& rhs) const + { + return strcmp(HLSLSemantic, rhs.HLSLSemantic) == 0 && + InputIndex == rhs.InputIndex && + BufferSlot == rhs.BufferSlot && + NumComponents == rhs.NumComponents && + ValueType == rhs.ValueType && + IsNormalized == rhs.IsNormalized && + RelativeOffset == rhs.RelativeOffset && + Stride == rhs.Stride && + Frequency == rhs.Frequency && + InstanceDataStepRate == rhs.InstanceDataStepRate; + } + + bool operator != (const LayoutElement& rhs) const + { + return !(*this == rhs); + } #endif }; typedef struct LayoutElement LayoutElement; @@ -195,6 +213,25 @@ struct InputLayoutDesc LayoutElements{_LayoutElements}, NumElements {_NumElements } {} + + bool operator == (const InputLayoutDesc& rhs) const + { + if (NumElements != rhs.NumElements) + return false; + + for (Uint32 i=0; i < NumElements; ++i) + { + if (LayoutElements[i] != rhs.LayoutElements[i]) + return false; + } + + return true; + } + + bool operator != (const InputLayoutDesc& rhs) const + { + return !(*this == rhs); + } #endif }; typedef struct InputLayoutDesc InputLayoutDesc; |
