summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2015-05-26 15:46:44 +0800
committerChia-I Wu <[email protected]>2015-06-14 15:43:20 +0800
commitf0de65cbc29b45fffbe4bf4e1ce299ddb8be9eda (patch)
tree48d710286d25255de03df5ca353421fa91ac77ad
parentf9d2bbe967fb1fbbe7102c0765f067b3155f5ca6 (diff)
ilo: add array_size and level_count to ilo_image
We will use them for bound checking.
-rw-r--r--src/gallium/drivers/ilo/core/ilo_image.c4
-rw-r--r--src/gallium/drivers/ilo/core/ilo_image.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/ilo/core/ilo_image.c b/src/gallium/drivers/ilo/core/ilo_image.c
index 5365dd10bab..cf6c17f28f7 100644
--- a/src/gallium/drivers/ilo/core/ilo_image.c
+++ b/src/gallium/drivers/ilo/core/ilo_image.c
@@ -679,6 +679,8 @@ img_init_size_and_format(struct ilo_image *img,
img->width0 = templ->width0;
img->height0 = templ->height0;
img->depth0 = templ->depth0;
+ img->array_size = templ->array_size;
+ img->level_count = templ->last_level + 1;
img->sample_count = (templ->nr_samples) ? templ->nr_samples : 1;
/*
@@ -1348,6 +1350,8 @@ img_init_for_transfer(struct ilo_image *img,
img->width0 = templ->width0;
img->height0 = templ->height0;
img->depth0 = templ->depth0;
+ img->array_size = templ->array_size;
+ img->level_count = 1;
img->sample_count = 1;
img->format = templ->format;
diff --git a/src/gallium/drivers/ilo/core/ilo_image.h b/src/gallium/drivers/ilo/core/ilo_image.h
index bef08bc3ca2..8307cb68f9c 100644
--- a/src/gallium/drivers/ilo/core/ilo_image.h
+++ b/src/gallium/drivers/ilo/core/ilo_image.h
@@ -94,6 +94,8 @@ struct ilo_image {
unsigned width0;
unsigned height0;
unsigned depth0;
+ unsigned array_size;
+ unsigned level_count;
unsigned sample_count;
enum pipe_format format;
bool separate_stencil;