From: Chad Versace Date: Mon, 14 Dec 2015 16:48:19 +0000 (-0800) Subject: isl: Rename s/lod_align/image_align/ for consistency X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0bebaeacd74acfafc97c0f66cdcd50369d85ab26;p=mesa.git isl: Rename s/lod_align/image_align/ for consistency Regarding the subimages within a surface, sometimes isl called them "images" and sometimes "LODs". This patch make isl consistently refer to them as "images". I choose the term "image" over "LOD" because LOD is an misnomer when applied to 3D surfaces. The alignment applies to each individual 2D subimage, not to the LOD as a whole. This patch changes no behavior. It's just a manually performed, case-insensitive, replacement s/lod/image/ that maintains correct indentation. any behavior. --- diff --git a/src/vulkan/gen7_state.c b/src/vulkan/gen7_state.c index 4101e84f827..3206f77b831 100644 --- a/src/vulkan/gen7_state.c +++ b/src/vulkan/gen7_state.c @@ -238,15 +238,15 @@ genX(image_view_init)(struct anv_image_view *iview, depth = image->extent.depth; } - const struct isl_extent3d lod_align_sa = - isl_surf_get_lod_alignment_sa(&surface->isl); + const struct isl_extent3d image_align_sa = + isl_surf_get_image_alignment_sa(&surface->isl); struct GENX(RENDER_SURFACE_STATE) surface_state = { .SurfaceType = image->surface_type, .SurfaceArray = image->array_size > 1, .SurfaceFormat = format->surface_format, - .SurfaceVerticalAlignment = anv_valign[lod_align_sa.height], - .SurfaceHorizontalAlignment = anv_halign[lod_align_sa.width], + .SurfaceVerticalAlignment = anv_valign[image_align_sa.height], + .SurfaceHorizontalAlignment = anv_halign[image_align_sa.width], /* From bspec (DevSNB, DevIVB): "Set Tile Walk to TILEWALK_XMAJOR if * Tiled Surface is False." diff --git a/src/vulkan/gen8_state.c b/src/vulkan/gen8_state.c index 59134d5214e..ac1f17f48f9 100644 --- a/src/vulkan/gen8_state.c +++ b/src/vulkan/gen8_state.c @@ -120,9 +120,11 @@ get_halign_valign(const struct isl_surf *surf, uint32_t *halign, uint32_t *valig * format (ETC2 has a block height of 4), then the vertical alignment is * 4 compression blocks or, equivalently, 16 pixels. */ - struct isl_extent3d lod_align_el = isl_surf_get_lod_alignment_el(surf); - *halign = anv_halign[lod_align_el.width]; - *valign = anv_valign[lod_align_el.height]; + struct isl_extent3d image_align_el + = isl_surf_get_image_alignment_el(surf); + + *halign = anv_halign[image_align_el.width]; + *valign = anv_valign[image_align_el.height]; #else /* Pre-Skylake, RENDER_SUFFACE_STATE.SurfaceVerticalAlignment is in * units of surface samples. For example, if SurfaceVerticalAlignment @@ -130,9 +132,11 @@ get_halign_valign(const struct isl_surf *surf, uint32_t *halign, uint32_t *valig * format (compressed or not) the vertical alignment is * 4 pixels. */ - struct isl_extent3d lod_align_sa = isl_surf_get_lod_alignment_sa(surf); - *halign = anv_halign[lod_align_sa.width]; - *valign = anv_valign[lod_align_sa.height]; + struct isl_extent3d image_align_sa + = isl_surf_get_image_alignment_sa(surf); + + *halign = anv_halign[image_align_sa.width]; + *valign = anv_valign[image_align_sa.height]; #endif } diff --git a/src/vulkan/isl.c b/src/vulkan/isl.c index 41b842dd79b..d858ea74745 100644 --- a/src/vulkan/isl.c +++ b/src/vulkan/isl.c @@ -344,27 +344,27 @@ isl_choose_array_pitch_span(const struct isl_device *dev, } static void -isl_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el) +isl_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el) { if (ISL_DEV_GEN(dev) >= 9) { - gen9_choose_lod_alignment_el(dev, info, tiling, msaa_layout, - lod_align_el); + gen9_choose_image_alignment_el(dev, info, tiling, msaa_layout, + image_align_el); } else if (ISL_DEV_GEN(dev) >= 8) { - gen8_choose_lod_alignment_el(dev, info, tiling, msaa_layout, - lod_align_el); + gen8_choose_image_alignment_el(dev, info, tiling, msaa_layout, + image_align_el); } else if (ISL_DEV_GEN(dev) >= 7) { - gen7_choose_lod_alignment_el(dev, info, tiling, msaa_layout, - lod_align_el); + gen7_choose_image_alignment_el(dev, info, tiling, msaa_layout, + image_align_el); } else if (ISL_DEV_GEN(dev) >= 6) { - gen6_choose_lod_alignment_el(dev, info, tiling, msaa_layout, - lod_align_el); + gen6_choose_image_alignment_el(dev, info, tiling, msaa_layout, + image_align_el); } else { - gen4_choose_lod_alignment_el(dev, info, tiling, msaa_layout, - lod_align_el); + gen4_choose_image_alignment_el(dev, info, tiling, msaa_layout, + image_align_el); } } @@ -528,7 +528,7 @@ isl_calc_phys_slice0_extent_sa_gen4_2d( const struct isl_device *dev, const struct isl_surf_init_info *restrict info, enum isl_msaa_layout msaa_layout, - const struct isl_extent3d *lod_align_sa, + const struct isl_extent3d *image_align_sa, const struct isl_extent4d *phys_level0_sa, struct isl_extent2d *phys_slice0_sa) { @@ -558,8 +558,8 @@ isl_calc_phys_slice0_extent_sa_gen4_2d( isl_msaa_interleaved_scale_px_to_sa(info->samples, &W, &H); } - uint32_t w = isl_align_npot(W, lod_align_sa->w); - uint32_t h = isl_align_npot(H, lod_align_sa->h); + uint32_t w = isl_align_npot(W, image_align_sa->w); + uint32_t h = isl_align_npot(H, image_align_sa->h); if (l == 0) { slice_top_w = w; @@ -589,7 +589,7 @@ static void isl_calc_phys_slice0_extent_sa_gen4_3d( const struct isl_device *dev, const struct isl_surf_init_info *restrict info, - const struct isl_extent3d *lod_align_sa, + const struct isl_extent3d *image_align_sa, const struct isl_extent4d *phys_level0_sa, struct isl_extent2d *phys_slice0_sa) { @@ -604,9 +604,9 @@ isl_calc_phys_slice0_extent_sa_gen4_3d( uint32_t D0 = phys_level0_sa->d; for (uint32_t l = 0; l < info->levels; ++l) { - uint32_t level_w = isl_align_npot(isl_minify(W0, l), lod_align_sa->w); - uint32_t level_h = isl_align_npot(isl_minify(H0, l), lod_align_sa->h); - uint32_t level_d = isl_align_npot(isl_minify(D0, l), lod_align_sa->d); + uint32_t level_w = isl_align_npot(isl_minify(W0, l), image_align_sa->w); + uint32_t level_h = isl_align_npot(isl_minify(H0, l), image_align_sa->h); + uint32_t level_d = isl_align_npot(isl_minify(D0, l), image_align_sa->d); uint32_t max_layers_horiz = MIN(level_d, 1u << l); uint32_t max_layers_vert = isl_align(level_d, 1u << l) / (1u << l); @@ -623,14 +623,14 @@ isl_calc_phys_slice0_extent_sa_gen4_3d( /** * Calculate the physical extent of the surface's first array slice, in units - * of surface samples. The result is aligned to \a lod_align_sa. + * of surface samples. The result is aligned to \a image_align_sa. */ static void isl_calc_phys_slice0_extent_sa(const struct isl_device *dev, const struct isl_surf_init_info *restrict info, enum isl_dim_layout dim_layout, enum isl_msaa_layout msaa_layout, - const struct isl_extent3d *lod_align_sa, + const struct isl_extent3d *image_align_sa, const struct isl_extent4d *phys_level0_sa, struct isl_extent2d *phys_slice0_sa) { @@ -642,11 +642,11 @@ isl_calc_phys_slice0_extent_sa(const struct isl_device *dev, /*fallthrough*/ case ISL_DIM_LAYOUT_GEN4_2D: isl_calc_phys_slice0_extent_sa_gen4_2d(dev, info, msaa_layout, - lod_align_sa, phys_level0_sa, + image_align_sa, phys_level0_sa, phys_slice0_sa); return; case ISL_DIM_LAYOUT_GEN4_3D: - isl_calc_phys_slice0_extent_sa_gen4_3d(dev, info, lod_align_sa, + isl_calc_phys_slice0_extent_sa_gen4_3d(dev, info, image_align_sa, phys_level0_sa, phys_slice0_sa); return; } @@ -654,14 +654,14 @@ isl_calc_phys_slice0_extent_sa(const struct isl_device *dev, /** * Calculate the pitch between physical array slices, in units of rows of - * surface samples. The result is aligned to \a lod_align_sa. + * surface samples. The result is aligned to \a image_align_sa. */ static uint32_t isl_calc_array_pitch_sa_rows(const struct isl_device *dev, const struct isl_surf_init_info *restrict info, enum isl_dim_layout dim_layout, enum isl_array_pitch_span array_pitch_span, - const struct isl_extent3d *lod_align_sa, + const struct isl_extent3d *image_align_sa, const struct isl_extent4d *phys_level0_sa, const struct isl_extent2d *phys_slice0_sa) { @@ -677,7 +677,7 @@ isl_calc_array_pitch_sa_rows(const struct isl_device *dev, case ISL_DIM_LAYOUT_GEN4_2D: switch (array_pitch_span) { case ISL_ARRAY_PITCH_SPAN_COMPACT: - return isl_align_npot(phys_slice0_sa->h, lod_align_sa->h); + return isl_align_npot(phys_slice0_sa->h, image_align_sa->h); case ISL_ARRAY_PITCH_SPAN_FULL: { /* The QPitch equation is found in the Broadwell PRM >> Volume 5: * Memory Views >> Common Surface Formats >> Surface Layout >> 2D @@ -686,8 +686,8 @@ isl_calc_array_pitch_sa_rows(const struct isl_device *dev, uint32_t H0_sa = phys_level0_sa->h; uint32_t H1_sa = isl_minify(H0_sa, 1); - uint32_t h0_sa = isl_align_npot(H0_sa, lod_align_sa->h); - uint32_t h1_sa = isl_align_npot(H1_sa, lod_align_sa->h); + uint32_t h0_sa = isl_align_npot(H0_sa, image_align_sa->h); + uint32_t h1_sa = isl_align_npot(H1_sa, image_align_sa->h); uint32_t m; if (ISL_DEV_GEN(dev) >= 7) { @@ -697,7 +697,7 @@ isl_calc_array_pitch_sa_rows(const struct isl_device *dev, m = 11; } - uint32_t pitch_sa_rows = h0_sa + h1_sa + (m * lod_align_sa->h); + uint32_t pitch_sa_rows = h0_sa + h1_sa + (m * image_align_sa->h); if (ISL_DEV_GEN(dev) == 6 && info->samples > 1 && (info->height % 4 == 1)) { @@ -724,7 +724,7 @@ isl_calc_array_pitch_sa_rows(const struct isl_device *dev, case ISL_DIM_LAYOUT_GEN4_3D: assert(array_pitch_span == ISL_ARRAY_PITCH_SPAN_COMPACT); - return isl_align_npot(phys_slice0_sa->h, lod_align_sa->h); + return isl_align_npot(phys_slice0_sa->h, image_align_sa->h); } unreachable("bad isl_dim_layout"); @@ -738,7 +738,7 @@ static uint32_t isl_calc_row_pitch(const struct isl_device *dev, const struct isl_surf_init_info *restrict info, const struct isl_tile_info *tile_info, - const struct isl_extent3d *lod_align_sa, + const struct isl_extent3d *image_align_sa, const struct isl_extent2d *phys_slice0_sa) { const struct isl_format_layout *fmtl = isl_format_get_layout(info->format); @@ -974,11 +974,12 @@ isl_surf_init_s(const struct isl_device *dev, if (!isl_choose_msaa_layout(dev, info, tiling, &msaa_layout)) return false; - struct isl_extent3d lod_align_el; - isl_choose_lod_alignment_el(dev, info, tiling, msaa_layout, &lod_align_el); + struct isl_extent3d image_align_el; + isl_choose_image_alignment_el(dev, info, tiling, msaa_layout, + &image_align_el); - struct isl_extent3d lod_align_sa = - isl_extent3d_el_to_sa(info->format, lod_align_el); + struct isl_extent3d image_align_sa = + isl_extent3d_el_to_sa(info->format, image_align_el); struct isl_extent4d phys_level0_sa; isl_calc_phys_level0_extent_sa(dev, info, dim_layout, tiling, msaa_layout, @@ -989,18 +990,18 @@ isl_surf_init_s(const struct isl_device *dev, struct isl_extent2d phys_slice0_sa; isl_calc_phys_slice0_extent_sa(dev, info, dim_layout, msaa_layout, - &lod_align_sa, &phys_level0_sa, + &image_align_sa, &phys_level0_sa, &phys_slice0_sa); assert(phys_slice0_sa.w % fmtl->bw == 0); assert(phys_slice0_sa.h % fmtl->bh == 0); const uint32_t row_pitch = isl_calc_row_pitch(dev, info, &tile_info, - &lod_align_sa, + &image_align_sa, &phys_slice0_sa); const uint32_t array_pitch_sa_rows = isl_calc_array_pitch_sa_rows(dev, info, dim_layout, array_pitch_span, - &lod_align_sa, &phys_level0_sa, + &image_align_sa, &phys_level0_sa, &phys_slice0_sa); assert(array_pitch_sa_rows % fmtl->bh == 0); @@ -1028,7 +1029,7 @@ isl_surf_init_s(const struct isl_device *dev, .levels = info->levels, .samples = info->samples, - .lod_alignment_el = lod_align_el, + .image_alignment_el = image_align_el, .logical_level0_px = logical_level0_px, .phys_level0_sa = phys_level0_sa, diff --git a/src/vulkan/isl.h b/src/vulkan/isl.h index 50b0c20505b..184b0c5f70a 100644 --- a/src/vulkan/isl.h +++ b/src/vulkan/isl.h @@ -646,10 +646,10 @@ struct isl_surf { enum isl_format format; /** - * Alignment of the upper-left sample of each LOD, in units of surface + * Alignment of the upper-left sample of each subimage, in units of surface * elements. */ - struct isl_extent3d lod_alignment_el; + struct isl_extent3d image_alignment_el; /** * Logical extent of the surface's base level, in units of pixels. This is @@ -859,28 +859,28 @@ isl_surf_init_s(const struct isl_device *dev, const struct isl_surf_init_info *restrict info); /** - * Alignment of the upper-left sample of each LOD, in units of surface + * Alignment of the upper-left sample of each subimage, in units of surface * elements. */ static inline struct isl_extent3d -isl_surf_get_lod_alignment_el(const struct isl_surf *surf) +isl_surf_get_image_alignment_el(const struct isl_surf *surf) { - return surf->lod_alignment_el; + return surf->image_alignment_el; } /** - * Alignment of the upper-left sample of each LOD, in units of surface + * Alignment of the upper-left sample of each subimage, in units of surface * samples. */ static inline struct isl_extent3d -isl_surf_get_lod_alignment_sa(const struct isl_surf *surf) +isl_surf_get_image_alignment_sa(const struct isl_surf *surf) { const struct isl_format_layout *fmtl = isl_format_get_layout(surf->format); return (struct isl_extent3d) { - .w = fmtl->bw * surf->lod_alignment_el.w, - .h = fmtl->bh * surf->lod_alignment_el.h, - .d = fmtl->bd * surf->lod_alignment_el.d, + .w = fmtl->bw * surf->image_alignment_el.w, + .h = fmtl->bh * surf->image_alignment_el.h, + .d = fmtl->bd * surf->image_alignment_el.d, }; } diff --git a/src/vulkan/isl_gen4.c b/src/vulkan/isl_gen4.c index bf9bec16f7d..52aa5655bb2 100644 --- a/src/vulkan/isl_gen4.c +++ b/src/vulkan/isl_gen4.c @@ -38,11 +38,11 @@ gen4_choose_msaa_layout(const struct isl_device *dev, } void -gen4_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el) +gen4_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el) { assert(info->samples == 1); assert(msaa_layout == ISL_MSAA_LAYOUT_NONE); @@ -66,9 +66,9 @@ gen4_choose_lod_alignment_el(const struct isl_device *dev, */ if (isl_format_is_compressed(info->format)) { - *lod_align_el = isl_extent3d(1, 1, 1); + *image_align_el = isl_extent3d(1, 1, 1); return; } - *lod_align_el = isl_extent3d(4, 2, 1); + *image_align_el = isl_extent3d(4, 2, 1); } diff --git a/src/vulkan/isl_gen4.h b/src/vulkan/isl_gen4.h index 913a7c68ba9..06cd70b9206 100644 --- a/src/vulkan/isl_gen4.h +++ b/src/vulkan/isl_gen4.h @@ -36,11 +36,11 @@ gen4_choose_msaa_layout(const struct isl_device *dev, enum isl_msaa_layout *msaa_layout); void -gen4_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el); +gen4_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el); #ifdef __cplusplus } diff --git a/src/vulkan/isl_gen6.c b/src/vulkan/isl_gen6.c index 8d522c37c29..24c393925ed 100644 --- a/src/vulkan/isl_gen6.c +++ b/src/vulkan/isl_gen6.c @@ -83,11 +83,11 @@ gen6_choose_msaa_layout(const struct isl_device *dev, } void -gen6_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el) +gen6_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el) { /* Note that the surface's horizontal image alignment is not programmable * on Sandybridge. @@ -123,38 +123,38 @@ gen6_choose_lod_alignment_el(const struct isl_device *dev, */ if (isl_format_is_compressed(info->format)) { - *lod_align_el = isl_extent3d(1, 1, 1); + *image_align_el = isl_extent3d(1, 1, 1); return; } if (isl_format_is_yuv(info->format)) { - *lod_align_el = isl_extent3d(4, 2, 1); + *image_align_el = isl_extent3d(4, 2, 1); return; } if (info->samples > 1) { - *lod_align_el = isl_extent3d(4, 4, 1); + *image_align_el = isl_extent3d(4, 4, 1); return; } if (isl_surf_usage_is_depth_or_stencil(info->usage) && !ISL_DEV_USE_SEPARATE_STENCIL(dev)) { /* interleaved depthstencil buffer */ - *lod_align_el = isl_extent3d(4, 4, 1); + *image_align_el = isl_extent3d(4, 4, 1); return; } if (isl_surf_usage_is_depth(info->usage)) { /* separate depth buffer */ - *lod_align_el = isl_extent3d(4, 4, 1); + *image_align_el = isl_extent3d(4, 4, 1); return; } if (isl_surf_usage_is_stencil(info->usage)) { /* separate stencil buffer */ - *lod_align_el = isl_extent3d(4, 2, 1); + *image_align_el = isl_extent3d(4, 2, 1); return; } - *lod_align_el = isl_extent3d(4, 2, 1); + *image_align_el = isl_extent3d(4, 2, 1); } diff --git a/src/vulkan/isl_gen6.h b/src/vulkan/isl_gen6.h index 56b7f2cb0b7..0779c674940 100644 --- a/src/vulkan/isl_gen6.h +++ b/src/vulkan/isl_gen6.h @@ -36,11 +36,11 @@ gen6_choose_msaa_layout(const struct isl_device *dev, enum isl_msaa_layout *msaa_layout); void -gen6_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el); +gen6_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el); #ifdef __cplusplus } diff --git a/src/vulkan/isl_gen7.c b/src/vulkan/isl_gen7.c index 2ac1852402e..9984f61b2a4 100644 --- a/src/vulkan/isl_gen7.c +++ b/src/vulkan/isl_gen7.c @@ -278,7 +278,7 @@ gen7_filter_tiling(const struct isl_device *dev, } /** - * Choose horizontal LOD alignment, in units of surface elements. + * Choose horizontal subimage alignment, in units of surface elements. */ static uint32_t gen7_choose_halign_el(const struct isl_device *dev, @@ -303,7 +303,7 @@ gen7_choose_halign_el(const struct isl_device *dev, } /** - * Choose vertical LOD alignment, in units of surface elements. + * Choose vertical subimage alignment, in units of surface elements. */ static uint32_t gen7_choose_valign_el(const struct isl_device *dev, @@ -375,16 +375,16 @@ gen7_choose_valign_el(const struct isl_device *dev, } void -gen7_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el) +gen7_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el) { /* IVB+ does not support combined depthstencil. */ assert(!isl_surf_usage_is_depth_and_stencil(info->usage)); - *lod_align_el = (struct isl_extent3d) { + *image_align_el = (struct isl_extent3d) { .w = gen7_choose_halign_el(dev, info), .h = gen7_choose_valign_el(dev, info, tiling), .d = 1, diff --git a/src/vulkan/isl_gen7.h b/src/vulkan/isl_gen7.h index c39bd4005f1..2a95b68a9bd 100644 --- a/src/vulkan/isl_gen7.h +++ b/src/vulkan/isl_gen7.h @@ -41,11 +41,11 @@ gen7_choose_msaa_layout(const struct isl_device *dev, enum isl_msaa_layout *msaa_layout); void -gen7_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el); +gen7_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el); #ifdef __cplusplus } diff --git a/src/vulkan/isl_gen8.c b/src/vulkan/isl_gen8.c index fe118cae000..2f434aabb2e 100644 --- a/src/vulkan/isl_gen8.c +++ b/src/vulkan/isl_gen8.c @@ -100,7 +100,7 @@ gen8_choose_msaa_layout(const struct isl_device *dev, } /** - * Choose horizontal LOD alignment, in units of surface elements. + * Choose horizontal subimage alignment, in units of surface elements. */ static uint32_t gen8_choose_halign_el(const struct isl_device *dev, @@ -154,7 +154,7 @@ gen8_choose_halign_el(const struct isl_device *dev, } /** - * Choose vertical LOD alignment, in units of surface elements. + * Choose vertical subimage alignment, in units of surface elements. */ static uint32_t gen8_choose_valign_el(const struct isl_device *dev, @@ -192,11 +192,11 @@ gen8_choose_valign_el(const struct isl_device *dev, } void -gen8_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el) +gen8_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el) { assert(!isl_tiling_is_std_y(tiling)); @@ -221,7 +221,7 @@ gen8_choose_lod_alignment_el(const struct isl_device *dev, * row.) */ - *lod_align_el = (struct isl_extent3d) { + *image_align_el = (struct isl_extent3d) { .w = gen8_choose_halign_el(dev, info), .h = gen8_choose_valign_el(dev, info), .d = 1, diff --git a/src/vulkan/isl_gen8.h b/src/vulkan/isl_gen8.h index 632d61936c1..2017ea8ddc1 100644 --- a/src/vulkan/isl_gen8.h +++ b/src/vulkan/isl_gen8.h @@ -36,11 +36,11 @@ gen8_choose_msaa_layout(const struct isl_device *dev, enum isl_msaa_layout *msaa_layout); void -gen8_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el); +gen8_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el); #ifdef __cplusplus } diff --git a/src/vulkan/isl_gen9.c b/src/vulkan/isl_gen9.c index 00634e4e54c..aa290aa1c35 100644 --- a/src/vulkan/isl_gen9.c +++ b/src/vulkan/isl_gen9.c @@ -26,15 +26,15 @@ #include "isl_priv.h" /** - * Calculate the LOD alignment, in units of surface samples, for the standard - * tiling formats Yf and Ys. + * Calculate the surface's subimage alignment, in units of surface samples, + * for the standard tiling formats Yf and Ys. */ static void -gen9_calc_std_lod_alignment_sa(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *align_sa) +gen9_calc_std_image_alignment_sa(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *align_sa) { const struct isl_format_layout *fmtl = isl_format_get_layout(info->format); @@ -97,11 +97,11 @@ gen9_calc_std_lod_alignment_sa(const struct isl_device *dev, } void -gen9_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el) +gen9_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el) { /* This BSpec text provides some insight into the hardware's alignment * requirements [Skylake BSpec > Memory Views > Common Surface Formats > @@ -150,11 +150,11 @@ gen9_choose_lod_alignment_el(const struct isl_device *dev, */ if (isl_tiling_is_std_y(tiling)) { - struct isl_extent3d lod_align_sa; - gen9_calc_std_lod_alignment_sa(dev, info, tiling, msaa_layout, - &lod_align_sa); + struct isl_extent3d image_align_sa; + gen9_calc_std_image_alignment_sa(dev, info, tiling, msaa_layout, + &image_align_sa); - *lod_align_el = isl_extent3d_sa_to_el(info->format, lod_align_sa); + *image_align_el = isl_extent3d_sa_to_el(info->format, image_align_sa); return; } @@ -162,7 +162,7 @@ gen9_choose_lod_alignment_el(const struct isl_device *dev, /* See the Skylake BSpec > Memory Views > Common Surface Formats > Surface * Layout and Tiling > 1D Surfaces > 1D Alignment Requirements. */ - *lod_align_el = isl_extent3d(64, 1, 1); + *image_align_el = isl_extent3d(64, 1, 1); return; } @@ -176,9 +176,10 @@ gen9_choose_lod_alignment_el(const struct isl_device *dev, * To avoid wasting memory, choose the smallest alignment possible: * HALIGN_4 and VALIGN_4. */ - *lod_align_el = isl_extent3d(4, 4, 1); + *image_align_el = isl_extent3d(4, 4, 1); return; } - gen8_choose_lod_alignment_el(dev, info, tiling, msaa_layout, lod_align_el); + gen8_choose_image_alignment_el(dev, info, tiling, msaa_layout, + image_align_el); } diff --git a/src/vulkan/isl_gen9.h b/src/vulkan/isl_gen9.h index 14252b6f70c..64ed0aa44ef 100644 --- a/src/vulkan/isl_gen9.h +++ b/src/vulkan/isl_gen9.h @@ -30,11 +30,11 @@ extern "C" { #endif void -gen9_choose_lod_alignment_el(const struct isl_device *dev, - const struct isl_surf_init_info *restrict info, - enum isl_tiling tiling, - enum isl_msaa_layout msaa_layout, - struct isl_extent3d *lod_align_el); +gen9_choose_image_alignment_el(const struct isl_device *dev, + const struct isl_surf_init_info *restrict info, + enum isl_tiling tiling, + enum isl_msaa_layout msaa_layout, + struct isl_extent3d *image_align_el); #ifdef __cplusplus }