Skip to content

Commit db3181e

Browse files
committed
Implement D3D12 pipeline state, with shader resources
1 parent fa6bac0 commit db3181e

6 files changed

Lines changed: 2339 additions & 1848 deletions

File tree

renderdoc/driver/d3d12/d3d12_replay.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,10 @@ void D3D12Replay::MakePipelineState()
955955
if(rs.rtSingle)
956956
desc += i;
957957

958+
view.RootElement = (uint32_t)i;
959+
view.Immediate = false;
960+
view.VisibilityMask = eStageBits_All;
961+
958962
FillResourceView(view, desc);
959963
}
960964
}
@@ -968,6 +972,10 @@ void D3D12Replay::MakePipelineState()
968972
D3D12Descriptor *desc =
969973
(D3D12Descriptor *)heap->GetCPUDescriptorHandleForHeapStart().ptr + rs.dsv.index;
970974

975+
view.RootElement = 0;
976+
view.Immediate = false;
977+
view.VisibilityMask = eStageBits_All;
978+
971979
FillResourceView(view, desc);
972980
}
973981
}

renderdocui/Code/CommonPipelineState.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,15 @@ public void GetConstantBuffer(ShaderStageType stage, uint BufIdx, uint ArrayIdx,
970970
{
971971
var bind = s.BindpointMapping.ConstantBlocks[s.ShaderDetails.ConstantBlocks[BufIdx].bindPoint];
972972

973+
if (bind.bindset >= m_D3D12.m_RootSig.Spaces.Length ||
974+
bind.bind >= m_D3D12.m_RootSig.Spaces[bind.bindset].ConstantBuffers.Length)
975+
{
976+
buf = ResourceId.Null;
977+
ByteOffset = 0;
978+
ByteSize = 0;
979+
return;
980+
}
981+
973982
var descriptor = m_D3D12.m_RootSig.Spaces[bind.bindset].ConstantBuffers[bind.bind];
974983

975984
buf = descriptor.Buffer;

renderdocui/Interop/Enums.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ public enum ShaderStageType
334334
[Flags]
335335
public enum ShaderStageBits
336336
{
337+
None = 0,
337338
Vertex = (1 << ShaderStageType.Vertex),
338339
Hull = (1 << ShaderStageType.Hull),
339340
Tess_Control = (1 << ShaderStageType.Tess_Control),
@@ -343,6 +344,7 @@ public enum ShaderStageBits
343344
Pixel = (1 << ShaderStageType.Pixel),
344345
Fragment = (1 << ShaderStageType.Fragment),
345346
Compute = (1 << ShaderStageType.Compute),
347+
All = (Vertex | Hull | Domain | Geometry | Pixel | Fragment | Compute),
346348
};
347349

348350
public enum DebugMessageSource

0 commit comments

Comments
 (0)