From 5000d27d993d9ac33ef80482eb44235298d5177e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 22 Mar 2018 18:08:19 -0400 Subject: Tidy up of Renderer (#452) * Fixed some small typos in api-users-guide.md * Fix some small typos in slang-test/main.cpp, render-test/render-d3d11.cpp * Remove exit() calls from test code. Added Slang::Result, which works in the same way as COM HRESULT. * FIx bug introduced when moving to Slang::Result - handling E_INVALIDARG on Dx11. * Fix the testing of feature levels on Dx11 renderer. * First attempt at README.md for slang-test. * Tidied up the slang-test README.md file. * Fix some small typos in tools/slang-test/main.cpp * Fix spaces -> tabs problems. Fix some small types. * Refactor Renderer implementations such that: * Class definition does not contain long implementation/s * Removed unused globals * Ordered implementation after class definition * Made renderer specific classes child classes, and use Impl postfix to differentiate * Converted tabs into spaces * First pass at Slang::ComPtr. Added slang-defines.h which sets up some fairly commonly used defines such as SLANG_FORCE_INLINE, compiler detection, os detection, and some other cross platform features. * * Fixed bug in vk renderer - where features structure not initialized on hkCreateDevice * Make member variables in Renderer implementations use prefix * Updated test README.md to document that free parameter can control what test is run * * changed setClearColor to take an array of 4 floats to make API clearer on usage * mix of type usage style - defaulted to more conventional style * * Fixed swapWith * Use SLANG_FORCE_INLINE * Don't bother initializing List data when type is POD * Added convenience macro for Result handling SLANG_RETURN_NULL_ON_ERROR --- tools/render-test/render.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tools/render-test/render.h') diff --git a/tools/render-test/render.h b/tools/render-test/render.h index bc63caa77..08d364b05 100644 --- a/tools/render-test/render.h +++ b/tools/render-test/render.h @@ -96,17 +96,17 @@ class Renderer public: virtual SlangResult initialize(void* inWindowHandle) = 0; - virtual void setClearColor(float const* color) = 0; + virtual void setClearColor(const float color[4]) = 0; virtual void clearFrame() = 0; virtual void presentFrame() = 0; - virtual SlangResult captureScreenShot(char const* outputPath) = 0; - virtual void serializeOutput(BindingState * state, char const* outputPath) = 0; - virtual Buffer* createBuffer(BufferDesc const& desc) = 0; + virtual SlangResult captureScreenShot(const char* outputPath) = 0; + virtual void serializeOutput(BindingState* state, const char* outputPath) = 0; + virtual Buffer* createBuffer(const BufferDesc& desc) = 0; - virtual InputLayout* createInputLayout(InputElementDesc const* inputElements, UInt inputElementCount) = 0; - virtual BindingState* createBindingState(const ShaderInputLayout & shaderInput) = 0; + virtual InputLayout* createInputLayout(const InputElementDesc* inputElements, UInt inputElementCount) = 0; + virtual BindingState* createBindingState(const ShaderInputLayout& shaderInput) = 0; virtual ShaderCompiler* getShaderCompiler() = 0; virtual void* map(Buffer* buffer, MapFlavor flavor) = 0; @@ -114,14 +114,14 @@ public: virtual void setInputLayout(InputLayout* inputLayout) = 0; virtual void setPrimitiveTopology(PrimitiveTopology topology) = 0; - virtual void setBindingState(BindingState * state) = 0; - virtual void setVertexBuffers(UInt startSlot, UInt slotCount, Buffer* const* buffers, UInt const* strides, UInt const* offsets) = 0; + virtual void setBindingState(BindingState* state) = 0; + virtual void setVertexBuffers(UInt startSlot, UInt slotCount, Buffer*const* buffers, const UInt* strides, const UInt* offsets) = 0; inline void setVertexBuffer(UInt slot, Buffer* buffer, UInt stride, UInt offset = 0); virtual void setShaderProgram(ShaderProgram* program) = 0; - virtual void setConstantBuffers(UInt startSlot, UInt slotCount, Buffer* const* buffers, UInt const* offsets) = 0; + virtual void setConstantBuffers(UInt startSlot, UInt slotCount, Buffer*const* buffers, const UInt* offsets) = 0; inline void setConstantBuffer(UInt slot, Buffer* buffer, UInt offset = 0); virtual void draw(UInt vertexCount, UInt startVertex = 0) = 0; -- cgit v1.2.3