Mesa (main): i915g: Fix GL_ARB_copy_buffer assertion fails.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 22 21:42:43 UTC 2021


Module: Mesa
Branch: main
Commit: a9e3ddfc63209a1b401e9de4a9de791789040f71
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9e3ddfc63209a1b401e9de4a9de791789040f71

Author: Emma Anholt <emma at anholt.net>
Date:   Tue Jun 22 13:31:22 2021 -0700

i915g: Fix GL_ARB_copy_buffer assertion fails.

The i915_texture() asserts that the resource is not a buffer, so check for
the buffer fallback first.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11540>

---

 src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt | 12 ------------
 src/gallium/drivers/i915/i915_surface.c               | 12 ++++++------
 2 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
index 557c6b191b4..8b2c8413ffe 100644
--- a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
+++ b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
@@ -329,14 +329,6 @@ spec at arb_color_buffer_float@gl_rgba8_snorm-render,Crash
 spec at arb_color_buffer_float@gl_rgba8_snorm-render-fog,Crash
 spec at arb_color_buffer_float@gl_rgba8_snorm-render-sanity,Crash
 spec at arb_color_buffer_float@gl_rgba8_snorm-render-sanity-fog,Crash
-spec at arb_copy_buffer@copy_buffer_coherency,Crash
-spec at arb_copy_buffer@copybuffersubdata,Crash
-spec at arb_copy_buffer@data-sync,Crash
-spec at arb_copy_buffer@dlist,Crash
-spec at arb_copy_buffer@intra-buffer-copy,Crash
-spec at arb_copy_buffer@overlap,Crash
-spec at arb_copy_buffer@subdata-sync,Crash
-spec at arb_copy_buffer@targets,Crash
 spec at arb_depth_texture@depth-level-clamp,Fail
 spec at arb_depth_texture@fbo-clear-formats,Fail
 spec at arb_depth_texture@fbo-clear-formats at GL_DEPTH_COMPONENT,Fail
@@ -388,10 +380,6 @@ spec at arb_framebuffer_object@framebuffer-blit-levels draw stencil,Fail
 spec at arb_framebuffer_object@framebuffer-blit-levels read stencil,Fail
 spec at arb_framebuffer_object@same-attachment-glframebuffertexture2d-gl_depth_stencil_attachment,Fail
 spec at arb_internalformat_query2@all internalformat_<x>_type pname checks,Timeout
-spec at arb_map_buffer_range@copybuffersubdata decrement-offset,Crash
-spec at arb_map_buffer_range@copybuffersubdata increment-offset,Crash
-spec at arb_map_buffer_range@copybuffersubdata offset=0,Crash
-spec at arb_map_buffer_range@map_buffer_range_test,Crash
 spec at arb_occlusion_query2@render,Fail
 spec at arb_occlusion_query@occlusion_query,Fail
 spec at arb_occlusion_query@occlusion_query_conform,Fail
diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c
index e43284fa36f..f642c151c47 100644
--- a/src/gallium/drivers/i915/i915_surface.c
+++ b/src/gallium/drivers/i915/i915_surface.c
@@ -207,12 +207,6 @@ i915_surface_copy_blitter(struct pipe_context *pipe,
                           struct pipe_resource *src, unsigned src_level,
                           const struct pipe_box *src_box)
 {
-   struct i915_texture *dst_tex = i915_texture(dst);
-   struct i915_texture *src_tex = i915_texture(src);
-   struct pipe_resource *dpt = &dst_tex->b;
-   struct pipe_resource *spt = &src_tex->b;
-   unsigned dst_offset, src_offset;  /* in bytes */
-
    /* Fallback for buffers. */
    if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
       util_resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz,
@@ -220,6 +214,12 @@ i915_surface_copy_blitter(struct pipe_context *pipe,
       return;
    }
 
+   struct i915_texture *dst_tex = i915_texture(dst);
+   struct i915_texture *src_tex = i915_texture(src);
+   struct pipe_resource *dpt = &dst_tex->b;
+   struct pipe_resource *spt = &src_tex->b;
+   unsigned dst_offset, src_offset;  /* in bytes */
+
    /* XXX cannot copy 3d regions at this time */
    assert(src_box->depth == 1);
    if (dst->target != PIPE_TEXTURE_CUBE &&



More information about the mesa-commit mailing list