npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@carbonenginejs/format-dxbc

v0.1.1

Published

CarbonEngineJS DXBC format package. Parses Direct3D shader bytecode containers, signatures and the SM4/SM5 token stream, and emits JSON or raw decoder objects for shader translation backends.

Readme

@carbonenginejs/format-dxbc

Pure-JavaScript CarbonEngineJS-facing reader for Microsoft DXBC (Direct3D compiled shader bytecode). No native tooling, no build step; it runs in Node and the browser.

CarbonEngine and Fenris Creations (CCP Games) are named in this package for interoperability and target-ecosystem context only. DXBC itself is a Microsoft format, and this package contains no CarbonEngine or Fenris Creations (CCP Games) source code.

DXBC is not a CCP format — this package has no Carbon/Trinity vocabulary. It parses the DXBC container and chunk directory, the input/output/patch signatures, and decodes the complete SM4/SM5 instruction token stream (218-opcode table, declarations included). The decoded instruction stream is the contract shader-translation backends build against (@carbonenginejs/format-webgl for GLSL ES 3.00, @carbonenginejs/format-webgpu later for WGSL).

Install

npm install @carbonenginejs/format-dxbc

Public API

The package root exports one public class: CjsFormatDxbc. The Cjs prefix marks this as a CarbonEngineJS format/construction boundary, not an engine runtime class. Internal container/signature/program/decoder machinery lives under src/core; construction utilities destined for a shared Carbon library live under src/carbon.

import CjsFormatDxbc from "@carbonenginejs/format-dxbc";

// One-shot statics (camelCase by convention)
CjsFormatDxbc.isDxbc(bytes);                  // magic sniff
CjsFormatDxbc.inspect(bytes);                 // header/chunks/stage summary, no instruction decode
CjsFormatDxbc.read(bytes);                    // full decode, plain JSON data
CjsFormatDxbc.read(bytes, { emit: "raw" });   // container/program/decoder objects for backends

// Reusable profile
const reader = new CjsFormatDxbc({
    emit: "json",              // "json" (default) | "raw"
    source: "myshader.dxbc",   // name used in error details
    decodeInstructions: true   // false = container/signatures only
});
const result = reader.Read(bytes);

emit: "json" returns plain JSON-compatible data: container facts, program header (stage, shader model), signature elements and the decoded instruction records. emit: "raw" returns the live DxbcContainer / DxbcShaderProgram / DxbcInstructionDecoder objects.

Docs

docs/ carries the audited DX11 instruction-semantics specifications (float ALU, integer/conversion, comparisons and control flow) that lowering backends implement against. Target-language-specific lowering notes live with their backend packages.

Tests

npm test

Baseline tests are fully self-contained (synthetic DXBC assembled in-test) — no game assets, network access or fixtures required. An optional corpus sweep decodes every DXBC payload found under the directory supplied by DXBC_CORPUS_DIR:

DXBC_CORPUS_DIR=path/to/effects npm test

Last full sweep: 1,611 files, 12,125 DXBC payloads, 2,142,826 instructions decoded, zero failures.

License

MIT (see LICENSE and NOTICE). Unlike @carbonenginejs/format-gr2, this package has no EUPL-derived code.