graphics: skip draws of mesh shaders that exceed host mesh limits

This commit is contained in:
nmzik committed 2026-10-26 05:32:02 +01:00
1 parent 52c80be266
commit 560756f34c
2 files changed
+14 -2

No files matched your search

@@ -711,8 +711,15 @@ void PipelineCache::GetGraphicsPrograms(const CommandBuffer& command, DrawRender
mesh.max_vertices > limits.maxMeshOutputVertices || mesh.max_vertices > limits.maxMeshOutputVertices ||
mesh.max_primitives > limits.maxMeshOutputPrimitives || mesh.max_primitives > limits.maxMeshOutputPrimitives ||
mesh.lds_size_dwords * sizeof(uint32_t) > limits.maxMeshSharedMemorySize) { mesh.lds_size_dwords * sizeof(uint32_t) > limits.maxMeshSharedMemorySize) {
EXIT("mesh shader exceeds host limits: threads=%u vertices=%u primitives=%u LDS=%u\n", static std::atomic_bool warned = false;
host_threads, mesh.max_vertices, mesh.max_primitives, mesh.lds_size_dwords); if (!warned.exchange(true, std::memory_order_relaxed)) {
Log::WriteToConsoleAndLog(
fmt::format("Warning: skipping draws of mesh shaders that exceed host limits "
"(shader=0x{:016x} threads={} vertices={} primitives={} LDS={}).\n",
vertex_params[0].hash, host_threads, mesh.max_vertices,
mesh.max_primitives, mesh.lds_size_dwords));
}
return;
} }
} }
ShaderParams pixel_params; ShaderParams pixel_params;
@@ -843,6 +843,11 @@ bool RenderExecutor::PrepareDrawRenderState(CommandBuffer& buffer, const DrawCal
LogDrawPhase(draw.Name(), "GetGraphicsPrograms"); LogDrawPhase(draw.Name(), "GetGraphicsPrograms");
} }
m_context.GetPipelineCache().GetGraphicsPrograms(buffer, state); m_context.GetPipelineCache().GetGraphicsPrograms(buffer, state);
// Vertex programs beyond the host mesh limits or with unsupported call targets are not
// compiled.
if (state.vertex_info[0].stage.module == nullptr) {
return false;
}
if (draw.IsIndexed()) { if (draw.IsIndexed()) {
LogDrawPhase(draw.Name(), "ResolveRenderColorTarget"); LogDrawPhase(draw.Name(), "ResolveRenderColorTarget");
} }