Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
262a4da
Guarding MakeUnique and MakeShared with a requires clause. Mainly so …
KStocky Jan 4, 2025
c6cb715
Completely refactor Object. Object now enables shared from this. Anyt…
KStocky Jan 5, 2025
3dde82e
Fix unused parameter error in object tests
KStocky Jan 5, 2025
bdc63ab
Refactoring Time utilities to just use chrono rather than my own chrono
KStocky Jan 8, 2025
a3494fe
Refactoring Fence. Tests not made because they would be flakey tests …
KStocky Jan 9, 2025
b297422
CommandQueue tests
KStocky Jan 9, 2025
b56dd7a
Adding SharedFromThis function to object to provide a type safe way o…
KStocky Jan 11, 2025
e0845bc
Making CommandQueue tests 3x faster (3 seconds -> ~900ms). Did this b…
KStocky Jan 12, 2025
2936b8c
FencedResourcePool and tests. Also added a WaitOnFenceCPU overload fo…
KStocky Jan 15, 2025
b499735
Merging from main
KStocky Dec 8, 2025
acf368e
Fix merge error and also ignoring expected value
KStocky Dec 8, 2025
ae11d15
Fixing issues found by clang 19. Not entirely sure why they were not …
KStocky Dec 8, 2025
52a4eb7
Merge branch 'main' into UnrestrictedConstantBuffers
KStocky Dec 14, 2025
3be7b20
Add equality operators for descriptor handles
KStocky Dec 15, 2025
4404e45
Implementing a lower level Descriptor manager that handles descriptor…
KStocky Dec 18, 2025
62bce78
Fixing for Clang 19.
KStocky Dec 18, 2025
db7ed0a
Added concept for valdiating bitfields
KStocky Dec 20, 2025
bb67d94
Not allowing signed integrals for bitfields
KStocky Dec 20, 2025
cfa8fcb
Strengthen valid bitfield concept to fail if a bit field has 0 bits
KStocky Dec 20, 2025
7cc2ceb
Adding VersionedIndex class
KStocky Dec 20, 2025
c1b762b
Fixing versionedindex compilation errors. Also adding common versione…
KStocky Dec 22, 2025
f7523c4
Actually fix compilation errors in VersionedIndex
KStocky Dec 22, 2025
52bb963
String literal class for guaranteeing a string literal
KStocky Dec 23, 2025
06a9073
Adding comparison operators to string literal
KStocky Dec 23, 2025
6449b7b
Make string literal comparisons constexpr
KStocky Dec 27, 2025
d5eaab0
Create Trivially copyable concept
KStocky Dec 27, 2025
3dd6ee4
Adding function to get a string view from a fixed string
KStocky Dec 27, 2025
4a0eb4f
New error type and tests
KStocky Dec 27, 2025
7edd9d5
Use Concept rather than std concept for formattable
KStocky Dec 27, 2025
4950e42
Support stream operator for Error
KStocky Dec 29, 2025
53c769d
Adding ostream for Expected with tests
KStocky Dec 29, 2025
e544d0c
New Resource manager that utilizes a free list. With tests
KStocky Dec 29, 2025
74d8b1d
Modify resource free list to not create resources. This removes the r…
KStocky Dec 29, 2025
3cba612
Make fences easier to debug
KStocky Dec 29, 2025
50fad4f
Using a desc to specify the params of committed resources to make it …
KStocky Dec 30, 2025
92f2463
Fix compilation error in test driver
KStocky Dec 30, 2025
6d63e53
Removing unused variable
KStocky Dec 30, 2025
7be3f21
Supporting creating cbvs in the device
KStocky Dec 30, 2025
95525ce
GPU Resource manager. No tests yet and largely unimplemented.
KStocky Dec 30, 2025
69d390a
Incorporating the gpu resource manager into the command engine. Also …
KStocky Dec 30, 2025
0e673d5
Fixing compilation errors
KStocky Dec 30, 2025
3ac49d7
Enabling writes to mapped resources
KStocky Jan 2, 2026
e9f81a4
Allow querying of max descriptor heap size
KStocky Jan 3, 2026
1d29e6b
Move HLSLTypes to Utility
KStocky Jan 4, 2026
0819f57
Adding a function to FixedString to return a StringLiteral
KStocky Jan 5, 2026
8d314c9
Adding convenience factory function to make an Error from an initial …
KStocky Jan 5, 2026
894d7bc
Fixing value binding test so that it is actually testing the thing it…
KStocky Jan 5, 2026
2eeb437
Shadering binding map that abstracts out the binding logic from shade…
KStocky Jan 6, 2026
7e4cd1a
Shader class. This is a generic shader class that takes most of its l…
KStocky Jan 6, 2026
a61d060
Adding missing header to shader reflection utils.cpp
KStocky Jan 6, 2026
bdbe10d
Major Shader refactor. This also involved converting the test fixture…
KStocky Jan 6, 2026
2fe2107
Slight refactor to make the creation params inherit from the shader t…
KStocky Jan 8, 2026
bec3fd9
Support constant buffers being bound as root descriptors
KStocky Jan 9, 2026
86ac182
Implementing buffer creation through the command engine
KStocky Jan 10, 2026
208adf6
Remove dependency on command engine from Shader. Command Engine is hi…
KStocky Jan 10, 2026
c73ded1
Allowing more appending of errors
KStocky Jan 10, 2026
dfae8cf
Converting descriptor allocators and managers to use ExpectedError
KStocky Jan 10, 2026
5d3cc52
Fix expensive copy warnings
KStocky Jan 10, 2026
68966e8
Moving towards supporting binding shaders in the command engine conte…
KStocky Jan 11, 2026
ec6f9c9
Comment out some parts of the command engine for now until everything…
KStocky Jan 11, 2026
f5bce54
Adding matchers for error to make nicer assertions for Error
KStocky Jan 11, 2026
ead6913
Refactoring RingBuffer to use ExpectedError
KStocky Jan 11, 2026
c927db9
Fix fenced resource free list so that it actually uses the free list.
KStocky Jan 11, 2026
89d2d6a
Free List and tests
KStocky Jan 11, 2026
ff4472c
Support readbacks through the gpu resource manager and command context
KStocky Jan 11, 2026
bf07354
Adding new concept for determining if a type is an instantiation of a…
KStocky Jan 11, 2026
0ff3542
Adding a concept for what an ExpectedError is
KStocky Jan 11, 2026
928d2c6
Allowing Command contexts to return something. This is to support rea…
KStocky Jan 11, 2026
2c9a6a3
Fix compilation error due to not fixing up a site of TIsInstantiationOf
KStocky Jan 12, 2026
4958ced
Adding a concept for ExpectedErrors with a specific value type
KStocky Jan 12, 2026
53c36c1
Support Readbacks and Command Execute functions returns values
KStocky Jan 12, 2026
0655fab
Supporting returning values from readback functions
KStocky Jan 12, 2026
7fd6d65
Support returning values from readbacks in the command engine
KStocky Jan 12, 2026
f92bc75
Fix RingBuffer and added a new test case to cover the scenario where …
KStocky Jan 15, 2026
2223c53
Refactor of shader test driver to use the new scoped shader pipeline.…
KStocky Jan 17, 2026
fe5b4c1
Fixing typo in Bindings docs
KStocky Jan 17, 2026
99f6cc3
Just make tuple use std::tuple for Clang 19 since clang 19 just can't…
KStocky Jan 17, 2026
7ab1ce5
Upping the minimum MSVC version to 14.41 because this code https://go…
KStocky Jan 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/TestCompilerSupport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:
- "main"

