summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-01-28 18:45:43 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-01-28 18:45:43 +0000
commit5e9b0dd7fb610e326739676aa0a0d9615a8e9c2d (patch)
tree76b4d1299cb573311918f0ac566a157e029e67bc /Graphics/GraphicsEngine
parentReworked IShaderD3D::GetHLSLResource method to be compatible wit C (diff)
downloadDiligentCore-5e9b0dd7fb610e326739676aa0a0d9615a8e9c2d.tar.gz
DiligentCore-5e9b0dd7fb610e326739676aa0a0d9615a8e9c2d.zip
Reworked C inteface method calls to use CALL_IFACE_METHOD macro
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/Buffer.h10
-rw-r--r--Graphics/GraphicsEngine/interface/BufferView.h2
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceContext.h78
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceObject.h4
-rw-r--r--Graphics/GraphicsEngine/interface/EngineFactory.h6
-rw-r--r--Graphics/GraphicsEngine/interface/Fence.h4
-rw-r--r--Graphics/GraphicsEngine/interface/PipelineState.h12
-rw-r--r--Graphics/GraphicsEngine/interface/Query.h4
-rw-r--r--Graphics/GraphicsEngine/interface/RenderDevice.h28
-rw-r--r--Graphics/GraphicsEngine/interface/ResourceMapping.h10
-rw-r--r--Graphics/GraphicsEngine/interface/Shader.h6
-rw-r--r--Graphics/GraphicsEngine/interface/ShaderResourceBinding.h12
-rw-r--r--Graphics/GraphicsEngine/interface/ShaderResourceVariable.h12
-rw-r--r--Graphics/GraphicsEngine/interface/SwapChain.h14
-rw-r--r--Graphics/GraphicsEngine/interface/Texture.h10
-rw-r--r--Graphics/GraphicsEngine/interface/TextureView.h6
16 files changed, 109 insertions, 109 deletions
diff --git a/Graphics/GraphicsEngine/interface/Buffer.h b/Graphics/GraphicsEngine/interface/Buffer.h
index a7a999a1..f2979b3c 100644
--- a/Graphics/GraphicsEngine/interface/Buffer.h
+++ b/Graphics/GraphicsEngine/interface/Buffer.h
@@ -258,11 +258,11 @@ typedef struct IBuffer
# define IBuffer_GetDesc(This) (const struct BufferDesc*)IDeviceObject_GetDesc(This)
-# define IBuffer_CreateView(This, ...) (This)->pVtbl->Buffer.CreateView ((IBuffer*)(This), __VA_ARGS__)
-# define IBuffer_GetDefaultView(This, ...) (This)->pVtbl->Buffer.GetDefaultView ((IBuffer*)(This), __VA_ARGS__)
-# define IBuffer_GetNativeHandle(This) (This)->pVtbl->Buffer.GetNativeHandle((IBuffer*)(This))
-# define IBuffer_SetState(This, ...) (This)->pVtbl->Buffer.SetState ((IBuffer*)(This), __VA_ARGS__)
-# define IBuffer_GetState(This) (This)->pVtbl->Buffer.GetState ((IBuffer*)(This))
+# define IBuffer_CreateView(This, ...) CALL_IFACE_METHOD(Buffer, CreateView, This, __VA_ARGS__)
+# define IBuffer_GetDefaultView(This, ...) CALL_IFACE_METHOD(Buffer, GetDefaultView, This, __VA_ARGS__)
+# define IBuffer_GetNativeHandle(This) CALL_IFACE_METHOD(Buffer, GetNativeHandle, This)
+# define IBuffer_SetState(This, ...) CALL_IFACE_METHOD(Buffer, SetState, This, __VA_ARGS__)
+# define IBuffer_GetState(This) CALL_IFACE_METHOD(Buffer, GetState, This)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/BufferView.h b/Graphics/GraphicsEngine/interface/BufferView.h
index 613f552b..9bfdc7c4 100644
--- a/Graphics/GraphicsEngine/interface/BufferView.h
+++ b/Graphics/GraphicsEngine/interface/BufferView.h
@@ -184,7 +184,7 @@ typedef struct IBufferView
# define IBufferView_GetDesc(This) (const struct BufferViewDesc*)IDeviceObject_GetDesc(This)
-# define IBufferView_GetBuffer(This) (This)->pVtbl->BufferView.GetBuffer((IBufferView*)(This))
+# define IBufferView_GetBuffer(This) CALL_IFACE_METHOD(BufferView, GetBuffer, This)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h
index 38cbfa61..35283bbe 100644
--- a/Graphics/GraphicsEngine/interface/DeviceContext.h
+++ b/Graphics/GraphicsEngine/interface/DeviceContext.h
@@ -1333,45 +1333,45 @@ typedef struct IDeviceContext
// clang-format off
-# define IDeviceContext_SetPipelineState(This, ...) (This)->pVtbl->DeviceContext.SetPipelineState ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_TransitionShaderResources(This, ...) (This)->pVtbl->DeviceContext.TransitionShaderResources ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_CommitShaderResources(This, ...) (This)->pVtbl->DeviceContext.CommitShaderResources ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_SetStencilRef(This, ...) (This)->pVtbl->DeviceContext.SetStencilRef ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_SetBlendFactors(This, ...) (This)->pVtbl->DeviceContext.SetBlendFactors ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_SetVertexBuffers(This, ...) (This)->pVtbl->DeviceContext.SetVertexBuffers ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_InvalidateState(This) (This)->pVtbl->DeviceContext.InvalidateState ((IDeviceContext*)(This))
-# define IDeviceContext_SetIndexBuffer(This, ...) (This)->pVtbl->DeviceContext.SetIndexBuffer ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_SetViewports(This, ...) (This)->pVtbl->DeviceContext.SetViewports ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_SetScissorRects(This, ...) (This)->pVtbl->DeviceContext.SetScissorRects ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_SetRenderTargets(This, ...) (This)->pVtbl->DeviceContext.SetRenderTargets ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_Draw(This, ...) (This)->pVtbl->DeviceContext.Draw ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_DrawIndexed(This, ...) (This)->pVtbl->DeviceContext.DrawIndexed ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_DrawIndirect(This, ...) (This)->pVtbl->DeviceContext.DrawIndirect ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_DrawIndexedIndirect(This, ...) (This)->pVtbl->DeviceContext.DrawIndexedIndirect ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_DispatchCompute(This, ...) (This)->pVtbl->DeviceContext.DispatchCompute ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_DispatchComputeIndirect(This, ...) (This)->pVtbl->DeviceContext.DispatchComputeIndirect ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_ClearDepthStencil(This, ...) (This)->pVtbl->DeviceContext.ClearDepthStencil ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_ClearRenderTarget(This, ...) (This)->pVtbl->DeviceContext.ClearRenderTarget ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_FinishCommandList(This, ...) (This)->pVtbl->DeviceContext.FinishCommandList ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_ExecuteCommandList(This, ...) (This)->pVtbl->DeviceContext.ExecuteCommandList ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_SignalFence(This, ...) (This)->pVtbl->DeviceContext.SignalFence ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_WaitForFence(This, ...) (This)->pVtbl->DeviceContext.WaitForFence ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_WaitForIdle(This, ...) (This)->pVtbl->DeviceContext.WaitForIdle ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_BeginQuery(This, ...) (This)->pVtbl->DeviceContext.BeginQuery ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_EndQuery(This, ...) (This)->pVtbl->DeviceContext.EndQuery ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_Flush(This, ...) (This)->pVtbl->DeviceContext.Flush ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_UpdateBuffer(This, ...) (This)->pVtbl->DeviceContext.UpdateBuffer ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_CopyBuffer(This, ...) (This)->pVtbl->DeviceContext.CopyBuffer ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_MapBuffer(This, ...) (This)->pVtbl->DeviceContext.MapBuffer ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_UnmapBuffer(This, ...) (This)->pVtbl->DeviceContext.UnmapBuffer ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_UpdateTexture(This, ...) (This)->pVtbl->DeviceContext.UpdateTexture ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_CopyTexture(This, ...) (This)->pVtbl->DeviceContext.CopyTexture ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_MapTextureSubresource(This, ...) (This)->pVtbl->DeviceContext.MapTextureSubresource ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_UnmapTextureSubresource(This, ...) (This)->pVtbl->DeviceContext.UnmapTextureSubresource ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_GenerateMips(This, ...) (This)->pVtbl->DeviceContext.GenerateMips ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_FinishFrame(This) (This)->pVtbl->DeviceContext.FinishFrame ((IDeviceContext*)(This))
-# define IDeviceContext_TransitionResourceStates(This, ...) (This)->pVtbl->DeviceContext.TransitionResourceStates ((IDeviceContext*)(This), __VA_ARGS__)
-# define IDeviceContext_ResolveTextureSubresource(This, ...) (This)->pVtbl->DeviceContext.ResolveTextureSubresource ((IDeviceContext*)(This), __VA_ARGS__)
+# define IDeviceContext_SetPipelineState(This, ...) CALL_IFACE_METHOD(DeviceContext, SetPipelineState, This, __VA_ARGS__)
+# define IDeviceContext_TransitionShaderResources(This, ...) CALL_IFACE_METHOD(DeviceContext, TransitionShaderResources, This, __VA_ARGS__)
+# define IDeviceContext_CommitShaderResources(This, ...) CALL_IFACE_METHOD(DeviceContext, CommitShaderResources, This, __VA_ARGS__)
+# define IDeviceContext_SetStencilRef(This, ...) CALL_IFACE_METHOD(DeviceContext, SetStencilRef, This, __VA_ARGS__)
+# define IDeviceContext_SetBlendFactors(This, ...) CALL_IFACE_METHOD(DeviceContext, SetBlendFactors, This, __VA_ARGS__)
+# define IDeviceContext_SetVertexBuffers(This, ...) CALL_IFACE_METHOD(DeviceContext, SetVertexBuffers, This, __VA_ARGS__)
+# define IDeviceContext_InvalidateState(This) CALL_IFACE_METHOD(DeviceContext, InvalidateState, This)
+# define IDeviceContext_SetIndexBuffer(This, ...) CALL_IFACE_METHOD(DeviceContext, SetIndexBuffer, This, __VA_ARGS__)
+# define IDeviceContext_SetViewports(This, ...) CALL_IFACE_METHOD(DeviceContext, SetViewports, This, __VA_ARGS__)
+# define IDeviceContext_SetScissorRects(This, ...) CALL_IFACE_METHOD(DeviceContext, SetScissorRects, This, __VA_ARGS__)
+# define IDeviceContext_SetRenderTargets(This, ...) CALL_IFACE_METHOD(DeviceContext, SetRenderTargets, This, __VA_ARGS__)
+# define IDeviceContext_Draw(This, ...) CALL_IFACE_METHOD(DeviceContext, Draw, This, __VA_ARGS__)
+# define IDeviceContext_DrawIndexed(This, ...) CALL_IFACE_METHOD(DeviceContext, DrawIndexed, This, __VA_ARGS__)
+# define IDeviceContext_DrawIndirect(This, ...) CALL_IFACE_METHOD(DeviceContext, DrawIndirect, This, __VA_ARGS__)
+# define IDeviceContext_DrawIndexedIndirect(This, ...) CALL_IFACE_METHOD(DeviceContext, DrawIndexedIndirect, This, __VA_ARGS__)
+# define IDeviceContext_DispatchCompute(This, ...) CALL_IFACE_METHOD(DeviceContext, DispatchCompute, This, __VA_ARGS__)
+# define IDeviceContext_DispatchComputeIndirect(This, ...) CALL_IFACE_METHOD(DeviceContext, DispatchComputeIndirect, This, __VA_ARGS__)
+# define IDeviceContext_ClearDepthStencil(This, ...) CALL_IFACE_METHOD(DeviceContext, ClearDepthStencil, This, __VA_ARGS__)
+# define IDeviceContext_ClearRenderTarget(This, ...) CALL_IFACE_METHOD(DeviceContext, ClearRenderTarget, This, __VA_ARGS__)
+# define IDeviceContext_FinishCommandList(This, ...) CALL_IFACE_METHOD(DeviceContext, FinishCommandList, This, __VA_ARGS__)
+# define IDeviceContext_ExecuteCommandList(This, ...) CALL_IFACE_METHOD(DeviceContext, ExecuteCommandList, This, __VA_ARGS__)
+# define IDeviceContext_SignalFence(This, ...) CALL_IFACE_METHOD(DeviceContext, SignalFence, This, __VA_ARGS__)
+# define IDeviceContext_WaitForFence(This, ...) CALL_IFACE_METHOD(DeviceContext, WaitForFence, This, __VA_ARGS__)
+# define IDeviceContext_WaitForIdle(This, ...) CALL_IFACE_METHOD(DeviceContext, WaitForIdle, This, __VA_ARGS__)
+# define IDeviceContext_BeginQuery(This, ...) CALL_IFACE_METHOD(DeviceContext, BeginQuery, This, __VA_ARGS__)
+# define IDeviceContext_EndQuery(This, ...) CALL_IFACE_METHOD(DeviceContext, EndQuery, This, __VA_ARGS__)
+# define IDeviceContext_Flush(This, ...) CALL_IFACE_METHOD(DeviceContext, Flush, This, __VA_ARGS__)
+# define IDeviceContext_UpdateBuffer(This, ...) CALL_IFACE_METHOD(DeviceContext, UpdateBuffer, This, __VA_ARGS__)
+# define IDeviceContext_CopyBuffer(This, ...) CALL_IFACE_METHOD(DeviceContext, CopyBuffer, This, __VA_ARGS__)
+# define IDeviceContext_MapBuffer(This, ...) CALL_IFACE_METHOD(DeviceContext, MapBuffer, This, __VA_ARGS__)
+# define IDeviceContext_UnmapBuffer(This, ...) CALL_IFACE_METHOD(DeviceContext, UnmapBuffer, This, __VA_ARGS__)
+# define IDeviceContext_UpdateTexture(This, ...) CALL_IFACE_METHOD(DeviceContext, UpdateTexture, This, __VA_ARGS__)
+# define IDeviceContext_CopyTexture(This, ...) CALL_IFACE_METHOD(DeviceContext, CopyTexture, This, __VA_ARGS__)
+# define IDeviceContext_MapTextureSubresource(This, ...) CALL_IFACE_METHOD(DeviceContext, MapTextureSubresource, This, __VA_ARGS__)
+# define IDeviceContext_UnmapTextureSubresource(This, ...) CALL_IFACE_METHOD(DeviceContext, UnmapTextureSubresource, This, __VA_ARGS__)
+# define IDeviceContext_GenerateMips(This, ...) CALL_IFACE_METHOD(DeviceContext, GenerateMips, This, __VA_ARGS__)
+# define IDeviceContext_FinishFrame(This) CALL_IFACE_METHOD(DeviceContext, FinishFrame, This)
+# define IDeviceContext_TransitionResourceStates(This, ...) CALL_IFACE_METHOD(DeviceContext, TransitionResourceStates, This, __VA_ARGS__)
+# define IDeviceContext_ResolveTextureSubresource(This, ...) CALL_IFACE_METHOD(DeviceContext, ResolveTextureSubresource, This, __VA_ARGS__)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/DeviceObject.h b/Graphics/GraphicsEngine/interface/DeviceObject.h
index 98d7f26f..35bc0bb5 100644
--- a/Graphics/GraphicsEngine/interface/DeviceObject.h
+++ b/Graphics/GraphicsEngine/interface/DeviceObject.h
@@ -88,8 +88,8 @@ typedef struct IDeviceObject
// clang-format off
-# define IDeviceObject_GetDesc(This) (This)->pVtbl->DeviceObject.GetDesc ((IDeviceObject*)(This))
-# define IDeviceObject_GetUniqueID(This) (This)->pVtbl->DeviceObject.GetUniqueID((IDeviceObject*)(This))
+# define IDeviceObject_GetDesc(This) CALL_IFACE_METHOD(DeviceObject, GetDesc, This)
+# define IDeviceObject_GetUniqueID(This) CALL_IFACE_METHOD(DeviceObject, GetUniqueID, This)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/EngineFactory.h b/Graphics/GraphicsEngine/interface/EngineFactory.h
index 7e401b37..84157c30 100644
--- a/Graphics/GraphicsEngine/interface/EngineFactory.h
+++ b/Graphics/GraphicsEngine/interface/EngineFactory.h
@@ -91,9 +91,9 @@ typedef struct IEngineFactory
// clang-format off
-# define IEngineFactory_GetAPIInfo(This) (This)->pVtbl->EngineFactory.GetAPIInfo ((IEngineFactory*)(This))
-# define IEngineFactory_CreateDefaultShaderSourceStreamFactory(This, ...) (This)->pVtbl->EngineFactory.CreateDefaultShaderSourceStreamFactory((IEngineFactory*)(This), __VA_ARGS__)
-# define IEngineFactory_InitAndroidFileSystem(This, ...) (This)->pVtbl->EngineFactory.InitAndroidFileSystem ((IEngineFactory*)(This), __VA_ARGS__)
+# define IEngineFactory_GetAPIInfo(This) CALL_IFACE_METHOD(EngineFactory, GetAPIInfo, This)
+# define IEngineFactory_CreateDefaultShaderSourceStreamFactory(This, ...) CALL_IFACE_METHOD(EngineFactory, CreateDefaultShaderSourceStreamFactory, This, __VA_ARGS__)
+# define IEngineFactory_InitAndroidFileSystem(This, ...) CALL_IFACE_METHOD(EngineFactory, InitAndroidFileSystem, This, __VA_ARGS__)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/Fence.h b/Graphics/GraphicsEngine/interface/Fence.h
index 7387495c..0cf50f6d 100644
--- a/Graphics/GraphicsEngine/interface/Fence.h
+++ b/Graphics/GraphicsEngine/interface/Fence.h
@@ -97,8 +97,8 @@ typedef struct IFence
# define IFence_GetDesc(This) (const struct FenceDesc*)IDeviceObject_GetDesc(This)
-# define IFence_GetCompletedValue(This) (This)->pVtbl->Fence.GetCompletedValue((IFence*)(This))
-# define IFence_Reset(This, ...) (This)->pVtbl->Fence.Reset ((IFence*)(This), __VA_ARGS__)
+# define IFence_GetCompletedValue(This) CALL_IFACE_METHOD(Fence, GetCompletedValue, This)
+# define IFence_Reset(This, ...) CALL_IFACE_METHOD(Fence, Reset, This, __VA_ARGS__)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/PipelineState.h b/Graphics/GraphicsEngine/interface/PipelineState.h
index de24d071..bc27c8ac 100644
--- a/Graphics/GraphicsEngine/interface/PipelineState.h
+++ b/Graphics/GraphicsEngine/interface/PipelineState.h
@@ -369,12 +369,12 @@ typedef struct IPipelineState
# define IPipelineState_GetDesc(This) (const struct PipelineStateDesc*)IDeviceObject_GetDesc(This)
-# define IPipelineState_BindStaticResources(This, ...) (This)->pVtbl->PipelineState.BindStaticResources ((IPipelineState*)(This), __VA_ARGS__)
-# define IPipelineState_GetStaticVariableCount(This, ...) (This)->pVtbl->PipelineState.GetStaticVariableCount ((IPipelineState*)(This), __VA_ARGS__)
-# define IPipelineState_GetStaticVariableByName(This, ...) (This)->pVtbl->PipelineState.GetStaticVariableByName ((IPipelineState*)(This), __VA_ARGS__)
-# define IPipelineState_GetStaticVariableByIndex(This, ...) (This)->pVtbl->PipelineState.GetStaticVariableByIndex ((IPipelineState*)(This), __VA_ARGS__)
-# define IPipelineState_CreateShaderResourceBinding(This, ...) (This)->pVtbl->PipelineState.CreateShaderResourceBinding((IPipelineState*)(This), __VA_ARGS__)
-# define IPipelineState_IsCompatibleWith(This, ...) (This)->pVtbl->PipelineState.IsCompatibleWith ((IPipelineState*)(This), __VA_ARGS__)
+# define IPipelineState_BindStaticResources(This, ...) CALL_IFACE_METHOD(PipelineState, BindStaticResources, This, __VA_ARGS__)
+# define IPipelineState_GetStaticVariableCount(This, ...) CALL_IFACE_METHOD(PipelineState, GetStaticVariableCount, This, __VA_ARGS__)
+# define IPipelineState_GetStaticVariableByName(This, ...) CALL_IFACE_METHOD(PipelineState, GetStaticVariableByName, This, __VA_ARGS__)
+# define IPipelineState_GetStaticVariableByIndex(This, ...) CALL_IFACE_METHOD(PipelineState, GetStaticVariableByIndex, This, __VA_ARGS__)
+# define IPipelineState_CreateShaderResourceBinding(This, ...) CALL_IFACE_METHOD(PipelineState, CreateShaderResourceBinding, This, __VA_ARGS__)
+# define IPipelineState_IsCompatibleWith(This, ...) CALL_IFACE_METHOD(PipelineState, IsCompatibleWith, This, __VA_ARGS__)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/Query.h b/Graphics/GraphicsEngine/interface/Query.h
index 4f4cfd98..dea4b71f 100644
--- a/Graphics/GraphicsEngine/interface/Query.h
+++ b/Graphics/GraphicsEngine/interface/Query.h
@@ -239,8 +239,8 @@ typedef struct IQuery
# define IQuery_GetDesc(This) (const struct QueryDesc*)IDeviceObject_GetDesc(This)
-# define IQuery_GetData(This, ...) (This)->pVtbl->Query.GetData ((IQuery*)(This), __VA_ARGS__)
-# define IQuery_Invalidate(This) (This)->pVtbl->Query.Invalidate((IQuery*)(This))
+# define IQuery_GetData(This, ...) CALL_IFACE_METHOD(Query, GetData, This, __VA_ARGS__)
+# define IQuery_Invalidate(This) CALL_IFACE_METHOD(Query, Invalidate, This)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/RenderDevice.h b/Graphics/GraphicsEngine/interface/RenderDevice.h
index 71d0bff3..47720d04 100644
--- a/Graphics/GraphicsEngine/interface/RenderDevice.h
+++ b/Graphics/GraphicsEngine/interface/RenderDevice.h
@@ -256,20 +256,20 @@ typedef struct IRenderDevice
// clang-format off
-# define IRenderDevice_CreateBuffer(This, ...) (This)->pVtbl->RenderDevice.CreateBuffer ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_CreateShader(This, ...) (This)->pVtbl->RenderDevice.CreateShader ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_CreateTexture(This, ...) (This)->pVtbl->RenderDevice.CreateTexture ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_CreateSampler(This, ...) (This)->pVtbl->RenderDevice.CreateSampler ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_CreateResourceMapping(This, ...) (This)->pVtbl->RenderDevice.CreateResourceMapping ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_CreatePipelineState(This, ...) (This)->pVtbl->RenderDevice.CreatePipelineState ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_CreateFence(This, ...) (This)->pVtbl->RenderDevice.CreateFence ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_CreateQuery(This, ...) (This)->pVtbl->RenderDevice.CreateQuery ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_GetDeviceCaps(This) (This)->pVtbl->RenderDevice.GetDeviceCaps ((IRenderDevice*)(This))
-# define IRenderDevice_GetTextureFormatInfo(This, ...) (This)->pVtbl->RenderDevice.GetTextureFormatInfo ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_GetTextureFormatInfoExt(This, ...) (This)->pVtbl->RenderDevice.GetTextureFormatInfoExt((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_ReleaseStaleResources(This, ...) (This)->pVtbl->RenderDevice.ReleaseStaleResources ((IRenderDevice*)(This), __VA_ARGS__)
-# define IRenderDevice_IdleGPU(This) (This)->pVtbl->RenderDevice.IdleGPU ((IRenderDevice*)(This))
-# define IRenderDevice_GetEngineFactory(This) (This)->pVtbl->RenderDevice.GetEngineFactory ((IRenderDevice*)(This))
+# define IRenderDevice_CreateBuffer(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateBuffer, This, __VA_ARGS__)
+# define IRenderDevice_CreateShader(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateShader, This, __VA_ARGS__)
+# define IRenderDevice_CreateTexture(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateTexture, This, __VA_ARGS__)
+# define IRenderDevice_CreateSampler(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateSampler, This, __VA_ARGS__)
+# define IRenderDevice_CreateResourceMapping(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateResourceMapping, This, __VA_ARGS__)
+# define IRenderDevice_CreatePipelineState(This, ...) CALL_IFACE_METHOD(RenderDevice, CreatePipelineState, This, __VA_ARGS__)
+# define IRenderDevice_CreateFence(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateFence, This, __VA_ARGS__)
+# define IRenderDevice_CreateQuery(This, ...) CALL_IFACE_METHOD(RenderDevice, CreateQuery, This, __VA_ARGS__)
+# define IRenderDevice_GetDeviceCaps(This) CALL_IFACE_METHOD(RenderDevice, GetDeviceCaps, This)
+# define IRenderDevice_GetTextureFormatInfo(This, ...) CALL_IFACE_METHOD(RenderDevice, GetTextureFormatInfo, This, __VA_ARGS__)
+# define IRenderDevice_GetTextureFormatInfoExt(This, ...) CALL_IFACE_METHOD(RenderDevice, GetTextureFormatInfoExt,This, __VA_ARGS__)
+# define IRenderDevice_ReleaseStaleResources(This, ...) CALL_IFACE_METHOD(RenderDevice, ReleaseStaleResources, This, __VA_ARGS__)
+# define IRenderDevice_IdleGPU(This) CALL_IFACE_METHOD(RenderDevice, IdleGPU, This)
+# define IRenderDevice_GetEngineFactory(This) CALL_IFACE_METHOD(RenderDevice, GetEngineFactory, This)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/ResourceMapping.h b/Graphics/GraphicsEngine/interface/ResourceMapping.h
index 3078cf13..583f6f1c 100644
--- a/Graphics/GraphicsEngine/interface/ResourceMapping.h
+++ b/Graphics/GraphicsEngine/interface/ResourceMapping.h
@@ -184,11 +184,11 @@ typedef struct IResourceMapping
// clang-format off
-# define IResourceMapping_AddResource(This, ...) (This)->pVtbl->ResourceMapping.AddResource ((IResourceMapping*)(This), __VA_ARGS__)
-# define IResourceMapping_AddResourceArray(This, ...) (This)->pVtbl->ResourceMapping.AddResourceArray ((IResourceMapping*)(This), __VA_ARGS__)
-# define IResourceMapping_RemoveResourceByName(This, ...) (This)->pVtbl->ResourceMapping.RemoveResourceByName((IResourceMapping*)(This), __VA_ARGS__)
-# define IResourceMapping_GetResource(This, ...) (This)->pVtbl->ResourceMapping.GetResource ((IResourceMapping*)(This), __VA_ARGS__)
-# define IResourceMapping_GetSize(This) (This)->pVtbl->ResourceMapping.GetSize ((IResourceMapping*)(This))
+# define IResourceMapping_AddResource(This, ...) CALL_IFACE_METHOD(ResourceMapping, AddResource, This, __VA_ARGS__)
+# define IResourceMapping_AddResourceArray(This, ...) CALL_IFACE_METHOD(ResourceMapping, AddResourceArray, This, __VA_ARGS__)
+# define IResourceMapping_RemoveResourceByName(This, ...) CALL_IFACE_METHOD(ResourceMapping, RemoveResourceByName, This, __VA_ARGS__)
+# define IResourceMapping_GetResource(This, ...) CALL_IFACE_METHOD(ResourceMapping, GetResource, This, __VA_ARGS__)
+# define IResourceMapping_GetSize(This) CALL_IFACE_METHOD(ResourceMapping, GetSize, This)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/Shader.h b/Graphics/GraphicsEngine/interface/Shader.h
index 63c788d9..b4a28c20 100644
--- a/Graphics/GraphicsEngine/interface/Shader.h
+++ b/Graphics/GraphicsEngine/interface/Shader.h
@@ -115,7 +115,7 @@ typedef struct IShaderSourceInputStreamFactory
struct IShaderSourceInputStreamFactoryVtbl* pVtbl;
} IShaderSourceInputStreamFactory;
-# define IShaderSourceInputStreamFactory_CreateInputStream(This, ...) (This)->pVtbl->ShaderSourceInputStreamFactory.CreateInputStream((IShaderSourceInputStreamFactory*)(This), __VA_ARGS__)
+# define IShaderSourceInputStreamFactory_CreateInputStream(This, ...) CALL_IFACE_METHOD(ShaderSourceInputStreamFactory, CreateInputStream, This, __VA_ARGS__)
#endif
@@ -361,8 +361,8 @@ typedef struct IShader
# define IShader_GetDesc(This) (const struct ShaderDesc*)IDeviceObject_GetDesc(This)
-# define IShader_GetResourceCount(This) (This)->pVtbl->Shader.GetResourceCount((IShader*)(This))
-# define IShader_GetResourceDesc(This, ...) (This)->pVtbl->Shader.GetResourceDesc ((IShader*)(This), __VA_ARGS__)
+# define IShader_GetResourceCount(This) CALL_IFACE_METHOD(Shader, GetResourceCount, This)
+# define IShader_GetResourceDesc(This, ...) CALL_IFACE_METHOD(Shader, GetResourceDesc, This, __VA_ARGS__)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/ShaderResourceBinding.h b/Graphics/GraphicsEngine/interface/ShaderResourceBinding.h
index 11889a86..07aee7fb 100644
--- a/Graphics/GraphicsEngine/interface/ShaderResourceBinding.h
+++ b/Graphics/GraphicsEngine/interface/ShaderResourceBinding.h
@@ -147,12 +147,12 @@ typedef struct IShaderResourceBinding
// clang-format off
-# define IShaderResourceBinding_GetPipelineState(This) (This)->pVtbl->ShaderResourceBinding.GetPipelineState ((IShaderResourceBinding*)(This))
-# define IShaderResourceBinding_BindResources(This, ...) (This)->pVtbl->ShaderResourceBinding.BindResources ((IShaderResourceBinding*)(This), __VA_ARGS__)
-# define IShaderResourceBinding_GetVariableByName(This, ...) (This)->pVtbl->ShaderResourceBinding.GetVariableByName ((IShaderResourceBinding*)(This), __VA_ARGS__)
-# define IShaderResourceBinding_GetVariableCount(This, ...) (This)->pVtbl->ShaderResourceBinding.GetVariableCount ((IShaderResourceBinding*)(This), __VA_ARGS__)
-# define IShaderResourceBinding_GetVariableByIndex(This, ...) (This)->pVtbl->ShaderResourceBinding.GetVariableByIndex ((IShaderResourceBinding*)(This), __VA_ARGS__)
-# define IShaderResourceBinding_InitializeStaticResources(This, ...) (This)->pVtbl->ShaderResourceBinding.InitializeStaticResources((IShaderResourceBinding*)(This), __VA_ARGS__)
+# define IShaderResourceBinding_GetPipelineState(This) CALL_IFACE_METHOD(ShaderResourceBinding, GetPipelineState, This)
+# define IShaderResourceBinding_BindResources(This, ...) CALL_IFACE_METHOD(ShaderResourceBinding, BindResources, This, __VA_ARGS__)
+# define IShaderResourceBinding_GetVariableByName(This, ...) CALL_IFACE_METHOD(ShaderResourceBinding, GetVariableByName, This, __VA_ARGS__)
+# define IShaderResourceBinding_GetVariableCount(This, ...) CALL_IFACE_METHOD(ShaderResourceBinding, GetVariableCount, This, __VA_ARGS__)
+# define IShaderResourceBinding_GetVariableByIndex(This, ...) CALL_IFACE_METHOD(ShaderResourceBinding, GetVariableByIndex, This, __VA_ARGS__)
+# define IShaderResourceBinding_InitializeStaticResources(This, ...) CALL_IFACE_METHOD(ShaderResourceBinding, InitializeStaticResources, This, __VA_ARGS__)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/ShaderResourceVariable.h b/Graphics/GraphicsEngine/interface/ShaderResourceVariable.h
index 889ecce0..2f86261e 100644
--- a/Graphics/GraphicsEngine/interface/ShaderResourceVariable.h
+++ b/Graphics/GraphicsEngine/interface/ShaderResourceVariable.h
@@ -173,12 +173,12 @@ typedef struct IShaderResourceVariable
// clang-format off
-# define IShaderResourceVariable_Set(This, ...) (This)->pVtbl->ShaderResourceVariable.Set ((IShaderResourceVariable*)(This), __VA_ARGS__)
-# define IShaderResourceVariable_SetArray(This, ...) (This)->pVtbl->ShaderResourceVariable.SetArray ((IShaderResourceVariable*)(This), __VA_ARGS__)
-# define IShaderResourceVariable_GetType(This) (This)->pVtbl->ShaderResourceVariable.GetType ((IShaderResourceVariable*)(This))
-# define IShaderResourceVariable_GetResourceDesc(This, ...) (This)->pVtbl->ShaderResourceVariable.GetResourceDesc((IShaderResourceVariable*)(This), __VA_ARGS__)
-# define IShaderResourceVariable_GetIndex(This) (This)->pVtbl->ShaderResourceVariable.GetIndex ((IShaderResourceVariable*)(This))
-# define IShaderResourceVariable_IsBound(This, ...) (This)->pVtbl->ShaderResourceVariable.IsBound ((IShaderResourceVariable*)(This), __VA_ARGS__)
+# define IShaderResourceVariable_Set(This, ...) CALL_IFACE_METHOD(ShaderResourceVariable, Set, This, __VA_ARGS__)
+# define IShaderResourceVariable_SetArray(This, ...) CALL_IFACE_METHOD(ShaderResourceVariable, SetArray, This, __VA_ARGS__)
+# define IShaderResourceVariable_GetType(This) CALL_IFACE_METHOD(ShaderResourceVariable, GetType, This)
+# define IShaderResourceVariable_GetResourceDesc(This, ...) CALL_IFACE_METHOD(ShaderResourceVariable, GetResourceDesc, This, __VA_ARGS__)
+# define IShaderResourceVariable_GetIndex(This) CALL_IFACE_METHOD(ShaderResourceVariable, GetIndex, This)
+# define IShaderResourceVariable_IsBound(This, ...) CALL_IFACE_METHOD(ShaderResourceVariable, IsBound, This, __VA_ARGS__)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/SwapChain.h b/Graphics/GraphicsEngine/interface/SwapChain.h
index c73800d3..9ea831bd 100644
--- a/Graphics/GraphicsEngine/interface/SwapChain.h
+++ b/Graphics/GraphicsEngine/interface/SwapChain.h
@@ -114,13 +114,13 @@ typedef struct ISwapChain
// clang-format off
-# define ISwapChain_Present(This, ...) (This)->pVtbl->SwapChain.Present ((ISwapChain*)(This), __VA_ARGS__)
-# define ISwapChain_GetDesc(This) (This)->pVtbl->SwapChain.GetDesc ((ISwapChain*)(This))
-# define ISwapChain_Resize(This, ...) (This)->pVtbl->SwapChain.Resize ((ISwapChain*)(This), __VA_ARGS__)
-# define ISwapChain_SetFullscreenMode(This, ...) (This)->pVtbl->SwapChain.SetFullscreenMode ((ISwapChain*)(This), __VA_ARGS__)
-# define ISwapChain_SetWindowedMode(This) (This)->pVtbl->SwapChain.SetWindowedMode ((ISwapChain*)(This))
-# define ISwapChain_GetCurrentBackBufferRTV(This) (This)->pVtbl->SwapChain.GetCurrentBackBufferRTV((ISwapChain*)(This))
-# define ISwapChain_GetDepthBufferDSV(This) (This)->pVtbl->SwapChain.GetDepthBufferDSV ((ISwapChain*)(This))
+# define ISwapChain_Present(This, ...) CALL_IFACE_METHOD(SwapChain, Present, This, __VA_ARGS__)
+# define ISwapChain_GetDesc(This) CALL_IFACE_METHOD(SwapChain, GetDesc, This)
+# define ISwapChain_Resize(This, ...) CALL_IFACE_METHOD(SwapChain, Resize, This, __VA_ARGS__)
+# define ISwapChain_SetFullscreenMode(This, ...) CALL_IFACE_METHOD(SwapChain, SetFullscreenMode, This, __VA_ARGS__)
+# define ISwapChain_SetWindowedMode(This) CALL_IFACE_METHOD(SwapChain, SetWindowedMode, This)
+# define ISwapChain_GetCurrentBackBufferRTV(This) CALL_IFACE_METHOD(SwapChain, GetCurrentBackBufferRTV, This)
+# define ISwapChain_GetDepthBufferDSV(This) CALL_IFACE_METHOD(SwapChain, GetDepthBufferDSV, This)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/Texture.h b/Graphics/GraphicsEngine/interface/Texture.h
index 261664bf..c58da40b 100644
--- a/Graphics/GraphicsEngine/interface/Texture.h
+++ b/Graphics/GraphicsEngine/interface/Texture.h
@@ -398,11 +398,11 @@ typedef struct ITexture
# define ITexture_GetDesc(This) (const struct TextureDesc*)IDeviceObject_GetDesc(This)
-# define ITexture_CreateView(This, ...) (This)->pVtbl->Texture.CreateView ((ITexture*)(This), __VA_ARGS__)
-# define ITexture_GetDefaultView(This, ...) (This)->pVtbl->Texture.GetDefaultView ((ITexture*)(This), __VA_ARGS__)
-# define ITexture_GetNativeHandle(This) (This)->pVtbl->Texture.GetNativeHandle((ITexture*)(This))
-# define ITexture_SetState(This, ...) (This)->pVtbl->Texture.SetState ((ITexture*)(This), __VA_ARGS__)
-# define ITexture_GetState(This) (This)->pVtbl->Texture.GetState ((ITexture*)(This))
+# define ITexture_CreateView(This, ...) CALL_IFACE_METHOD(Texture, CreateView, This, __VA_ARGS__)
+# define ITexture_GetDefaultView(This, ...) CALL_IFACE_METHOD(Texture, GetDefaultView, This, __VA_ARGS__)
+# define ITexture_GetNativeHandle(This) CALL_IFACE_METHOD(Texture, GetNativeHandle, This)
+# define ITexture_SetState(This, ...) CALL_IFACE_METHOD(Texture, SetState, This, __VA_ARGS__)
+# define ITexture_GetState(This) CALL_IFACE_METHOD(Texture, GetState, This)
// clang-format on
diff --git a/Graphics/GraphicsEngine/interface/TextureView.h b/Graphics/GraphicsEngine/interface/TextureView.h
index 21e8b6f8..44af2485 100644
--- a/Graphics/GraphicsEngine/interface/TextureView.h
+++ b/Graphics/GraphicsEngine/interface/TextureView.h
@@ -246,9 +246,9 @@ typedef struct ITextureView
// clang-format off
-# define ITextureView_SetSampler(This, ...) (This)->pVtbl->TextureView.SetSampler((ITextureView*)(This), __VA_ARGS__)
-# define ITextureView_GetSampler(This) (This)->pVtbl->TextureView.GetSampler((ITextureView*)(This))
-# define ITextureView_GetTexture(This) (This)->pVtbl->TextureView.GetTexture((ITextureView*)(This))
+# define ITextureView_SetSampler(This, ...) CALL_IFACE_METHOD(TextureView, SetSampler, This, __VA_ARGS__)
+# define ITextureView_GetSampler(This) CALL_IFACE_METHOD(TextureView, GetSampler, This)
+# define ITextureView_GetTexture(This) CALL_IFACE_METHOD(TextureView, GetTexture, This)
// clang-format on