summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-01-26 05:50:07 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-01-26 05:50:07 +0000
commit9908786e9c4662683a2fca06a3299332497d812f (patch)
tree82301317dfc9d827d2112049a8939dde198c2de6 /Graphics/GraphicsEngine
parentFixed SRB c interface; added test. (diff)
downloadDiligentCore-9908786e9c4662683a2fca06a3299332497d812f.tar.gz
DiligentCore-9908786e9c4662683a2fca06a3299332497d812f.zip
Updated shader C interface; added test.
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/Shader.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngine/interface/Shader.h b/Graphics/GraphicsEngine/interface/Shader.h
index d3e29e57..7cfa7a79 100644
--- a/Graphics/GraphicsEngine/interface/Shader.h
+++ b/Graphics/GraphicsEngine/interface/Shader.h
@@ -309,23 +309,36 @@ public:
struct IShader;
+// clang-format off
+
+struct IShaderMethods
+{
+ Uint32 (*GetResourceCount)(struct IShader*);
+ struct ShaderResourceDesc (*GetResource) (struct IShader*, Uint32 Index);
+};
+
+// clang-format on
+
struct IShaderVtbl
{
- Uint32 (*GetResourceCount)();
- struct ShaderResourceDesc (*GetResource)(Uint32 Index);
+ struct IObjectMethods Object;
+ struct IDeviceObjectMethods DeviceObject;
+ struct IShaderMethods Shader;
};
struct IShader
{
- struct IObjectVtbl* pObjectVtbl;
- struct IDeviceObjectVtbl* pDeviceObjectVtbl;
- struct IShader* pShaderVtbl;
+ struct IShaderVtbl* pVtbl;
};
-# define IShader_GetDesc(This) (const struct ShaderDesc*)(This)->pDeviceObjectVtbl->GetDesc(This)
+// clang-format off
+
+# define IShader_GetDesc(This) (const struct ShaderDesc*)IDeviceObject_GetDesc(This)
-# define ITexture_GetResourceCount(This) (This)->pShaderVtbl->GetResourceCount(This)
-# define ITexture_GetResource(This, ...) (This)->pShaderVtbl->GetResource(This, __VA_ARGS__)
+# define IShader_GetResourceCount(This) (This)->pVtbl->Shader.GetResourceCount((struct IShader*)(This))
+# define IShader_GetResource(This, ...) (This)->pVtbl->Shader.GetResource ((struct IShader*)(This), __VA_ARGS__)
+
+// clang-format on
#endif