img->width0 = templ->width0;
img->height0 = templ->height0;
+ img->depth0 = templ->depth0;
+ img->sample_count = (templ->nr_samples) ? templ->nr_samples : 1;
/*
* From the Sandy Bridge PRM, volume 2 part 1, page 317:
img_align(img, params);
img_calculate_bo_size(img, params);
+ img->scanout = (params->templ->bind & PIPE_BIND_SCANOUT);
+
switch (img->aux.type) {
case ILO_IMAGE_AUX_HIZ:
img_calculate_hiz_size(img, params);
assert(templ->nr_samples <= 1);
img->aux.type = ILO_IMAGE_AUX_NONE;
+
img->width0 = templ->width0;
img->height0 = templ->height0;
+ img->depth0 = templ->depth0;
+ img->sample_count = 1;
+
img->format = templ->format;
img->block_width = util_format_get_blockwidth(templ->format);
img->block_height = util_format_get_blockheight(templ->format);
img->block_size = util_format_get_blocksize(templ->format);
+
img->walk = ILO_IMAGE_WALK_LOD;
img->tiling = GEN6_TILING_NONE;
img->bo_stride = bo_stride;
+ /* assume imported RTs are also scanouts */
+ if (!img->scanout)
+ img->scanout = (templ->bind & PIPE_BIND_RENDER_TARGET);
+
return true;
}
* Texture layout.
*/
struct ilo_image {
- /* size and format for programming hardware states */
+ /* size, format, etc for programming hardware states */
unsigned width0;
unsigned height0;
+ unsigned depth0;
+ unsigned sample_count;
enum pipe_format format;
bool separate_stencil;
/* number of pixel block rows */
unsigned bo_height;
+ bool scanout;
+
struct intel_bo *bo;
struct {
const unsigned sx = slice & ((1 << level) - 1);
const unsigned sy = slice >> level;
+ assert(slice < u_minify(img->depth0, level));
+
*x = img->lods[level].x + img->lods[level].slice_width * sx;
*y = img->lods[level].y + img->lods[level].slice_height * sy;
-
- /* should not overlap with the next level */
- if (level + 1 < Elements(img->lods) &&
- img->lods[level + 1].y) {
- assert(*y + img->lods[level].slice_height <=
- img->lods[level + 1].y);
- }
- break;
}
+ break;
default:
assert(!"unknown img walk type");
*x = 0;