{"record":{"id":"aecd3d50ec4a6691","repo":"stride3d/stride","slug":"creation-of-additional-command-lists-is-not-supported-for","errorCode":null,"errorMessage":"Creation of additional Command Lists is not supported for Direct3D 11","messagePattern":"Creation of additional Command Lists is not supported for Direct3D 11","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Graphics/Direct3D11/CommandList.Direct3D11.cs","lineNumber":69,"sourceCode":"        /// <summary>\n        ///   Gets the internal Direct3D 11 Device Context.\n        /// </summary>\n        /// <remarks>\n        ///   If the reference is going to be kept, use <c>AddRef()</c> on the COM pointer to increment the internal\n        ///   reference count, and <see cref=\"ComPtr{T}.Dispose()\"/> when no longer needed to release the object.\n        /// </remarks>\n        internal ComPtr<ID3D11DeviceContext> NativeDeviceContext => ToComPtr(nativeDeviceContext);\n\n\n        /// <summary>\n        ///   Creates a new <see cref=\"CommandList\"/>.\n        /// </summary>\n        /// <param name=\"device\">The Graphics Device.</param>\n        /// <returns>The new instance of <see cref=\"CommandList\"/>.</returns>\n        /// <exception cref=\"InvalidOperationException\">Creation of additional Command Lists is not supported for Direct3D 11.</exception>\n        public static CommandList New(GraphicsDevice device)\n        {\n            throw new InvalidOperationException(\"Creation of additional Command Lists is not supported for Direct3D 11\");\n        }\n\n        /// <summary>\n        ///   Initializes a new instance of the <see cref=\"CommandList\"/> class.\n        /// </summary>\n        /// <param name=\"device\">The Graphics Device.</param>\n        internal CommandList(GraphicsDevice device) : base(device)\n        {\n            // We just take ownership of the native device context. No need to call AddRef() on it\n            nativeDeviceContext = device.NativeDeviceContext.Handle;\n            SetNativeDeviceChild(NativeDeviceContext.AsDeviceChild());\n\n            ComPtr<ID3DUserDefinedAnnotation> deviceProfiler = default;\n            if (device.IsDebugMode)\n            {\n                HResult result = nativeDeviceContext->QueryInterface(out deviceProfiler);\n                if (result.IsFailure)\n                    deviceProfiler = null;","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Graphics/Direct3D11/CommandList.Direct3D11.cs#L51-L87","documentation":"D3D11 only supports a single immediate-command-list model per device context, unlike D3D12/Vulkan which support multiple deferred command lists. CommandList.New(GraphicsDevice) exists to satisfy the cross-backend API surface, but on Direct3D 11 it always throws InvalidOperationException instead of creating an extra CommandList.","triggerScenarios":"Calling the static CommandList.New(device) on a GraphicsDevice whose backend is Direct3D 11 — typically in backend-agnostic code that creates additional command lists for multithreaded or deferred rendering.","commonSituations":"Porting D3D12/Vulkan-era Stride code (or generic sample code) to a D3D11 project; attempting parallel command recording with a second CommandList; factory-style command list creation shared across graphics backends.","solutions":["Reuse the existing CommandList (e.g. GraphicsDevice's immediate command list) instead of creating new ones.","Upgrade the graphics backend to Direct3D 12 if multiple command lists/parallel recording is required.","Restructure work to be single-threaded command recording on D3D11, or use per-thread rendering with separate GraphicsDevice instances (heavyweight)."],"exampleFix":"// before\nvar cmdList = CommandList.New(graphicsDevice);\ncmdList.Begin(graphicsDevice);\n// after\nvar cmdList = graphicsDevice.Commands.CommandList; // reuse the immediate command list on D3D11","handlingStrategy":"try-catch","validationCode":"if (device.Backend == GraphicsBackend.Direct3D11 && needExtraCommandList)\n    throw new NotSupportedException(\"D3D11 supports only the immediate command list\");","typeGuard":"bool SupportsAdditionalCommandLists(GraphicsDevice d) => d.Backend is not GraphicsBackend.Direct3D11;","tryCatchPattern":"try { cmdList = CommandList.New(device); }\ncatch (InvalidOperationException)\n{ cmdList = device.Commands.CommandList; /* reuse immediate command list */ }","preventionTips":["Check graphics backend before writing multi-command-list code","Design rendering code around a single command list when targeting D3D11","Upgrade to D3D12 for parallel command recording"],"tags":["direct3d11","commandlist","graphics","stride","platform-limitation"],"backgroundTag":"method-not-implemented","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}