Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/gallium/drivers/zink/zink_pipeline.h
4570 views
1
/*
2
* Copyright 2018 Collabora Ltd.
3
*
4
* Permission is hereby granted, free of charge, to any person obtaining a
5
* copy of this software and associated documentation files (the "Software"),
6
* to deal in the Software without restriction, including without limitation
7
* on the rights to use, copy, modify, merge, publish, distribute, sub
8
* license, and/or sell copies of the Software, and to permit persons to whom
9
* the Software is furnished to do so, subject to the following conditions:
10
*
11
* The above copyright notice and this permission notice (including the next
12
* paragraph) shall be included in all copies or substantial portions of the
13
* Software.
14
*
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21
* USE OR OTHER DEALINGS IN THE SOFTWARE.
22
*/
23
24
#ifndef ZINK_PIPELINE_H
25
#define ZINK_PIPELINE_H
26
27
#include <vulkan/vulkan.h>
28
29
#include "pipe/p_state.h"
30
31
struct zink_blend_state;
32
struct zink_depth_stencil_alpha_state;
33
struct zink_gfx_program;
34
struct zink_compute_program;
35
struct zink_rasterizer_state;
36
struct zink_render_pass;
37
struct zink_screen;
38
struct zink_vertex_elements_state;
39
40
struct zink_gfx_pipeline_state {
41
struct zink_render_pass *render_pass;
42
43
uint8_t void_alpha_attachments:PIPE_MAX_COLOR_BUFS;
44
uint32_t num_attachments;
45
struct zink_blend_state *blend_state;
46
47
struct zink_rasterizer_hw_state *rast_state;
48
49
VkSampleMask sample_mask;
50
uint8_t rast_samples;
51
uint8_t vertices_per_patch;
52
53
unsigned num_viewports;
54
55
bool primitive_restart;
56
57
/* Pre-hashed value for table lookup, invalid when zero.
58
* Members after this point are not included in pipeline state hash key */
59
uint32_t hash;
60
bool dirty;
61
62
struct zink_depth_stencil_alpha_hw_state *depth_stencil_alpha_state; //non-dynamic state
63
VkFrontFace front_face;
64
65
VkShaderModule modules[PIPE_SHADER_TYPES - 1];
66
uint32_t module_hash;
67
68
uint32_t combined_hash;
69
bool combined_dirty;
70
71
struct zink_vertex_elements_hw_state *element_state;
72
bool vertex_state_dirty;
73
74
uint32_t final_hash;
75
76
uint32_t vertex_buffers_enabled_mask;
77
uint32_t vertex_strides[PIPE_MAX_ATTRIBS];
78
bool sample_locations_enabled;
79
bool have_EXT_extended_dynamic_state;
80
81
VkPipeline pipeline;
82
enum pipe_prim_type mode : 8;
83
};
84
85
struct zink_compute_pipeline_state {
86
/* Pre-hashed value for table lookup, invalid when zero.
87
* Members after this point are not included in pipeline state hash key */
88
uint32_t hash;
89
bool dirty;
90
bool use_local_size;
91
uint32_t local_size[3];
92
93
VkPipeline pipeline;
94
};
95
96
VkPipeline
97
zink_create_gfx_pipeline(struct zink_screen *screen,
98
struct zink_gfx_program *prog,
99
struct zink_gfx_pipeline_state *state,
100
VkPrimitiveTopology primitive_topology);
101
102
VkPipeline
103
zink_create_compute_pipeline(struct zink_screen *screen, struct zink_compute_program *comp, struct zink_compute_pipeline_state *state);
104
#endif
105
106