summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2020-11-18 01:53:50 +0000
committerazhirnov <zh1dron@gmail.com>2020-11-18 01:53:50 +0000
commit392e0a83119c67118bca0f5bf7d77069cf103024 (patch)
treecc6e08ef3cda27784354c532bcef889f5e608f61 /Graphics/GraphicsEngine
parentSome fixes for PSO (diff)
parentMoved GetBufferToTextureCopyInfo to GraphicsAccessories (diff)
downloadDiligentCore-392e0a83119c67118bca0f5bf7d77069cf103024.tar.gz
DiligentCore-392e0a83119c67118bca0f5bf7d77069cf103024.zip
Merge branch 'master' into ray_tracing_2
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h14
-rw-r--r--Graphics/GraphicsEngine/interface/InputLayout.h41
2 files changed, 51 insertions, 4 deletions
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index e9983eb0..08fc3571 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -2083,8 +2083,8 @@ struct EngineD3D12CreateInfo DILIGENT_DERIVE(EngineCreateInfo)
Uint32 NumCommandsToFlushCmdList DEFAULT_INITIALIZER(256);
/// A device context uses dynamic heap when it needs to allocate temporary
- /// CPU-accessible memory to update a resource via IBufer::UpdateData() or
- /// ITexture::UpdateData(), or to map dynamic resources.
+ /// CPU-accessible memory to update a resource via IDeviceContext::UpdateBuffer() or
+ /// IDeviceContext::UpdateTexture(), or to map dynamic resources.
/// Device contexts first request a chunk of memory from global dynamic
/// resource manager and then suballocate from this chunk in a lock-free
/// fashion. DynamicHeapPageSize defines the size of this chunk.
@@ -2228,7 +2228,8 @@ struct EngineVkCreateInfo DILIGENT_DERIVE(EngineCreateInfo)
/// Page size of the upload heap that is allocated by immediate/deferred
/// contexts from the global memory manager to perform lock-free dynamic
/// suballocations.
- /// Upload heap is used to update resources with UpdateData()
+ /// Upload heap is used to update resources with IDeviceContext::UpdateBuffer()
+ /// and IDeviceContext::UpdateTexture().
Uint32 UploadHeapPageSize DEFAULT_INITIALIZER(1 << 20);
/// Size of the dynamic heap (the buffer that is used to suballocate
@@ -2263,6 +2264,13 @@ typedef struct EngineVkCreateInfo EngineVkCreateInfo;
/// Attributes of the Metal-based engine implementation
struct EngineMtlCreateInfo DILIGENT_DERIVE(EngineCreateInfo)
+ /// A device context uses dynamic heap when it needs to allocate temporary
+ /// CPU-accessible memory to update a resource via IDeviceContext::UpdateBuffer() or
+ /// IDeviceContext::UpdateTexture(), or to map dynamic resources.
+ /// Device contexts first request a chunk of memory from global dynamic
+ /// resource manager and then suballocate from this chunk in a lock-free
+ /// fashion. DynamicHeapPageSize defines the size of this chunk.
+ Uint32 DynamicHeapPageSize DEFAULT_INITIALIZER(4 << 20);
};
typedef struct EngineMtlCreateInfo EngineMtlCreateInfo;
diff --git a/Graphics/GraphicsEngine/interface/InputLayout.h b/Graphics/GraphicsEngine/interface/InputLayout.h
index c7b18965..f39b2868 100644
--- a/Graphics/GraphicsEngine/interface/InputLayout.h
+++ b/Graphics/GraphicsEngine/interface/InputLayout.h
@@ -32,6 +32,8 @@
/// \file
/// Definition input layout
+#include <string.h>
+
#include "GraphicsTypes.h"
DILIGENT_BEGIN_NAMESPACE(Diligent)
@@ -60,7 +62,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 +173,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 +215,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;