{"record":{"id":"2e643a2dbe79e8e8","repo":"stride3d/stride","slug":"query-type-querytype-not-supported-querypool-direct3d12","errorCode":null,"errorMessage":"Query type {QueryType} not supported","messagePattern":"Query type (.+?) not supported","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Graphics/Direct3D12/QueryPool.Direct3D12.cs","lineNumber":132,"sourceCode":"            return false;\n        }\n\n        /// <summary>\n        ///   Implementation in Direct3D 12 that recreates the queries in the pool.\n        /// </summary>\n        /// <exception cref=\"NotImplementedException\">\n        ///   Only GPU queries of type <see cref=\"QueryType.Timestamp\"/> are supported.\n        /// </exception>\n        private unsafe partial void Recreate()\n        {\n            var description = new QueryHeapDesc\n            {\n                Count = (uint) QueryCount,\n                Type = QueryType switch\n                {\n                    QueryType.Timestamp => QueryHeapType.Timestamp,\n\n                    _ => throw new NotImplementedException($\"Query type {QueryType} not supported\")\n                }\n            };\n\n            HResult result = NativeDevice.CreateQueryHeap(in description, out ComPtr<ID3D12QueryHeap> queryHeap);\n\n            if (result.IsFailure)\n                result.Throw();\n\n            nativeQueryHeap = queryHeap;\n\n            var readbackBufferDesc = new ResourceDesc\n            {\n                Dimension = ResourceDimension.Buffer,\n                Width = (uint) QueryCount * sizeof(long),\n                Height = 1,\n                DepthOrArraySize = 1,\n                MipLevels = 1,\n                Alignment = 0,","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Graphics/Direct3D12/QueryPool.Direct3D12.cs#L114-L150","documentation":"QueryPool.Recreate creates a D3D12 query heap, but the switch only maps QueryType.Timestamp to a heap type; every other QueryType (e.g. Occlusion, PipelineStatistics) is unimplemented in this backend and throws NotImplementedException.","triggerScenarios":"Creating a QueryPool with QueryType other than Timestamp on the Direct3D12 backend (e.g. new QueryPool(device, QueryType.Occlusion, count)).","commonSituations":"Code shared across backends (Vulkan supports more query types) running on D3D12; enabling profiling/GPU-stat features that request non-timestamp queries.","solutions":["Use QueryType.Timestamp only on Direct3D12","Guard feature code by graphics platform/API and disable non-timestamp queries on D3D12","Implement or wait for backend support (contribute the QueryHeapType mapping for additional query types)"],"exampleFix":"// before\nvar pool = new QueryPool(device, QueryType.Occlusion, 64);\n// after\nvar pool = new QueryPool(device, QueryType.Timestamp, 64);","handlingStrategy":"fallback","validationCode":"if (queryType != QueryType.Timestamp) throw new PlatformNotSupportedException(\"Only Timestamp queries are supported on Direct3D12\");","typeGuard":"bool IsSupportedQuery(QueryType q) => q == QueryType.Timestamp;","tryCatchPattern":"try { pool = new QueryPool(device, queryType, count); } catch (NotImplementedException) { pool = null; /* disable GPU timing feature */ }","preventionTips":["Restrict GPU query features to timestamps on D3D12","Gate profiling features per graphics API","Check Stride release notes for added query-type support before enabling others"],"tags":["direct3d12","query-pool","unsupported"],"backgroundTag":"operation-not-supported","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"}