diff options
author | Brian Paul <[email protected]> | 2016-05-02 10:29:52 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-05-03 15:40:48 -0600 |
commit | 05abaa65c745d74fb296006285b85d253cb11525 (patch) | |
tree | f51c500ec88224104966b3570136c98493d99257 /src/gallium | |
parent | abc6432d54c4b4b50368f230634ed8a0d2c92e34 (diff) |
svga: try to flag surfaces for sampling, in addition to rendering
This silences some warnings when we try to sample from surfaces that were
created for drawing, such as when blitting from one of the framebuffer
surfaces. We were already doing the opposite situation (adding a bind
flag for rendering to surfaces declared as texture sources).
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/svga/svga_resource_texture.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index f176647dcf6..b7e8549b782 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -839,6 +839,17 @@ svga_texture_create(struct pipe_screen *screen, tex->key.cachable = 1; + if ((bindings & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL)) && + !(bindings & PIPE_BIND_SAMPLER_VIEW)) { + /* Also check if the format can be sampled from */ + if (screen->is_format_supported(screen, template->format, + template->target, + template->nr_samples, + PIPE_BIND_SAMPLER_VIEW)) { + bindings |= PIPE_BIND_SAMPLER_VIEW; + } + } + if (bindings & PIPE_BIND_SAMPLER_VIEW) { tex->key.flags |= SVGA3D_SURFACE_HINT_TEXTURE; tex->key.flags |= SVGA3D_SURFACE_BIND_SHADER_RESOURCE; |