diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-01-28 20:30:39 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-01-28 20:30:39 +0000 |
| commit | de9b8692d538f4249e30dd979c3ebac45120be41 (patch) | |
| tree | 2a0c65090d858680c3767d4dc974fd483f923294 /Graphics/GraphicsEngineVulkan | |
| parent | Fixed few issues in C interface (diff) | |
| download | DiligentCore-de9b8692d538f4249e30dd979c3ebac45120be41.tar.gz DiligentCore-de9b8692d538f4249e30dd979c3ebac45120be41.zip | |
Reworked interface definitions to use DILIGENT_BEGIN_INTERFACE/DILIGENT_END_INTERFACE pair
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
14 files changed, 28 insertions, 75 deletions
diff --git a/Graphics/GraphicsEngineVulkan/interface/BufferViewVk.h b/Graphics/GraphicsEngineVulkan/interface/BufferViewVk.h index e1f1aa66..aee3dd94 100644 --- a/Graphics/GraphicsEngineVulkan/interface/BufferViewVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/BufferViewVk.h @@ -44,11 +44,12 @@ static const INTERFACE_ID IID_BufferViewVk = // clang-format off /// Exposes Vulkan-specific functionality of a buffer view object. -DILIGENT_INTERFACE(IBufferViewVk, IBufferView) +DILIGENT_BEGIN_INTERFACE(IBufferViewVk, IBufferView) { /// Returns Vulkan buffer view object. VIRTUAL VkBufferView METHOD(GetVkBufferView)(THIS) CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -64,12 +65,6 @@ struct IBufferViewVkVtbl struct IBufferViewVkMethods BufferViewVk; }; -typedef struct IBufferViewVk -{ - struct IBufferViewVkVtbl* pVtbl; -} IBufferViewVk; - - // clang-format off # define IBufferViewVk_GetVkBufferView(This) CALL_IFACE_METHOD(BufferViewVk, GetVkBufferView, This) diff --git a/Graphics/GraphicsEngineVulkan/interface/BufferVk.h b/Graphics/GraphicsEngineVulkan/interface/BufferVk.h index 5e145f39..5e444cf1 100644 --- a/Graphics/GraphicsEngineVulkan/interface/BufferVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/BufferVk.h @@ -44,7 +44,7 @@ static const INTERFACE_ID IID_BufferVk = // clang-format off /// Exposes Vulkan-specific functionality of a buffer object. -DILIGENT_INTERFACE(IBufferVk, IBuffer) +DILIGENT_BEGIN_INTERFACE(IBufferVk, IBuffer) { /// Returns a vulkan buffer handle VIRTUAL VkBuffer METHOD(GetVkBuffer)(THIS) CONST PURE; @@ -59,6 +59,7 @@ DILIGENT_INTERFACE(IBufferVk, IBuffer) /// returns Vulkan access flags corresponding to the state. If the state is unknown, returns 0. VIRTUAL VkAccessFlags METHOD(GetAccessFlags)(THIS) CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -74,11 +75,6 @@ struct IBufferVkVtbl struct IBufferVkMethods BufferVk; }; -typedef struct IBufferVk -{ - struct IBufferVkVtbl* pVtbl; -} IBufferVk; - # define IBufferVk_GetVkBuffer(This) CALL_IFACE_METHOD(BufferVk, GetVkBuffer, This) # define IBufferVk_SetAccessFlags(This, ...) CALL_IFACE_METHOD(BufferVk, SetAccessFlags, This, __VA_ARGS__) # define IBufferVk_GetAccessFlags(This) CALL_IFACE_METHOD(BufferVk, GetAccessFlags, This) diff --git a/Graphics/GraphicsEngineVulkan/interface/CommandQueueVk.h b/Graphics/GraphicsEngineVulkan/interface/CommandQueueVk.h index 9742d474..9a93b1ae 100644 --- a/Graphics/GraphicsEngineVulkan/interface/CommandQueueVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/CommandQueueVk.h @@ -44,7 +44,7 @@ static const INTERFACE_ID IID_CommandQueueVk = // clang-format off /// Command queue interface -DILIGENT_INTERFACE(ICommandQueueVk, IObject) +DILIGENT_BEGIN_INTERFACE(ICommandQueueVk, IObject) { /// Returns the fence value that will be signaled next time VIRTUAL Uint64 METHOD(GetNextFenceValue)(THIS) CONST PURE; @@ -83,6 +83,7 @@ DILIGENT_INTERFACE(ICommandQueueVk, IObject) VIRTUAL void METHOD(SignalFence)(THIS_ VkFence vkFence) PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -96,11 +97,6 @@ struct ICommandQueueVkVtbl struct ICommandQueueVkMethods CommandQueueVk; }; -typedef struct ICommandQueueVk -{ - struct ICommandQueueVkVtbl* pVtbl; -} ICommandQueueVk; - // clang-format off # define ICommandQueueVk_GetNextFenceValue(This) CALL_IFACE_METHOD(CommandQueueVk, GetNextFenceValue, This) diff --git a/Graphics/GraphicsEngineVulkan/interface/DeviceContextVk.h b/Graphics/GraphicsEngineVulkan/interface/DeviceContextVk.h index f6650410..bad568e4 100644 --- a/Graphics/GraphicsEngineVulkan/interface/DeviceContextVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/DeviceContextVk.h @@ -45,7 +45,7 @@ static const INTERFACE_ID IID_DeviceContextVk = // clang-format off /// Exposes Vulkan-specific functionality of a device context. -DILIGENT_INTERFACE(IDeviceContextVk, IDeviceContext) +DILIGENT_BEGIN_INTERFACE(IDeviceContextVk, IDeviceContext) { /// Transitions internal vulkan image to a specified layout @@ -86,6 +86,7 @@ DILIGENT_INTERFACE(IDeviceContextVk, IDeviceContext) /// Unlocks the command queue that was previously locked by IDeviceContextVk::LockCommandQueue(). VIRTUAL void METHOD(UnlockCommandQueue)(THIS) PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -100,11 +101,6 @@ struct IDeviceContextVkVtbl struct IDeviceContextVkMethods DeviceContextVk; }; -typedef struct IDeviceContextVk -{ - struct IDeviceContextVkVtbl* pVtbl; -} IDeviceContextVk; - // clang-format off # define IDeviceContextVk_TransitionImageLayout(This, ...) CALL_IFACE_METHOD(DeviceContextVk, TransitionImageLayout, This, __VA_ARGS__) diff --git a/Graphics/GraphicsEngineVulkan/interface/EngineFactoryVk.h b/Graphics/GraphicsEngineVulkan/interface/EngineFactoryVk.h index a074c14a..f9c8ad39 100644 --- a/Graphics/GraphicsEngineVulkan/interface/EngineFactoryVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/EngineFactoryVk.h @@ -60,7 +60,7 @@ static const INTERFACE_ID IID_EngineFactoryVk = // clang-format off -DILIGENT_INTERFACE(IEngineFactoryVk, IEngineFactory) +DILIGENT_BEGIN_INTERFACE(IEngineFactoryVk, IEngineFactory) { VIRTUAL void METHOD(CreateDeviceAndContextsVk)(THIS_ const EngineVkCreateInfo REF EngineCI, @@ -80,6 +80,7 @@ DILIGENT_INTERFACE(IEngineFactoryVk, IEngineFactory) void* pNativeWndHandle, ISwapChain** ppSwapChain) PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -94,11 +95,6 @@ struct IEngineFactoryVkVtbl struct IEngineFactoryVkMethods EngineFactoryVk; }; -typedef struct IEngineFactoryVk -{ - struct IEngineFactoryVkVtbl* pVtbl; -} IEngineFactoryVk; - // clang-format off # define IEngineFactoryVk_CreateDeviceAndContextsVk(This, ...) CALL_IFACE_METHOD(EngineFactoryVk, CreateDeviceAndContextsVk, This, __VA_ARGS__) diff --git a/Graphics/GraphicsEngineVulkan/interface/FenceVk.h b/Graphics/GraphicsEngineVulkan/interface/FenceVk.h index e5521dd6..ffa851b8 100644 --- a/Graphics/GraphicsEngineVulkan/interface/FenceVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/FenceVk.h @@ -46,9 +46,10 @@ static const INTERFACE_ID IID_FenceVk = #if DILIGENT_CPP_INTERFACE /// Exposes Vulkan-specific functionality of a fence object. -DILIGENT_INTERFACE(IFenceVk, IFence) +DILIGENT_BEGIN_INTERFACE(IFenceVk, IFence) { }; +DILIGENT_END_INTERFACE #endif diff --git a/Graphics/GraphicsEngineVulkan/interface/PipelineStateVk.h b/Graphics/GraphicsEngineVulkan/interface/PipelineStateVk.h index 0102ddfb..453851a7 100644 --- a/Graphics/GraphicsEngineVulkan/interface/PipelineStateVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/PipelineStateVk.h @@ -42,7 +42,7 @@ static const INTERFACE_ID IID_PipelineStateVk = #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h" /// Exposes Vulkan-specific functionality of a pipeline state object. -DILIGENT_INTERFACE(IPipelineStateVk, IPipelineState) +DILIGENT_BEGIN_INTERFACE(IPipelineStateVk, IPipelineState) { /// Returns handle to a vulkan render pass object. VIRTUAL VkRenderPass METHOD(GetVkRenderPass)(THIS) CONST PURE; @@ -50,6 +50,7 @@ DILIGENT_INTERFACE(IPipelineStateVk, IPipelineState) /// Returns handle to a vulkan pipeline pass object. VIRTUAL VkPipeline METHOD(GetVkPipeline)(THIS) CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -63,11 +64,6 @@ struct IPipelineStateVkVtbl struct IPipelineStateVkMethods PipelineStateVk; }; -typedef struct IPipelineStateVk -{ - struct IPipelineStateVkVtbl* pVtbl; -} IPipelineStateVk; - // clang-format off # define IPipelineStateVk_GetVkRenderPass(This) CALL_IFACE_METHOD(PipelineStateVk, GetVkRenderPass, This) diff --git a/Graphics/GraphicsEngineVulkan/interface/QueryVk.h b/Graphics/GraphicsEngineVulkan/interface/QueryVk.h index 77d18bad..a5179258 100644 --- a/Graphics/GraphicsEngineVulkan/interface/QueryVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/QueryVk.h @@ -44,7 +44,8 @@ static const INTERFACE_ID IID_QueryVk = #if DILIGENT_CPP_INTERFACE /// Exposes Vulkan-specific functionality of a Query object. -DILIGENT_INTERFACE(IQueryVk, IQuery){}; +DILIGENT_BEGIN_INTERFACE(IQueryVk, IQuery){}; +DILIGENT_END_INTERFACE #endif diff --git a/Graphics/GraphicsEngineVulkan/interface/RenderDeviceVk.h b/Graphics/GraphicsEngineVulkan/interface/RenderDeviceVk.h index 270a5b4e..e0099db7 100644 --- a/Graphics/GraphicsEngineVulkan/interface/RenderDeviceVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/RenderDeviceVk.h @@ -44,7 +44,7 @@ static const INTERFACE_ID IID_RenderDeviceVk = // clang-format off /// Exposes Vulkan-specific functionality of a render device. -DILIGENT_INTERFACE(IRenderDeviceVk, IRenderDevice) +DILIGENT_BEGIN_INTERFACE(IRenderDeviceVk, IRenderDevice) { /// Returns logical Vulkan device handle VIRTUAL VkDevice METHOD(GetVkDevice)(THIS) PURE; @@ -109,6 +109,7 @@ DILIGENT_INTERFACE(IRenderDeviceVk, IRenderDevice) RESOURCE_STATE InitialState, IBuffer** ppBuffer) PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -123,11 +124,6 @@ struct IRenderDeviceVkVtbl struct IRenderDeviceVkMethods RenderDeviceVk; }; -typedef struct IRenderDeviceVk -{ - struct IRenderDeviceVkVtbl* pVtbl; -} IRenderDeviceVk; - // clang-format off # define IRenderDeviceVk_GetVkDevice(This) CALL_IFACE_METHOD(RenderDeviceVk, GetVkDevice, This) diff --git a/Graphics/GraphicsEngineVulkan/interface/SamplerVk.h b/Graphics/GraphicsEngineVulkan/interface/SamplerVk.h index 38e034a9..a86e1a3e 100644 --- a/Graphics/GraphicsEngineVulkan/interface/SamplerVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/SamplerVk.h @@ -42,11 +42,12 @@ static const INTERFACE_ID IID_SamplerVk = #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h" /// Exposes Vulkan-specific functionality of a sampler object. -DILIGENT_INTERFACE(ISamplerVk, ISampler) +DILIGENT_BEGIN_INTERFACE(ISamplerVk, ISampler) { /// Returns a vulkan sampler object handle VIRTUAL VkSampler METHOD(GetVkSampler)() CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -60,11 +61,6 @@ struct ISamplerVkVtbl struct ISamplerVkMethods SamplerVk; }; -typedef struct ISamplerVk -{ - struct ISamplerVkVtbl* pVtbl; -} ISamplerVk; - # define ISamplerVk_GetVkSampler(This) CALL_IFACE_METHOD(SamplerVk, GetVkSampler, This) #endif diff --git a/Graphics/GraphicsEngineVulkan/interface/ShaderResourceBindingVk.h b/Graphics/GraphicsEngineVulkan/interface/ShaderResourceBindingVk.h index ae7faf16..4c86b7ff 100644 --- a/Graphics/GraphicsEngineVulkan/interface/ShaderResourceBindingVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/ShaderResourceBindingVk.h @@ -44,7 +44,8 @@ static const INTERFACE_ID IID_ShaderResourceBindingVk = #if DILIGENT_CPP_INTERFACE /// Exposes Vulkan-specific functionality of a shader resource binding object. -DILIGENT_INTERFACE(IShaderResourceBindingVk, IShaderResourceBinding){}; +DILIGENT_BEGIN_INTERFACE(IShaderResourceBindingVk, IShaderResourceBinding){}; +DILIGENT_END_INTERFACE #endif @@ -60,11 +61,6 @@ struct IShaderResourceBindingVkVtbl //struct IShaderResourceBindingVkMethods ShaderResourceBindingVk; }; -typedef struct IShaderResourceBindingVk -{ - struct IShaderResourceBindingVkVtbl* pVtbl; -} IShaderResourceBindingVk; - #endif DILIGENT_END_NAMESPACE // namespace Diligent diff --git a/Graphics/GraphicsEngineVulkan/interface/SwapChainVk.h b/Graphics/GraphicsEngineVulkan/interface/SwapChainVk.h index 033d5c5b..532ffbcf 100644 --- a/Graphics/GraphicsEngineVulkan/interface/SwapChainVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/SwapChainVk.h @@ -45,11 +45,12 @@ static const INTERFACE_ID IID_SwapChainVk = #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h" /// Exposes Vulkan-specific functionality of a swap chain. -DILIGENT_INTERFACE(ISwapChainVk, ISwapChain) +DILIGENT_BEGIN_INTERFACE(ISwapChainVk, ISwapChain) { /// Returns a handle to the Vulkan swap chain object. VIRTUAL VkSwapchainKHR METHOD(GetVkSwapChain)(THIS) PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -63,11 +64,6 @@ struct ISwapChainVkVtbl struct ISwapChainVkMethods SwapChainVk; }; -typedef struct ISwapChainVk -{ - struct ISwapChainVkVtbl* pVtbl; -} ISwapChainVk; - // clang-format off # define ISwapChainVk_GetVkSwapChain(This) CALL_IFACE_METHOD(SwapChainVk, GetVkSwapChain, This) diff --git a/Graphics/GraphicsEngineVulkan/interface/TextureViewVk.h b/Graphics/GraphicsEngineVulkan/interface/TextureViewVk.h index 968273e8..c6ee2438 100644 --- a/Graphics/GraphicsEngineVulkan/interface/TextureViewVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/TextureViewVk.h @@ -44,11 +44,12 @@ static const INTERFACE_ID IID_TextureViewVk = // clang-format off /// Exposes Vulkan-specific functionality of a texture view object. -DILIGENT_INTERFACE(ITextureViewVk, ITextureView) +DILIGENT_BEGIN_INTERFACE(ITextureViewVk, ITextureView) { /// Returns Vulkan image view handle VIRTUAL VkImageView METHOD(GetVulkanImageView)(THIS) CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -64,11 +65,6 @@ struct ITextureViewVkVtbl struct ITextureViewVkMethods TextureViewVk; }; -typedef struct ITextureViewVk -{ - struct ITextureViewVkVtbl* pVtbl; -} ITextureViewVk; - // clang-format off # define ITextureViewVk_GetVulkanImageView(This) CALL_IFACE_METHOD(TextureViewVk, GetVulkanImageView, This) diff --git a/Graphics/GraphicsEngineVulkan/interface/TextureVk.h b/Graphics/GraphicsEngineVulkan/interface/TextureVk.h index f8336f09..7dd96782 100644 --- a/Graphics/GraphicsEngineVulkan/interface/TextureVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/TextureVk.h @@ -44,7 +44,7 @@ static const INTERFACE_ID IID_TextureVk = // clang-format off /// Exposes Vulkan-specific functionality of a texture object. -DILIGENT_INTERFACE(ITextureVk, ITexture) +DILIGENT_BEGIN_INTERFACE(ITextureVk, ITexture) { /// Returns Vulkan image handle. @@ -62,6 +62,7 @@ DILIGENT_INTERFACE(ITextureVk, ITexture) /// Returns current Vulkan image layout. If the state is unknown to the engine, returns VK_IMAGE_LAYOUT_UNDEFINED VIRTUAL VkImageLayout METHOD(GetLayout)(THIS) CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -77,11 +78,6 @@ struct ITextureVkVtbl struct ITextureVkMethods TextureVk; }; -typedef struct ITextureVk -{ - struct ITextureVkVtbl* pVtbl; -} ITextureVk; - // clang-format off # define ITextureVk_GetVkImage(This) CALL_IFACE_METHOD(TextureVk, GetVkImage,This) |
