radeonsi: move nir_shader_compiler_options into si_screen
[mesa.git] / src / gallium / drivers / zink / zink_state.h
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_STATE_H
25 #define ZINK_STATE_H
26
27 #include <vulkan/vulkan.h>
28
29 #include "pipe/p_state.h"
30
31 struct zink_vertex_elements_hw_state {
32 VkVertexInputAttributeDescription attribs[PIPE_MAX_ATTRIBS];
33 uint32_t num_bindings, num_attribs;
34 };
35
36 struct zink_vertex_elements_state {
37 struct {
38 uint32_t binding;
39 VkVertexInputRate inputRate;
40 } bindings[PIPE_MAX_ATTRIBS];
41 uint8_t binding_map[PIPE_MAX_ATTRIBS];
42 struct zink_vertex_elements_hw_state hw_state;
43 };
44
45 struct zink_rasterizer_hw_state {
46 VkBool32 depth_clamp;
47 VkBool32 rasterizer_discard;
48 VkFrontFace front_face;
49 VkPolygonMode polygon_mode;
50 VkCullModeFlags cull_mode;
51 };
52
53 struct zink_rasterizer_state {
54 struct pipe_rasterizer_state base;
55 bool offset_point, offset_line, offset_tri;
56 float offset_units, offset_clamp, offset_scale;
57 float line_width;
58 struct zink_rasterizer_hw_state hw_state;
59 };
60
61 struct zink_blend_state {
62 VkPipelineColorBlendAttachmentState attachments[PIPE_MAX_COLOR_BUFS];
63
64 VkBool32 logicop_enable;
65 VkLogicOp logicop_func;
66
67 VkBool32 alpha_to_coverage;
68 VkBool32 alpha_to_one;
69
70 bool need_blend_constants;
71 };
72
73 struct zink_depth_stencil_alpha_state {
74 VkBool32 depth_test;
75 VkCompareOp depth_compare_op;
76
77 VkBool32 depth_bounds_test;
78 float min_depth_bounds, max_depth_bounds;
79
80 VkBool32 stencil_test;
81 VkStencilOpState stencil_front;
82 VkStencilOpState stencil_back;
83
84 VkBool32 depth_write;
85 };
86
87 void
88 zink_context_state_init(struct pipe_context *pctx);
89
90 #endif