Path: blob/21.2-virgl/src/gallium/drivers/zink/zink_state.h
4570 views
/*1* Copyright 2018 Collabora Ltd.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* on the rights to use, copy, modify, merge, publish, distribute, sub7* license, and/or sell copies of the Software, and to permit persons to whom8* the Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL17* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,18* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR19* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE20* USE OR OTHER DEALINGS IN THE SOFTWARE.21*/2223#ifndef ZINK_STATE_H24#define ZINK_STATE_H2526#include <vulkan/vulkan.h>2728#include "pipe/p_state.h"2930struct zink_vertex_elements_hw_state {31VkVertexInputAttributeDescription attribs[PIPE_MAX_ATTRIBS];32VkVertexInputBindingDivisorDescriptionEXT divisors[PIPE_MAX_ATTRIBS];33VkVertexInputBindingDescription bindings[PIPE_MAX_ATTRIBS]; // combination of element_state and stride34uint32_t num_bindings, num_attribs;35uint8_t divisors_present;36};3738struct zink_vertex_elements_state {39struct {40uint32_t binding;41VkVertexInputRate inputRate;42} bindings[PIPE_MAX_ATTRIBS];43uint32_t divisor[PIPE_MAX_ATTRIBS];44uint8_t binding_map[PIPE_MAX_ATTRIBS];45struct zink_vertex_elements_hw_state hw_state;46};4748struct zink_rasterizer_hw_state {49VkPolygonMode polygon_mode;50VkCullModeFlags cull_mode;51VkProvokingVertexModeEXT pv_mode;52VkLineRasterizationModeEXT line_mode;53unsigned depth_clamp : 1;54unsigned rasterizer_discard : 1;55unsigned force_persample_interp : 1;56unsigned line_stipple_factor : 8;57unsigned line_stipple_pattern : 16;58};5960struct zink_rasterizer_state {61struct pipe_rasterizer_state base;62bool offset_point, offset_line, offset_tri;63float offset_units, offset_clamp, offset_scale;64float line_width;65VkFrontFace front_face;66struct zink_rasterizer_hw_state hw_state;67};6869struct zink_blend_state {70VkPipelineColorBlendAttachmentState attachments[PIPE_MAX_COLOR_BUFS];7172VkBool32 logicop_enable;73VkLogicOp logicop_func;7475VkBool32 alpha_to_coverage;76VkBool32 alpha_to_one;7778bool need_blend_constants;79bool dual_src_blend;80};8182struct zink_depth_stencil_alpha_hw_state {83VkBool32 depth_test;84VkCompareOp depth_compare_op;8586VkBool32 depth_bounds_test;87float min_depth_bounds, max_depth_bounds;8889VkBool32 stencil_test;90VkStencilOpState stencil_front;91VkStencilOpState stencil_back;9293VkBool32 depth_write;94};9596struct zink_depth_stencil_alpha_state {97struct pipe_depth_stencil_alpha_state base;98struct zink_depth_stencil_alpha_hw_state hw_state;99};100101void102zink_context_state_init(struct pipe_context *pctx);103104#endif105106107