aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharmaine Lee <[email protected]>2016-06-23 09:21:11 -0700
committerBrian Paul <[email protected]>2016-06-28 13:43:23 -0600
commit6397c12f32431616555c8de29ee40aac51e69401 (patch)
treee5cd035cd970fd42837652f9a376f1dc25ad3fd7
parentd65c4e22a84b3f305e64932e167e998dcf44f5be (diff)
svga: force direct map for transfering multiple slices
With commit fb9fe35, we start using transfer_inline_write for memcpy of TexSubImage. But SurfaceDMA command does not work well with texture array. This patch forces direct map when transfering multiple slices of a texture array. Fixes piglit regression "texelFetch fs sampler1DArray" Tested with MTT piglit, glretrace, conform. Reviewed-by: Sinclair Yeh <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index f8305d58ad7..0e21f5ea512 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -350,6 +350,30 @@ svga_texture_transfer_map(struct pipe_context *pipe,
if (!st)
return NULL;
+ st->base.level = level;
+ st->base.usage = usage;
+ st->base.box = *box;
+
+ switch (tex->b.b.target) {
+ case PIPE_TEXTURE_CUBE:
+ st->slice = st->base.box.z;
+ st->base.box.z = 0; /* so we don't apply double offsets below */
+ break;
+ case PIPE_TEXTURE_2D_ARRAY:
+ case PIPE_TEXTURE_1D_ARRAY:
+ st->slice = st->base.box.z;
+ st->base.box.z = 0; /* so we don't apply double offsets below */
+
+ /* Force direct map for transfering multiple slices */
+ if (st->base.box.depth > 1)
+ use_direct_map = svga_have_gb_objects(svga);
+
+ break;
+ default:
+ st->slice = 0;
+ break;
+ }
+
{
unsigned w, h;
if (use_direct_map) {
@@ -370,24 +394,9 @@ svga_texture_transfer_map(struct pipe_context *pipe,
pipe_resource_reference(&st->base.resource, texture);
- st->base.level = level;
- st->base.usage = usage;
- st->base.box = *box;
st->base.stride = nblocksx*util_format_get_blocksize(texture->format);
st->base.layer_stride = st->base.stride * nblocksy;
- switch (tex->b.b.target) {
- case PIPE_TEXTURE_CUBE:
- case PIPE_TEXTURE_2D_ARRAY:
- case PIPE_TEXTURE_1D_ARRAY:
- st->slice = st->base.box.z;
- st->base.box.z = 0; /* so we don't apply double offsets below */
- break;
- default:
- st->slice = 0;
- break;
- }
-
if (usage & PIPE_TRANSFER_WRITE) {
/* record texture upload for HUD */
svga->hud.num_bytes_uploaded +=