code wiki / (root) / nx_d3d11_min.nx

nx_d3d11_min.nx

buildroot/runtime/nx_d3d11_min.nx

2748 B55 linesdepth 4pulls 7 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_d3d11_min.nx -- D0 of the D3D-game ladder: the END-TO-END SPINE. Models the D3D11 device+swapchain object model and the exact startup call sequence a game makes on frame 0 -- D3D11CreateDeviceAndSwapChain -> GetBuffer(backbuffer) -> ClearRenderTargetView -> [draw region] -> Present -- and drives it through OUR real backend (nx_swgpu framebuffer) and OUR real present (nx_swapchain -> PPM). Proves API-surface -> backend -> present as ONE working path. HONEST SCOPE: this is the ARCHITECTURE spine (the object model + call sequence backed by the real backend/present), NOT yet a COM-vtable d3d11.dll a Windows game loads unchanged -- that (real IUnknown/GUID vtables + the dll shim) is a later rung. Correctness before perf: the software backend is correct-but-slow. license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_swgpu.nx nx_swapchain.nx nx_d3d11_min.nx nx_d3d11_min_gate.nx

imports: nx_syscalls.nxnx_swgpu.nxnx_swapchain.nx

imported by: nx_d3d11_min_gate.nx

structs

none

consts

none

functions

13func d3d_create_device_and_swapchain(reqw: i64, reqh: i64) -> *i64
called by 1: main calls 3: sys_mmapswgpu_bytessg_reset
22func d3d_backbuffer(ctx: *i64) -> *i64 { return sg_fb(ctx[0]) } // GetBuffer(0) + CreateRenderTargetView
23func d3d_width(ctx: *i64) -> i64 { return ctx[1] }
called by 1: main
24func d3d_height(ctx: *i64) -> i64 { return ctx[2] }
called by 1: main
26func d3d_pack(r: i64, g: i64, b: i64) -> i64 { return (r & 255) | ((g & 255) << 8) | ((b & 255) << 16) }
29func d3d_clear_rtv(ctx: *i64, r: i64, g: i64, b: i64) -> i64
called by 1: main calls 2: d3d_backbufferd3d_pack
39func d3d_fill_rect(ctx: *i64, x0: i64, y0: i64, x1: i64, y1: i64, r: i64, g: i64, b: i64) -> i64
called by 1: main calls 2: d3d_backbufferd3d_pack
53func d3d_present(ctx: *i64, out: *u8, out_cap: i64) -> i64
called by 1: main calls 2: nx_swap_presentd3d_backbuffer