mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-25 07:56:33 +00:00
Add enums and API-agnostic handling for new task and mesh shader stages
* The enums are given after compute, to preserve indices for the normal vertex pipeline. * Mesh dispatches are considered a new action type, rather than being bundled into the `Drawcall` type. This will allow them to be distinguished by API backends as needed. The UI treats them as drawcalls * We apply this universally even though it's not relevant to D3D11/GL. It means a couple of empty array entries but it should not cause any significant issues. * Shader messages will be identified by group and thread as with compute shaders. For mesh shaders there is an additional subdivision to identify them by task group, since each task group can submit a grid of mesh groups.
This commit is contained in:
@@ -529,6 +529,68 @@ be emulated.
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(VertexInputAttribute);
|
||||
|
||||
DOCUMENT(R"(A task or mesh message's location.
|
||||
|
||||
.. data:: NotUsed
|
||||
|
||||
Set for values of task group/thread index when no task shaders were run.
|
||||
|
||||
Also set for values of a mesh group or thread index when that dimensionality is unused. For
|
||||
example if the shader declares a group dimension of (128,1,1) then the y and z values for
|
||||
thread index will be indicated as not used.
|
||||
)");
|
||||
struct ShaderMeshMessageLocation
|
||||
{
|
||||
DOCUMENT("");
|
||||
ShaderMeshMessageLocation() = default;
|
||||
ShaderMeshMessageLocation(const ShaderMeshMessageLocation &) = default;
|
||||
ShaderMeshMessageLocation &operator=(const ShaderMeshMessageLocation &) = default;
|
||||
|
||||
bool operator==(const ShaderMeshMessageLocation &o) const
|
||||
{
|
||||
return taskGroup == o.taskGroup && meshGroup == o.meshGroup && thread == o.thread;
|
||||
}
|
||||
bool operator<(const ShaderMeshMessageLocation &o) const
|
||||
{
|
||||
if(!(taskGroup == o.taskGroup))
|
||||
return taskGroup < o.taskGroup;
|
||||
if(!(meshGroup == o.meshGroup))
|
||||
return meshGroup < o.meshGroup;
|
||||
if(!(thread == o.thread))
|
||||
return thread < o.thread;
|
||||
return false;
|
||||
}
|
||||
|
||||
DOCUMENT(R"(The task workgroup index between the task dispatch.
|
||||
|
||||
.. note::
|
||||
If no task shader is in use, this will be :data:`NotUsed`, :data:`NotUsed`, :data:`NotUsed`.
|
||||
|
||||
:type: Tuple[int,int,int]
|
||||
)");
|
||||
rdcfixedarray<uint32_t, 3> taskGroup;
|
||||
|
||||
DOCUMENT(R"(The mesh workgroup index within the dispatch or launching task workgroup.
|
||||
|
||||
:type: Tuple[int,int,int]
|
||||
)");
|
||||
rdcfixedarray<uint32_t, 3> meshGroup;
|
||||
|
||||
DOCUMENT(R"(The thread index within the workgroup, either for a task shader or mesh shader.
|
||||
|
||||
.. note::
|
||||
Since task shaders can only emit one set of meshes per group, the task thread is not relevant
|
||||
for mesh shader messages, so this is the thread either for a task or a mesh shader message.
|
||||
|
||||
:type: Tuple[int,int,int]
|
||||
)");
|
||||
rdcfixedarray<uint32_t, 3> thread;
|
||||
|
||||
static const uint32_t NotUsed = ~0U;
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(ShaderMeshMessageLocation);
|
||||
|
||||
DOCUMENT("A compute shader message's location.");
|
||||
struct ShaderComputeMessageLocation
|
||||
{
|
||||
@@ -664,6 +726,12 @@ union ShaderMessageLocation
|
||||
)");
|
||||
ShaderComputeMessageLocation compute;
|
||||
|
||||
DOCUMENT(R"(The location if the shader is a task or mesh shader.
|
||||
|
||||
:type: ShaderMeshMessageLocation
|
||||
)");
|
||||
ShaderMeshMessageLocation mesh;
|
||||
|
||||
DOCUMENT(R"(The location if the shader is a vertex shader.
|
||||
|
||||
:type: ShaderVertexMessageLocation
|
||||
@@ -696,7 +764,7 @@ struct ShaderMessage
|
||||
bool operator==(const ShaderMessage &o) const
|
||||
{
|
||||
return stage == o.stage && disassemblyLine == o.disassemblyLine &&
|
||||
location.compute == o.location.compute && message == o.message;
|
||||
location.mesh == o.location.mesh && message == o.message;
|
||||
}
|
||||
bool operator<(const ShaderMessage &o) const
|
||||
{
|
||||
@@ -704,8 +772,8 @@ struct ShaderMessage
|
||||
return stage < o.stage;
|
||||
if(!(disassemblyLine == o.disassemblyLine))
|
||||
return disassemblyLine < o.disassemblyLine;
|
||||
if(!(location.compute == o.location.compute))
|
||||
return location.compute < o.location.compute;
|
||||
if(!(location.mesh == o.location.mesh))
|
||||
return location.mesh < o.location.mesh;
|
||||
if(!(message == o.message))
|
||||
return message < o.message;
|
||||
return false;
|
||||
|
||||
@@ -31,6 +31,59 @@
|
||||
#include "rdcarray.h"
|
||||
#include "replay_enums.h"
|
||||
|
||||
DOCUMENT(R"(The size information for a task group.
|
||||
)");
|
||||
struct TaskGroupSize
|
||||
{
|
||||
DOCUMENT("The size in the x dimension.");
|
||||
uint32_t x;
|
||||
DOCUMENT("The size in the y dimension.");
|
||||
uint32_t y;
|
||||
DOCUMENT("The size in the z dimension.");
|
||||
uint32_t z;
|
||||
|
||||
bool operator==(const TaskGroupSize &o) const { return x == o.x && y == o.y && z == o.z; }
|
||||
bool operator<(const TaskGroupSize &o) const
|
||||
{
|
||||
if(!(x == o.x))
|
||||
return x < o.x;
|
||||
if(!(y == o.y))
|
||||
return y < o.y;
|
||||
if(!(z == o.z))
|
||||
return z < o.z;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(TaskGroupSize);
|
||||
|
||||
DOCUMENT(R"(The size information for a meshlet.
|
||||
)");
|
||||
struct MeshletSize
|
||||
{
|
||||
DOCUMENT("The number of indices in the meshlet.");
|
||||
uint32_t numIndices;
|
||||
DOCUMENT(R"(The number of vertices in this meshlet. This may be larger or smaller than the number
|
||||
of indices.
|
||||
)");
|
||||
uint32_t numVertices;
|
||||
|
||||
bool operator==(const MeshletSize &o) const
|
||||
{
|
||||
return numIndices == o.numIndices && numVertices == o.numVertices;
|
||||
}
|
||||
bool operator<(const MeshletSize &o) const
|
||||
{
|
||||
if(!(numIndices == o.numIndices))
|
||||
return numIndices < o.numIndices;
|
||||
if(!(numVertices == o.numVertices))
|
||||
return numVertices < o.numVertices;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(MeshletSize);
|
||||
|
||||
DOCUMENT(R"(Contains the details of a single element of data (such as position or texture
|
||||
co-ordinates) within a mesh.
|
||||
)");
|
||||
@@ -60,6 +113,54 @@ struct MeshFormat
|
||||
DOCUMENT("The number of bytes to use from the vertex buffer. Only valid on APIs that allow it.");
|
||||
uint64_t vertexByteSize = 0;
|
||||
|
||||
DOCUMENT(R"(The size of each meshlet, for a meshlet based draw.
|
||||
|
||||
Each meshlet lists its individual size, but a cumulative sum can be used for defining boundaries
|
||||
between meshlets either by raw vertex order (using the number of indices) or by index value (using
|
||||
the number of vertices).
|
||||
|
||||
:type: List[MeshletSize]
|
||||
)");
|
||||
rdcarray<MeshletSize> meshletSizes;
|
||||
|
||||
DOCUMENT(R"(The size of each task group's dispatch, for a meshlet based draw.
|
||||
|
||||
Each group of a task shader within a dispatch can itself fill out a payload and dispatch a number
|
||||
of mesh groups. This list contains the 3-dimensional dimension that each task group emitted.
|
||||
|
||||
:type: List[TaskGroupSize]
|
||||
)");
|
||||
rdcarray<TaskGroupSize> taskSizes;
|
||||
|
||||
DOCUMENT(R"(If showing a set of meshlets that don't start from meshlet 0, this is the number of
|
||||
meshlet to consider skipped before :data:`meshletSizes`.
|
||||
|
||||
Primarily useful for keeping a consistent colouring of meshlets when filtering to a subset
|
||||
|
||||
See also :data:`meshletIndexOffset`.
|
||||
)");
|
||||
uint32_t meshletOffset = 0;
|
||||
|
||||
DOCUMENT(R"(If showing a set of meshlets that don't start from index 0, this is the number of
|
||||
vertices to consider skipped before :data:`meshletSizes` - equivalent to baseVertex.
|
||||
|
||||
Primarily useful for keeping a consistent colouring of meshlets when filtering to a subset
|
||||
|
||||
See also :data:`meshletOffset`.
|
||||
)");
|
||||
uint32_t meshletIndexOffset = 0;
|
||||
|
||||
DOCUMENT(R"(The offset in bytes to the start of the per-primitive rate vertex data.
|
||||
|
||||
Only for meshlet outputs.
|
||||
)");
|
||||
uint64_t perPrimitiveOffset = 0;
|
||||
DOCUMENT(R"(The stride in bytes of the per-primitive rate vertex data.
|
||||
|
||||
Only for meshlet outputs.
|
||||
)");
|
||||
uint32_t perPrimitiveStride = 0;
|
||||
|
||||
DOCUMENT(R"(The format description of this mesh components elements.
|
||||
|
||||
:type: ResourceFormat
|
||||
@@ -130,7 +231,7 @@ struct MeshDisplay
|
||||
MeshDisplay &operator=(const MeshDisplay &) = default;
|
||||
|
||||
DOCUMENT("The :class:`MeshDataStage` where this mesh data comes from.");
|
||||
MeshDataStage type = MeshDataStage::Unknown;
|
||||
MeshDataStage type = MeshDataStage::VSIn;
|
||||
|
||||
DOCUMENT(R"(The camera to use when rendering all of the meshes.
|
||||
|
||||
|
||||
@@ -974,6 +974,16 @@ struct State
|
||||
:type: D3D12Shader
|
||||
)");
|
||||
Shader computeShader;
|
||||
DOCUMENT(R"(The amplification shader stage.
|
||||
|
||||
:type: D3D12Shader
|
||||
)");
|
||||
Shader ampShader;
|
||||
DOCUMENT(R"(The mesh shader stage.
|
||||
|
||||
:type: D3D12Shader
|
||||
)");
|
||||
Shader meshShader;
|
||||
|
||||
DOCUMENT(R"(The stream-out pipeline stage.
|
||||
|
||||
|
||||
@@ -442,4 +442,8 @@ private:
|
||||
const D3D12Pipe::Shader &GetD3D12Stage(ShaderStage stage) const;
|
||||
const GLPipe::Shader &GetGLStage(ShaderStage stage) const;
|
||||
const VKPipe::Shader &GetVulkanStage(ShaderStage stage) const;
|
||||
bool IsD3D11Stage(ShaderStage stage) const;
|
||||
bool IsD3D12Stage(ShaderStage stage) const;
|
||||
bool IsGLStage(ShaderStage stage) const;
|
||||
bool IsVulkanStage(ShaderStage stage) const;
|
||||
};
|
||||
|
||||
@@ -62,6 +62,8 @@ rdcstr PipeState::Abbrev(ShaderStage stage) const
|
||||
case ShaderStage::Geometry: return "GS";
|
||||
case ShaderStage::Fragment: return "FS";
|
||||
case ShaderStage::Compute: return "CS";
|
||||
case ShaderStage::Task: return "TS";
|
||||
case ShaderStage::Mesh: return "MS";
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -75,6 +77,8 @@ rdcstr PipeState::Abbrev(ShaderStage stage) const
|
||||
case ShaderStage::Geometry: return "GS";
|
||||
case ShaderStage::Pixel: return "PS";
|
||||
case ShaderStage::Compute: return "CS";
|
||||
case ShaderStage::Amplification: return "AS";
|
||||
case ShaderStage::Mesh: return "MS";
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -92,6 +96,62 @@ rdcstr PipeState::OutputAbbrev() const
|
||||
return "RT";
|
||||
}
|
||||
|
||||
bool PipeState::IsD3D11Stage(ShaderStage stage) const
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case ShaderStage::Vertex:
|
||||
case ShaderStage::Domain:
|
||||
case ShaderStage::Hull:
|
||||
case ShaderStage::Geometry:
|
||||
case ShaderStage::Pixel:
|
||||
case ShaderStage::Compute: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool PipeState::IsD3D12Stage(ShaderStage stage) const
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case ShaderStage::Vertex:
|
||||
case ShaderStage::Domain:
|
||||
case ShaderStage::Hull:
|
||||
case ShaderStage::Geometry:
|
||||
case ShaderStage::Pixel:
|
||||
case ShaderStage::Compute: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool PipeState::IsGLStage(ShaderStage stage) const
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case ShaderStage::Vertex:
|
||||
case ShaderStage::Domain:
|
||||
case ShaderStage::Hull:
|
||||
case ShaderStage::Geometry:
|
||||
case ShaderStage::Pixel:
|
||||
case ShaderStage::Compute: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool PipeState::IsVulkanStage(ShaderStage stage) const
|
||||
{
|
||||
switch(stage)
|
||||
{
|
||||
case ShaderStage::Vertex:
|
||||
case ShaderStage::Domain:
|
||||
case ShaderStage::Hull:
|
||||
case ShaderStage::Geometry:
|
||||
case ShaderStage::Pixel:
|
||||
case ShaderStage::Compute: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
const D3D11Pipe::Shader &PipeState::GetD3D11Stage(ShaderStage stage) const
|
||||
{
|
||||
if(stage == ShaderStage::Vertex)
|
||||
@@ -952,6 +1012,9 @@ BoundCBuffer PipeState::GetConstantBuffer(ShaderStage stage, uint32_t BufIdx, ui
|
||||
{
|
||||
if(IsCaptureD3D11())
|
||||
{
|
||||
if(!IsD3D11Stage(stage))
|
||||
return ret;
|
||||
|
||||
const D3D11Pipe::Shader &s = GetD3D11Stage(stage);
|
||||
|
||||
if(s.reflection != NULL && BufIdx < (uint32_t)s.reflection->constantBlocks.count())
|
||||
@@ -971,6 +1034,9 @@ BoundCBuffer PipeState::GetConstantBuffer(ShaderStage stage, uint32_t BufIdx, ui
|
||||
}
|
||||
else if(IsCaptureD3D12())
|
||||
{
|
||||
if(!IsD3D12Stage(stage))
|
||||
return ret;
|
||||
|
||||
const D3D12Pipe::Shader &s = GetD3D12Stage(stage);
|
||||
|
||||
if(s.reflection != NULL && BufIdx < (uint32_t)s.reflection->constantBlocks.count())
|
||||
@@ -1014,6 +1080,9 @@ BoundCBuffer PipeState::GetConstantBuffer(ShaderStage stage, uint32_t BufIdx, ui
|
||||
}
|
||||
else if(IsCaptureGL())
|
||||
{
|
||||
if(!IsGLStage(stage))
|
||||
return ret;
|
||||
|
||||
const GLPipe::Shader &s = GetGLStage(stage);
|
||||
|
||||
if(s.reflection != NULL && BufIdx < (uint32_t)s.reflection->constantBlocks.count())
|
||||
@@ -1038,6 +1107,9 @@ BoundCBuffer PipeState::GetConstantBuffer(ShaderStage stage, uint32_t BufIdx, ui
|
||||
}
|
||||
else if(IsCaptureVK())
|
||||
{
|
||||
if(!IsVulkanStage(stage))
|
||||
return ret;
|
||||
|
||||
const VKPipe::Pipeline &pipe =
|
||||
stage == ShaderStage::Compute ? m_Vulkan->compute : m_Vulkan->graphics;
|
||||
const VKPipe::Shader &s = GetVulkanStage(stage);
|
||||
@@ -1150,6 +1222,9 @@ rdcarray<BoundResourceArray> PipeState::GetSamplers(ShaderStage stage) const
|
||||
{
|
||||
if(IsCaptureD3D11())
|
||||
{
|
||||
if(!IsD3D11Stage(stage))
|
||||
return ret;
|
||||
|
||||
const D3D11Pipe::Shader &s = GetD3D11Stage(stage);
|
||||
|
||||
ret.reserve(s.samplers.size());
|
||||
@@ -1168,6 +1243,9 @@ rdcarray<BoundResourceArray> PipeState::GetSamplers(ShaderStage stage) const
|
||||
}
|
||||
else if(IsCaptureD3D12())
|
||||
{
|
||||
if(!IsD3D12Stage(stage))
|
||||
return ret;
|
||||
|
||||
const D3D12Pipe::Shader &s = GetD3D12Stage(stage);
|
||||
|
||||
size_t size = s.bindpointMapping.samplers.size();
|
||||
@@ -1210,6 +1288,9 @@ rdcarray<BoundResourceArray> PipeState::GetSamplers(ShaderStage stage) const
|
||||
}
|
||||
else if(IsCaptureGL())
|
||||
{
|
||||
if(!IsGLStage(stage))
|
||||
return ret;
|
||||
|
||||
ret.reserve(m_GL->samplers.size());
|
||||
|
||||
for(int i = 0; i < m_GL->samplers.count(); i++)
|
||||
@@ -1226,6 +1307,9 @@ rdcarray<BoundResourceArray> PipeState::GetSamplers(ShaderStage stage) const
|
||||
}
|
||||
else if(IsCaptureVK())
|
||||
{
|
||||
if(!IsVulkanStage(stage))
|
||||
return ret;
|
||||
|
||||
const rdcarray<VKPipe::DescriptorSet> &descsets = stage == ShaderStage::Compute
|
||||
? m_Vulkan->compute.descriptorSets
|
||||
: m_Vulkan->graphics.descriptorSets;
|
||||
@@ -1282,6 +1366,9 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage,
|
||||
{
|
||||
if(IsCaptureD3D11())
|
||||
{
|
||||
if(!IsD3D11Stage(stage))
|
||||
return ret;
|
||||
|
||||
const D3D11Pipe::Shader &s = GetD3D11Stage(stage);
|
||||
|
||||
ret.reserve(s.srvs.size());
|
||||
@@ -1303,6 +1390,9 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage,
|
||||
}
|
||||
else if(IsCaptureD3D12())
|
||||
{
|
||||
if(!IsD3D12Stage(stage))
|
||||
return ret;
|
||||
|
||||
const D3D12Pipe::Shader &s = GetD3D12Stage(stage);
|
||||
|
||||
size_t size = s.bindpointMapping.readOnlyResources.size();
|
||||
@@ -1370,6 +1460,9 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage,
|
||||
}
|
||||
else if(IsCaptureGL())
|
||||
{
|
||||
if(!IsGLStage(stage))
|
||||
return ret;
|
||||
|
||||
ret.reserve(m_GL->textures.size());
|
||||
|
||||
for(int i = 0; i < m_GL->textures.count(); i++)
|
||||
@@ -1389,6 +1482,9 @@ rdcarray<BoundResourceArray> PipeState::GetReadOnlyResources(ShaderStage stage,
|
||||
}
|
||||
else if(IsCaptureVK())
|
||||
{
|
||||
if(!IsVulkanStage(stage))
|
||||
return ret;
|
||||
|
||||
const rdcarray<VKPipe::DescriptorSet> &descsets = stage == ShaderStage::Compute
|
||||
? m_Vulkan->compute.descriptorSets
|
||||
: m_Vulkan->graphics.descriptorSets;
|
||||
@@ -1478,6 +1574,9 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage,
|
||||
{
|
||||
if(IsCaptureD3D11())
|
||||
{
|
||||
if(!IsD3D11Stage(stage))
|
||||
return ret;
|
||||
|
||||
if(stage == ShaderStage::Compute)
|
||||
{
|
||||
ret.reserve(m_D3D11->computeShader.uavs.size());
|
||||
@@ -1526,6 +1625,9 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage,
|
||||
}
|
||||
else if(IsCaptureD3D12())
|
||||
{
|
||||
if(!IsD3D12Stage(stage))
|
||||
return ret;
|
||||
|
||||
const D3D12Pipe::Shader &s = GetD3D12Stage(stage);
|
||||
|
||||
size_t size = s.bindpointMapping.readWriteResources.size();
|
||||
@@ -1591,6 +1693,9 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage,
|
||||
}
|
||||
else if(IsCaptureGL())
|
||||
{
|
||||
if(!IsGLStage(stage))
|
||||
return ret;
|
||||
|
||||
ret.reserve(m_GL->images.size() + m_GL->atomicBuffers.size() +
|
||||
m_GL->shaderStorageBuffers.size());
|
||||
|
||||
@@ -1629,6 +1734,9 @@ rdcarray<BoundResourceArray> PipeState::GetReadWriteResources(ShaderStage stage,
|
||||
}
|
||||
else if(IsCaptureVK())
|
||||
{
|
||||
if(!IsVulkanStage(stage))
|
||||
return ret;
|
||||
|
||||
const rdcarray<VKPipe::DescriptorSet> &descsets = stage == ShaderStage::Compute
|
||||
? m_Vulkan->compute.descriptorSets
|
||||
: m_Vulkan->graphics.descriptorSets;
|
||||
|
||||
@@ -692,6 +692,7 @@ rdcstr DoStringise(const ShaderBuiltin &el)
|
||||
STRINGISE_ENUM_CLASS_NAMED(PackedFragRate, "Packed Fragment Rate");
|
||||
STRINGISE_ENUM_CLASS_NAMED(Barycentrics, "Barycentrics");
|
||||
STRINGISE_ENUM_CLASS_NAMED(CullPrimitive, "Cull Primitive Output");
|
||||
STRINGISE_ENUM_CLASS_NAMED(OutputIndices, "Output Indices");
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
@@ -918,6 +919,8 @@ rdcstr DoStringise(const GPUCounter &el)
|
||||
STRINGISE_ENUM_CLASS(GSInvocations);
|
||||
STRINGISE_ENUM_CLASS(PSInvocations);
|
||||
STRINGISE_ENUM_CLASS(CSInvocations);
|
||||
STRINGISE_ENUM_CLASS(TSInvocations);
|
||||
STRINGISE_ENUM_CLASS(MSInvocations);
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
@@ -948,6 +951,8 @@ rdcstr DoStringise(const ShaderStage &el)
|
||||
STRINGISE_ENUM_CLASS(Geometry);
|
||||
STRINGISE_ENUM_CLASS(Pixel);
|
||||
STRINGISE_ENUM_CLASS(Compute);
|
||||
STRINGISE_ENUM_CLASS(Task);
|
||||
STRINGISE_ENUM_CLASS(Mesh);
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
@@ -957,10 +962,11 @@ rdcstr DoStringise(const MeshDataStage &el)
|
||||
{
|
||||
BEGIN_ENUM_STRINGISE(MeshDataStage)
|
||||
{
|
||||
STRINGISE_ENUM_CLASS(Unknown);
|
||||
STRINGISE_ENUM_CLASS(VSIn);
|
||||
STRINGISE_ENUM_CLASS(VSOut);
|
||||
STRINGISE_ENUM_CLASS(GSOut);
|
||||
STRINGISE_ENUM_CLASS(TaskOut);
|
||||
STRINGISE_ENUM_CLASS(MeshOut);
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
@@ -1214,6 +1220,7 @@ rdcstr DoStringise(const ActionFlags &el)
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Clear);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Drawcall);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Dispatch);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(MeshDispatch);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(CmdList);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(SetMarker);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(PushMarker);
|
||||
@@ -1252,6 +1259,8 @@ rdcstr DoStringise(const ShaderStageMask &el)
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Geometry);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Pixel);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Compute);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Task);
|
||||
STRINGISE_BITFIELD_CLASS_BIT(Mesh);
|
||||
}
|
||||
END_BITFIELD_STRINGISE();
|
||||
}
|
||||
|
||||
@@ -831,7 +831,7 @@ enum class BindType : uint32_t
|
||||
|
||||
DECLARE_REFLECTION_ENUM(BindType);
|
||||
|
||||
DOCUMENT2(R"(Annotates a particular built-in input or output from a shader with a special meaning to
|
||||
DOCUMENT3(R"(Annotates a particular built-in input or output from a shader with a special meaning to
|
||||
the hardware or API.
|
||||
|
||||
Some of the built-in inputs or outputs can be declared multiple times in arrays or otherwise indexed
|
||||
@@ -929,6 +929,8 @@ to apply to multiple related things - see :data:`ClipDistance`, :data:`CullDista
|
||||
|
||||
This is related to :data:`GroupIndex` and :data:`DispatchThreadIndex`.
|
||||
|
||||
)",
|
||||
R"(
|
||||
.. data:: GSInstanceIndex
|
||||
|
||||
An input to the geometry shader giving the instance being run, if the geometry shader was setup to
|
||||
@@ -956,8 +958,6 @@ to apply to multiple related things - see :data:`ClipDistance`, :data:`CullDista
|
||||
in a pixel were covered by the rasterizer. As an output, it specifies which samples in the
|
||||
destination target should be updated.
|
||||
|
||||
)",
|
||||
R"(
|
||||
.. data:: MSAASamplePosition
|
||||
|
||||
An input to the pixel shader that contains the location of the current sample relative to the
|
||||
@@ -1034,6 +1034,8 @@ to apply to multiple related things - see :data:`ClipDistance`, :data:`CullDista
|
||||
|
||||
Indicates if the current invocation is a helper invocation.
|
||||
|
||||
)",
|
||||
R"(
|
||||
.. data:: SubgroupSize
|
||||
|
||||
The number of invocations in a subgroup.
|
||||
@@ -1103,6 +1105,10 @@ to apply to multiple related things - see :data:`ClipDistance`, :data:`CullDista
|
||||
.. data:: CullPrimitive
|
||||
|
||||
An output to indicate whether or not a primitive should be culled.
|
||||
|
||||
.. data:: OutputIndices
|
||||
|
||||
An output containing the indices for a meshlet.
|
||||
)");
|
||||
enum class ShaderBuiltin : uint32_t
|
||||
{
|
||||
@@ -1159,6 +1165,7 @@ enum class ShaderBuiltin : uint32_t
|
||||
PackedFragRate,
|
||||
Barycentrics,
|
||||
CullPrimitive,
|
||||
OutputIndices,
|
||||
Count,
|
||||
};
|
||||
|
||||
@@ -1191,10 +1198,6 @@ DECLARE_REFLECTION_ENUM(ReplayOutputType);
|
||||
|
||||
DOCUMENT(R"(Describes a particular stage in the geometry transformation pipeline.
|
||||
|
||||
.. data:: Unknown
|
||||
|
||||
Unknown or invalid stage.
|
||||
|
||||
.. data:: VSIn
|
||||
|
||||
The inputs to the vertex shader described by the explicit API vertex input bindings.
|
||||
@@ -1208,13 +1211,29 @@ DOCUMENT(R"(Describes a particular stage in the geometry transformation pipeline
|
||||
The final output from the last stage in the pipeline, be that tessellation or geometry shader.
|
||||
|
||||
This has possibly been expanded/multiplied from the inputs
|
||||
|
||||
.. data:: TaskOut
|
||||
|
||||
Data from a task/amplification shader.
|
||||
|
||||
.. data:: AmpOut
|
||||
|
||||
Data from an amplification shader (alias for :data:`TaskOut`).
|
||||
|
||||
.. data:: MeshOut
|
||||
|
||||
Data from a mesh shader.
|
||||
)");
|
||||
enum class MeshDataStage : uint32_t
|
||||
{
|
||||
Unknown = 0,
|
||||
VSIn,
|
||||
VSIn = 0,
|
||||
First = VSIn,
|
||||
VSOut,
|
||||
GSOut,
|
||||
TaskOut,
|
||||
AmpOut = TaskOut,
|
||||
MeshOut,
|
||||
Count,
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_ENUM(MeshDataStage);
|
||||
@@ -2336,6 +2355,18 @@ DOCUMENT(R"(The stage in a pipeline where a shader runs
|
||||
.. data:: Compute
|
||||
|
||||
The compute shader.
|
||||
|
||||
.. data:: Amplification
|
||||
|
||||
The amplification shader. See also :data:`Task`.
|
||||
|
||||
.. data:: Task
|
||||
|
||||
The task shader. See also :data:`Amplification`.
|
||||
|
||||
.. data:: Mesh
|
||||
|
||||
The mesh shader.
|
||||
)");
|
||||
enum class ShaderStage : uint32_t
|
||||
{
|
||||
@@ -2355,12 +2386,19 @@ enum class ShaderStage : uint32_t
|
||||
|
||||
Compute,
|
||||
|
||||
Task,
|
||||
Amplification = Task,
|
||||
|
||||
Mesh,
|
||||
|
||||
Count,
|
||||
};
|
||||
|
||||
ITERABLE_OPERATORS(ShaderStage);
|
||||
DECLARE_REFLECTION_ENUM(ShaderStage);
|
||||
|
||||
#define NumShaderStages arraydim<ShaderStage>()
|
||||
|
||||
template <typename integer>
|
||||
constexpr inline ShaderStage StageFromIndex(integer stage)
|
||||
{
|
||||
@@ -2528,7 +2566,7 @@ enum class MessageSource : uint32_t
|
||||
|
||||
DECLARE_REFLECTION_ENUM(MessageSource);
|
||||
|
||||
DOCUMENT(R"(How a resource is being used in the pipeline at a particular point.
|
||||
DOCUMENT2(R"(How a resource is being used in the pipeline at a particular point.
|
||||
|
||||
Note that a resource may be used for more than one thing in one event, see :class:`EventUsage`.
|
||||
|
||||
@@ -2570,6 +2608,15 @@ Note that a resource may be used for more than one thing in one event, see :clas
|
||||
|
||||
The resource is being used for constants in the :data:`compute shader <ShaderStage.Compute>`.
|
||||
|
||||
.. data:: TS_Constants
|
||||
|
||||
The resource is being used as a constants in the amplification or
|
||||
:data:`task shader <ShaderStage.Task>`.
|
||||
|
||||
.. data:: MS_Constants
|
||||
|
||||
The resource is being used as a constants in the :data:`mesh shader <ShaderStage.Mesh>`.
|
||||
|
||||
.. data:: All_Constants
|
||||
|
||||
The resource is being used for constants in all shader stages.
|
||||
@@ -2608,10 +2655,22 @@ Note that a resource may be used for more than one thing in one event, see :clas
|
||||
The resource is being used as a read-only resource in the
|
||||
:data:`compute shader <ShaderStage.Compute>`.
|
||||
|
||||
.. data:: TS_Resource
|
||||
|
||||
The resource is being used as a read-only resource in the amplification or
|
||||
:data:`task shader <ShaderStage.Task>`.
|
||||
|
||||
.. data:: MS_Resource
|
||||
|
||||
The resource is being used as a read-only resource in the
|
||||
:data:`mesh shader <ShaderStage.Mesh>`.
|
||||
|
||||
.. data:: All_Resource
|
||||
|
||||
The resource is being used as a read-only resource in all shader stages.
|
||||
|
||||
)",
|
||||
R"(
|
||||
.. data:: VS_RWResource
|
||||
|
||||
The resource is being used as a read-write resource in the
|
||||
@@ -2642,6 +2701,16 @@ Note that a resource may be used for more than one thing in one event, see :clas
|
||||
The resource is being used as a read-write resource in the
|
||||
:data:`compute shader <ShaderStage.Compute>`.
|
||||
|
||||
.. data:: TS_RWResource
|
||||
|
||||
The resource is being used as a read-write resource in the amplification or
|
||||
:data:`task shader <ShaderStage.Task>`.
|
||||
|
||||
.. data:: MS_RWResource
|
||||
|
||||
The resource is being used as a read-write resource in the
|
||||
:data:`mesh shader <ShaderStage.Mesh>`.
|
||||
|
||||
.. data:: All_RWResource
|
||||
|
||||
The resource is being used as a read-write resource in all shader stages.
|
||||
@@ -2720,6 +2789,8 @@ enum class ResourceUsage : uint32_t
|
||||
GS_Constants,
|
||||
PS_Constants,
|
||||
CS_Constants,
|
||||
TS_Constants,
|
||||
MS_Constants,
|
||||
|
||||
All_Constants,
|
||||
|
||||
@@ -2731,6 +2802,8 @@ enum class ResourceUsage : uint32_t
|
||||
GS_Resource,
|
||||
PS_Resource,
|
||||
CS_Resource,
|
||||
TS_Resource,
|
||||
MS_Resource,
|
||||
|
||||
All_Resource,
|
||||
|
||||
@@ -2740,6 +2813,8 @@ enum class ResourceUsage : uint32_t
|
||||
GS_RWResource,
|
||||
PS_RWResource,
|
||||
CS_RWResource,
|
||||
TS_RWResource,
|
||||
MS_RWResource,
|
||||
|
||||
All_RWResource,
|
||||
|
||||
@@ -2838,6 +2913,10 @@ DOCUMENT(R"(What kind of solid shading to use when rendering a mesh.
|
||||
|
||||
The mesh should be rendered using the secondary element as color.
|
||||
|
||||
.. data:: Meshlet
|
||||
|
||||
The mesh should be rendered colorising each meshlet differently.
|
||||
|
||||
)");
|
||||
enum class SolidShade : uint32_t
|
||||
{
|
||||
@@ -2845,6 +2924,7 @@ enum class SolidShade : uint32_t
|
||||
Solid,
|
||||
Lit,
|
||||
Secondary,
|
||||
Meshlet,
|
||||
Count,
|
||||
};
|
||||
|
||||
@@ -3495,6 +3575,18 @@ enumerated with IDs in the appropriate ranges.
|
||||
|
||||
Number of times a :data:`compute shader <ShaderStage.Compute>` was invoked.
|
||||
|
||||
.. data:: TSInvocations
|
||||
|
||||
Number of times a :data:`task shader <ShaderStage.Task>` was invoked.
|
||||
|
||||
.. data:: ASInvocations
|
||||
|
||||
Number of times a :data:`amplification shader <ShaderStage.Amplification>` was invoked.
|
||||
|
||||
.. data:: MSInvocations
|
||||
|
||||
Number of times a :data:`mesh shader <ShaderStage.Mesh>` was invoked.
|
||||
|
||||
.. data:: FirstAMD
|
||||
|
||||
The AMD-specific counter IDs start from this value.
|
||||
@@ -3554,6 +3646,9 @@ enum class GPUCounter : uint32_t
|
||||
PSInvocations,
|
||||
FSInvocations = PSInvocations,
|
||||
CSInvocations,
|
||||
ASInvocations,
|
||||
TSInvocations = ASInvocations,
|
||||
MSInvocations,
|
||||
Count,
|
||||
|
||||
// IHV specific counters can be set above this point
|
||||
@@ -4416,7 +4511,10 @@ enum class ShaderStageMask : uint32_t
|
||||
Pixel = 1 << uint32_t(ShaderStage::Pixel),
|
||||
Fragment = Pixel,
|
||||
Compute = 1 << uint32_t(ShaderStage::Compute),
|
||||
All = Vertex | Hull | Domain | Geometry | Pixel | Compute,
|
||||
Task = 1 << uint32_t(ShaderStage::Task),
|
||||
Amplification = Task,
|
||||
Mesh = 1 << uint32_t(ShaderStage::Mesh),
|
||||
All = Vertex | Hull | Domain | Geometry | Pixel | Compute | Task | Mesh,
|
||||
};
|
||||
|
||||
BITMASK_OPERATORS(ShaderStageMask);
|
||||
@@ -4541,6 +4639,10 @@ actions.
|
||||
|
||||
The action issues a number of compute workgroups.
|
||||
|
||||
.. data:: MeshDispatch
|
||||
|
||||
The action issues a number of mesh groups for a draw.
|
||||
|
||||
.. data:: CmdList
|
||||
|
||||
The action calls into a previously recorded child command list.
|
||||
@@ -4629,16 +4731,17 @@ enum class ActionFlags : uint32_t
|
||||
Clear = 0x0001,
|
||||
Drawcall = 0x0002,
|
||||
Dispatch = 0x0004,
|
||||
CmdList = 0x0008,
|
||||
SetMarker = 0x0010,
|
||||
PushMarker = 0x0020,
|
||||
PopMarker = 0x0040, // this is only for internal tracking use
|
||||
Present = 0x0080,
|
||||
MultiAction = 0x0100,
|
||||
Copy = 0x0200,
|
||||
Resolve = 0x0400,
|
||||
GenMips = 0x0800,
|
||||
PassBoundary = 0x1000,
|
||||
MeshDispatch = 0x0008,
|
||||
CmdList = 0x0010,
|
||||
SetMarker = 0x0020,
|
||||
PushMarker = 0x0040,
|
||||
PopMarker = 0x0080,
|
||||
Present = 0x0100,
|
||||
MultiAction = 0x0200,
|
||||
Copy = 0x0400,
|
||||
Resolve = 0x0800,
|
||||
GenMips = 0x1000,
|
||||
PassBoundary = 0x2000,
|
||||
|
||||
// flags
|
||||
Indexed = 0x010000,
|
||||
|
||||
@@ -930,7 +930,12 @@ struct SigParameter
|
||||
DOCUMENT("The combined semantic name and index.");
|
||||
rdcstr semanticIdxName;
|
||||
DOCUMENT("The semantic index of this variable - see :data:`semanticName`.");
|
||||
uint32_t semanticIndex = 0;
|
||||
uint16_t semanticIndex = 0;
|
||||
|
||||
DOCUMENT(
|
||||
"A flag indicating if this parameter is output at per-primitive rate rather than "
|
||||
"per-vertex.");
|
||||
bool perPrimitiveRate = false;
|
||||
|
||||
DOCUMENT(R"(The index of the shader register/binding used to store this signature element.
|
||||
|
||||
@@ -956,7 +961,7 @@ shader itself, for APIs that pack signatures together.
|
||||
DOCUMENT("A convenience flag - ``True`` if the semantic name is unique and no index is needed.");
|
||||
bool needSemanticIndex = false;
|
||||
|
||||
DOCUMENT("The number of components used to store this element. See :data:`compType`.");
|
||||
DOCUMENT("The number of components used to store this element. See :data:`varType`.");
|
||||
uint32_t compCount = 0;
|
||||
DOCUMENT(
|
||||
"Selects a stream for APIs that provide multiple output streams for the same named output.");
|
||||
@@ -1526,6 +1531,12 @@ struct ShaderReflection
|
||||
)");
|
||||
rdcfixedarray<uint32_t, 3> dispatchThreadsDimension;
|
||||
|
||||
DOCUMENT(R"(The output topology for geometry, tessellation and mesh shaders.
|
||||
|
||||
:type: Topology
|
||||
)");
|
||||
Topology outputTopology = Topology::Unknown;
|
||||
|
||||
DOCUMENT(R"(The input signature.
|
||||
|
||||
:type: List[SigParameter]
|
||||
@@ -1574,6 +1585,15 @@ struct ShaderReflection
|
||||
:type: List[ShaderConstantType]
|
||||
)");
|
||||
rdcarray<ShaderConstantType> pointerTypes;
|
||||
|
||||
DOCUMENT(R"(The block layout of the task-mesh communication payload.
|
||||
|
||||
Only relevant for task or mesh shaders, this gives the output payload (for task shaders) or the
|
||||
input payload (for mesh shaders)
|
||||
|
||||
:type: ConstantBlock
|
||||
)");
|
||||
ConstantBlock taskPayload;
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(ShaderReflection);
|
||||
|
||||
@@ -1394,6 +1394,18 @@ struct State
|
||||
)");
|
||||
Shader computeShader;
|
||||
|
||||
DOCUMENT(R"(The task shader stage.
|
||||
|
||||
:type: VKShader
|
||||
)");
|
||||
Shader taskShader;
|
||||
|
||||
DOCUMENT(R"(The mesh shader stage.
|
||||
|
||||
:type: VKShader
|
||||
)");
|
||||
Shader meshShader;
|
||||
|
||||
DOCUMENT(R"(The tessellation stage.
|
||||
|
||||
:type: VKTessellation
|
||||
|
||||
Reference in New Issue
Block a user