Ported DirectX12GameEngine.Shaders project

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-10 20:07:30 +02:00
1 親 b3faa3ddd2
コミット 8e0931c46b
18ファイル変更
+1794

検索条件に一致するファイルはありません

+53
ファイルの表示
@@ -0,0 +1,53 @@
using System;
using System.Reflection;
namespace DirectX12GameEngine.Shaders
{
public class ShaderGenerationResult
{
public ShaderGenerationResult(string shaderSource)
{
ShaderSource = shaderSource;
}
public string ShaderSource { get; }
public string? ComputeShader { get; set; }
public string? VertexShader { get; set; }
public string? PixelShader { get; set; }
public string? HullShader { get; set; }
public string? DomainShader { get; set; }
public string? GeometryShader { get; set; }
public string? RayGenerationShader { get; set; }
public string? IntersectionShader { get; set; }
public string? AnyHitShader { get; set; }
public string? ClosestHitShader { get; set; }
public string? MissShader { get; set; }
public string? CallableShader { get; set; }
internal void SetShader(string shaderName, string methodName)
{
foreach (PropertyInfo propertyInfo in GetType().GetProperties())
{
if (shaderName == propertyInfo.Name.Replace("Shader", "").ToLower())
{
propertyInfo.SetValue(this, methodName);
return;
}
}
throw new NotSupportedException("Attribute 'Shader' must have one of these values: compute, vertex, pixel, hull, domain, geometry, raygeneration, intersection, anyhit, closesthit, miss, callable.");
}
}
}