Skip to content

mateeeeeee/d3d11sw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

184 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

D3D11SW

A software implementation of the Direct3D 11 API.

Missing Features

  • Tesselation: Hull Shader, Domain Shader
  • Deferred contexts

Implemented

  • Vertex, Pixel, and Compute shaders (JIT: DXBC → C++ → clang++/MSVC)
  • Geometry Shader, Stream output, Adjacency topologies, DrawAuto
  • SM4.0/SM5.0 instruction set (arithmetic, integer, bitwise, control flow, atomics)
  • Tiled rasterizer with 28.4 fixed-point edge functions
  • 2x2 quad pixel shader execution (derivatives, auto-LOD)
  • BC compressed textures (BC1, BC2, BC3, BC4, BC5, BC7), BC6H still missing
  • Texture sampling: 1D/2D/3D/cube, point/bilinear/trilinear, all address modes
  • Anisotropic filtering
  • Mipmap chains, GenerateMips, SampleLevel/SampleGrad/SampleBias/SampleCmp
  • SRGB support
  • Depth/stencil with all comparison functions and stencil ops, HiZ
  • Blending with all blend factors/ops, dual-source, logic ops
  • Multi-render-target, write masks, clip/cull distances
  • SV_ViewportArrayIndex, SV_RenderTargetArrayIndex
  • Indexed/instanced/indirect draw and dispatch
  • MSAA stubs (apps requesting MSAA should work, rendered as 1x)
  • TGSM, barriers, thread pool for compute
  • Append/consume buffers

Examples

Screenshots

Triangle

Triangle

Textured Cube

Textured Cube   Procedural Textured Cube

Instanced Cubes

Instanced Cubes

Floor (Aliased vs Mipmapped)

Aliased Floor   Mipmapped Floor

Tests

Around 600 tests divided into three categories:

  • Unit tests: Device, resources, views, states, formats, shader compilation, draw and compute pipelines
  • Golden tests: Pixel-exact comparison against reference images
  • Perf tests: Draw and compute benchmarks

References

  • D3D11.3 Functional Spec — rasterization rules, fixed-point precision, LOD calculation, texture filtering
  • D3D11 API Reference — API contracts, parameter rules, struct/enum definitions
  • Parsing DXBC — DXBC container layout
  • d3d11TokenizedProgramFormat.hpp (Windows SDK) — opcode definitions, operand encoding, token layout for SM4/SM5 bytecode

About

A software implementation of the Direct3D 11 API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors