Skip to content

Commit

Permalink
Write a full Kope pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 2, 2024
1 parent f46e3a4 commit d8465da
Show file tree
Hide file tree
Showing 2 changed files with 328 additions and 276 deletions.
2 changes: 2 additions & 0 deletions Sources/backends/hlsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ static void write_functions(char *hlsl, size_t *offset, shader_stage stage, func

if (f == main) {
if (stage == SHADER_STAGE_VERTEX) {
*offset += sprintf(&hlsl[*offset], "[RootSignature(\"RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT)\")]\n");
*offset += sprintf(&hlsl[*offset], "%s main(", type_string(f->return_type.type));
for (uint8_t parameter_index = 0; parameter_index < f->parameters_size; ++parameter_index) {
if (parameter_index == 0) {
Expand All @@ -360,6 +361,7 @@ static void write_functions(char *hlsl, size_t *offset, shader_stage stage, func
}
*offset += sprintf(&hlsl[*offset], "};\n\n");

*offset += sprintf(&hlsl[*offset], "[RootSignature(\"RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT)\")]\n");
*offset += sprintf(&hlsl[*offset], "_kong_colors_out main(");
for (uint8_t parameter_index = 0; parameter_index < f->parameters_size; ++parameter_index) {
if (parameter_index == 0) {
Expand Down
Loading

0 comments on commit d8465da

Please sign in to comment.