Fixed shader not loading non public instance members

このコミットが含まれているのは:
Sergio Pedri committed 2020-04-13 02:57:59 +02:00
1 親 b457c99457
コミット bc49147e8e
1ファイル変更
+1 -1
+1 -1
ファイルの表示
@@ -125,7 +125,7 @@ namespace ComputeSharp.Shaders.Translation
/// <param name="shader">The boxed <typeparamref name="T"/> instance to use to build the shader</param>
private void LoadFieldsInfo(object shader)
{
IReadOnlyList<FieldInfo> shaderFields = typeof(T).GetFields().ToArray();
IReadOnlyList<FieldInfo> shaderFields = typeof(T).GetFields(BindingFlags.Instance | BindingFlags.NonPublic).ToArray();
if (shaderFields.Count == 0) throw new InvalidOperationException("Empty shader body");