summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5/vc5_resource.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-11-02 16:59:10 -0700
committerEric Anholt <[email protected]>2018-02-23 15:07:26 -0800
commitb4b4ada7616dec49e9386670e455553d277e5f85 (patch)
tree271278e4c74ab257f096bc79757db562e437c6fc /src/gallium/drivers/vc5/vc5_resource.h
parent97dc0773032d6284ea5c63758abf704d877f65dc (diff)
broadcom/vc5: Fix layout of 3D textures.
Cube maps are entire miptrees repeated, while 3D textures have each level have all of its layers next to each other. Fixes tex3d and tex-miplevel-selection GL2:texture() 3D.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_resource.h')
-rw-r--r--src/gallium/drivers/vc5/vc5_resource.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc5/vc5_resource.h b/src/gallium/drivers/vc5/vc5_resource.h
index 1bba480115b..2af355354ab 100644
--- a/src/gallium/drivers/vc5/vc5_resource.h
+++ b/src/gallium/drivers/vc5/vc5_resource.h
@@ -74,6 +74,10 @@ struct vc5_resource_slice {
uint32_t offset;
uint32_t stride;
uint32_t padded_height;
+ /* Size of a single pane of the slice. For 3D textures, there will be
+ * a number of panes equal to the minified, power-of-two-aligned
+ * depth.
+ */
uint32_t size;
uint8_t ub_pad;
enum vc5_tiling_mode tiling;
@@ -113,6 +117,7 @@ struct vc5_resource {
struct vc5_bo *bo;
struct vc5_resource_slice slices[VC5_MAX_MIP_LEVELS];
uint32_t cube_map_stride;
+ uint32_t size;
int cpp;
bool tiled;
@@ -163,5 +168,8 @@ void vc5_resource_screen_init(struct pipe_screen *pscreen);
void vc5_resource_context_init(struct pipe_context *pctx);
struct pipe_resource *vc5_resource_create(struct pipe_screen *pscreen,
const struct pipe_resource *tmpl);
+uint32_t vc5_layer_offset(struct pipe_resource *prsc, uint32_t level,
+ uint32_t layer);
+
#endif /* VC5_RESOURCE_H */