1bf215546Sopenharmony_ci/************************************************************************** 2bf215546Sopenharmony_ci * 3bf215546Sopenharmony_ci * Copyright 2007 VMware, Inc. 4bf215546Sopenharmony_ci * All Rights Reserved. 5bf215546Sopenharmony_ci * Copyright 2008 VMware, Inc. All rights reserved. 6bf215546Sopenharmony_ci * 7bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 8bf215546Sopenharmony_ci * copy of this software and associated documentation files (the 9bf215546Sopenharmony_ci * "Software"), to deal in the Software without restriction, including 10bf215546Sopenharmony_ci * without limitation the rights to use, copy, modify, merge, publish, 11bf215546Sopenharmony_ci * distribute, sub license, and/or sell copies of the Software, and to 12bf215546Sopenharmony_ci * permit persons to whom the Software is furnished to do so, subject to 13bf215546Sopenharmony_ci * the following conditions: 14bf215546Sopenharmony_ci * 15bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the 16bf215546Sopenharmony_ci * next paragraph) shall be included in all copies or substantial portions 17bf215546Sopenharmony_ci * of the Software. 18bf215546Sopenharmony_ci * 19bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21bf215546Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 22bf215546Sopenharmony_ci * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 23bf215546Sopenharmony_ci * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24bf215546Sopenharmony_ci * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25bf215546Sopenharmony_ci * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26bf215546Sopenharmony_ci * 27bf215546Sopenharmony_ci **************************************************************************/ 28bf215546Sopenharmony_ci 29bf215546Sopenharmony_ci/* Author: 30bf215546Sopenharmony_ci * Keith Whitwell <keithw@vmware.com> 31bf215546Sopenharmony_ci */ 32bf215546Sopenharmony_ci 33bf215546Sopenharmony_ci#include "draw/draw_context.h" 34bf215546Sopenharmony_ci#include "draw/draw_vbuf.h" 35bf215546Sopenharmony_ci#include "pipe/p_defines.h" 36bf215546Sopenharmony_ci#include "util/u_math.h" 37bf215546Sopenharmony_ci#include "util/u_memory.h" 38bf215546Sopenharmony_ci#include "util/u_inlines.h" 39bf215546Sopenharmony_ci#include "util/u_upload_mgr.h" 40bf215546Sopenharmony_ci#include "tgsi/tgsi_exec.h" 41bf215546Sopenharmony_ci#include "sp_buffer.h" 42bf215546Sopenharmony_ci#include "sp_clear.h" 43bf215546Sopenharmony_ci#include "sp_context.h" 44bf215546Sopenharmony_ci#include "sp_flush.h" 45bf215546Sopenharmony_ci#include "sp_prim_vbuf.h" 46bf215546Sopenharmony_ci#include "sp_state.h" 47bf215546Sopenharmony_ci#include "sp_surface.h" 48bf215546Sopenharmony_ci#include "sp_tile_cache.h" 49bf215546Sopenharmony_ci#include "sp_tex_tile_cache.h" 50bf215546Sopenharmony_ci#include "sp_texture.h" 51bf215546Sopenharmony_ci#include "sp_query.h" 52bf215546Sopenharmony_ci#include "sp_screen.h" 53bf215546Sopenharmony_ci#include "sp_tex_sample.h" 54bf215546Sopenharmony_ci#include "sp_image.h" 55bf215546Sopenharmony_ci 56bf215546Sopenharmony_cistatic void 57bf215546Sopenharmony_cisoftpipe_destroy( struct pipe_context *pipe ) 58bf215546Sopenharmony_ci{ 59bf215546Sopenharmony_ci struct softpipe_context *softpipe = softpipe_context( pipe ); 60bf215546Sopenharmony_ci uint i, sh; 61bf215546Sopenharmony_ci 62bf215546Sopenharmony_ci if (softpipe->blitter) { 63bf215546Sopenharmony_ci util_blitter_destroy(softpipe->blitter); 64bf215546Sopenharmony_ci } 65bf215546Sopenharmony_ci 66bf215546Sopenharmony_ci if (softpipe->draw) 67bf215546Sopenharmony_ci draw_destroy( softpipe->draw ); 68bf215546Sopenharmony_ci 69bf215546Sopenharmony_ci if (softpipe->quad.shade) 70bf215546Sopenharmony_ci softpipe->quad.shade->destroy( softpipe->quad.shade ); 71bf215546Sopenharmony_ci 72bf215546Sopenharmony_ci if (softpipe->quad.depth_test) 73bf215546Sopenharmony_ci softpipe->quad.depth_test->destroy( softpipe->quad.depth_test ); 74bf215546Sopenharmony_ci 75bf215546Sopenharmony_ci if (softpipe->quad.blend) 76bf215546Sopenharmony_ci softpipe->quad.blend->destroy( softpipe->quad.blend ); 77bf215546Sopenharmony_ci 78bf215546Sopenharmony_ci if (softpipe->pipe.stream_uploader) 79bf215546Sopenharmony_ci u_upload_destroy(softpipe->pipe.stream_uploader); 80bf215546Sopenharmony_ci 81bf215546Sopenharmony_ci for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { 82bf215546Sopenharmony_ci sp_destroy_tile_cache(softpipe->cbuf_cache[i]); 83bf215546Sopenharmony_ci pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL); 84bf215546Sopenharmony_ci } 85bf215546Sopenharmony_ci 86bf215546Sopenharmony_ci sp_destroy_tile_cache(softpipe->zsbuf_cache); 87bf215546Sopenharmony_ci pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL); 88bf215546Sopenharmony_ci 89bf215546Sopenharmony_ci for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) { 90bf215546Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) { 91bf215546Sopenharmony_ci sp_destroy_tex_tile_cache(softpipe->tex_cache[sh][i]); 92bf215546Sopenharmony_ci pipe_sampler_view_reference(&softpipe->sampler_views[sh][i], NULL); 93bf215546Sopenharmony_ci } 94bf215546Sopenharmony_ci } 95bf215546Sopenharmony_ci 96bf215546Sopenharmony_ci for (sh = 0; sh < ARRAY_SIZE(softpipe->constants); sh++) { 97bf215546Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(softpipe->constants[0]); i++) { 98bf215546Sopenharmony_ci if (softpipe->constants[sh][i]) { 99bf215546Sopenharmony_ci pipe_resource_reference(&softpipe->constants[sh][i], NULL); 100bf215546Sopenharmony_ci } 101bf215546Sopenharmony_ci } 102bf215546Sopenharmony_ci } 103bf215546Sopenharmony_ci 104bf215546Sopenharmony_ci for (i = 0; i < softpipe->num_vertex_buffers; i++) { 105bf215546Sopenharmony_ci pipe_vertex_buffer_unreference(&softpipe->vertex_buffer[i]); 106bf215546Sopenharmony_ci } 107bf215546Sopenharmony_ci 108bf215546Sopenharmony_ci tgsi_exec_machine_destroy(softpipe->fs_machine); 109bf215546Sopenharmony_ci 110bf215546Sopenharmony_ci for (i = 0; i < PIPE_SHADER_TYPES; i++) { 111bf215546Sopenharmony_ci FREE(softpipe->tgsi.sampler[i]); 112bf215546Sopenharmony_ci FREE(softpipe->tgsi.image[i]); 113bf215546Sopenharmony_ci FREE(softpipe->tgsi.buffer[i]); 114bf215546Sopenharmony_ci } 115bf215546Sopenharmony_ci 116bf215546Sopenharmony_ci FREE( softpipe ); 117bf215546Sopenharmony_ci} 118bf215546Sopenharmony_ci 119bf215546Sopenharmony_ci 120bf215546Sopenharmony_ci/** 121bf215546Sopenharmony_ci * if (the texture is being used as a framebuffer surface) 122bf215546Sopenharmony_ci * return SP_REFERENCED_FOR_WRITE 123bf215546Sopenharmony_ci * else if (the texture is a bound texture source) 124bf215546Sopenharmony_ci * return SP_REFERENCED_FOR_READ 125bf215546Sopenharmony_ci * else 126bf215546Sopenharmony_ci * return SP_UNREFERENCED 127bf215546Sopenharmony_ci */ 128bf215546Sopenharmony_ciunsigned int 129bf215546Sopenharmony_cisoftpipe_is_resource_referenced( struct pipe_context *pipe, 130bf215546Sopenharmony_ci struct pipe_resource *texture, 131bf215546Sopenharmony_ci unsigned level, int layer) 132bf215546Sopenharmony_ci{ 133bf215546Sopenharmony_ci struct softpipe_context *softpipe = softpipe_context( pipe ); 134bf215546Sopenharmony_ci unsigned i, sh; 135bf215546Sopenharmony_ci 136bf215546Sopenharmony_ci if (texture->target == PIPE_BUFFER) 137bf215546Sopenharmony_ci return SP_UNREFERENCED; 138bf215546Sopenharmony_ci 139bf215546Sopenharmony_ci /* check if any of the bound drawing surfaces are this texture */ 140bf215546Sopenharmony_ci if (softpipe->dirty_render_cache) { 141bf215546Sopenharmony_ci for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) { 142bf215546Sopenharmony_ci if (softpipe->framebuffer.cbufs[i] && 143bf215546Sopenharmony_ci softpipe->framebuffer.cbufs[i]->texture == texture) { 144bf215546Sopenharmony_ci return SP_REFERENCED_FOR_WRITE; 145bf215546Sopenharmony_ci } 146bf215546Sopenharmony_ci } 147bf215546Sopenharmony_ci if (softpipe->framebuffer.zsbuf && 148bf215546Sopenharmony_ci softpipe->framebuffer.zsbuf->texture == texture) { 149bf215546Sopenharmony_ci return SP_REFERENCED_FOR_WRITE; 150bf215546Sopenharmony_ci } 151bf215546Sopenharmony_ci } 152bf215546Sopenharmony_ci 153bf215546Sopenharmony_ci /* check if any of the tex_cache textures are this texture */ 154bf215546Sopenharmony_ci for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) { 155bf215546Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) { 156bf215546Sopenharmony_ci if (softpipe->tex_cache[sh][i] && 157bf215546Sopenharmony_ci softpipe->tex_cache[sh][i]->texture == texture) 158bf215546Sopenharmony_ci return SP_REFERENCED_FOR_READ; 159bf215546Sopenharmony_ci } 160bf215546Sopenharmony_ci } 161bf215546Sopenharmony_ci 162bf215546Sopenharmony_ci return SP_UNREFERENCED; 163bf215546Sopenharmony_ci} 164bf215546Sopenharmony_ci 165bf215546Sopenharmony_ci 166bf215546Sopenharmony_ci 167bf215546Sopenharmony_ci 168bf215546Sopenharmony_cistatic void 169bf215546Sopenharmony_cisoftpipe_render_condition(struct pipe_context *pipe, 170bf215546Sopenharmony_ci struct pipe_query *query, 171bf215546Sopenharmony_ci bool condition, 172bf215546Sopenharmony_ci enum pipe_render_cond_flag mode) 173bf215546Sopenharmony_ci{ 174bf215546Sopenharmony_ci struct softpipe_context *softpipe = softpipe_context( pipe ); 175bf215546Sopenharmony_ci 176bf215546Sopenharmony_ci softpipe->render_cond_query = query; 177bf215546Sopenharmony_ci softpipe->render_cond_mode = mode; 178bf215546Sopenharmony_ci softpipe->render_cond_cond = condition; 179bf215546Sopenharmony_ci} 180bf215546Sopenharmony_ci 181bf215546Sopenharmony_ci 182bf215546Sopenharmony_cistatic void 183bf215546Sopenharmony_cisoftpipe_set_debug_callback(struct pipe_context *pipe, 184bf215546Sopenharmony_ci const struct util_debug_callback *cb) 185bf215546Sopenharmony_ci{ 186bf215546Sopenharmony_ci struct softpipe_context *softpipe = softpipe_context(pipe); 187bf215546Sopenharmony_ci 188bf215546Sopenharmony_ci if (cb) 189bf215546Sopenharmony_ci softpipe->debug = *cb; 190bf215546Sopenharmony_ci else 191bf215546Sopenharmony_ci memset(&softpipe->debug, 0, sizeof(softpipe->debug)); 192bf215546Sopenharmony_ci} 193bf215546Sopenharmony_ci 194bf215546Sopenharmony_ci 195bf215546Sopenharmony_cistruct pipe_context * 196bf215546Sopenharmony_cisoftpipe_create_context(struct pipe_screen *screen, 197bf215546Sopenharmony_ci void *priv, unsigned flags) 198bf215546Sopenharmony_ci{ 199bf215546Sopenharmony_ci struct softpipe_screen *sp_screen = softpipe_screen(screen); 200bf215546Sopenharmony_ci struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context); 201bf215546Sopenharmony_ci uint i, sh; 202bf215546Sopenharmony_ci 203bf215546Sopenharmony_ci util_init_math(); 204bf215546Sopenharmony_ci 205bf215546Sopenharmony_ci for (i = 0; i < PIPE_SHADER_TYPES; i++) { 206bf215546Sopenharmony_ci softpipe->tgsi.sampler[i] = sp_create_tgsi_sampler(); 207bf215546Sopenharmony_ci } 208bf215546Sopenharmony_ci 209bf215546Sopenharmony_ci for (i = 0; i < PIPE_SHADER_TYPES; i++) { 210bf215546Sopenharmony_ci softpipe->tgsi.image[i] = sp_create_tgsi_image(); 211bf215546Sopenharmony_ci } 212bf215546Sopenharmony_ci 213bf215546Sopenharmony_ci for (i = 0; i < PIPE_SHADER_TYPES; i++) { 214bf215546Sopenharmony_ci softpipe->tgsi.buffer[i] = sp_create_tgsi_buffer(); 215bf215546Sopenharmony_ci } 216bf215546Sopenharmony_ci 217bf215546Sopenharmony_ci softpipe->pipe.screen = screen; 218bf215546Sopenharmony_ci softpipe->pipe.destroy = softpipe_destroy; 219bf215546Sopenharmony_ci softpipe->pipe.priv = priv; 220bf215546Sopenharmony_ci 221bf215546Sopenharmony_ci /* state setters */ 222bf215546Sopenharmony_ci softpipe_init_blend_funcs(&softpipe->pipe); 223bf215546Sopenharmony_ci softpipe_init_clip_funcs(&softpipe->pipe); 224bf215546Sopenharmony_ci softpipe_init_query_funcs( softpipe ); 225bf215546Sopenharmony_ci softpipe_init_rasterizer_funcs(&softpipe->pipe); 226bf215546Sopenharmony_ci softpipe_init_sampler_funcs(&softpipe->pipe); 227bf215546Sopenharmony_ci softpipe_init_shader_funcs(&softpipe->pipe); 228bf215546Sopenharmony_ci softpipe_init_streamout_funcs(&softpipe->pipe); 229bf215546Sopenharmony_ci softpipe_init_texture_funcs( &softpipe->pipe ); 230bf215546Sopenharmony_ci softpipe_init_vertex_funcs(&softpipe->pipe); 231bf215546Sopenharmony_ci softpipe_init_image_funcs(&softpipe->pipe); 232bf215546Sopenharmony_ci 233bf215546Sopenharmony_ci softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state; 234bf215546Sopenharmony_ci softpipe->pipe.set_debug_callback = softpipe_set_debug_callback; 235bf215546Sopenharmony_ci 236bf215546Sopenharmony_ci softpipe->pipe.draw_vbo = softpipe_draw_vbo; 237bf215546Sopenharmony_ci 238bf215546Sopenharmony_ci softpipe->pipe.launch_grid = softpipe_launch_grid; 239bf215546Sopenharmony_ci 240bf215546Sopenharmony_ci softpipe->pipe.clear = softpipe_clear; 241bf215546Sopenharmony_ci softpipe->pipe.flush = softpipe_flush_wrapped; 242bf215546Sopenharmony_ci softpipe->pipe.texture_barrier = softpipe_texture_barrier; 243bf215546Sopenharmony_ci softpipe->pipe.memory_barrier = softpipe_memory_barrier; 244bf215546Sopenharmony_ci softpipe->pipe.render_condition = softpipe_render_condition; 245bf215546Sopenharmony_ci 246bf215546Sopenharmony_ci /* 247bf215546Sopenharmony_ci * Alloc caches for accessing drawing surfaces and textures. 248bf215546Sopenharmony_ci * Must be before quad stage setup! 249bf215546Sopenharmony_ci */ 250bf215546Sopenharmony_ci for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) 251bf215546Sopenharmony_ci softpipe->cbuf_cache[i] = sp_create_tile_cache( &softpipe->pipe ); 252bf215546Sopenharmony_ci softpipe->zsbuf_cache = sp_create_tile_cache( &softpipe->pipe ); 253bf215546Sopenharmony_ci 254bf215546Sopenharmony_ci /* Allocate texture caches */ 255bf215546Sopenharmony_ci for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) { 256bf215546Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) { 257bf215546Sopenharmony_ci softpipe->tex_cache[sh][i] = sp_create_tex_tile_cache(&softpipe->pipe); 258bf215546Sopenharmony_ci if (!softpipe->tex_cache[sh][i]) 259bf215546Sopenharmony_ci goto fail; 260bf215546Sopenharmony_ci } 261bf215546Sopenharmony_ci } 262bf215546Sopenharmony_ci 263bf215546Sopenharmony_ci softpipe->fs_machine = tgsi_exec_machine_create(PIPE_SHADER_FRAGMENT); 264bf215546Sopenharmony_ci 265bf215546Sopenharmony_ci /* setup quad rendering stages */ 266bf215546Sopenharmony_ci softpipe->quad.shade = sp_quad_shade_stage(softpipe); 267bf215546Sopenharmony_ci softpipe->quad.depth_test = sp_quad_depth_test_stage(softpipe); 268bf215546Sopenharmony_ci softpipe->quad.blend = sp_quad_blend_stage(softpipe); 269bf215546Sopenharmony_ci 270bf215546Sopenharmony_ci softpipe->pipe.stream_uploader = u_upload_create_default(&softpipe->pipe); 271bf215546Sopenharmony_ci if (!softpipe->pipe.stream_uploader) 272bf215546Sopenharmony_ci goto fail; 273bf215546Sopenharmony_ci softpipe->pipe.const_uploader = softpipe->pipe.stream_uploader; 274bf215546Sopenharmony_ci 275bf215546Sopenharmony_ci /* 276bf215546Sopenharmony_ci * Create drawing context and plug our rendering stage into it. 277bf215546Sopenharmony_ci */ 278bf215546Sopenharmony_ci if (sp_screen->use_llvm) 279bf215546Sopenharmony_ci softpipe->draw = draw_create(&softpipe->pipe); 280bf215546Sopenharmony_ci else 281bf215546Sopenharmony_ci softpipe->draw = draw_create_no_llvm(&softpipe->pipe); 282bf215546Sopenharmony_ci if (!softpipe->draw) 283bf215546Sopenharmony_ci goto fail; 284bf215546Sopenharmony_ci 285bf215546Sopenharmony_ci draw_texture_sampler(softpipe->draw, 286bf215546Sopenharmony_ci PIPE_SHADER_VERTEX, 287bf215546Sopenharmony_ci (struct tgsi_sampler *) 288bf215546Sopenharmony_ci softpipe->tgsi.sampler[PIPE_SHADER_VERTEX]); 289bf215546Sopenharmony_ci 290bf215546Sopenharmony_ci draw_texture_sampler(softpipe->draw, 291bf215546Sopenharmony_ci PIPE_SHADER_GEOMETRY, 292bf215546Sopenharmony_ci (struct tgsi_sampler *) 293bf215546Sopenharmony_ci softpipe->tgsi.sampler[PIPE_SHADER_GEOMETRY]); 294bf215546Sopenharmony_ci 295bf215546Sopenharmony_ci draw_image(softpipe->draw, 296bf215546Sopenharmony_ci PIPE_SHADER_VERTEX, 297bf215546Sopenharmony_ci (struct tgsi_image *) 298bf215546Sopenharmony_ci softpipe->tgsi.image[PIPE_SHADER_VERTEX]); 299bf215546Sopenharmony_ci 300bf215546Sopenharmony_ci draw_image(softpipe->draw, 301bf215546Sopenharmony_ci PIPE_SHADER_GEOMETRY, 302bf215546Sopenharmony_ci (struct tgsi_image *) 303bf215546Sopenharmony_ci softpipe->tgsi.image[PIPE_SHADER_GEOMETRY]); 304bf215546Sopenharmony_ci 305bf215546Sopenharmony_ci draw_buffer(softpipe->draw, 306bf215546Sopenharmony_ci PIPE_SHADER_VERTEX, 307bf215546Sopenharmony_ci (struct tgsi_buffer *) 308bf215546Sopenharmony_ci softpipe->tgsi.buffer[PIPE_SHADER_VERTEX]); 309bf215546Sopenharmony_ci 310bf215546Sopenharmony_ci draw_buffer(softpipe->draw, 311bf215546Sopenharmony_ci PIPE_SHADER_GEOMETRY, 312bf215546Sopenharmony_ci (struct tgsi_buffer *) 313bf215546Sopenharmony_ci softpipe->tgsi.buffer[PIPE_SHADER_GEOMETRY]); 314bf215546Sopenharmony_ci 315bf215546Sopenharmony_ci softpipe->vbuf_backend = sp_create_vbuf_backend(softpipe); 316bf215546Sopenharmony_ci if (!softpipe->vbuf_backend) 317bf215546Sopenharmony_ci goto fail; 318bf215546Sopenharmony_ci 319bf215546Sopenharmony_ci softpipe->vbuf = draw_vbuf_stage(softpipe->draw, softpipe->vbuf_backend); 320bf215546Sopenharmony_ci if (!softpipe->vbuf) 321bf215546Sopenharmony_ci goto fail; 322bf215546Sopenharmony_ci 323bf215546Sopenharmony_ci draw_set_rasterize_stage(softpipe->draw, softpipe->vbuf); 324bf215546Sopenharmony_ci draw_set_render(softpipe->draw, softpipe->vbuf_backend); 325bf215546Sopenharmony_ci 326bf215546Sopenharmony_ci softpipe->blitter = util_blitter_create(&softpipe->pipe); 327bf215546Sopenharmony_ci if (!softpipe->blitter) { 328bf215546Sopenharmony_ci goto fail; 329bf215546Sopenharmony_ci } 330bf215546Sopenharmony_ci 331bf215546Sopenharmony_ci /* must be done before installing Draw stages */ 332bf215546Sopenharmony_ci util_blitter_cache_all_shaders(softpipe->blitter); 333bf215546Sopenharmony_ci 334bf215546Sopenharmony_ci /* plug in AA line/point stages */ 335bf215546Sopenharmony_ci draw_install_aaline_stage(softpipe->draw, &softpipe->pipe); 336bf215546Sopenharmony_ci draw_install_aapoint_stage(softpipe->draw, &softpipe->pipe); 337bf215546Sopenharmony_ci 338bf215546Sopenharmony_ci /* Do polygon stipple w/ texture map + frag prog. */ 339bf215546Sopenharmony_ci draw_install_pstipple_stage(softpipe->draw, &softpipe->pipe); 340bf215546Sopenharmony_ci 341bf215546Sopenharmony_ci draw_wide_point_sprites(softpipe->draw, TRUE); 342bf215546Sopenharmony_ci 343bf215546Sopenharmony_ci sp_init_surface_functions(softpipe); 344bf215546Sopenharmony_ci 345bf215546Sopenharmony_ci return &softpipe->pipe; 346bf215546Sopenharmony_ci 347bf215546Sopenharmony_ci fail: 348bf215546Sopenharmony_ci softpipe_destroy(&softpipe->pipe); 349bf215546Sopenharmony_ci return NULL; 350bf215546Sopenharmony_ci} 351