Rejig how root signature data is organised in pipeline state

This commit is contained in:
baldurk
2016-09-20 17:28:37 +02:00
parent dbb0e4702e
commit d40b87aed0
2 changed files with 69 additions and 42 deletions
+31 -20
View File
@@ -161,37 +161,48 @@ struct D3D12PipelineState
ResourceId Buffer;
uint64_t Offset;
uint32_t ByteSize;
rdctype::array<uint32_t> Immediate;
};
struct RootSignature
{
ResourceId obj;
struct RootElem
// Immediate indicates either a root parameter (not in a table), or static samplers
// RootElement is the index in the original root signature that this descriptor came from.
struct CBufferDescriptor
{
ShaderStageBits VisibilityMask;
bool32 Immediate;
uint32_t RootElement;
// true for root constants and root descriptors
bool32 RootElement;
// for tables this is the expanded list of all the ranges and their values, for
// root constants and root descriptors there's only one element with their value
struct Descriptor
{
uint32_t RegSpace;
uint32_t RegIndex;
ShaderBindType Type;
rdctype::array<uint32_t> Constants;
CBuffer ConstantBuffer;
ResourceView View;
};
rdctype::array<Descriptor> Descriptors;
CBuffer obj;
};
rdctype::array<RootElem> Elements;
struct ViewDescriptor
{
ShaderStageBits VisibilityMask;
bool32 Immediate;
uint32_t RootElement;
ResourceView obj;
};
struct SamplerDescriptor
{
ShaderStageBits VisibilityMask;
bool32 Immediate;
uint32_t RootElement;
Sampler obj;
};
rdctype::array<CBufferDescriptor> ConstantBuffers;
rdctype::array<SamplerDescriptor> Samplers;
rdctype::array<ViewDescriptor> SRVs;
rdctype::array<ViewDescriptor> UAVs;
} m_RootSig;
struct Streamout
+38 -22
View File
@@ -164,6 +164,9 @@ namespace renderdoc
public ResourceId Buffer;
public UInt64 Offset;
public UInt32 ByteSize;
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public UInt32[] Immediate;
};
[StructLayout(LayoutKind.Sequential)]
@@ -172,33 +175,46 @@ namespace renderdoc
public ResourceId Obj;
[StructLayout(LayoutKind.Sequential)]
public class RootElem
public class CBufferDescriptor
{
public ShaderStageBits VisibilityMask;
public bool Immediate;
public UInt32 RootElement;
public bool RootElement;
[StructLayout(LayoutKind.Sequential)]
public class Descriptor
{
public UInt32 RegSpace;
public UInt32 RegIndex;
public ShaderBindType Type;
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public UInt32[] Constants;
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
CBuffer ConstantBuffer;
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
ResourceView View;
};
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public Descriptor[] Descriptors;
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
CBuffer obj;
};
[StructLayout(LayoutKind.Sequential)]
public class ViewDescriptor
{
public ShaderStageBits VisibilityMask;
public bool Immediate;
public UInt32 RootElement;
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
ResourceView obj;
};
[StructLayout(LayoutKind.Sequential)]
public class SamplerDescriptor
{
public ShaderStageBits VisibilityMask;
public bool Immediate;
public UInt32 RootElement;
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
Sampler obj;
};
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public RootElem[] Elements;
public CBufferDescriptor[] ConstantBuffers;
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public SamplerDescriptor[] Samplers;
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public ViewDescriptor[] SRVs;
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
public ViewDescriptor[] UAVs;
};
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
public RootSignature m_RootSig;