Initial switch to root constants for cbuffer resource
このコミットが含まれているのは:
1 親
2f6bf05c1b
コミット
1ed6a49210
7ファイル変更
+28
-54
検索条件に一致するファイルはありません
@@ -70,21 +70,21 @@ namespace ComputeSharp.Shaders.Translation.Models
|
||||
/// <summary>
|
||||
/// Gets a <see cref="ReadOnlySpan{T}"/> with the padded data representing all the captured variables.
|
||||
/// </summary>
|
||||
public unsafe ReadOnlySpan<Int4> Variables
|
||||
public unsafe ReadOnlySpan<uint> Variables
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
#if NET5_0
|
||||
ref byte r0 = ref MemoryMarshal.GetArrayDataReference(this.variablesArray);
|
||||
ref Int4 r1 = ref Unsafe.As<byte, Int4>(ref r0);
|
||||
int length = (int)((uint)this.variablesByteSize / (uint)sizeof(Int4));
|
||||
ref uint r1 = ref Unsafe.As<byte, uint>(ref r0);
|
||||
int length = (int)((uint)this.variablesByteSize / sizeof(uint));
|
||||
|
||||
return MemoryMarshal.CreateReadOnlySpan(ref r1, length);
|
||||
#else
|
||||
Span<byte> span = this.variablesArray.AsSpan(0, this.variablesByteSize);
|
||||
|
||||
return MemoryMarshal.Cast<byte, Int4>(span);
|
||||
return MemoryMarshal.Cast<byte, uint>(span);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace ComputeSharp.Shaders.Translation
|
||||
{
|
||||
// Resources and variables buffers
|
||||
ulong[] resources = ArrayPool<ulong>.Shared.Rent(this.totalResourceCount);
|
||||
byte[] variables = ArrayPool<byte>.Shared.Rent(4096);
|
||||
byte[] variables = ArrayPool<byte>.Shared.Rent(256);
|
||||
|
||||
ref ulong r0 = ref MemoryMarshal.GetArrayDataReference(resources);
|
||||
ref byte r1 = ref MemoryMarshal.GetArrayDataReference(variables);
|
||||
|
||||
@@ -164,11 +164,6 @@ namespace ComputeSharp.Shaders.Translation
|
||||
|
||||
List<D3D12_DESCRIPTOR_RANGE1> d3D12DescriptorRanges1 = new();
|
||||
|
||||
// Descriptor for the buffer for captured scalar/vector variables
|
||||
D3D12_DESCRIPTOR_RANGE1 d3D12DescriptorRange1 = new(D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, this.constantBuffersCount++);
|
||||
|
||||
d3D12DescriptorRanges1.Add(d3D12DescriptorRange1);
|
||||
|
||||
// Inspect the captured fields
|
||||
foreach (FieldInfo fieldInfo in shaderFields)
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする