summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_surface.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_surface.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_surface.c b/src/gallium/drivers/llvmpipe/lp_surface.c
index 96f8ed82cd8..dd1c4465323 100644
--- a/src/gallium/drivers/llvmpipe/lp_surface.c
+++ b/src/gallium/drivers/llvmpipe/lp_surface.c
@@ -131,8 +131,15 @@ llvmpipe_create_surface(struct pipe_context *pipe,
{
struct pipe_surface *ps;
- if (!(pt->bind & (PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_RENDER_TARGET)))
+ if (!(pt->bind & (PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_RENDER_TARGET))) {
debug_printf("Illegal surface creation without bind flag\n");
+ if (util_format_is_depth_or_stencil(surf_tmpl->format)) {
+ pt->bind |= PIPE_BIND_DEPTH_STENCIL;
+ }
+ else {
+ pt->bind |= PIPE_BIND_RENDER_TARGET;
+ }
+ }
ps = CALLOC_STRUCT(pipe_surface);
if (ps) {