Minor code style tweaks

このコミットが含まれているのは:
Sergio Pedri committed 2020-11-16 17:06:04 +01:00
1 親 3e6f9d27c9
コミット 5ffa20e548
5ファイル変更
+69 -62

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

+13 -12
ファイルの表示
@@ -3,25 +3,26 @@
namespace ComputeSharp.Shaders.Renderer.Models.Fields.Abstract
{
/// <summary>
/// A <see langword="class"/> that contains info on a shader buffer field
/// A <see langword="class"/> that contains info on a shader buffer field.
/// </summary>
internal abstract class HlslBufferInfo : CapturedFieldInfo
{
/// <summary>
/// Gets or sets the index of the current buffer, relative to its own type
/// Creates a new <see cref="HlslBufferInfo"/> instance with the specified parameters.
/// </summary>
public int BufferIndex { get; set; }
/// <summary>
/// Creates a new <see cref="HlslBufferInfo"/> instance with the specified parameters
/// </summary>
/// <param name="fieldCsharpType">The type of the current field in the C# source</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader</param>
/// <param name="fieldName">The name of the current field</param>
/// <param name="bufferIndex">The index of the current buffer field</param>
protected HlslBufferInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex) : base(fieldCsharpType, fieldHlslType, fieldName)
/// <param name="fieldCsharpType">The type of the current field in the C# source.</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader.</param>
/// <param name="fieldName">The name of the current field.</param>
/// <param name="bufferIndex">The index of the current buffer field.</param>
protected HlslBufferInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex)
: base(fieldCsharpType, fieldHlslType, fieldName)
{
BufferIndex = bufferIndex;
}
/// <summary>
/// Gets or sets the index of the current buffer, relative to its own type.
/// </summary>
public int BufferIndex { get; set; }
}
}
+20 -20
ファイルの表示
@@ -4,36 +4,36 @@ using System;
namespace ComputeSharp.Shaders.Renderer.Models.Fields
{
/// <summary>
/// A <see langword="class"/> that contains info on a shader field
/// A <see langword="class"/> that contains info on a shader field.
/// </summary>
internal class CapturedFieldInfo
{
/// <summary>
/// Gets the type of the current field in the C# source
/// Creates a new <see cref="CapturedFieldInfo"/> instance with the specified parameters.
/// </summary>
public string FieldCsharpType { get; }
/// <summary>
/// Gets the type of the current field in the HLSL shader
/// </summary>
public string FieldHlslType { get; }
/// <summary>
/// Gets the name to use for the current field
/// </summary>
public string FieldName { get; }
/// <summary>
/// Creates a new <see cref="CapturedFieldInfo"/> instance with the specified parameters
/// </summary>
/// <param name="fieldCsharpType">The type of the current field in the C# source</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader</param>
/// <param name="fieldName">The name to use for the current field</param>
/// <param name="fieldCsharpType">The type of the current field in the C# source.</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader.</param>
/// <param name="fieldName">The name to use for the current field.</param>
public CapturedFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName)
{
FieldCsharpType = fieldCsharpType.ToFriendlyString();
FieldHlslType = fieldHlslType;
FieldName = fieldName;
}
/// <summary>
/// Gets the type of the current field in the C# source.
/// </summary>
public string FieldCsharpType { get; }
/// <summary>
/// Gets the type of the current field in the HLSL shader.
/// </summary>
public string FieldHlslType { get; }
/// <summary>
/// Gets the name to use for the current field.
/// </summary>
public string FieldName { get; }
}
}
+12 -10
ファイルの表示
@@ -4,23 +4,25 @@ using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract;
namespace ComputeSharp.Shaders.Renderer.Models.Fields
{
/// <summary>
/// A <see langword="class"/> that contains info on a constant buffer field
/// A <see langword="class"/> that contains info on a constant buffer field.
/// </summary>
internal sealed class ConstantBufferFieldInfo : HlslBufferInfo
{
/// <summary>
/// Gets whether or not the current <see cref="CapturedFieldInfo"/> instance represents a constant buffer (always <see langword="true"/>)
/// Creates a new <see cref="ConstantBufferFieldInfo"/> instance with the specified parameters.
/// </summary>
public bool IsConstantBuffer { get; } = true;
/// <param name="fieldCsharpType">The type of the current field in the C# source.</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader.</param>
/// <param name="fieldName">The name of the current field.</param>
/// <param name="bufferIndex">The index of the current constant buffer field.</param>
public ConstantBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex)
: base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex)
{
}
/// <summary>
/// Creates a new <see cref="ConstantBufferFieldInfo"/> instance with the specified parameters
/// Gets whether or not the current <see cref="CapturedFieldInfo"/> instance represents a constant buffer (always <see langword="true"/>).
/// </summary>
/// <param name="fieldCsharpType">The type of the current field in the C# source</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader</param>
/// <param name="fieldName">The name of the current field</param>
/// <param name="bufferIndex">The index of the current constant buffer field</param>
public ConstantBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex)
: base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex) { }
public bool IsConstantBuffer { get; } = true;
}
}
+12 -10
ファイルの表示
@@ -4,23 +4,25 @@ using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract;
namespace ComputeSharp.Shaders.Renderer.Models.Fields
{
/// <summary>
/// A <see langword="class"/> that contains info on a readonly buffer field
/// A <see langword="class"/> that contains info on a readonly buffer field.
/// </summary>
internal sealed class ReadOnlyBufferFieldInfo : HlslBufferInfo
{
/// <summary>
/// Gets whether or not the current <see cref="CapturedFieldInfo"/> instance represents a readonly buffer (always <see langword="true"/>)
/// Creates a new <see cref="ReadOnlyBufferFieldInfo"/> instance with the specified parameters.
/// </summary>
public bool IsReadOnlyBuffer { get; } = true;
/// <param name="fieldCsharpType">The type of the current field in the C# source.</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader.</param>
/// <param name="fieldName">The name of the current field.</param>
/// <param name="bufferIndex">The index of the current readonly buffer field.</param>
public ReadOnlyBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex)
: base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex)
{
}
/// <summary>
/// Creates a new <see cref="ReadOnlyBufferFieldInfo"/> instance with the specified parameters
/// Gets whether or not the current <see cref="CapturedFieldInfo"/> instance represents a readonly buffer (always <see langword="true"/>).
/// </summary>
/// <param name="fieldCsharpType">The type of the current field in the C# source</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader</param>
/// <param name="fieldName">The name of the current field</param>
/// <param name="bufferIndex">The index of the current readonly buffer field</param>
public ReadOnlyBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex)
: base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex) { }
public bool IsReadOnlyBuffer { get; } = true;
}
}
+12 -10
ファイルの表示
@@ -4,23 +4,25 @@ using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract;
namespace ComputeSharp.Shaders.Renderer.Models.Fields
{
/// <summary>
/// A <see langword="class"/> that contains info on a read write buffer field
/// A <see langword="class"/> that contains info on a read write buffer field.
/// </summary>
internal sealed class ReadWriteBufferFieldInfo : HlslBufferInfo
{
/// <summary>
/// Gets whether or not the current <see cref="CapturedFieldInfo"/> instance represents a read write buffer (always <see langword="true"/>)
/// Creates a new <see cref="ReadWriteBufferFieldInfo"/> instance with the specified parameters.
/// </summary>
public bool IsReadWriteBuffer { get; } = true;
/// <param name="fieldCsharpType">The type of the current field in the C# source.</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader.</param>
/// <param name="fieldName">The name of the current field.</param>
/// <param name="bufferIndex">The index of the current read write buffer field.</param>
public ReadWriteBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex)
: base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex)
{
}
/// <summary>
/// Creates a new <see cref="ReadWriteBufferFieldInfo"/> instance with the specified parameters
/// Gets whether or not the current <see cref="CapturedFieldInfo"/> instance represents a read write buffer (always <see langword="true"/>).
/// </summary>
/// <param name="fieldCsharpType">The type of the current field in the C# source</param>
/// <param name="fieldHlslType">The type of the current field in the HLSL shader</param>
/// <param name="fieldName">The name of the current field</param>
/// <param name="bufferIndex">The index of the current read write buffer field</param>
public ReadWriteBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex)
: base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex) { }
public bool IsReadWriteBuffer { get; } = true;
}
}