14a49301eSmrg/************************************************************************** 24a49301eSmrg * 3af69d88dSmrg * Copyright 2007 VMware, Inc. 44a49301eSmrg * All Rights Reserved. 54a49301eSmrg * 64a49301eSmrg * Permission is hereby granted, free of charge, to any person obtaining a 74a49301eSmrg * copy of this software and associated documentation files (the 84a49301eSmrg * "Software"), to deal in the Software without restriction, including 94a49301eSmrg * without limitation the rights to use, copy, modify, merge, publish, 104a49301eSmrg * distribute, sub license, and/or sell copies of the Software, and to 114a49301eSmrg * permit persons to whom the Software is furnished to do so, subject to 124a49301eSmrg * the following conditions: 134a49301eSmrg * 144a49301eSmrg * The above copyright notice and this permission notice (including the 154a49301eSmrg * next paragraph) shall be included in all copies or substantial portions 164a49301eSmrg * of the Software. 174a49301eSmrg * 184a49301eSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 194a49301eSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 204a49301eSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21af69d88dSmrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 224a49301eSmrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 234a49301eSmrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 244a49301eSmrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 254a49301eSmrg * 264a49301eSmrg **************************************************************************/ 274a49301eSmrg 28af69d88dSmrg/* Authors: Keith Whitwell <keithw@vmware.com> 294a49301eSmrg */ 304a49301eSmrg 314a49301eSmrg#ifndef LP_STATE_H 324a49301eSmrg#define LP_STATE_H 334a49301eSmrg 344a49301eSmrg#include "pipe/p_state.h" 354a49301eSmrg#include "lp_jit.h" 363464ebd5Sriastradh#include "lp_state_fs.h" 373464ebd5Sriastradh#include "gallivm/lp_bld.h" 384a49301eSmrg 394a49301eSmrg 404a49301eSmrg#define LP_NEW_VIEWPORT 0x1 414a49301eSmrg#define LP_NEW_RASTERIZER 0x2 424a49301eSmrg#define LP_NEW_FS 0x4 434a49301eSmrg#define LP_NEW_BLEND 0x8 444a49301eSmrg#define LP_NEW_CLIP 0x10 454a49301eSmrg#define LP_NEW_SCISSOR 0x20 464a49301eSmrg#define LP_NEW_STIPPLE 0x40 474a49301eSmrg#define LP_NEW_FRAMEBUFFER 0x80 484a49301eSmrg#define LP_NEW_DEPTH_STENCIL_ALPHA 0x100 4901e04c3fSmrg#define LP_NEW_FS_CONSTANTS 0x200 504a49301eSmrg#define LP_NEW_SAMPLER 0x400 513464ebd5Sriastradh#define LP_NEW_SAMPLER_VIEW 0x800 524a49301eSmrg#define LP_NEW_VERTEX 0x1000 534a49301eSmrg#define LP_NEW_VS 0x2000 54af69d88dSmrg#define LP_NEW_OCCLUSION_QUERY 0x4000 55cdc920a0Smrg#define LP_NEW_BLEND_COLOR 0x8000 563464ebd5Sriastradh#define LP_NEW_GS 0x10000 573464ebd5Sriastradh#define LP_NEW_SO 0x20000 583464ebd5Sriastradh#define LP_NEW_SO_BUFFERS 0x40000 597ec681f3Smrg#define LP_NEW_FS_SSBOS 0x80000 607ec681f3Smrg#define LP_NEW_FS_IMAGES 0x100000 617ec681f3Smrg#define LP_NEW_TCS 0x200000 627ec681f3Smrg#define LP_NEW_TES 0x400000 637ec681f3Smrg#define LP_NEW_SAMPLE_MASK 0x800000 647ec681f3Smrg 657ec681f3Smrg#define LP_CSNEW_CS 0x1 667ec681f3Smrg#define LP_CSNEW_CONSTANTS 0x2 677ec681f3Smrg#define LP_CSNEW_SAMPLER 0x4 687ec681f3Smrg#define LP_CSNEW_SAMPLER_VIEW 0x8 697ec681f3Smrg#define LP_CSNEW_SSBOS 0x10 707ec681f3Smrg#define LP_CSNEW_IMAGES 0x20 714a49301eSmrg 724a49301eSmrgstruct vertex_info; 734a49301eSmrgstruct pipe_context; 744a49301eSmrgstruct llvmpipe_context; 754a49301eSmrg 764a49301eSmrg 774a49301eSmrg 783464ebd5Sriastradhstruct lp_geometry_shader { 79af69d88dSmrg boolean no_tokens; 80af69d88dSmrg struct pipe_stream_output_info stream_output; 81af69d88dSmrg struct draw_geometry_shader *dgs; 824a49301eSmrg}; 834a49301eSmrg 847ec681f3Smrgstruct lp_tess_ctrl_shader { 857ec681f3Smrg boolean no_tokens; 867ec681f3Smrg struct pipe_stream_output_info stream_output; 877ec681f3Smrg struct draw_tess_ctrl_shader *dtcs; 887ec681f3Smrg}; 897ec681f3Smrg 907ec681f3Smrgstruct lp_tess_eval_shader { 917ec681f3Smrg boolean no_tokens; 927ec681f3Smrg struct pipe_stream_output_info stream_output; 937ec681f3Smrg struct draw_tess_eval_shader *dtes; 947ec681f3Smrg}; 957ec681f3Smrg 967ec681f3Smrg 973464ebd5Sriastradh/** Vertex element state */ 983464ebd5Sriastradhstruct lp_velems_state 994a49301eSmrg{ 1003464ebd5Sriastradh unsigned count; 1013464ebd5Sriastradh struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; 1024a49301eSmrg}; 1034a49301eSmrg 1043464ebd5Sriastradhstruct lp_so_state { 105af69d88dSmrg struct pipe_stream_output_info base; 1064a49301eSmrg}; 1074a49301eSmrg 1084a49301eSmrg 1093464ebd5Sriastradhvoid 1103464ebd5Sriastradhllvmpipe_set_framebuffer_state(struct pipe_context *, 1113464ebd5Sriastradh const struct pipe_framebuffer_state *); 1123464ebd5Sriastradh 1133464ebd5Sriastradhvoid 1143464ebd5Sriastradhllvmpipe_update_fs(struct llvmpipe_context *lp); 1154a49301eSmrg 1163464ebd5Sriastradhvoid 1173464ebd5Sriastradhllvmpipe_update_setup(struct llvmpipe_context *lp); 1184a49301eSmrg 1197ec681f3Smrgvoid 1207ec681f3Smrgllvmpipe_update_derived_clear(struct llvmpipe_context *llvmpipe); 1217ec681f3Smrg 122cdc920a0Smrgvoid 1233464ebd5Sriastradhllvmpipe_update_derived(struct llvmpipe_context *llvmpipe); 1244a49301eSmrg 125cdc920a0Smrgvoid 1263464ebd5Sriastradhllvmpipe_init_sampler_funcs(struct llvmpipe_context *llvmpipe); 127cdc920a0Smrg 1283464ebd5Sriastradhvoid 1293464ebd5Sriastradhllvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe); 1304a49301eSmrg 1313464ebd5Sriastradhvoid 1323464ebd5Sriastradhllvmpipe_init_vertex_funcs(struct llvmpipe_context *llvmpipe); 1334a49301eSmrg 1343464ebd5Sriastradhvoid 1353464ebd5Sriastradhllvmpipe_init_draw_funcs(struct llvmpipe_context *llvmpipe); 1364a49301eSmrg 1377ec681f3Smrgvoid 1387ec681f3Smrgllvmpipe_init_compute_funcs(struct llvmpipe_context *llvmpipe); 1397ec681f3Smrg 1403464ebd5Sriastradhvoid 1413464ebd5Sriastradhllvmpipe_init_clip_funcs(struct llvmpipe_context *llvmpipe); 1424a49301eSmrg 1433464ebd5Sriastradhvoid 1443464ebd5Sriastradhllvmpipe_init_fs_funcs(struct llvmpipe_context *llvmpipe); 1454a49301eSmrg 1463464ebd5Sriastradhvoid 1473464ebd5Sriastradhllvmpipe_init_vs_funcs(struct llvmpipe_context *llvmpipe); 1484a49301eSmrg 1493464ebd5Sriastradhvoid 1503464ebd5Sriastradhllvmpipe_init_gs_funcs(struct llvmpipe_context *llvmpipe); 1514a49301eSmrg 1527ec681f3Smrgvoid 1537ec681f3Smrgllvmpipe_init_tess_funcs(struct llvmpipe_context *llvmpipe); 1547ec681f3Smrg 155cdc920a0Smrgvoid 1563464ebd5Sriastradhllvmpipe_init_rasterizer_funcs(struct llvmpipe_context *llvmpipe); 1574a49301eSmrg 1584a49301eSmrgvoid 1593464ebd5Sriastradhllvmpipe_init_so_funcs(struct llvmpipe_context *llvmpipe); 1604a49301eSmrg 1614a49301eSmrgvoid 1623464ebd5Sriastradhllvmpipe_prepare_vertex_sampling(struct llvmpipe_context *ctx, 1633464ebd5Sriastradh unsigned num, 1643464ebd5Sriastradh struct pipe_sampler_view **views); 1654a49301eSmrg 166af69d88dSmrgvoid 167af69d88dSmrgllvmpipe_prepare_geometry_sampling(struct llvmpipe_context *ctx, 168af69d88dSmrg unsigned num, 169af69d88dSmrg struct pipe_sampler_view **views); 170af69d88dSmrg 1717ec681f3Smrgvoid 1727ec681f3Smrgllvmpipe_prepare_tess_ctrl_sampling(struct llvmpipe_context *ctx, 1737ec681f3Smrg unsigned num, 1747ec681f3Smrg struct pipe_sampler_view **views); 1757ec681f3Smrg 1767ec681f3Smrgvoid 1777ec681f3Smrgllvmpipe_prepare_tess_eval_sampling(struct llvmpipe_context *ctx, 1787ec681f3Smrg unsigned num, 1797ec681f3Smrg struct pipe_sampler_view **views); 1807ec681f3Smrgvoid 1817ec681f3Smrgllvmpipe_cleanup_stage_sampling(struct llvmpipe_context *ctx, 1827ec681f3Smrg enum pipe_shader_type stage); 1837ec681f3Smrg 1847ec681f3Smrgvoid 1857ec681f3Smrgllvmpipe_prepare_vertex_images(struct llvmpipe_context *lp, 1867ec681f3Smrg unsigned num, 1877ec681f3Smrg struct pipe_image_view *views); 1887ec681f3Smrg 1897ec681f3Smrgvoid 1907ec681f3Smrgllvmpipe_prepare_geometry_images(struct llvmpipe_context *lp, 1917ec681f3Smrg unsigned num, 1927ec681f3Smrg struct pipe_image_view *views); 1937ec681f3Smrg 1947ec681f3Smrgvoid 1957ec681f3Smrgllvmpipe_prepare_tess_ctrl_images(struct llvmpipe_context *lp, 1967ec681f3Smrg unsigned num, 1977ec681f3Smrg struct pipe_image_view *views); 1987ec681f3Smrg 1997ec681f3Smrgvoid 2007ec681f3Smrgllvmpipe_prepare_tess_eval_images(struct llvmpipe_context *lp, 2017ec681f3Smrg unsigned num, 2027ec681f3Smrg struct pipe_image_view *views); 2037ec681f3Smrg 2047ec681f3Smrgvoid 2057ec681f3Smrgllvmpipe_cleanup_stage_images(struct llvmpipe_context *ctx, 2067ec681f3Smrg enum pipe_shader_type stage); 2077ec681f3Smrg 2084a49301eSmrg#endif 209