How to implement Vortice.Direct3D.Include in 1.9.77+
See original GitHub issueHello 😃,
I’ve been using v1.9.65 of Vortice.D3DCompiler/VorticeDirect3D11 to compile shaders like this
var include = new ShaderFileInclude(Path.GetDirectoryName(this.FullPath));
Compiler.Compile(sourceText, Defines, include, this.VertexShaderEntryPoint, this.FileName, this.VertexShaderProfile, out this.vertexShaderBlob, out var vsErrorBlob);
The class ShaderFileInclude looks like this:
internal sealed class ShaderFileInclude : Vortice.Direct3D.Include
{
private readonly string RootFolder;
public ShaderFileInclude(string rootFolder)
{
this.RootFolder = rootFolder;
}
public ShadowContainer Shadow { get; set; } // never set, property is null!
public void Close(Stream stream) => stream.Close();
public Stream Open(IncludeType type, string fileName, Stream parentStream)
{
switch (type)
{
case IncludeType.Local:
return File.OpenRead(Path.Combine(this.RootFolder, fileName));
case IncludeType.System:
default:
return File.OpenRead(fileName);
}
}
public void Dispose() { }
}
This worked great. However when upgrading to a newer version (1.9.77 or higher). This leads to a System.NullReferenceException
, I think because I haven’t initialized the ShadowContainer Shadow
property. To be honest I don’t really know what to do with it. I’ve looked through the source code in this repository. But I can’t really figure out how to implement the Vortice.Direct3D.Include
correctly or more specifically how to initialize the Shadow property.
Any hints?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Vortice.Direct3D11 1.9.77
Package, Downloads. Veldrid. A low-level, hardware-accelerated graphics and compute library for .NET, with backends for Vulkan, Metal, Direct3D 11, OpenGL, ...
Read more >Vortice.DirectX 3.2.0
Version Downloads Last updated
3.2.1‑beta 112 2 months ago
3.2.0 1,257 3 months ago
3.1.1‑beta 120 4 months ago
Read more >amerkoleci/Vortice.Windows: .NET bindings for Direct3D12 ...
Vortice.Windows is a collection of Win32 and UWP libraries with bindings support for DXGI, WIC, DirectWrite, Direct2D, Direct3D9, Direct3D11, Direct3D12, ...
Read more >Vortice.DirectComposition 1.8.49 - NuGet Gallery
Vortice.DirectComposition 1.8.49 .NET Standard 2.0. There is a newer version of this package available. See the version list below for details.
Read more >Untitled
Check file size before upload in php, How do managers differ from non managerial ... Pulpite anesthesia non funziona torrent, Vortex club party...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for digging this issue, ping me if you have any other issues, will release new nuget package soon.
Good morning, I’ve pulled the latest changes and I can confirm that they fix my issue! Thanks for the quick responses.