diff options
author | Marek Olšák <[email protected]> | 2016-02-24 00:54:11 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-03-09 15:02:25 +0100 |
commit | 260ef9c9bec8695d5988a91443988516d39d0240 (patch) | |
tree | 9d4db56bcc8bbc71515aa35d85e36de57a0e77bf /src/gallium/drivers/r300 | |
parent | 82db518f1519cec9e3842f23455a105e2006afbd (diff) |
gallium/radeon: use a structure for passing tiling flags from/to winsys
and call it radeon_bo_metadata
Reviewed-by: Michel Dänzer <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_texture.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 2b9018a5de3..81929632daf 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -1006,6 +1006,7 @@ r300_texture_create_object(struct r300_screen *rscreen, { struct radeon_winsys *rws = rscreen->rws; struct r300_resource *tex = NULL; + struct radeon_bo_metadata tiling = {}; tex = CALLOC_STRUCT(r300_resource); if (!tex) { @@ -1060,10 +1061,10 @@ r300_texture_create_object(struct r300_screen *rscreen, util_format_is_depth_or_stencil(base->format) ? "depth" : "color"); } - rws->buffer_set_tiling(tex->buf, NULL, - tex->tex.microtile, tex->tex.macrotile[0], - 0, 0, 0, 0, 0, 0, 0, - tex->tex.stride_in_bytes[0], false); + tiling.microtile = tex->tex.microtile; + tiling.macrotile = tex->tex.macrotile[0]; + tiling.stride = tex->tex.stride_in_bytes[0]; + rws->buffer_set_tiling(tex->buf, NULL, &tiling); return tex; @@ -1104,8 +1105,8 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen, struct r300_screen *rscreen = r300_screen(screen); struct radeon_winsys *rws = rscreen->rws; struct pb_buffer *buffer; - enum radeon_bo_layout microtile, macrotile; unsigned stride; + struct radeon_bo_metadata tiling = {}; /* Support only 2D textures without mipmaps */ if ((base->target != PIPE_TEXTURE_2D && @@ -1119,25 +1120,24 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen, if (!buffer) return NULL; - rws->buffer_get_tiling(buffer, µtile, ¯otile, NULL, NULL, NULL, - NULL, NULL, NULL); + rws->buffer_get_tiling(buffer, &tiling); /* Enforce a microtiled zbuffer. */ if (util_format_is_depth_or_stencil(base->format) && - microtile == RADEON_LAYOUT_LINEAR) { + tiling.microtile == RADEON_LAYOUT_LINEAR) { switch (util_format_get_blocksize(base->format)) { case 4: - microtile = RADEON_LAYOUT_TILED; + tiling.microtile = RADEON_LAYOUT_TILED; break; case 2: - microtile = RADEON_LAYOUT_SQUARETILED; + tiling.microtile = RADEON_LAYOUT_SQUARETILED; break; } } return (struct pipe_resource*) - r300_texture_create_object(rscreen, base, microtile, macrotile, + r300_texture_create_object(rscreen, base, tiling.microtile, tiling.macrotile, stride, buffer); } |