Kore
Loading...
Searching...
No Matches
pipeline.c.h
1#include "pipeline.h"
2
3void kinc_g5_internal_pipeline_init(kinc_g5_pipeline_t *pipe) {
4 for (int i = 0; i < 16; ++i)
5 pipe->inputLayout[i] = NULL;
6 pipe->vertexShader = NULL;
7 pipe->fragmentShader = NULL;
8 pipe->geometryShader = NULL;
9 pipe->tessellationControlShader = NULL;
10 pipe->tessellationEvaluationShader = NULL;
11
12 pipe->cullMode = KINC_G5_CULL_MODE_NEVER;
13
14 pipe->depthWrite = false;
15 pipe->depthMode = KINC_G5_COMPARE_MODE_ALWAYS;
16
17 pipe->stencilMode = KINC_G5_COMPARE_MODE_ALWAYS;
18 pipe->stencilBothPass = KINC_G5_STENCIL_ACTION_KEEP;
19 pipe->stencilDepthFail = KINC_G5_STENCIL_ACTION_KEEP;
20 pipe->stencilFail = KINC_G5_STENCIL_ACTION_KEEP;
21 pipe->stencilReferenceValue = 0;
22 pipe->stencilReadMask = 0xff;
23 pipe->stencilWriteMask = 0xff;
24
25 pipe->blend_source = KINC_G5_BLEND_ONE;
26 pipe->blend_destination = KINC_G5_BLEND_ZERO;
27 pipe->blend_operation = KINC_G5_BLENDOP_ADD;
28 pipe->alpha_blend_source = KINC_G5_BLEND_ONE;
29 pipe->alpha_blend_destination = KINC_G5_BLEND_ZERO;
30 pipe->alpha_blend_operation = KINC_G5_BLENDOP_ADD;
31
32 for (int i = 0; i < 8; ++i)
33 pipe->colorWriteMaskRed[i] = true;
34 for (int i = 0; i < 8; ++i)
35 pipe->colorWriteMaskGreen[i] = true;
36 for (int i = 0; i < 8; ++i)
37 pipe->colorWriteMaskBlue[i] = true;
38 for (int i = 0; i < 8; ++i)
39 pipe->colorWriteMaskAlpha[i] = true;
40
41 pipe->colorAttachmentCount = 1;
42 for (int i = 0; i < 8; ++i)
43 pipe->colorAttachment[i] = KINC_G5_RENDER_TARGET_FORMAT_32BIT;
44
45 pipe->depthAttachmentBits = 0;
46 pipe->stencilAttachmentBits = 0;
47}
Provides functions for creating and using pipelines which configure the GPU for rendering.