diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-02-15 07:22:18 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-02-15 07:22:18 +0000 |
| commit | 5c9450e283d0889987e39ebd13b5a29c110d9e88 (patch) | |
| tree | fc8c9eb710106d57fe0f18816da9948d10ad7832 /Tests/TestApp/include | |
| parent | Fixed formatting of cmake files + some minor updates (diff) | |
| download | DiligentEngine-5c9450e283d0889987e39ebd13b5a29c110d9e88.tar.gz DiligentEngine-5c9450e283d0889987e39ebd13b5a29c110d9e88.zip | |
Added tests
Diffstat (limited to 'Tests/TestApp/include')
28 files changed, 1172 insertions, 0 deletions
diff --git a/Tests/TestApp/include/AllocatorTest.h b/Tests/TestApp/include/AllocatorTest.h new file mode 100644 index 0000000..c6854ea --- /dev/null +++ b/Tests/TestApp/include/AllocatorTest.h @@ -0,0 +1,30 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class AllocatorTest +{ +public: + AllocatorTest(); +}; diff --git a/Tests/TestApp/include/MTResourceCreationTest.h b/Tests/TestApp/include/MTResourceCreationTest.h new file mode 100644 index 0000000..8e3d979 --- /dev/null +++ b/Tests/TestApp/include/MTResourceCreationTest.h @@ -0,0 +1,57 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include <thread> +#include <mutex> +#include <atomic> +#include <condition_variable> + +class MTResourceCreationTest +{ +public: + MTResourceCreationTest(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext, Diligent::Uint32 NumThreads); + void StartThreads(); + void StopThreads(); + +private: + void ThreadWorkerFunc(bool bIsMasterThread); + void WaitForThreadStart(int VarId); + void StartThreads(int VarId); + void WaitThreads(int VarId); + + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pContext; + std::vector<std::thread> m_Threads; + volatile bool m_bStopThreadsFlag = false; + volatile bool m_bStopThreadsFlagInternal = false; + + std::mutex m_Mtx; + std::condition_variable m_CondVar; + bool m_bReleaseThread[2] = {false, false}; + std::atomic<int> m_NumThreadsCompleted; + std::atomic<int> m_NumBuffersCreated; + std::atomic<int> m_NumTexturesCreated; + std::atomic<int> m_NumPSOCreated; +}; diff --git a/Tests/TestApp/include/RenderScriptTest.h b/Tests/TestApp/include/RenderScriptTest.h new file mode 100644 index 0000000..76aeb2d --- /dev/null +++ b/Tests/TestApp/include/RenderScriptTest.h @@ -0,0 +1,30 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class RenderScriptTest +{ +public: + RenderScriptTest( Diligent::IRenderDevice *pRenderDevice, Diligent::IDeviceContext *pContext ); +}; diff --git a/Tests/TestApp/include/ShaderConverterTest.h b/Tests/TestApp/include/ShaderConverterTest.h new file mode 100644 index 0000000..d064201 --- /dev/null +++ b/Tests/TestApp/include/ShaderConverterTest.h @@ -0,0 +1,30 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class ShaderConverterTest +{ +public: + ShaderConverterTest( Diligent::IRenderDevice *pRenderDevice, Diligent::IDeviceContext *pContext ); +}; diff --git a/Tests/TestApp/include/SmartPointerTest.h b/Tests/TestApp/include/SmartPointerTest.h new file mode 100644 index 0000000..a9e6b6d --- /dev/null +++ b/Tests/TestApp/include/SmartPointerTest.h @@ -0,0 +1,84 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "RenderDevice.h" +#include "RefCntAutoPtr.h" +#include "RefCountedObjectImpl.h" +#include <mutex> +#include <condition_variable> +#include <atomic> + +class SmartPointerTest +{ +public: + class Object : public Diligent::RefCountedObject<Diligent::IObject> + { + public: + virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, Diligent::IObject **ppInterface ) + { + *ppInterface = nullptr; + if(IID==Diligent::IID_Unknown) + { + *ppInterface = this; + (*ppInterface)->AddRef(); + } + } + + Object( Diligent::IReferenceCounters *pRefCounters) : + RefCountedObject<Diligent::IObject>(pRefCounters), + m_Value(0) + { + } + + ~Object(){} + int m_Value; + }; + + typedef Diligent::RefCntAutoPtr<Object> SmartPtr; + typedef Diligent::RefCntWeakPtr<Object> WeakPtr; + + void CreateObject(Object **ppObj); + SmartPointerTest(); + ~SmartPointerTest(); + + std::vector<std::thread> m_Threads; + static void WorkerThreadFunc(SmartPointerTest *This, size_t ThreadNum); + Object *m_pSharedObject; + void StartConcurrencyTest(); + void RunConcurrencyTest(); + void WaitForThreadStart(int VarId); + void StartThreadsAndWait(int VarId, size_t NumThreads); + std::atomic<int> m_NumThreadsCompleted; + bool m_bStopThreads = false; + int m_NumTestsPerformed = 0; +#ifdef _DEBUG + static const int NumThreadInterations = 20; +#else + static const int NumThreadInterations = 50; +#endif + std::mutex m_Mtx; + std::condition_variable m_CondVar; + bool m_bThreadStart[2]; +}; diff --git a/Tests/TestApp/include/TestApp.h b/Tests/TestApp/include/TestApp.h new file mode 100644 index 0000000..931007b --- /dev/null +++ b/Tests/TestApp/include/TestApp.h @@ -0,0 +1,93 @@ +/* Copyright 2015-2018 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include <vector> + +#include "NativeAppBase.h" +#include "RefCntAutoPtr.h" +#include "RenderDevice.h" +#include "DeviceContext.h" +#include "SwapChain.h" + +#include "TestDrawCommands.h" +#include "TestBufferAccess.h" +#include "TestTextureCreation.h" +#include "TestSamplerCreation.h" +#include "TestTexturing.h" +#include "ScriptParser.h" +#include "TestComputeShaders.h" +#include "Timer.h" +#include "TestRenderTarget.h" +#include "MTResourceCreationTest.h" +#include "TestShaderResArrays.h" +#include "SmartPointerTest.h" +#include "TestGeometryShader.h" +#include "TestTessellation.h" + +class TestApp : public NativeAppBase +{ +public: + TestApp(); + ~TestApp(); + virtual void ProcessCommandLine(const char *CmdLine)override final; + virtual const char* GetAppTitle()const override final { return m_AppTitle.c_str(); } + virtual void Update(double CurrTime, double ElapsedTime)override final; + virtual void WindowResize(int width, int height)override final; + virtual void Render()override; + virtual void Present()override; + +protected: + void InitializeDiligentEngine( +#if PLATFORM_LINUX + void *display, +#endif + void *NativeWindowHandle + ); + void InitializeRenderers(); + + Diligent::DeviceType m_DeviceType = Diligent::DeviceType::Undefined; + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pImmediateContext; + std::vector<Diligent::RefCntAutoPtr<Diligent::IDeviceContext> > m_pDeferredContexts; + Diligent::RefCntAutoPtr<Diligent::ISwapChain> m_pSwapChain; + std::string m_AppTitle; + + std::unique_ptr<TestDrawCommands> m_pTestDrawCommands; + std::unique_ptr<TestBufferAccess> m_pTestBufferAccess; + std::unique_ptr<TestTexturing> m_pTestTexturing[16]; + std::unique_ptr<TestComputeShaders> m_pTestCS; + std::unique_ptr<TestRenderTarget> m_pTestRT; + std::unique_ptr<MTResourceCreationTest> m_pMTResCreationTest; + std::unique_ptr<TestShaderResArrays> m_pTestShaderResArrays; + TestGeometryShader m_TestGS; + TestTessellation m_TestTessellation; + + Diligent::RefCntAutoPtr<Diligent::IBuffer> m_pInstBuff, m_pInstBuff2, m_pUniformBuff, m_pUniformBuff2, m_pUniformBuff3, m_pUniformBuff4; + Diligent::RefCntAutoPtr<Diligent::ITexture> m_pTestTex; + Diligent::RefCntAutoPtr<Diligent::ScriptParser> m_pRenderScript; + + SmartPointerTest m_SmartPointerTest; + double m_CurrTime = 0; +}; diff --git a/Tests/TestApp/include/TestBlendState.h b/Tests/TestApp/include/TestBlendState.h new file mode 100644 index 0000000..9c7d411 --- /dev/null +++ b/Tests/TestApp/include/TestBlendState.h @@ -0,0 +1,36 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "TestPipelineStateBase.h" + +class TestBlendState : public TestPipelineStateBase +{ +public: + TestBlendState( Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext ); + +private: + void CreateTestBS( Diligent::BlendStateDesc &RSDesc ); + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; +}; diff --git a/Tests/TestApp/include/TestBufferAccess.h b/Tests/TestApp/include/TestBufferAccess.h new file mode 100644 index 0000000..c4bf038 --- /dev/null +++ b/Tests/TestApp/include/TestBufferAccess.h @@ -0,0 +1,47 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestBufferAccess +{ +public: + static const int TriGridSize = 16; + TestBufferAccess(); + + void Init( Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ); + void Draw(float fTime); + +private: + void Define2DVertex(std::vector<float> &VertexData, float fX, float fY, float fR, float fG, float fB); + + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pRenderDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + + static const int NumRows = 5; + static const int NumInstances = 3; + + Diligent::RefCntAutoPtr<Diligent::IPipelineState> m_pPSO; + Diligent::RefCntAutoPtr<Diligent::IBuffer> m_pVertexBuff, m_pInstBuff[7]; + float m_fXExtent, m_fYExtent; +};
\ No newline at end of file diff --git a/Tests/TestApp/include/TestBufferCreation.h b/Tests/TestApp/include/TestBufferCreation.h new file mode 100644 index 0000000..b36d101 --- /dev/null +++ b/Tests/TestApp/include/TestBufferCreation.h @@ -0,0 +1,31 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + + +class TestBufferCreation +{ +public: + TestBufferCreation(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext); +}; diff --git a/Tests/TestApp/include/TestComputeShaders.h b/Tests/TestApp/include/TestComputeShaders.h new file mode 100644 index 0000000..7042d65 --- /dev/null +++ b/Tests/TestApp/include/TestComputeShaders.h @@ -0,0 +1,40 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "ScriptParser.h" + +class TestComputeShaders +{ +public: + TestComputeShaders(); + + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext); + void Draw(); + +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pRenderDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + Diligent::RefCntAutoPtr<Diligent::ScriptParser> m_pRenderScript; +}; diff --git a/Tests/TestApp/include/TestCopyTexData.h b/Tests/TestApp/include/TestCopyTexData.h new file mode 100644 index 0000000..5fa57ae --- /dev/null +++ b/Tests/TestApp/include/TestCopyTexData.h @@ -0,0 +1,37 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestCopyTexData +{ +public: + TestCopyTexData(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext); + +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pContext; + void Test2DTexture( Diligent::TEXTURE_FORMAT Format ); + void Test2DTexArray( Diligent::TEXTURE_FORMAT Format ); + void Test3DTexture( Diligent::TEXTURE_FORMAT Format ); +}; diff --git a/Tests/TestApp/include/TestCreateObjFromNativeRes.h b/Tests/TestApp/include/TestCreateObjFromNativeRes.h new file mode 100644 index 0000000..a0b1e8e --- /dev/null +++ b/Tests/TestApp/include/TestCreateObjFromNativeRes.h @@ -0,0 +1,32 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestCreateObjFromNativeRes +{ +public: + virtual ~TestCreateObjFromNativeRes() {} + virtual void CreateTexture(Diligent::ITexture *pTexture) = 0; + virtual void CreateBuffer(Diligent::IBuffer *pBuffer) = 0; +}; diff --git a/Tests/TestApp/include/TestCreateObjFromNativeResD3D11.h b/Tests/TestApp/include/TestCreateObjFromNativeResD3D11.h new file mode 100644 index 0000000..925cf5c --- /dev/null +++ b/Tests/TestApp/include/TestCreateObjFromNativeResD3D11.h @@ -0,0 +1,39 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "TestCreateObjFromNativeRes.h" +class TestCreateObjFromNativeResD3D11 : public TestCreateObjFromNativeRes +{ +public: + TestCreateObjFromNativeResD3D11(Diligent::IRenderDevice *pDevice) : + m_pDevice(pDevice) + {} + + virtual void CreateTexture(Diligent::ITexture *pTexture)override final; + virtual void CreateBuffer(Diligent::IBuffer *pBuffer)override final; + +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pDevice; +}; diff --git a/Tests/TestApp/include/TestCreateObjFromNativeResD3D12.h b/Tests/TestApp/include/TestCreateObjFromNativeResD3D12.h new file mode 100644 index 0000000..4999656 --- /dev/null +++ b/Tests/TestApp/include/TestCreateObjFromNativeResD3D12.h @@ -0,0 +1,39 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "TestCreateObjFromNativeRes.h" +class TestCreateObjFromNativeResD3D12 : public TestCreateObjFromNativeRes +{ +public: + TestCreateObjFromNativeResD3D12(Diligent::IRenderDevice *pDevice) : + m_pDevice(pDevice) + {} + + virtual void CreateTexture(Diligent::ITexture *pTexture)override final; + virtual void CreateBuffer(Diligent::IBuffer *pBuffer)override final; + +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pDevice; +}; diff --git a/Tests/TestApp/include/TestCreateObjFromNativeResGL.h b/Tests/TestApp/include/TestCreateObjFromNativeResGL.h new file mode 100644 index 0000000..ae4d5b1 --- /dev/null +++ b/Tests/TestApp/include/TestCreateObjFromNativeResGL.h @@ -0,0 +1,39 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "TestCreateObjFromNativeRes.h" +class TestCreateObjFromNativeResGL : public TestCreateObjFromNativeRes +{ +public: + TestCreateObjFromNativeResGL(Diligent::IRenderDevice *pDevice) : + m_pDevice(pDevice) + {} + + virtual void CreateTexture(Diligent::ITexture *pTexture)override final; + virtual void CreateBuffer(Diligent::IBuffer *pBuffer)override final; + +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pDevice; +}; diff --git a/Tests/TestApp/include/TestDepthStencilState.h b/Tests/TestApp/include/TestDepthStencilState.h new file mode 100644 index 0000000..c08ce30 --- /dev/null +++ b/Tests/TestApp/include/TestDepthStencilState.h @@ -0,0 +1,35 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "TestPipelineStateBase.h" +class TestDepthStencilState : public TestPipelineStateBase +{ +public: + TestDepthStencilState( Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext ); + +private: + void CreateTestDSS( Diligent::DepthStencilStateDesc &DSSDesc ); + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; +};
\ No newline at end of file diff --git a/Tests/TestApp/include/TestDrawCommands.h b/Tests/TestApp/include/TestDrawCommands.h new file mode 100644 index 0000000..3faaeea --- /dev/null +++ b/Tests/TestApp/include/TestDrawCommands.h @@ -0,0 +1,43 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestDrawCommands +{ +public: + static const int TriGridSize = 16; + + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent); + void Draw(); + +private: + void Define2DVertex(std::vector<float> &VertexData, float fX, float fY, float fR, float fG, float fB); + + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pRenderDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + + Diligent::RefCntAutoPtr<Diligent::IPipelineState> m_pPSO, m_pPSOInst; + Diligent::RefCntAutoPtr<Diligent::IBuffer> m_pVertexBuff, m_pVertexBuff2, m_pIndexBuff, m_pInstanceData, m_pIndirectDrawArgs, m_pIndexedIndirectDrawArgs; + Diligent::RefCntAutoPtr<Diligent::IResourceMapping> m_pResMapping; +}; diff --git a/Tests/TestApp/include/TestGeometryShader.h b/Tests/TestApp/include/TestGeometryShader.h new file mode 100644 index 0000000..65d7151 --- /dev/null +++ b/Tests/TestApp/include/TestGeometryShader.h @@ -0,0 +1,35 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestGeometryShader +{ +public: + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext); + void Draw(); + +private: + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + Diligent::RefCntAutoPtr<Diligent::IPipelineState> m_pPSO; +}; diff --git a/Tests/TestApp/include/TestPipelineStateBase.h b/Tests/TestApp/include/TestPipelineStateBase.h new file mode 100644 index 0000000..177d595 --- /dev/null +++ b/Tests/TestApp/include/TestPipelineStateBase.h @@ -0,0 +1,37 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestPipelineStateBase +{ +public: + TestPipelineStateBase( Diligent::IRenderDevice *pDevice ); + +protected: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pDevice; + Diligent::RefCntAutoPtr<Diligent::IShader> m_pTrivialVS; + Diligent::RefCntAutoPtr<Diligent::IShader> m_pTrivialPS; + + Diligent::PipelineStateDesc m_PSODesc; +}; diff --git a/Tests/TestApp/include/TestRasterizerState.h b/Tests/TestApp/include/TestRasterizerState.h new file mode 100644 index 0000000..db6c268 --- /dev/null +++ b/Tests/TestApp/include/TestRasterizerState.h @@ -0,0 +1,35 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "TestPipelineStateBase.h" +class TestRasterizerState : public TestPipelineStateBase +{ +public: + TestRasterizerState( Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext ); + +private: + void CreateTestRS(); + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; +}; diff --git a/Tests/TestApp/include/TestRenderTarget.h b/Tests/TestApp/include/TestRenderTarget.h new file mode 100644 index 0000000..dde43c3 --- /dev/null +++ b/Tests/TestApp/include/TestRenderTarget.h @@ -0,0 +1,41 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "ScriptParser.h" + +class TestRenderTarget +{ +public: + TestRenderTarget(); + + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent); + void Draw(); + +private: + + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pRenderDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + Diligent::RefCntAutoPtr<Diligent::ScriptParser> m_pRenderScript; +}; diff --git a/Tests/TestApp/include/TestSamplerCreation.h b/Tests/TestApp/include/TestSamplerCreation.h new file mode 100644 index 0000000..c6a6ff9 --- /dev/null +++ b/Tests/TestApp/include/TestSamplerCreation.h @@ -0,0 +1,34 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestSamplerCreation +{ +public: + TestSamplerCreation(Diligent::IRenderDevice *pDevice); + +private: + //void CreateSamplerTexture(RESOURCE_DIMENSION Type, Uint32 BindFlags, Uint32 SampleCount); + Diligent::IRenderDevice *m_pDevice; +}; diff --git a/Tests/TestApp/include/TestShaderResArrays.h b/Tests/TestApp/include/TestShaderResArrays.h new file mode 100644 index 0000000..9ba0c7d --- /dev/null +++ b/Tests/TestApp/include/TestShaderResArrays.h @@ -0,0 +1,40 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestShaderResArrays +{ +public: + TestShaderResArrays(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, bool bUseOpenGL, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent); + + void Draw(); + +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pRenderDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + Diligent::RefCntAutoPtr<Diligent::IPipelineState> m_pPSO; + Diligent::RefCntAutoPtr<Diligent::IShaderResourceBinding> m_pSRB; + Diligent::RefCntAutoPtr<Diligent::IBuffer> m_pVertexBuff; + Diligent::RefCntAutoPtr<Diligent::ITexture> m_pTextures[8]; +}; diff --git a/Tests/TestApp/include/TestTessellation.h b/Tests/TestApp/include/TestTessellation.h new file mode 100644 index 0000000..baa3456 --- /dev/null +++ b/Tests/TestApp/include/TestTessellation.h @@ -0,0 +1,35 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestTessellation +{ +public: + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext); + void Draw(); + +private: + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + Diligent::RefCntAutoPtr<Diligent::IPipelineState> m_pQuadPSO, m_pTriPSO; +}; diff --git a/Tests/TestApp/include/TestTextureCreation.h b/Tests/TestApp/include/TestTextureCreation.h new file mode 100644 index 0000000..20b44c3 --- /dev/null +++ b/Tests/TestApp/include/TestTextureCreation.h @@ -0,0 +1,38 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +const bool bIsGL43 = false; + +class TestTextureCreation +{ +public: + TestTextureCreation(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext); +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pDevice; + void TestTextureFormatAttribs(); + void CheckFormatSize( Diligent::TEXTURE_FORMAT *begin, Diligent::TEXTURE_FORMAT *end, Diligent::Uint32 RefSize ); + void CheckNumComponents( Diligent::TEXTURE_FORMAT *begin, Diligent::TEXTURE_FORMAT *end, Diligent::Uint32 RefComponents ); + void CheckComponentType( Diligent::TEXTURE_FORMAT *begin, Diligent::TEXTURE_FORMAT *end, Diligent::COMPONENT_TYPE RefType ); +}; diff --git a/Tests/TestApp/include/TestTexturing.h b/Tests/TestApp/include/TestTexturing.h new file mode 100644 index 0000000..8649674 --- /dev/null +++ b/Tests/TestApp/include/TestTexturing.h @@ -0,0 +1,48 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +class TestTexturing +{ +public: + TestTexturing(); + + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, Diligent::TEXTURE_FORMAT TexFormat, bool bUseOpenGL, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent); + void Draw(); + static void GenerateTextureData(Diligent::IRenderDevice *pRenderDevice, std::vector<Diligent::Uint8> &Data, std::vector<Diligent::TextureSubResData> &SubResouces, const Diligent::TextureDesc &TexDesc, const float *ColorOffset = nullptr); + +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pRenderDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + + Diligent::RefCntAutoPtr<Diligent::IPipelineState> m_pPSO; + Diligent::RefCntAutoPtr<Diligent::IBuffer> m_pVertexBuff; + Diligent::RefCntAutoPtr<Diligent::ISampler> m_pSampler; + Diligent::RefCntAutoPtr<Diligent::ITexture> m_pTexture; + Diligent::RefCntAutoPtr<Diligent::IResourceMapping> m_pResourceMapping; + const Diligent::Uint32 m_iTestTexWidth; + const Diligent::Uint32 m_iTestTexHeight; + const Diligent::Uint32 m_iMipLevels; + Diligent::TEXTURE_FORMAT m_TextureFormat; +}; diff --git a/Tests/TestApp/include/TestVPAndSR.h b/Tests/TestApp/include/TestVPAndSR.h new file mode 100644 index 0000000..4c0e01d --- /dev/null +++ b/Tests/TestApp/include/TestVPAndSR.h @@ -0,0 +1,37 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "ScriptParser.h" + +class TestVPAndSR +{ +public: + TestVPAndSR(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext); + +private: + Diligent::RefCntAutoPtr<Diligent::IRenderDevice> m_pRenderDevice; + Diligent::RefCntAutoPtr<Diligent::IDeviceContext> m_pDeviceContext; + Diligent::RefCntAutoPtr<Diligent::ScriptParser> m_pRenderScript; +}; diff --git a/Tests/TestApp/include/pch.h b/Tests/TestApp/include/pch.h new file mode 100644 index 0000000..58295f7 --- /dev/null +++ b/Tests/TestApp/include/pch.h @@ -0,0 +1,50 @@ +/* Copyright 2015-2017 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include <stdlib.h> +#include <malloc.h> +#include <memory.h> +#include <list> +#include <algorithm> +#include <cassert> +#include <memory> +#include <chrono> +#include <vector> + +#include "PlatformDefinitions.h" + +#include "BasicTypes.h" + +#include "RefCntAutoPtr.h" +#include "DebugUtilities.h" +#include "RenderDevice.h" +#include "DeviceContext.h" +#include "SwapChain.h" + |
