Mesa (gallium-0.2): softpipe: plug in softpipe' s texture samplers into draw module.
Brian Paul
brianp at kemper.freedesktop.org
Thu Dec 4 17:00:15 UTC 2008
Module: Mesa
Branch: gallium-0.2
Commit: b9604fe7699355584307ee3f38e048914fdfd76b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b9604fe7699355584307ee3f38e048914fdfd76b
Author: Brian <brian.paul at tungstengraphics.com>
Date: Tue Dec 2 22:40:08 2008 -0700
softpipe: plug in softpipe's texture samplers into draw module.
---
src/gallium/drivers/softpipe/sp_context.c | 11 +++++++++++
src/gallium/drivers/softpipe/sp_context.h | 7 +++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index cd1e666..99b5274 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -221,6 +221,14 @@ softpipe_create( struct pipe_screen *screen,
softpipe->quad[i].output = sp_quad_output_stage(softpipe);
}
+ for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+ softpipe->tgsi.samplers[i].base.get_samples = sp_get_samples;
+ softpipe->tgsi.samplers[i].unit = i;
+ softpipe->tgsi.samplers[i].sp = softpipe;
+ softpipe->tgsi.samplers[i].cache = softpipe->tex_cache[i];
+ softpipe->tgsi.samplers_list[i] = &softpipe->tgsi.samplers[i];
+ }
+
/*
* Create drawing context and plug our rendering stage into it.
*/
@@ -228,6 +236,9 @@ softpipe_create( struct pipe_screen *screen,
if (!softpipe->draw)
goto fail;
+ draw_texture_samplers(softpipe->draw,
+ PIPE_MAX_SAMPLERS, softpipe->tgsi.samplers_list);
+
softpipe->setup = sp_draw_render_stage(softpipe);
if (!softpipe->setup)
goto fail;
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 2b9a2a8..790143a 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -37,6 +37,7 @@
#include "draw/draw_vertex.h"
#include "sp_quad.h"
+#include "sp_tex_sample.h"
/**
@@ -139,6 +140,12 @@ struct softpipe_context {
struct quad_stage *first; /**< points to one of the above stages */
} quad[SP_NUM_QUAD_THREADS];
+ /** TGSI exec things */
+ struct {
+ struct sp_shader_sampler samplers[PIPE_MAX_SAMPLERS];
+ struct sp_shader_sampler *samplers_list[PIPE_MAX_SAMPLERS];
+ } tgsi;
+
/** The primitive drawing context */
struct draw_context *draw;
struct draw_stage *setup;
More information about the mesa-commit
mailing list