From 1bc9ad4cbc913a03a8d4368d45a57f2818bafa64 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 25 Mar 2018 13:35:07 -0700 Subject: Updated copyright notice --- Tests/TestApp/src/AllocatorTest.cpp | 2 +- Tests/TestApp/src/MTResourceCreationTest.cpp | 2 +- Tests/TestApp/src/MathLibTest.cpp | 2 +- Tests/TestApp/src/RenderScriptTest.cpp | 2 +- Tests/TestApp/src/RingBufferTest.cpp | 2 +- Tests/TestApp/src/ShaderConverterTest.cpp | 2 +- Tests/TestApp/src/SmartPointerTest.cpp | 2 +- Tests/TestApp/src/TestBlendState.cpp | 2 +- Tests/TestApp/src/TestBufferAccess.cpp | 2 +- Tests/TestApp/src/TestBufferCreation.cpp | 2 +- Tests/TestApp/src/TestComputeShaders.cpp | 2 +- Tests/TestApp/src/TestCopyTexData.cpp | 2 +- Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp | 2 +- Tests/TestApp/src/TestCreateObjFromNativeResD3D12.cpp | 2 +- Tests/TestApp/src/TestCreateObjFromNativeResGL.cpp | 2 +- Tests/TestApp/src/TestDepthStencilState.cpp | 2 +- Tests/TestApp/src/TestDrawCommands.cpp | 2 +- Tests/TestApp/src/TestGeometryShader.cpp | 2 +- Tests/TestApp/src/TestPSOCompatibility.cpp | 2 +- Tests/TestApp/src/TestPipelineStateBase.cpp | 2 +- Tests/TestApp/src/TestRasterizerState.cpp | 2 +- Tests/TestApp/src/TestRenderTarget.cpp | 2 +- Tests/TestApp/src/TestSamplerCreation.cpp | 2 +- Tests/TestApp/src/TestShaderResArrays.cpp | 2 +- Tests/TestApp/src/TestTessellation.cpp | 2 +- Tests/TestApp/src/TestTextureCreation.cpp | 2 +- Tests/TestApp/src/TestTexturing.cpp | 2 +- Tests/TestApp/src/TestVPAndSR.cpp | 2 +- Tests/TestApp/src/UnitTestBase.cpp | 2 +- Tests/TestApp/src/VarSizeAllocationsManagerTest.cpp | 2 +- Tests/TestApp/src/pch.cpp | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) (limited to 'Tests/TestApp/src') diff --git a/Tests/TestApp/src/AllocatorTest.cpp b/Tests/TestApp/src/AllocatorTest.cpp index 89ef347..9f5e42d 100644 --- a/Tests/TestApp/src/AllocatorTest.cpp +++ b/Tests/TestApp/src/AllocatorTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/MTResourceCreationTest.cpp b/Tests/TestApp/src/MTResourceCreationTest.cpp index d1160b5..0bf8529 100644 --- a/Tests/TestApp/src/MTResourceCreationTest.cpp +++ b/Tests/TestApp/src/MTResourceCreationTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/MathLibTest.cpp b/Tests/TestApp/src/MathLibTest.cpp index 572e338..c04fe2c 100644 --- a/Tests/TestApp/src/MathLibTest.cpp +++ b/Tests/TestApp/src/MathLibTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/RenderScriptTest.cpp b/Tests/TestApp/src/RenderScriptTest.cpp index b4010d7..bf8b514 100644 --- a/Tests/TestApp/src/RenderScriptTest.cpp +++ b/Tests/TestApp/src/RenderScriptTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/RingBufferTest.cpp b/Tests/TestApp/src/RingBufferTest.cpp index c139c93..03aec5a 100644 --- a/Tests/TestApp/src/RingBufferTest.cpp +++ b/Tests/TestApp/src/RingBufferTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/ShaderConverterTest.cpp b/Tests/TestApp/src/ShaderConverterTest.cpp index 6e7b78f..837d911 100644 --- a/Tests/TestApp/src/ShaderConverterTest.cpp +++ b/Tests/TestApp/src/ShaderConverterTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/SmartPointerTest.cpp b/Tests/TestApp/src/SmartPointerTest.cpp index 5030433..27a73fb 100644 --- a/Tests/TestApp/src/SmartPointerTest.cpp +++ b/Tests/TestApp/src/SmartPointerTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestBlendState.cpp b/Tests/TestApp/src/TestBlendState.cpp index d399372..f54df7e 100644 --- a/Tests/TestApp/src/TestBlendState.cpp +++ b/Tests/TestApp/src/TestBlendState.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestBufferAccess.cpp b/Tests/TestApp/src/TestBufferAccess.cpp index e74d592..29cbd19 100644 --- a/Tests/TestApp/src/TestBufferAccess.cpp +++ b/Tests/TestApp/src/TestBufferAccess.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestBufferCreation.cpp b/Tests/TestApp/src/TestBufferCreation.cpp index f0f5b3d..9794193 100644 --- a/Tests/TestApp/src/TestBufferCreation.cpp +++ b/Tests/TestApp/src/TestBufferCreation.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestComputeShaders.cpp b/Tests/TestApp/src/TestComputeShaders.cpp index 658f26b..9b3f392 100644 --- a/Tests/TestApp/src/TestComputeShaders.cpp +++ b/Tests/TestApp/src/TestComputeShaders.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestCopyTexData.cpp b/Tests/TestApp/src/TestCopyTexData.cpp index 5bb65e1..d34f10e 100644 --- a/Tests/TestApp/src/TestCopyTexData.cpp +++ b/Tests/TestApp/src/TestCopyTexData.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp b/Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp index be8cfab..cd985a1 100644 --- a/Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp +++ b/Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestCreateObjFromNativeResD3D12.cpp b/Tests/TestApp/src/TestCreateObjFromNativeResD3D12.cpp index b402f7f..a98cfbe 100644 --- a/Tests/TestApp/src/TestCreateObjFromNativeResD3D12.cpp +++ b/Tests/TestApp/src/TestCreateObjFromNativeResD3D12.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestCreateObjFromNativeResGL.cpp b/Tests/TestApp/src/TestCreateObjFromNativeResGL.cpp index 0a61d22..59535c7 100644 --- a/Tests/TestApp/src/TestCreateObjFromNativeResGL.cpp +++ b/Tests/TestApp/src/TestCreateObjFromNativeResGL.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestDepthStencilState.cpp b/Tests/TestApp/src/TestDepthStencilState.cpp index 94c6198..8ad006b 100644 --- a/Tests/TestApp/src/TestDepthStencilState.cpp +++ b/Tests/TestApp/src/TestDepthStencilState.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestDrawCommands.cpp b/Tests/TestApp/src/TestDrawCommands.cpp index f8e341d..d9dcb64 100644 --- a/Tests/TestApp/src/TestDrawCommands.cpp +++ b/Tests/TestApp/src/TestDrawCommands.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestGeometryShader.cpp b/Tests/TestApp/src/TestGeometryShader.cpp index 0352a8e..922ba8a 100644 --- a/Tests/TestApp/src/TestGeometryShader.cpp +++ b/Tests/TestApp/src/TestGeometryShader.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestPSOCompatibility.cpp b/Tests/TestApp/src/TestPSOCompatibility.cpp index 4d51586..f14f22d 100644 --- a/Tests/TestApp/src/TestPSOCompatibility.cpp +++ b/Tests/TestApp/src/TestPSOCompatibility.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestPipelineStateBase.cpp b/Tests/TestApp/src/TestPipelineStateBase.cpp index b4c5041..a1222c5 100644 --- a/Tests/TestApp/src/TestPipelineStateBase.cpp +++ b/Tests/TestApp/src/TestPipelineStateBase.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestRasterizerState.cpp b/Tests/TestApp/src/TestRasterizerState.cpp index 64a1b41..8033f6a 100644 --- a/Tests/TestApp/src/TestRasterizerState.cpp +++ b/Tests/TestApp/src/TestRasterizerState.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestRenderTarget.cpp b/Tests/TestApp/src/TestRenderTarget.cpp index e09acb1..0cbaf2c 100644 --- a/Tests/TestApp/src/TestRenderTarget.cpp +++ b/Tests/TestApp/src/TestRenderTarget.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestSamplerCreation.cpp b/Tests/TestApp/src/TestSamplerCreation.cpp index e46f7cd..bc7616d 100644 --- a/Tests/TestApp/src/TestSamplerCreation.cpp +++ b/Tests/TestApp/src/TestSamplerCreation.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestShaderResArrays.cpp b/Tests/TestApp/src/TestShaderResArrays.cpp index dc65b9a..11ae64b 100644 --- a/Tests/TestApp/src/TestShaderResArrays.cpp +++ b/Tests/TestApp/src/TestShaderResArrays.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestTessellation.cpp b/Tests/TestApp/src/TestTessellation.cpp index e48bff8..3973c8b 100644 --- a/Tests/TestApp/src/TestTessellation.cpp +++ b/Tests/TestApp/src/TestTessellation.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestTextureCreation.cpp b/Tests/TestApp/src/TestTextureCreation.cpp index acaccaa..ae938fd 100644 --- a/Tests/TestApp/src/TestTextureCreation.cpp +++ b/Tests/TestApp/src/TestTextureCreation.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestTexturing.cpp b/Tests/TestApp/src/TestTexturing.cpp index ef032d0..c79676a 100644 --- a/Tests/TestApp/src/TestTexturing.cpp +++ b/Tests/TestApp/src/TestTexturing.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/TestVPAndSR.cpp b/Tests/TestApp/src/TestVPAndSR.cpp index c3b8b74..4c6b3e0 100644 --- a/Tests/TestApp/src/TestVPAndSR.cpp +++ b/Tests/TestApp/src/TestVPAndSR.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/UnitTestBase.cpp b/Tests/TestApp/src/UnitTestBase.cpp index fefaac2..86ed04d 100644 --- a/Tests/TestApp/src/UnitTestBase.cpp +++ b/Tests/TestApp/src/UnitTestBase.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/VarSizeAllocationsManagerTest.cpp b/Tests/TestApp/src/VarSizeAllocationsManagerTest.cpp index 1463bed..97ee76b 100644 --- a/Tests/TestApp/src/VarSizeAllocationsManagerTest.cpp +++ b/Tests/TestApp/src/VarSizeAllocationsManagerTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. diff --git a/Tests/TestApp/src/pch.cpp b/Tests/TestApp/src/pch.cpp index b61be60..5df156a 100644 --- a/Tests/TestApp/src/pch.cpp +++ b/Tests/TestApp/src/pch.cpp @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Egor Yusov +/* 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. -- cgit v1.2.3 From 6019c9be9e028fc5948bfa87f2f4f0fe75e0ef88 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 25 Mar 2018 20:37:03 -0700 Subject: Added ortho projection matrix test --- Tests/TestApp/src/MathLibTest.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'Tests/TestApp/src') diff --git a/Tests/TestApp/src/MathLibTest.cpp b/Tests/TestApp/src/MathLibTest.cpp index c04fe2c..d43de16 100644 --- a/Tests/TestApp/src/MathLibTest.cpp +++ b/Tests/TestApp/src/MathLibTest.cpp @@ -519,6 +519,38 @@ public: 5, 6); std::hash()(m3); } + + // Test ortho projection matrix + { + { + float4x4 OrthoProj = Ortho(2.f, 4.f, -4.f, 12.f, true); + auto c0 = float3(-1.f, -2.f, -4.f) * OrthoProj; + auto c1 = float3(+1.f, +2.f, +12.f) * OrthoProj; + VERIFY_EXPR(c0 == float3(-1, -1, 0) && c1 == float3(+1,+1,+1) ); + } + + { + float4x4 OrthoProj = Ortho(2.f, 4.f, -4.f, 12.f, false); + auto c0 = float3(-1.f, -2.f, -4.f) * OrthoProj; + auto c1 = float3(+1.f, +2.f, +12.f) * OrthoProj; + VERIFY_EXPR(c0 == float3(-1, -1, -1) && c1 == float3(+1, +1, +1)); + } + + { + float4x4 OrthoProj = OrthoOffCenter(-2.f, 6.f, -4.f, +12.f, -6.f, 10.f, true); + auto c0 = float3(-2.f, -4.f, -6.f) * OrthoProj; + auto c1 = float3(+6.f, +12.f, +10.f) * OrthoProj; + VERIFY_EXPR(c0 == float3(-1, -1, 0) && c1 == float3(+1, +1, +1)); + } + + { + float4x4 OrthoProj = OrthoOffCenter(-2.f, 6.f, -4.f, +12.f, -6.f, 10.f, false); + auto c0 = float3(-2.f, -4.f, -6.f) * OrthoProj; + auto c1 = float3(+6.f, +12.f, +10.f) * OrthoProj; + VERIFY_EXPR(c0 == float3(-1, -1, -1) && c1 == float3(+1, +1, +1)); + } + } + SetStatus(TestResult::Succeeded); } }; -- cgit v1.2.3 From 7eaac141998744af9ab260105f9f91726b669847 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 27 Mar 2018 19:23:07 -0700 Subject: Fixed https://github.com/DiligentGraphics/DiligentEngine/issues/9 --- Tests/TestApp/src/TestApp.cpp | 2 ++ Tests/TestApp/src/TestBrokenShader.cpp | 61 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 Tests/TestApp/src/TestBrokenShader.cpp (limited to 'Tests/TestApp/src') diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index 08a99f4..97dd72e 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -58,6 +58,7 @@ #include "TestCopyTexData.h" #include "PlatformMisc.h" #include "TestBufferCreation.h" +#include "TestBrokenShader.h" using namespace Diligent; @@ -180,6 +181,7 @@ void TestApp::InitializeRenderers() TestTextureCreation TestTexCreation(m_pDevice, m_pImmediateContext); TestBufferCreation TestBuffCreation(m_pDevice, m_pImmediateContext); TestPSOCompatibility TestPSOCompat(m_pDevice); + TestBrokenShader TestBrknShdr(m_pDevice); m_TestGS.Init(m_pDevice, m_pImmediateContext); m_TestTessellation.Init(m_pDevice, m_pImmediateContext); diff --git a/Tests/TestApp/src/TestBrokenShader.cpp b/Tests/TestApp/src/TestBrokenShader.cpp new file mode 100644 index 0000000..794e138 --- /dev/null +++ b/Tests/TestApp/src/TestBrokenShader.cpp @@ -0,0 +1,61 @@ +/* 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. + */ + +// EngineSandbox.cpp : Defines the entry point for the application. +// + +#include "pch.h" +#include "TestBrokenShader.h" + +using namespace Diligent; + +static const char g_BrokenShaderSource[] = +R"( +void VSMain(out float4 pos : SV_POSITION) +{ + pos = float3(0.0, 0.0, 0.0, 0.0); +} +)"; + +TestBrokenShader::TestBrokenShader(IRenderDevice *pDevice) : + UnitTestBase("Broken shader test") +{ + ShaderCreationAttribs Attrs; + Attrs.Source = g_BrokenShaderSource; + Attrs.EntryPoint = "VSMain"; + Attrs.Desc.ShaderType = SHADER_TYPE_VERTEX; + Attrs.Desc.Name = "TrivialVS (TestPipelineStateBase)"; + Attrs.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL; + RefCntAutoPtr pBrokenShader; + IDataBlob *pErrors = nullptr; + Attrs.ppCompilerOutput = &pErrors; + LOG_INFO_MESSAGE("No worries, testing broken shader..."); + pDevice->CreateShader(Attrs, &pBrokenShader); + VERIFY_EXPR(!pBrokenShader); + VERIFY_EXPR(pErrors != nullptr); + const char* Msg = reinterpret_cast(pErrors->GetDataPtr()); + LOG_INFO_MESSAGE("Compiler output:\n", Msg); + pErrors->Release(); + + SetStatus(TestResult::Succeeded); +} -- cgit v1.2.3 From 6d8eedb36afc22d690cd261f52e39a1184f981bd Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 27 Mar 2018 19:30:16 -0700 Subject: Minor update --- Tests/TestApp/src/TestBrokenShader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Tests/TestApp/src') diff --git a/Tests/TestApp/src/TestBrokenShader.cpp b/Tests/TestApp/src/TestBrokenShader.cpp index 794e138..7282828 100644 --- a/Tests/TestApp/src/TestBrokenShader.cpp +++ b/Tests/TestApp/src/TestBrokenShader.cpp @@ -44,7 +44,7 @@ TestBrokenShader::TestBrokenShader(IRenderDevice *pDevice) : Attrs.Source = g_BrokenShaderSource; Attrs.EntryPoint = "VSMain"; Attrs.Desc.ShaderType = SHADER_TYPE_VERTEX; - Attrs.Desc.Name = "TrivialVS (TestPipelineStateBase)"; + Attrs.Desc.Name = "Broken shader test"; Attrs.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL; RefCntAutoPtr pBrokenShader; IDataBlob *pErrors = nullptr; -- cgit v1.2.3 From 3081e9165ae8d931e75f9aa8f825d72fbb0e8cdb Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 29 Mar 2018 18:50:58 -0700 Subject: Updated Core (added hardware adapter & display mode enumeration) --- Tests/TestApp/src/TestApp.cpp | 54 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) (limited to 'Tests/TestApp/src') diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index 97dd72e..783a7e4 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -23,6 +23,7 @@ #include #include +#include #include "PlatformDefinitions.h" #include "TestApp.h" @@ -89,6 +90,8 @@ void TestApp::InitializeDiligentEngine( SCDesc.SamplesCount = 1; Uint32 NumDeferredCtx = 0; std::vector ppContexts; + std::vector Adapters; + std::vector> AdapterDisplayModes; switch (m_DeviceType) { #if D3D11_SUPPORTED @@ -100,8 +103,23 @@ void TestApp::InitializeDiligentEngine( // Load the dll and import GetEngineFactoryD3D11() function LoadGraphicsEngineD3D11(GetEngineFactoryD3D11); #endif - ppContexts.resize(1 + NumDeferredCtx); auto *pFactoryD3D11 = GetEngineFactoryD3D11(); + Uint32 NumAdapters = 0; + pFactoryD3D11->EnumerateHardwareAdapters(NumAdapters, 0); + Adapters.resize(NumAdapters); + pFactoryD3D11->EnumerateHardwareAdapters(NumAdapters, Adapters.data()); + + for(Uint32 i=0; i < Adapters.size(); ++i) + { + Uint32 NumDisplayModes = 0; + std::vector DisplayModes; + pFactoryD3D11->EnumerateDisplayModes(i, 0, TEX_FORMAT_RGBA8_UNORM, NumDisplayModes, nullptr); + DisplayModes.resize(NumDisplayModes); + pFactoryD3D11->EnumerateDisplayModes(i, 0, TEX_FORMAT_RGBA8_UNORM, NumDisplayModes, DisplayModes.data()); + AdapterDisplayModes.emplace_back(std::move(DisplayModes)); + } + + ppContexts.resize(1 + NumDeferredCtx); pFactoryD3D11->CreateDeviceAndContextsD3D11(DeviceAttribs, &m_pDevice, ppContexts.data(), NumDeferredCtx); if(NativeWindowHandle != nullptr) @@ -118,9 +136,25 @@ void TestApp::InitializeDiligentEngine( // Load the dll and import GetEngineFactoryD3D12() function LoadGraphicsEngineD3D12(GetEngineFactoryD3D12); #endif + auto *pFactoryD3D12 = GetEngineFactoryD3D12(); + Uint32 NumAdapters = 0; + pFactoryD3D12->EnumerateHardwareAdapters(NumAdapters, 0); + Adapters.resize(NumAdapters); + pFactoryD3D12->EnumerateHardwareAdapters(NumAdapters, Adapters.data()); + + for (Uint32 i = 0; i < Adapters.size(); ++i) + { + Uint32 NumDisplayModes = 0; + std::vector DisplayModes; + pFactoryD3D12->EnumerateDisplayModes(i, 0, TEX_FORMAT_RGBA8_UNORM, NumDisplayModes, nullptr); + DisplayModes.resize(NumDisplayModes); + pFactoryD3D12->EnumerateDisplayModes(i, 0, TEX_FORMAT_RGBA8_UNORM, NumDisplayModes, DisplayModes.data()); + AdapterDisplayModes.emplace_back(std::move(DisplayModes)); + } + EngineD3D12Attribs EngD3D12Attribs; ppContexts.resize(1 + NumDeferredCtx); - auto *pFactoryD3D12 = GetEngineFactoryD3D12(); + pFactoryD3D12->CreateDeviceAndContextsD3D12(EngD3D12Attribs, &m_pDevice, ppContexts.data(), NumDeferredCtx); if (!m_pSwapChain && NativeWindowHandle != nullptr) @@ -165,6 +199,22 @@ void TestApp::InitializeDiligentEngine( break; } + + std::stringstream ss; + ss << "Found " << Adapters.size() << " adapters:\n"; + for (Uint32 i = 0; i < Adapters.size(); ++i) + { + ss << Adapters[i].Description << " (" << (Adapters[i].DedicatedVideoMemory >> 20) << " MB). Num outputs: " << Adapters[i].NumOutputs << ". Display modes:\n"; + const auto &DisplayModes = AdapterDisplayModes[i]; + for(Uint32 m=0; m < DisplayModes.size(); ++m) + { + const auto &Mode = DisplayModes[m]; + ss << " " << Mode.Width << 'x' << Mode.Height << " " << std::setprecision(2) << Mode.RefreshRate << "Hz\n"; + } + } + auto str = ss.str(); + LOG_INFO_MESSAGE(str); + m_pImmediateContext.Attach(ppContexts[0]); m_pDeferredContexts.resize(NumDeferredCtx); for (Diligent::Uint32 ctx = 0; ctx < NumDeferredCtx; ++ctx) -- cgit v1.2.3 From 6e300d8c6a0c2157b8d804cd604dad6079429d8d Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 30 Mar 2018 09:59:44 -0700 Subject: Updated submodules; enabled fullscreen mode --- Tests/TestApp/src/TestApp.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Tests/TestApp/src') diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index 783a7e4..4994c69 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -123,7 +123,7 @@ void TestApp::InitializeDiligentEngine( pFactoryD3D11->CreateDeviceAndContextsD3D11(DeviceAttribs, &m_pDevice, ppContexts.data(), NumDeferredCtx); if(NativeWindowHandle != nullptr) - pFactoryD3D11->CreateSwapChainD3D11(m_pDevice, ppContexts[0], SCDesc, NativeWindowHandle, &m_pSwapChain); + pFactoryD3D11->CreateSwapChainD3D11(m_pDevice, ppContexts[0], SCDesc, FullScreenModeDesc{}, NativeWindowHandle, &m_pSwapChain); } break; #endif @@ -158,7 +158,7 @@ void TestApp::InitializeDiligentEngine( pFactoryD3D12->CreateDeviceAndContextsD3D12(EngD3D12Attribs, &m_pDevice, ppContexts.data(), NumDeferredCtx); if (!m_pSwapChain && NativeWindowHandle != nullptr) - pFactoryD3D12->CreateSwapChainD3D12(m_pDevice, ppContexts[0], SCDesc, NativeWindowHandle, &m_pSwapChain); + pFactoryD3D12->CreateSwapChainD3D12(m_pDevice, ppContexts[0], SCDesc, FullScreenModeDesc{}, NativeWindowHandle, &m_pSwapChain); } break; #endif @@ -209,7 +209,8 @@ void TestApp::InitializeDiligentEngine( for(Uint32 m=0; m < DisplayModes.size(); ++m) { const auto &Mode = DisplayModes[m]; - ss << " " << Mode.Width << 'x' << Mode.Height << " " << std::setprecision(2) << Mode.RefreshRate << "Hz\n"; + float RefreshRate = (float)Mode.RefreshRateNumerator / (float)Mode.RefreshRateDenominator; + ss << " " << Mode.Width << 'x' << Mode.Height << " " << std::fixed << std::setprecision(2) << RefreshRate << " Hz\n"; } } auto str = ss.str(); -- cgit v1.2.3 From 8f99e9af700ba047431f9599df1cce3c0857480d Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 30 Mar 2018 18:11:27 -0700 Subject: Fixed UWP build error --- Tests/TestApp/src/UWP/TestAppUWP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Tests/TestApp/src') diff --git a/Tests/TestApp/src/UWP/TestAppUWP.cpp b/Tests/TestApp/src/UWP/TestAppUWP.cpp index a74a8de..d7158f8 100644 --- a/Tests/TestApp/src/UWP/TestAppUWP.cpp +++ b/Tests/TestApp/src/UWP/TestAppUWP.cpp @@ -165,11 +165,11 @@ public: IDXGISwapChain3 *pDXGISwapChain3 = nullptr; if (m_DeviceType == DeviceType::D3D12) { - GetEngineFactoryD3D12()->CreateSwapChainD3D12(m_pDevice, m_pImmediateContext, SCDesc, reinterpret_cast(window), &m_pSwapChain); + GetEngineFactoryD3D12()->CreateSwapChainD3D12(m_pDevice, m_pImmediateContext, SCDesc, FullScreenModeDesc{}, reinterpret_cast(window), &m_pSwapChain); } else if (m_DeviceType == DeviceType::D3D11) { - GetEngineFactoryD3D11()->CreateSwapChainD3D11(m_pDevice, m_pImmediateContext, SCDesc, reinterpret_cast(window), &m_pSwapChain); + GetEngineFactoryD3D11()->CreateSwapChainD3D11(m_pDevice, m_pImmediateContext, SCDesc, FullScreenModeDesc{}, reinterpret_cast(window), &m_pSwapChain); } else UNEXPECTED("Unexpected device type"); -- cgit v1.2.3 From ba7b40284d98e893d4e8119c65d1d89c6a7091cf Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 31 Mar 2018 16:45:18 -0700 Subject: Added sync interval to Present. Fixed https://github.com/DiligentGraphics/DiligentEngine/issues/10 --- Tests/TestApp/src/TestApp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Tests/TestApp/src') diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index 4994c69..3b96cf0 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -543,5 +543,5 @@ void TestApp::Render() void TestApp::Present() { - m_pSwapChain->Present(); + m_pSwapChain->Present(0); } -- cgit v1.2.3