summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-09-20 17:22:42 -0600
committerBrian Paul <[email protected]>2016-09-23 19:54:42 -0600
commitc0d7b6073d308101b4ffb59b588445e07dad7690 (patch)
treef680306eb5a58a97a82b9fa0133c45b4ee95f39d
parentf942a703406b5e08f18fe308d78ea91422b2e01c (diff)
svga: set PIPE_BIND_DEPTH_STENCIL flag for new resources when possible
When we create a depth/stencil texture, also check if we can render to it and set the PIPE_BIND_DEPTH_STENCIL flag. We were previously doing this for color textures (PIPE_BIND_RENDER_TARGET). Reviewed-by: Charmaine Lee <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index ea26c3e822c..fc5c3741b54 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -975,7 +975,7 @@ svga_texture_create(struct pipe_screen *screen,
tex->key.flags |= SVGA3D_SURFACE_BIND_SHADER_RESOURCE;
if (!(bindings & PIPE_BIND_RENDER_TARGET)) {
- /* Also check if the format is renderable */
+ /* Also check if the format is color renderable */
if (screen->is_format_supported(screen, template->format,
template->target,
template->nr_samples,
@@ -983,6 +983,16 @@ svga_texture_create(struct pipe_screen *screen,
bindings |= PIPE_BIND_RENDER_TARGET;
}
}
+
+ if (!(bindings & PIPE_BIND_DEPTH_STENCIL)) {
+ /* Also check if the format is depth/stencil renderable */
+ if (screen->is_format_supported(screen, template->format,
+ template->target,
+ template->nr_samples,
+ PIPE_BIND_DEPTH_STENCIL)) {
+ bindings |= PIPE_BIND_DEPTH_STENCIL;
+ }
+ }
}
if (bindings & PIPE_BIND_DISPLAY_TARGET) {