summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2017-06-28 08:56:26 +0300
committerTopi Pohjolainen <[email protected]>2017-07-20 11:32:21 +0300
commit40e75aba730ddeb41ca4bbc25caa61054f2bbc99 (patch)
tree6734421175eb1659f90604dde53a51f2e04938f7 /src
parent0f795effe512b77a21b1dd4b98430325657e1e65 (diff)
i965/miptree: Add support for imported bo offsets for isl based
Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index c2d5eafa510..619b00567ed 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1453,9 +1453,22 @@ intel_miptree_get_image_offset(const struct intel_mipmap_tree *mt,
GLuint level, GLuint slice,
GLuint *x, GLuint *y)
{
+ if (level == 0 && slice == 0) {
+ *x = mt->level[0].level_x;
+ *y = mt->level[0].level_y;
+ return;
+ }
+
if (mt->surf.size > 0) {
uint32_t x_offset_sa, y_offset_sa;
+ /* Miptree itself can have an offset only if it represents a single
+ * slice in an imported buffer object.
+ * See intel_miptree_create_for_dri_image().
+ */
+ assert(mt->level[0].level_x == 0);
+ assert(mt->level[0].level_y == 0);
+
/* Given level is relative to level zero while the miptree may be
* represent just a subset of all levels starting from 'first_level'.
*/