From 875fbd7069983334921059fdb4dead7e46a86ca8 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 25 Jan 2020 22:52:53 -0800 Subject: Fixed Sampler c interface; added test. Also fixed issue in shader C interface --- Graphics/GraphicsEngine/interface/Sampler.h | 15 ++++++++++----- Graphics/GraphicsEngine/interface/Shader.h | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/interface/Sampler.h b/Graphics/GraphicsEngine/interface/Sampler.h index 4a141548..9493106e 100644 --- a/Graphics/GraphicsEngine/interface/Sampler.h +++ b/Graphics/GraphicsEngine/interface/Sampler.h @@ -191,18 +191,23 @@ public: struct ISampler; -//struct ISamplerVtbl +//struct ISamplerMethods //{ //}; +struct ISamplerVtbl +{ + struct IObjectMethods Object; + struct IDeviceObjectMethods DeviceObject; + //struct ISamplerMethods Sampler; +}; + struct ISampler { - struct IObjectVtbl* pObjectVtbl; - struct IDeviceObjectVtbl* pDeviceObjectVtbl; - //struct ISampler* pSamplerVtbl; + struct ISamplerVtbl* pVtbl; }; -# define ISampler_GetDesc(This) (const struct SamplerDesc*)(This)->pDeviceObjectVtbl->GetDesc(This) +# define ISampler_GetDesc(This) (const struct SamplerDesc*)IDeviceObject_GetDesc(This) #endif diff --git a/Graphics/GraphicsEngine/interface/Shader.h b/Graphics/GraphicsEngine/interface/Shader.h index 876fe897..e472852f 100644 --- a/Graphics/GraphicsEngine/interface/Shader.h +++ b/Graphics/GraphicsEngine/interface/Shader.h @@ -313,8 +313,8 @@ struct IShader; struct IShaderMethods { - Uint32 (*GetResourceCount)(struct IShader*); - struct ShaderResourceDesc (*GetResourceDesc) (struct IShader*, Uint32 Index); + Uint32 (*GetResourceCount)(struct IShader*); + void (*GetResourceDesc) (struct IShader*, Uint32 Index, struct ShaderResourceDesc* ResourceDesc); }; // clang-format on -- cgit v1.2.3