Path: blob/21.2-virgl/src/gallium/drivers/zink/zink_pipeline.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_PIPELINE_H24#define ZINK_PIPELINE_H2526#include <vulkan/vulkan.h>2728#include "pipe/p_state.h"2930struct zink_blend_state;31struct zink_depth_stencil_alpha_state;32struct zink_gfx_program;33struct zink_compute_program;34struct zink_rasterizer_state;35struct zink_render_pass;36struct zink_screen;37struct zink_vertex_elements_state;3839struct zink_gfx_pipeline_state {40struct zink_render_pass *render_pass;4142uint8_t void_alpha_attachments:PIPE_MAX_COLOR_BUFS;43uint32_t num_attachments;44struct zink_blend_state *blend_state;4546struct zink_rasterizer_hw_state *rast_state;4748VkSampleMask sample_mask;49uint8_t rast_samples;50uint8_t vertices_per_patch;5152unsigned num_viewports;5354bool primitive_restart;5556/* Pre-hashed value for table lookup, invalid when zero.57* Members after this point are not included in pipeline state hash key */58uint32_t hash;59bool dirty;6061struct zink_depth_stencil_alpha_hw_state *depth_stencil_alpha_state; //non-dynamic state62VkFrontFace front_face;6364VkShaderModule modules[PIPE_SHADER_TYPES - 1];65uint32_t module_hash;6667uint32_t combined_hash;68bool combined_dirty;6970struct zink_vertex_elements_hw_state *element_state;71bool vertex_state_dirty;7273uint32_t final_hash;7475uint32_t vertex_buffers_enabled_mask;76uint32_t vertex_strides[PIPE_MAX_ATTRIBS];77bool sample_locations_enabled;78bool have_EXT_extended_dynamic_state;7980VkPipeline pipeline;81enum pipe_prim_type mode : 8;82};8384struct zink_compute_pipeline_state {85/* Pre-hashed value for table lookup, invalid when zero.86* Members after this point are not included in pipeline state hash key */87uint32_t hash;88bool dirty;89bool use_local_size;90uint32_t local_size[3];9192VkPipeline pipeline;93};9495VkPipeline96zink_create_gfx_pipeline(struct zink_screen *screen,97struct zink_gfx_program *prog,98struct zink_gfx_pipeline_state *state,99VkPrimitiveTopology primitive_topology);100101VkPipeline102zink_create_compute_pipeline(struct zink_screen *screen, struct zink_compute_program *comp, struct zink_compute_pipeline_state *state);103#endif104105106