env:
MSVC_VERSION: 14.37
VS_VERSION: 17.7
MSVC_VERSION: 14.41
VS_VERSION: 17.11

jobs:
Test-Compiler-Support:
Expand Down
2 changes: 1 addition & 1 deletion docs/STF/Bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

All code snippets for this section will be taken from ([Ex8_ConstantBuffers](../../examples/Ex8_ConstantBuffers))

Shader Test Framework provides a simple way of specifying constant buffer bindings. i.e. bindings which are not buffers, samples or textures. `stf::ShaderTestFixture::RuntimeTestDesc` contains a member called `Bindings` which can be populated with a `std::vector` of pairs of `std::string`s and constant buffer data. Bindings must refer to global names. Meaning that you can't bind individual members of global parameters or constant buffers. You must provide all of the data to bind to a global name in the shader.
Shader Test Framework provides a simple way of specifying constant buffer bindings. i.e. bindings which are not buffers, samplers or textures. `stf::ShaderTestFixture::RuntimeTestDesc` contains a member called `Bindings` which can be populated with a `std::vector` of pairs of `std::string`s and constant buffer data. Bindings must refer to global names. Meaning that you can't bind individual members of global parameters or constant buffers. You must provide all of the data to bind to a global name in the shader.

Given the following HLSL test:

Expand Down
4 changes: 3 additions & 1 deletion examples/Ex8_ConstantBuffers/ConstantBuffers.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <Framework/HLSLTypes.h>

#include <Framework/ShaderTestFixture.h>
#include <Utility/HLSLTypes.h>

#include <catch2/catch_test_macros.hpp>

