Mesa (vulkan): vc4: Fix subimage accesses to LT textures.

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Apr 15 20:48:18 UTC 2016


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Apr 15 11:43:00 2016 -0700

vc4: Fix subimage accesses to LT textures.

This code started out like the T case, iterating over utile offsets, but I
had partially switched it to iterating over pixel offsets.  I hadn't
caught this before because it's unusual to do piecemeal uploads to small
textures.

Fixes bad text rendering in QT5 apps, which use a 256x16 glyph cache.
Also fixes 6 piglit tests related to glTexSubImage() and
glGetTexSubImage().

Cc: "11.1 11.2" <mesa-stable at lists.freedesktop.org>

---

 src/gallium/drivers/vc4/vc4_tiling.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_tiling.c b/src/gallium/drivers/vc4/vc4_tiling.c
index cf86eb0..2a803ab 100644
--- a/src/gallium/drivers/vc4/vc4_tiling.c
+++ b/src/gallium/drivers/vc4/vc4_tiling.c
@@ -140,8 +140,8 @@ vc4_load_lt_image(void *dst, uint32_t dst_stride,
 {
         uint32_t utile_w = vc4_utile_width(cpp);
         uint32_t utile_h = vc4_utile_height(cpp);
-        uint32_t xstart = box->x / utile_w;
-        uint32_t ystart = box->y / utile_h;
+        uint32_t xstart = box->x;
+        uint32_t ystart = box->y;
 
         for (uint32_t y = 0; y < box->height; y += utile_h) {
                 for (int x = 0; x < box->width; x += utile_w) {
@@ -161,8 +161,8 @@ vc4_store_lt_image(void *dst, uint32_t dst_stride,
 {
         uint32_t utile_w = vc4_utile_width(cpp);
         uint32_t utile_h = vc4_utile_height(cpp);
-        uint32_t xstart = box->x / utile_w;
-        uint32_t ystart = box->y / utile_h;
+        uint32_t xstart = box->x;
+        uint32_t ystart = box->y;
 
         for (uint32_t y = 0; y < box->height; y += utile_h) {
                 for (int x = 0; x < box->width; x += utile_w) {




More information about the mesa-commit mailing list