Kore
Loading...
Searching...
No Matches
pipeline.c.h
1#include "pipeline.h"
2
3#include <stddef.h>
4
5void kinc_g4_internal_pipeline_set_defaults(kinc_g4_pipeline_t *state) {
6 for (int i = 0; i < 16; ++i)
7 state->input_layout[i] = NULL;
8 state->vertex_shader = NULL;
9 state->fragment_shader = NULL;
10 state->geometry_shader = NULL;
11 state->tessellation_control_shader = NULL;
12 state->tessellation_evaluation_shader = NULL;
13
14 state->cull_mode = KINC_G4_CULL_NOTHING;
15
16 state->depth_write = false;
17 state->depth_mode = KINC_G4_COMPARE_ALWAYS;
18
19 state->stencil_front_mode = KINC_G4_COMPARE_ALWAYS;
20 state->stencil_front_both_pass = KINC_G4_STENCIL_KEEP;
21 state->stencil_front_depth_fail = KINC_G4_STENCIL_KEEP;
22 state->stencil_front_fail = KINC_G4_STENCIL_KEEP;
23 state->stencil_back_mode = KINC_G4_COMPARE_ALWAYS;
24 state->stencil_back_both_pass = KINC_G4_STENCIL_KEEP;
25 state->stencil_back_depth_fail = KINC_G4_STENCIL_KEEP;
26 state->stencil_back_fail = KINC_G4_STENCIL_KEEP;
27 state->stencil_reference_value = 0;
28 state->stencil_read_mask = 0xff;
29 state->stencil_write_mask = 0xff;
30
31 state->blend_source = KINC_G4_BLEND_ONE;
32 state->blend_destination = KINC_G4_BLEND_ZERO;
33 state->blend_operation = KINC_G4_BLENDOP_ADD;
34 state->alpha_blend_source = KINC_G4_BLEND_ONE;
35 state->alpha_blend_destination = KINC_G4_BLEND_ZERO;
36 state->alpha_blend_operation = KINC_G4_BLENDOP_ADD;
37
38 for (int i = 0; i < 8; ++i)
39 state->color_write_mask_red[i] = true;
40 for (int i = 0; i < 8; ++i)
41 state->color_write_mask_green[i] = true;
42 for (int i = 0; i < 8; ++i)
43 state->color_write_mask_blue[i] = true;
44 for (int i = 0; i < 8; ++i)
45 state->color_write_mask_alpha[i] = true;
46
47 state->color_attachment_count = 1;
48 for (int i = 0; i < 8; ++i)
49 state->color_attachment[i] = KINC_G4_RENDER_TARGET_FORMAT_32BIT;
50
51 state->depth_attachment_bits = 0;
52 state->stencil_attachment_bits = 0;
53
54 state->conservative_rasterization = false;
55}
Provides functions for creating and using pipelines which configure the GPU for rendering.