• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemoBytom / DemoEngine / 25463527634

06 May 2026 09:58PM UTC coverage: 28.38% (+0.02%) from 28.36%
25463527634

push

coveralls.net

DemoBytom
Continue working on instrumentation registration

Cleaned up instrumentation registration pattern, where any module can register it's own instrumentation package, by preparing a simple extension method, that would be called in the `Program.cs` to register it within the instrumentation sources. Everything handled by interfaces and extension methods.
A room for improvement using source generators in the future.

1226 of 4320 relevant lines covered (28.38%)

0.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Demo.Engine.Platform.DirectX12/RegistrationExtensions.cs
1
// Copyright © Michał Dembski and contributors.
2
// Distributed under MIT license. See LICENSE file in the root for more information.
3

4
using Demo.Engine.Core.Interfaces;
5
using Demo.Engine.Core.Interfaces.Rendering;
6
using Demo.Engine.Core.Interfaces.Rendering.Shaders;
7
using Demo.Engine.Observability.Abstractions;
8
using Demo.Engine.Platform.DirectX12.Shaders;
9
using Microsoft.Extensions.DependencyInjection;
10

11
namespace Demo.Engine.Platform.DirectX12;
12

13
public static class RegistrationExtensions
14
{
15
    public static IServiceCollection AddDirectX12(
16
        this IServiceCollection services)
17
        => services
×
18
            .AddScoped<D3D12RenderingEngine>()
×
19
            .AddScoped<IRenderingEngine>(sp
×
20
                => sp.GetRequiredService<D3D12RenderingEngine>())
×
21
            .AddScoped<ID3D12RenderingEngine>(sp
×
22
                => sp.GetRequiredService<D3D12RenderingEngine>())
×
23
            .AddScoped<IDebugLayerLogger, DebugLayerLogger>()
×
24
            // shaders
×
25
            .AddSingleton<IShaderCompiler, ShaderCompilerOld>()
×
26
            .AddSingleton<IShaderAsyncCompiler, ShaderCompiler>()
×
27
            .AddSingleton<IEngineShaderManager, EngineShaderManager>()
×
28
            //Cube
×
29
            .AddScoped<ICube, Cube>()
×
30
        ;
31

32
    public static TTelemetryBuilder WithDirectX12Instrumentation<TTelemetryBuilder>(
33
        this TTelemetryBuilder instrumentationBuilder)
34
        where TTelemetryBuilder : ITelemetryBuilder<TTelemetryBuilder>, allows ref struct
35
        => instrumentationBuilder.WithInstrumentation<InstrumentationDX12>();
×
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc