@@ -19,29 +19,30 @@ typedef struct SCD3D12Desc {
1919 u32 frame_latency ; /* swap-chain frame latency (1–3) */
2020} SCD3D12Desc ;
2121
22- SCResult sc_d3d12_init (SCGfxContext * ctx , const SCGfxDesc * desc ,
23- const SCD3D12Desc * d3d_desc );
24- void sc_d3d12_shutdown (SCGfxContext * ctx );
25- void sc_d3d12_begin_frame (SCGfxContext * ctx , SCColor clear );
26- void sc_d3d12_submit (SCGfxContext * ctx ,
22+ SCResult sc_d3d12_init (SCGfxContext * ctx , const SCGfxDesc * desc ,
23+ const SCD3D12Desc * d3d_desc );
24+ void sc_d3d12_shutdown (SCGfxContext * ctx );
25+ void sc_d3d12_begin_frame (SCGfxContext * ctx , SCColor clear );
26+ void sc_d3d12_submit (SCGfxContext * ctx ,
2727 const SCGfxDrawCmd * cmds , u32 count );
28- void sc_d3d12_end_frame (SCGfxContext * ctx );
28+ void sc_d3d12_end_frame (SCGfxContext * ctx );
29+ SCGfxBuffer sc_d3d12_make_buffer (SCGfxContext * ctx , const SCGfxBufferDesc * desc );
30+ void sc_d3d12_destroy_buffer (SCGfxContext * ctx , SCGfxBuffer buf );
31+ void sc_d3d12_update_buffer (SCGfxContext * ctx , SCGfxBuffer buf ,
32+ const void * data , usize size );
33+ SCGfxTexture sc_d3d12_make_texture (SCGfxContext * ctx , const SCGfxTextureDesc * desc );
34+ void sc_d3d12_destroy_texture (SCGfxContext * ctx , SCGfxTexture tex );
35+ SCGfxShader sc_d3d12_make_shader (SCGfxContext * ctx , const SCGfxShaderDesc * desc );
36+ void sc_d3d12_destroy_shader (SCGfxContext * ctx , SCGfxShader shd );
37+ SCGfxPipeline sc_d3d12_make_pipeline (SCGfxContext * ctx , const SCGfxPipelineDesc * desc );
38+ void sc_d3d12_destroy_pipeline (SCGfxContext * ctx , SCGfxPipeline pip );
2939
3040#ifdef SC_BACKEND_D3D12_IMPLEMENTATION
3141#include <stdio.h>
3242
3343SCResult sc_d3d12_init (SCGfxContext * ctx , const SCGfxDesc * desc ,
3444 const SCD3D12Desc * d3d_desc ) {
3545 SC_UNUSED (ctx ); SC_UNUSED (desc ); SC_UNUSED (d3d_desc );
36- /*
37- * TODO:
38- * D3D12CreateDevice(adapter, D3D_FEATURE_LEVEL_11_0, ...)
39- * CreateCommandQueue / CreateSwapChain / CreateDescriptorHeaps
40- * CreateRootSignature / CompileShader (D3DCompileFromFile)
41- * CreateGraphicsPipelineState
42- * CreateCommandAllocator / CreateCommandList
43- * per-frame fence + event
44- */
4546 fprintf (stderr , "[sc_d3d12] stub – link d3d12.lib on Windows\n" );
4647 return SC_ERR_NOT_SUPPORTED ;
4748}
@@ -51,5 +52,32 @@ void sc_d3d12_submit(SCGfxContext *ctx, const SCGfxDrawCmd *cmds, u32 n) {
5152 SC_UNUSED (ctx ); SC_UNUSED (cmds ); SC_UNUSED (n );
5253}
5354void sc_d3d12_end_frame (SCGfxContext * ctx ) { SC_UNUSED (ctx ); }
55+ SCGfxBuffer sc_d3d12_make_buffer (SCGfxContext * ctx , const SCGfxBufferDesc * desc ) {
56+ SC_UNUSED (ctx ); SC_UNUSED (desc ); SCGfxBuffer h = {0 }; return h ;
57+ }
58+ void sc_d3d12_destroy_buffer (SCGfxContext * ctx , SCGfxBuffer buf ) {
59+ SC_UNUSED (ctx ); SC_UNUSED (buf );
60+ }
61+ void sc_d3d12_update_buffer (SCGfxContext * ctx , SCGfxBuffer buf , const void * data , usize size ) {
62+ SC_UNUSED (ctx ); SC_UNUSED (buf ); SC_UNUSED (data ); SC_UNUSED (size );
63+ }
64+ SCGfxTexture sc_d3d12_make_texture (SCGfxContext * ctx , const SCGfxTextureDesc * desc ) {
65+ SC_UNUSED (ctx ); SC_UNUSED (desc ); SCGfxTexture h = {0 }; return h ;
66+ }
67+ void sc_d3d12_destroy_texture (SCGfxContext * ctx , SCGfxTexture tex ) {
68+ SC_UNUSED (ctx ); SC_UNUSED (tex );
69+ }
70+ SCGfxShader sc_d3d12_make_shader (SCGfxContext * ctx , const SCGfxShaderDesc * desc ) {
71+ SC_UNUSED (ctx ); SC_UNUSED (desc ); SCGfxShader h = {0 }; return h ;
72+ }
73+ void sc_d3d12_destroy_shader (SCGfxContext * ctx , SCGfxShader shd ) {
74+ SC_UNUSED (ctx ); SC_UNUSED (shd );
75+ }
76+ SCGfxPipeline sc_d3d12_make_pipeline (SCGfxContext * ctx , const SCGfxPipelineDesc * desc ) {
77+ SC_UNUSED (ctx ); SC_UNUSED (desc ); SCGfxPipeline h = {0 }; return h ;
78+ }
79+ void sc_d3d12_destroy_pipeline (SCGfxContext * ctx , SCGfxPipeline pip ) {
80+ SC_UNUSED (ctx ); SC_UNUSED (pip );
81+ }
5482#endif /* SC_BACKEND_D3D12_IMPLEMENTATION */
5583#endif /* SC_BACKEND_D3D12_H */
0 commit comments