← All resources

An Experimental Approach to printf in HLSL

Auto-discovered

Blog Advanced

Chris Bieneman

Visit resource ↗

Description

An Experimental Approach to printf in HLSL is a December 2025 technical post by Chris Bieneman describing a holiday prototype for GPU-side printf in HLSL.

It covers GPU string and formatting challenges, then a design that keeps strings out of the driver-facing binary via a compile-time string table and __builtin_hlsl_string_to_offset, with printf in HLSL writing into an RWByteAddressBuffer. Topics include wave-based argument packing, variadic templates in DXC, generalizing the HLSL string type, message ordering caveats, and DX12 Shader Model 6.0+ support, plus roadblocks for Clang, DXC, SPIR-V, and Metal.

It is for advanced HLSL compiler and tooling engineers who debug compute or graphics shaders with DXC or Clang.

The article is free HTML with code samples; linked prototype work is described in the author's DXC and test-suite forks.

It is useful as a concrete blueprint for shader logging without driver changes and as context on missing HLSL language features.