summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-06-19 19:41:25 -0700
committerEric Anholt <[email protected]>2015-06-20 00:16:32 -0700
commitbb107110a4d97191841985076dd9f2fbd0937dfc (patch)
tree5c27e3cbb9d1a5b203406208fc1db17465dd2457 /src
parent028590cbc758e877b963ba430f0a0cb49e882a6b (diff)
vc4: Fix write-only texsubimage when we had to align.
We need to make sure that when we store the aligned box, we've got initialized contents in the border. We could potentially just load the border area, but for now let's get text rendering working in X (and fix the GL_TEXTURE_2D errors in piglit's texsubimage test and gl-2.1-pbo/test_tex_image)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.c6
-rw-r--r--src/mesa/main/extensions.c1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index 14b135e2f45..cab76406055 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -162,6 +162,8 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
/* We need to align the box to utile boundaries, since that's
* what load/store operate on.
*/
+ uint32_t orig_width = ptrans->box.width;
+ uint32_t orig_height = ptrans->box.height;
uint32_t box_start_x = ptrans->box.x & (utile_w - 1);
uint32_t box_start_y = ptrans->box.y & (utile_h - 1);
ptrans->box.width += box_start_x;
@@ -175,7 +177,9 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
ptrans->layer_stride = ptrans->stride;
trans->map = malloc(ptrans->stride * ptrans->box.height);
- if (usage & PIPE_TRANSFER_READ) {
+ if (usage & PIPE_TRANSFER_READ ||
+ ptrans->box.width != orig_width ||
+ ptrans->box.height != orig_height) {
vc4_load_tiled_image(trans->map, ptrans->stride,
buf + slice->offset +
box->z * rsc->cube_map_stride,
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 4176a69ed7c..b747abaf684 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -218,6 +218,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_discard_framebuffer", o(dummy_true), ES1 | ES2, 2009 },
{ "GL_EXT_blend_minmax", o(EXT_blend_minmax), GLL | ES1 | ES2, 1995 },
{ "GL_EXT_blend_subtract", o(dummy_true), GLL, 1995 },
+ { "GL_EXT_buffer_storage", o(ARB_buffer_storage), ES2, 2015 },
{ "GL_EXT_compiled_vertex_array", o(dummy_true), GLL, 1996 },
{ "GL_EXT_copy_texture", o(dummy_true), GLL, 1995 },
{ "GL_EXT_depth_bounds_test", o(EXT_depth_bounds_test), GL, 2002 },