{"record":{"id":"9f972ab9dbc112ab","repo":"stride3d/stride","slug":"the-specified-com-pointer-type-is-not-supported","errorCode":null,"errorMessage":"The specified COM pointer type is not supported.","messagePattern":"The specified COM pointer type is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"warning","filePath":"sources/engine/Stride.Graphics/Direct3D/DebugHelpers.Direct3D.cs","lineNumber":98,"sourceCode":"            case IComVtbl<ID3D11DeviceChild>:\n            {\n                var nameSpan = name.GetAsciiSpan();\n                var nameSpanLength = (uint) nameSpan.Length;\n\n                var d3d11DeviceChild = CastComPtr<T, ID3D11DeviceChild>(comPtr);\n                d3d11DeviceChild.SetPrivateData(DebugObjectName, nameSpanLength, nameSpan);\n                break;\n            }\n#elif STRIDE_GRAPHICS_API_DIRECT3D12\n            case IComVtbl<ID3D12DeviceChild>:\n            {\n                var d3d12DeviceChild = CastComPtr<T, ID3D12DeviceChild>(comPtr);\n                d3d12DeviceChild.SetName(name);\n                break;\n            }\n#endif\n            default:\n                throw new NotSupportedException(\"The specified COM pointer type is not supported.\");\n        }\n\n        if (LogDebugNames)\n        {\n            // Log the debug name for the object\n            var typeName = typeof(T).Name;\n            var ptr = (nint) comPtr.Handle;\n            Debug.WriteLine($\"Changed or set the debug name for {typeName} at 0x{ptr:X8} to '{name}'.\");\n        }\n    }\n}\n\n#endif\n","sourceCodeStart":80,"sourceCodeEnd":112,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Graphics/Direct3D/DebugHelpers.Direct3D.cs#L80-L112","documentation":"DebugHelpers<T>.SetDebugName casts the raw COM pointer to a known D3D debug interface (ID3D11DeviceChild / ID3D12DeviceChild) and throws NotSupportedException in the default branch when the COM pointer's type is none of the supported Direct3D interfaces. It exists so objects can be tagged for graphics debuggers (PIX, Visual Studio Graphics Diagnostics). Stride only supports a fixed set of native types for naming.","triggerScenarios":"Calling SetDebugName (directly or via GraphicsResource.Name setter on D3D11/D3D12) with a generic parameter T or COM pointer whose native interface is not among the cases handled in the switch — e.g. a swap chain, DXGI object, or a custom/newer D3D object type not covered by the implemented branches.","commonSituations":"Assigning .Name to a graphics resource on a backend/object combination Stride does not map (e.g. naming a DXGI factory/adapter or unsupported D3D12 object); custom engine code extending graphics objects and reusing SetDebugName with a new COM type; API-version changes where the cast target interface differs.","solutions":["Only call SetDebugName with supported D3D11/D3D12 device-child objects (buffers, textures, shaders, etc.)","Extend the switch in DebugHelpers.Direct3D.cs to QueryInterface and cast the new COM type (e.g. IDXGISwapChain) before setting its name","Wrap the call in a check for the concrete interface type and skip naming for unsupported objects","Update Stride to a version where the object type you are naming is supported"],"exampleFix":"// before\nDebugHelpers.SetDebugName(swapChainNativePtr, \"MySwapChain\"); // unsupported COM type\n// after\nif (swapChainNativePtr is ID3D12DeviceChild deviceChild) // only name supported device children\n    DebugHelpers.SetDebugName(deviceChild.NativePtr, \"MySwapChain\");","handlingStrategy":"try-catch","validationCode":"// only name known-supported device children\nif (obj is ID3D11DeviceChild || obj is ID3D12DeviceChild)\n    DebugHelpers.SetDebugName(ptr, name);","typeGuard":"bool CanSetDebugName<T>(T ptr) => typeof(T) == typeof(ID3D11DeviceChild) || typeof(T) == typeof(ID3D12DeviceChild);","tryCatchPattern":"try { DebugHelpers.SetDebugName(comPtr, name); }\ncatch (NotSupportedException) { /* naming unsupported on this COM type; skip */ }","preventionTips":["Only assign .Name to supported D3D device-child graphics resources","Skip debug naming for DXGI objects (swap chains, adapters, factories)","Keep the helper's switch in sync when adding new native object types"],"tags":["graphics","direct3d","com","debugging"],"backgroundTag":"unsupported-operation","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"}