diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-24 01:57:18 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-24 01:57:18 +0000 |
commit | b24b5b9049e889ee4eb39b565bcc8d48bd45ab48 (patch) | |
tree | 658ca4e6b41655f49463c85edbaeda48979c394c /lib/mesa/src/gallium/drivers/r300/r300_transfer.c | |
parent | 57768bbb154c2879d34ec20e401b19472e77aaf7 (diff) |
Import Mesa 21.3.7
Diffstat (limited to 'lib/mesa/src/gallium/drivers/r300/r300_transfer.c')
-rw-r--r-- | lib/mesa/src/gallium/drivers/r300/r300_transfer.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/mesa/src/gallium/drivers/r300/r300_transfer.c b/lib/mesa/src/gallium/drivers/r300/r300_transfer.c index 8274de5f4..e15acac60 100644 --- a/lib/mesa/src/gallium/drivers/r300/r300_transfer.c +++ b/lib/mesa/src/gallium/drivers/r300/r300_transfer.c @@ -33,9 +33,6 @@ struct r300_transfer { /* Parent class */ struct pipe_transfer transfer; - /* Offset from start of buffer. */ - unsigned offset; - /* Linear texture. */ struct r300_resource *linear_texture; }; @@ -53,7 +50,7 @@ static void r300_copy_from_tiled_texture(struct pipe_context *ctx, { struct pipe_transfer *transfer = (struct pipe_transfer*)r300transfer; struct pipe_resource *src = transfer->resource; - struct pipe_resource *dst = &r300transfer->linear_texture->b.b; + struct pipe_resource *dst = &r300transfer->linear_texture->b; if (src->nr_samples <= 1) { ctx->resource_copy_region(ctx, dst, 0, 0, 0, 0, @@ -93,7 +90,7 @@ static void r300_copy_into_tiled_texture(struct pipe_context *ctx, ctx->resource_copy_region(ctx, tex, transfer->level, transfer->box.x, transfer->box.y, transfer->box.z, - &r300transfer->linear_texture->b.b, 0, &src_box); + &r300transfer->linear_texture->b, 0, &src_box); /* XXX remove this. */ r300_flush(ctx, 0, NULL); @@ -111,7 +108,7 @@ r300_texture_transfer_map(struct pipe_context *ctx, struct r300_resource *tex = r300_resource(texture); struct r300_transfer *trans; boolean referenced_cs, referenced_hw; - enum pipe_format format = tex->b.b.format; + enum pipe_format format = tex->b.format; char *map; referenced_cs = @@ -206,7 +203,7 @@ r300_texture_transfer_map(struct pipe_context *ctx, /* Unpipelined transfer. */ trans->transfer.stride = tex->tex.stride_in_bytes[level]; trans->transfer.layer_stride = tex->tex.layer_size_in_bytes[level]; - trans->offset = r300_texture_get_offset(tex, level, box->z); + trans->transfer.offset = r300_texture_get_offset(tex, level, box->z); if (referenced_cs && !(usage & PIPE_MAP_UNSYNCHRONIZED)) { @@ -237,7 +234,7 @@ r300_texture_transfer_map(struct pipe_context *ctx, } *transfer = &trans->transfer; - return map + trans->offset + + return map + trans->transfer.offset + box->y / util_format_get_blockheight(format) * trans->transfer.stride + box->x / util_format_get_blockwidth(format) * util_format_get_blocksize(format); } |