{"_id":"@bun-win32/d3d12","_rev":"4-151b8136c1e6cea4e6992ced5d2f3414","name":"@bun-win32/d3d12","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/d3d12","version":"1.0.0","keywords":["bun","ffi","win32","windows","d3d12","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/d3d12@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"fdaac68b8a9919848452afd11b89dcfc4c8d9f2f","tarball":"https://registry.npmjs.org/@bun-win32/d3d12/-/d3d12-1.0.0.tgz","fileCount":6,"integrity":"sha512-cqp2zSV1N6cmdP4TpC8/qpfVE9EEuYjy+detgNIu1rkcxhNKczCa5IWUzzRH47uk+v2OjolxRNKou+PYZUZ1ZQ==","signatures":[{"sig":"MEQCIBiShOYD/fpaiX3leKgG3HWm2ZGWBsEVjzXMEJp2jhwpAiANoEc3IJw7aY8MEF0JxHGlZMBsuf1Sg7LcS658040j3g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13028},"main":"./index.ts","type":"module","module":"index.ts","shasum":"fdaac68b8a9919848452afd11b89dcfc4c8d9f2f","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:d3d12-device-probe":"bun ./example/d3d12-device-probe.ts","example:d3d12-capability-xray":"bun ./example/d3d12-capability-xray.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-cqp2zSV1N6cmdP4TpC8/qpfVE9EEuYjy+detgNIu1rkcxhNKczCa5IWUzzRH47uk+v2OjolxRNKou+PYZUZ1ZQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/d3d12"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 D3D12 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/d3d12_1.0.0_1779073007615_0.099366235021769","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/d3d12","version":"1.0.1","keywords":["bun","ffi","win32","windows","d3d12","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/d3d12@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"7be1b9dc6cc64246e0fc72cb7dfe7091819f1fa2","tarball":"https://registry.npmjs.org/@bun-win32/d3d12/-/d3d12-1.0.1.tgz","fileCount":6,"integrity":"sha512-jY6zu8Y6MDrb6Phm1G77fN3gRtEsweUwyprhLu4SpCjHiUwNFZ13pnCdcyEBzmL/wjGzVO0WEdNaxhJlKgCP+w==","signatures":[{"sig":"MEUCIAm/AOJW7FwhEg7sWwOSk9lX4fI7Xsre+2b8a+ny2bKPAiEAux9ddatx4VIrokl2O++2UlKPb5ODsD0s2Of+z1e6hVg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13033},"main":"./index.ts","type":"module","module":"index.ts","shasum":"7be1b9dc6cc64246e0fc72cb7dfe7091819f1fa2","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:d3d12-device-probe":"bun ./example/d3d12-device-probe.ts","example:d3d12-capability-xray":"bun ./example/d3d12-capability-xray.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-jY6zu8Y6MDrb6Phm1G77fN3gRtEsweUwyprhLu4SpCjHiUwNFZ13pnCdcyEBzmL/wjGzVO0WEdNaxhJlKgCP+w==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/d3d12"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 D3D12 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/d3d12_1.0.1_1781130810844_0.10272319567975496","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/d3d12","version":"2.0.0","keywords":["bun","ffi","win32","windows","d3d12","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/d3d12@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"b14b5f622289eb2efc9d091a4717a82b4696fa14","tarball":"https://registry.npmjs.org/@bun-win32/d3d12/-/d3d12-2.0.0.tgz","fileCount":6,"integrity":"sha512-HL5rBow3Qsof8UGmK1b3BiJ1AxcV0nqBxWdtSO3eHAXyjA7hSAWw2ZL81uYUsclqo1i9dTtZ+bEvodk5T/mZOA==","signatures":[{"sig":"MEUCIDSZu1qB4M39Odv9NNjuNEHh0kh1DgKGjda8bUYoBwl2AiEAs1awNbQR4b1ia+av+Q3B0PpwwS5G99cHEbjMAmxXQ5w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14383},"main":"./index.ts","type":"module","module":"index.ts","shasum":"b14b5f622289eb2efc9d091a4717a82b4696fa14","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:d3d12-device-probe":"bun ./example/d3d12-device-probe.ts","example:d3d12-capability-xray":"bun ./example/d3d12-capability-xray.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-HL5rBow3Qsof8UGmK1b3BiJ1AxcV0nqBxWdtSO3eHAXyjA7hSAWw2ZL81uYUsclqo1i9dTtZ+bEvodk5T/mZOA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/d3d12"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 D3D12 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/d3d12_2.0.0_1782435289196_0.38706746138148573","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 D3D12 bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/d3d12","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/d3d12"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","d3d12","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:d3d12-device-probe":"bun ./example/d3d12-device-probe.ts","example:d3d12-capability-xray":"bun ./example/d3d12-capability-xray.ts"},"_id":"@bun-win32/d3d12@2.0.1","_integrity":"sha512-jPrsEJ9l/bqpCng1+EMgvP4r2PxZyh0h3Zx+wmZHcyAYSmXLlnbE1dYu4oHyy0Y5Mx/DdjapHrIRnjtCQpNAkA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"c127f77a771c46d30da62040362c73c25be67f01","dist":{"integrity":"sha512-jPrsEJ9l/bqpCng1+EMgvP4r2PxZyh0h3Zx+wmZHcyAYSmXLlnbE1dYu4oHyy0Y5Mx/DdjapHrIRnjtCQpNAkA==","shasum":"c127f77a771c46d30da62040362c73c25be67f01","tarball":"https://registry.npmjs.org/@bun-win32/d3d12/-/d3d12-2.0.1.tgz","fileCount":6,"unpackedSize":14383,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDy1PbLGelsq0caNxjYlN3CgjA4YT4JuYuxT6DZpdYKswIgA+7teHQoM26boH6qyha6uZVadDsU/7T+Zl3hWwn2Alc="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/d3d12_2.0.1_1782437747430_0.3055687060997372"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T02:56:47.520Z","modified":"2026-06-26T01:35:47.682Z","1.0.0":"2026-05-18T02:56:47.786Z","1.0.1":"2026-06-10T22:33:30.976Z","2.0.0":"2026-06-26T00:54:49.378Z","2.0.1":"2026-06-26T01:35:47.558Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","d3d12","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/d3d12"},"description":"Zero-dependency, zero-overhead Win32 D3D12 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/d3d12\n\nZero-dependency, zero-overhead Win32 D3D12 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/d3d12` exposes the `d3d12.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `D3d12`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `d3d12.dll` (Direct3D 12 device creation, debug-layer access, global interface retrieval, and root-signature serialize/deserialize).\n- In-source docs in `structs/D3d12.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`D3d12.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/D3d12.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/d3d12\n```\n\n## Quick Start\n\n```ts\nimport D3d12, { D3D_FEATURE_LEVEL } from '@bun-win32/d3d12';\n\n// IID_ID3D12Device {189819f1-1db6-4b57-be54-1821339b85f7}\nconst iidDevice = Buffer.alloc(16);\niidDevice.writeUInt32LE(0x189819f1, 0);\niidDevice.writeUInt16LE(0x1db6, 4);\niidDevice.writeUInt16LE(0x4b57, 6);\nBuffer.from([0xbe, 0x54, 0x18, 0x21, 0x33, 0x9b, 0x85, 0xf7]).copy(iidDevice, 8);\n\n// Pass NULL for ppDevice to test support without creating the device:\n// S_OK / S_FALSE means a D3D12-capable adapter exists at this feature level.\nconst hr = D3d12.D3D12CreateDevice(null, D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, iidDevice.ptr, null);\nif (hr === 0 || hr === 1) {\n  console.log('D3D12 supported at feature level 11_0');\n}\n\n// Allocate an 8-byte slot and pass its .ptr to actually receive the device,\n// then drive ID3D12Device via its COM vtable and call Release when done.\nconst ppDevice = Buffer.alloc(8);\nconst created = D3d12.D3D12CreateDevice(null, D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, iidDevice.ptr, ppDevice.ptr);\nif (created === 0) {\n  const deviceAddress = ppDevice.readBigUInt64LE(0);\n  console.log(`ID3D12Device @ 0x${deviceAddress.toString(16)}`);\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\n# Thorough flat-FFI diagnostic: feature-level ladder, debug/SDK interfaces,\n# and root-signature serialize -> deserialize round-trips\nbun run example:d3d12-device-probe\n\n# Creative: create a real ID3D12Device and x-ray its hidden capability\n# matrix (ray tracing, mesh shaders, wave ops, ...) via CheckFeatureSupport\nbun run example:d3d12-capability-xray\n```\n\n## Notes\n\n- Either rely on lazy binding or call `D3d12.Preload()`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}