Code refactoring in the field info models

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-15 18:38:26 +02:00
1 親 98e5fe86d2
コミット a2e8eef126
9ファイル変更
+48 -45

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

+7 -6
ファイルの表示
@@ -11,6 +11,7 @@ using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using SharpDX.Direct3D12;
using FieldInfo = ComputeSharp.Shaders.Renderer.Models.Fields.Abstract.FieldInfo;
#pragma warning disable CS8618 // Non-nullable field is uninitialized
@@ -39,7 +40,7 @@ namespace ComputeSharp.Shaders.Translation
/// <summary>
/// The sequence of fields in the targeted closure
/// </summary>
private readonly IReadOnlyList<FieldInfo> ShaderFields;
private readonly IReadOnlyList<System.Reflection.FieldInfo> ShaderFields;
/// <summary>
/// Creates a new <see cref="ShaderLoader"/> with the specified parameters
@@ -68,12 +69,12 @@ namespace ComputeSharp.Shaders.Translation
/// </summary>
public IReadOnlyList<(int Index, object Value)> CapturedConstantBufferValues { get; private set; }
private readonly List<FieldInfoBase> _FieldsInfo = new List<FieldInfoBase>();
private readonly List<FieldInfo> _FieldsInfo = new List<FieldInfo>();
/// <summary>
/// Gets the collection of <see cref="FieldInfoBase"/> items for the shader fields
/// Gets the collection of <see cref="FieldInfo"/> items for the shader fields
/// </summary>
public IReadOnlyList<FieldInfoBase> FieldsInfo => _FieldsInfo;
public IReadOnlyList<FieldInfo> FieldsInfo => _FieldsInfo;
/// <summary>
/// Gets the name of the <see cref="ThreadIds"/> variable used as input for the shader method
@@ -116,12 +117,12 @@ namespace ComputeSharp.Shaders.Translation
int readWriteBuffersCount = 0;
int readOnlyBuffersCount = 0;
foreach (FieldInfo fieldInfo in ShaderFields)
foreach (System.Reflection.FieldInfo fieldInfo in ShaderFields)
{
Type fieldType = fieldInfo.FieldType;
string fieldName = fieldInfo.Name;
object fieldValue = fieldInfo.GetValue(ShaderInstance);
FieldInfoBase processedFieldInfo;
FieldInfo processedFieldInfo;
// Read write buffer
if (HlslKnownTypes.IsReadWriteBufferType(fieldType))