Skip to content

Commit e4b4cb0

Browse files
committed
D3D12 Pixel shader debug support for Mesh shader generated primitives
1 parent 90827de commit e4b4cb0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

renderdoc/driver/d3d12/d3d12_shaderdebug.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,6 +2350,13 @@ ShaderDebugTrace *D3D12Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t
23502350
if(ds)
23512351
prevDxbc = ds->GetDXBC();
23522352
}
2353+
// Check for mesh shader next
2354+
if(prevDxbc == NULL)
2355+
{
2356+
WrappedID3D12Shader *ms = (WrappedID3D12Shader *)pso->graphics->MS.pShaderBytecode;
2357+
if(ms)
2358+
prevDxbc = ms->GetDXBC();
2359+
}
23532360
// Check for vertex shader last
23542361
if(prevDxbc == NULL)
23552362
{
@@ -2378,10 +2385,11 @@ ShaderDebugTrace *D3D12Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t
23782385

23792386
uint32_t overdrawLevels = 100; // maximum number of overdraw levels
23802387

2381-
// If the pipe contains a geometry shader, then SV_PrimitiveID cannot be used in the pixel shader
2382-
// without being emitted from the geometry shader. For now, check if this semantic will succeed in
2383-
// a new pixel shader with the rest of the pipe unchanged
2384-
bool usePrimitiveID = (prevDxbc->m_Type != ShaderType::Geometry);
2388+
// If the pipe contains a mesh/geometry shader, then SV_PrimitiveID cannot be used in the pixel
2389+
// shader without being emitted from the mesh/geometry shader. For now, check if this semantic
2390+
// will succeed in a new pixel shader with the rest of the pipe unchanged
2391+
bool usePrimitiveID =
2392+
((prevDxbc->m_Type != ShaderType::Geometry) && (prevDxbc->m_Type != ShaderType::Mesh));
23852393
for(const PSInputElement &e : initialValues)
23862394
{
23872395
if(e.sysattribute == ShaderBuiltin::PrimitiveIndex)

0 commit comments

Comments
 (0)