1946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca/************************************************************************** 2946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 3946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. 4946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * All Rights Reserved. 5946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 6946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * Permission is hereby granted, free of charge, to any person obtaining a 7946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * copy of this software and associated documentation files (the 8946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * "Software"), to deal in the Software without restriction, including 9946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * without limitation the rights to use, copy, modify, merge, publish, 10946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * distribute, sub license, and/or sell copies of the Software, and to 11946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * permit persons to whom the Software is furnished to do so, subject to 12946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * the following conditions: 13946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 14946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * The above copyright notice and this permission notice (including the 15946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * next paragraph) shall be included in all copies or substantial portions 16946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * of the Software. 17946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 18946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 22946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca * 26946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca **************************************************************************/ 27946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 28946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca/* Authors: Keith Whitwell <keith@tungstengraphics.com> 29946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca */ 30946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 31c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#ifndef LP_STATE_H 32c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_STATE_H 33946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 34946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca#include "pipe/p_state.h" 3508dd41fd6899bd6b3289d30dc31f8b2998406889José Fonseca#include "lp_jit.h" 3618fb9ff6d8f58a08e559070cf29f26ed0caa567fJosé Fonseca#include "lp_state_fs.h" 37965a604306e9371379cccebc5f83120e99d18548Brian Paul#include "gallivm/lp_bld.h" 38946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 39946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 40c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_VIEWPORT 0x1 41c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_RASTERIZER 0x2 42c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_FS 0x4 43c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_BLEND 0x8 44c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_CLIP 0x10 45c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_SCISSOR 0x20 46c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_STIPPLE 0x40 47c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_FRAMEBUFFER 0x80 48c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_DEPTH_STENCIL_ALPHA 0x100 49c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_CONSTANTS 0x200 50c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_SAMPLER 0x400 511fb440beb9cccbe6f4bbd309792a89f6e1b4ee3fmichal#define LP_NEW_SAMPLER_VIEW 0x800 52c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_VERTEX 0x1000 53c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_VS 0x2000 54c9a5930fe45a0a0299769bd2b672ca516d1bf39eJosé Fonseca#define LP_NEW_QUERY 0x4000 55d904ed88c1d957f662497343de7dc3e9fa743e47José Fonseca#define LP_NEW_BLEND_COLOR 0x8000 56a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwell#define LP_NEW_GS 0x10000 57b5e381d9783f17c9a527ac38122444eac6807566Zack Rusin#define LP_NEW_SO 0x20000 58b5e381d9783f17c9a527ac38122444eac6807566Zack Rusin#define LP_NEW_SO_BUFFERS 0x40000 59b5e381d9783f17c9a527ac38122444eac6807566Zack Rusin 60946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 61946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 62946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecastruct vertex_info; 63e4c76c02f77ed6e86537b546f4200f8f8132d114José Fonsecastruct pipe_context; 64e4c76c02f77ed6e86537b546f4200f8f8132d114José Fonsecastruct llvmpipe_context; 65946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 66946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 67946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 68946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca/** Subclass of pipe_shader_state */ 69965a604306e9371379cccebc5f83120e99d18548Brian Paulstruct lp_vertex_shader 70965a604306e9371379cccebc5f83120e99d18548Brian Paul{ 71946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca struct pipe_shader_state shader; 72946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca struct draw_vertex_shader *draw_data; 73946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca}; 74946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 75a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwell/** Subclass of pipe_shader_state */ 76a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwellstruct lp_geometry_shader { 77a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwell struct pipe_shader_state shader; 78a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwell struct draw_geometry_shader *draw_data; 79a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwell}; 80965a604306e9371379cccebc5f83120e99d18548Brian Paul 81965a604306e9371379cccebc5f83120e99d18548Brian Paul/** Vertex element state */ 82965a604306e9371379cccebc5f83120e99d18548Brian Paulstruct lp_velems_state 83965a604306e9371379cccebc5f83120e99d18548Brian Paul{ 84f89730385532056e89e3b9053c244a67f84e323eRoland Scheidegger unsigned count; 85e8983f70b41ea92a9527cb618db011b5dd136626Roland Scheidegger struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; 86f89730385532056e89e3b9053c244a67f84e323eRoland Scheidegger}; 87946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 88b5e381d9783f17c9a527ac38122444eac6807566Zack Rusinstruct lp_so_state { 89861a029ddb31e91bb4d8e18ab708d0d172f63aadMarek Olšák struct pipe_stream_output_info base; 90b5e381d9783f17c9a527ac38122444eac6807566Zack Rusin}; 91b5e381d9783f17c9a527ac38122444eac6807566Zack Rusin 92946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 93946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecavoid 94dd2fd8ae036c9f19dabe0ef1f6200385d2f49100Brian Paulllvmpipe_set_framebuffer_state(struct pipe_context *, 95dd2fd8ae036c9f19dabe0ef1f6200385d2f49100Brian Paul const struct pipe_framebuffer_state *); 96946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 97946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonsecavoid 98dd2fd8ae036c9f19dabe0ef1f6200385d2f49100Brian Paulllvmpipe_update_fs(struct llvmpipe_context *lp); 995b4c43d98556c5a4806757513bcb196a724518c5Keith Whitwell 1005b4c43d98556c5a4806757513bcb196a724518c5Keith Whitwellvoid 1015b4c43d98556c5a4806757513bcb196a724518c5Keith Whitwellllvmpipe_update_setup(struct llvmpipe_context *lp); 102946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 103dd2fd8ae036c9f19dabe0ef1f6200385d2f49100Brian Paulvoid 104965a604306e9371379cccebc5f83120e99d18548Brian Paulllvmpipe_update_derived(struct llvmpipe_context *llvmpipe); 105946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca 106bfd81b4ebb1eb16ff56ec1a38aeb942eb7f0389cBrian Paulvoid 107bfd81b4ebb1eb16ff56ec1a38aeb942eb7f0389cBrian Paulllvmpipe_init_sampler_funcs(struct llvmpipe_context *llvmpipe); 108bfd81b4ebb1eb16ff56ec1a38aeb942eb7f0389cBrian Paul 1098fd794db9e04da1c272e3681e5d2f74ce84fde07Brian Paulvoid 1108fd794db9e04da1c272e3681e5d2f74ce84fde07Brian Paulllvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe); 1118fd794db9e04da1c272e3681e5d2f74ce84fde07Brian Paul 112e351e828698b133feb1f626c1d99d0fcb2ec1480Brian Paulvoid 113e351e828698b133feb1f626c1d99d0fcb2ec1480Brian Paulllvmpipe_init_vertex_funcs(struct llvmpipe_context *llvmpipe); 114bfd81b4ebb1eb16ff56ec1a38aeb942eb7f0389cBrian Paul 115f7885f8f1fd242dd3f8dafe98549c190bb4cab3aBrian Paulvoid 116f7885f8f1fd242dd3f8dafe98549c190bb4cab3aBrian Paulllvmpipe_init_draw_funcs(struct llvmpipe_context *llvmpipe); 117f7885f8f1fd242dd3f8dafe98549c190bb4cab3aBrian Paul 1182176cad7dc478db3a329521a13d5537a8d99aedcBrian Paulvoid 1192176cad7dc478db3a329521a13d5537a8d99aedcBrian Paulllvmpipe_init_clip_funcs(struct llvmpipe_context *llvmpipe); 1202176cad7dc478db3a329521a13d5537a8d99aedcBrian Paul 1219523d78dde7f2e819275ecb39cdeafe50eb65f13Brian Paulvoid 1229523d78dde7f2e819275ecb39cdeafe50eb65f13Brian Paulllvmpipe_init_fs_funcs(struct llvmpipe_context *llvmpipe); 1239523d78dde7f2e819275ecb39cdeafe50eb65f13Brian Paul 1249523d78dde7f2e819275ecb39cdeafe50eb65f13Brian Paulvoid 1259523d78dde7f2e819275ecb39cdeafe50eb65f13Brian Paulllvmpipe_init_vs_funcs(struct llvmpipe_context *llvmpipe); 1269523d78dde7f2e819275ecb39cdeafe50eb65f13Brian Paul 1278975ade13b7efdea2273e91e05cc6ecbda6ca454Brian Paulvoid 128a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwellllvmpipe_init_gs_funcs(struct llvmpipe_context *llvmpipe); 129a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwell 130a6d9d18faecef9963be3e4b64a21b89889b4670dKeith Whitwellvoid 1318975ade13b7efdea2273e91e05cc6ecbda6ca454Brian Paulllvmpipe_init_rasterizer_funcs(struct llvmpipe_context *llvmpipe); 1328975ade13b7efdea2273e91e05cc6ecbda6ca454Brian Paul 133b5e381d9783f17c9a527ac38122444eac6807566Zack Rusinvoid 134b5e381d9783f17c9a527ac38122444eac6807566Zack Rusinllvmpipe_init_so_funcs(struct llvmpipe_context *llvmpipe); 135b5e381d9783f17c9a527ac38122444eac6807566Zack Rusin 13699c8d9b6dac55263b3f0ddce939173ec9a16cf80Zack Rusinvoid 13799c8d9b6dac55263b3f0ddce939173ec9a16cf80Zack Rusinllvmpipe_prepare_vertex_sampling(struct llvmpipe_context *ctx, 13899c8d9b6dac55263b3f0ddce939173ec9a16cf80Zack Rusin unsigned num, 13999c8d9b6dac55263b3f0ddce939173ec9a16cf80Zack Rusin struct pipe_sampler_view **views); 14099c8d9b6dac55263b3f0ddce939173ec9a16cf80Zack Rusinvoid 14199c8d9b6dac55263b3f0ddce939173ec9a16cf80Zack Rusinllvmpipe_cleanup_vertex_sampling(struct llvmpipe_context *ctx); 142b5e381d9783f17c9a527ac38122444eac6807566Zack Rusin 1432176cad7dc478db3a329521a13d5537a8d99aedcBrian Paul 144946f432a08112148d743eb9faf6b27bb8cc7fa76José Fonseca#endif 145