summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_surface.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2013-06-18 00:42:31 +0200
committerRoland Scheidegger <sroland@vmware.com>2013-06-18 18:01:24 +0200
commit8975dc798d6b7790de7a788c8263b636cfd02184 (patch)
tree5dd6993f4d00ac6d6d7fb846e31bd317ca3e390c /src/gallium/drivers/llvmpipe/lp_surface.c
parent793e8e3d7ed816cc9a066245dde798afdcf8b581 (diff)
llvmpipe: fixes for conditional rendering
honor render_condition for clear_render_target and clear_depth_stencil. Also add minimal support for occlusion predicate, though it can't be active at the same time as an occlusion query yet. While here also switchify some large if-else (actually just mutually exclusive if-if-if...) constructs. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_surface.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_surface.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_surface.c b/src/gallium/drivers/llvmpipe/lp_surface.c
index 7b1f9391b7e..c1eeaf566dd 100644
--- a/src/gallium/drivers/llvmpipe/lp_surface.c
+++ b/src/gallium/drivers/llvmpipe/lp_surface.c
@@ -32,6 +32,7 @@
#include "lp_limits.h"
#include "lp_surface.h"
#include "lp_texture.h"
+#include "lp_query.h"
/**
@@ -286,11 +287,48 @@ llvmpipe_surface_destroy(struct pipe_context *pipe,
}
+static void
+llvmpipe_clear_render_target(struct pipe_context *pipe,
+ struct pipe_surface *dst,
+ const union pipe_color_union *color,
+ unsigned dstx, unsigned dsty,
+ unsigned width, unsigned height)
+{
+ struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+
+ if (!llvmpipe_check_render_cond(llvmpipe))
+ return;
+
+ util_clear_render_target(pipe, dst, color,
+ dstx, dsty, width, height);
+}
+
+
+static void
+llvmpipe_clear_depth_stencil(struct pipe_context *pipe,
+ struct pipe_surface *dst,
+ unsigned clear_flags,
+ double depth,
+ unsigned stencil,
+ unsigned dstx, unsigned dsty,
+ unsigned width, unsigned height)
+{
+ struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+
+ if (!llvmpipe_check_render_cond(llvmpipe))
+ return;
+
+ util_clear_depth_stencil(pipe, dst, clear_flags,
+ depth, stencil,
+ dstx, dsty, width, height);
+}
+
+
void
llvmpipe_init_surface_functions(struct llvmpipe_context *lp)
{
- lp->pipe.clear_render_target = util_clear_render_target;
- lp->pipe.clear_depth_stencil = util_clear_depth_stencil;
+ lp->pipe.clear_render_target = llvmpipe_clear_render_target;
+ lp->pipe.clear_depth_stencil = llvmpipe_clear_depth_stencil;
lp->pipe.create_surface = llvmpipe_create_surface;
lp->pipe.surface_destroy = llvmpipe_surface_destroy;
/* These two are not actually functions dealing with surfaces */