Go to the source code of this file.
Data Structures | |
struct | softpipe_winsys |
Functions | |
struct pipe_context * | softpipe_create (struct pipe_screen *, struct pipe_winsys *, void *unused) |
struct pipe_screen * | softpipe_create_screen (struct pipe_winsys *) |
Create a new pipe_screen object Note: we're not presently subclassing pipe_screen (no softpipe_screen). |
struct pipe_context* softpipe_create | ( | struct pipe_screen * | , | |
struct pipe_winsys * | , | |||
void * | unused | |||
) | [read] |
Definition at line 127 of file sp_context.c.
References softpipe_context::alpha_test, pipe_context::bind_blend_state, pipe_context::bind_depth_stencil_alpha_state, pipe_context::bind_fs_state, pipe_context::bind_rasterizer_state, pipe_context::bind_sampler_states, pipe_context::bind_vs_state, softpipe_context::blend, CALLOC_STRUCT, softpipe_context::cbuf_cache, pipe_context::clear, softpipe_context::colormask, softpipe_context::coverage, pipe_context::create_blend_state, pipe_context::create_depth_stencil_alpha_state, pipe_context::create_fs_state, pipe_context::create_rasterizer_state, pipe_context::create_sampler_state, pipe_context::create_vs_state, debug_get_bool_option(), pipe_context::delete_blend_state, pipe_context::delete_depth_stencil_alpha_state, pipe_context::delete_fs_state, pipe_context::delete_rasterizer_state, pipe_context::delete_sampler_state, pipe_context::delete_vs_state, softpipe_context::depth_test, pipe_context::destroy, softpipe_context::draw, pipe_context::draw_arrays, draw_create(), pipe_context::draw_elements, draw_install_aaline_stage(), draw_install_aapoint_stage(), draw_install_pstipple_stage(), pipe_context::draw_range_elements, draw_set_rasterize_stage(), softpipe_context::dump_fs, softpipe_context::earlyz, FALSE, pipe_context::flush, softpipe_context::no_rast, softpipe_context::occlusion, softpipe_context::output, softpipe_context::pipe, PIPE_MAX_COLOR_BUFS, PIPE_MAX_SAMPLERS, softpipe_context::polygon_stipple, softpipe_context::quad, pipe_context::screen, pipe_context::set_blend_color, pipe_context::set_clip_state, pipe_context::set_constant_buffer, pipe_context::set_edgeflags, pipe_context::set_framebuffer_state, pipe_context::set_polygon_stipple, pipe_context::set_sampler_textures, pipe_context::set_scissor_state, pipe_context::set_vertex_buffers, pipe_context::set_vertex_elements, pipe_context::set_viewport_state, softpipe_context::setup, softpipe_context::shade, softpipe_bind_blend_state(), softpipe_bind_depth_stencil_state(), softpipe_bind_fs_state(), softpipe_bind_rasterizer_state(), softpipe_bind_sampler_states(), softpipe_bind_vs_state(), softpipe_clear(), softpipe_create_blend_state(), softpipe_create_depth_stencil_state(), softpipe_create_fs_state(), softpipe_create_rasterizer_state(), softpipe_create_sampler_state(), softpipe_create_vs_state(), softpipe_delete_blend_state(), softpipe_delete_depth_stencil_state(), softpipe_delete_fs_state(), softpipe_delete_rasterizer_state(), softpipe_delete_sampler_state(), softpipe_delete_vs_state(), softpipe_destroy(), softpipe_draw_arrays(), softpipe_draw_elements(), softpipe_draw_range_elements(), softpipe_flush(), softpipe_init_query_funcs(), softpipe_init_texture_funcs(), softpipe_set_blend_color(), softpipe_set_clip_state(), softpipe_set_constant_buffer(), softpipe_set_edgeflags(), softpipe_set_framebuffer_state(), softpipe_set_polygon_stipple(), softpipe_set_sampler_textures(), softpipe_set_scissor_state(), softpipe_set_vertex_buffers(), softpipe_set_vertex_elements(), softpipe_set_viewport_state(), sp_create_tile_cache(), sp_draw_render_stage(), sp_init_surface_functions(), sp_init_vbuf(), SP_NUM_QUAD_THREADS, sp_quad_alpha_test_stage(), sp_quad_blend_stage(), sp_quad_colormask_stage(), sp_quad_coverage_stage(), sp_quad_depth_test_stage(), sp_quad_earlyz_stage(), sp_quad_occlusion_stage(), sp_quad_output_stage(), sp_quad_polygon_stipple_stage(), sp_quad_shade_stage(), sp_quad_stencil_test_stage(), softpipe_context::stencil_test, softpipe_context::tex_cache, TRUE, softpipe_context::use_sse, util_init_math(), pipe_context::winsys, and softpipe_context::zsbuf_cache.
00130 { 00131 struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context); 00132 uint i; 00133 00134 util_init_math(); 00135 00136 #ifdef PIPE_ARCH_X86 00137 softpipe->use_sse = !debug_get_bool_option( "GALLIUM_NOSSE", FALSE ); 00138 #else 00139 softpipe->use_sse = FALSE; 00140 #endif 00141 00142 softpipe->dump_fs = debug_get_bool_option( "GALLIUM_DUMP_FS", FALSE ); 00143 00144 softpipe->pipe.winsys = pipe_winsys; 00145 softpipe->pipe.screen = screen; 00146 softpipe->pipe.destroy = softpipe_destroy; 00147 00148 /* state setters */ 00149 softpipe->pipe.create_blend_state = softpipe_create_blend_state; 00150 softpipe->pipe.bind_blend_state = softpipe_bind_blend_state; 00151 softpipe->pipe.delete_blend_state = softpipe_delete_blend_state; 00152 00153 softpipe->pipe.create_sampler_state = softpipe_create_sampler_state; 00154 softpipe->pipe.bind_sampler_states = softpipe_bind_sampler_states; 00155 softpipe->pipe.delete_sampler_state = softpipe_delete_sampler_state; 00156 00157 softpipe->pipe.create_depth_stencil_alpha_state = softpipe_create_depth_stencil_state; 00158 softpipe->pipe.bind_depth_stencil_alpha_state = softpipe_bind_depth_stencil_state; 00159 softpipe->pipe.delete_depth_stencil_alpha_state = softpipe_delete_depth_stencil_state; 00160 00161 softpipe->pipe.create_rasterizer_state = softpipe_create_rasterizer_state; 00162 softpipe->pipe.bind_rasterizer_state = softpipe_bind_rasterizer_state; 00163 softpipe->pipe.delete_rasterizer_state = softpipe_delete_rasterizer_state; 00164 00165 softpipe->pipe.create_fs_state = softpipe_create_fs_state; 00166 softpipe->pipe.bind_fs_state = softpipe_bind_fs_state; 00167 softpipe->pipe.delete_fs_state = softpipe_delete_fs_state; 00168 00169 softpipe->pipe.create_vs_state = softpipe_create_vs_state; 00170 softpipe->pipe.bind_vs_state = softpipe_bind_vs_state; 00171 softpipe->pipe.delete_vs_state = softpipe_delete_vs_state; 00172 00173 softpipe->pipe.set_blend_color = softpipe_set_blend_color; 00174 softpipe->pipe.set_clip_state = softpipe_set_clip_state; 00175 softpipe->pipe.set_constant_buffer = softpipe_set_constant_buffer; 00176 softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state; 00177 softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple; 00178 softpipe->pipe.set_scissor_state = softpipe_set_scissor_state; 00179 softpipe->pipe.set_sampler_textures = softpipe_set_sampler_textures; 00180 softpipe->pipe.set_viewport_state = softpipe_set_viewport_state; 00181 00182 softpipe->pipe.set_vertex_buffers = softpipe_set_vertex_buffers; 00183 softpipe->pipe.set_vertex_elements = softpipe_set_vertex_elements; 00184 00185 softpipe->pipe.draw_arrays = softpipe_draw_arrays; 00186 softpipe->pipe.draw_elements = softpipe_draw_elements; 00187 softpipe->pipe.draw_range_elements = softpipe_draw_range_elements; 00188 softpipe->pipe.set_edgeflags = softpipe_set_edgeflags; 00189 00190 00191 softpipe->pipe.clear = softpipe_clear; 00192 softpipe->pipe.flush = softpipe_flush; 00193 00194 softpipe_init_query_funcs( softpipe ); 00195 softpipe_init_texture_funcs( softpipe ); 00196 00197 /* 00198 * Alloc caches for accessing drawing surfaces and textures. 00199 * Must be before quad stage setup! 00200 */ 00201 for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) 00202 softpipe->cbuf_cache[i] = sp_create_tile_cache( screen ); 00203 softpipe->zsbuf_cache = sp_create_tile_cache( screen ); 00204 00205 for (i = 0; i < PIPE_MAX_SAMPLERS; i++) 00206 softpipe->tex_cache[i] = sp_create_tile_cache( screen ); 00207 00208 00209 /* setup quad rendering stages */ 00210 for (i = 0; i < SP_NUM_QUAD_THREADS; i++) { 00211 softpipe->quad[i].polygon_stipple = sp_quad_polygon_stipple_stage(softpipe); 00212 softpipe->quad[i].earlyz = sp_quad_earlyz_stage(softpipe); 00213 softpipe->quad[i].shade = sp_quad_shade_stage(softpipe); 00214 softpipe->quad[i].alpha_test = sp_quad_alpha_test_stage(softpipe); 00215 softpipe->quad[i].depth_test = sp_quad_depth_test_stage(softpipe); 00216 softpipe->quad[i].stencil_test = sp_quad_stencil_test_stage(softpipe); 00217 softpipe->quad[i].occlusion = sp_quad_occlusion_stage(softpipe); 00218 softpipe->quad[i].coverage = sp_quad_coverage_stage(softpipe); 00219 softpipe->quad[i].blend = sp_quad_blend_stage(softpipe); 00220 softpipe->quad[i].colormask = sp_quad_colormask_stage(softpipe); 00221 softpipe->quad[i].output = sp_quad_output_stage(softpipe); 00222 } 00223 00224 /* 00225 * Create drawing context and plug our rendering stage into it. 00226 */ 00227 softpipe->draw = draw_create(); 00228 if (!softpipe->draw) 00229 goto fail; 00230 00231 softpipe->setup = sp_draw_render_stage(softpipe); 00232 if (!softpipe->setup) 00233 goto fail; 00234 00235 if (debug_get_bool_option( "SP_NO_RAST", FALSE )) 00236 softpipe->no_rast = TRUE; 00237 00238 if (debug_get_bool_option( "SP_NO_VBUF", FALSE )) { 00239 /* Deprecated path -- vbuf is the intended interface to the draw module: 00240 */ 00241 draw_set_rasterize_stage(softpipe->draw, softpipe->setup); 00242 } 00243 else { 00244 sp_init_vbuf(softpipe); 00245 } 00246 00247 /* plug in AA line/point stages */ 00248 draw_install_aaline_stage(softpipe->draw, &softpipe->pipe); 00249 draw_install_aapoint_stage(softpipe->draw, &softpipe->pipe); 00250 00251 #if USE_DRAW_STAGE_PSTIPPLE 00252 /* Do polygon stipple w/ texture map + frag prog? */ 00253 draw_install_pstipple_stage(softpipe->draw, &softpipe->pipe); 00254 #endif 00255 00256 sp_init_surface_functions(softpipe); 00257 00258 return &softpipe->pipe; 00259 00260 fail: 00261 softpipe_destroy(&softpipe->pipe); 00262 return NULL; 00263 }
struct pipe_screen* softpipe_create_screen | ( | struct pipe_winsys * | ) | [read] |
Create a new pipe_screen object Note: we're not presently subclassing pipe_screen (no softpipe_screen).
Definition at line 158 of file sp_screen.c.
References softpipe_screen::base, CALLOC_STRUCT, pipe_screen::destroy, pipe_screen::get_name, pipe_screen::get_param, pipe_screen::get_paramf, pipe_screen::get_vendor, pipe_screen::is_format_supported, softpipe_destroy_screen(), softpipe_get_name(), softpipe_get_param(), softpipe_get_paramf(), softpipe_get_vendor(), softpipe_init_screen_texture_funcs(), softpipe_is_format_supported(), and pipe_screen::winsys.
00159 { 00160 struct softpipe_screen *screen = CALLOC_STRUCT(softpipe_screen); 00161 00162 if (!screen) 00163 return NULL; 00164 00165 screen->base.winsys = winsys; 00166 00167 screen->base.destroy = softpipe_destroy_screen; 00168 00169 screen->base.get_name = softpipe_get_name; 00170 screen->base.get_vendor = softpipe_get_vendor; 00171 screen->base.get_param = softpipe_get_param; 00172 screen->base.get_paramf = softpipe_get_paramf; 00173 screen->base.is_format_supported = softpipe_is_format_supported; 00174 00175 softpipe_init_screen_texture_funcs(&screen->base); 00176 00177 return &screen->base; 00178 }