summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_pipe_blit.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2017-06-14 15:53:40 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2017-06-16 08:40:26 +0200
commit9d81ab73768db6647c116f4710f7a93d8d41e3b1 (patch)
tree710811be755fd9a62ae4b9e298f471d77a66be4c /src/gallium/drivers/svga/svga_pipe_blit.c
parenta37eede540a69392f817162b0c37a992d59a0b17 (diff)
svga: Relax the format checks for copy_region_vgpu10 somewhat
The new generic checks were actually more restrictive than the previous svga- specific tests and not vice versa. So bypass the common format checks for copy_region_vgpu10. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_blit.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_blit.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index 28996062ab3..45bad97072f 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -275,8 +275,17 @@ static bool
can_blit_via_svga_copy_region(struct svga_context *svga,
const struct pipe_blit_info *blit_info)
{
- if (!util_can_blit_via_copy_region(blit_info, FALSE) &&
- !util_can_blit_via_copy_region(blit_info, TRUE))
+ struct pipe_blit_info local_blit = *blit_info;
+
+ /* First basic checks to catch incompatibilities in new or locally unchecked
+ * struct pipe_blit_info members but bypass the format check here.
+ * Also since util_can_blit_via_copy_region() requires a dimension match,
+ * PIPE_FILTER_LINEAR should be equal to PIPE_FILTER_NEAREST.
+ */
+ local_blit.dst.format = local_blit.src.format;
+ if (local_blit.filter == PIPE_TEX_FILTER_LINEAR)
+ local_blit.filter = PIPE_TEX_FILTER_NEAREST;
+ if (!util_can_blit_via_copy_region(&local_blit, TRUE))
return false;
/* For depth+stencil formats, copy with mask != PIPE_MASK_ZS is not
@@ -331,6 +340,21 @@ can_blit_via_surface_copy(struct svga_context *svga,
{
struct svga_texture *dtex, *stex;
+ /* Mimic the format tests in util_can_blit_via_copy_region(), but
+ * skip the other tests that have already been performed.
+ */
+ if (blit_info->src.format != blit_info->dst.format) {
+ const struct util_format_description *src_desc, *dst_desc;
+
+ src_desc = util_format_description(blit_info->src.resource->format);
+ dst_desc = util_format_description(blit_info->dst.resource->format);
+
+ if (blit_info->src.resource->format != blit_info->src.format ||
+ blit_info->dst.resource->format != blit_info->dst.format ||
+ !util_is_format_compatible(src_desc, dst_desc));
+ return FALSE;
+ }
+
if (svga->render_condition && blit_info->render_condition_enable)
return false;