Fix position output hint.
This commit is contained in:
11
Codegen.jai
11
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 {
|
Output_Language :: enum {
|
||||||
HLSL;
|
HLSL;
|
||||||
GLSL; // @Incomplete
|
GLSL; // @Incomplete
|
||||||
@@ -111,6 +120,8 @@ emit_field :: (state : *Codegen_State, node : *AST_Node, indentation : int) {
|
|||||||
append(*state.builder, " : POSITION");
|
append(*state.builder, " : POSITION");
|
||||||
} else if hint.ident_value == "uv" {
|
} else if hint.ident_value == "uv" {
|
||||||
append(*state.builder, " : TEXCOORD0");
|
append(*state.builder, " : TEXCOORD0");
|
||||||
|
} else if hint.ident_value == "outposition" {
|
||||||
|
append(*state.builder, " : SV_POSITION");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
module.jai
13
module.jai
@@ -122,12 +122,25 @@ Constant_Buffer :: struct {
|
|||||||
buffer_index : u32;
|
buffer_index : u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Texture :: struct {
|
||||||
|
register : int;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sampler_State :: struct {
|
||||||
|
register : int;
|
||||||
|
}
|
||||||
|
|
||||||
Shader_Variant_Collection :: struct {
|
Shader_Variant_Collection :: struct {
|
||||||
properties : Properties;
|
properties : Properties;
|
||||||
|
|
||||||
max_constant_buffers :: 16;
|
max_constant_buffers :: 16;
|
||||||
cbuffers : Static_Array(Constant_Buffer, max_constant_buffers);
|
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;
|
variants : [..]Shader_Variant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user