Path: blob/21.2-virgl/src/gallium/drivers/llvmpipe/lp_setup.h
4570 views
/**************************************************************************1*2* Copyright 2007 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/26#ifndef LP_SETUP_H27#define LP_SETUP_H2829#include "pipe/p_compiler.h"30#include "lp_jit.h"3132struct draw_context;33struct vertex_info;343536struct pipe_resource;37struct pipe_query;38struct pipe_surface;39struct pipe_blend_color;40struct pipe_screen;41struct pipe_framebuffer_state;42struct lp_fragment_shader_variant;43struct lp_jit_context;44struct llvmpipe_query;45struct pipe_fence_handle;46struct lp_setup_variant;47struct lp_setup_context;4849void lp_setup_reset( struct lp_setup_context *setup );5051struct lp_setup_context *52lp_setup_create( struct pipe_context *pipe,53struct draw_context *draw );5455void56lp_setup_clear(struct lp_setup_context *setup,57const union pipe_color_union *clear_color,58double clear_depth,59unsigned clear_stencil,60unsigned flags);61626364void65lp_setup_flush( struct lp_setup_context *setup,66struct pipe_fence_handle **fence,67const char *reason);686970void71lp_setup_bind_framebuffer( struct lp_setup_context *setup,72const struct pipe_framebuffer_state *fb );7374void75lp_setup_set_triangle_state( struct lp_setup_context *setup,76unsigned cullmode,77boolean front_is_ccw,78boolean scissor,79boolean half_pixel_center,80boolean bottom_edge_rule,81boolean multisample);8283void84lp_setup_set_line_state( struct lp_setup_context *setup,85float line_width,86boolean line_rectangular);8788void89lp_setup_set_point_state( struct lp_setup_context *setup,90float point_size,91boolean point_size_per_vertex,92uint sprite_coord_enable,93uint sprite_coord_origin,94boolean point_quad_rasterization);9596void97lp_setup_set_setup_variant( struct lp_setup_context *setup,98const struct lp_setup_variant *variant );99100void101lp_setup_set_fs_variant( struct lp_setup_context *setup,102struct lp_fragment_shader_variant *variant );103104void105lp_setup_set_fs_constants(struct lp_setup_context *setup,106unsigned num,107struct pipe_constant_buffer *buffers);108109void110lp_setup_set_fs_ssbos(struct lp_setup_context *setup,111unsigned num,112struct pipe_shader_buffer *buffers);113114void115lp_setup_set_fs_images(struct lp_setup_context *setup,116unsigned num,117struct pipe_image_view *images);118119void120lp_setup_set_alpha_ref_value( struct lp_setup_context *setup,121float alpha_ref_value );122123void124lp_setup_set_stencil_ref_values( struct lp_setup_context *setup,125const ubyte refs[2] );126127void128lp_setup_set_blend_color( struct lp_setup_context *setup,129const struct pipe_blend_color *blend_color );130131void132lp_setup_set_scissors( struct lp_setup_context *setup,133const struct pipe_scissor_state *scissors );134135void136lp_setup_set_viewports(struct lp_setup_context *setup,137unsigned num_viewports,138const struct pipe_viewport_state *viewports);139140void141lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup,142unsigned num,143struct pipe_sampler_view **views);144145void146lp_setup_set_fragment_sampler_state(struct lp_setup_context *setup,147unsigned num,148struct pipe_sampler_state **samplers);149150unsigned151lp_setup_is_resource_referenced( const struct lp_setup_context *setup,152const struct pipe_resource *texture );153154void155lp_setup_set_sample_mask(struct lp_setup_context *setup,156uint32_t sample_mask);157158void159lp_setup_set_flatshade_first( struct lp_setup_context *setup,160boolean flatshade_first );161162void163lp_setup_set_rasterizer_discard( struct lp_setup_context *setup,164boolean rasterizer_discard );165166void167lp_setup_set_vertex_info( struct lp_setup_context *setup,168struct vertex_info *info );169170void171lp_setup_begin_query(struct lp_setup_context *setup,172struct llvmpipe_query *pq);173174void175lp_setup_end_query(struct lp_setup_context *setup,176struct llvmpipe_query *pq);177178static inline unsigned179lp_clamp_viewport_idx(int idx)180{181return (PIPE_MAX_VIEWPORTS > idx && idx >= 0) ? idx : 0;182}183184#endif185186187