SCENARIO("Example8Tests")
Expand Down
20 changes: 15 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set_target_properties(WINPIX PROPERTIES
asset_dependency_init(ShaderTestFramework)

set(SOURCES
Public/Container/FreeList.h
Public/Container/RingBuffer.h
Public/D3D12/AgilityDefinitions.h
Public/D3D12/BindlessFreeListAllocator.h
Expand All @@ -32,28 +33,31 @@ set(SOURCES
Public/D3D12/Descriptor.h
Public/D3D12/DescriptorFreeListAllocator.h
Public/D3D12/DescriptorHeap.h
Public/D3D12/DescriptorManager.h
Public/D3D12/DescriptorRingAllocator.h
Public/D3D12/Fence.h
Public/D3D12/FencedResourceFreeList.h
Public/D3D12/FencedResourcePool.h
Public/D3D12/GPUDevice.h
Public/D3D12/GPUResource.h
Public/D3D12/GPUResourceManager.h
Public/D3D12/Shader/CompiledShaderData.h
Public/D3D12/Shader/IncludeHandler.h
Public/D3D12/Shader/PipelineState.h
Public/D3D12/Shader/RootSignature.h
Public/D3D12/Shader/Shader.h
Public/D3D12/Shader/ShaderBinding.h
Public/D3D12/Shader/ShaderBindingMap.h
Public/D3D12/Shader/ShaderCompiler.h
Public/D3D12/Shader/ShaderEnums.h
Public/D3D12/Shader/ShaderHash.h
Public/D3D12/Shader/ShaderReflectionUtils.h
Public/D3D12/Shader/VirtualShaderDirectoryMapping.h
Public/D3D12/Shader/VirtualShaderDirectoryMappingManager.h
Public/Framework/HLSLTypes.h
Public/Framework/PIXCapturer.h
Public/Framework/ShaderTestCommon.h
Public/Framework/ShaderTestDescriptorManager.h
Public/Framework/ShaderTestDriver.h
Public/Framework/ShaderTestFixture.h
Public/Framework/ShaderTestShader.h
Public/Framework/TestDataBufferLayout.h
Public/Framework/TestDataBufferProcessor.h
Public/Framework/TestDataBufferStructs.h
Expand All @@ -64,47 +68,53 @@ set(SOURCES
Public/Utility/Algorithm.h
Public/Utility/Concepts.h
Public/Utility/EnumReflection.h
Public/Utility/Error.h
Public/Utility/Exception.h
Public/Utility/Expected.h
Public/Utility/FixedString.h
Public/Utility/Float.h
Public/Utility/FunctionTraits.h
Public/Utility/HLSLTypes.h
Public/Utility/Lambda.h
Public/Utility/Math.h
Public/Utility/MoveOnly.h
Public/Utility/Object.h
Public/Utility/OverloadSet.h
Public/Utility/Pointer.h
Public/Utility/StringLiteral.h
Public/Utility/Time.h
Public/Utility/Tuple.h
Public/Utility/Type.h
Public/Utility/TypeList.h
Public/Utility/TypeTraits.h
Public/Utility/VersionedIndex.h
Private/D3D12/BindlessFreeListAllocator.cpp
Private/D3D12/CommandAllocator.cpp
Private/D3D12/CommandEngine.cpp
Private/D3D12/CommandList.cpp
Private/D3D12/CommandQueue.cpp
Private/D3D12/DescriptorFreeListAllocator.cpp
Private/D3D12/DescriptorHeap.cpp
Private/D3D12/DescriptorManager.cpp
Private/D3D12/DescriptorRingAllocator.cpp
Private/D3D12/Fence.cpp
Private/D3D12/GPUDevice.cpp
Private/D3D12/GPUResource.cpp
Private/D3D12/GPUResourceManager.cpp
Private/D3D12/Shader/CompiledShaderData.cpp
Private/D3D12/Shader/IncludeHandler.cpp
Private/D3D12/Shader/PipelineState.cpp
Private/D3D12/Shader/RootSignature.cpp
Private/D3D12/Shader/Shader.cpp
Private/D3D12/Shader/ShaderBinding.cpp
Private/D3D12/Shader/ShaderBindingMap.cpp
Private/D3D12/Shader/ShaderCompiler.cpp
Private/D3D12/Shader/ShaderReflectionUtils.cpp
Private/D3D12/Shader/VirtualShaderDirectoryMappingManager.cpp
Private/Framework/PIXCapturer.cpp
Private/Framework/ShaderTestCommon.cpp
Private/Framework/ShaderTestDescriptorManager.cpp
Private/Framework/ShaderTestDriver.cpp
Private/Framework/ShaderTestFixture.cpp
Private/Framework/ShaderTestShader.cpp
Private/Framework/TestDataBufferLayout.cpp
Private/Framework/TestDataBufferProcessor.cpp
Private/Framework/TestDataBufferStructs.cpp
Expand Down
77 changes: 42 additions & 35 deletions src/Private/D3D12/BindlessFreeListAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@

namespace stf
{
namespace Errors::BindlessFreeListAllocator
{
ErrorFragment Empty()
{
return ErrorFragment::Make<"Bindless allocator is empty">();
}

ErrorFragment InvalidIndex(const u32 InIndex)
{
return ErrorFragment::Make<"Bindless index {} is invalid">(InIndex);
}

ErrorFragment IndexAlreadyReleased(const u32 InIndex)
{
return ErrorFragment::Make<"Bindless index {} has already been released">(InIndex);
}

ErrorFragment ShrinkAttempted(const u32 InCurrentSize, const u32 InRequestedSize)
{
return ErrorFragment::Make<"Attempted shrink which is unsupported. Current size: {}, Requested size: {}">(InCurrentSize, InRequestedSize);
}
}

BindlessFreeListAllocator::BindlessFreeListAllocator(CreationParams InParams)
: m_FreeList(InParams.NumDescriptors)
, m_FreeSet(InParams.NumDescriptors, true)
Expand All @@ -13,7 +36,7 @@ namespace stf
std::ranges::generate_n(std::back_inserter(m_FreeList), m_NumDescriptors, [index = 0]() mutable { return index++; });
}

BindlessFreeListAllocator::Expected<BindlessFreeListAllocator::BindlessIndex> BindlessFreeListAllocator::Allocate()
ExpectedError<BindlessFreeListAllocator::BindlessIndex> BindlessFreeListAllocator::Allocate()
{
return m_FreeList.pop_front()
.transform(
Expand All @@ -23,35 +46,24 @@ namespace stf
return BindlessIndex{ Private{}, InIndex };
})
.transform_error(
[](const EBufferError InError)
[](const Error& InError) -> Error
{
switch (InError)
{
case EBufferError::EmptyBuffer:
{
return EErrorType::EmptyError;
}

default:
{
return EErrorType::UnknownError;
}
}
return InError + Errors::BindlessFreeListAllocator::Empty();
}
);
}

BindlessFreeListAllocator::Expected<void> BindlessFreeListAllocator::Release(const BindlessIndex InIndex)
ExpectedError<void> BindlessFreeListAllocator::Release(const BindlessIndex InIndex)
{
const u32 index = InIndex;
if (index >= m_NumDescriptors)
{
return Unexpected(EErrorType::InvalidIndex);
return Unexpected{ Error{Errors::BindlessFreeListAllocator::InvalidIndex(index) } };
}

if (m_FreeSet[index])
{
return Unexpected(EErrorType::IndexAlreadyReleased);
return Unexpected{ Error{ Errors::BindlessFreeListAllocator::IndexAlreadyReleased(index) } };
}

m_FreeList.push_back(index);
Expand All @@ -60,11 +72,11 @@ namespace stf
return {};
}

BindlessFreeListAllocator::Expected<void> BindlessFreeListAllocator::Resize(const u32 InNewSize)
ExpectedError<void> BindlessFreeListAllocator::Resize(const u32 InNewSize)
{
if (InNewSize < m_NumDescriptors)
{
return Unexpected(EErrorType::ShrinkAttempted);
return Unexpected{ Error{ Errors::BindlessFreeListAllocator::ShrinkAttempted(m_NumDescriptors, InNewSize) } };
}

if (InNewSize == m_NumDescriptors)
Expand All @@ -83,22 +95,6 @@ namespace stf
std::ranges::generate_n(std::back_inserter(m_FreeSet), numAdded, []() { return true; });
m_NumDescriptors = InNewSize;
}
).transform_error(
[](const stf::RingBuffer<stf::u32>::EErrorType InError)
{
using enum stf::RingBuffer<stf::u32>::EErrorType;
switch (InError)
{
case AttemptedShrink:
{
return EErrorType::ShrinkAttempted;
}
default:
{
return EErrorType::UnknownError;
}
}
}
);
}

Expand Down Expand Up @@ -126,4 +122,15 @@ namespace stf
{
return m_Index;
}

ExpectedError<bool> BindlessFreeListAllocator::IsAllocated(const BindlessIndex InIndex) const
{
const u32 index = InIndex;
if (index >= m_NumDescriptors)
{
return Unexpected{ Error{ Errors::BindlessFreeListAllocator::InvalidIndex(InIndex) } };
}

return !m_FreeSet[InIndex];
}
}
5 changes: 3 additions & 2 deletions src/Private/D3D12/CommandAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

namespace stf
{
CommandAllocator::CommandAllocator(CreationParams InParams)
: m_Allocator(std::move(InParams.Allocator))
CommandAllocator::CommandAllocator(ObjectToken InToken, CreationParams InParams)
: Object(InToken)
, m_Allocator(std::move(InParams.Allocator))
, m_Type(InParams.Type)
{
}
Expand Down
Loading