diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-01-28 05:06:57 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-01-28 05:06:57 +0000 |
| commit | 7f60ebc2347aed1866726ea82df7116010414b8d (patch) | |
| tree | eb126cb016cf5712186dca16b058df2937909641 /Tests/IncludeTest | |
| parent | Refactored D3D11 C interface (diff) | |
| download | DiligentCore-7f60ebc2347aed1866726ea82df7116010414b8d.tar.gz DiligentCore-7f60ebc2347aed1866726ea82df7116010414b8d.zip | |
Implemented C interface for D3D12 backend
Diffstat (limited to 'Tests/IncludeTest')
20 files changed, 622 insertions, 3 deletions
diff --git a/Tests/IncludeTest/GraphicsEngineD3D11/DeviceContextD3D11H_test.c b/Tests/IncludeTest/GraphicsEngineD3D11/DeviceContextD3D11H_test.c index 61801480..0f5eabab 100644 --- a/Tests/IncludeTest/GraphicsEngineD3D11/DeviceContextD3D11H_test.c +++ b/Tests/IncludeTest/GraphicsEngineD3D11/DeviceContextD3D11H_test.c @@ -28,8 +28,8 @@ #include <d3d11.h> #include "DiligentCore/Graphics/GraphicsEngineD3D11/interface/DeviceContextD3D11.h" -void TestDeviceContextD3D11_CInterface(struct IDeviceContextD3D11* pView) +void TestDeviceContextD3D11_CInterface(IDeviceContextD3D11* pCtx) { - ID3D11DeviceContext* pd3d11Ctx = IDeviceContextD3D11_GetD3D11DeviceContext(pView); + ID3D11DeviceContext* pd3d11Ctx = IDeviceContextD3D11_GetD3D11DeviceContext(pCtx); (void)pd3d11Ctx; } diff --git a/Tests/IncludeTest/GraphicsEngineD3D11/EngineFactoryD3D11H_test.c b/Tests/IncludeTest/GraphicsEngineD3D11/EngineFactoryD3D11H_test.c index 0d05b7d9..db1293dc 100644 --- a/Tests/IncludeTest/GraphicsEngineD3D11/EngineFactoryD3D11H_test.c +++ b/Tests/IncludeTest/GraphicsEngineD3D11/EngineFactoryD3D11H_test.c @@ -29,6 +29,7 @@ # define NOMINMAX #endif #include <Windows.h> +#include <d3d11.h> #ifndef ENGINE_DLL # define ENGINE_DLL 1 diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/BufferD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/BufferD3D12H_test.c new file mode 100644 index 00000000..81b6094c --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/BufferD3D12H_test.c @@ -0,0 +1,38 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <D3D12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/BufferD3D12.h" + +void TestBufferD3D12_CInterface(IBufferD3D12* pBuffer) +{ + ID3D12Resource* pD3D12Res = IBufferD3D12_GetD3D12Buffer(pBuffer, 0, (IDeviceContext*)NULL); + (void)pD3D12Res; + IBufferD3D12_SetD3D12ResourceState(pBuffer, RESOURCE_STATE_CONSTANT_BUFFER); + RESOURCE_STATE State = IBufferD3D12_GetD3D12ResourceState(pBuffer); + (void)State; +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/BufferViewD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/BufferViewD3D12H_test.c new file mode 100644 index 00000000..c5bb9c1a --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/BufferViewD3D12H_test.c @@ -0,0 +1,35 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/BufferViewD3D12.h" + +void TestBufferViewD3D12_CInterface(IBufferViewD3D12* pView) +{ + D3D12_CPU_DESCRIPTOR_HANDLE Handle = IBufferViewD3D12_GetCPUDescriptorHandle(pView); + (void)Handle; +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/CommandQueueD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/CommandQueueD3D12H_test.c new file mode 100644 index 00000000..3a15cd81 --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/CommandQueueD3D12H_test.c @@ -0,0 +1,46 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/CommandQueueD3D12.h" + +void TestCommandQueueD3D12CInterface(ICommandQueueD3D12* pQueue) +{ + Uint64 FenceVal = ICommandQueueD3D12_GetNextFenceValue(pQueue); + (void)FenceVal; + + FenceVal = ICommandQueueD3D12_Submit(pQueue, (ID3D12GraphicsCommandList*)NULL); + + ID3D12CommandQueue* pd3d12Queue = ICommandQueueD3D12_GetD3D12CommandQueue(pQueue); + (void)pd3d12Queue; + + FenceVal = ICommandQueueD3D12_GetCompletedFenceValue(pQueue); + + ICommandQueueD3D12_WaitForIdle(pQueue); + + ICommandQueueD3D12_SignalFence(pQueue, (ID3D12Fence*)NULL, (Uint64)0); +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/CommandQueueD3D12H_test.cpp b/Tests/IncludeTest/GraphicsEngineD3D12/CommandQueueD3D12H_test.cpp index 19150c2e..3385c0dc 100644 --- a/Tests/IncludeTest/GraphicsEngineD3D12/CommandQueueD3D12H_test.cpp +++ b/Tests/IncludeTest/GraphicsEngineD3D12/CommandQueueD3D12H_test.cpp @@ -26,4 +26,4 @@ */ #include <d3d12.h> -#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/BufferViewD3D12.h" +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/CommandQueueD3D12.h" diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/DeviceContextD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/DeviceContextD3D12H_test.c new file mode 100644 index 00000000..a11d9fbc --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/DeviceContextD3D12H_test.c @@ -0,0 +1,43 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/DeviceContextD3D12.h" + +void TestDeviceContextD3D12_CInterface(IDeviceContextD3D12* pCtx) +{ + IDeviceContextD3D12_TransitionTextureState(pCtx, (ITexture*)NULL, RESOURCE_STATE_SHADER_RESOURCE); + IDeviceContextD3D12_TransitionBufferState(pCtx, (IBuffer*)NULL, RESOURCE_STATE_SHADER_RESOURCE); + + ID3D12GraphicsCommandList* pd3d12CmdList = IDeviceContextD3D12_GetD3D12CommandList(pCtx); + (void)pd3d12CmdList; + + ICommandQueueD3D12* pd3d12CmdQueue = IDeviceContextD3D12_LockCommandQueue(pCtx); + (void)pd3d12CmdQueue; + + IDeviceContextD3D12_UnlockCommandQueue(pCtx); +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/EngineFactoryD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/EngineFactoryD3D12H_test.c new file mode 100644 index 00000000..849ff5dd --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/EngineFactoryD3D12H_test.c @@ -0,0 +1,69 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#ifndef NOMINMAX +# define NOMINMAX +#endif +#include <Windows.h> +#include <d3d12.h> + +#ifndef ENGINE_DLL +# define ENGINE_DLL 1 +#endif + +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/EngineFactoryD3D12.h" + +void TestEngineFactoryD3D12CInterface() +{ + GetEngineFactoryD3D12Type GetEngineFactoryD3D12 = LoadGraphicsEngineD3D12(); + struct IEngineFactoryD3D12* pFactory = GetEngineFactoryD3D12(); + struct EngineD3D12CreateInfo EngineCI = {0}; + IRenderDevice* pDevice = NULL; + IDeviceContext* pCtx = NULL; + IEngineFactoryD3D12_CreateDeviceAndContextsD3D12(pFactory, &EngineCI, &pDevice, &pCtx); + + bool res = IEngineFactoryD3D12_LoadD3D12(pFactory, "d3d12.dll"); + (void)res; + + struct SwapChainDesc SCDesc = {0}; + struct FullScreenModeDesc FSDes = {0}; + void* pNativeWndHandle = NULL; + ISwapChain* pSwapChain = NULL; + IEngineFactoryD3D12_CreateSwapChainD3D12(pFactory, pDevice, pCtx, &SCDesc, &FSDes, pNativeWndHandle, &pSwapChain); + + void* pd3d12NativeDevice = NULL; + struct ICommandQueueD3D12* pd3d12CmdQueues = NULL; + IEngineFactoryD3D12_AttachToD3D12Device(pFactory, pd3d12NativeDevice, (size_t)1, &pd3d12CmdQueues, &EngineCI, &pDevice, &pCtx); + + Uint32 NumAdapters = 0; + struct AdapterAttribs* Adapters = NULL; + IEngineFactoryD3D12_EnumerateAdapters(pFactory, DIRECT3D_FEATURE_LEVEL_11_0, &NumAdapters, Adapters); + + Uint32 NumDisplayModes = 0; + struct DisplayModeAttribs* DisplayModes = NULL; + IEngineFactoryD3D12_EnumerateDisplayModes(pFactory, DIRECT3D_FEATURE_LEVEL_11_0, 0, 0, TEX_FORMAT_RGBA8_UNORM, &NumDisplayModes, DisplayModes); +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/EngineFactoryD3D12H_test.cpp b/Tests/IncludeTest/GraphicsEngineD3D12/EngineFactoryD3D12H_test.cpp index 2e44550b..f424ef18 100644 --- a/Tests/IncludeTest/GraphicsEngineD3D12/EngineFactoryD3D12H_test.cpp +++ b/Tests/IncludeTest/GraphicsEngineD3D12/EngineFactoryD3D12H_test.cpp @@ -29,6 +29,7 @@ # define NOMINMAX #endif #include <Windows.h> +#include <d3d12.h> #ifndef ENGINE_DLL # define ENGINE_DLL 1 diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/FenceD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/FenceD3D12H_test.c new file mode 100644 index 00000000..49752587 --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/FenceD3D12H_test.c @@ -0,0 +1,29 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/FenceD3D12.h" diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/PipelineStateD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/PipelineStateD3D12H_test.c new file mode 100644 index 00000000..1c3b90f6 --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/PipelineStateD3D12H_test.c @@ -0,0 +1,37 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/PipelineStateD3D12.h" + +void TestPipelineStateD3D12CInterface(struct IPipelineStateD3D12* pPSO) +{ + ID3D12PipelineState* pd3d12PSO = IPipelineStateD3D12_GetD3D12PipelineState(pPSO); + ID3D12RootSignature* pd3d12RS = IPipelineStateD3D12_GetD3D12RootSignature(pPSO); + (void)pd3d12PSO; + (void)pd3d12RS; +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/QueryD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/QueryD3D12H_test.c new file mode 100644 index 00000000..00a1c857 --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/QueryD3D12H_test.c @@ -0,0 +1,38 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/QueryD3D12.h" + +void TestQueryD3D12_CInterface(struct IQueryD3D12* pQuery) +{ + ID3D12QueryHeap* pd3d12QueryHeap = IQueryD3D12_GetD3D12QueryHeap(pQuery); + (void)pd3d12QueryHeap; + + Uint32 Idx = IQueryD3D12_GetQueryHeapIndex(pQuery); + (void)Idx; +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/QueryD3D12H_test.cpp b/Tests/IncludeTest/GraphicsEngineD3D12/QueryD3D12H_test.cpp new file mode 100644 index 00000000..26479cfb --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/QueryD3D12H_test.cpp @@ -0,0 +1,29 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d11.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D11/interface/QueryD3D11.h" diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/RenderDeviceD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/RenderDeviceD3D12H_test.c new file mode 100644 index 00000000..d6fa648a --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/RenderDeviceD3D12H_test.c @@ -0,0 +1,46 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/RenderDeviceD3D12.h" + +void TestRenderDeviceD3D12CInterface(IRenderDeviceD3D12* pDevice) +{ + ID3D12Device* pD3D12Device = IRenderDeviceD3D12_GetD3D12Device(pDevice); + (void)pD3D12Device; + + Uint64 Fence = IRenderDeviceD3D12_GetNextFenceValue(pDevice, (Uint32)0); + (void)Fence; + + Fence = IRenderDeviceD3D12_GetCompletedFenceValue(pDevice, (Uint32)0); + + bool IsSignaled = IRenderDeviceD3D12_IsFenceSignaled(pDevice, (Uint32)0, (Uint64)0); + (void)IsSignaled; + + IRenderDeviceD3D12_CreateTextureFromD3DResource(pDevice, (ID3D12Resource*)NULL, RESOURCE_STATE_SHADER_RESOURCE, (ITexture**)NULL); + IRenderDeviceD3D12_CreateBufferFromD3DResource(pDevice, (ID3D12Resource*)NULL, (BufferDesc*)NULL, RESOURCE_STATE_CONSTANT_BUFFER, (IBuffer**)NULL); +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/SamplerD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/SamplerD3D12H_test.c new file mode 100644 index 00000000..8f01b95b --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/SamplerD3D12H_test.c @@ -0,0 +1,35 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/SamplerD3D12.h" + +void TestSamplerD3D12_CInterface(ISamplerD3D12* pSampler) +{ + D3D12_CPU_DESCRIPTOR_HANDLE Handle = ISamplerD3D12_GetCPUDescriptorHandle(pSampler); + (void)Handle; +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/ShaderD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/ShaderD3D12H_test.c new file mode 100644 index 00000000..eb580650 --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/ShaderD3D12H_test.c @@ -0,0 +1,33 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/ShaderD3D12.h" + +void TestShaderD3D12_CInterface(IShaderD3D12* pShader) +{ +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/ShaderResourceBindingD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/ShaderResourceBindingD3D12H_test.c new file mode 100644 index 00000000..57f9d0a0 --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/ShaderResourceBindingD3D12H_test.c @@ -0,0 +1,29 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/ShaderResourceBindingD3D12.h" diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/SwapChainD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/SwapChainD3D12H_test.c new file mode 100644 index 00000000..c7bcd3e4 --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/SwapChainD3D12H_test.c @@ -0,0 +1,35 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/SwapChainD3D12.h" + +void TestSwapChainD3D12CInterface(ISwapChainD3D12* pSwapChain) +{ + IDXGISwapChain* pDXGISwapChain = ISwapChainD3D12_GetDXGISwapChain(pSwapChain); + (void)pDXGISwapChain; +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/TextureD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/TextureD3D12H_test.c new file mode 100644 index 00000000..48fe9ede --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/TextureD3D12H_test.c @@ -0,0 +1,40 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/TextureD3D12.h" + +void TestTextureD3D12_CInterface(ITextureD3D12* pTexture) +{ + ID3D12Resource* pD3D12Texture = ITextureD3D12_GetD3D12Texture(pTexture); + (void)pD3D12Texture; + + ITextureD3D12_SetD3D12ResourceState(pTexture, RESOURCE_STATE_SHADER_RESOURCE); + + D3D12_RESOURCE_STATES State = ITextureD3D12_GetD3D12ResourceState(pTexture); + (void)State; +} diff --git a/Tests/IncludeTest/GraphicsEngineD3D12/TextureViewD3D12H_test.c b/Tests/IncludeTest/GraphicsEngineD3D12/TextureViewD3D12H_test.c new file mode 100644 index 00000000..2cbc9334 --- /dev/null +++ b/Tests/IncludeTest/GraphicsEngineD3D12/TextureViewD3D12H_test.c @@ -0,0 +1,35 @@ +/* + * Copyright 2019-2020 Diligent Graphics LLC + * Copyright 2015-2019 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * 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. + */ + +#include <d3d12.h> +#include "DiligentCore/Graphics/GraphicsEngineD3D12/interface/TextureViewD3D12.h" + +void TestTextureViewD3D12_CInterface(struct ITextureViewD3D12* pView) +{ + D3D12_CPU_DESCRIPTOR_HANDLE Handle = ITextureViewD3D12_GetCPUDescriptorHandle(pView); + (void)Handle; +} |
