diff --git a/Codegen.jai b/Codegen.jai index 8e49fae..b264469 100644 --- a/Codegen.jai +++ b/Codegen.jai @@ -1,3 +1,12 @@ +///////////////////////////////////// +//~ nbr: +// + +///////////////////////////////////// +//~ nbr: Codegen TODOs +// +// [ ] Prefix output of property values with __PROPERTIES so we don't get name clashes + Output_Language :: enum { HLSL; GLSL; // @Incomplete @@ -111,6 +120,8 @@ emit_field :: (state : *Codegen_State, node : *AST_Node, indentation : int) { append(*state.builder, " : POSITION"); } else if hint.ident_value == "uv" { append(*state.builder, " : TEXCOORD0"); + } else if hint.ident_value == "outposition" { + append(*state.builder, " : SV_POSITION"); } } } diff --git a/module.jai b/module.jai index 1355ecc..2a2de04 100644 --- a/module.jai +++ b/module.jai @@ -122,12 +122,25 @@ Constant_Buffer :: struct { buffer_index : u32; } +Texture :: struct { + register : int; +} + +Sampler_State :: struct { + register : int; +} + Shader_Variant_Collection :: struct { properties : Properties; max_constant_buffers :: 16; cbuffers : Static_Array(Constant_Buffer, max_constant_buffers); + max_textures :: 16; + textures : Static_Array(Texture, max_textures); + max_sampler_states :: 16; + sampler_states : Static_Array(Sampler_State, max_sampler_states); + variants : [..]Shader_Variant; }