18e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell/************************************************************************** 28e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 3877128505431adaf817dc8069172ebe4a1cdf5d8José Fonseca * Copyright 2007 VMware, Inc. 48e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * All Rights Reserved. 58e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 68e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * Permission is hereby granted, free of charge, to any person obtaining a 78e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * copy of this software and associated documentation files (the 88e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * "Software"), to deal in the Software without restriction, including 98e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * without limitation the rights to use, copy, modify, merge, publish, 108e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * distribute, sub license, and/or sell copies of the Software, and to 118e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * permit persons to whom the Software is furnished to do so, subject to 128e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * the following conditions: 138e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 148e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * The above copyright notice and this permission notice (including the 158e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * next paragraph) shall be included in all copies or substantial portions 168e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * of the Software. 178e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 188e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 198e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 208e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21877128505431adaf817dc8069172ebe4a1cdf5d8José Fonseca * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 228e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 238e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 248e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 258e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * 268e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell **************************************************************************/ 278e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 28877128505431adaf817dc8069172ebe4a1cdf5d8José Fonseca/* Authors: Keith Whitwell <keithw@vmware.com> 298e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell */ 308e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 3116fdae16b6c34dd93867e98320152fbaac71139eBrian Paul#ifndef SP_CONTEXT_H 3216fdae16b6c34dd93867e98320152fbaac71139eBrian Paul#define SP_CONTEXT_H 338e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 346393cda6766b707ef01e925d378239a66d143ae0Keith Whitwell#include "pipe/p_context.h" 353d9d4b1ce6e700d85920eca84ae58a4dcf7288c2Marek Olšák#include "util/u_blitter.h" 368e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 376acd63a4980951727939c0dd545a0324965b3834José Fonseca#include "draw/draw_vertex.h" 38440e794b05511c1854c22956e6e306d1b1d8682dBrian Paul 39ed6f41e2f467f5b9338320a96202c7dfd181422fBrian Paul#include "sp_quad_pipe.h" 40892e2d1395375c6f904af5250371c8d2784c8762Roland Scheidegger#include "sp_setup.h" 418e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 42440e794b05511c1854c22956e6e306d1b1d8682dBrian Paul 4357aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul/** Do polygon stipple in the draw module? */ 4457aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul#define DO_PSTIPPLE_IN_DRAW_MODULE 0 4557aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul 4657aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul/** Do polygon stipple with the util module? */ 4757aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul#define DO_PSTIPPLE_IN_HELPER_MODULE 1 4844519e18a410016fde7ad8a66cd042bbc90c8940Brian Paul 4944519e18a410016fde7ad8a66cd042bbc90c8940Brian Paul 50cd3643698eafa0869a8317b002e5b066de0172e7Brian Paulstruct softpipe_vbuf_render; 518e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwellstruct draw_context; 52ea470eec86715cd2bc9aa86d36e6ea803d0d4017Brian Paulstruct draw_stage; 537e8396399824108d62dc3e02b2af0422e98aab8eBrian Paulstruct softpipe_tile_cache; 5480c78472ad43f4288c9ef5076074ba9d31a39885Keith Whitwellstruct softpipe_tex_tile_cache; 55c04a7f8929d674971a472ffa4d3a31200c22aa5aKeith Whitwellstruct sp_fragment_shader; 56c04a7f8929d674971a472ffa4d3a31200c22aa5aKeith Whitwellstruct sp_vertex_shader; 57057427dd3ea9da6f907b39391f6bd1b093fb128eRoland Scheideggerstruct sp_velems_state; 58a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusinstruct sp_so_state; 598e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 60a1a989f0be8dc34082b52bb3b3a6eacb36d9e75eZack Rusinstruct softpipe_context { 61e7a208514812506eeb9862b91258392da646b618Brian Paul struct pipe_context pipe; /**< base class */ 628e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 630aaa3ef2faf5c71c53abd5314ed7d55dcb929e21Brian Paul /** Constant state objects */ 644fc7d0345a18042a79686940fb7cc4e698cc9192Keith Whitwell struct pipe_blend_state *blend; 65d6c3e6d8f34fc39dcbe9395c3a5953af726443f1Brian Paul struct pipe_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; 664fc7d0345a18042a79686940fb7cc4e698cc9192Keith Whitwell struct pipe_depth_stencil_alpha_state *depth_stencil; 674fc7d0345a18042a79686940fb7cc4e698cc9192Keith Whitwell struct pipe_rasterizer_state *rasterizer; 684fc7d0345a18042a79686940fb7cc4e698cc9192Keith Whitwell struct sp_fragment_shader *fs; 69c534f11164bbecf25eb2b1e697f9511eceb0c86fBrian Paul struct sp_fragment_shader_variant *fs_variant; 704fc7d0345a18042a79686940fb7cc4e698cc9192Keith Whitwell struct sp_vertex_shader *vs; 7189d8577fb3036547ef0b47498cc8dc5c77f886e0Zack Rusin struct sp_geometry_shader *gs; 72057427dd3ea9da6f907b39391f6bd1b093fb128eRoland Scheidegger struct sp_velems_state *velems; 73a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bcZack Rusin struct sp_so_state *so; 74e749c30cebe071da450e28cb47b1b7deb8284a39Dave Airlie struct sp_compute_shader *cs; 759780327c5d95586a88fce94d7b47342355ead118Zack Rusin 760aaa3ef2faf5c71c53abd5314ed7d55dcb929e21Brian Paul /** Other rendering state */ 77d378a2c0b87dfc0bee0e8310312fec566148cb63Brian Paul struct pipe_blend_color blend_color; 78ec22b75be1c57f991f48bf6cc1d4b910911e8bf2Brian Paul struct pipe_blend_color blend_color_clamped; 79658e94578f8004c01eb8c64254728912527e0c2fRoland Scheidegger struct pipe_stencil_ref stencil_ref; 80ea92566ed9cabf5eb5d0993b39c4372d5bfcf3f1Brian Paul struct pipe_clip_state clip; 81287c94ea4987033f9c99a2f91c5750c9083504caKeith Whitwell struct pipe_resource *constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS]; 82ea92566ed9cabf5eb5d0993b39c4372d5bfcf3f1Brian Paul struct pipe_framebuffer_state framebuffer; 836393cda6766b707ef01e925d378239a66d143ae0Keith Whitwell struct pipe_poly_stipple poly_stipple; 8400f97ad5def91d485de0e5dd79fd39fae9ed3ce1Edward O'Callaghan struct pipe_scissor_state scissors[PIPE_MAX_VIEWPORTS]; 85ef17cc9cb697a7146cf2a3dba2eb0f6a968918ccRoland Scheidegger struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS]; 86d6c3e6d8f34fc39dcbe9395c3a5953af726443f1Brian Paul 87eb9ad9faa3975fc4f044b81d3b4b793866ef5563Dave Airlie struct pipe_image_view images[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_IMAGES]; 88afa8707ba93a7d226a76319acda2a8dd89524db7Dave Airlie struct pipe_shader_buffer buffers[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_BUFFERS]; 8900f97ad5def91d485de0e5dd79fd39fae9ed3ce1Edward O'Callaghan struct pipe_viewport_state viewports[PIPE_MAX_VIEWPORTS]; 9039038c11699bbc9baab744542e96d54e91cb452aBrian Paul struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; 916d28bf917fb1d741d90fd3f05c22769376021fcaChia-I Wu struct pipe_index_buffer index_buffer; 923d29e75a5f59639c3b9dfed26cd41ab13c0d60fcRoland Scheidegger struct pipe_resource *mapped_vs_tex[PIPE_MAX_SHADER_SAMPLER_VIEWS]; 933d29e75a5f59639c3b9dfed26cd41ab13c0d60fcRoland Scheidegger struct pipe_resource *mapped_gs_tex[PIPE_MAX_SHADER_SAMPLER_VIEWS]; 94ec8cbd79ac4065111365a6720c9564de56855cc8Dave Airlie 95ec8cbd79ac4065111365a6720c9564de56855cc8Dave Airlie struct draw_so_target *so_targets[PIPE_MAX_SO_BUFFERS]; 96b2d3f364dbc6fe1d506224534dc48f58d9dcbabaBrian Paul unsigned num_so_targets; 97ec8cbd79ac4065111365a6720c9564de56855cc8Dave Airlie 98be7d8ddf0c0a293ee94db360a44561beb10e62f9Zack Rusin struct pipe_query_data_so_statistics so_stats; 998e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 10080ee4a407a2668f6a6a410c3e56ae9910510f773Zack Rusin struct pipe_query_data_pipeline_statistics pipeline_statistics; 10180ee4a407a2668f6a6a410c3e56ae9910510f773Zack Rusin unsigned active_statistics_queries; 10280ee4a407a2668f6a6a410c3e56ae9910510f773Zack Rusin 103d6c3e6d8f34fc39dcbe9395c3a5953af726443f1Brian Paul unsigned num_samplers[PIPE_SHADER_TYPES]; 104d6c3e6d8f34fc39dcbe9395c3a5953af726443f1Brian Paul unsigned num_sampler_views[PIPE_SHADER_TYPES]; 105d6c3e6d8f34fc39dcbe9395c3a5953af726443f1Brian Paul 10628cf8c8fdcbd2817b93f27cad2bba3b4fb8aecf5Brian Paul unsigned num_vertex_buffers; 1074528287e040415c2071012d02f20979ff995c754Keith Whitwell 1080aaa3ef2faf5c71c53abd5314ed7d55dcb929e21Brian Paul unsigned dirty; /**< Mask of SP_NEW_x flags */ 109a5b87f249ef79b1a8d8b9dbe72879b7ac9eb133cKeith Whitwell 11013699463a33c1adf44005125c488e886e074a05bKeith Whitwell /* Counter for occlusion queries. Note this supports overlapping 11113699463a33c1adf44005125c488e886e074a05bKeith Whitwell * queries. 11209fbb3837b6aa5dfc6c94f41ab5443820177c569Brian Paul */ 113ab3a9f1eeda5b216099763f6eb932da723309f4aJosé Fonseca uint64_t occlusion_count; 11457fd20237541c34ed06587bca9f5a58c8a63fbf4Keith Whitwell unsigned active_query_count; 11509fbb3837b6aa5dfc6c94f41ab5443820177c569Brian Paul 1160aaa3ef2faf5c71c53abd5314ed7d55dcb929e21Brian Paul /** Mapped vertex buffers */ 11739038c11699bbc9baab744542e96d54e91cb452aBrian Paul ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS]; 1180fb71be2179ebf140b086682f050399809ef57b8Brian Paul 119c0bb4ba9e665e40a325d82aa2ee48d7b8abd603bBrian Paul /** Mapped constant buffers */ 12073d9400ad65c1ec0a20c29805a9fc1930687988cKeith Whitwell const void *mapped_constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS]; 121ba2cc3b8e6ad161181b67fd2575c6bc768584d23Brian Paul unsigned const_buffer_size[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS]; 1228e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 123440e794b05511c1854c22956e6e306d1b1d8682dBrian Paul /** Vertex format */ 124892e2d1395375c6f904af5250371c8d2784c8762Roland Scheidegger struct sp_setup_info setup_info; 1258d4039ecdb167771d4b085f70b9666438be1c6adRoland Scheidegger struct vertex_info vertex_info; 1266000dcc973cdc1bd61621b432aed27d21059ae5dBrian Paul 1270aaa3ef2faf5c71c53abd5314ed7d55dcb929e21Brian Paul /** Which vertex shader output slot contains point size */ 1288d4039ecdb167771d4b085f70b9666438be1c6adRoland Scheidegger int8_t psize_slot; 1298e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 13000f97ad5def91d485de0e5dd79fd39fae9ed3ce1Edward O'Callaghan /** Which vertex shader output slot contains viewport index */ 1318d4039ecdb167771d4b085f70b9666438be1c6adRoland Scheidegger int8_t viewport_index_slot; 13200f97ad5def91d485de0e5dd79fd39fae9ed3ce1Edward O'Callaghan 133740d5bed77120aba4d815b5e2d28b109f214a800Dave Airlie /** Which vertex shader output slot contains layer */ 1348d4039ecdb167771d4b085f70b9666438be1c6adRoland Scheidegger int8_t layer_slot; 135740d5bed77120aba4d815b5e2d28b109f214a800Dave Airlie 1360fb71be2179ebf140b086682f050399809ef57b8Brian Paul /** The reduced version of the primitive supplied by the state tracker */ 137a1dbd7aa159e266592a1e52504680992327ca9e0Keith Whitwell unsigned reduced_api_prim; 138a1dbd7aa159e266592a1e52504680992327ca9e0Keith Whitwell 1390bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell /** Derived information about which winding orders to cull */ 1400bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell unsigned cull_mode; 1410bd1cbcd0d28dbadfb0c3e1f8b048a18b56bc72cKeith Whitwell 1420fb71be2179ebf140b086682f050399809ef57b8Brian Paul /** 1430fb71be2179ebf140b086682f050399809ef57b8Brian Paul * The reduced primitive after unfilled triangles, wide-line decomposition, 1440fb71be2179ebf140b086682f050399809ef57b8Brian Paul * etc, are taken into account. This is the primitive type that's actually 1450fb71be2179ebf140b086682f050399809ef57b8Brian Paul * rasterized. 146a1dbd7aa159e266592a1e52504680992327ca9e0Keith Whitwell */ 147a1dbd7aa159e266592a1e52504680992327ca9e0Keith Whitwell unsigned reduced_prim; 148f58ab8e75c082a0aea36ed63fe7e21fb5fac14b6Brian Paul 149a0c1d591ab8d19377c7ab784a0472fac00f9fcd3Brian Paul /** Derived from scissor and surface bounds: */ 15000f97ad5def91d485de0e5dd79fd39fae9ed3ce1Edward O'Callaghan struct pipe_scissor_state cliprect[PIPE_MAX_VIEWPORTS]; 151a0c1d591ab8d19377c7ab784a0472fac00f9fcd3Brian Paul 15270af238b494ed1b6da4841c2065c33ee0f0f37c9Keith Whitwell unsigned line_stipple_counter; 1530360b49afbcd839f99ba0745d01cf9dc5be4d122Brian Paul 15441450b03a8e8e0f94f8eefc6880d32e9b0ef6f6dBrian Paul /** Conditional query object and mode */ 15541450b03a8e8e0f94f8eefc6880d32e9b0ef6f6dBrian Paul struct pipe_query *render_cond_query; 15641450b03a8e8e0f94f8eefc6880d32e9b0ef6f6dBrian Paul uint render_cond_mode; 157793e8e3d7ed816cc9a066245dde798afdcf8b581Roland Scheidegger boolean render_cond_cond; 15841450b03a8e8e0f94f8eefc6880d32e9b0ef6f6dBrian Paul 15957aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul /** Polygon stipple items */ 16057aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul struct { 16157aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul struct pipe_resource *texture; 16257aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul struct pipe_sampler_state *sampler; 16357aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul struct pipe_sampler_view *sampler_view; 16457aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul } pstipple; 16557aa597b3d5dac0fc59c05557dafec59e14e1019Brian Paul 166e7a208514812506eeb9862b91258392da646b618Brian Paul /** Software quad rendering pipeline */ 167fb5cdbd078d4d44fb43d417843debe41148f3714Brian Paul struct { 168fb5cdbd078d4d44fb43d417843debe41148f3714Brian Paul struct quad_stage *shade; 169fb5cdbd078d4d44fb43d417843debe41148f3714Brian Paul struct quad_stage *depth_test; 170fb5cdbd078d4d44fb43d417843debe41148f3714Brian Paul struct quad_stage *blend; 17144519e18a410016fde7ad8a66cd042bbc90c8940Brian Paul struct quad_stage *pstipple; 172fb5cdbd078d4d44fb43d417843debe41148f3714Brian Paul struct quad_stage *first; /**< points to one of the above stages */ 1736153a1c28f118be1a74ffee0e19c16fb83b5cab7Keith Whitwell } quad; 174fb5cdbd078d4d44fb43d417843debe41148f3714Brian Paul 175b9604fe7699355584307ee3f38e048914fdfd76bBrian Paul /** TGSI exec things */ 176b9604fe7699355584307ee3f38e048914fdfd76bBrian Paul struct { 1776b35c2b110be0d9ae6a292250fdcbab11a9190a5Roland Scheidegger struct sp_tgsi_sampler *sampler[PIPE_SHADER_TYPES]; 178eb9ad9faa3975fc4f044b81d3b4b793866ef5563Dave Airlie struct sp_tgsi_image *image[PIPE_SHADER_TYPES]; 179afa8707ba93a7d226a76319acda2a8dd89524db7Dave Airlie struct sp_tgsi_buffer *buffer[PIPE_SHADER_TYPES]; 180b9604fe7699355584307ee3f38e048914fdfd76bBrian Paul } tgsi; 181b9604fe7699355584307ee3f38e048914fdfd76bBrian Paul 1821fce9d58cc70deaff284e1d9d0ffcb15b61e7595Brian Paul struct tgsi_exec_machine *fs_machine; 183493eab76792307d066489bc1d88798f14a5df31dDave Airlie /** whether early depth testing is enabled */ 184493eab76792307d066489bc1d88798f14a5df31dDave Airlie bool early_depth; 1851fce9d58cc70deaff284e1d9d0ffcb15b61e7595Brian Paul 186e7a208514812506eeb9862b91258392da646b618Brian Paul /** The primitive drawing context */ 1878e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell struct draw_context *draw; 1884fe0fc3eba1f79beda890a5016359d549bab6ad4Keith Whitwell 1894fe0fc3eba1f79beda890a5016359d549bab6ad4Keith Whitwell /** Draw module backend */ 1904fe0fc3eba1f79beda890a5016359d549bab6ad4Keith Whitwell struct vbuf_render *vbuf_backend; 191a37e0daeb97bb36ba10038b12a909e22e08b52c4Keith Whitwell struct draw_stage *vbuf; 192a48d767cf2ec82d0c0f893a22d22e8593901b206Brian Paul 1933d9d4b1ce6e700d85920eca84ae58a4dcf7288c2Marek Olšák struct blitter_context *blitter; 1943d9d4b1ce6e700d85920eca84ae58a4dcf7288c2Marek Olšák 1955d0cf9ebb41c05b0c6fa6914ccbb1e1871e27099José Fonseca boolean dirty_render_cache; 1960fb71be2179ebf140b086682f050399809ef57b8Brian Paul 1977e8396399824108d62dc3e02b2af0422e98aab8eBrian Paul struct softpipe_tile_cache *cbuf_cache[PIPE_MAX_COLOR_BUFS]; 1988de2331e432e2ea6f978acb6c80666da99c6c4a1Brian Paul struct softpipe_tile_cache *zsbuf_cache; 1990fb71be2179ebf140b086682f050399809ef57b8Brian Paul 200b5d583efeff5f195bff48c95125a225c273189e2Keith Whitwell unsigned tex_timestamp; 2010a14e9f09fc1cf9d5c277bb239f349203d3bed79Brian Paul 2020a14e9f09fc1cf9d5c277bb239f349203d3bed79Brian Paul /* 2030a14e9f09fc1cf9d5c277bb239f349203d3bed79Brian Paul * Texture caches for vertex, fragment, geometry stages. 2040a14e9f09fc1cf9d5c277bb239f349203d3bed79Brian Paul * Don't use PIPE_SHADER_TYPES here to avoid allocating unused memory 2050a14e9f09fc1cf9d5c277bb239f349203d3bed79Brian Paul * for compute shaders. 206ef17cc9cb697a7146cf2a3dba2eb0f6a968918ccRoland Scheidegger * XXX wouldn't it make more sense for the tile cache to just be part 207ef17cc9cb697a7146cf2a3dba2eb0f6a968918ccRoland Scheidegger * of sp_sampler_view? 2080a14e9f09fc1cf9d5c277bb239f349203d3bed79Brian Paul */ 209e749c30cebe071da450e28cb47b1b7deb8284a39Dave Airlie struct softpipe_tex_tile_cache *tex_cache[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS]; 21070eb7996f265f3634dabda078f13d1be3533cc65Brian Paul 2110aaa3ef2faf5c71c53abd5314ed7d55dcb929e21Brian Paul unsigned dump_fs : 1; 212ac96ee1c16419583aa43c9f4100aaca774b9439aZack Rusin unsigned dump_gs : 1; 213e749c30cebe071da450e28cb47b1b7deb8284a39Dave Airlie unsigned dump_cs : 1; 2140aaa3ef2faf5c71c53abd5314ed7d55dcb929e21Brian Paul unsigned no_rast : 1; 2158e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell}; 2168e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 2178e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 218a2a1a5805fd617e7f3cc8be44dd79b50da07ebb9Ilia Mirkinstatic inline struct softpipe_context * 2196393cda6766b707ef01e925d378239a66d143ae0Keith Whitwellsoftpipe_context( struct pipe_context *pipe ) 2208e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell{ 2216393cda6766b707ef01e925d378239a66d143ae0Keith Whitwell return (struct softpipe_context *)pipe; 2228e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell} 2238e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell 2244fc7d0345a18042a79686940fb7cc4e698cc9192Keith Whitwell 2257f41f5447c8f9113c8956901e1c5fff6081ecd94Keith Whitwellstruct pipe_context * 2260fc21ecfc0891d239f20bf7724e51bc75503570cMarek Olšáksoftpipe_create_context(struct pipe_screen *, void *priv, unsigned flags); 2277f41f5447c8f9113c8956901e1c5fff6081ecd94Keith Whitwell 2280b7d48cbad86eaac21fce3793da41b46db8be3b4Marek Olšákstruct pipe_resource * 2290b7d48cbad86eaac21fce3793da41b46db8be3b4Marek Olšáksoftpipe_user_buffer_create(struct pipe_screen *screen, 2300b7d48cbad86eaac21fce3793da41b46db8be3b4Marek Olšák void *ptr, 2310b7d48cbad86eaac21fce3793da41b46db8be3b4Marek Olšák unsigned bytes, 2320b7d48cbad86eaac21fce3793da41b46db8be3b4Marek Olšák unsigned bind_flags); 2334fc7d0345a18042a79686940fb7cc4e698cc9192Keith Whitwell 23425485f4b69447514ab8b595aced90c75606a99bdMarek Olšák#define SP_UNREFERENCED 0 23525485f4b69447514ab8b595aced90c75606a99bdMarek Olšák#define SP_REFERENCED_FOR_READ (1 << 0) 23625485f4b69447514ab8b595aced90c75606a99bdMarek Olšák#define SP_REFERENCED_FOR_WRITE (1 << 1) 23725485f4b69447514ab8b595aced90c75606a99bdMarek Olšák 23825485f4b69447514ab8b595aced90c75606a99bdMarek Olšákunsigned int 23925485f4b69447514ab8b595aced90c75606a99bdMarek Olšáksoftpipe_is_resource_referenced( struct pipe_context *pipe, 24025485f4b69447514ab8b595aced90c75606a99bdMarek Olšák struct pipe_resource *texture, 24125485f4b69447514ab8b595aced90c75606a99bdMarek Olšák unsigned level, int layer); 24225485f4b69447514ab8b595aced90c75606a99bdMarek Olšák 24316fdae16b6c34dd93867e98320152fbaac71139eBrian Paul#endif /* SP_CONTEXT_H */ 244