Skip to content

Commit

Permalink
testing improvements (#12)
Browse files Browse the repository at this point in the history
* add doctest formatter

* introduce SKIP

* lower case device names

* add natvis file

* enable more backends for tests

* fix unit test comparison !!

* add format names

* add support for shader cache in tests

* fix cmake preset
  • Loading branch information
skallweitNV authored Sep 3, 2024
1 parent caac6ad commit 5233911
Show file tree
Hide file tree
Showing 26 changed files with 584 additions and 209 deletions.
124 changes: 67 additions & 57 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,77 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"description": "Default build using Ninja Multi-Config generator",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build"
},
{
"name": "msvc-base",
"hidden": true,
"inherits": "default",
"description": "Options specific for MSVC",
"cacheVariables": {
"CMAKE_C_FLAGS_INIT": "-D_ITERATOR_DEBUG_LEVEL=0 /MP",
"CMAKE_CXX_FLAGS_INIT": "-D_ITERATOR_DEBUG_LEVEL=0 /MP"
}
},
{
"name": "msvc",
"inherits": "msvc-base",
"description": "Ninja Multi-Config generator with MSVC",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
{
"name": "default",
"description": "Default build using Ninja Multi-Config generator",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build"
},
{
"name": "msvc-base",
"hidden": true,
"inherits": "default",
"description": "Options specific for MSVC",
"cacheVariables": {
"CMAKE_C_FLAGS_INIT": "-D_ITERATOR_DEBUG_LEVEL=0 /MP",
"CMAKE_CXX_FLAGS_INIT": "-D_ITERATOR_DEBUG_LEVEL=0 /MP"
}
},
{
"name": "msvc",
"inherits": "msvc-base",
"description": "Ninja Multi-Config generator with MSVC",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
},
{
"name": "vs2019",
"inherits": "msvc-base",
"description": "Visual Studio 2019 project",
"generator": "Visual Studio 16 2019"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
{
"name": "vs2022",
"inherits": "msvc-base",
"description": "Visual Studio 2022 project",
"generator": "Visual Studio 17 2022"
}
},
{
"name": "vs2019",
"inherits": "msvc-base",
"description": "Visual Studio 2019 project",
"generator": "Visual Studio 16 2019"
},
{
"name": "vs2022",
"inherits": "msvc-base",
"description": "Visual Studio 2022 project",
"generator": "Visual Studio 17 2022"
}
],
"buildPresets": [
{
"name": "msvc-debug",
"configurePreset": "msvc",
"configuration": "Debug"
},
{
"name": "msvc-release",
"configurePreset": "default",
"configuration": "Release"
}
{
"name": "debug",
"configurePreset": "default",
"configuration": "Debug"
},
{
"name": "release",
"configurePreset": "default",
"configuration": "Release"
},
{
"name": "msvc-debug",
"configurePreset": "msvc",
"configuration": "Debug"
},
{
"name": "msvc-release",
"configurePreset": "msvc",
"configuration": "Release"
}
]
}
}
1 change: 1 addition & 0 deletions include/slang-rhi.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ enum class Format
// TODO: Width/Height/Depth/whatever should not be used. We should use extentX, extentY, etc.
struct FormatInfo
{
const char* name;
/// The amount of channels in the format. Only set if the channelType is set.
GfxCount channelCount;
/// One of SlangScalarType None if type isn't made up of elements of type. TODO: Change to uint32_t?
Expand Down
37 changes: 37 additions & 0 deletions src/core.natvis
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>

<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">

<Type Name="rhi::RefPtr&lt;*&gt;">
<SmartPointer Usage="Minimal">pointer</SmartPointer>
<DisplayString Condition="pointer == 0">empty</DisplayString>
<DisplayString Condition="pointer != 0">RefPtr {*pointer}</DisplayString>
<Expand>
<ExpandedItem>pointer</ExpandedItem>
</Expand>
</Type>

<Type Name="rhi::static_vector&lt;*,*&gt;">
<DisplayString>{{ size={m_size} }}</DisplayString>
<Expand>
<Item Name="[size]">m_size</Item>
<ArrayItems>
<Size>m_size</Size>
<ValuePointer>m_data.data()</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="rhi::short_vector&lt;*,*,*&gt;">
<DisplayString>{{ size={m_count} }}</DisplayString>
<Expand>
<Item Name="[size]">m_count</Item>
<Item Name="[capacity]">m_capacity</Item>
<ArrayItems>
<Size>m_size</Size>
<ValuePointer>m_data</ValuePointer>
</ArrayItems>
</Expand>
</Type>

</AutoVisualizer>
Loading

0 comments on commit 5233911

Please sign in to comment.