#include "sp_texture.h"
#include "sp_query.h"
#include "sp_screen.h"
-
-
-/**
- * Map any drawing surfaces which aren't already mapped
- */
-void
-softpipe_map_transfers(struct softpipe_context *sp)
-{
- unsigned i;
-
- for (i = 0; i < sp->framebuffer.nr_cbufs; i++) {
- sp_tile_cache_map_transfers(sp->cbuf_cache[i]);
- }
-
- sp_tile_cache_map_transfers(sp->zsbuf_cache);
-}
-
-
-/**
- * Unmap any mapped drawing surfaces
- */
-void
-softpipe_unmap_transfers(struct softpipe_context *sp)
-{
- uint i;
-
- for (i = 0; i < sp->framebuffer.nr_cbufs; i++) {
- sp_tile_cache_unmap_transfers(sp->cbuf_cache[i]);
- }
-
- sp_tile_cache_unmap_transfers(sp->zsbuf_cache);
-}
+#include "sp_tex_sample.h"
static void
pipe_sampler_view_reference(&softpipe->pstipple.sampler_view, NULL);
#endif
+ if (softpipe->blitter) {
+ util_blitter_destroy(softpipe->blitter);
+ }
+
if (softpipe->draw)
draw_destroy( softpipe->draw );
sp_destroy_tile_cache(softpipe->zsbuf_cache);
pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL);
- for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
- sp_destroy_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_FRAGMENT][i]);
- pipe_sampler_view_reference(&softpipe->fragment_sampler_views[i], NULL);
- }
-
- for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
- sp_destroy_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_VERTEX][i]);
- pipe_sampler_view_reference(&softpipe->vertex_sampler_views[i], NULL);
- }
-
- for (i = 0; i < PIPE_MAX_GEOMETRY_SAMPLERS; i++) {
- sp_destroy_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_GEOMETRY][i]);
- pipe_sampler_view_reference(&softpipe->geometry_sampler_views[i], NULL);
- }
-
for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) {
sp_destroy_tex_tile_cache(softpipe->tex_cache[sh][i]);
tgsi_exec_machine_destroy(softpipe->fs_machine);
+ for (i = 0; i < PIPE_SHADER_TYPES; i++) {
+ FREE(softpipe->tgsi.sampler[i]);
+ }
+
FREE( softpipe );
}
static void
softpipe_render_condition( struct pipe_context *pipe,
struct pipe_query *query,
+ boolean condition,
uint mode )
{
struct softpipe_context *softpipe = softpipe_context( pipe );
softpipe->render_cond_query = query;
softpipe->render_cond_mode = mode;
+ softpipe->render_cond_cond = condition;
}
util_init_math();
+ for (i = 0; i < PIPE_SHADER_TYPES; i++) {
+ softpipe->tgsi.sampler[i] = sp_create_tgsi_sampler();
+ }
+
softpipe->dump_fs = debug_get_bool_option( "SOFTPIPE_DUMP_FS", FALSE );
softpipe->dump_gs = debug_get_bool_option( "SOFTPIPE_DUMP_GS", FALSE );
if (!softpipe->draw)
goto fail;
- draw_texture_samplers(softpipe->draw,
- PIPE_SHADER_VERTEX,
- PIPE_MAX_VERTEX_SAMPLERS,
- (struct tgsi_sampler **)
- softpipe->tgsi.vert_samplers_list);
+ draw_texture_sampler(softpipe->draw,
+ PIPE_SHADER_VERTEX,
+ (struct tgsi_sampler *)
+ softpipe->tgsi.sampler[PIPE_SHADER_VERTEX]);
- draw_texture_samplers(softpipe->draw,
- PIPE_SHADER_GEOMETRY,
- PIPE_MAX_GEOMETRY_SAMPLERS,
- (struct tgsi_sampler **)
- softpipe->tgsi.geom_samplers_list);
+ draw_texture_sampler(softpipe->draw,
+ PIPE_SHADER_GEOMETRY,
+ (struct tgsi_sampler *)
+ softpipe->tgsi.sampler[PIPE_SHADER_GEOMETRY]);
if (debug_get_bool_option( "SOFTPIPE_NO_RAST", FALSE ))
softpipe->no_rast = TRUE;
draw_set_rasterize_stage(softpipe->draw, softpipe->vbuf);
draw_set_render(softpipe->draw, softpipe->vbuf_backend);
+ softpipe->blitter = util_blitter_create(&softpipe->pipe);
+ if (!softpipe->blitter) {
+ goto fail;
+ }
+
+ /* must be done before installing Draw stages */
+ util_blitter_cache_all_shaders(softpipe->blitter);
/* plug in AA line/point stages */
draw_install_aaline_stage(softpipe->draw, &softpipe->pipe);