summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2010-02-10 21:20:24 +0100
committerRoland Scheidegger <sroland@vmware.com>2010-02-10 21:20:24 +0100
commit6a509ec6dd16f93758a308a0f0eb1b032f099693 (patch)
tree88326364a2a25dbc6e9bc6115abb1bf275384d0d /src/gallium/drivers
parent4ea2f61e5ae556fa4141cd226ecbf1521e9f16ff (diff)
llvmpipe: adapt to stencil ref changes
since the driver doesn't actually handle stencil yet the code won't do much.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.c1
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.h1
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state.h7
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_blend.c21
4 files changed, 28 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 43d610631d..808f490361 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -148,6 +148,7 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
llvmpipe->pipe.delete_vs_state = llvmpipe_delete_vs_state;
llvmpipe->pipe.set_blend_color = llvmpipe_set_blend_color;
+ llvmpipe->pipe.set_stencil_ref = llvmpipe_set_stencil_ref;
llvmpipe->pipe.set_clip_state = llvmpipe_set_clip_state;
llvmpipe->pipe.set_constant_buffer = llvmpipe_set_constant_buffer;
llvmpipe->pipe.set_framebuffer_state = llvmpipe_set_framebuffer_state;
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
index 3bde485ac0..955c7eb8e0 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
@@ -61,6 +61,7 @@ struct llvmpipe_context {
/** Other rendering state */
struct pipe_blend_color blend_color;
+ struct pipe_stencil_ref stencil_ref;
struct pipe_clip_state clip;
struct pipe_buffer *constants[PIPE_SHADER_TYPES];
struct pipe_framebuffer_state framebuffer;
diff --git a/src/gallium/drivers/llvmpipe/lp_state.h b/src/gallium/drivers/llvmpipe/lp_state.h
index 8f68f12bed..9beba32271 100644
--- a/src/gallium/drivers/llvmpipe/lp_state.h
+++ b/src/gallium/drivers/llvmpipe/lp_state.h
@@ -152,13 +152,16 @@ void llvmpipe_bind_rasterizer_state(struct pipe_context *, void *);
void llvmpipe_delete_rasterizer_state(struct pipe_context *, void *);
void llvmpipe_set_framebuffer_state( struct pipe_context *,
- const struct pipe_framebuffer_state * );
+ const struct pipe_framebuffer_state * );
void llvmpipe_set_blend_color( struct pipe_context *pipe,
const struct pipe_blend_color *blend_color );
+void llvmpipe_set_stencil_ref( struct pipe_context *pipe,
+ const struct pipe_stencil_ref *stencil_ref );
+
void llvmpipe_set_clip_state( struct pipe_context *,
- const struct pipe_clip_state * );
+ const struct pipe_clip_state * );
void llvmpipe_set_constant_buffer(struct pipe_context *,
uint shader, uint index,
diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c
index 9b950e82d8..8bb89f96c2 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c
@@ -121,3 +121,24 @@ llvmpipe_delete_depth_stencil_state(struct pipe_context *pipe, void *depth)
{
FREE( depth );
}
+
+void llvmpipe_set_stencil_ref( struct pipe_context *pipe,
+ const struct pipe_stencil_ref *stencil_ref )
+{
+ struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+
+ if(!stencil_ref)
+ return;
+
+ if(memcmp(&llvmpipe->stencil_ref, stencil_ref, sizeof *stencil_ref) == 0)
+ return;
+
+ draw_flush(llvmpipe->draw);
+
+ memcpy(&llvmpipe->stencil_ref, stencil_ref, sizeof *stencil_ref);
+
+ /* not sure. want new flag? */
+ llvmpipe->dirty |= LP_NEW_DEPTH_STENCIL_ALPHA;
+}
+
+