<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - glBufferSubData is corrupting data when buffer is > 32k"
href="https://bugs.freedesktop.org/show_bug.cgi?id=90734#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - glBufferSubData is corrupting data when buffer is > 32k"
href="https://bugs.freedesktop.org/show_bug.cgi?id=90734">bug 90734</a>
from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
<pre>diff --git a/src/mesa/drivers/dri/i965/intel_blit.c
b/src/mesa/drivers/dri/i965/intel_blit.c
index 4bfa0ef..a73da35 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -539,23 +539,26 @@ intel_emit_linear_blit(struct brw_context *brw,
*/
pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);
height = (pitch == 0) ? 1 : size / pitch;
+ if (height) {
+ src_x = src_offset % 64;
+ dst_x = dst_offset % 64;
+ ok = intelEmitCopyBlit(brw, 4,
+ pitch, src_bo, src_offset - src_x,
I915_TILING_NONE,
+ pitch, dst_bo, dst_offset - dst_x,
I915_TILING_NONE,
+ src_x/4, 0, /* src x/y */
+ dst_x/4, 0, /* dst x/y */
+ pitch/4, height, /* w, h */
+ GL_COPY);
+ if (!ok)
+ _mesa_problem(ctx, "Failed to linear blit %dx%d\n", pitch, height);
+
+ src_offset += pitch * height;
+ dst_offset += pitch * height;
+ size -= pitch * height;
+ }
+
src_x = src_offset % 64;
dst_x = dst_offset % 64;
- ok = intelEmitCopyBlit(brw, 1,
- pitch, src_bo, src_offset - src_x, I915_TILING_NONE,
- pitch, dst_bo, dst_offset - dst_x, I915_TILING_NONE,
- src_x, 0, /* src x/y */
- dst_x, 0, /* dst x/y */
- pitch, height, /* w, h */
- GL_COPY);
- if (!ok)
- _mesa_problem(ctx, "Failed to linear blit %dx%d\n", pitch, height);
-
- src_offset += pitch * height;
- dst_offset += pitch * height;
- src_x = src_offset % 64;
- dst_x = dst_offset % 64;
- size -= pitch * height;
assert (size < (1 << 15));
pitch = ALIGN(size, 4);</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>